{"version":3,"file":"local-data-mapping-tool.umd.js","sources":["../../../../../node_modules/react/cjs/react.production.min.js","../../../../../node_modules/react/index.js","../../../../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../../../node_modules/react/jsx-runtime.js","../../../../../node_modules/scheduler/cjs/scheduler.production.min.js","../../../../../node_modules/scheduler/index.js","../../../../../node_modules/react-dom/cjs/react-dom.production.min.js","../../../../../node_modules/react-dom/index.js","../../../../../node_modules/react-dom/client.js","../../../../../node_modules/@mui/material/colors/common.js","../../../../../node_modules/@mui/material/colors/red.js","../../../../../node_modules/@mui/material/colors/purple.js","../../../../../node_modules/@mui/material/colors/blue.js","../../../../../node_modules/@mui/material/colors/lightBlue.js","../../../../../node_modules/@mui/material/colors/green.js","../../../../../node_modules/@mui/material/colors/orange.js","../../../../../node_modules/@mui/material/colors/grey.js","../../../../../node_modules/@mui/utils/formatMuiErrorMessage/formatMuiErrorMessage.js","../../../../../node_modules/@mui/material/styles/identifier.js","../../../../../node_modules/@babel/runtime/helpers/esm/extends.js","../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../../node_modules/@babel/runtime/helpers/extends.js","../../../../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../../../../../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../../../../../node_modules/@emotion/cache/node_modules/stylis/src/Enum.js","../../../../../node_modules/@emotion/cache/node_modules/stylis/src/Utility.js","../../../../../node_modules/@emotion/cache/node_modules/stylis/src/Tokenizer.js","../../../../../node_modules/@emotion/cache/node_modules/stylis/src/Parser.js","../../../../../node_modules/@emotion/cache/node_modules/stylis/src/Serializer.js","../../../../../node_modules/@emotion/cache/node_modules/stylis/src/Middleware.js","../../../../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../../../../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../../../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../../../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../../../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../../../../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../../../../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../../../../../node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js","../../../../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../../../../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","../../../../../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","../../../../../node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js","../../../../../node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js","../../../../../node_modules/@mui/styled-engine/index.js","../../../../../node_modules/@mui/utils/deepmerge/deepmerge.js","../../../../../node_modules/@mui/system/esm/createTheme/createBreakpoints.js","../../../../../node_modules/@mui/system/esm/createTheme/shape.js","../../../../../node_modules/@mui/system/esm/merge.js","../../../../../node_modules/@mui/system/esm/breakpoints.js","../../../../../node_modules/@mui/utils/capitalize/capitalize.js","../../../../../node_modules/@mui/system/esm/style.js","../../../../../node_modules/@mui/system/esm/memoize.js","../../../../../node_modules/@mui/system/esm/spacing.js","../../../../../node_modules/@mui/system/esm/createTheme/createSpacing.js","../../../../../node_modules/@mui/system/esm/compose.js","../../../../../node_modules/@mui/system/esm/borders.js","../../../../../node_modules/@mui/system/esm/cssGrid.js","../../../../../node_modules/@mui/system/esm/palette.js","../../../../../node_modules/@mui/system/esm/sizing.js","../../../../../node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js","../../../../../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js","../../../../../node_modules/@mui/system/esm/createTheme/applyStyles.js","../../../../../node_modules/@mui/system/esm/createTheme/createTheme.js","../../../../../node_modules/@mui/system/esm/useThemeWithoutDefault.js","../../../../../node_modules/@mui/system/esm/useTheme.js","../../../../../node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js","../../../../../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../../../../../node_modules/@mui/utils/ClassNameGenerator/ClassNameGenerator.js","../../../../../node_modules/clsx/dist/clsx.mjs","../../../../../node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.js","../../../../../node_modules/@mui/utils/generateUtilityClasses/generateUtilityClasses.js","../../../../../node_modules/react-is/cjs/react-is.production.min.js","../../../../../node_modules/react-is/index.js","../../../../../node_modules/@mui/utils/getDisplayName/getDisplayName.js","../../../../../node_modules/@mui/system/esm/createStyled.js","../../../../../node_modules/@mui/system/esm/styled.js","../../../../../node_modules/@mui/utils/resolveProps/resolveProps.js","../../../../../node_modules/@mui/system/esm/useThemeProps/getThemeProps.js","../../../../../node_modules/@mui/system/esm/useThemeProps/useThemeProps.js","../../../../../node_modules/@mui/utils/useEnhancedEffect/useEnhancedEffect.js","../../../../../node_modules/@mui/utils/clamp/clamp.js","../../../../../node_modules/@mui/utils/createChainedFunction/createChainedFunction.js","../../../../../node_modules/@mui/utils/debounce/debounce.js","../../../../../node_modules/@mui/utils/isMuiElement/isMuiElement.js","../../../../../node_modules/@mui/utils/ownerDocument/ownerDocument.js","../../../../../node_modules/@mui/utils/ownerWindow/ownerWindow.js","../../../../../node_modules/@mui/utils/setRef/setRef.js","../../../../../node_modules/@mui/utils/useId/useId.js","../../../../../node_modules/@mui/utils/useControlled/useControlled.js","../../../../../node_modules/@mui/utils/useEventCallback/useEventCallback.js","../../../../../node_modules/@mui/utils/useForkRef/useForkRef.js","../../../../../node_modules/@mui/utils/useLazyRef/useLazyRef.js","../../../../../node_modules/@mui/utils/useOnMount/useOnMount.js","../../../../../node_modules/@mui/utils/useTimeout/useTimeout.js","../../../../../node_modules/@mui/utils/useIsFocusVisible/useIsFocusVisible.js","../../../../../node_modules/@mui/utils/getScrollbarSize/getScrollbarSize.js","../../../../../node_modules/@mui/utils/composeClasses/composeClasses.js","../../../../../node_modules/@mui/private-theming/useTheme/ThemeContext.js","../../../../../node_modules/@mui/private-theming/useTheme/useTheme.js","../../../../../node_modules/@mui/private-theming/ThemeProvider/nested.js","../../../../../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js","../../../../../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js","../../../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../../../../node_modules/@mui/system/esm/Stack/createStack.js","../../../../../node_modules/@mui/material/styles/createMixins.js","../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../../../../node_modules/@mui/system/colorManipulator.js","../../../../../node_modules/@mui/material/styles/createPalette.js","../../../../../node_modules/@mui/material/styles/createTypography.js","../../../../../node_modules/@mui/material/styles/shadows.js","../../../../../node_modules/@mui/material/styles/createTransitions.js","../../../../../node_modules/@mui/material/styles/zIndex.js","../../../../../node_modules/@mui/material/styles/createTheme.js","../../../../../node_modules/@mui/material/styles/defaultTheme.js","../../../../../node_modules/@mui/material/styles/useTheme.js","../../../../../node_modules/@mui/material/styles/useThemeProps.js","../../../../../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../../../../../node_modules/@mui/system/createStyled.js","../../../../../node_modules/@mui/material/styles/styled.js","../../../../../node_modules/@mui/material/styles/ThemeProvider.js","../../../../../node_modules/@mui/material/styles/getOverlayAlpha.js","../../../../../node_modules/@mui/material/SvgIcon/svgIconClasses.js","../../../../../node_modules/@mui/material/SvgIcon/SvgIcon.js","../../../../../node_modules/@mui/material/utils/createSvgIcon.js","../../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../../../node_modules/react-transition-group/esm/config.js","../../../../../node_modules/react-transition-group/esm/TransitionGroupContext.js","../../../../../node_modules/react-transition-group/esm/utils/reflow.js","../../../../../node_modules/react-transition-group/esm/Transition.js","../../../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../../../../node_modules/react-transition-group/esm/utils/ChildMapping.js","../../../../../node_modules/react-transition-group/esm/TransitionGroup.js","../../../../../node_modules/@mui/material/transitions/utils.js","../../../../../node_modules/@mui/material/Paper/paperClasses.js","../../../../../node_modules/@mui/material/Paper/Paper.js","../../../../../node_modules/@mui/base/utils/isHostComponent.js","../../../../../node_modules/@mui/base/utils/appendOwnerState.js","../../../../../node_modules/@mui/base/utils/extractEventHandlers.js","../../../../../node_modules/@mui/base/utils/resolveComponentProps.js","../../../../../node_modules/@mui/base/utils/omitEventHandlers.js","../../../../../node_modules/@mui/base/utils/mergeSlotProps.js","../../../../../node_modules/@mui/base/utils/useSlotProps.js","../../../../../node_modules/@mui/material/ButtonBase/Ripple.js","../../../../../node_modules/@mui/material/ButtonBase/touchRippleClasses.js","../../../../../node_modules/@mui/material/ButtonBase/TouchRipple.js","../../../../../node_modules/@mui/material/ButtonBase/buttonBaseClasses.js","../../../../../node_modules/@mui/material/ButtonBase/ButtonBase.js","../../../../../node_modules/@mui/material/Typography/typographyClasses.js","../../../../../node_modules/@mui/material/Typography/Typography.js","../../../../../node_modules/@mui/base/FocusTrap/FocusTrap.js","../../../../../node_modules/@mui/base/Portal/Portal.js","../../../../../node_modules/@mui/base/unstable_useModal/ModalManager.js","../../../../../node_modules/@mui/base/unstable_useModal/useModal.js","../../../../../node_modules/@mui/base/TextareaAutosize/TextareaAutosize.js","../../../../../node_modules/@mui/material/FormControl/formControlState.js","../../../../../node_modules/@mui/material/FormControl/FormControlContext.js","../../../../../node_modules/@mui/material/FormControl/useFormControl.js","../../../../../node_modules/@mui/material/GlobalStyles/GlobalStyles.js","../../../../../node_modules/@mui/material/InputBase/utils.js","../../../../../node_modules/@mui/material/InputBase/inputBaseClasses.js","../../../../../node_modules/@mui/material/InputBase/InputBase.js","../../../../../node_modules/@mui/material/Input/inputClasses.js","../../../../../node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js","../../../../../node_modules/@mui/material/FilledInput/filledInputClasses.js","../../../../../node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js","../../../../../node_modules/@mui/material/Fade/Fade.js","../../../../../node_modules/@mui/material/Backdrop/backdropClasses.js","../../../../../node_modules/@mui/material/Backdrop/Backdrop.js","../../../../../node_modules/@mui/material/internal/switchBaseClasses.js","../../../../../node_modules/@mui/material/internal/SwitchBase.js","../../../../../node_modules/@mui/material/Modal/modalClasses.js","../../../../../node_modules/@mui/material/Modal/Modal.js","../../../../../node_modules/@mui/material/Divider/dividerClasses.js","../../../../../node_modules/@mui/material/FilledInput/FilledInput.js","../../../../../node_modules/@mui/material/FormControl/formControlClasses.js","../../../../../node_modules/@mui/material/FormControl/FormControl.js","../../../../../node_modules/@mui/material/Stack/Stack.js","../../../../../node_modules/@mui/material/FormControlLabel/formControlLabelClasses.js","../../../../../node_modules/@mui/material/FormControlLabel/FormControlLabel.js","../../../../../node_modules/@mui/material/FormGroup/formGroupClasses.js","../../../../../node_modules/@mui/material/FormGroup/FormGroup.js","../../../../../node_modules/@mui/material/FormLabel/formLabelClasses.js","../../../../../node_modules/@mui/material/FormLabel/FormLabel.js","../../../../../node_modules/@mui/material/Grow/Grow.js","../../../../../node_modules/@mui/material/Input/Input.js","../../../../../node_modules/@mui/material/InputLabel/inputLabelClasses.js","../../../../../node_modules/@mui/material/InputLabel/InputLabel.js","../../../../../node_modules/@mui/material/List/ListContext.js","../../../../../node_modules/@mui/material/List/listClasses.js","../../../../../node_modules/@mui/material/List/List.js","../../../../../node_modules/@mui/material/ListItemIcon/listItemIconClasses.js","../../../../../node_modules/@mui/material/ListItemText/listItemTextClasses.js","../../../../../node_modules/@mui/material/MenuList/MenuList.js","../../../../../node_modules/@mui/material/Popover/popoverClasses.js","../../../../../node_modules/@mui/material/Popover/Popover.js","../../../../../node_modules/@mui/material/Menu/menuClasses.js","../../../../../node_modules/@mui/material/Menu/Menu.js","../../../../../node_modules/@mui/material/MenuItem/menuItemClasses.js","../../../../../node_modules/@mui/material/MenuItem/MenuItem.js","../../../../../node_modules/@mui/material/NativeSelect/nativeSelectClasses.js","../../../../../node_modules/@mui/material/NativeSelect/NativeSelectInput.js","../../../../../node_modules/@mui/material/OutlinedInput/NotchedOutline.js","../../../../../node_modules/@mui/material/OutlinedInput/OutlinedInput.js","../../../../../node_modules/@mui/material/internal/svg-icons/RadioButtonUnchecked.js","../../../../../node_modules/@mui/material/internal/svg-icons/RadioButtonChecked.js","../../../../../node_modules/@mui/material/Radio/RadioButtonIcon.js","../../../../../node_modules/@mui/material/RadioGroup/RadioGroupContext.js","../../../../../node_modules/@mui/material/RadioGroup/useRadioGroup.js","../../../../../node_modules/@mui/material/Radio/radioClasses.js","../../../../../node_modules/@mui/material/Radio/Radio.js","../../../../../node_modules/@mui/material/RadioGroup/RadioGroup.js","../../../../../node_modules/@mui/material/Select/selectClasses.js","../../../../../node_modules/@mui/material/Select/SelectInput.js","../../../../../node_modules/@mui/material/Select/Select.js","../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../../../../node_modules/use-sync-external-store/shim/index.js","../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../../../../node_modules/use-sync-external-store/shim/with-selector.js","../../../../../node_modules/react-redux/es/utils/batch.js","../../../../../node_modules/react-redux/es/components/Context.js","../../../../../node_modules/react-redux/es/hooks/useReduxContext.js","../../../../../node_modules/react-redux/es/hooks/useSelector.js","../../../../../node_modules/react-redux/es/utils/useSyncExternalStore.js","../../../../../node_modules/react-redux/es/utils/Subscription.js","../../../../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","../../../../../node_modules/react-redux/es/utils/shallowEqual.js","../../../../../node_modules/react-redux/es/components/Provider.js","../../../../../node_modules/react-redux/es/hooks/useStore.js","../../../../../node_modules/react-redux/es/hooks/useDispatch.js","../../../../../node_modules/react-redux/es/index.js","../../../../../www/local-data-mapping-tool/app/react/configs/tools.configs.ts","../../../../../www/local-data-mapping-tool/app/react/components/Images/ToolTableIcon.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Images/ToolChartIcon.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Images/ToolMapIcon.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarMapDisableContainer/SidebarMapDisableContainer.tsx","../../../../../node_modules/immer/dist/immer.esm.mjs","../../../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../../../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../../../../node_modules/redux/es/redux.js","../../../../../node_modules/reselect/es/defaultMemoize.js","../../../../../node_modules/reselect/es/index.js","../../../../../node_modules/redux-thunk/es/index.js","../../../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js","../../../../../node_modules/lodash/_freeGlobal.js","../../../../../node_modules/lodash/_root.js","../../../../../node_modules/lodash/_Symbol.js","../../../../../node_modules/lodash/_getRawTag.js","../../../../../node_modules/lodash/_objectToString.js","../../../../../node_modules/lodash/_baseGetTag.js","../../../../../node_modules/lodash/isObject.js","../../../../../node_modules/lodash/isFunction.js","../../../../../node_modules/lodash/_coreJsData.js","../../../../../node_modules/lodash/_isMasked.js","../../../../../node_modules/lodash/_toSource.js","../../../../../node_modules/lodash/_baseIsNative.js","../../../../../node_modules/lodash/_getValue.js","../../../../../node_modules/lodash/_getNative.js","../../../../../node_modules/lodash/_defineProperty.js","../../../../../node_modules/lodash/_baseAssignValue.js","../../../../../node_modules/lodash/_arrayAggregator.js","../../../../../node_modules/lodash/_createBaseFor.js","../../../../../node_modules/lodash/_baseFor.js","../../../../../node_modules/lodash/_baseTimes.js","../../../../../node_modules/lodash/isObjectLike.js","../../../../../node_modules/lodash/_baseIsArguments.js","../../../../../node_modules/lodash/isArguments.js","../../../../../node_modules/lodash/isArray.js","../../../../../node_modules/lodash/stubFalse.js","../../../../../node_modules/lodash/isBuffer.js","../../../../../node_modules/lodash/_isIndex.js","../../../../../node_modules/lodash/isLength.js","../../../../../node_modules/lodash/_baseIsTypedArray.js","../../../../../node_modules/lodash/_baseUnary.js","../../../../../node_modules/lodash/_nodeUtil.js","../../../../../node_modules/lodash/isTypedArray.js","../../../../../node_modules/lodash/_arrayLikeKeys.js","../../../../../node_modules/lodash/_isPrototype.js","../../../../../node_modules/lodash/_overArg.js","../../../../../node_modules/lodash/_nativeKeys.js","../../../../../node_modules/lodash/_baseKeys.js","../../../../../node_modules/lodash/isArrayLike.js","../../../../../node_modules/lodash/keys.js","../../../../../node_modules/lodash/_baseForOwn.js","../../../../../node_modules/lodash/_createBaseEach.js","../../../../../node_modules/lodash/_baseEach.js","../../../../../node_modules/lodash/_baseAggregator.js","../../../../../node_modules/lodash/_listCacheClear.js","../../../../../node_modules/lodash/eq.js","../../../../../node_modules/lodash/_assocIndexOf.js","../../../../../node_modules/lodash/_listCacheDelete.js","../../../../../node_modules/lodash/_listCacheGet.js","../../../../../node_modules/lodash/_listCacheHas.js","../../../../../node_modules/lodash/_listCacheSet.js","../../../../../node_modules/lodash/_ListCache.js","../../../../../node_modules/lodash/_stackClear.js","../../../../../node_modules/lodash/_stackDelete.js","../../../../../node_modules/lodash/_stackGet.js","../../../../../node_modules/lodash/_stackHas.js","../../../../../node_modules/lodash/_Map.js","../../../../../node_modules/lodash/_nativeCreate.js","../../../../../node_modules/lodash/_hashClear.js","../../../../../node_modules/lodash/_hashDelete.js","../../../../../node_modules/lodash/_hashGet.js","../../../../../node_modules/lodash/_hashHas.js","../../../../../node_modules/lodash/_hashSet.js","../../../../../node_modules/lodash/_Hash.js","../../../../../node_modules/lodash/_mapCacheClear.js","../../../../../node_modules/lodash/_isKeyable.js","../../../../../node_modules/lodash/_getMapData.js","../../../../../node_modules/lodash/_mapCacheDelete.js","../../../../../node_modules/lodash/_mapCacheGet.js","../../../../../node_modules/lodash/_mapCacheHas.js","../../../../../node_modules/lodash/_mapCacheSet.js","../../../../../node_modules/lodash/_MapCache.js","../../../../../node_modules/lodash/_stackSet.js","../../../../../node_modules/lodash/_Stack.js","../../../../../node_modules/lodash/_setCacheAdd.js","../../../../../node_modules/lodash/_setCacheHas.js","../../../../../node_modules/lodash/_SetCache.js","../../../../../node_modules/lodash/_arraySome.js","../../../../../node_modules/lodash/_cacheHas.js","../../../../../node_modules/lodash/_equalArrays.js","../../../../../node_modules/lodash/_Uint8Array.js","../../../../../node_modules/lodash/_mapToArray.js","../../../../../node_modules/lodash/_setToArray.js","../../../../../node_modules/lodash/_equalByTag.js","../../../../../node_modules/lodash/_arrayPush.js","../../../../../node_modules/lodash/_baseGetAllKeys.js","../../../../../node_modules/lodash/_arrayFilter.js","../../../../../node_modules/lodash/stubArray.js","../../../../../node_modules/lodash/_getSymbols.js","../../../../../node_modules/lodash/_getAllKeys.js","../../../../../node_modules/lodash/_equalObjects.js","../../../../../node_modules/lodash/_DataView.js","../../../../../node_modules/lodash/_Promise.js","../../../../../node_modules/lodash/_Set.js","../../../../../node_modules/lodash/_WeakMap.js","../../../../../node_modules/lodash/_getTag.js","../../../../../node_modules/lodash/_baseIsEqualDeep.js","../../../../../node_modules/lodash/_baseIsEqual.js","../../../../../node_modules/lodash/_baseIsMatch.js","../../../../../node_modules/lodash/_isStrictComparable.js","../../../../../node_modules/lodash/_getMatchData.js","../../../../../node_modules/lodash/_matchesStrictComparable.js","../../../../../node_modules/lodash/_baseMatches.js","../../../../../node_modules/lodash/isSymbol.js","../../../../../node_modules/lodash/_isKey.js","../../../../../node_modules/lodash/memoize.js","../../../../../node_modules/lodash/_memoizeCapped.js","../../../../../node_modules/lodash/_stringToPath.js","../../../../../node_modules/lodash/_arrayMap.js","../../../../../node_modules/lodash/_baseToString.js","../../../../../node_modules/lodash/toString.js","../../../../../node_modules/lodash/_castPath.js","../../../../../node_modules/lodash/_toKey.js","../../../../../node_modules/lodash/_baseGet.js","../../../../../node_modules/lodash/get.js","../../../../../node_modules/lodash/_baseHasIn.js","../../../../../node_modules/lodash/_hasPath.js","../../../../../node_modules/lodash/hasIn.js","../../../../../node_modules/lodash/_baseMatchesProperty.js","../../../../../node_modules/lodash/identity.js","../../../../../node_modules/lodash/_baseProperty.js","../../../../../node_modules/lodash/_basePropertyDeep.js","../../../../../node_modules/lodash/property.js","../../../../../node_modules/lodash/_baseIteratee.js","../../../../../node_modules/lodash/_createAggregator.js","../../../../../node_modules/lodash/keyBy.js","../../../../../www/local-data-mapping-tool/app/react/configs/attributeFields.configs.ts","../../../../../www/local-data-mapping-tool/app/react/configs/map.configs.ts","../../../../../node_modules/chroma-js/chroma.js","../../../../../node_modules/lodash/_baseRange.js","../../../../../node_modules/lodash/_isIterateeCall.js","../../../../../node_modules/lodash/_trimmedEndIndex.js","../../../../../node_modules/lodash/_baseTrim.js","../../../../../node_modules/lodash/toNumber.js","../../../../../node_modules/lodash/toFinite.js","../../../../../node_modules/lodash/_createRange.js","../../../../../node_modules/lodash/range.js","../../../../../www/local-data-mapping-tool/app/react/configs/mapColor.configs.ts","../../../../../www/local-data-mapping-tool/app/react/configs/mapRendererClassificationMethods.configs.ts","../../../../../www/local-data-mapping-tool/app/react/store/slices/sidebarMapFiltersSlice.ts","../../../../../www/local-data-mapping-tool/app/react/configs/muiStyling.config.ts","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarMapFiltersType/SidebarMapFiltersField.tsx","../../../../../www/local-data-mapping-tool/app/react/store/slices/admin2ToolsSlice.ts","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Tools/Admin2Tools.tsx","../../../../../www/local-data-mapping-tool/app/react/components/DownloadIcon.tsx","../../../../../www/local-data-mapping-tool/app/react/configs/indicators.config.ts","../../../../../www/local-data-mapping-tool/app/react/store/slices/admin2EstimatesSlice.ts","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Filters/Admin2Filters.tsx","../../../../../node_modules/lodash/_baseMap.js","../../../../../node_modules/lodash/_baseSortBy.js","../../../../../node_modules/lodash/_compareAscending.js","../../../../../node_modules/lodash/_compareMultiple.js","../../../../../node_modules/lodash/_baseOrderBy.js","../../../../../node_modules/lodash/orderBy.js","../../../../../node_modules/react-data-grid/lib/bundle.js","../../../../../node_modules/@arcgis/core/chunks/tslib.es6.js","../../../../../node_modules/@arcgis/core/core/has.js","../../../../../node_modules/@arcgis/core/core/RandomLCG.js","../../../../../node_modules/@arcgis/core/core/arrayUtils.js","../../../../../node_modules/@arcgis/core/core/byteSizeEstimations.js","../../../../../node_modules/@arcgis/core/core/typedArrayUtil.js","../../../../../node_modules/@arcgis/core/core/lang.js","../../../../../node_modules/@arcgis/core/core/object.js","../../../../../node_modules/@arcgis/core/config.js","../../../../../node_modules/@arcgis/core/core/string.js","../../../../../node_modules/@arcgis/core/core/Logger.js","../../../../../node_modules/@arcgis/core/core/MapUtils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/ensureType.js","../../../../../node_modules/@arcgis/core/core/handleUtils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/utils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/get.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/metadata.js","../../../../../node_modules/@arcgis/core/core/Message.js","../../../../../node_modules/@arcgis/core/core/Error.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/set.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/property.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/beforeDestroy.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/interfaces.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/tracking/Flags.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/tracking.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/extensions/serializableProperty/originAliases.js","../../../../../node_modules/@arcgis/core/core/Warning.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/extensions/serializableProperty/type.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/extensions/serializableProperty/reader.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/extensions/serializableProperty/shorthands.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/extensions/serializableProperty/writer.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/extensions/serializableProperty.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/subclass.js","../../../../../node_modules/@arcgis/core/core/deprecate.js","../../../../../node_modules/@arcgis/core/core/iteratorUtils.js","../../../../../node_modules/@arcgis/core/core/Handles.js","../../../../../node_modules/@arcgis/core/core/maybe.js","../../../../../node_modules/@arcgis/core/core/ObjectPool.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/tracking/ObservationHandle.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/ObservableBase.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/PropertyOrigin.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/Property.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/Store.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/Properties.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/testSupport.js","../../../../../node_modules/@arcgis/core/core/ArrayPool.js","../../../../../node_modules/@arcgis/core/core/ReentrantObjectPool.js","../../../../../node_modules/@arcgis/core/core/nextTick.js","../../../../../node_modules/@arcgis/core/core/PerformanceSampler.js","../../../../../node_modules/@arcgis/core/core/HeapSort.js","../../../../../node_modules/@arcgis/core/core/PooledArray.js","../../../../../node_modules/@arcgis/core/core/clock.js","../../../../../node_modules/@arcgis/core/core/events.js","../../../../../node_modules/@arcgis/core/core/promiseUtils.js","../../../../../node_modules/@arcgis/core/core/time.js","../../../../../node_modules/@arcgis/core/core/scheduling.js","../../../../../node_modules/@arcgis/core/core/SetUtils.js","../../../../../node_modules/@arcgis/core/core/uid.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/tracking/SimpleTrackingTarget.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/trackingUtils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/watch.js","../../../../../node_modules/@arcgis/core/core/Accessor.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/DefaultsStore.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/defaultsStoreUtils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/read.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/write.js","../../../../../node_modules/@arcgis/core/core/JSONSupport.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/reader.js","../../../../../node_modules/@arcgis/core/core/jsonMap.js","../../../../../node_modules/@arcgis/core/geometry/support/Ellipsoid.js","../../../../../node_modules/@arcgis/core/portal/support/urlUtils.js","../../../../../node_modules/@arcgis/core/support/base64Utils.js","../../../../../node_modules/@arcgis/core/core/urlUtils.js","../../../../../node_modules/@arcgis/core/support/revision.js","../../../../../node_modules/@arcgis/core/kernel.js","../../../../../node_modules/@arcgis/core/support/apiKeyUtils.js","../../../../../node_modules/@arcgis/core/support/requestUtils.js","../../../../../node_modules/@arcgis/core/request.js","../../../../../node_modules/@arcgis/core/assets.js","../../../../../node_modules/@arcgis/core/chunks/pe.js","../../../../../node_modules/@arcgis/core/geometry/support/SupportedGCSWkids.js","../../../../../node_modules/@arcgis/core/geometry/support/WKIDUnitConversion.js","../../../../../node_modules/@arcgis/core/geometry/support/spatialReferenceUtils.js","../../../../../node_modules/@arcgis/core/geometry/ellipsoidUtils.js","../../../../../node_modules/@arcgis/core/core/unitUtils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/writer.js","../../../../../node_modules/@arcgis/core/geometry/SpatialReference.js","../../../../../node_modules/@arcgis/core/geometry/Geometry.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/cast.js","../../../../../node_modules/@arcgis/core/geometry/support/pointUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/webMercatorUtils.js","../../../../../node_modules/@arcgis/core/geometry/Point.js","../../../../../node_modules/@arcgis/core/geometry/support/contains.js","../../../../../node_modules/@arcgis/core/geometry/support/intersectsBase.js","../../../../../node_modules/@arcgis/core/geometry/Extent.js","../../../../../node_modules/@arcgis/core/geometry/support/zmUtils.js","../../../../../node_modules/@arcgis/core/geometry/Multipoint.js","../../../../../node_modules/@arcgis/core/geometry/geometryCursorCollectUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/Axis.js","../../../../../node_modules/@arcgis/core/geometry/support/coordsUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/centroid.js","../../../../../node_modules/@arcgis/core/chunks/vec3f64.js","../../../../../node_modules/@arcgis/core/chunks/common.js","../../../../../node_modules/@arcgis/core/chunks/vec3.js","../../../../../node_modules/@arcgis/core/chunks/vec4.js","../../../../../node_modules/@arcgis/core/core/mathUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/aaBoundingRect.js","../../../../../node_modules/@arcgis/core/geometry/support/boundsUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/extentUtils.js","../../../../../node_modules/@arcgis/core/geometry/Polygon.js","../../../../../node_modules/@arcgis/core/geometry/Polyline.js","../../../../../node_modules/@arcgis/core/geometry/support/typeUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/jsonUtils.js","../../../../../node_modules/@arcgis/core/geometry.js","../../../../../node_modules/@arcgis/core/core/Clonable.js","../../../../../node_modules/@arcgis/core/core/Evented.js","../../../../../node_modules/@arcgis/core/core/ObservableChangesType.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/shared.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/tracking/SimpleObservable.js","../../../../../node_modules/@arcgis/core/core/Collection.js","../../../../../node_modules/@arcgis/core/core/sql.js","../../../../../node_modules/@arcgis/core/widgets/support/dataUtils.js","../../../../../node_modules/@arcgis/core/intl/locale.js","../../../../../node_modules/@arcgis/core/time/legacyTimeZoneMap.js","../../../../../node_modules/luxon/src/errors.js","../../../../../node_modules/luxon/src/impl/formats.js","../../../../../node_modules/luxon/src/zone.js","../../../../../node_modules/luxon/src/zones/systemZone.js","../../../../../node_modules/luxon/src/zones/IANAZone.js","../../../../../node_modules/luxon/src/impl/locale.js","../../../../../node_modules/luxon/src/zones/fixedOffsetZone.js","../../../../../node_modules/luxon/src/zones/invalidZone.js","../../../../../node_modules/luxon/src/impl/zoneUtil.js","../../../../../node_modules/luxon/src/settings.js","../../../../../node_modules/luxon/src/impl/invalid.js","../../../../../node_modules/luxon/src/impl/conversions.js","../../../../../node_modules/luxon/src/impl/util.js","../../../../../node_modules/luxon/src/impl/english.js","../../../../../node_modules/luxon/src/impl/formatter.js","../../../../../node_modules/luxon/src/impl/regexParser.js","../../../../../node_modules/luxon/src/duration.js","../../../../../node_modules/luxon/src/interval.js","../../../../../node_modules/luxon/src/info.js","../../../../../node_modules/luxon/src/impl/diff.js","../../../../../node_modules/luxon/src/impl/digits.js","../../../../../node_modules/luxon/src/impl/tokenParser.js","../../../../../node_modules/luxon/src/datetime.js","../../../../../node_modules/@arcgis/core/time/timeZoneUtils.js","../../../../../node_modules/@arcgis/core/intl/date.js","../../../../../node_modules/@arcgis/core/intl/number.js","../../../../../node_modules/@arcgis/core/intl/substitute.js","../../../../../node_modules/@arcgis/core/intl/messages.js","../../../../../node_modules/@arcgis/core/intl/t9n.js","../../../../../node_modules/@arcgis/core/intl.js","../../../../../node_modules/@arcgis/core/widgets/support/dateUtils.js","../../../../../node_modules/@arcgis/core/layers/support/domainUtils.js","../../../../../node_modules/@arcgis/core/support/arcadeOnDemand.js","../../../../../node_modules/@arcgis/core/layers/support/fieldUtils.js","../../../../../node_modules/@arcgis/core/popup/content/Content.js","../../../../../node_modules/@arcgis/core/popup/content/AttachmentsContent.js","../../../../../node_modules/@arcgis/core/popup/content/CustomContent.js","../../../../../node_modules/@arcgis/core/popup/ElementExpressionInfo.js","../../../../../node_modules/@arcgis/core/popup/content/ExpressionContent.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/enumeration.js","../../../../../node_modules/@arcgis/core/popup/support/FieldInfoFormat.js","../../../../../node_modules/@arcgis/core/popup/FieldInfo.js","../../../../../node_modules/@arcgis/core/popup/content/FieldsContent.js","../../../../../node_modules/@arcgis/core/popup/content/mixins/MediaInfo.js","../../../../../node_modules/@arcgis/core/colorUtils.js","../../../../../node_modules/@arcgis/core/Color.js","../../../../../node_modules/@arcgis/core/popup/content/support/ChartMediaInfoValueSeries.js","../../../../../node_modules/@arcgis/core/popup/content/support/ChartMediaInfoValue.js","../../../../../node_modules/@arcgis/core/popup/content/mixins/ChartMediaInfo.js","../../../../../node_modules/@arcgis/core/popup/content/support/chartMediaInfoUtils.js","../../../../../node_modules/@arcgis/core/popup/content/BarChartMediaInfo.js","../../../../../node_modules/@arcgis/core/popup/content/ColumnChartMediaInfo.js","../../../../../node_modules/@arcgis/core/popup/content/support/ImageMediaInfoValue.js","../../../../../node_modules/@arcgis/core/popup/content/ImageMediaInfo.js","../../../../../node_modules/@arcgis/core/popup/content/LineChartMediaInfo.js","../../../../../node_modules/@arcgis/core/popup/content/PieChartMediaInfo.js","../../../../../node_modules/@arcgis/core/popup/content/support/mediaInfoTypes.js","../../../../../node_modules/@arcgis/core/popup/content/MediaContent.js","../../../../../node_modules/@arcgis/core/popup/support/RelatedRecordsInfoFieldOrder.js","../../../../../node_modules/@arcgis/core/popup/content/RelationshipContent.js","../../../../../node_modules/@arcgis/core/popup/content/TextContent.js","../../../../../node_modules/@arcgis/core/popup/content.js","../../../../../node_modules/@arcgis/core/popup/ExpressionInfo.js","../../../../../node_modules/@arcgis/core/popup/LayerOptions.js","../../../../../node_modules/@arcgis/core/popup/RelatedRecordsInfo.js","../../../../../node_modules/@arcgis/core/core/Identifiable.js","../../../../../node_modules/@arcgis/core/support/actions/ActionBase.js","../../../../../node_modules/@arcgis/core/support/actions/ActionButton.js","../../../../../node_modules/@arcgis/core/support/actions/ActionToggle.js","../../../../../node_modules/@arcgis/core/PopupTemplate.js","../../../../../node_modules/@arcgis/core/symbols/Symbol.js","../../../../../node_modules/@arcgis/core/symbols/CIMSymbol.js","../../../../../node_modules/@arcgis/core/symbols/Symbol3DLayer.js","../../../../../node_modules/@arcgis/core/core/screenUtils.js","../../../../../node_modules/@arcgis/core/webdoc/support/opacityUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/materialUtils.js","../../../../../node_modules/@arcgis/core/symbols/edges/Edges3D.js","../../../../../node_modules/@arcgis/core/symbols/edges/SketchEdges3D.js","../../../../../node_modules/@arcgis/core/symbols/edges/SolidEdges3D.js","../../../../../node_modules/@arcgis/core/symbols/edges/utils.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DMaterial.js","../../../../../node_modules/@arcgis/core/symbols/ExtrudeSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/LineSymbol.js","../../../../../node_modules/@arcgis/core/symbols/support/lineMarkers.js","../../../../../node_modules/@arcgis/core/symbols/LineSymbolMarker.js","../../../../../node_modules/@arcgis/core/symbols/SimpleLineSymbol.js","../../../../../node_modules/@arcgis/core/symbols/FillSymbol.js","../../../../../node_modules/@arcgis/core/symbols/patterns/LinePattern3D.js","../../../../../node_modules/@arcgis/core/symbols/patterns/lineStyles.js","../../../../../node_modules/@arcgis/core/symbols/patterns/LineStylePattern3D.js","../../../../../node_modules/@arcgis/core/symbols/patterns/Pattern3D.js","../../../../../node_modules/@arcgis/core/symbols/patterns/styles.js","../../../../../node_modules/@arcgis/core/symbols/patterns/StylePattern3D.js","../../../../../node_modules/@arcgis/core/symbols/patterns/utils.js","../../../../../node_modules/@arcgis/core/symbols/support/colors.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DFillMaterial.js","../../../../../node_modules/@arcgis/core/geometry/support/aaBoundingBox.js","../../../../../node_modules/@arcgis/core/symbols/support/symbolLayerUtils3D.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DOutline.js","../../../../../node_modules/@arcgis/core/symbols/FillSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/support/textUtils.js","../../../../../node_modules/@arcgis/core/symbols/Font.js","../../../../../node_modules/@arcgis/core/chunks/persistableUrlUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/IconSymbol3DLayerResource.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DAnchorPosition2D.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DIconOutline.js","../../../../../node_modules/@arcgis/core/symbols/IconSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/core/collectionUtils.js","../../../../../node_modules/@arcgis/core/core/Promise.js","../../../../../node_modules/@arcgis/core/core/Loadable.js","../../../../../node_modules/@arcgis/core/portal/portalDefault.js","../../../../../node_modules/@arcgis/core/portal/PortalQueryParams.js","../../../../../node_modules/@arcgis/core/portal/PortalGroup.js","../../../../../node_modules/@arcgis/core/portal/PortalQueryResult.js","../../../../../node_modules/@arcgis/core/portal/PortalFolder.js","../../../../../node_modules/@arcgis/core/portal/PortalUser.js","../../../../../node_modules/@arcgis/core/portal/Portal.js","../../../../../node_modules/@arcgis/core/symbols/LineStyleMarker3D.js","../../../../../node_modules/@arcgis/core/symbols/LineSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/support/ObjectSymbol3DLayerResource.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DAnchorPosition3D.js","../../../../../node_modules/@arcgis/core/symbols/ObjectSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/PathSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DHalo.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DTextBackground.js","../../../../../node_modules/@arcgis/core/symbols/TextSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/WaterSymbol3DLayer.js","../../../../../node_modules/@arcgis/core/symbols/support/StyleOrigin.js","../../../../../node_modules/@arcgis/core/symbols/support/Thumbnail.js","../../../../../node_modules/@arcgis/core/symbols/Symbol3D.js","../../../../../node_modules/@arcgis/core/symbols/callouts/Callout3D.js","../../../../../node_modules/@arcgis/core/symbols/callouts/LineCallout3DBorder.js","../../../../../node_modules/@arcgis/core/symbols/callouts/LineCallout3D.js","../../../../../node_modules/@arcgis/core/symbols/callouts/calloutUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/Symbol3DVerticalOffset.js","../../../../../node_modules/@arcgis/core/symbols/LabelSymbol3D.js","../../../../../node_modules/@arcgis/core/symbols/LineSymbol3D.js","../../../../../node_modules/@arcgis/core/symbols/MarkerSymbol.js","../../../../../node_modules/@arcgis/core/symbols/MeshSymbol3D.js","../../../../../node_modules/@arcgis/core/symbols/support/urlUtils.js","../../../../../node_modules/@arcgis/core/symbols/PictureFillSymbol.js","../../../../../node_modules/@arcgis/core/symbols/PictureMarkerSymbol.js","../../../../../node_modules/@arcgis/core/symbols/PointSymbol3D.js","../../../../../node_modules/@arcgis/core/core/asyncUtils.js","../../../../../node_modules/@arcgis/core/core/reactiveUtils.js","../../../../../node_modules/@arcgis/core/symbols/PolygonSymbol3D.js","../../../../../node_modules/@arcgis/core/symbols/SimpleFillSymbol.js","../../../../../node_modules/@arcgis/core/symbols/SimpleMarkerSymbol.js","../../../../../node_modules/@arcgis/core/symbols/TextSymbol.js","../../../../../node_modules/@arcgis/core/symbols/WebStyleSymbol.js","../../../../../node_modules/@arcgis/core/symbols.js","../../../../../node_modules/@arcgis/core/Graphic.js","../../../../../node_modules/@arcgis/core/core/loadAll.js","../../../../../node_modules/@arcgis/core/portal/PortalItemResource.js","../../../../../node_modules/@arcgis/core/portal/PortalRating.js","../../../../../node_modules/@arcgis/core/portal/PortalItem.js","../../../../../node_modules/@arcgis/core/support/basemapDefinitions.js","../../../../../node_modules/@arcgis/core/support/BasemapStyle.js","../../../../../node_modules/@arcgis/core/layers/support/layerUtils.js","../../../../../node_modules/@arcgis/core/webdoc/support/writeUtils.js","../../../../../node_modules/@arcgis/core/Basemap.js","../../../../../node_modules/@arcgis/core/core/compilerUtils.js","../../../../../node_modules/@arcgis/core/ground/NavigationConstraint.js","../../../../../node_modules/@arcgis/core/Ground.js","../../../../../node_modules/@arcgis/core/core/CollectionFlattener.js","../../../../../node_modules/@arcgis/core/layers/support/infoFor3D.js","../../../../../node_modules/@arcgis/core/layers/support/editableLayers.js","../../../../../node_modules/@arcgis/core/chunks/mat4f32.js","../../../../../node_modules/@arcgis/core/chunks/mat4.js","../../../../../node_modules/@arcgis/core/layers/effects/colorMatrixFunctions.js","../../../../../node_modules/@arcgis/core/layers/effects/effects.js","../../../../../node_modules/@arcgis/core/layers/effects/utils.js","../../../../../node_modules/@arcgis/core/support/basemapUtils.js","../../../../../node_modules/@arcgis/core/support/collectionUtils.js","../../../../../node_modules/@arcgis/core/support/groundUtils.js","../../../../../node_modules/@arcgis/core/layers/support/fromPortalItem.js","../../../../../node_modules/@arcgis/core/layers/Layer.js","../../../../../node_modules/@arcgis/core/support/LayersMixin.js","../../../../../node_modules/@arcgis/core/support/TablesMixin.js","../../../../../node_modules/@arcgis/core/Map.js","../../../../../node_modules/@arcgis/core/core/Cyclical.js","../../../../../node_modules/@arcgis/core/Camera.js","../../../../../node_modules/@arcgis/core/Viewpoint.js","../../../../../node_modules/@arcgis/core/core/Queue.js","../../../../../node_modules/@arcgis/core/core/workers/connectionRegistry.js","../../../../../node_modules/@arcgis/core/core/workers/registry.js","../../../../../node_modules/@arcgis/core/core/workers/utils.js","../../../../../node_modules/@arcgis/core/core/workers/RemoteClient.js","../../../../../node_modules/@arcgis/core/core/workers/Connection.js","../../../../../node_modules/@arcgis/core/core/workers/staticWorkerMessages.js","../../../../../node_modules/@arcgis/core/core/workers/loaderConfig.js","../../../../../node_modules/@arcgis/core/core/workers/WorkerFallback.js","../../../../../node_modules/@arcgis/core/core/workers/workerFactory.js","../../../../../node_modules/@arcgis/core/core/workers/WorkerOwner.js","../../../../../node_modules/@arcgis/core/core/workers/workers.js","../../../../../node_modules/@arcgis/core/geometry/support/geodesicConstants.js","../../../../../node_modules/@arcgis/core/geometry/projection/projectors.js","../../../../../node_modules/@arcgis/core/geometry/projection/projectBuffer.js","../../../../../node_modules/@arcgis/core/geometry/projection/projectXYZToVector.js","../../../../../node_modules/@arcgis/core/geometry/support/GeographicTransformationStep.js","../../../../../node_modules/@arcgis/core/geometry/support/GeographicTransformation.js","../../../../../node_modules/@arcgis/core/geometry/support/zscale.js","../../../../../node_modules/@arcgis/core/geometry/projection.js","../../../../../node_modules/@arcgis/core/layers/support/LOD.js","../../../../../node_modules/@arcgis/core/layers/support/TileKey.js","../../../../../node_modules/@arcgis/core/layers/support/TileInfo.js","../../../../../node_modules/@arcgis/core/views/BreakpointsOwner.js","../../../../../node_modules/@arcgis/core/core/domUtils.js","../../../../../node_modules/@arcgis/core/core/support/UpdatingHandles.js","../../../../../node_modules/@esri/arcgis-html-sanitizer/dist/esm/index.js","../../../../../node_modules/@arcgis/core/widgets/support/vnodeCache.js","../../../../../node_modules/@arcgis/core/widgets/support/widgetUtils.js","../../../../../node_modules/@arcgis/core/libs/maquette/projection.js","../../../../../node_modules/@arcgis/core/libs/maquette/dom.js","../../../../../node_modules/@arcgis/core/libs/maquette/projector.js","../../../../../node_modules/@arcgis/core/views/overlay/ViewOverlay.js","../../../../../node_modules/@arcgis/core/views/DOMContainer.js","../../../../../node_modules/@arcgis/core/views/3d/support/PropertiesPool.js","../../../../../node_modules/@arcgis/core/views/input/keys.js","../../../../../node_modules/@arcgis/core/views/input/EventMatch.js","../../../../../node_modules/@arcgis/core/views/input/InputHandler.js","../../../../../node_modules/@arcgis/core/views/input/handlers/LatestPointer.js","../../../../../node_modules/@arcgis/core/core/signal.js","../../../../../node_modules/@arcgis/core/views/input/handlers/MultiTouch.js","../../../../../node_modules/@arcgis/core/views/input/InputManager.js","../../../../../node_modules/@arcgis/core/views/PopupView.js","../../../../../node_modules/@arcgis/core/core/timeUtils.js","../../../../../node_modules/@arcgis/core/TimeExtent.js","../../../../../node_modules/@arcgis/core/core/support/OwningCollection.js","../../../../../node_modules/@arcgis/core/geometry/HeightModelInfo.js","../../../../../node_modules/@arcgis/core/support/AnalysesCollection.js","../../../../../node_modules/@arcgis/core/support/GraphicsCollection.js","../../../../../node_modules/@arcgis/core/views/BasemapView.js","../../../../../node_modules/@arcgis/core/views/LayerViewManager.js","../../../../../node_modules/@arcgis/core/views/Magnifier.js","../../../../../node_modules/@arcgis/core/views/Theme.js","../../../../../node_modules/@arcgis/core/views/input/IViewEvents.js","../../../../../node_modules/@arcgis/core/views/input/ViewEvents.js","../../../../../node_modules/@arcgis/core/views/interactive/interfaces.js","../../../../../node_modules/@arcgis/core/views/interactive/interactiveToolUtils.js","../../../../../node_modules/@arcgis/core/views/support/screenUtils.js","../../../../../node_modules/@arcgis/core/views/interactive/ToolViewManagerManipulatorState.js","../../../../../node_modules/@arcgis/core/views/ToolViewManager.js","../../../../../node_modules/@arcgis/core/views/input/gamepad/GamepadInputDevice.js","../../../../../node_modules/@arcgis/core/views/input/gamepad/GamepadSettings.js","../../../../../node_modules/@arcgis/core/views/input/Input.js","../../../../../node_modules/@arcgis/core/views/navigation/gamepad/GamepadSettings.js","../../../../../node_modules/@arcgis/core/views/navigation/Navigation.js","../../../../../node_modules/@arcgis/core/layers/support/arcgisLayerUrl.js","../../../../../node_modules/@arcgis/core/geometry/support/heightModelInfoUtils.js","../../../../../node_modules/@arcgis/core/views/ViewingMode.js","../../../../../node_modules/@arcgis/core/views/support/projectionUtils.js","../../../../../node_modules/@arcgis/core/views/support/DefaultsFromMap.js","../../../../../node_modules/@arcgis/core/views/View.js","../../../../../node_modules/@arcgis/core/views/ViewAnimation.js","../../../../../node_modules/@arcgis/core/views/2d/unitBezier.js","../../../../../node_modules/@arcgis/core/chunks/mat2d.js","../../../../../node_modules/@arcgis/core/chunks/mat2df64.js","../../../../../node_modules/@arcgis/core/chunks/vec2.js","../../../../../node_modules/@arcgis/core/chunks/vec2f64.js","../../../../../node_modules/@arcgis/core/geometry/support/normalizeUtilsCommon.js","../../../../../node_modules/@arcgis/core/rest/utils.js","../../../../../node_modules/@arcgis/core/rest/geometryService/cut.js","../../../../../node_modules/@arcgis/core/rest/geometryService/utils.js","../../../../../node_modules/@arcgis/core/rest/geometryService/simplify.js","../../../../../node_modules/@arcgis/core/geometry/support/normalizeUtils.js","../../../../../node_modules/@arcgis/core/views/2d/viewpointUtils.js","../../../../../node_modules/@arcgis/core/views/2d/AnimationManager.js","../../../../../node_modules/@arcgis/core/views/2d/FrameTask.js","../../../../../node_modules/@arcgis/core/views/2d/GoToManager.js","../../../../../node_modules/@arcgis/core/views/2d/layerViewModuleImportUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/near.js","../../../../../node_modules/@arcgis/core/views/2d/constraints/GeometryConstraint.js","../../../../../node_modules/@arcgis/core/views/2d/constraints/RotationConstraint.js","../../../../../node_modules/@arcgis/core/views/2d/constraints/ZoomConstraint.js","../../../../../node_modules/@arcgis/core/views/2d/MapViewConstraints.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileKey.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/LODInfo.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileCoverage.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileSpan.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileInfoView.js","../../../../../node_modules/@arcgis/core/core/ReactiveMap.js","../../../../../node_modules/@arcgis/core/views/support/QueueProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileQueue.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileCache.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileStrategy.js","../../../../../node_modules/@arcgis/core/chunks/mat2df32.js","../../../../../node_modules/@arcgis/core/chunks/mat3.js","../../../../../node_modules/@arcgis/core/chunks/mat3f32.js","../../../../../node_modules/@arcgis/core/chunks/vec2f32.js","../../../../../node_modules/@arcgis/core/core/libs/gl-matrix-2/types/vec2.js","../../../../../node_modules/@arcgis/core/views/2d/ViewState.js","../../../../../node_modules/@arcgis/core/views/2d/PaddedViewState.js","../../../../../node_modules/@arcgis/core/views/2d/ViewStateManager.js","../../../../../node_modules/@arcgis/core/views/input/handlers/support.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/DoubleClickZoom.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/DoubleTapDragZoom.js","../../../../../node_modules/@arcgis/core/views/input/DragEventSeparator.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/DragPan.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/DragRotate.js","../../../../../node_modules/@arcgis/core/views/navigation/gamepadAndKeyboardUtils.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/GamepadNavigation.js","../../../../../node_modules/@arcgis/core/views/input/VisibilityChange.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/KeyPan.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/KeyRotate.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/KeyZoom.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/MouseWheelZoom.js","../../../../../node_modules/@arcgis/core/views/2d/input/handlers/PinchAction.js","../../../../../node_modules/@arcgis/core/views/input/gamepad/GamepadState.js","../../../../../node_modules/@arcgis/core/views/input/gamepad/GamepadSource.js","../../../../../node_modules/@arcgis/core/views/input/BrowserEventSource.js","../../../../../node_modules/@arcgis/core/views/input/handlers/PreventContextMenu.js","../../../../../node_modules/@arcgis/core/views/input/recognizers/support.js","../../../../../node_modules/@arcgis/core/views/input/recognizers/DoubleTapDrag.js","../../../../../node_modules/@arcgis/core/views/input/recognizers/Drag.js","../../../../../node_modules/@arcgis/core/views/input/recognizers/ImmediateDoubleClick.js","../../../../../node_modules/@arcgis/core/views/input/recognizers/PointerClickHoldAndDrag.js","../../../../../node_modules/@arcgis/core/views/input/recognizers/SingleAndDoubleClick.js","../../../../../node_modules/@arcgis/core/views/2d/input/MapViewInputManager.js","../../../../../node_modules/@arcgis/core/chunks/_commonjsHelpers.js","../../../../../node_modules/@arcgis/core/chunks/quickselect.js","../../../../../node_modules/@arcgis/core/chunks/rbush.js","../../../../../node_modules/@arcgis/core/rest/support/QuantizationParameters.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/Tile.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/TileStore.js","../../../../../node_modules/@arcgis/core/views/2d/support/HighlightOptions.js","../../../../../node_modules/@arcgis/core/views/2d/support/hitTestUtils.js","../../../../../node_modules/@arcgis/core/core/imageUtils.js","../../../../../node_modules/@arcgis/core/views/support/screenshotUtils.js","../../../../../node_modules/@arcgis/core/views/2d/support/screenshotUtils.js","../../../../../node_modules/@arcgis/core/views/2d/support/StationaryManager.js","../../../../../node_modules/@arcgis/core/views/2d/support/Timeline.js","../../../../../node_modules/@arcgis/core/views/webgl/contextUtils.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities.js","../../../../../node_modules/@arcgis/core/views/support/WebGLRequirements.js","../../../../../node_modules/@arcgis/core/views/ui/Component.js","../../../../../node_modules/@arcgis/core/support/themeUtils.js","../../../../../node_modules/@arcgis/core/views/ui/UI.js","../../../../../node_modules/@arcgis/core/core/uuid.js","../../../../../node_modules/@arcgis/core/libs/maquette-advanced-projector/advanced-projector-options.js","../../../../../node_modules/@arcgis/core/libs/maquette-advanced-projector/utils.js","../../../../../node_modules/@arcgis/core/libs/maquette-advanced-projector/projector.js","../../../../../node_modules/@stencil/core/internal/app-data/index.js","../../../../../node_modules/@stencil/core/internal/client/index.js","../../../../../node_modules/@esri/calcite-components/dist/components/guid.js","../../../../../node_modules/@esri/calcite-components/dist/components/dom.js","../../../../../node_modules/@esri/calcite-components/dist/components/index.js","../../../../../node_modules/@arcgis/core/widgets/support/componentsUtils.js","../../../../../node_modules/@arcgis/core/widgets/support/symbols.js","../../../../../node_modules/@arcgis/core/widgets/support/jsxWidgetSupport.js","../../../../../node_modules/@arcgis/core/widgets/support/legacyIcon.js","../../../../../node_modules/@arcgis/core/widgets/support/tests.js","../../../../../node_modules/@arcgis/core/widgets/Widget.js","../../../../../node_modules/@arcgis/core/widgets/Attribution/AttributionViewModel.js","../../../../../node_modules/@arcgis/core/widgets/support/globalCss.js","../../../../../node_modules/@arcgis/core/widgets/support/decorators/accessibleHandler.js","../../../../../node_modules/@arcgis/core/widgets/support/decorators/messageBundle.js","../../../../../node_modules/@arcgis/core/widgets/support/jsxFactory.js","../../../../../node_modules/@arcgis/core/widgets/Attribution.js","../../../../../node_modules/@arcgis/core/widgets/Compass/utils.js","../../../../../node_modules/@arcgis/core/widgets/support/GoTo.js","../../../../../node_modules/@arcgis/core/widgets/Compass/CompassViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Compass/css.js","../../../../../node_modules/@arcgis/core/widgets/Compass.js","../../../../../node_modules/@arcgis/core/widgets/NavigationToggle/css.js","../../../../../node_modules/@arcgis/core/widgets/NavigationToggle/NavigationToggleViewModel.js","../../../../../node_modules/@arcgis/core/widgets/NavigationToggle.js","../../../../../node_modules/@arcgis/core/widgets/Feature/resources.js","../../../../../node_modules/@arcgis/core/widgets/Zoom/IconButton.js","../../../../../node_modules/@arcgis/core/widgets/Zoom/ZoomConditions2D.js","../../../../../node_modules/@arcgis/core/widgets/Zoom/ZoomConditions3D.js","../../../../../node_modules/@arcgis/core/widgets/Zoom/ZoomViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Zoom.js","../../../../../node_modules/@arcgis/core/views/ui/DefaultUI.js","../../../../../node_modules/@arcgis/core/views/ui/2d/DefaultUI2D.js","../../../../../node_modules/@arcgis/core/webmap/background/ColorBackground.js","../../../../../node_modules/@arcgis/core/views/MapView.js","../../../../../node_modules/@arcgis/core/layers/effects/parser.js","../../../../../node_modules/@arcgis/core/layers/effects/jsonUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/BlendLayer.js","../../../../../node_modules/@arcgis/core/layers/mixins/ScaleRangeLayer.js","../../../../../node_modules/@arcgis/core/symbols/support/FeatureExpressionInfo.js","../../../../../node_modules/@arcgis/core/renderers/support/lengthUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/unitConversionUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/ElevationInfo.js","../../../../../node_modules/@arcgis/core/layers/GraphicsLayer.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/MultiOriginStore.js","../../../../../node_modules/@arcgis/core/core/ReadOnlyMultiOriginJSONSupport.js","../../../../../node_modules/@arcgis/core/core/MultiOriginJSONSupport.js","../../../../../node_modules/@arcgis/core/geometry/support/scaleUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/APIKeyMixin.js","../../../../../node_modules/@arcgis/core/core/Version.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/layerContainerType.js","../../../../../node_modules/@arcgis/core/support/timeUtils.js","../../../../../node_modules/@arcgis/core/layers/support/commonProperties.js","../../../../../node_modules/@arcgis/core/portal/support/portalItemUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/ArcGISMapService.js","../../../../../node_modules/@arcgis/core/layers/mixins/ArcGISService.js","../../../../../node_modules/@arcgis/core/layers/mixins/CustomParametersMixin.js","../../../../../node_modules/@arcgis/core/layers/mixins/operationalLayers.js","../../../../../node_modules/@arcgis/core/layers/mixins/OperationalLayer.js","../../../../../node_modules/@arcgis/core/layers/mixins/PortalLayer.js","../../../../../node_modules/@arcgis/core/layers/mixins/refresh.js","../../../../../node_modules/@arcgis/core/layers/mixins/RefreshableLayer.js","../../../../../node_modules/@arcgis/core/renderers/support/AuthoringInfoClassBreakInfo.js","../../../../../node_modules/@arcgis/core/renderers/support/AuthoringInfoFieldInfo.js","../../../../../node_modules/@arcgis/core/renderers/support/AuthoringInfoVisualVariable.js","../../../../../node_modules/@arcgis/core/rest/support/ColorRamp.js","../../../../../node_modules/@arcgis/core/rest/support/AlgorithmicColorRamp.js","../../../../../node_modules/@arcgis/core/rest/support/MultipartColorRamp.js","../../../../../node_modules/@arcgis/core/rest/support/colorRamps.js","../../../../../node_modules/@arcgis/core/renderers/support/AuthoringInfo.js","../../../../../node_modules/@arcgis/core/renderers/Renderer.js","../../../../../node_modules/@arcgis/core/renderers/support/randomRotationExpression.js","../../../../../node_modules/@arcgis/core/renderers/support/LegendOptions.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/VisualVariableLegendOptions.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/VisualVariable.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/ColorStop.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/ColorVariable.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/OpacityStop.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/OpacityVariable.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/RotationVariable.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/SizeStop.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/SizeVariableLegendOptions.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/sizeVariableUtils.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/support/visualVariableUtils.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/SizeVariable.js","../../../../../node_modules/@arcgis/core/renderers/visualVariables/VisualVariableFactory.js","../../../../../node_modules/@arcgis/core/renderers/mixins/VisualVariablesMixin.js","../../../../../node_modules/@arcgis/core/symbols/support/symbolConversion.js","../../../../../node_modules/@arcgis/core/symbols/support/jsonUtils.js","../../../../../node_modules/@arcgis/core/renderers/support/commonProperties.js","../../../../../node_modules/@arcgis/core/renderers/support/ClassBreakInfo.js","../../../../../node_modules/@arcgis/core/renderers/ClassBreaksRenderer.js","../../../../../node_modules/@arcgis/core/core/MemCache.js","../../../../../node_modules/@arcgis/core/core/LRUCache.js","../../../../../node_modules/@arcgis/core/core/sql/UnknownTimeZone.js","../../../../../node_modules/@arcgis/core/layers/support/FieldsIndex.js","../../../../../node_modules/@arcgis/core/renderers/support/DictionaryLoader.js","../../../../../node_modules/@arcgis/core/renderers/DictionaryRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/AttributeColorInfo.js","../../../../../node_modules/@arcgis/core/renderers/support/DotDensityLegendOptions.js","../../../../../node_modules/@arcgis/core/renderers/DotDensityRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/HeatmapColorStop.js","../../../../../node_modules/@arcgis/core/renderers/support/HeatmapLegendOptions.js","../../../../../node_modules/@arcgis/core/chunks/vec4f64.js","../../../../../node_modules/@arcgis/core/renderers/support/heatmapUtils.js","../../../../../node_modules/@arcgis/core/renderers/HeatmapRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/OthersCategory.js","../../../../../node_modules/@arcgis/core/renderers/support/PieChartLegendOptions.js","../../../../../node_modules/@arcgis/core/renderers/PieChartRenderer.js","../../../../../node_modules/@arcgis/core/renderers/SimpleRenderer.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/diffUtils.js","../../../../../node_modules/@arcgis/core/renderers/support/UniqueValue.js","../../../../../node_modules/@arcgis/core/renderers/support/UniqueValueClass.js","../../../../../node_modules/@arcgis/core/renderers/support/UniqueValueGroup.js","../../../../../node_modules/@arcgis/core/renderers/support/UniqueValueInfo.js","../../../../../node_modules/@arcgis/core/support/featureFlags.js","../../../../../node_modules/@arcgis/core/symbols/support/styleUtils.js","../../../../../node_modules/@arcgis/core/renderers/UniqueValueRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/types.js","../../../../../node_modules/@arcgis/core/renderers/support/jsonUtils.js","../../../../../node_modules/@arcgis/core/layers/support/CodedValue.js","../../../../../node_modules/@arcgis/core/layers/support/Domain.js","../../../../../node_modules/@arcgis/core/layers/support/CodedValueDomain.js","../../../../../node_modules/@arcgis/core/layers/support/InheritedDomain.js","../../../../../node_modules/@arcgis/core/layers/support/RangeDomain.js","../../../../../node_modules/@arcgis/core/layers/support/domains.js","../../../../../node_modules/@arcgis/core/layers/support/fieldType.js","../../../../../node_modules/@arcgis/core/layers/support/Field.js","../../../../../node_modules/@arcgis/core/layers/support/source/MapLayerSource.js","../../../../../node_modules/@arcgis/core/layers/support/source/QueryTableDataSource.js","../../../../../node_modules/@arcgis/core/layers/support/source/RasterDataSource.js","../../../../../node_modules/@arcgis/core/layers/support/source/TableDataSource.js","../../../../../node_modules/@arcgis/core/layers/support/source/DataLayerSource.js","../../../../../node_modules/@arcgis/core/rest/operations/urlUtils.js","../../../../../node_modules/@arcgis/core/core/pbf.js","../../../../../node_modules/@arcgis/core/layers/graphics/OptimizedGeometry.js","../../../../../node_modules/@arcgis/core/layers/graphics/OptimizedFeature.js","../../../../../node_modules/@arcgis/core/layers/graphics/OptimizedFeatureSet.js","../../../../../node_modules/@arcgis/core/rest/query/operations/pbfOptimizedFeatureSet.js","../../../../../node_modules/@arcgis/core/rest/query/operations/pbfFeatureServiceParser.js","../../../../../node_modules/@arcgis/core/rest/query/operations/pbfQueryUtils.js","../../../../../node_modules/@arcgis/core/rest/query/operations/queryZScale.js","../../../../../node_modules/@arcgis/core/rest/query/operations/query.js","../../../../../node_modules/@arcgis/core/rest/support/FullTextSearch.js","../../../../../node_modules/@arcgis/core/rest/support/StatisticDefinition.js","../../../../../node_modules/@arcgis/core/rest/support/Query.js","../../../../../node_modules/@arcgis/core/rest/query/executeForCount.js","../../../../../node_modules/@arcgis/core/rest/query/executeForExtent.js","../../../../../node_modules/@arcgis/core/rest/query/executeForIds.js","../../../../../node_modules/@arcgis/core/rest/support/FeatureSet.js","../../../../../node_modules/@arcgis/core/rest/query/executeQueryJSON.js","../../../../../node_modules/@arcgis/core/layers/graphics/featureConversionUtils.js","../../../../../node_modules/@arcgis/core/rest/query/operations/pbfJSONFeatureSet.js","../../../../../node_modules/@arcgis/core/rest/query/executeQueryPBF.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/QueryTask.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureTemplate.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureType.js","../../../../../node_modules/@arcgis/core/layers/support/labelUtils.js","../../../../../node_modules/@arcgis/core/layers/support/LabelExpressionInfo.js","../../../../../node_modules/@arcgis/core/symbols/support/defaultsJSON.js","../../../../../node_modules/@arcgis/core/symbols/support/defaults.js","../../../../../node_modules/@arcgis/core/layers/support/LabelClass.js","../../../../../node_modules/@arcgis/core/layers/support/labelingInfo.js","../../../../../node_modules/@arcgis/core/layers/support/LayerFloorInfo.js","../../../../../node_modules/@arcgis/core/rest/support/jsonUtils.js","../../../../../node_modules/@arcgis/core/layers/support/serviceCapabilitiesUtils.js","../../../../../node_modules/@arcgis/core/rest/support/AttachmentQuery.js","../../../../../node_modules/@arcgis/core/support/popupUtils.js","../../../../../node_modules/@arcgis/core/layers/support/Sublayer.js","../../../../../node_modules/@arcgis/core/layers/support/sublayerUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/SublayersOwner.js","../../../../../node_modules/@arcgis/core/portal/timeUnitKebabDictionary.js","../../../../../node_modules/@arcgis/core/TimeInterval.js","../../../../../node_modules/@arcgis/core/layers/support/TimeInfo.js","../../../../../node_modules/@arcgis/core/layers/mixins/TemporalLayer.js","../../../../../node_modules/@arcgis/core/layers/support/floorFilterUtils.js","../../../../../node_modules/@arcgis/core/layers/support/ExportImageParameters.js","../../../../../node_modules/@arcgis/core/layers/support/imageBitmapUtils.js","../../../../../node_modules/@arcgis/core/layers/support/versionUtils.js","../../../../../node_modules/@arcgis/core/layers/MapImageLayer.js","../../../../../node_modules/@arcgis/core/form/ExpressionInfo.js","../../../../../node_modules/@arcgis/core/form/elements/Element.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/AttachmentInput.js","../../../../../node_modules/@arcgis/core/form/elements/AttachmentElement.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/Input.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/TextInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/BarcodeScannerInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/ComboBoxInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/DatePickerInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/DateTimeOffsetPickerInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/DateTimePickerInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/RadioButtonsInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/SwitchInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/TextAreaInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/TextBoxInput.js","../../../../../node_modules/@arcgis/core/form/elements/inputs/TimePickerInput.js","../../../../../node_modules/@arcgis/core/form/elements/support/inputs.js","../../../../../node_modules/@arcgis/core/form/elements/FieldElement.js","../../../../../node_modules/@arcgis/core/form/elements/RelationshipElement.js","../../../../../node_modules/@arcgis/core/form/support/elements.js","../../../../../node_modules/@arcgis/core/form/elements/GroupElement.js","../../../../../node_modules/@arcgis/core/form/FormTemplate.js","../../../../../node_modules/@arcgis/core/rest/query/operations/editsZScale.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/MemorySource.js","../../../../../node_modules/@arcgis/core/versionManagement/support/versionManagementUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/EditBusLayer.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureFilter.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureEffect.js","../../../../../node_modules/@arcgis/core/layers/mixins/FeatureEffectLayer.js","../../../../../node_modules/@arcgis/core/layers/support/EditFieldsInfo.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureIndex.js","../../../../../node_modules/@arcgis/core/layers/support/featureQueryAll.js","../../../../../node_modules/@arcgis/core/rest/support/RelationshipQuery.js","../../../../../node_modules/@arcgis/core/layers/support/featureLayerUtils.js","../../../../../node_modules/@arcgis/core/layers/support/GeometryFieldsInfo.js","../../../../../node_modules/@arcgis/core/layers/support/Relationship.js","../../../../../node_modules/@arcgis/core/layers/support/Subtype.js","../../../../../node_modules/@arcgis/core/layers/mixins/FeatureLayerBase.js","../../../../../node_modules/@arcgis/core/layers/support/ExpressionInfo.js","../../../../../node_modules/@arcgis/core/layers/support/AggregateField.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureReduction.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureReductionBinning.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureReductionCluster.js","../../../../../node_modules/@arcgis/core/layers/support/FeatureReductionSelection.js","../../../../../node_modules/@arcgis/core/layers/support/featureReductionUtils.js","../../../../../node_modules/@arcgis/core/core/MD5.js","../../../../../node_modules/@arcgis/core/views/2d/engine/LevelDependentSizeVariable.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/clusterUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/FeatureReductionLayer.js","../../../../../node_modules/@arcgis/core/layers/support/OrderByInfo.js","../../../../../node_modules/@arcgis/core/layers/mixins/OrderedLayer.js","../../../../../node_modules/@arcgis/core/layers/support/PublishingInfo.js","../../../../../node_modules/@arcgis/core/layers/mixins/PublishableLayer.js","../../../../../node_modules/@arcgis/core/layers/support/fieldProperties.js","../../../../../node_modules/@arcgis/core/renderers/support/styleUtils.js","../../../../../node_modules/@arcgis/core/rest/support/TopFilter.js","../../../../../node_modules/@arcgis/core/rest/support/TopFeaturesQuery.js","../../../../../node_modules/@arcgis/core/webdoc/interfaces.js","../../../../../node_modules/@arcgis/core/layers/FeatureLayer.js","../../../../../node_modules/@arcgis/core/layers/effects/EffectView.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/pixelRangeUtils.js","../../../../../node_modules/@arcgis/core/renderers/support/rendererConversion.js","../../../../../node_modules/@arcgis/core/smartMapping/support/utils.js","../../../../../node_modules/@arcgis/core/symbols/cim/utils.js","../../../../../node_modules/@arcgis/core/symbols/support/cimSymbolUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/previewUtils.js","../../../../../node_modules/@arcgis/core/core/colorUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/svgUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/gfxUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/utils.js","../../../../../node_modules/@arcgis/core/symbols/support/renderUtils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/styles/support/relationshipUtils.js","../../../../../node_modules/@arcgis/core/core/devEnvironmentUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/webStyleSymbolUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/previewSymbol3D.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/relationshipRampUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/symbolUtils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/clusterUtils.js","../../../../../node_modules/@arcgis/core/renderers/support/numberUtils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/utils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/colorRampUtils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/heatmapRampUtils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/sizeRampUtils.js","../../../../../node_modules/@arcgis/core/renderers/support/utils.js","../../../../../node_modules/@arcgis/core/widgets/smartMapping/support/utils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/ActiveLayerInfo.js","../../../../../node_modules/@arcgis/core/widgets/Legend/LegendViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Legend/styles/CardCSS.js","../../../../../node_modules/@arcgis/core/widgets/Legend/styles/support/univariateUtils.js","../../../../../node_modules/@arcgis/core/widgets/Legend/support/styleUtils.js","../../../../../node_modules/@arcgis/core/widgets/support/Heading.js","../../../../../node_modules/@arcgis/core/widgets/Legend/styles/Card.js","../../../../../node_modules/@arcgis/core/widgets/Legend/styles/ClassicCSS.js","../../../../../node_modules/@arcgis/core/widgets/Legend/styles/Classic.js","../../../../../node_modules/@arcgis/core/widgets/Legend.js","../../../../../node_modules/@arcgis/core/widgets/Home/HomeViewModel.js","../../../../../node_modules/@arcgis/core/widgets/support/decorators/vmEvent.js","../../../../../node_modules/@arcgis/core/widgets/Home.js","../../../../../www/local-data-mapping-tool/app/react/store/slices/mapSlice.ts","../../../../../node_modules/@reduxjs/toolkit/dist/query/rtk-query.esm.js","../../../../../node_modules/@reduxjs/toolkit/dist/query/react/rtk-query-react.esm.js","../../../../../node_modules/@arcgis/core/rest/query/executeQuery.js","../../../../../node_modules/@arcgis/core/layers/support/exifUtils.js","../../../../../node_modules/@arcgis/core/rest/query/support/AttachmentInfo.js","../../../../../node_modules/@arcgis/core/rest/query/operations/queryAttachments.js","../../../../../node_modules/@arcgis/core/rest/query/operations/queryRelatedRecords.js","../../../../../node_modules/@arcgis/core/rest/query/executeRelationshipQuery.js","../../../../../node_modules/@arcgis/core/rest/query/operations/queryTopFeatures.js","../../../../../node_modules/@arcgis/core/rest/query/executeTopFeaturesQuery.js","../../../../../node_modules/@arcgis/core/rest/query/executeForTopIds.js","../../../../../node_modules/@arcgis/core/rest/query/executeForTopExtents.js","../../../../../node_modules/@arcgis/core/rest/query/executeForTopCount.js","../../../../../www/local-data-mapping-tool/app/react/store/query/getDataRtkQuery.ts","../../../../../www/local-data-mapping-tool/app/react/store/store.ts","../../../../../node_modules/@arcgis/core/geometry/support/quantizationUtils.js","../../../../../node_modules/@arcgis/core/rest/support/ClassBreaksDefinition.js","../../../../../node_modules/@arcgis/core/rest/support/generateRendererUtils.js","../../../../../node_modules/@arcgis/core/statistics/utils.js","../../../../../node_modules/@arcgis/core/smartMapping/statistics/support/utils.js","../../../../../node_modules/@arcgis/core/smartMapping/support/binningUtils.js","../../../../../node_modules/@arcgis/core/smartMapping/statistics/support/WorkerClient.js","../../../../../node_modules/@arcgis/core/rest/generateRenderer.js","../../../../../node_modules/@arcgis/core/rest/support/GenerateRendererParameters.js","../../../../../node_modules/@arcgis/core/rest/support/UniqueValueDefinition.js","../../../../../node_modules/@arcgis/core/smartMapping/statistics/support/predominanceUtils.js","../../../../../node_modules/@arcgis/core/smartMapping/statistics/support/statsWorker.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/LayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/support/utils.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/InMemoryLayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/FeatureLayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/CSVLayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/FeatureLayerBinningAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/SceneLayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/PointCloudLayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/StreamLayerAdapter.js","../../../../../node_modules/@arcgis/core/smartMapping/support/adapters/support/layerUtils.js","../../../../../node_modules/@arcgis/core/smartMapping/statistics/classBreaks.js","../../../../../www/local-data-mapping-tool/app/react/utils/mapRenderers.utils.ts","../../../../../www/local-data-mapping-tool/app/react/utils/mapLabeling.utils.ts","../../../../../www/local-data-mapping-tool/app/react/utils/referenceLayers.utils.ts","../../../../../node_modules/@arcgis/core/rest/support/IdentifyParameters.js","../../../../../node_modules/@arcgis/core/rest/operations/identify.js","../../../../../node_modules/@arcgis/core/rest/support/IdentifyResult.js","../../../../../node_modules/@arcgis/core/rest/identify.js","../../../../../node_modules/axios/lib/helpers/bind.js","../../../../../node_modules/axios/lib/utils.js","../../../../../node_modules/axios/lib/core/AxiosError.js","../../../../../node_modules/axios/lib/helpers/null.js","../../../../../node_modules/axios/lib/helpers/toFormData.js","../../../../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../../../../node_modules/axios/lib/helpers/buildURL.js","../../../../../node_modules/axios/lib/core/InterceptorManager.js","../../../../../node_modules/axios/lib/defaults/transitional.js","../../../../../node_modules/axios/lib/platform/browser/index.js","../../../../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../../../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../../../../node_modules/axios/lib/platform/browser/classes/Blob.js","../../../../../node_modules/axios/lib/platform/common/utils.js","../../../../../node_modules/axios/lib/platform/index.js","../../../../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../../../../node_modules/axios/lib/helpers/formDataToJSON.js","../../../../../node_modules/axios/lib/defaults/index.js","../../../../../node_modules/axios/lib/helpers/parseHeaders.js","../../../../../node_modules/axios/lib/core/AxiosHeaders.js","../../../../../node_modules/axios/lib/core/transformData.js","../../../../../node_modules/axios/lib/cancel/isCancel.js","../../../../../node_modules/axios/lib/cancel/CanceledError.js","../../../../../node_modules/axios/lib/core/settle.js","../../../../../node_modules/axios/lib/helpers/cookies.js","../../../../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../../../../node_modules/axios/lib/helpers/combineURLs.js","../../../../../node_modules/axios/lib/core/buildFullPath.js","../../../../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../../../../node_modules/axios/lib/helpers/parseProtocol.js","../../../../../node_modules/axios/lib/helpers/speedometer.js","../../../../../node_modules/axios/lib/adapters/xhr.js","../../../../../node_modules/axios/lib/adapters/adapters.js","../../../../../node_modules/axios/lib/core/dispatchRequest.js","../../../../../node_modules/axios/lib/core/mergeConfig.js","../../../../../node_modules/axios/lib/env/data.js","../../../../../node_modules/axios/lib/helpers/validator.js","../../../../../node_modules/axios/lib/core/Axios.js","../../../../../node_modules/axios/lib/cancel/CancelToken.js","../../../../../node_modules/axios/lib/helpers/spread.js","../../../../../node_modules/axios/lib/helpers/isAxiosError.js","../../../../../node_modules/axios/lib/helpers/HttpStatusCode.js","../../../../../node_modules/axios/lib/axios.js","../../../../../www/local-data-mapping-tool/app/react/services/getSurveyRasterData.service.ts","../../../../../www/local-data-mapping-tool/app/react/configs/popup.config.ts","../../../../../www/local-data-mapping-tool/app/react/utils/popup.utils.ts","../../../../../www/local-data-mapping-tool/app/react/utils/mapDefinitionExpression.utils.ts","../../../../../www/local-data-mapping-tool/app/react/controllers/MapControllers.ts","../../../../../node_modules/@arcgis/core/chunks/geometryEngineBase.js","../../../../../node_modules/@arcgis/core/geometry/geometryAdapters/hydrated.js","../../../../../node_modules/@arcgis/core/geometry/geometryEngine.js","../../../../../www/local-data-mapping-tool/app/react/utils/admin2Data.utils.ts","../../../../../www/local-data-mapping-tool/app/react/configs/api.configs.ts","../../../../../www/local-data-mapping-tool/app/react/services/getGeometries.service.ts","../../../../../www/local-data-mapping-tool/app/react/services/getSurveyData.service.ts","../../../../../www/local-data-mapping-tool/app/react/utils/admin1Map.utils.ts","../../../../../www/local-data-mapping-tool/app/react/utils/map.utils.ts","../../../../../www/local-data-mapping-tool/app/react/utils/indicators.utils.ts","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Table/Admin2Table.tsx","../../../../../node_modules/@kurkle/color/dist/color.esm.js","../../../../../node_modules/chart.js/dist/chunks/helpers.segment.js","../../../../../node_modules/chart.js/dist/chart.js","../../../../../node_modules/react-chartjs-2/dist/index.js","../../../../../node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Chart/Admin2Chart.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarTitle/SidebarTitle.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarMapAdmins/SidebarMapAdmins.tsx","../../../../../www/local-data-mapping-tool/app/react/components/RendererClassificationMethods/RendererClassificationMethodsDropdown.tsx","../../../../../www/local-data-mapping-tool/app/react/components/ColorRangeSteps/ColorRangeStepsDropdown.tsx","../../../../../www/local-data-mapping-tool/app/react/components/ColorRange/ColorRange.tsx","../../../../../www/local-data-mapping-tool/app/react/components/ColorBreaksDropdown/ColorBreaksDropdown.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarMapFiltersBreaks/SidebarMapFiltersBreaks.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarMapLegend/SidebarMapLegend.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/SidebarMapFiltersDivider/SidebarMapFiltersDivider.tsx","../../../../../www/local-data-mapping-tool/app/react/components/Admin2MapNote/Admin2MapNote.tsx","../../../../../www/local-data-mapping-tool/app/react/services/getMapServerAdmin2Data.service.ts","../../../../../node_modules/lodash/isEqual.js","../../../../../node_modules/lodash/_baseFindIndex.js","../../../../../node_modules/lodash/_baseIsNaN.js","../../../../../node_modules/lodash/_strictIndexOf.js","../../../../../node_modules/lodash/_baseIndexOf.js","../../../../../node_modules/lodash/_arrayIncludes.js","../../../../../node_modules/lodash/_arrayIncludesWith.js","../../../../../node_modules/lodash/noop.js","../../../../../node_modules/lodash/_createSet.js","../../../../../node_modules/lodash/_baseUniq.js","../../../../../node_modules/lodash/uniqWith.js","../../../../../www/local-data-mapping-tool/app/react/utils/survey.utils.ts","../../../../../www/local-data-mapping-tool/app/react/configs/s3.configs.ts","../../../../../www/local-data-mapping-tool/app/react/components/Admin2Map/Admin2Map.tsx","../../../../../www/local-data-mapping-tool/app/react/components/App/App.tsx","../../../../../www/local-data-mapping-tool/app/react/index.tsx","../../../../../node_modules/@arcgis/core/core/workers/request.js","../../../../../node_modules/@arcgis/core/identity/IdentityForm.js","../../../../../node_modules/@arcgis/core/widgets/support/widget.js","../../../../../node_modules/tabbable/dist/index.esm.js","../../../../../node_modules/focus-trap/dist/focus-trap.esm.js","../../../../../node_modules/@arcgis/core/identity/IdentityModal.js","../../../../../node_modules/@arcgis/core/identity/OAuthCredential.js","../../../../../node_modules/@arcgis/core/identity/OAuthInfo.js","../../../../../node_modules/@arcgis/core/identity/ServerInfo.js","../../../../../node_modules/@arcgis/core/identity/IdentityManagerBase.js","../../../../../node_modules/@arcgis/core/identity/IdentityManager.js","../../../../../node_modules/@arcgis/core/chunks/pe-wasm.js","../../../../../node_modules/@arcgis/core/arcade/ArcadeDate.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/errorsupport.js","../../../../../node_modules/@arcgis/core/core/sql/DateOnly.js","../../../../../node_modules/@arcgis/core/core/sql/SqlTimestampOffset.js","../../../../../node_modules/@arcgis/core/arcade/kernel.js","../../../../../node_modules/@arcgis/core/core/sql/TimeOnly.js","../../../../../node_modules/@arcgis/core/core/sql/AggregateFunctions.js","../../../../../node_modules/@arcgis/core/core/sql/SqlInterval.js","../../../../../node_modules/@arcgis/core/core/sql/sqlDateParsingUtils.js","../../../../../node_modules/@arcgis/core/core/sql/sqlCompareUtils.js","../../../../../node_modules/@arcgis/core/core/sql/StandardizedFunctions.js","../../../../../node_modules/@arcgis/core/core/sql/sqlArithmeticUtils.js","../../../../../node_modules/@arcgis/core/core/sql/WhereGrammar.js","../../../../../node_modules/@arcgis/core/core/sql/WhereClause.js","../../../../../node_modules/@arcgis/core/arcade/ArcadeModule.js","../../../../../node_modules/@arcgis/core/arcade/ArcadeModuleLoader.js","../../../../../node_modules/@arcgis/core/arcade/executionError.js","../../../../../node_modules/@arcgis/core/arcade/FunctionWrapper.js","../../../../../node_modules/@arcgis/core/arcade/ImmutableArray.js","../../../../../node_modules/@arcgis/core/arcade/ImmutablePointArray.js","../../../../../node_modules/@arcgis/core/arcade/ImmutablePathArray.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/shared.js","../../../../../node_modules/@arcgis/core/core/number.js","../../../../../node_modules/@arcgis/core/chunks/languageUtils.js","../../../../../node_modules/@arcgis/core/arcade/deepClone.js","../../../../../node_modules/@arcgis/core/arcade/Dictionary.js","../../../../../node_modules/@arcgis/core/arcade/Feature.js","../../../../../node_modules/@arcgis/core/arcade/treeAnalysis.js","../../../../../node_modules/@arcgis/core/chunks/array.js","../../../../../node_modules/@arcgis/core/arcade/functions/date.js","../../../../../node_modules/@arcgis/core/arcade/functions/centroid.js","../../../../../node_modules/@arcgis/core/arcade/functions/geometry.js","../../../../../node_modules/@arcgis/core/arcade/functions/geomsync.js","../../../../../node_modules/@arcgis/core/arcade/functions/maths.js","../../../../../node_modules/@arcgis/core/arcade/functions/fieldStats.js","../../../../../node_modules/@arcgis/core/arcade/functions/stats.js","../../../../../node_modules/@arcgis/core/arcade/ArcadePortal.js","../../../../../node_modules/@arcgis/core/arcade/Attachment.js","../../../../../node_modules/@arcgis/core/arcade/functions/convertdirection.js","../../../../../node_modules/@arcgis/core/arcade/functions/hash.js","../../../../../node_modules/@arcgis/core/arcade/functions/string.js","../../../../../node_modules/@arcgis/core/arcade/arcadeCompiler.js","../../../../../node_modules/@arcgis/core/arcade/lib/types.js","../../../../../node_modules/@arcgis/core/arcade/lib/comment-handler.js","../../../../../node_modules/@arcgis/core/arcade/lib/error-handler.js","../../../../../node_modules/@arcgis/core/arcade/lib/assert.js","../../../../../node_modules/@arcgis/core/arcade/lib/character.js","../../../../../node_modules/@arcgis/core/arcade/lib/scanner.js","../../../../../node_modules/@arcgis/core/arcade/lib/parser.js","../../../../../node_modules/@arcgis/core/arcade/lib/arcade-parser.js","../../../../../node_modules/@arcgis/core/arcade/parser.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/RecentlyUsedCache.js","../../../../../node_modules/@arcgis/core/arcade/ArcadeModuleResolver.js","../../../../../node_modules/@arcgis/core/arcade/arcadeRuntime.js","../../../../../node_modules/@arcgis/core/chunks/arcade.js","../../../../../node_modules/@arcgis/core/support/arcadeUtils.js","../../../../../node_modules/@arcgis/core/layers/support/TileInfoTilemapCache.js","../../../../../node_modules/@arcgis/core/core/ByteSizeUnit.js","../../../../../node_modules/@arcgis/core/geometry/support/UintArray.js","../../../../../node_modules/@arcgis/core/layers/support/Tilemap.js","../../../../../node_modules/@arcgis/core/layers/support/TilemapCache.js","../../../../../node_modules/@arcgis/core/layers/mixins/ArcGISCachedService.js","../../../../../node_modules/@arcgis/core/layers/support/ElevationTileData.js","../../../../../node_modules/@arcgis/core/core/workers/WorkerHandle.js","../../../../../node_modules/@arcgis/core/layers/support/LercDecoder.js","../../../../../node_modules/@arcgis/core/layers/ElevationLayer.js","../../../../../node_modules/@arcgis/core/portal/support/resourceUtils.js","../../../../../node_modules/@arcgis/core/support/requestPresets.js","../../../../../node_modules/@arcgis/core/layers/support/LayerLoadContext.js","../../../../../node_modules/@arcgis/core/layers/support/lazyLayerLoader.js","../../../../../node_modules/@arcgis/core/portal/support/featureCollectionUtils.js","../../../../../node_modules/@arcgis/core/layers/support/associatedFeatureServiceUtils.js","../../../../../node_modules/@arcgis/core/portal/support/loadUtils.js","../../../../../node_modules/@arcgis/core/portal/support/portalLayers.js","../../../../../node_modules/@arcgis/core/layers/support/layersCreator.js","../../../../../node_modules/@arcgis/core/layers/support/ElevationSampler.js","../../../../../node_modules/@arcgis/core/layers/support/ElevationSamplerData.js","../../../../../node_modules/@arcgis/core/layers/support/ElevationTile.js","../../../../../node_modules/@arcgis/core/layers/support/ElevationQuery.js","../../../../../node_modules/@arcgis/core/layers/support/fetchService.js","../../../../../node_modules/@arcgis/core/layers/support/arcgisLayers.js","../../../../../node_modules/@arcgis/core/geometry/geometryAdapters/json.js","../../../../../node_modules/@arcgis/core/chunks/geometryEngineJSON.js","../../../../../node_modules/@arcgis/core/geometry/geometryEngineWorker.js","../../../../../node_modules/@arcgis/core/core/date.js","../../../../../node_modules/@arcgis/core/core/libs/rbush/PooledRBush.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/BoundsStore.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/geometryUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/centroid.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/FeatureStore.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/projectionSupport.js","../../../../../node_modules/@arcgis/core/core/sql/WhereClauseCache.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/attributeSupport.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/QueryEngineCapabilities.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/AttributesBuilder.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/SnappingCandidate.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/QueryEngineResult.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/queryUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/intersects.js","../../../../../node_modules/@arcgis/core/layers/graphics/contains.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/spatialQuerySupport.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/queryValidationUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/timeSupport.js","../../../../../node_modules/@arcgis/core/layers/support/PromiseQueue.js","../../../../../node_modules/@arcgis/core/views/support/debugFlags.js","../../../../../node_modules/@arcgis/core/views/support/RenderState.js","../../../../../node_modules/@arcgis/core/views/support/Scheduler.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/QueryEngine.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/csv/csv.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/clientSideDefaults.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/CSVSourceWorker.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/internals/Mat3.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/internals/Mat4.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/internals/Scalar.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/internals/Vec2.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/internals/Vec3.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/internals/Vec4.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/BufferView.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/types.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Util.js","../../../../../node_modules/@arcgis/core/views/3d/support/buffer/InterleavedLayout.js","../../../../../node_modules/@arcgis/core/views/3d/support/buffer/workerHelper.js","../../../../../node_modules/@arcgis/core/views/webgl/enums.js","../../../../../node_modules/@arcgis/core/views/webgl/VertexElementDescriptor.js","../../../../../node_modules/@arcgis/core/views/3d/support/buffer/glUtil.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/VertexAttribute.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js","../../../../../node_modules/@arcgis/core/geometry/support/Indices.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/deduplicate.js","../../../../../node_modules/@arcgis/core/views/3d/support/meshProcessing.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js","../../../../../node_modules/@arcgis/core/chunks/mat3f64.js","../../../../../node_modules/@arcgis/core/chunks/mat4f64.js","../../../../../node_modules/@arcgis/core/geometry/spatialReferenceEllipsoidUtils.js","../../../../../node_modules/@arcgis/core/geometry/projection/localRotationUtils.js","../../../../../node_modules/@arcgis/core/geometry/projection/computeTranslationToOriginAndRotation.js","../../../../../node_modules/@arcgis/core/geometry/support/DoubleArray.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshGeoreferencedRelativeVertexSpace.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshGeoreferencedVertexSpace.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshLocalVertexSpace.js","../../../../../node_modules/@arcgis/core/chunks/quatf64.js","../../../../../node_modules/@arcgis/core/chunks/quat.js","../../../../../node_modules/@arcgis/core/geometry/support/axisAngleDegrees.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshTransform.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/math/common.js","../../../../../node_modules/@arcgis/core/chunks/vec32.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/geographicUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/projection.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/georeference.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/ElevationSamplerWorker.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/symbologySnappingCandidates.js","../../../../../node_modules/@arcgis/core/core/AsyncSequence.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/geojson/geojson.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/sourceUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/geojson/GeoJSONSourceWorker.js","../../../../../node_modules/@arcgis/core/layers/support/LercWorker.js","../../../../../node_modules/@arcgis/core/layers/graphics/objectIdUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/MemorySourceWorker.js","../../../../../node_modules/@arcgis/core/layers/graphics/dehydratedFeatures.js","../../../../../node_modules/@arcgis/core/rest/query/operations/pbfDehydratedFeatureSet.js","../../../../../node_modules/@arcgis/core/views/3d/support/PBFDecoderWorker.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/processors.js","../../../../../node_modules/@arcgis/core/core/CircularArray.js","../../../../../node_modules/@arcgis/core/views/2d/arcade/callExpressionWithCursor.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/Store2D.js","../../../../../node_modules/@arcgis/core/geometry/GeometryCursor.js","../../../../../node_modules/@arcgis/core/geometry/support/labelPoint.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/StaticBitSet.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReader.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReaderPBFIndirect.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/FeatureStore2D.js","../../../../../node_modules/@arcgis/core/layers/ogc/ogcFeatureUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReaderJSON.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReaderPBF.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/controllers/support/sourceAdapters.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/UpdateToken.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/DataTileSubscription.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/DataTileSource.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/BaseFeatureSource.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/DrillDownFeatureSource.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/PagedFeatureSource.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/SnapshotFeatureSource.js","../../../../../node_modules/@arcgis/core/layers/graphics/data/StreamFeatureManager.js","../../../../../node_modules/@arcgis/core/layers/support/StreamConnection.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/connections/WebSocketConnection.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/connections/GeoEventConnection.js","../../../../../node_modules/@arcgis/core/layers/support/ClientSideConnection.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/connections/createConnection.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/StreamConnectionState.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/StreamSource.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/sources/createSource.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/definitions.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/DisplayId.js","../../../../../node_modules/@arcgis/core/symbols/cim/enums.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/enums.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/Utils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/debug.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/number.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/color.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/visualVariablesUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/support/visualVariablesUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/AttributeStore.js","../../../../../node_modules/@arcgis/core/geohash/geohashUtils.js","../../../../../node_modules/@arcgis/core/geohash/GeohashTree.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/BinStore.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/ClusterStore.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/DisplayIdGenerator.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/ComputedAttributeStorage.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/controllers/FeatureController2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/Pipeline.js","../../../../../node_modules/@arcgis/core/chunks/vec3f32.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/ColorModulation.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/PointSizeAlgorithm.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/PointSizeFixedSizeAlgorithm.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/PointSizeSplatAlgorithm.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/pointSizeAlgorithmTypeUtils.js","../../../../../node_modules/@arcgis/core/renderers/PointCloudRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/ColorClassBreakInfo.js","../../../../../node_modules/@arcgis/core/renderers/PointCloudClassBreaksRenderer.js","../../../../../node_modules/@arcgis/core/renderers/PointCloudStretchRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/ColorUniqueValueInfo.js","../../../../../node_modules/@arcgis/core/renderers/PointCloudUniqueValueRenderer.js","../../../../../node_modules/@arcgis/core/views/3d/layers/i3s/LEPCC.js","../../../../../node_modules/@arcgis/core/views/3d/layers/i3s/I3SBinaryReader.js","../../../../../node_modules/@arcgis/core/views/3d/layers/i3s/PointCloudWorkerUtil.js","../../../../../node_modules/@arcgis/core/views/3d/layers/PointCloudWorker.js","../../../../../node_modules/@arcgis/core/layers/support/SimpleBandStatistics.js","../../../../../node_modules/@arcgis/core/layers/support/PixelBlock.js","../../../../../node_modules/@arcgis/core/chunks/Zlib.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/ImageCanvasDecoder.js","../../../../../node_modules/@arcgis/core/chunks/Jpg.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/JpgPlus.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/Lerc.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/Lzw.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/Raw.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/byteStreamUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/TiffTags.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/utils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/TiffDecoder.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFormats/RasterCodec.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/pixelUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/BaseFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/AspectFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/RasterBandInfo.js","../../../../../node_modules/@arcgis/core/layers/support/RasterSensorInfo.js","../../../../../node_modules/@arcgis/core/layers/support/RasterStorageInfo.js","../../../../../node_modules/@arcgis/core/layers/support/RasterInfo.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/BaseRasterFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/surfaceUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/AspectFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/customBandIndexUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/bandIndexUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/BandArithmeticFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/BandArithmeticFunction.js","../../../../../node_modules/@arcgis/core/renderers/support/colorRampUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ColormapFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/colormaps.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ColormapFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/CompositeBandFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/CompositeBandFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ContrastBrightnessFunctionArguments.js","../../../../../node_modules/@arcgis/core/renderers/support/stretchRendererUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/stretchUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ContrastBrightnessFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctionConstants.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/mirror.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/convolutionUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ConvolutionFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ConvolutionFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/CurvatureFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/CurvatureFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ExtractBandFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/ExtractBandFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/LocalFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/localUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/LocalFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/MaskFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/MaskFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/NDVIFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/NDVIFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/RemapFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/RemapFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/SlopeFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/SlopeFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/focalStatUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/StatisticsFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/StatisticsFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/StatisticsHistogramFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/StatisticsHistogramFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/StretchFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/StretchFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/TableFunctionArguments.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/TableFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/rasterFunctionHelper.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/rasterProjectionHelper.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/vectorFieldUtils.js","../../../../../node_modules/@arcgis/core/layers/support/rasterTransforms/BaseRasterTransform.js","../../../../../node_modules/@arcgis/core/layers/support/rasterTransforms/GCSShiftTransform.js","../../../../../node_modules/@arcgis/core/layers/support/rasterTransforms/IdentityTransform.js","../../../../../node_modules/@arcgis/core/layers/support/rasterTransforms/PolynomialTransform.js","../../../../../node_modules/@arcgis/core/layers/support/rasterTransforms/utils.js","../../../../../node_modules/@arcgis/core/renderers/support/rasterRendererChecks.js","../../../../../node_modules/@arcgis/core/renderers/support/RasterSymbolizer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/dataUtils.js","../../../../../node_modules/@arcgis/core/layers/support/RasterWorker.js","../../../../../node_modules/@arcgis/core/core/ObjectStack.js","../../../../../node_modules/@arcgis/core/core/VectorStack.js","../../../../../node_modules/@arcgis/core/geometry/support/vectorStacks.js","../../../../../node_modules/@arcgis/core/geometry/support/lineSegment.js","../../../../../node_modules/@arcgis/core/geometry/support/ray.js","../../../../../node_modules/@arcgis/core/geometry/support/vector.js","../../../../../node_modules/@arcgis/core/chunks/sphere.js","../../../../../node_modules/@arcgis/core/geometry/support/clipRay.js","../../../../../node_modules/@arcgis/core/geometry/support/plane.js","../../../../../node_modules/@arcgis/core/geometry/support/frustum.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Octree.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js","../../../../../node_modules/@arcgis/core/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js","../../../../../node_modules/@arcgis/core/libs/i3s/enums.js","../../../../../node_modules/@arcgis/core/libs/i3s/I3SModule.js","../../../../../node_modules/@arcgis/core/views/3d/layers/i3s/I3SNode.js","../../../../../node_modules/@arcgis/core/views/3d/layers/SceneLayerWorker.js","../../../../../node_modules/@arcgis/core/layers/ogc/xmlUtils.js","../../../../../node_modules/@arcgis/core/layers/ogc/wfsUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/WFSSourceWorker.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/enums.js","../../../../../node_modules/@arcgis/core/geometry/support/TileClipper.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/GeometryUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/ScriptUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/Rect.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/TextShaping.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/config.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleDefinition.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/Placement.js","../../../../../node_modules/@arcgis/core/geometry/libtess.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/Feature.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/MemoryBuffer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/IndexMemoryBuffer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/SourceLayerData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/VertexMemoryBuffer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/buckets/BaseBucket.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/buckets/CircleBucket.js","../../../../../node_modules/@arcgis/core/chunks/earcut.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/buckets/FillBucket.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TurboLine.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/buckets/LineBucket.js","../../../../../node_modules/@arcgis/core/core/bidiEngineTables.js","../../../../../node_modules/@arcgis/core/core/BidiEngine.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/enums.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterial.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/types.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/expression/expression.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/Filter.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleProperty.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleLayer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/buckets/SymbolBucket.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/enums.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileParser.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/WorkerTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/StyleRepository.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/WorkerTileHandler.js","../../../../../node_modules/@arcgis/core/core/throttle.js","../../../../../node_modules/@arcgis/core/core/quantityUtils.js","../../../../../node_modules/@arcgis/core/core/unitFormatUtils.js","../../../../../node_modules/@arcgis/core/widgets/Feature/support/featureUtils.js","../../../../../node_modules/@arcgis/core/widgets/Attachments/AttachmentsViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Attachments/support/attachmentUtils.js","../../../../../node_modules/@arcgis/core/widgets/Attachments.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureAttachments/FeatureAttachmentsViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Feature/support/FeatureElementInfo.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureAttachments.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureContent/FeatureContentViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureContent.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js","../../../../../node_modules/@arcgis/core/widgets/support/uriUtils.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureFields.js","../../../../../node_modules/@arcgis/core/core/a11yUtils.js","../../../../../node_modules/@arcgis/core/widgets/Feature/support/relatedFeatureUtils.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureMedia.js","../../../../../node_modules/@arcgis/core/widgets/Feature/support/arcadeFeatureUtils.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureExpression.js","../../../../../node_modules/@arcgis/core/widgets/FeatureForm/featureFormUtils.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureRelationship.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/FeatureSetQueryInterceptor.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Feature/support/FeatureContentMixin.js","../../../../../node_modules/@arcgis/core/widgets/Feature.js","../../../../../node_modules/@arcgis/core/widgets/support/AnchorElementViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Spinner/SpinnerViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Spinner.js","../../../../../node_modules/@arcgis/core/widgets/Features/css.js","../../../../../node_modules/@arcgis/core/widgets/Features/FeaturesRelatedRecords.js","../../../../../node_modules/@arcgis/core/core/ReactiveSet.js","../../../../../node_modules/@arcgis/core/layers/LayerConstants.js","../../../../../node_modules/@arcgis/core/views/support/layerViewUtils.js","../../../../../node_modules/@arcgis/core/widgets/Popup/actions.js","../../../../../node_modules/@arcgis/core/widgets/Popup/actionUtils.js","../../../../../node_modules/@arcgis/core/widgets/Features/FeaturesViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Features/FeaturesVisibleElements.js","../../../../../node_modules/@arcgis/core/widgets/Features.js","../../../../../node_modules/@arcgis/core/widgets/Popup/css.js","../../../../../node_modules/@arcgis/core/widgets/Popup/PopupViewModel.js","../../../../../node_modules/@arcgis/core/widgets/Popup/PopupVisibleElements.js","../../../../../node_modules/@arcgis/core/widgets/Popup.js","../../../../../node_modules/@arcgis/core/rest/support/ProjectParameters.js","../../../../../node_modules/@arcgis/core/rest/geometryService/project.js","../../../../../node_modules/@arcgis/core/portal/support/geometryServiceUtils.js","../../../../../node_modules/@arcgis/core/views/webgl/checkWebGLError.js","../../../../../node_modules/@arcgis/core/views/webgl/BufferObject.js","../../../../../node_modules/@arcgis/core/views/webgl/GLObjectType.js","../../../../../node_modules/@arcgis/core/views/webgl/Util.js","../../../../../node_modules/@arcgis/core/views/webgl/RenderbufferDescriptor.js","../../../../../node_modules/@arcgis/core/views/webgl/Renderbuffer.js","../../../../../node_modules/@arcgis/core/views/webgl/TextureDescriptor.js","../../../../../node_modules/@arcgis/core/views/webgl/ValidatedTextureDescriptor.js","../../../../../node_modules/@arcgis/core/views/webgl/Texture.js","../../../../../node_modules/@arcgis/core/views/webgl/FramebufferObject.js","../../../../../node_modules/@arcgis/core/views/webgl/reservedWordsGLSL3.js","../../../../../node_modules/@arcgis/core/chunks/builtins.js","../../../../../node_modules/@arcgis/core/views/webgl/ShaderTranspiler.js","../../../../../node_modules/@arcgis/core/views/webgl/Program.js","../../../../../node_modules/@arcgis/core/core/NestedMap.js","../../../../../node_modules/@arcgis/core/views/webgl/ProgramCache.js","../../../../../node_modules/@arcgis/core/views/webgl/ShaderCompiler.js","../../../../../node_modules/@arcgis/core/views/webgl/VertexArrayObject.js","../../../../../node_modules/@arcgis/core/views/webgl/programUtils.js","../../../../../node_modules/@arcgis/core/views/webgl/ProgramTemplate.js","../../../../../node_modules/@arcgis/core/core/fontUtils.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMResourceManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/DisplayObject.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/parameters.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/HighlightGradient.js","../../../../../node_modules/@arcgis/core/views/2d/engine/Container.js","../../../../../node_modules/@arcgis/core/views/2d/engine/ManagedCanvas.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/FreeList.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/BufferPool.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/VertexStream.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrush.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/BrushBitmap.js","../../../../../node_modules/@arcgis/core/chunks/vec4f32.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/sources/shaderRepository.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/sources/resolver.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/BackgroundPrograms.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/BrushClip.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/BrushOverlay.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/alignmentUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/materialKey/MaterialKey.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLGeometryBrush.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/techniques/Technique.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/techniques/heatmap/TechniqueHeatmap.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/techniques/pieChart/TechniquePieChart.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/techniques/utils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushDotDensity.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/Effect.js","../../../../../node_modules/@arcgis/core/views/webgl/heatmapTextureUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/DefaultVertexAttributeLayouts.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/TileInfoPrograms.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/isWebGL2Context.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushInfo.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushPieChart.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushStencil.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/GeometryUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js","../../../../../node_modules/@arcgis/core/views/2d/engine/brushes.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/sources/resolver.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/Programs.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/BitBlitPrograms.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/BitBlitRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/MaterialPrograms.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/MaterialManager.js","../../../../../node_modules/@arcgis/core/core/BidiText.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMPlacements.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMEffects.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMImageColorSubstitutionHelper.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectAddControlPoints.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMCursor.js","../../../../../node_modules/@arcgis/core/symbols/cim/CurveHelper.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectArrow.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectBuffer.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectControlMeasureLine.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectCut.js","../../../../../node_modules/@arcgis/core/symbols/cim/GeometryWalker.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectDashes.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectDonut.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectJog.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectMove.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectOffset.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectReverse.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectRotate.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectScale.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/EffectWave.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementAlongLineSameSize.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementAtExtremities.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementAtRatioPositions.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementInsidePolygon.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementOnLine.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementOnVertices.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/PlacementPolygonCenter.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMOperators.js","../../../../../node_modules/@arcgis/core/symbols/cim/imageUtils.js","../../../../../node_modules/@arcgis/core/symbols/cim/Rect.js","../../../../../node_modules/@arcgis/core/symbols/cim/TextRasterizer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/collisions/BoundingBox.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/shapingUtils.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMSymbolDrawHelper.js","../../../../../node_modules/@arcgis/core/views/2d/arcade/callExpressionWithFeature.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMSymbolHelper.js","../../../../../node_modules/@arcgis/core/core/floatRGBA.js","../../../../../node_modules/@arcgis/core/symbols/cim/rasterizingUtils.js","../../../../../node_modules/@arcgis/core/symbols/cim/SDFHelper.js","../../../../../node_modules/@arcgis/core/symbols/cim/Rasterizer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/RectangleBinPack.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/GlyphMosaic.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/GlyphSource.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/SDFConverter.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/SpriteMosaic.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/imageutils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/grouping.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/animatedFormats/utils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/Result.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/symbolUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TextureManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TextureUploadManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/StencilPrograms.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WorldExtentClipRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/AnimationEffect.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/BlendPrograms.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/BlendEffect.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/FeatureEffect.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/HighlightPrograms.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/HighlightEffect.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/HittestEffect.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/HittestEffectVTL.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Bloom.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Blur.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Colorize.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/DropShadow.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/Opacity.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/effects/post-processing/EffectManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/painter/RenderPass.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/Painter.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/DisjointTimerQuery.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/Profiler.js","../../../../../node_modules/@arcgis/core/views/webgl/ContextState.js","../../../../../node_modules/@arcgis/core/views/support/AllocationTracer.js","../../../../../node_modules/@arcgis/core/views/webgl/InstanceCounter.js","../../../../../node_modules/@arcgis/core/views/webgl/Parameters.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/basicInterfaces.js","../../../../../node_modules/@arcgis/core/views/webgl/renderState.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/interfaces.js","../../../../../node_modules/@arcgis/core/views/webgl/AppleAmdDriverHelper.js","../../../../../node_modules/@arcgis/core/views/webgl/WebGLDriverTestModule.js","../../../../../node_modules/@arcgis/core/views/webgl/testAppleAmdDrawArrays.js","../../../../../node_modules/@arcgis/core/views/webgl/doublePrecisionUtils.js","../../../../../node_modules/@arcgis/core/views/webgl/testDoublePrecisionArithmetic.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/TransparencyPassType.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/OrderIndependentTransparency.js","../../../../../node_modules/@arcgis/core/views/webgl/testFloatBufferBlend.js","../../../../../node_modules/@arcgis/core/views/webgl/testSamplerPrecision.js","../../../../../node_modules/@arcgis/core/views/webgl/testSVGPremultipliedAlpha.js","../../../../../node_modules/@arcgis/core/views/webgl/WebGLDriverTest.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/DrawBuffers.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/load.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/LoseContext.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/VertexArrayObjects.js","../../../../../node_modules/@arcgis/core/views/webgl/capabilities/Capabilities.js","../../../../../node_modules/@arcgis/core/views/webgl/RenderingContext.js","../../../../../node_modules/@arcgis/core/views/2d/engine/Stage.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/collisions/CollisionGrid.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/collisions/CollisionEngine.js","../../../../../node_modules/@arcgis/core/views/2d/LabelManager.js","../../../../../node_modules/@arcgis/core/geometry/support/normalizeUtilsSync.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/DirtyMap.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/FreeList.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/DisplayRecordStore.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WGLBuffers.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TiledDisplayObject.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WGLTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/GraphicTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/MemoryRequirements.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TileBufferData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/GraphicDisplayList.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/MeshData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WGLDisplayRecord.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/serializationUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WGLDisplayObject.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TileDisplayData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/FeatureDisplayList.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexBuffer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/Writer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexVector.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TileData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/heuristics.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexDataWriter.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/tileUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/MeshData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/util.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/segmentUtils.js","../../../../../node_modules/@arcgis/core/symbols/cim/placements/CIMMarkerPlacementHelper.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js","../../../../../node_modules/@arcgis/core/symbols/cim/effects/CIMEffectHelper.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLTextTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/bufcut.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/templateUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseFillTemplate.js","../../../../../node_modules/@arcgis/core/symbols/cim/quantizeTime.js","../../../../../node_modules/@arcgis/core/symbols/cim/cimAnalyzer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicMeshTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/textUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/Lock.js","../../../../../node_modules/@arcgis/core/symbols/cim/ExpandedCIM.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/cimSymbolUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLTemplateStore.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/mesh/factories/WGLMeshFactory.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/Matcher.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/util/vvFlagUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/createSymbolSchema.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/graphicsUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/pixelBuffering.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/rendererUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/util.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/schemaUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/GraphicsReader.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/GraphicStoreItem.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/GraphicStore.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/GraphicsView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/AttributeStoreView.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/Mesh2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/ClippingInfo.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WGLContainer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/TileContainer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/WGLRendererInfo.js","../../../../../node_modules/@arcgis/core/views/2d/engine/FeatureContainer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/GraphicBoundsRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/BaseGraphicContainer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/GraphicContainer.js","../../../../../node_modules/@arcgis/core/views/2d/navigation/ZoomBox.js","../../../../../node_modules/@arcgis/core/views/navigation/FilteredFiniteDifference.js","../../../../../node_modules/@arcgis/core/views/navigation/Momentum.js","../../../../../node_modules/@arcgis/core/views/navigation/PanPlanarMomentumEstimator.js","../../../../../node_modules/@arcgis/core/views/2d/navigation/actions/Pan.js","../../../../../node_modules/@arcgis/core/views/navigation/MomentumEstimator.js","../../../../../node_modules/@arcgis/core/views/navigation/RotationMomentumEstimator.js","../../../../../node_modules/@arcgis/core/views/navigation/ZoomMomentumEstimator.js","../../../../../node_modules/@arcgis/core/views/2d/navigation/actions/Pinch.js","../../../../../node_modules/@arcgis/core/views/2d/navigation/actions/Rotate.js","../../../../../node_modules/@arcgis/core/views/2d/navigation/MapViewNavigation.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/shaders/MagnifierPrograms.js","../../../../../node_modules/@arcgis/core/support/requestImageUtils.js","../../../../../node_modules/@arcgis/core/views/magnifier/resources.js","../../../../../node_modules/@arcgis/core/views/2d/magnifier/MagnifierView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/ImageryBitmapSource.js","../../../../../node_modules/@arcgis/core/views/2d/engine/Bitmap.js","../../../../../node_modules/@arcgis/core/views/2d/engine/BitmapTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/BitmapTileContainer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/BitmapTileLayerView2D.js","../../../../../node_modules/@arcgis/core/views/layers/support/ClipArea.js","../../../../../node_modules/@arcgis/core/views/layers/support/ClipRect.js","../../../../../node_modules/@arcgis/core/views/layers/support/Geometry.js","../../../../../node_modules/@arcgis/core/views/layers/support/Path.js","../../../../../node_modules/@arcgis/core/views/2d/layers/LayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/graphics/HighlightGraphicContainer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/imageUtils.js","../../../../../node_modules/@arcgis/core/views/layers/LayerView.js","../../../../../node_modules/@arcgis/core/views/layers/RefreshableLayerView.js","../../../../../node_modules/@arcgis/core/renderers/support/clickToleranceUtils.js","../../../../../node_modules/@arcgis/core/views/layers/support/popupUtils.js","../../../../../node_modules/@arcgis/core/views/layers/support/MapServiceLayerViewHelper.js","../../../../../node_modules/@arcgis/core/views/support/drapedUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/TileLayerView2D.js","../../../../../node_modules/@arcgis/core/AggregateGraphic.js","../../../../../node_modules/@arcgis/core/layers/effects/FeatureEffectView.js","../../../../../node_modules/@arcgis/core/rest/support/AggregateFeatureSet.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/BaseTileRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/support/HeatmapSource.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/HeatmapTileRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/collisions/MetricReader.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/Buffer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/cpuMapped/Geometry.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/FeatureTile.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/tileRenderers.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/FeatureCommandQueue.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/FeatureLayerProxy.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/visualVariableSimpleUtils.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileManager.js","../../../../../node_modules/@arcgis/core/views/layers/FeatureLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/FeatureLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/BitmapContainer.js","../../../../../node_modules/@arcgis/core/views/2d/viewStateUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/ExportStrategy.js","../../../../../node_modules/@arcgis/core/views/2d/layers/BaseDynamicLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/GeoRSSLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/GraphicsLayerView2D.js","../../../../../node_modules/@arcgis/core/views/layers/GroupLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/GroupLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/utils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/styles/Imagery.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/styles/Particles.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/styles/Stack.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/styles/Streamlines.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/createFlowStyle.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/BrushFlow.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/FlowContainer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/FlowDisplayData.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/FlowDisplayObject.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/FlowStrategy.js","../../../../../node_modules/@arcgis/core/views/2d/engine/flow/FlowView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/imagery/ImageryView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/BrushVectorField.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFContainer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFDisplayObject.js","../../../../../node_modules/@arcgis/core/views/2d/layers/imagery/ImageryVFStrategy.js","../../../../../node_modules/@arcgis/core/views/2d/layers/imagery/VectorFieldView2D.js","../../../../../node_modules/@arcgis/core/views/layers/ImageryLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/ImageryLayerView2D.js","../../../../../node_modules/@arcgis/core/layers/support/DimensionalDefinition.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/multidimensionalUtils.js","../../../../../node_modules/@arcgis/core/views/webgl/rasterUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterBitmap.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/colorizer/utils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/colorizer/lut.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/colorizer/shadedrelief.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/colorizer/stretch.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/colorizer/rasterColorizer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/utils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/aspectProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/bandArithmeticProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/compositeBandProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/contrastProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/convolutionProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/curvatureProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/extractBandProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/focalStatisticsProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/localProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/maskProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/ndviProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/remapProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/reprojectProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/slopeProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/stretchProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/processor/rasterProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/BrushRasterBitmap.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterTileContainer.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/EphemeralBlockCache.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/RawBlockCache.js","../../../../../node_modules/@arcgis/core/views/2d/layers/imagery/BaseImageryTileSubView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/imagery/ImageryTileView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFTileContainer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/imagery/VectorFieldTileView2D.js","../../../../../node_modules/@arcgis/core/views/layers/ImageryTileLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/ImageryTileLayerView2D.js","../../../../../node_modules/@arcgis/core/layers/support/kmlUtils.js","../../../../../node_modules/@arcgis/core/views/support/imageReprojection.js","../../../../../node_modules/@arcgis/core/views/2d/layers/KMLLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/KnowledgeGraphLayerView2D.js","../../../../../node_modules/@arcgis/core/views/layers/MapImageLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/MapImageLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/MapNotesLayerView2D.js","../../../../../node_modules/@arcgis/core/layers/support/MediaElementView.js","../../../../../node_modules/@arcgis/core/core/perspectiveUtils.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/Overlay.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/OverlayContainer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/MediaLayerView2D.js","../../../../../node_modules/@arcgis/core/views/layers/OGCFeatureLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/OGCFeatureLayerView2D.js","../../../../../node_modules/@arcgis/core/rest/support/networkEnums.js","../../../../../node_modules/@arcgis/core/rest/support/DirectionLine.js","../../../../../node_modules/@arcgis/core/rest/support/DirectionPoint.js","../../../../../node_modules/@arcgis/core/rest/route/utils.js","../../../../../node_modules/@arcgis/core/rest/support/PointBarrier.js","../../../../../node_modules/@arcgis/core/rest/support/PolygonBarrier.js","../../../../../node_modules/@arcgis/core/rest/support/PolylineBarrier.js","../../../../../node_modules/@arcgis/core/rest/support/TravelMode.js","../../../../../node_modules/@arcgis/core/rest/support/RouteSettings.js","../../../../../node_modules/@arcgis/core/rest/support/RouteInfo.js","../../../../../node_modules/@arcgis/core/rest/support/Stop.js","../../../../../node_modules/@arcgis/core/views/2d/layers/RouteLayerView2D.js","../../../../../node_modules/@arcgis/core/views/layers/StreamLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/StreamLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/SubtypeGroupLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/RectangleBinPack.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/GlyphMosaic.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/GlyphSource.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/SpriteMosaic.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileHandler.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/TileManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/core.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/util.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/RenderBucket.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/VectorTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/jobs.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/decluttering/SymbolFader.js","../../../../../node_modules/@arcgis/core/views/2d/engine/webgl/RenderableTile.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/VectorTileContainer.js","../../../../../node_modules/@arcgis/core/views/2d/tiling/TileInfoViewPOT.js","../../../../../node_modules/@arcgis/core/views/2d/layers/VectorTileLayerView2D.js","../../../../../node_modules/@arcgis/core/layers/support/TelemetryDisplay.js","../../../../../node_modules/@arcgis/core/views/2d/layers/VideoLayerView2D.js","../../../../../node_modules/@arcgis/core/layers/support/ExportWMSImageParameters.js","../../../../../node_modules/@arcgis/core/views/layers/WMSLayerView.js","../../../../../node_modules/@arcgis/core/views/2d/layers/WMSLayerView2D.js","../../../../../node_modules/@arcgis/core/views/2d/layers/WMTSLayerView2D.js","../../../../../node_modules/@arcgis/core/core/image/gif.js","../../../../../node_modules/@arcgis/core/core/image/apng.js","../../../../../node_modules/@esri/calcite-components/dist/components/form.js","../../../../../node_modules/@esri/calcite-components/dist/components/interactive.js","../../../../../node_modules/@esri/calcite-components/dist/components/label2.js","../../../../../node_modules/@esri/calcite-components/dist/components/loadable.js","../../../../../node_modules/@esri/calcite-components/dist/components/key.js","../../../../../node_modules/@esri/calcite-components/dist/components/observers.js","../../../../../node_modules/@esri/calcite-components/dist/components/locale.js","../../../../../node_modules/@esri/calcite-components/dist/components/component.js","../../../../../node_modules/@esri/calcite-components/dist/components/t9n.js","../../../../../node_modules/@esri/calcite-components/dist/components/globalAttributes.js","../../../../../node_modules/@esri/calcite-components/dist/components/icon.js","../../../../../node_modules/@esri/calcite-components/dist/components/loader.js","../../../../../node_modules/@esri/calcite-components/dist/components/button.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-button.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-icon.js","../../../../../node_modules/@arcgis/core/portal/support/jsonContext.js","../../../../../node_modules/@arcgis/core/portal/support/layersLoader.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshTexture.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshTextureTransform.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshMaterial.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshMaterialMetallicRoughness.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshVertexAttributes.js","../../../../../node_modules/@arcgis/core/geometry/support/MeshComponent.js","../../../../../node_modules/@arcgis/core/geometry/support/meshErrors.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Attribute.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObjectType.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/AttributeArray.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/BoundingInfo.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObject.js","../../../../../node_modules/@arcgis/core/geometry/support/triangle.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/geometryDataUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Object3DStateID.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/renderers/utils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Geometry.js","../../../../../node_modules/@arcgis/core/views/3d/layers/graphics/polygonUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/triangulationUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/bounds.js","../../../../../node_modules/@arcgis/core/geometry/projection/projectPointToVector.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/centerAt.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/loadExternal.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/External.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/Metadata.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/offset.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/primitives.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/rotate.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/scale.js","../../../../../node_modules/@arcgis/core/support/zipUtils.js","../../../../../node_modules/@arcgis/core/geometry/Mesh.js","../../../../../node_modules/@arcgis/core/rest/support/meshFeatureSet.js","../../../../../node_modules/@arcgis/core/rest/versionManagement/gdbVersion/deleteForwardEdits.js","../../../../../node_modules/@arcgis/core/rest/versionManagement/gdbVersion/support/DeleteForwardEditsParameters.js","../../../../../node_modules/@arcgis/core/layers/graphics/editingSupport.js","../../../../../node_modules/@arcgis/core/core/multiOriginJSONSupportUtils.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/originUtils.js","../../../../../node_modules/@arcgis/core/webdoc/saveAPIKeyUtils.js","../../../../../node_modules/@arcgis/core/layers/save/utils.js","../../../../../node_modules/@arcgis/core/layers/save/featureLayerUtils.js","../../../../../node_modules/@arcgis/core/geometry/support/meshVertexSpaceUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/applyEditsUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/FeatureLayerSource.js","../../../../../node_modules/@arcgis/core/symbols/support/symbolLayerUtils.js","../../../../../node_modules/@arcgis/core/symbols/support/previewWebStyleSymbol.js","../../../../../node_modules/@arcgis/core/symbols/support/previewSymbol2D.js","../../../../../node_modules/@arcgis/core/symbols/cim/CIMSymbolRasterizer.js","../../../../../node_modules/@arcgis/core/symbols/support/previewCIMSymbol.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-loader.js","../../../../../node_modules/@arcgis/core/geometry/geometryEngineAsync.js","../../../../../node_modules/@arcgis/core/arcade/portalUtils.js","../../../../../node_modules/@arcgis/core/portal/support/utils.js","../../../../../node_modules/@arcgis/core/arcade/functions/geomasync.js","../../../../../node_modules/@arcgis/core/arcade/arcadeAsyncRuntime.js","../../../../../node_modules/@arcgis/core/arcade/featureSetCollection.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/cache.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/FeatureSetIterator.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/IdSet.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/sqlUtils.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/stats.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/FeatureSet.js","../../../../../node_modules/@arcgis/core/arcade/featureset/actions/AttributeFilter.js","../../../../../node_modules/@arcgis/core/arcade/featureset/actions/Adapted.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/OrderbyClause.js","../../../../../node_modules/@arcgis/core/arcade/featureset/actions/OrderBy.js","../../../../../node_modules/@arcgis/core/arcade/featureset/support/StatsField.js","../../../../../node_modules/@arcgis/core/arcade/featureset/actions/GroupBy.js","../../../../../node_modules/@arcgis/core/arcade/featureset/sources/Empty.js","../../../../../node_modules/@arcgis/core/arcade/featureset/actions/SpatialFilter.js","../../../../../node_modules/@arcgis/core/arcade/featureset/actions/Top.js","../../../../../node_modules/@arcgis/core/layers/support/SubtypeSublayer.js","../../../../../node_modules/@arcgis/core/layers/SubtypeGroupLayer.js","../../../../../node_modules/@arcgis/core/arcade/featureset/sources/FeatureLayerDynamic.js","../../../../../node_modules/@arcgis/core/arcade/featureset/sources/FeatureLayerMemory.js","../../../../../node_modules/@arcgis/core/arcade/featureset/sources/FeatureLayerRelated.js","../../../../../node_modules/@arcgis/core/arcade/featureSetUtils.js","../../../../../node_modules/@arcgis/core/arcade/functions/featuresetbase.js","../../../../../node_modules/@arcgis/core/arcade/functions/featuresetgeom.js","../../../../../node_modules/@arcgis/core/arcade/functions/featuresetstats.js","../../../../../node_modules/@arcgis/core/arcade/functions/featuresetstring.js","../../../../../node_modules/@arcgis/core/layers/BaseTileLayer.js","../../../../../node_modules/@arcgis/core/layers/BingMapsLayer.js","../../../../../node_modules/@arcgis/core/layers/buildingSublayers/BuildingSublayer.js","../../../../../node_modules/@arcgis/core/layers/support/capabilities.js","../../../../../node_modules/@arcgis/core/layers/support/I3SIndexInfo.js","../../../../../node_modules/@arcgis/core/layers/support/I3SLayerDefinitions.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/interfaces.js","../../../../../node_modules/@arcgis/core/views/3d/layers/support/edgeUtils.js","../../../../../node_modules/@arcgis/core/views/3d/layers/support/symbolColorUtils.js","../../../../../node_modules/@arcgis/core/views/3d/support/orientedBoundingBox.js","../../../../../node_modules/@arcgis/core/views/3d/layers/i3s/I3SUtil.js","../../../../../node_modules/@arcgis/core/layers/buildingSublayers/BuildingComponentSublayer.js","../../../../../node_modules/@arcgis/core/layers/buildingSublayers/BuildingGroupSublayer.js","../../../../../node_modules/@arcgis/core/layers/support/schemaValidatorLoader.js","../../../../../node_modules/@arcgis/core/webdoc/support/saveUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/SceneService.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterAuthoringInfo.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterAuthoringInfoType.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterAuthoringInfoBlock.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterAuthoringInfoCheckbox.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterMode.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterModeSolid.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterModeWireFrame.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterModeXRay.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilterBlock.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingFilter.js","../../../../../node_modules/@arcgis/core/layers/support/BuildingSummaryStatistics.js","../../../../../node_modules/@arcgis/core/support/elevationInfoUtils.js","../../../../../node_modules/@arcgis/core/layers/BuildingSceneLayer.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/CSVSource.js","../../../../../node_modules/@arcgis/core/layers/CSVLayer.js","../../../../../node_modules/@arcgis/core/analysis/Analysis.js","../../../../../node_modules/@arcgis/core/analysis/DimensionSimpleStyle.js","../../../../../node_modules/@arcgis/core/analysis/dimensionUtils.js","../../../../../node_modules/@arcgis/core/analysis/LengthDimension.js","../../../../../node_modules/@arcgis/core/analysis/DimensionAnalysis.js","../../../../../node_modules/@arcgis/core/layers/DimensionLayer.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/GeoJSONSource.js","../../../../../node_modules/@arcgis/core/layers/GeoJSONLayer.js","../../../../../node_modules/@arcgis/core/layers/GeoRSSLayer.js","../../../../../node_modules/@arcgis/core/support/tagSymbols.js","../../../../../node_modules/@arcgis/core/layers/GroupLayer.js","../../../../../node_modules/@arcgis/core/renderers/FlowRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/ColormapInfo.js","../../../../../node_modules/@arcgis/core/renderers/RasterColormapRenderer.js","../../../../../node_modules/@arcgis/core/renderers/RasterShadedReliefRenderer.js","../../../../../node_modules/@arcgis/core/renderers/RasterStretchRenderer.js","../../../../../node_modules/@arcgis/core/renderers/VectorFieldRenderer.js","../../../../../node_modules/@arcgis/core/rasterRenderers.js","../../../../../node_modules/@arcgis/core/layers/support/rasterEnums.js","../../../../../node_modules/@arcgis/core/layers/support/RasterFunctionInfo.js","../../../../../node_modules/@arcgis/core/layers/support/RasterFunctionVariable.js","../../../../../node_modules/@arcgis/core/layers/support/RasterFunctionProperties.js","../../../../../node_modules/@arcgis/core/layers/support/RasterFunctionTemplate.js","../../../../../node_modules/@arcgis/core/layers/support/RasterFunction.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/rasterFunctionSchema.js","../../../../../node_modules/@arcgis/core/layers/support/imageryRendererUtils.js","../../../../../node_modules/@arcgis/core/layers/support/MosaicRule.js","../../../../../node_modules/@arcgis/core/layers/support/ExportImageServiceParameters.js","../../../../../node_modules/@arcgis/core/layers/support/MultidimensionalSubset.js","../../../../../node_modules/@arcgis/core/layers/support/RasterJobHandler.js","../../../../../node_modules/@arcgis/core/renderers/support/rasterRendererHelper.js","../../../../../node_modules/@arcgis/core/rest/support/ImageAngleResult.js","../../../../../node_modules/@arcgis/core/rest/support/BaseImageMeasureResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImageAreaResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImageDistanceResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImageHeightResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImageIdentifyResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImagePixelLocationResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImagePointResult.js","../../../../../node_modules/@arcgis/core/rest/support/ImageSample.js","../../../../../node_modules/@arcgis/core/rest/support/ImageSampleResult.js","../../../../../node_modules/@arcgis/core/rest/imageService.js","../../../../../node_modules/@arcgis/core/rest/imageService/fetchRasterInfo.js","../../../../../node_modules/@arcgis/core/rest/imageService/getCatalogItemRasterInfo.js","../../../../../node_modules/@arcgis/core/rest/support/ImageAngleParameters.js","../../../../../node_modules/@arcgis/core/rest/support/BaseImageMeasureParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImageAreaParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImageDistanceParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImageHeightParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImageHistogramParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImageIdentifyParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImagePixelLocationParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImagePointParameters.js","../../../../../node_modules/@arcgis/core/rest/support/ImageSampleParameters.js","../../../../../node_modules/@arcgis/core/layers/mixins/ArcGISImageService.js","../../../../../node_modules/@arcgis/core/layers/ImageryLayer.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/BaseRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/FunctionRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterFunctions/clipUtils.js","../../../../../node_modules/@arcgis/core/layers/mixins/ImageryTileMixin.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/DBFParser.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/CloudRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/InMemoryRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/xmlUtilities.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/pamParser.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/ImageAuxRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/ImageServerRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/MRFRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/TIFFRaster.js","../../../../../node_modules/@arcgis/core/layers/support/rasterDatasets/RasterFactory.js","../../../../../node_modules/@arcgis/core/layers/ImageryTileLayer.js","../../../../../node_modules/@arcgis/core/portal/support/resourceExtension.js","../../../../../node_modules/@arcgis/core/core/accessorSupport/decorators/persistable.js","../../../../../node_modules/@arcgis/core/layers/support/SceneModification.js","../../../../../node_modules/@arcgis/core/layers/support/SceneModifications.js","../../../../../node_modules/@arcgis/core/layers/IntegratedMeshLayer.js","../../../../../node_modules/@arcgis/core/layers/support/KMLSublayer.js","../../../../../node_modules/@arcgis/core/layers/KMLLayer.js","../../../../../node_modules/@arcgis/core/analysis/featureReferenceUtils.js","../../../../../node_modules/@arcgis/core/analysis/LineOfSightAnalysisObserver.js","../../../../../node_modules/@arcgis/core/analysis/LineOfSightAnalysisTarget.js","../../../../../node_modules/@arcgis/core/analysis/LineOfSightAnalysis.js","../../../../../node_modules/@arcgis/core/layers/LineOfSightLayer.js","../../../../../node_modules/@arcgis/core/layers/knowledgeGraph/SessionMemoryStorage.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphQueryResult.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphQueryStreamingResult.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/FieldIndex.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphProperty.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphObjectType.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/EntityType.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/RelationshipType.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/DataModel.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/ServiceDefinition.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/KnowledgeGraph.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphObject.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphNamedObject.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/Entity.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/Relationship.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/SearchIndex.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/ObjectValue.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/Path.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/KnowledgeWasmInterface.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/WasmQueryWrapperInterfaces.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/wasmToGeometryFactories.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraphService.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphQuery.js","../../../../../node_modules/@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js","../../../../../node_modules/@arcgis/core/layers/knowledgeGraph/supportUtils.js","../../../../../node_modules/@arcgis/core/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js","../../../../../node_modules/@arcgis/core/layers/knowledgeGraph/KnowledgeGraphSublayerBase.js","../../../../../node_modules/@arcgis/core/layers/knowledgeGraph/KnowledgeGraphSublayer.js","../../../../../node_modules/@arcgis/core/libs/linkchartlayout/LinkChartLayout.js","../../../../../node_modules/@arcgis/core/layers/LinkChartLayer.js","../../../../../node_modules/@arcgis/core/layers/MapNotesLayer.js","../../../../../node_modules/@arcgis/core/layers/support/GeoreferenceBase.js","../../../../../node_modules/@arcgis/core/layers/support/ControlPointsGeoreference.js","../../../../../node_modules/@arcgis/core/layers/support/CornersGeoreference.js","../../../../../node_modules/@arcgis/core/layers/support/ExtentAndRotationGeoreference.js","../../../../../node_modules/@arcgis/core/layers/support/MediaElementBase.js","../../../../../node_modules/@arcgis/core/layers/support/ImageElement.js","../../../../../node_modules/@arcgis/core/layers/support/VideoElement.js","../../../../../node_modules/@arcgis/core/layers/support/LocalMediaElementSource.js","../../../../../node_modules/@arcgis/core/layers/MediaLayer.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/OGCFeatureSource.js","../../../../../node_modules/@arcgis/core/layers/OGCFeatureLayer.js","../../../../../node_modules/@arcgis/core/layers/support/WMTSLayerInfo.js","../../../../../node_modules/@arcgis/core/layers/WebTileLayer.js","../../../../../node_modules/@arcgis/core/layers/OpenStreetMapLayer.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/constants/wkid.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/constants/utils.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/core/CameraOrientation.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/core/CameraOrientationHPR.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/core/CameraOrientationOPK.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/core/CameraOrientationYPR.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/core/ElevationSourceDefinitions.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/enums/CameraOrientationType.js","../../../../../node_modules/@arcgis/core/layers/orientedImagery/core/utils.js","../../../../../node_modules/@arcgis/core/layers/OrientedImageryLayer.js","../../../../../node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudFilter.js","../../../../../node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudBitfieldFilter.js","../../../../../node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudReturnFilter.js","../../../../../node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudValueFilter.js","../../../../../node_modules/@arcgis/core/layers/pointCloudFilters/typeUtils.js","../../../../../node_modules/@arcgis/core/renderers/PointCloudRGBRenderer.js","../../../../../node_modules/@arcgis/core/renderers/support/pointCloud/typeUtils.js","../../../../../node_modules/@arcgis/core/layers/PointCloudLayer.js","../../../../../node_modules/@arcgis/core/layers/support/RouteStopSymbols.js","../../../../../node_modules/@arcgis/core/layers/support/RouteSymbols.js","../../../../../node_modules/@arcgis/core/rest/support/NetworkAttribute.js","../../../../../node_modules/@arcgis/core/rest/support/NetworkDataset.js","../../../../../node_modules/@arcgis/core/rest/support/NetworkServiceDescription.js","../../../../../node_modules/@arcgis/core/rest/networkService.js","../../../../../node_modules/@arcgis/core/rest/support/GPMessage.js","../../../../../node_modules/@arcgis/core/rest/support/NAMessage.js","../../../../../node_modules/@arcgis/core/rest/support/DirectionsString.js","../../../../../node_modules/@arcgis/core/rest/support/DirectionsEvent.js","../../../../../node_modules/@arcgis/core/rest/support/DirectionsFeature.js","../../../../../node_modules/@arcgis/core/rest/support/DirectionsFeatureSet.js","../../../../../node_modules/@arcgis/core/rest/support/RouteResult.js","../../../../../node_modules/@arcgis/core/rest/support/RouteSolveResult.js","../../../../../node_modules/@arcgis/core/rest/route.js","../../../../../node_modules/@arcgis/core/rest/support/commonProperties.js","../../../../../node_modules/@arcgis/core/rest/support/DataLayer.js","../../../../../node_modules/@arcgis/core/rest/support/NetworkFeatureSet.js","../../../../../node_modules/@arcgis/core/rest/support/NetworkUrl.js","../../../../../node_modules/@arcgis/core/rest/support/RouteParameters.js","../../../../../node_modules/@arcgis/core/layers/RouteLayer.js","../../../../../node_modules/@arcgis/core/layers/support/RangeInfo.js","../../../../../node_modules/@arcgis/core/layers/support/PolygonCollection.js","../../../../../node_modules/@arcgis/core/layers/support/SceneFilter.js","../../../../../node_modules/@arcgis/core/layers/SceneLayer.js","../../../../../node_modules/@arcgis/core/layers/support/PurgeOptions.js","../../../../../node_modules/@arcgis/core/layers/StreamLayer.js","../../../../../node_modules/@arcgis/core/layers/TileLayer.js","../../../../../node_modules/@arcgis/core/layers/UnknownLayer.js","../../../../../node_modules/@arcgis/core/layers/UnsupportedLayer.js","../../../../../node_modules/@arcgis/core/layers/support/imageUtils.js","../../../../../node_modules/@arcgis/core/layers/support/SpriteSource.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/TilemapIndex.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/TilemapRequest.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/style/VectorTileSource.js","../../../../../node_modules/@arcgis/core/layers/support/vectorTileLayerLoader.js","../../../../../node_modules/@arcgis/core/views/2d/engine/vectorTiles/tileInfoUtils.js","../../../../../node_modules/@arcgis/core/layers/VectorTileLayer.js","../../../../../node_modules/@arcgis/core/layers/voxel/voxelPlaneUtils.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelSlice.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelSection.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelSimpleShading.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelFormat.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelVariable.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelIsosurface.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelColorStop.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelOpacityStop.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelRangeFilter.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelTransferFunctionStyle.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelUniqueValue.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelVariableStyle.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelIrregularSpacing.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelRegularSpacing.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelDimension.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelVolume.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelVolumeIndex.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelDynamicSection.js","../../../../../node_modules/@arcgis/core/layers/voxel/VoxelVolumeStyle.js","../../../../../node_modules/@arcgis/core/layers/VoxelLayer.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/WFSSource.js","../../../../../node_modules/@arcgis/core/layers/WFSLayer.js","../../../../../node_modules/@arcgis/core/layers/ogc/crsUtils.js","../../../../../node_modules/@arcgis/core/layers/support/WMSSublayer.js","../../../../../node_modules/@arcgis/core/layers/support/wmsUtils.js","../../../../../node_modules/@arcgis/core/layers/WMSLayer.js","../../../../../node_modules/@arcgis/core/layers/support/TileMatrixSet.js","../../../../../node_modules/@arcgis/core/layers/support/WMTSStyle.js","../../../../../node_modules/@arcgis/core/layers/support/WMTSSublayer.js","../../../../../node_modules/@arcgis/core/layers/support/wmtsUtils.js","../../../../../node_modules/@arcgis/core/layers/WMTSLayer.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/processors/BaseProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/processors/HeatmapProcessor.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/ResourceManagerProxy.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/processors/SymbolProcessor.js","../../../../../node_modules/@arcgis/core/layers/support/labelFormatUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/whereUtils.js","../../../../../node_modules/@arcgis/core/views/2d/layers/features/support/FeatureFilter.js","../../../../../node_modules/@arcgis/core/chunks/lerc-wasm.js","../../../../../node_modules/@arcgis/core/chunks/i3s.js","../../../../../node_modules/@arcgis/core/chunks/libtess-asm.js","../../../../../node_modules/@arcgis/core/chunks/libtess.js","../../../../../node_modules/@arcgis/core/chunks/Theme.js","../../../../../node_modules/@arcgis/core/chunks/Tooltip.js","../../../../../node_modules/@arcgis/core/chunks/DefaultTheme.js","../../../../../node_modules/@arcgis/core/chunks/chartUtilsAm5.js","../../../../../node_modules/@arcgis/core/chunks/Responsive.js","../../../../../node_modules/@arcgis/core/chunks/Button.js","../../../../../node_modules/@arcgis/core/chunks/ColorSet.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureMedia/chartCommon.js","../../../../../node_modules/@arcgis/core/chunks/Tick.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureMedia/pieChart.js","../../../../../node_modules/@arcgis/core/chunks/LineSeries.js","../../../../../node_modules/@arcgis/core/widgets/Feature/FeatureMedia/xyChart.js","../../../../../node_modules/@esri/calcite-components/dist/components/utils3.js","../../../../../node_modules/@esri/calcite-components/dist/components/sortableComponent.js","../../../../../node_modules/@esri/calcite-components/dist/components/stack.js","../../../../../node_modules/@esri/calcite-components/dist/components/debounce.js","../../../../../node_modules/@esri/calcite-components/dist/components/filter2.js","../../../../../node_modules/@esri/calcite-components/dist/components/progress.js","../../../../../node_modules/@esri/calcite-components/dist/components/input.js","../../../../../node_modules/@esri/calcite-components/dist/components/filter.js","../../../../../node_modules/@esri/calcite-components/dist/components/scrim.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-list.js","../../../../../node_modules/@esri/calcite-components/dist/components/action.js","../../../../../node_modules/@esri/calcite-components/dist/components/handle.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-list-item.js","../../../../../node_modules/@esri/calcite-components/dist/components/conditionalSlot.js","../../../../../node_modules/@esri/calcite-components/dist/components/resources.js","../../../../../node_modules/@esri/calcite-components/dist/components/openCloseComponent.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-notice.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-action.js","../../../../../node_modules/@esri/calcite-components/dist/components/array.js","../../../../../node_modules/@esri/calcite-components/dist/components/floating-ui.js","../../../../../node_modules/@esri/calcite-components/dist/components/focusTrapComponent.js","../../../../../node_modules/@esri/calcite-components/dist/components/Heading.js","../../../../../node_modules/@esri/calcite-components/dist/components/FloatingArrow.js","../../../../../node_modules/@esri/calcite-components/dist/components/popover.js","../../../../../node_modules/@esri/calcite-components/dist/components/action-menu.js","../../../../../node_modules/@esri/calcite-components/dist/components/panel.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-flow-item.js","../../../../../node_modules/@esri/calcite-components/dist/components/action-group.js","../../../../../node_modules/@esri/calcite-components/dist/components/ExpandToggle.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-action-bar.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-action-group.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-flow.js","../../../../../node_modules/@esri/calcite-components/dist/components/calcite-list-item-group.js","../../../../../node_modules/@arcgis/core/views/2d/layers/support/webStyleUtils.js","../../../../../node_modules/@arcgis/core/views/magnifier/mask-svg.js","../../../../../node_modules/@arcgis/core/views/magnifier/overlay-svg.js","../../../../../node_modules/@arcgis/core/chunks/vec42.js","../../../../../node_modules/@arcgis/core/chunks/mat32.js","../../../../../node_modules/@arcgis/core/chunks/mat42.js","../../../../../node_modules/@arcgis/core/chunks/scalar.js","../../../../../node_modules/@arcgis/core/chunks/vec22.js","../../../../../node_modules/@arcgis/core/chunks/vec33.js","../../../../../node_modules/@arcgis/core/chunks/vec43.js","../../../../../node_modules/@arcgis/core/geometry/support/buffer/utils.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/DefaultLoadingContext.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/LoaderResult.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/BinaryStreamReader.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/enums.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/fillDefaults.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/pathUtils.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/resourceUtils.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/Resource.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/loader.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/indexUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/loadGLTFMesh.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/deflate.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/inflate.js","../../../../../node_modules/@zip.js/zip.js/lib/core/constants.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/stream-adapter.js","../../../../../node_modules/@zip.js/zip.js/lib/core/configuration.js","../../../../../node_modules/@zip.js/zip.js/lib/core/util/mime-type.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/crc32.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/crc32-stream.js","../../../../../node_modules/@zip.js/zip.js/lib/core/util/encode-text.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/codecs/sjcl.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/common-crypto.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/aes-crypto-stream.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/zip-crypto-stream.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js","../../../../../node_modules/@zip.js/zip.js/lib/core/streams/codec-stream.js","../../../../../node_modules/@zip.js/zip.js/lib/core/codec-worker.js","../../../../../node_modules/@zip.js/zip.js/lib/core/codec-pool.js","../../../../../node_modules/@zip.js/zip.js/lib/z-worker-inline.js","../../../../../node_modules/@zip.js/zip.js/lib/core/io.js","../../../../../node_modules/@zip.js/zip.js/lib/core/util/cp437-decode.js","../../../../../node_modules/@zip.js/zip.js/lib/core/util/decode-text.js","../../../../../node_modules/@zip.js/zip.js/lib/core/zip-entry.js","../../../../../node_modules/@zip.js/zip.js/lib/core/zip-reader.js","../../../../../node_modules/@zip.js/zip.js/lib/zip-fs.js","../../../../../node_modules/@zip.js/zip.js/index.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/glb.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/types.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/bufferview.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/buffer.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/geometry.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/gltf.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/asset.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/scene.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/node.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/index.js","../../../../../node_modules/@arcgis/core/geometry/support/meshUtils/exporters/gltf/gltfexport.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/uploadAssetErrors.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/uploadProgressWeights.js","../../../../../node_modules/@arcgis/core/support/progressUtils.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/uploads.js","../../../../../node_modules/@arcgis/core/layers/graphics/sources/support/uploadAssets.js","../../../../../node_modules/@arcgis/core/geometry/support/FloatArray.js","../../../../../node_modules/@arcgis/core/views/3d/glTF/internal/TextureTransformUtils.js","../../../../../node_modules/@arcgis/core/views/3d/layers/graphics/ProcessedObjectResource.js","../../../../../node_modules/@arcgis/core/libs/basisu/BasisU.js","../../../../../node_modules/@arcgis/core/libs/basisu/TextureFormat.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/BasisUtil.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/DDSUtil.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/textureUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Texture.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/BindType.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Uniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLMaterial.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLTextureMaterial.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/MaterialUtil.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Material.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderSlot.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/verticalOffsetUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultBufferWriter.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/Program.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/StencilUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/pbrUtils.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloat16Encoding.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/support/debugFlags.js","../../../../../node_modules/@arcgis/core/views/3d/layers/support/FastSymbolUpdates.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/VisualVariablePassParameters.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/FBOCache.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/effects/RenderPlugin.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js","../../../../../node_modules/@arcgis/core/chunks/SSAOBlur.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/effects/ssao/SSAONoiseData.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/effects/ssao/SSAOParameters.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js","../../../../../node_modules/@arcgis/core/chunks/SSAO.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderFeature.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/effects/ssao/SSAO.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SceneLighting.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js","../../../../../node_modules/@arcgis/core/chunks/DefaultMaterial.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js","../../../../../node_modules/@arcgis/core/chunks/RealisticTree.glsl.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js","../../../../../node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial.js","../../../../../node_modules/@arcgis/core/views/3d/layers/graphics/wosrLoader.js","../../../../../node_modules/@arcgis/core/views/3d/layers/graphics/objectResourceUtils.js","../../../../../node_modules/@arcgis/core/layers/save/groupLayerUtils.js","../../../../../node_modules/@arcgis/core/layers/save/imageryUtils.js","../../../../../node_modules/@arcgis/core/chunks/arcgis-knowledge-client-core-simd.js","../../../../../node_modules/@arcgis/core/chunks/arcgis-knowledge-client-core.js","../../../../../node_modules/@arcgis/core/chunks/lclayout.js","../../../../../node_modules/@arcgis/core/layers/save/streamLayerUtils.js","../../../../../node_modules/@arcgis/core/chunks/ar.js","../../../../../node_modules/@arcgis/core/chunks/bg_BG.js","../../../../../node_modules/@arcgis/core/chunks/bs_BA.js","../../../../../node_modules/@arcgis/core/chunks/ca_ES.js","../../../../../node_modules/@arcgis/core/chunks/cs_CZ.js","../../../../../node_modules/@arcgis/core/chunks/da_DK.js","../../../../../node_modules/@arcgis/core/chunks/de_DE.js","../../../../../node_modules/@arcgis/core/chunks/de_CH.js","../../../../../node_modules/@arcgis/core/chunks/el_GR.js","../../../../../node_modules/@arcgis/core/chunks/en_US.js","../../../../../node_modules/@arcgis/core/chunks/en_CA.js","../../../../../node_modules/@arcgis/core/chunks/es_ES.js","../../../../../node_modules/@arcgis/core/chunks/et_EE.js","../../../../../node_modules/@arcgis/core/chunks/fi_FI.js","../../../../../node_modules/@arcgis/core/chunks/fr_FR.js","../../../../../node_modules/@arcgis/core/chunks/he_IL.js","../../../../../node_modules/@arcgis/core/chunks/hr_HR.js","../../../../../node_modules/@arcgis/core/chunks/hu_HU.js","../../../../../node_modules/@arcgis/core/chunks/id_ID.js","../../../../../node_modules/@arcgis/core/chunks/it_IT.js","../../../../../node_modules/@arcgis/core/chunks/ja_JP.js","../../../../../node_modules/@arcgis/core/chunks/ko_KR.js","../../../../../node_modules/@arcgis/core/chunks/lt_LT.js","../../../../../node_modules/@arcgis/core/chunks/lv_LV.js","../../../../../node_modules/@arcgis/core/chunks/nb_NO.js","../../../../../node_modules/@arcgis/core/chunks/nl_NL.js","../../../../../node_modules/@arcgis/core/chunks/pl_PL.js","../../../../../node_modules/@arcgis/core/chunks/pt_BR.js","../../../../../node_modules/@arcgis/core/chunks/pt_PT.js","../../../../../node_modules/@arcgis/core/chunks/ro_RO.js","../../../../../node_modules/@arcgis/core/chunks/ru_RU.js","../../../../../node_modules/@arcgis/core/chunks/sk_SK.js","../../../../../node_modules/@arcgis/core/chunks/sl_SL.js","../../../../../node_modules/@arcgis/core/chunks/sr_RS.js","../../../../../node_modules/@arcgis/core/chunks/sv_SE.js","../../../../../node_modules/@arcgis/core/chunks/th_TH.js","../../../../../node_modules/@arcgis/core/chunks/tr_TR.js","../../../../../node_modules/@arcgis/core/chunks/uk_UA.js","../../../../../node_modules/@arcgis/core/chunks/vi_VN.js","../../../../../node_modules/@arcgis/core/chunks/zh_Hans.js","../../../../../node_modules/@arcgis/core/chunks/zh_Hant.js","../../../../../node_modules/@arcgis/core/chunks/basis_transcoder.js"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","function _extends() {\n module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _extends.apply(this, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default isPropValid;\n","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport default murmur2;\n","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport default unitlessKeys;\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","import * as React from 'react';\nimport { useLayoutEffect } from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import { createContext, useContext, forwardRef, createElement, Fragment } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar hasOwnProperty = {}.hasOwnProperty;\n\nvar EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nif (process.env.NODE_ENV !== 'production') {\n EmotionCacheContext.displayName = 'EmotionCacheContext';\n}\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n // $FlowFixMe\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'EmotionThemeContext';\n}\n\nvar useTheme = function useTheme() {\n return useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {\n throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');\n }\n\n return mergedTheme;\n }\n\n if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {\n throw new Error('[ThemeProvider] Please make your theme prop a plain object');\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = useContext(ThemeContext);\n return /*#__PURE__*/createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n }; // $FlowFixMe\n\n\n var WithTheme = /*#__PURE__*/forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar getLastPart = function getLastPart(functionName) {\n // The match may be something like 'Object.createEmotionProps' or\n // 'Loader.prototype.render'\n var parts = functionName.split('.');\n return parts[parts.length - 1];\n};\n\nvar getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {\n // V8\n var match = /^\\s+at\\s+([A-Za-z0-9$.]+)\\s/.exec(line);\n if (match) return getLastPart(match[1]); // Safari / Firefox\n\n match = /^([A-Za-z0-9$.]+)@/.exec(line);\n if (match) return getLastPart(match[1]);\n return undefined;\n};\n\nvar internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS\n// identifiers, thus we only need to replace what is a valid character for JS,\n// but not for CSS.\n\nvar sanitizeIdentifier = function sanitizeIdentifier(identifier) {\n return identifier.replace(/\\$/g, '-');\n};\n\nvar getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {\n if (!stackTrace) return undefined;\n var lines = stackTrace.split('\\n');\n\n for (var i = 0; i < lines.length; i++) {\n var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just \"Error\"\n\n if (!functionName) continue; // If we reach one of these, we have gone too far and should quit\n\n if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an\n // uppercase letter\n\n if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);\n }\n\n return undefined;\n};\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration\n props.css.indexOf(':') !== -1) {\n throw new Error(\"Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`\" + props.css + \"`\");\n }\n\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when\n // the label hasn't already been computed\n\n if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {\n var label = getLabelFromStackTrace(new Error().stack);\n if (label) newProps[labelPropName] = label;\n }\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));\n\n if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {\n var labelFromStack = props[labelPropName];\n\n if (labelFromStack) {\n serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);\n }\n }\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {\n newProps[key] = props[key];\n }\n }\n\n newProps.ref = ref;\n newProps.className = className;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/createElement(WrappedComponent, newProps));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Emotion.displayName = 'EmotionCssPropInternal';\n}\n\nexport { CacheProvider as C, Emotion as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwnProperty as h, useTheme as u, withEmotionCache as w };\n","import { createElement, useContext, useRef, Fragment } from 'react';\nimport '@emotion/cache';\nimport { h as hasOwnProperty, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext } from './emotion-element-6a883da9.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-6a883da9.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport 'hoist-non-react-statics';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.10.4\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": \"./macro.js\"\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.js\",\n\t\t\"macro.d.ts\",\n\t\t\"macro.js.flow\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.10.0\",\n\t\t\"@emotion/cache\": \"^11.10.0\",\n\t\t\"@emotion/serialize\": \"^1.1.0\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.0\",\n\t\t\"@emotion/utils\": \"^1.2.0\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.0\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\t\"@babel/core\": \"^7.0.0\",\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@babel/core\": {\n\t\t\toptional: true\n\t\t},\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@babel/core\": \"^7.18.5\",\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.10.0\",\n\t\t\"@emotion/css-prettifier\": \"1.1.0\",\n\t\t\"@emotion/server\": \"11.10.0\",\n\t\t\"@emotion/styled\": \"11.10.4\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": \"./macro.js\"\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwnProperty.call(props, 'css')) {\n // $FlowFixMe\n return createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n var res = insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727 for some reason Jest evaluates modules twice if some consuming module gets mocked with jest.mock\n\n var isJest = typeof jest !== 'undefined';\n\n if (isBrowser && !isJest) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { useContext, createElement, Fragment } from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === undefined) {\n throw new Error('You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.');\n }\n }\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[i], args[0][i]);\n }\n } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class\n\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if ( // $FlowFixMe\n finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n newProps.ref = ref;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {\n return 'NO_COMPONENT_SELECTOR';\n } // $FlowFixMe: coerce undefined to string\n\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport default createStyled;\n","import '@babel/runtime/helpers/extends';\nimport 'react';\nimport '@emotion/is-prop-valid';\nimport createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@emotion/react';\nimport '@emotion/utils';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\nvar newStyled = createStyled.bind();\ntags.forEach(function (tagName) {\n // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type\n newStyled[tagName] = newStyled(tagName);\n});\n\nexport default newStyled;\n","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\n\n// prepend: true moves MUI styles to the top of the so they're loaded first.\n// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet cache;\nif (typeof document === 'object') {\n cache = createCache({\n key: 'css',\n prepend: true\n });\n}\nexport default function StyledEngineProvider(props) {\n const {\n injectFirst,\n children\n } = props;\n return injectFirst && cache ? /*#__PURE__*/_jsx(CacheProvider, {\n value: cache,\n children: children\n }) : children;\n}\nprocess.env.NODE_ENV !== \"production\" ? StyledEngineProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * By default, the styles are injected last in the element of the page.\n * As a result, they gain more specificity than any other style sheet.\n * If you want to override MUI's styles, set this prop.\n */\n injectFirst: PropTypes.bool\n} : void 0;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Global } from '@emotion/react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isEmpty(obj) {\n return obj === undefined || obj === null || Object.keys(obj).length === 0;\n}\nexport default function GlobalStyles(props) {\n const {\n styles,\n defaultTheme = {}\n } = props;\n const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty(themeInput) ? defaultTheme : themeInput) : styles;\n return /*#__PURE__*/_jsx(Global, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes = {\n defaultTheme: PropTypes.object,\n styles: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.object, PropTypes.func])\n} : void 0;","/**\n * @mui/styled-engine v5.15.11\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport emStyled from '@emotion/styled';\nexport default function styled(tag, options) {\n const stylesFactory = emStyled(tag, options);\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n return stylesFactory(...styles);\n };\n }\n return stylesFactory;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const internal_processStyles = (tag, processor) => {\n // Emotion attaches all the styles as `__emotion_styles`.\n // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186\n if (Array.isArray(tag.__emotion_styles)) {\n tag.__emotion_styles = processor(tag.__emotion_styles);\n }\n};\nexport { ThemeContext, keyframes, css } from '@emotion/react';\nexport { default as StyledEngineProvider } from './StyledEngineProvider';\nexport { default as GlobalStyles } from './GlobalStyles';","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js\nexport function isPlainObject(item) {\n if (typeof item !== 'object' || item === null) {\n return false;\n }\n const prototype = Object.getPrototypeOf(item);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);\n}\nfunction deepClone(source) {\n if (!isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? _extends({}, target) : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n // Avoid prototype pollution\n if (key === '__proto__') {\n return;\n }\n if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"values\", \"unit\", \"step\"];\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || [];\n // Sort in ascending order\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return _extends({}, acc, {\n [obj.key]: obj.val\n });\n }, {});\n};\n\n// Keep in mind that @media is inclusive by the CSS specification.\nexport default function createBreakpoints(breakpoints) {\n const {\n // The breakpoint **start** at this value.\n // For instance with the first breakpoint xs: [xs, sm).\n values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n },\n unit = 'px',\n step = 5\n } = breakpoints,\n other = _objectWithoutPropertiesLoose(breakpoints, _excluded);\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n }\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n return _extends({\n keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit\n }, other);\n}","const shape = {\n borderRadius: 4\n};\nexport default shape;","import deepmerge from '@mui/utils/deepmerge';\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n });\n}\nexport default merge;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport deepmerge from '@mui/utils/deepmerge';\nimport merge from './merge';\n\n// The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\nexport const values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n};\nconst defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: key => `@media (min-width:${values[key]}px)`\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n const theme = props.theme || {};\n if (Array.isArray(propValue)) {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return propValue.reduce((acc, item, index) => {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n if (typeof propValue === 'object') {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return Object.keys(propValue).reduce((acc, breakpoint) => {\n // key is breakpoint\n if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {\n const mediaKey = themeBreakpoints.up(breakpoint);\n acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);\n } else {\n const cssKey = breakpoint;\n acc[cssKey] = propValue[cssKey];\n }\n return acc;\n }, {});\n }\n const output = styleFromPropValue(propValue);\n return output;\n}\nfunction breakpoints(styleFunction) {\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme\n }, props[key]));\n }\n return acc;\n }, null);\n return merge(base, extended);\n };\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\nexport function createEmptyBreakpointObject(breakpointsInput = {}) {\n var _breakpointsInput$key;\n const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {\n const breakpointStyleKey = breakpointsInput.up(key);\n acc[breakpointStyleKey] = {};\n return acc;\n }, {});\n return breakpointsInOrder || {};\n}\nexport function removeUnusedBreakpoints(breakpointKeys, style) {\n return breakpointKeys.reduce((acc, key) => {\n const breakpointOutput = acc[key];\n const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;\n if (isBreakpointUnused) {\n delete acc[key];\n }\n return acc;\n }, style);\n}\nexport function mergeBreakpointsInOrder(breakpointsInput, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});\n return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);\n}\n\n// compute base for responsive values; e.g.,\n// [1,2,3] => {xs: true, sm: true, md: true}\n// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}\nexport function computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n // fixed value\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n return base;\n}\nexport function resolveBreakpointValues({\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n}) {\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n if (keys.length === 0) {\n return breakpointValues;\n }\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else if (typeof breakpointValues === 'object') {\n acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];\n previous = breakpoint;\n } else {\n acc[breakpoint] = breakpointValues;\n }\n return acc;\n }, {});\n}\nexport default breakpoints;","import _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","import capitalize from '@mui/utils/capitalize';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path, checkVars = true) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n // Check if CSS variables are used\n if (obj && obj.vars && checkVars) {\n const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n if (val != null) {\n return val;\n }\n }\n return path.split('.').reduce((acc, item) => {\n if (acc && acc[item] != null) {\n return acc[item];\n }\n return null;\n }, obj);\n}\nexport function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || userValue;\n } else {\n value = getPath(themeMapping, propValueFinal) || userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\nfunction style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n const styleFromPropValue = propValueFinal => {\n let value = getStyleValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: responsivePropType\n } : {};\n fn.filterProps = [prop];\n return fn;\n}\nexport default style;","export default function memoize(fn) {\n const cache = {};\n return arg => {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n return cache[arg];\n };\n}","import responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport { getPath } from './style';\nimport merge from './merge';\nimport memoize from './memoize';\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n};\n\n// memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\nconst getCssProperties = memoize(prop => {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n const [a, b] = prop.split('');\n const property = properties[a];\n const direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n});\nexport const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];\nexport const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];\nconst spacingKeys = [...marginKeys, ...paddingKeys];\nexport function createUnaryUnit(theme, themeKey, defaultValue, propName) {\n var _getPath;\n const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;\n if (typeof themeSpacing === 'number') {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);\n }\n }\n return themeSpacing * abs;\n };\n }\n if (Array.isArray(themeSpacing)) {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n return themeSpacing[abs];\n };\n }\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n return () => undefined;\n}\nexport function createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nexport function getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n const abs = Math.abs(propValue);\n const transformed = transformer(abs);\n if (propValue >= 0) {\n return transformed;\n }\n if (typeof transformed === 'number') {\n return -transformed;\n }\n return `-${transformed}`;\n}\nexport function getStyleFromPropValue(cssProperties, transformer) {\n return propValue => cssProperties.reduce((acc, cssProperty) => {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n}\nfunction resolveCssProperty(props, keys, prop, transformer) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (keys.indexOf(prop) === -1) {\n return null;\n }\n const cssProperties = getCssProperties(prop);\n const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n const propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n}\nfunction style(props, keys) {\n const transformer = createUnarySpacing(props.theme);\n return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});\n}\nexport function margin(props) {\n return style(props, marginKeys);\n}\nmargin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nmargin.filterProps = marginKeys;\nexport function padding(props) {\n return style(props, paddingKeys);\n}\npadding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\npadding.filterProps = paddingKeys;\nfunction spacing(props) {\n return style(props, spacingKeys);\n}\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","import { createUnarySpacing } from '../spacing';\n\n// The different signatures imply different meaning for their arguments that can't be expressed structurally.\n// We express the difference with variable names.\n\nexport default function createSpacing(spacingInput = 8) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n }\n\n // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n // Smaller components, such as icons, can align to a 4dp grid.\n // https://m2.material.io/design/layout/understanding-layout.html\n const transform = createUnarySpacing({\n spacing: spacingInput\n });\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n spacing.mui = true;\n return spacing;\n}","import merge from './merge';\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n return Object.keys(props).reduce((acc, prop) => {\n if (handlers[prop]) {\n return merge(acc, handlers[prop](props));\n }\n return acc;\n }, {});\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\nexport default compose;","import responsivePropType from './responsivePropType';\nimport style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nexport function borderTransform(value) {\n if (typeof value !== 'number') {\n return value;\n }\n return `${value}px solid`;\n}\nfunction createBorderStyle(prop, transform) {\n return style({\n prop,\n themeKey: 'borders',\n transform\n });\n}\nexport const border = createBorderStyle('border', borderTransform);\nexport const borderTop = createBorderStyle('borderTop', borderTransform);\nexport const borderRight = createBorderStyle('borderRight', borderTransform);\nexport const borderBottom = createBorderStyle('borderBottom', borderTransform);\nexport const borderLeft = createBorderStyle('borderLeft', borderTransform);\nexport const borderColor = createBorderStyle('borderColor');\nexport const borderTopColor = createBorderStyle('borderTopColor');\nexport const borderRightColor = createBorderStyle('borderRightColor');\nexport const borderBottomColor = createBorderStyle('borderBottomColor');\nexport const borderLeftColor = createBorderStyle('borderLeftColor');\nexport const outline = createBorderStyle('outline', borderTransform);\nexport const outlineColor = createBorderStyle('outlineColor');\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n const styleFromPropValue = propValue => ({\n borderRadius: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.borderRadius, styleFromPropValue);\n }\n return null;\n};\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: responsivePropType\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);\nexport default borders;","import style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nimport responsivePropType from './responsivePropType';\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');\n const styleFromPropValue = propValue => ({\n gap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.gap, styleFromPropValue);\n }\n return null;\n};\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: responsivePropType\n} : {};\ngap.filterProps = ['gap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');\n const styleFromPropValue = propValue => ({\n columnGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.columnGap, styleFromPropValue);\n }\n return null;\n};\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: responsivePropType\n} : {};\ncolumnGap.filterProps = ['columnGap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');\n const styleFromPropValue = propValue => ({\n rowGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.rowGap, styleFromPropValue);\n }\n return null;\n};\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: responsivePropType\n} : {};\nrowGap.filterProps = ['rowGap'];\nexport const gridColumn = style({\n prop: 'gridColumn'\n});\nexport const gridRow = style({\n prop: 'gridRow'\n});\nexport const gridAutoFlow = style({\n prop: 'gridAutoFlow'\n});\nexport const gridAutoColumns = style({\n prop: 'gridAutoColumns'\n});\nexport const gridAutoRows = style({\n prop: 'gridAutoRows'\n});\nexport const gridTemplateColumns = style({\n prop: 'gridTemplateColumns'\n});\nexport const gridTemplateRows = style({\n prop: 'gridTemplateRows'\n});\nexport const gridTemplateAreas = style({\n prop: 'gridTemplateAreas'\n});\nexport const gridArea = style({\n prop: 'gridArea'\n});\nconst grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nexport default grid;","import style from './style';\nimport compose from './compose';\nexport function paletteTransform(value, userValue) {\n if (userValue === 'grey') {\n return userValue;\n }\n return value;\n}\nexport const color = style({\n prop: 'color',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const bgcolor = style({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const backgroundColor = style({\n prop: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst palette = compose(color, bgcolor, backgroundColor);\nexport default palette;","import style from './style';\nimport compose from './compose';\nimport { handleBreakpoints, values as breakpointsValues } from './breakpoints';\nexport function sizingTransform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\nexport const width = style({\n prop: 'width',\n transform: sizingTransform\n});\nexport const maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n var _props$theme, _props$theme2;\n const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || breakpointsValues[propValue];\n if (!breakpoint) {\n return {\n maxWidth: sizingTransform(propValue)\n };\n }\n if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {\n return {\n maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`\n };\n }\n return {\n maxWidth: breakpoint\n };\n };\n return handleBreakpoints(props, props.maxWidth, styleFromPropValue);\n }\n return null;\n};\nmaxWidth.filterProps = ['maxWidth'];\nexport const minWidth = style({\n prop: 'minWidth',\n transform: sizingTransform\n});\nexport const height = style({\n prop: 'height',\n transform: sizingTransform\n});\nexport const maxHeight = style({\n prop: 'maxHeight',\n transform: sizingTransform\n});\nexport const minHeight = style({\n prop: 'minHeight',\n transform: sizingTransform\n});\nexport const sizeWidth = style({\n prop: 'size',\n cssProperty: 'width',\n transform: sizingTransform\n});\nexport const sizeHeight = style({\n prop: 'size',\n cssProperty: 'height',\n transform: sizingTransform\n});\nexport const boxSizing = style({\n prop: 'boxSizing'\n});\nconst sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nexport default sizing;","import { padding, margin } from '../spacing';\nimport { borderRadius, borderTransform } from '../borders';\nimport { gap, rowGap, columnGap } from '../cssGrid';\nimport { paletteTransform } from '../palette';\nimport { maxWidth, sizingTransform } from '../sizing';\nconst defaultSxConfig = {\n // borders\n border: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderTop: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderRight: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderBottom: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderLeft: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderColor: {\n themeKey: 'palette'\n },\n borderTopColor: {\n themeKey: 'palette'\n },\n borderRightColor: {\n themeKey: 'palette'\n },\n borderBottomColor: {\n themeKey: 'palette'\n },\n borderLeftColor: {\n themeKey: 'palette'\n },\n outline: {\n themeKey: 'borders',\n transform: borderTransform\n },\n outlineColor: {\n themeKey: 'palette'\n },\n borderRadius: {\n themeKey: 'shape.borderRadius',\n style: borderRadius\n },\n // palette\n color: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n bgcolor: {\n themeKey: 'palette',\n cssProperty: 'backgroundColor',\n transform: paletteTransform\n },\n backgroundColor: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n // spacing\n p: {\n style: padding\n },\n pt: {\n style: padding\n },\n pr: {\n style: padding\n },\n pb: {\n style: padding\n },\n pl: {\n style: padding\n },\n px: {\n style: padding\n },\n py: {\n style: padding\n },\n padding: {\n style: padding\n },\n paddingTop: {\n style: padding\n },\n paddingRight: {\n style: padding\n },\n paddingBottom: {\n style: padding\n },\n paddingLeft: {\n style: padding\n },\n paddingX: {\n style: padding\n },\n paddingY: {\n style: padding\n },\n paddingInline: {\n style: padding\n },\n paddingInlineStart: {\n style: padding\n },\n paddingInlineEnd: {\n style: padding\n },\n paddingBlock: {\n style: padding\n },\n paddingBlockStart: {\n style: padding\n },\n paddingBlockEnd: {\n style: padding\n },\n m: {\n style: margin\n },\n mt: {\n style: margin\n },\n mr: {\n style: margin\n },\n mb: {\n style: margin\n },\n ml: {\n style: margin\n },\n mx: {\n style: margin\n },\n my: {\n style: margin\n },\n margin: {\n style: margin\n },\n marginTop: {\n style: margin\n },\n marginRight: {\n style: margin\n },\n marginBottom: {\n style: margin\n },\n marginLeft: {\n style: margin\n },\n marginX: {\n style: margin\n },\n marginY: {\n style: margin\n },\n marginInline: {\n style: margin\n },\n marginInlineStart: {\n style: margin\n },\n marginInlineEnd: {\n style: margin\n },\n marginBlock: {\n style: margin\n },\n marginBlockStart: {\n style: margin\n },\n marginBlockEnd: {\n style: margin\n },\n // display\n displayPrint: {\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n },\n display: {},\n overflow: {},\n textOverflow: {},\n visibility: {},\n whiteSpace: {},\n // flexbox\n flexBasis: {},\n flexDirection: {},\n flexWrap: {},\n justifyContent: {},\n alignItems: {},\n alignContent: {},\n order: {},\n flex: {},\n flexGrow: {},\n flexShrink: {},\n alignSelf: {},\n justifyItems: {},\n justifySelf: {},\n // grid\n gap: {\n style: gap\n },\n rowGap: {\n style: rowGap\n },\n columnGap: {\n style: columnGap\n },\n gridColumn: {},\n gridRow: {},\n gridAutoFlow: {},\n gridAutoColumns: {},\n gridAutoRows: {},\n gridTemplateColumns: {},\n gridTemplateRows: {},\n gridTemplateAreas: {},\n gridArea: {},\n // positions\n position: {},\n zIndex: {\n themeKey: 'zIndex'\n },\n top: {},\n right: {},\n bottom: {},\n left: {},\n // shadows\n boxShadow: {\n themeKey: 'shadows'\n },\n // sizing\n width: {\n transform: sizingTransform\n },\n maxWidth: {\n style: maxWidth\n },\n minWidth: {\n transform: sizingTransform\n },\n height: {\n transform: sizingTransform\n },\n maxHeight: {\n transform: sizingTransform\n },\n minHeight: {\n transform: sizingTransform\n },\n boxSizing: {},\n // typography\n fontFamily: {\n themeKey: 'typography'\n },\n fontSize: {\n themeKey: 'typography'\n },\n fontStyle: {\n themeKey: 'typography'\n },\n fontWeight: {\n themeKey: 'typography'\n },\n letterSpacing: {},\n textTransform: {},\n lineHeight: {},\n textAlign: {},\n typography: {\n cssProperty: false,\n themeKey: 'typography'\n }\n};\nexport default defaultSxConfig;","import capitalize from '@mui/utils/capitalize';\nimport merge from '../merge';\nimport { getPath, getStyleValue as getValue } from '../style';\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from '../breakpoints';\nimport defaultSxConfig from './defaultSxConfig';\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && val === 'inherit') {\n return {\n [prop]: val\n };\n }\n const themeMapping = getPath(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n var _theme$unstable_sxCon;\n const {\n sx,\n theme = {}\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n return removeUnusedBreakpoints(breakpointsKeys, css);\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;","/**\n * A universal utility to style components with multiple color modes. Always use it from the theme object.\n * It works with:\n * - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)\n * - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)\n * - Zero-runtime engine\n *\n * Tips: Use an array over object spread and place `theme.applyStyles()` last.\n *\n * ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]\n *\n * 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}\n *\n * @example\n * 1. using with `styled`:\n * ```jsx\n * const Component = styled('div')(({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]);\n * ```\n *\n * @example\n * 2. using with `sx` prop:\n * ```jsx\n * [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]}\n * />\n * ```\n *\n * @example\n * 3. theming a component:\n * ```jsx\n * extendTheme({\n * components: {\n * MuiButton: {\n * styleOverrides: {\n * root: ({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ],\n * },\n * }\n * }\n * })\n *```\n */\nexport default function applyStyles(key, styles) {\n // @ts-expect-error this is 'any' type\n const theme = this;\n if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {\n // If CssVarsProvider is used as a provider,\n // returns '* :where([data-mui-color-scheme=\"light|dark\"]) &'\n const selector = theme.getColorSchemeSelector(key).replace(/(\\[[^\\]]+\\])/, '*:where($1)');\n return {\n [selector]: styles\n };\n }\n if (theme.palette.mode === key) {\n return styles;\n }\n return {};\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"breakpoints\", \"palette\", \"spacing\", \"shape\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport createBreakpoints from './createBreakpoints';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport styleFunctionSx from '../styleFunctionSx/styleFunctionSx';\nimport defaultSxConfig from '../styleFunctionSx/defaultSxConfig';\nimport applyStyles from './applyStyles';\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n const breakpoints = createBreakpoints(breakpointsInput);\n const spacing = createSpacing(spacingInput);\n let muiTheme = deepmerge({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: _extends({\n mode: 'light'\n }, paletteInput),\n spacing,\n shape: _extends({}, shape, shapeInput)\n }, other);\n muiTheme.applyStyles = applyStyles;\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nexport default createTheme;","'use client';\n\nimport * as React from 'react';\nimport { ThemeContext } from '@mui/styled-engine';\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction useTheme(defaultTheme = null) {\n const contextTheme = React.useContext(ThemeContext);\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\nexport default useTheme;","'use client';\n\nimport createTheme from './createTheme';\nimport useThemeWithoutDefault from './useThemeWithoutDefault';\nexport const systemDefaultTheme = createTheme();\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return useThemeWithoutDefault(defaultTheme);\n}\nexport default useTheme;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GlobalStyles as MuiGlobalStyles } from '@mui/styled-engine';\nimport useTheme from '../useTheme';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GlobalStyles({\n styles,\n themeId,\n defaultTheme = {}\n}) {\n const upperTheme = useTheme(defaultTheme);\n const globalStyles = typeof styles === 'function' ? styles(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles;\n return /*#__PURE__*/_jsx(MuiGlobalStyles, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n defaultTheme: PropTypes.object,\n /**\n * @ignore\n */\n styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),\n /**\n * @ignore\n */\n themeId: PropTypes.string\n} : void 0;\nexport default GlobalStyles;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"sx\"];\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport defaultSxConfig from './defaultSxConfig';\nconst splitProps = props => {\n var _props$theme$unstable, _props$theme;\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nexport default function extendSxProp(props) {\n const {\n sx: inSx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!isPlainObject(result)) {\n return systemProps;\n }\n return _extends({}, systemProps, result);\n };\n } else {\n finalSx = _extends({}, systemProps, inSx);\n }\n return _extends({}, otherProps, {\n sx: finalSx\n });\n}","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import { ForwardRef, Memo } from 'react-is';\n\n// Simplified polyfill for IE11 support\n// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3\nconst fnNameMatchRegex = /^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^(\\s/]*)\\s*/;\nexport function getFunctionName(fn) {\n const match = `${fn}`.match(fnNameMatchRegex);\n const name = match && match[1];\n return name || '';\n}\nfunction getFunctionComponentName(Component, fallback = '') {\n return Component.displayName || Component.name || getFunctionName(Component) || fallback;\n}\nfunction getWrappedName(outerType, innerType, wrapperName) {\n const functionName = getFunctionComponentName(innerType);\n return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);\n}\n\n/**\n * cherry-pick from\n * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js\n * originally forked from recompose/getDisplayName with added IE11 support\n */\nexport default function getDisplayName(Component) {\n if (Component == null) {\n return undefined;\n }\n if (typeof Component === 'string') {\n return Component;\n }\n if (typeof Component === 'function') {\n return getFunctionComponentName(Component, 'Component');\n }\n\n // TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`\n if (typeof Component === 'object') {\n switch (Component.$$typeof) {\n case ForwardRef:\n return getWrappedName(Component, Component.render, 'ForwardRef');\n case Memo:\n return getWrappedName(Component, Component.type, 'memo');\n default:\n return undefined;\n }\n }\n return undefined;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"ownerState\"],\n _excluded2 = [\"variants\"],\n _excluded3 = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"];\n/* eslint-disable no-underscore-dangle */\nimport styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport capitalize from '@mui/utils/capitalize';\nimport getDisplayName from '@mui/utils/getDisplayName';\nimport createTheme from './createTheme';\nimport styleFunctionSx from './styleFunctionSx';\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\n\n// Update /system/styled/#api in case if this changes\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport const systemDefaultTheme = createTheme();\nconst lowercaseFirstLetter = string => {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nfunction resolveTheme({\n defaultTheme,\n theme,\n themeId\n}) {\n return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (props, styles) => styles[slot];\n}\nfunction processStyleArg(callableStyle, _ref) {\n let {\n ownerState\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle(_extends({\n ownerState\n }, props)) : callableStyle;\n if (Array.isArray(resolvedStylesArg)) {\n return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, _extends({\n ownerState\n }, props)));\n }\n if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {\n const {\n variants = []\n } = resolvedStylesArg,\n otherStyles = _objectWithoutPropertiesLoose(resolvedStylesArg, _excluded2);\n let result = otherStyles;\n variants.forEach(variant => {\n let isMatch = true;\n if (typeof variant.props === 'function') {\n isMatch = variant.props(_extends({\n ownerState\n }, props, ownerState));\n } else {\n Object.keys(variant.props).forEach(key => {\n if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {\n isMatch = false;\n }\n });\n }\n if (isMatch) {\n if (!Array.isArray(result)) {\n result = [result];\n }\n result.push(typeof variant.style === 'function' ? variant.style(_extends({\n ownerState\n }, props, ownerState)) : variant.style);\n }\n });\n return result;\n }\n return resolvedStylesArg;\n}\nexport default function createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n return styleFunctionSx(_extends({}, props, {\n theme: resolveTheme(_extends({}, props, {\n defaultTheme,\n themeId\n }))\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))\n } = inputOptions,\n options = _objectWithoutPropertiesLoose(inputOptions, _excluded3);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = styledEngineStyled(tag, _extends({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const transformStyleArg = stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || isPlainObject(stylesArg)) {\n return props => processStyleArg(stylesArg, _extends({}, props, {\n theme: resolveTheme({\n theme: props.theme,\n defaultTheme,\n themeId\n })\n }));\n }\n return stylesArg;\n };\n const muiStyledResolver = (styleArg, ...expressions) => {\n let transformedStyleArg = transformStyleArg(styleArg);\n const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = resolveTheme(_extends({}, props, {\n defaultTheme,\n themeId\n }));\n if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {\n return null;\n }\n const styleOverrides = theme.components[componentName].styleOverrides;\n const resolvedStyleOverrides = {};\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, _extends({}, props, {\n theme\n }));\n });\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n var _theme$components;\n const theme = resolveTheme(_extends({}, props, {\n defaultTheme,\n themeId\n }));\n const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;\n return processStyleArg({\n variants: themeVariants\n }, _extends({}, props, {\n theme\n }));\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${capitalize(componentSlot || '')}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${getDisplayName(tag)})`;\n }\n Component.displayName = displayName;\n }\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}","import createStyled from './createStyled';\nconst styled = createStyled();\nexport default styled;","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = _extends({}, props);\n Object.keys(defaultProps).forEach(propName => {\n if (propName.toString().match(/^(components|slots)$/)) {\n output[propName] = _extends({}, defaultProps[propName], output[propName]);\n } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n const defaultSlotProps = defaultProps[propName] || {};\n const slotProps = props[propName];\n output[propName] = {};\n if (!slotProps || !Object.keys(slotProps)) {\n // Reduce the iteration if the slot props is empty\n output[propName] = defaultSlotProps;\n } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n // Reduce the iteration if the default slot props is empty\n output[propName] = slotProps;\n } else {\n output[propName] = _extends({}, slotProps);\n Object.keys(defaultSlotProps).forEach(slotPropName => {\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n });\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\n}","import resolveProps from '@mui/utils/resolveProps';\nexport default function getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n return resolveProps(theme.components[name].defaultProps, props);\n}","'use client';\n\nimport getThemeProps from './getThemeProps';\nimport useTheme from '../useTheme';\nexport default function useThemeProps({\n props,\n name,\n defaultTheme,\n themeId\n}) {\n let theme = useTheme(defaultTheme);\n if (themeId) {\n theme = theme[themeId] || theme;\n }\n const mergedProps = getThemeProps({\n theme,\n name,\n props\n });\n return mergedProps;\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}\nexport default clamp;","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n var _muiName, _element$type;\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName\n // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45\n // eslint-disable-next-line no-underscore-dangle\n (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example
\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport useLazyRef from '../useLazyRef/useLazyRef';\nimport useOnMount from '../useOnMount/useOnMount';\nexport class Timeout {\n constructor() {\n this.currentId = null;\n this.clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport { Timeout } from '../useTimeout/useTimeout';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nconst hadFocusVisibleRecentlyTimeout = new Timeout();\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n hadFocusVisibleRecentlyTimeout.start(100, () => {\n hadFocusVisibleRecently = false;\n });\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18\nexport default function getScrollbarSize(doc) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}","export default function composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n Object.keys(slots).forEach(\n // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n const utilityClass = getUtilityClass(key);\n if (utilityClass !== '') {\n acc.push(utilityClass);\n }\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","import * as React from 'react';\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\nexport default ThemeContext;","import * as React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}","const hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport ThemeContext from '../useTheme/ThemeContext';\nimport useTheme from '../useTheme';\nimport nested from './nested';\n\n// To support composition of theme.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(outerTheme);\n if (process.env.NODE_ENV !== 'production') {\n if (!mergedTheme) {\n console.error(['MUI: You should return an object from your theme function, i.e.', ' ({})} />'].join('\\n'));\n }\n }\n return mergedTheme;\n }\n return _extends({}, outerTheme, localTheme);\n}\n\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme\n } = props;\n const outerTheme = useTheme();\n if (process.env.NODE_ENV !== 'production') {\n if (outerTheme === null && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const theme = React.useMemo(() => {\n const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n if (output != null) {\n output[nested] = outerTheme !== null;\n }\n return output;\n }, [localTheme, outerTheme]);\n return /*#__PURE__*/_jsx(ThemeContext.Provider, {\n value: theme,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as MuiThemeProvider, useTheme as usePrivateTheme } from '@mui/private-theming';\nimport exactProp from '@mui/utils/exactProp';\nimport { ThemeContext as StyledEngineThemeContext } from '@mui/styled-engine';\nimport useThemeWithoutDefault from '../useThemeWithoutDefault';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst EMPTY_THEME = {};\nfunction useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {\n return React.useMemo(() => {\n const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(resolvedTheme);\n const result = themeId ? _extends({}, upperTheme, {\n [themeId]: mergedTheme\n }) : mergedTheme;\n // must return a function for the private theme to NOT merge with the upper theme.\n // see the test case \"use provided theme from a callback\" in ThemeProvider.test.js\n if (isPrivate) {\n return () => result;\n }\n return result;\n }\n return themeId ? _extends({}, upperTheme, {\n [themeId]: localTheme\n }) : _extends({}, upperTheme, localTheme);\n }, [themeId, upperTheme, localTheme, isPrivate]);\n}\n\n/**\n * This component makes the `theme` available down the React tree.\n * It should preferably be used at **the root of your component tree**.\n *\n * // existing use case\n * // theme scoping\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme,\n themeId\n } = props;\n const upperTheme = useThemeWithoutDefault(EMPTY_THEME);\n const upperPrivateTheme = usePrivateTheme() || EMPTY_THEME;\n if (process.env.NODE_ENV !== 'production') {\n if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);\n const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);\n return /*#__PURE__*/_jsx(MuiThemeProvider, {\n theme: privateTheme,\n children: /*#__PURE__*/_jsx(StyledEngineThemeContext.Provider, {\n value: engineTheme,\n children: children\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,\n /**\n * The design system's unique id for getting the corresponded theme when there are multiple design systems.\n */\n themeId: PropTypes.string\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"component\", \"direction\", \"spacing\", \"divider\", \"children\", \"className\", \"useFlexGap\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport deepmerge from '@mui/utils/deepmerge';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport composeClasses from '@mui/utils/composeClasses';\nimport systemStyled from '../styled';\nimport useThemePropsSystem from '../useThemeProps';\nimport { extendSxProp } from '../styleFunctionSx';\nimport createTheme from '../createTheme';\nimport { handleBreakpoints, mergeBreakpointsInOrder, resolveBreakpointValues } from '../breakpoints';\nimport { createUnarySpacing, getValue } from '../spacing';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultTheme = createTheme();\n// widening Theme to any so that the consumer can own the theme structure.\nconst defaultCreateStyledComponent = systemStyled('div', {\n name: 'MuiStack',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n});\nfunction useThemePropsDefault(props) {\n return useThemePropsSystem({\n props,\n name: 'MuiStack',\n defaultTheme\n });\n}\n\n/**\n * Return an array with the separator React element interspersed between\n * each React node of the input children.\n *\n * > joinChildren([1,2,3], 0)\n * [1,0,2,0,3]\n */\nfunction joinChildren(children, separator) {\n const childrenArray = React.Children.toArray(children).filter(Boolean);\n return childrenArray.reduce((output, child, index) => {\n output.push(child);\n if (index < childrenArray.length - 1) {\n output.push( /*#__PURE__*/React.cloneElement(separator, {\n key: `separator-${index}`\n }));\n }\n return output;\n }, []);\n}\nconst getSideFromDirection = direction => {\n return {\n row: 'Left',\n 'row-reverse': 'Right',\n column: 'Top',\n 'column-reverse': 'Bottom'\n }[direction];\n};\nexport const style = ({\n ownerState,\n theme\n}) => {\n let styles = _extends({\n display: 'flex',\n flexDirection: 'column'\n }, handleBreakpoints({\n theme\n }, resolveBreakpointValues({\n values: ownerState.direction,\n breakpoints: theme.breakpoints.values\n }), propValue => ({\n flexDirection: propValue\n })));\n if (ownerState.spacing) {\n const transformer = createUnarySpacing(theme);\n const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {\n if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {\n acc[breakpoint] = true;\n }\n return acc;\n }, {});\n const directionValues = resolveBreakpointValues({\n values: ownerState.direction,\n base\n });\n const spacingValues = resolveBreakpointValues({\n values: ownerState.spacing,\n base\n });\n if (typeof directionValues === 'object') {\n Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {\n const directionValue = directionValues[breakpoint];\n if (!directionValue) {\n const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';\n directionValues[breakpoint] = previousDirectionValue;\n }\n });\n }\n const styleFromPropValue = (propValue, breakpoint) => {\n if (ownerState.useFlexGap) {\n return {\n gap: getValue(transformer, propValue)\n };\n }\n return {\n // The useFlexGap={false} implement relies on each child to give up control of the margin.\n // We need to reset the margin to avoid double spacing.\n '& > :not(style):not(style)': {\n margin: 0\n },\n '& > :not(style) ~ :not(style)': {\n [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)\n }\n };\n };\n styles = deepmerge(styles, handleBreakpoints({\n theme\n }, spacingValues, styleFromPropValue));\n }\n styles = mergeBreakpointsInOrder(theme.breakpoints, styles);\n return styles;\n};\nexport default function createStack(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiStack'\n } = options;\n const useUtilityClasses = () => {\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});\n };\n const StackRoot = createStyledComponent(style);\n const Stack = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {\n const themeProps = useThemeProps(inProps);\n const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.\n const {\n component = 'div',\n direction = 'column',\n spacing = 0,\n divider,\n children,\n className,\n useFlexGap = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = {\n direction,\n spacing,\n useFlexGap\n };\n const classes = useUtilityClasses();\n return /*#__PURE__*/_jsx(StackRoot, _extends({\n as: component,\n ownerState: ownerState,\n ref: ref,\n className: clsx(classes.root, className)\n }, other, {\n children: divider ? joinChildren(children, divider) : children\n }));\n });\n process.env.NODE_ENV !== \"production\" ? Stack.propTypes /* remove-proptypes */ = {\n children: PropTypes.node,\n direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),\n divider: PropTypes.node,\n spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n } : void 0;\n return Stack;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, mixins) {\n return _extends({\n toolbar: {\n minHeight: 56,\n [breakpoints.up('xs')]: {\n '@media (orientation: landscape)': {\n minHeight: 48\n }\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n }\n }, mixins);\n}","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.alpha = alpha;\nexports.blend = blend;\nexports.colorChannel = void 0;\nexports.darken = darken;\nexports.decomposeColor = decomposeColor;\nexports.emphasize = emphasize;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.hexToRgb = hexToRgb;\nexports.hslToRgb = hslToRgb;\nexports.lighten = lighten;\nexports.private_safeAlpha = private_safeAlpha;\nexports.private_safeColorChannel = void 0;\nexports.private_safeDarken = private_safeDarken;\nexports.private_safeEmphasize = private_safeEmphasize;\nexports.private_safeLighten = private_safeLighten;\nexports.recomposeColor = recomposeColor;\nexports.rgbToHex = rgbToHex;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _clamp = _interopRequireDefault(require(\"@mui/utils/clamp\"));\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return (0, _clamp.default)(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nfunction hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nconst colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexports.colorChannel = colorChannel;\nconst private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexports.private_safeColorChannel = private_safeColorChannel;\nfunction recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nfunction rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nfunction hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nfunction private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nfunction private_safeEmphasize(color, coefficient, warning) {\n try {\n return private_safeEmphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nfunction blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nconst _excluded = [\"mode\", \"contrastThreshold\", \"tonalOffset\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport { darken, getContrastRatio, lighten } from '@mui/system/colorManipulator';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport purple from '../colors/purple';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport lightBlue from '../colors/lightBlue';\nimport green from '../colors/green';\nexport const light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: common.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport const dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: blue[200],\n light: blue[50],\n dark: blue[400]\n };\n }\n return {\n main: blue[700],\n light: blue[400],\n dark: blue[800]\n };\n}\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: purple[200],\n light: purple[50],\n dark: purple[400]\n };\n }\n return {\n main: purple[500],\n light: purple[300],\n dark: purple[700]\n };\n}\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: red[500],\n light: red[300],\n dark: red[700]\n };\n }\n return {\n main: red[700],\n light: red[400],\n dark: red[800]\n };\n}\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: lightBlue[400],\n light: lightBlue[300],\n dark: lightBlue[700]\n };\n }\n return {\n main: lightBlue[700],\n light: lightBlue[500],\n dark: lightBlue[900]\n };\n}\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: green[400],\n light: green[300],\n dark: green[700]\n };\n }\n return {\n main: green[800],\n light: green[500],\n dark: green[900]\n };\n}\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: orange[400],\n light: orange[300],\n dark: orange[700]\n };\n }\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: orange[500],\n dark: orange[900]\n };\n}\nexport default function createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2\n } = palette,\n other = _objectWithoutPropertiesLoose(palette, _excluded);\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode);\n\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n function getContrastText(background) {\n const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n if (process.env.NODE_ENV !== 'production') {\n const contrast = getContrastRatio(background, contrastText);\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n return contrastText;\n }\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = _extends({}, color);\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\nThe color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));\n }\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n return color;\n };\n const modes = {\n dark,\n light\n };\n if (process.env.NODE_ENV !== 'production') {\n if (!modes[mode]) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n const paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: _extends({}, common),\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset\n }, modes[mode]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"];\nimport deepmerge from '@mui/utils/deepmerge';\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n\n/**\n * @see @link{https://m2.material.io/design/typography/the-type-system.html}\n * @see @link{https://m2.material.io/design/typography/understanding-typography.html}\n */\nexport default function createTypography(palette, typography) {\n const _ref = typeof typography === 'function' ? typography(palette) : typography,\n {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n const coef = fontSize / 14;\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}, casing, allVariants);\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),\n // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.\n inherit: {\n fontFamily: 'inherit',\n fontWeight: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'inherit',\n letterSpacing: 'inherit'\n }\n };\n return deepmerge(_extends({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n });\n}","const shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n}\n\n// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"duration\", \"easing\", \"delay\"];\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport const easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nexport const duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n const constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\nexport default function createTransitions(inputTransitions) {\n const mergedEasing = _extends({}, easing, inputTransitions.easing);\n const mergedDuration = _extends({}, duration, inputTransitions.duration);\n const create = (props = ['all'], options = {}) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string';\n // IE11 support, replace with Number.isNaN\n // eslint-disable-next-line no-restricted-globals\n const isNumber = value => !isNaN(parseFloat(value));\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n if (typeof options !== 'object') {\n console.error(['MUI: Secong argument of transition.create must be an object.', \"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`\"].join('\\n'));\n }\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n return _extends({\n getAutoHeightDuration,\n create\n }, inputTransitions, {\n easing: mergedEasing,\n duration: mergedDuration\n });\n}","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nconst _excluded = [\"breakpoints\", \"mixins\", \"spacing\", \"palette\", \"transitions\", \"typography\", \"shape\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';\nimport systemCreateTheme from '@mui/system/createTheme';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport createTransitions from './createTransitions';\nimport zIndex from './zIndex';\nfunction createTheme(options = {}, ...args) {\n const {\n mixins: mixinsInput = {},\n palette: paletteInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (options.vars) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`vars\\` is a private field used for CSS variables support.\nPlease use another name.` : _formatMuiErrorMessage(18));\n }\n const palette = createPalette(paletteInput);\n const systemTheme = systemCreateTheme(options);\n let muiTheme = deepmerge(systemTheme, {\n mixins: createMixins(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: shadows.slice(),\n typography: createTypography(palette, typographyInput),\n transitions: createTransitions(transitionsInput),\n zIndex: _extends({}, zIndex)\n });\n muiTheme = deepmerge(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n if (process.env.NODE_ENV !== 'production') {\n // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n const traverse = (node, component) => {\n let key;\n\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (key in node) {\n const child = node[key];\n if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = generateUtilityClass('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n }\n // Remove the style to prevent global conflicts.\n node[key] = {};\n }\n }\n };\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n if (styleOverrides && component.indexOf('Mui') === 0) {\n traverse(styleOverrides, component);\n }\n });\n }\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nlet warnedOnce = false;\nexport function createMuiTheme(...args) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@mui/material/styles'`\"].join('\\n'));\n }\n }\n return createTheme(...args);\n}\nexport default createTheme;","'use client';\n\nimport createTheme from './createTheme';\nconst defaultTheme = createTheme();\nexport default defaultTheme;","'use client';\n\nimport * as React from 'react';\nimport { useTheme as useThemeSystem } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nexport default function useTheme() {\n const theme = useThemeSystem(defaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme[THEME_ID] || theme;\n}","'use client';\n\nimport systemUseThemeProps from '@mui/system/useThemeProps';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nexport default function useThemeProps({\n props,\n name\n}) {\n return systemUseThemeProps({\n props,\n name,\n defaultTheme,\n themeId: THEME_ID\n });\n}","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createStyled;\nexports.shouldForwardProp = shouldForwardProp;\nexports.systemDefaultTheme = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _styledEngine = _interopRequireWildcard(require(\"@mui/styled-engine\"));\nvar _deepmerge = require(\"@mui/utils/deepmerge\");\nvar _capitalize = _interopRequireDefault(require(\"@mui/utils/capitalize\"));\nvar _getDisplayName = _interopRequireDefault(require(\"@mui/utils/getDisplayName\"));\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _styleFunctionSx = _interopRequireDefault(require(\"./styleFunctionSx\"));\nconst _excluded = [\"ownerState\"],\n _excluded2 = [\"variants\"],\n _excluded3 = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"];\n/* eslint-disable no-underscore-dangle */\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\n\n// Update /system/styled/#api in case if this changes\nfunction shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nconst systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();\nconst lowercaseFirstLetter = string => {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nfunction resolveTheme({\n defaultTheme,\n theme,\n themeId\n}) {\n return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (props, styles) => styles[slot];\n}\nfunction processStyleArg(callableStyle, _ref) {\n let {\n ownerState\n } = _ref,\n props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);\n const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0, _extends2.default)({\n ownerState\n }, props)) : callableStyle;\n if (Array.isArray(resolvedStylesArg)) {\n return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0, _extends2.default)({\n ownerState\n }, props)));\n }\n if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {\n const {\n variants = []\n } = resolvedStylesArg,\n otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2);\n let result = otherStyles;\n variants.forEach(variant => {\n let isMatch = true;\n if (typeof variant.props === 'function') {\n isMatch = variant.props((0, _extends2.default)({\n ownerState\n }, props, ownerState));\n } else {\n Object.keys(variant.props).forEach(key => {\n if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {\n isMatch = false;\n }\n });\n }\n if (isMatch) {\n if (!Array.isArray(result)) {\n result = [result];\n }\n result.push(typeof variant.style === 'function' ? variant.style((0, _extends2.default)({\n ownerState\n }, props, ownerState)) : variant.style);\n }\n });\n return result;\n }\n return resolvedStylesArg;\n}\nfunction createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {\n theme: resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }))\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n (0, _styledEngine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))\n } = inputOptions,\n options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const transformStyleArg = stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {\n return props => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {\n theme: resolveTheme({\n theme: props.theme,\n defaultTheme,\n themeId\n })\n }));\n }\n return stylesArg;\n };\n const muiStyledResolver = (styleArg, ...expressions) => {\n let transformedStyleArg = transformStyleArg(styleArg);\n const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {\n return null;\n }\n const styleOverrides = theme.components[componentName].styleOverrides;\n const resolvedStyleOverrides = {};\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n var _theme$components;\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;\n return processStyleArg({\n variants: themeVariants\n }, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${(0, _capitalize.default)(componentSlot || '')}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${(0, _getDisplayName.default)(tag)})`;\n }\n Component.displayName = displayName;\n }\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}","'use client';\n\nimport createStyled, { shouldForwardProp } from '@mui/system/createStyled';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nexport const rootShouldForwardProp = prop => shouldForwardProp(prop) && prop !== 'classes';\nexport const slotShouldForwardProp = shouldForwardProp;\nconst styled = createStyled({\n themeId: THEME_ID,\n defaultTheme,\n rootShouldForwardProp\n});\nexport default styled;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"theme\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as SystemThemeProvider } from '@mui/system';\nimport THEME_ID from './identifier';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function ThemeProvider(_ref) {\n let {\n theme: themeInput\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const scopedTheme = themeInput[THEME_ID];\n return /*#__PURE__*/_jsx(SystemThemeProvider, _extends({}, props, {\n themeId: scopedTheme ? THEME_ID : undefined,\n theme: scopedTheme || themeInput\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;","// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61\nconst getOverlayAlpha = elevation => {\n let alphaValue;\n if (elevation < 1) {\n alphaValue = 5.11916 * elevation ** 2;\n } else {\n alphaValue = 4.5 * Math.log(elevation + 1) + 2;\n }\n return (alphaValue / 100).toFixed(2);\n};\nexport default getOverlayAlpha;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getSvgIconUtilityClass(slot) {\n return generateUtilityClass('MuiSvgIcon', slot);\n}\nconst svgIconClasses = generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);\nexport default svgIconClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"inheritViewBox\", \"titleAccess\", \"viewBox\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport capitalize from '../utils/capitalize';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport { getSvgIconUtilityClass } from './svgIconClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n color,\n fontSize,\n classes\n } = ownerState;\n const slots = {\n root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]\n };\n return composeClasses(slots, getSvgIconUtilityClass, classes);\n};\nconst SvgIconRoot = styled('svg', {\n name: 'MuiSvgIcon',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;\n return {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n // the will define the property that has `currentColor`\n // e.g. heroicons uses fill=\"none\" and stroke=\"currentColor\"\n fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',\n flexShrink: 0,\n transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {\n duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter\n }),\n fontSize: {\n inherit: 'inherit',\n small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',\n medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',\n large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'\n }[ownerState.fontSize],\n // TODO v5 deprecate, v6 remove for sx\n color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {\n action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,\n disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,\n inherit: undefined\n }[ownerState.color]\n };\n});\nconst SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiSvgIcon'\n });\n const {\n children,\n className,\n color = 'inherit',\n component = 'svg',\n fontSize = 'medium',\n htmlColor,\n inheritViewBox = false,\n titleAccess,\n viewBox = '0 0 24 24'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';\n const ownerState = _extends({}, props, {\n color,\n component,\n fontSize,\n instanceFontSize: inProps.fontSize,\n inheritViewBox,\n viewBox,\n hasSvgAsChild\n });\n const more = {};\n if (!inheritViewBox) {\n more.viewBox = viewBox;\n }\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n focusable: \"false\",\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, more, other, hasSvgAsChild && children.props, {\n ownerState: ownerState,\n children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /*#__PURE__*/_jsx(\"title\", {\n children: titleAccess\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n * @default 'inherit'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n * @default 'medium'\n */\n fontSize: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'large', 'medium', 'small']), PropTypes.string]),\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n /**\n * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`\n * prop will be ignored.\n * Useful when you want to reference a custom `component` and have `SvgIcon` pass that\n * `component`'s viewBox to the root node.\n * @default false\n */\n inheritViewBox: PropTypes.bool,\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this prop.\n */\n shapeRendering: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: PropTypes.string,\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n * @default '0 0 24 24'\n */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default SvgIcon;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport SvgIcon from '../SvgIcon';\n\n/**\n * Private module reserved for @mui packages.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createSvgIcon(path, displayName) {\n function Component(props, ref) {\n return /*#__PURE__*/_jsx(SvgIcon, _extends({\n \"data-testid\": `${displayName}Icon`,\n ref: ref\n }, props, {\n children: path\n }));\n }\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = `${displayName}Icon`;\n }\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n * \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","export const reflow = node => node.scrollTop;\nexport function getTransitionProps(props, options) {\n var _style$transitionDura, _style$transitionTimi;\n const {\n timeout,\n easing,\n style = {}\n } = props;\n return {\n duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing === 'object' ? easing[options.mode] : easing,\n delay: style.transitionDelay\n };\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getPaperUtilityClass(slot) {\n return generateUtilityClass('MuiPaper', slot);\n}\nconst paperClasses = generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);\nexport default paperClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"elevation\", \"square\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport integerPropType from '@mui/utils/integerPropType';\nimport chainPropTypes from '@mui/utils/chainPropTypes';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport styled from '../styles/styled';\nimport getOverlayAlpha from '../styles/getOverlayAlpha';\nimport useThemeProps from '../styles/useThemeProps';\nimport useTheme from '../styles/useTheme';\nimport { getPaperUtilityClass } from './paperClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n square,\n elevation,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]\n };\n return composeClasses(slots, getPaperUtilityClass, classes);\n};\nconst PaperRoot = styled('div', {\n name: 'MuiPaper',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$vars$overlays;\n return _extends({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n color: (theme.vars || theme).palette.text.primary,\n transition: theme.transitions.create('box-shadow')\n }, !ownerState.square && {\n borderRadius: theme.shape.borderRadius\n }, ownerState.variant === 'outlined' && {\n border: `1px solid ${(theme.vars || theme).palette.divider}`\n }, ownerState.variant === 'elevation' && _extends({\n boxShadow: (theme.vars || theme).shadows[ownerState.elevation]\n }, !theme.vars && theme.palette.mode === 'dark' && {\n backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`\n }, theme.vars && {\n backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]\n }));\n});\nconst Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPaper'\n });\n const {\n className,\n component = 'div',\n elevation = 1,\n square = false,\n variant = 'elevation'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n elevation,\n square,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const theme = useTheme();\n if (theme.shadows[elevation] === undefined) {\n console.error([`MUI: The elevation provided is not available in the theme.`, `Please make sure that \\`theme.shadows[${elevation}]\\` is defined.`].join('\\n'));\n }\n }\n return /*#__PURE__*/_jsx(PaperRoot, _extends({\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Paper.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 1\n */\n elevation: chainPropTypes(integerPropType, props => {\n const {\n elevation,\n variant\n } = props;\n if (elevation > 0 && variant === 'outlined') {\n return new Error(`MUI: Combining \\`elevation={${elevation}}\\` with \\`variant=\"${variant}\"\\` has no effect. Either use \\`elevation={0}\\` or use a different \\`variant\\`.`);\n }\n return null;\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'elevation'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])\n} : void 0;\nexport default Paper;","/**\n * Determines if a given element is a DOM element name (i.e. not a React component).\n */\nexport function isHostComponent(element) {\n return typeof element === 'string';\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { isHostComponent } from './isHostComponent';\n\n/**\n * Type of the ownerState based on the type of an element it applies to.\n * This resolves to the provided OwnerState for React components and `undefined` for host components.\n * Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.\n */\n\n/**\n * Appends the ownerState object to the props, merging with the existing one if necessary.\n *\n * @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.\n * @param otherProps Props of the element.\n * @param ownerState\n */\nexport function appendOwnerState(elementType, otherProps, ownerState) {\n if (elementType === undefined || isHostComponent(elementType)) {\n return otherProps;\n }\n return _extends({}, otherProps, {\n ownerState: _extends({}, otherProps.ownerState, ownerState)\n });\n}","/**\n * Extracts event handlers from a given object.\n * A prop is considered an event handler if it is a function and its name starts with `on`.\n *\n * @param object An object to extract event handlers from.\n * @param excludeKeys An array of keys to exclude from the returned object.\n */\nexport function extractEventHandlers(object, excludeKeys = []) {\n if (object === undefined) {\n return {};\n }\n const result = {};\n Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}","/**\n * If `componentProps` is a function, calls it with the provided `ownerState`.\n * Otherwise, just returns `componentProps`.\n */\nexport function resolveComponentProps(componentProps, ownerState, slotState) {\n if (typeof componentProps === 'function') {\n return componentProps(ownerState, slotState);\n }\n return componentProps;\n}","/**\n * Removes event handlers from the given object.\n * A field is considered an event handler if it is a function with a name beginning with `on`.\n *\n * @param object Object to remove event handlers from.\n * @returns Object with event handlers removed.\n */\nexport function omitEventHandlers(object) {\n if (object === undefined) {\n return {};\n }\n const result = {};\n Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport clsx from 'clsx';\nimport { extractEventHandlers } from './extractEventHandlers';\nimport { omitEventHandlers } from './omitEventHandlers';\n/**\n * Merges the slot component internal props (usually coming from a hook)\n * with the externally provided ones.\n *\n * The merge order is (the latter overrides the former):\n * 1. The internal props (specified as a getter function to work with get*Props hook result)\n * 2. Additional props (specified internally on a Base UI component)\n * 3. External props specified on the owner component. These should only be used on a root slot.\n * 4. External props specified in the `slotProps.*` prop.\n * 5. The `className` prop - combined from all the above.\n * @param parameters\n * @returns\n */\nexport function mergeSlotProps(parameters) {\n const {\n getSlotProps,\n additionalProps,\n externalSlotProps,\n externalForwardedProps,\n className\n } = parameters;\n if (!getSlotProps) {\n // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,\n // so we can simply merge all the props without having to worry about extracting event handlers.\n const joinedClasses = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: undefined\n };\n }\n\n // In this case, getSlotProps is responsible for calling the external event handlers.\n // We don't need to include them in the merged props because of this.\n\n const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));\n const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);\n const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);\n const internalSlotProps = getSlotProps(eventHandlers);\n\n // The order of classes is important here.\n // Emotion (that we use in libraries consuming Base UI) depends on this order\n // to properly override style. It requires the most important classes to be last\n // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.\n const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: internalSlotProps.ref\n };\n}","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"elementType\", \"externalSlotProps\", \"ownerState\", \"skipResolvingSlotProps\"];\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { appendOwnerState } from './appendOwnerState';\nimport { mergeSlotProps } from './mergeSlotProps';\nimport { resolveComponentProps } from './resolveComponentProps';\n/**\n * @ignore - do not document.\n * Builds the props to be passed into the slot of an unstyled component.\n * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.\n * If the slot component is not a host component, it also merges in the `ownerState`.\n *\n * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.\n */\nexport function useSlotProps(parameters) {\n var _parameters$additiona;\n const {\n elementType,\n externalSlotProps,\n ownerState,\n skipResolvingSlotProps = false\n } = parameters,\n rest = _objectWithoutPropertiesLoose(parameters, _excluded);\n const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);\n const {\n props: mergedProps,\n internalRef\n } = mergeSlotProps(_extends({}, rest, {\n externalSlotProps: resolvedComponentsProps\n }));\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);\n const props = appendOwnerState(elementType, _extends({}, mergedProps, {\n ref\n }), ownerState);\n return props;\n}","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction Ripple(props) {\n const {\n className,\n classes,\n pulsate = false,\n rippleX,\n rippleY,\n rippleSize,\n in: inProp,\n onExited,\n timeout\n } = props;\n const [leaving, setLeaving] = React.useState(false);\n const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n const rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n if (!inProp && !leaving) {\n setLeaving(true);\n }\n React.useEffect(() => {\n if (!inProp && onExited != null) {\n // react-transition-group#onExited\n const timeoutId = setTimeout(onExited, timeout);\n return () => {\n clearTimeout(timeoutId);\n };\n }\n return undefined;\n }, [onExited, inProp, timeout]);\n return /*#__PURE__*/_jsx(\"span\", {\n className: rippleClassName,\n style: rippleStyles,\n children: /*#__PURE__*/_jsx(\"span\", {\n className: childClassName\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getTouchRippleUtilityClass(slot) {\n return generateUtilityClass('MuiTouchRipple', slot);\n}\nconst touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);\nexport default touchRippleClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"center\", \"classes\", \"className\"];\nlet _ = t => t,\n _t,\n _t2,\n _t3,\n _t4;\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport { keyframes } from '@mui/system';\nimport useTimeout from '@mui/utils/useTimeout';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport Ripple from './Ripple';\nimport touchRippleClasses from './touchRippleClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DURATION = 550;\nexport const DELAY_RIPPLE = 80;\nconst enterKeyframe = keyframes(_t || (_t = _`\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n`));\nconst exitKeyframe = keyframes(_t2 || (_t2 = _`\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n`));\nconst pulsateKeyframe = keyframes(_t3 || (_t3 = _`\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n`));\nexport const TouchRippleRoot = styled('span', {\n name: 'MuiTouchRipple',\n slot: 'Root'\n})({\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n});\n\n// This `styled()` function invokes keyframes. `styled-components` only supports keyframes\n// in string templates. Do not convert these styles in JS object as it will break.\nexport const TouchRippleRipple = styled(Ripple, {\n name: 'MuiTouchRipple',\n slot: 'Ripple'\n})(_t4 || (_t4 = _`\n opacity: 0;\n position: absolute;\n\n &.${0} {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n &.${0} {\n animation-duration: ${0}ms;\n }\n\n & .${0} {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .${0} {\n opacity: 0;\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n & .${0} {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ${0};\n animation-duration: 2500ms;\n animation-timing-function: ${0};\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n`), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({\n theme\n}) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({\n theme\n}) => theme.transitions.easing.easeInOut);\n\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\nconst TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiTouchRipple'\n });\n const {\n center: centerProp = false,\n classes = {},\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [ripples, setRipples] = React.useState([]);\n const nextKey = React.useRef(0);\n const rippleCallback = React.useRef(null);\n React.useEffect(() => {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]);\n\n // Used to filter out mouse emulated events on mobile.\n const ignoringMouseDown = React.useRef(false);\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n const startTimer = useTimeout();\n\n // This is the hook called once the previous timeout is ready.\n const startTimerCommit = React.useRef(null);\n const container = React.useRef(null);\n const startCommit = React.useCallback(params => {\n const {\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n } = params;\n setRipples(oldRipples => [...oldRipples, /*#__PURE__*/_jsx(TouchRippleRipple, {\n classes: {\n ripple: clsx(classes.ripple, touchRippleClasses.ripple),\n rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),\n ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),\n child: clsx(classes.child, touchRippleClasses.child),\n childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),\n childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)\n },\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n }, nextKey.current)]);\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {\n const {\n pulsate = false,\n center = centerProp || options.pulsate,\n fakeElement = false // For test purposes\n } = options;\n if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n if ((event == null ? void 0 : event.type) === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n const element = fakeElement ? null : container.current;\n const rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n\n // Get the size of the ripple\n let rippleX;\n let rippleY;\n let rippleSize;\n if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n const {\n clientX,\n clientY\n } = event.touches && event.touches.length > 0 ? event.touches[0] : event;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n if (center) {\n rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);\n\n // For some reason the animation is broken on Mobile Chrome if the size is even.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);\n }\n\n // Touche devices\n if (event != null && event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = () => {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n };\n // Delay the execution of the ripple effect.\n // We have to make a tradeoff with this delay value.\n startTimer.start(DELAY_RIPPLE, () => {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n });\n }\n } else {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n }\n }, [centerProp, startCommit, startTimer]);\n const pulsate = React.useCallback(() => {\n start({}, {\n pulsate: true\n });\n }, [start]);\n const stop = React.useCallback((event, cb) => {\n startTimer.clear();\n\n // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.start(0, () => {\n stop(event, cb);\n });\n return;\n }\n startTimerCommit.current = null;\n setRipples(oldRipples => {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, [startTimer]);\n React.useImperativeHandle(ref, () => ({\n pulsate,\n start,\n stop\n }), [pulsate, start, stop]);\n return /*#__PURE__*/_jsx(TouchRippleRoot, _extends({\n className: clsx(touchRippleClasses.root, classes.root, className),\n ref: container\n }, other, {\n children: /*#__PURE__*/_jsx(TransitionGroup, {\n component: null,\n exit: true,\n children: ripples\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default TouchRipple;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getButtonBaseUtilityClass(slot) {\n return generateUtilityClass('MuiButtonBase', slot);\n}\nconst buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);\nexport default buttonBaseClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"action\", \"centerRipple\", \"children\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"LinkComponent\", \"onBlur\", \"onClick\", \"onContextMenu\", \"onDragLeave\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"tabIndex\", \"TouchRippleProps\", \"touchRippleRef\", \"type\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nimport buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n focusVisible,\n focusVisibleClassName,\n classes\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']\n };\n const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);\n if (focusVisible && focusVisibleClassName) {\n composedClasses.root += ` ${focusVisibleClassName}`;\n }\n return composedClasses;\n};\nexport const ButtonBaseRoot = styled('button', {\n name: 'MuiButtonBase',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n [`&.${buttonBaseClasses.disabled}`]: {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n});\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\nconst ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiButtonBase'\n });\n const {\n action,\n centerRipple = false,\n children,\n className,\n component = 'button',\n disabled = false,\n disableRipple = false,\n disableTouchRipple = false,\n focusRipple = false,\n LinkComponent = 'a',\n onBlur,\n onClick,\n onContextMenu,\n onDragLeave,\n onFocus,\n onFocusVisible,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n tabIndex = 0,\n TouchRippleProps,\n touchRippleRef,\n type\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const buttonRef = React.useRef(null);\n const rippleRef = React.useRef(null);\n const handleRippleRef = useForkRef(rippleRef, touchRippleRef);\n const {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible();\n const [focusVisible, setFocusVisible] = React.useState(false);\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n React.useImperativeHandle(action, () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n }), []);\n const [mountedState, setMountedState] = React.useState(false);\n React.useEffect(() => {\n setMountedState(true);\n }, []);\n const enableTouchRipple = mountedState && !disableRipple && !disabled;\n React.useEffect(() => {\n if (focusVisible && focusRipple && !disableRipple && mountedState) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible, mountedState]);\n function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {\n return useEventCallback(event => {\n if (eventCallback) {\n eventCallback(event);\n }\n const ignore = skipRippleAction;\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n return true;\n });\n }\n const handleMouseDown = useRippleHandler('start', onMouseDown);\n const handleContextMenu = useRippleHandler('stop', onContextMenu);\n const handleDragLeave = useRippleHandler('stop', onDragLeave);\n const handleMouseUp = useRippleHandler('stop', onMouseUp);\n const handleMouseLeave = useRippleHandler('stop', event => {\n if (focusVisible) {\n event.preventDefault();\n }\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n const handleTouchStart = useRippleHandler('start', onTouchStart);\n const handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n const handleTouchMove = useRippleHandler('stop', onTouchMove);\n const handleBlur = useRippleHandler('stop', event => {\n handleBlurVisible(event);\n if (isFocusVisibleRef.current === false) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n const handleFocus = useEventCallback(event => {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n handleFocusVisible(event);\n if (isFocusVisibleRef.current === true) {\n setFocusVisible(true);\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n if (onFocus) {\n onFocus(event);\n }\n });\n const isNonNativeButton = () => {\n const button = buttonRef.current;\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n\n /**\n * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n const keydownRef = React.useRef(false);\n const handleKeyDown = useEventCallback(event => {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n rippleRef.current.stop(event, () => {\n rippleRef.current.start(event);\n });\n }\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n });\n const handleKeyUp = useEventCallback(event => {\n // calling preventDefault in keyUp on a \r\n *
\r\n * )\r\n * }\r\n */\n\nexport const useDispatch = /*#__PURE__*/createDispatchHook();","// The primary entry point assumes we're working with standard ReactDOM/RN, but\n// older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).\n// Because of that, the useSyncExternalStore compat shim is needed.\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch';\nimport { initializeUseSelector } from './hooks/useSelector';\nimport { initializeConnect } from './components/connect';\ninitializeUseSelector(useSyncExternalStoreWithSelector);\ninitializeConnect(useSyncExternalStore); // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };\nexport * from './exports';","export const TOOLS_ICON_TITLE_PLACEHOLDER = 'Selected survey';\n\nexport const BACKGROUND_COLOR_SELECTED = '#0860A2';\nexport const BACKGROUND_COLOR_NOT_SELECTED = '#738eb5';\n\nexport const TOOLS_OPTIONS_OBJECT = {\n table: {\n label: 'table',\n },\n chart: {\n label: 'chart',\n },\n line: {\n label: 'line',\n },\n map: {\n label: 'map',\n },\n};\n\nexport const COLUMN_CHARACTERISTIC = 'CharacteristicLabel';\nexport const COLUMN_COUNTRY = 'CountryName';\nexport const COLUMN_SURVEY = 'SurveyLabel';\nexport const COLUMN_VALUE = 'Value';\n","import React from 'react';\n\n// Configs\nimport { BACKGROUND_COLOR_NOT_SELECTED, BACKGROUND_COLOR_SELECTED } from '../../configs/tools.configs';\n\nconst ToolTableIcon = ({ selected = false, title = 'Tool Table Icon' }: { selected: boolean; title?: string }) => {\n const backgroundColor = selected ? BACKGROUND_COLOR_SELECTED : BACKGROUND_COLOR_NOT_SELECTED;\n\n return (\n \n {title}\n \n \n \n );\n};\n\nexport default ToolTableIcon;\n","import React from 'react';\n\n// Configs\nimport { BACKGROUND_COLOR_NOT_SELECTED, BACKGROUND_COLOR_SELECTED } from '../../configs/tools.configs';\n\nconst ToolChartIcon = ({ selected = false, title = 'Tool Chart Icon' }: { selected: boolean; title?: string }) => {\n const backgroundColor = selected ? BACKGROUND_COLOR_SELECTED : BACKGROUND_COLOR_NOT_SELECTED;\n\n return (\n \n {title}\n \n \n \n );\n};\n\nexport default ToolChartIcon;\n","import React from 'react';\n\n// Configs\nimport { BACKGROUND_COLOR_NOT_SELECTED, BACKGROUND_COLOR_SELECTED } from '../../configs/tools.configs';\n\nconst ToolMapIcon = ({ selected = false, title = 'Tool Map Icon' }: { selected: boolean; title?: string }) => {\n const backgroundColor = selected ? BACKGROUND_COLOR_SELECTED : BACKGROUND_COLOR_NOT_SELECTED;\n\n return (\n \n {title}\n \n \n \n \n \n \n );\n};\n\nexport default ToolMapIcon;\n","import React from 'react';\n\n// Styles\nimport './SidebarMapDisableContainer.scss';\n\nconst SidebarMapDisableContainer = () => {\n return
;\n};\n\nexport default SidebarMapDisableContainer;\n","function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||\"object\"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return\"production\"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b(\"Patches\"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b(\"ES5\").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b(\"Patches\").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b(\"Patches\").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if(\"production\"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b(\"MapSet\").F(r,t):v(r)?b(\"MapSet\").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b(\"ES5\").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b(\"ES5\").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return\"production\"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];\"production\"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e1?t-1:0),o=1;o1?t-1:0),o=1;o=0;e--){var i=t[e];if(0===i.path.length&&\"replace\"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b(\"Patches\").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,R as current,J as enableAllPlugins,F as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};\n//# sourceMappingURL=immer.esm.js.map\n","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nexport default function _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","// Cache implementation based on Erik Rasmussen's `lru-memoize`:\n// https://github.com/erikras/lru-memoize\nvar NOT_FOUND = 'NOT_FOUND';\n\nfunction createSingletonCache(equals) {\n var entry;\n return {\n get: function get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n\n return NOT_FOUND;\n },\n put: function put(key, value) {\n entry = {\n key: key,\n value: value\n };\n },\n getEntries: function getEntries() {\n return entry ? [entry] : [];\n },\n clear: function clear() {\n entry = undefined;\n }\n };\n}\n\nfunction createLruCache(maxSize, equals) {\n var entries = [];\n\n function get(key) {\n var cacheIndex = entries.findIndex(function (entry) {\n return equals(key, entry.key);\n }); // We found a cached entry\n\n if (cacheIndex > -1) {\n var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top\n\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n\n return entry.value;\n } // No entry found in cache, return sentinel\n\n\n return NOT_FOUND;\n }\n\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n // TODO Is unshift slow?\n entries.unshift({\n key: key,\n value: value\n });\n\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n\n function getEntries() {\n return entries;\n }\n\n function clear() {\n entries = [];\n }\n\n return {\n get: get,\n put: put,\n getEntries: getEntries,\n clear: clear\n };\n}\n\nexport var defaultEqualityCheck = function defaultEqualityCheck(a, b) {\n return a === b;\n};\nexport function createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n\n\n var length = prev.length;\n\n for (var i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n };\n}\n// defaultMemoize now supports a configurable cache size with LRU behavior,\n// and optional comparison of the result value with existing values\nexport function defaultMemoize(func, equalityCheckOrOptions) {\n var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {\n equalityCheck: equalityCheckOrOptions\n };\n var _providedOptions$equa = providedOptions.equalityCheck,\n equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,\n _providedOptions$maxS = providedOptions.maxSize,\n maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,\n resultEqualityCheck = providedOptions.resultEqualityCheck;\n var comparator = createCacheKeyComparator(equalityCheck);\n var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons\n\n function memoized() {\n var value = cache.get(arguments);\n\n if (value === NOT_FOUND) {\n // @ts-ignore\n value = func.apply(null, arguments);\n\n if (resultEqualityCheck) {\n var entries = cache.getEntries();\n var matchingEntry = entries.find(function (entry) {\n return resultEqualityCheck(entry.value, value);\n });\n\n if (matchingEntry) {\n value = matchingEntry.value;\n }\n }\n\n cache.put(arguments, value);\n }\n\n return value;\n }\n\n memoized.clearCache = function () {\n return cache.clear();\n };\n\n return memoized;\n}","import { defaultMemoize, defaultEqualityCheck } from './defaultMemoize';\nexport { defaultMemoize, defaultEqualityCheck };\n\nfunction getDependencies(funcs) {\n var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n if (!dependencies.every(function (dep) {\n return typeof dep === 'function';\n })) {\n var dependencyTypes = dependencies.map(function (dep) {\n return typeof dep === 'function' ? \"function \" + (dep.name || 'unnamed') + \"()\" : typeof dep;\n }).join(', ');\n throw new Error(\"createSelector expects all input-selectors to be functions, but received the following types: [\" + dependencyTypes + \"]\");\n }\n\n return dependencies;\n}\n\nexport function createSelectorCreator(memoize) {\n for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n memoizeOptionsFromArgs[_key - 1] = arguments[_key];\n }\n\n var createSelector = function createSelector() {\n for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n funcs[_key2] = arguments[_key2];\n }\n\n var _recomputations = 0;\n\n var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.\n // So, start by declaring the default value here.\n // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)\n\n\n var directlyPassedOptions = {\n memoizeOptions: undefined\n }; // Normally, the result func or \"output selector\" is the last arg\n\n var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object\n\n if (typeof resultFunc === 'object') {\n directlyPassedOptions = resultFunc; // and pop the real result func off\n\n resultFunc = funcs.pop();\n }\n\n if (typeof resultFunc !== 'function') {\n throw new Error(\"createSelector expects an output function after the inputs, but received: [\" + typeof resultFunc + \"]\");\n } // Determine which set of options we're using. Prefer options passed directly,\n // but fall back to options given to createSelectorCreator.\n\n\n var _directlyPassedOption = directlyPassedOptions,\n _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,\n memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer\n // is an array. In most libs I've looked at, it's an equality function or options object.\n // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full\n // user-provided array of options. Otherwise, it must be just the _first_ arg, and so\n // we wrap it in an array so we can apply it.\n\n var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];\n var dependencies = getDependencies(funcs);\n var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {\n _recomputations++; // apply arguments instead of spreading for performance.\n\n return resultFunc.apply(null, arguments);\n }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n\n var selector = memoize(function dependenciesChecker() {\n var params = [];\n var length = dependencies.length;\n\n for (var i = 0; i < length; i++) {\n // apply arguments instead of spreading and mutate a local list of params for performance.\n // @ts-ignore\n params.push(dependencies[i].apply(null, arguments));\n } // apply arguments instead of spreading for performance.\n\n\n _lastResult = memoizedResultFunc.apply(null, params);\n return _lastResult;\n });\n Object.assign(selector, {\n resultFunc: resultFunc,\n memoizedResultFunc: memoizedResultFunc,\n dependencies: dependencies,\n lastResult: function lastResult() {\n return _lastResult;\n },\n recomputations: function recomputations() {\n return _recomputations;\n },\n resetRecomputations: function resetRecomputations() {\n return _recomputations = 0;\n }\n });\n return selector;\n }; // @ts-ignore\n\n\n return createSelector;\n}\nexport var createSelector = /* #__PURE__ */createSelectorCreator(defaultMemoize);\n// Manual definition of state and output arguments\nexport var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {\n if (selectorCreator === void 0) {\n selectorCreator = createSelector;\n }\n\n if (typeof selectors !== 'object') {\n throw new Error('createStructuredSelector expects first argument to be an object ' + (\"where each property is a selector, instead received a \" + typeof selectors));\n }\n\n var objectKeys = Object.keys(selectors);\n var resultSelector = selectorCreator( // @ts-ignore\n objectKeys.map(function (key) {\n return selectors[key];\n }), function () {\n for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n values[_key3] = arguments[_key3];\n }\n\n return values.reduce(function (composition, value, index) {\n composition[objectKeys[index]] = value;\n return composition;\n }, {});\n });\n return resultSelector;\n};","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n};\r\nvar __defProp = Object.defineProperty;\r\nvar __defProps = Object.defineProperties;\r\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\r\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\r\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\r\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\r\nvar __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };\r\nvar __spreadValues = function (a, b) {\r\n for (var prop in b || (b = {}))\r\n if (__hasOwnProp.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n if (__getOwnPropSymbols)\r\n for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {\r\n var prop = _c[_i];\r\n if (__propIsEnum.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n }\r\n return a;\r\n};\r\nvar __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };\r\nvar __async = function (__this, __arguments, generator) {\r\n return new Promise(function (resolve, reject) {\r\n var fulfilled = function (value) {\r\n try {\r\n step(generator.next(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var rejected = function (value) {\r\n try {\r\n step(generator.throw(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };\r\n step((generator = generator.apply(__this, __arguments)).next());\r\n });\r\n};\r\n// src/index.ts\r\nimport { enableES5 } from \"immer\";\r\nexport * from \"redux\";\r\nimport { default as default2, current as current2, freeze, original, isDraft as isDraft4 } from \"immer\";\r\nimport { createSelector as createSelector2 } from \"reselect\";\r\n// src/createDraftSafeSelector.ts\r\nimport { current, isDraft } from \"immer\";\r\nimport { createSelector } from \"reselect\";\r\nvar createDraftSafeSelector = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var selector = createSelector.apply(void 0, args);\r\n var wrappedSelector = function (value) {\r\n var rest = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n rest[_i - 1] = arguments[_i];\r\n }\r\n return selector.apply(void 0, __spreadArray([isDraft(value) ? current(value) : value], rest));\r\n };\r\n return wrappedSelector;\r\n};\r\n// src/configureStore.ts\r\nimport { createStore, compose as compose2, applyMiddleware, combineReducers } from \"redux\";\r\n// src/devtoolsExtension.ts\r\nimport { compose } from \"redux\";\r\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {\r\n if (arguments.length === 0)\r\n return void 0;\r\n if (typeof arguments[0] === \"object\")\r\n return compose;\r\n return compose.apply(null, arguments);\r\n};\r\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {\r\n return function (noop2) {\r\n return noop2;\r\n };\r\n};\r\n// src/isPlainObject.ts\r\nfunction isPlainObject(value) {\r\n if (typeof value !== \"object\" || value === null)\r\n return false;\r\n var proto = Object.getPrototypeOf(value);\r\n if (proto === null)\r\n return true;\r\n var baseProto = proto;\r\n while (Object.getPrototypeOf(baseProto) !== null) {\r\n baseProto = Object.getPrototypeOf(baseProto);\r\n }\r\n return proto === baseProto;\r\n}\r\n// src/getDefaultMiddleware.ts\r\nimport thunkMiddleware from \"redux-thunk\";\r\n// src/tsHelpers.ts\r\nvar hasMatchFunction = function (v) {\r\n return v && typeof v.match === \"function\";\r\n};\r\n// src/createAction.ts\r\nfunction createAction(type, prepareAction) {\r\n function actionCreator() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (prepareAction) {\r\n var prepared = prepareAction.apply(void 0, args);\r\n if (!prepared) {\r\n throw new Error(\"prepareAction did not return an object\");\r\n }\r\n return __spreadValues(__spreadValues({\r\n type: type,\r\n payload: prepared.payload\r\n }, \"meta\" in prepared && { meta: prepared.meta }), \"error\" in prepared && { error: prepared.error });\r\n }\r\n return { type: type, payload: args[0] };\r\n }\r\n actionCreator.toString = function () { return \"\" + type; };\r\n actionCreator.type = type;\r\n actionCreator.match = function (action) { return action.type === type; };\r\n return actionCreator;\r\n}\r\nfunction isAction(action) {\r\n return isPlainObject(action) && \"type\" in action;\r\n}\r\nfunction isActionCreator(action) {\r\n return typeof action === \"function\" && \"type\" in action && hasMatchFunction(action);\r\n}\r\nfunction isFSA(action) {\r\n return isAction(action) && typeof action.type === \"string\" && Object.keys(action).every(isValidKey);\r\n}\r\nfunction isValidKey(key) {\r\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\r\n}\r\nfunction getType(actionCreator) {\r\n return \"\" + actionCreator;\r\n}\r\n// src/actionCreatorInvariantMiddleware.ts\r\nfunction getMessage(type) {\r\n var splitType = type ? (\"\" + type).split(\"/\") : [];\r\n var actionName = splitType[splitType.length - 1] || \"actionCreator\";\r\n return \"Detected an action creator with type \\\"\" + (type || \"unknown\") + \"\\\" being dispatched. \\nMake sure you're calling the action creator before dispatching, i.e. `dispatch(\" + actionName + \"())` instead of `dispatch(\" + actionName + \")`. This is necessary even if the action has no payload.\";\r\n}\r\nfunction createActionCreatorInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c;\r\n return function () { return function (next) { return function (action) {\r\n if (isActionCreator2(action)) {\r\n console.warn(getMessage(action.type));\r\n }\r\n return next(action);\r\n }; }; };\r\n}\r\n// src/utils.ts\r\nimport createNextState, { isDraftable } from \"immer\";\r\nfunction getTimeMeasureUtils(maxDelay, fnName) {\r\n var elapsed = 0;\r\n return {\r\n measureTime: function (fn) {\r\n var started = Date.now();\r\n try {\r\n return fn();\r\n }\r\n finally {\r\n var finished = Date.now();\r\n elapsed += finished - started;\r\n }\r\n },\r\n warnIfExceeded: function () {\r\n if (elapsed > maxDelay) {\r\n console.warn(fnName + \" took \" + elapsed + \"ms, which is more than the warning threshold of \" + maxDelay + \"ms. \\nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\\nIt is disabled in production builds, so you don't need to worry about that.\");\r\n }\r\n }\r\n };\r\n}\r\nvar MiddlewareArray = /** @class */ (function (_super) {\r\n __extends(MiddlewareArray, _super);\r\n function MiddlewareArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, MiddlewareArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(MiddlewareArray, Symbol.species, {\r\n get: function () {\r\n return MiddlewareArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n MiddlewareArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n MiddlewareArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return MiddlewareArray;\r\n}(Array));\r\nvar EnhancerArray = /** @class */ (function (_super) {\r\n __extends(EnhancerArray, _super);\r\n function EnhancerArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, EnhancerArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(EnhancerArray, Symbol.species, {\r\n get: function () {\r\n return EnhancerArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n EnhancerArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n EnhancerArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return EnhancerArray;\r\n}(Array));\r\nfunction freezeDraftable(val) {\r\n return isDraftable(val) ? createNextState(val, function () {\r\n }) : val;\r\n}\r\n// src/immutableStateInvariantMiddleware.ts\r\nvar isProduction = process.env.NODE_ENV === \"production\";\r\nvar prefix = \"Invariant failed\";\r\nfunction invariant(condition, message) {\r\n if (condition) {\r\n return;\r\n }\r\n if (isProduction) {\r\n throw new Error(prefix);\r\n }\r\n throw new Error(prefix + \": \" + (message || \"\"));\r\n}\r\nfunction stringify(obj, serializer, indent, decycler) {\r\n return JSON.stringify(obj, getSerialize(serializer, decycler), indent);\r\n}\r\nfunction getSerialize(serializer, decycler) {\r\n var stack = [], keys = [];\r\n if (!decycler)\r\n decycler = function (_, value) {\r\n if (stack[0] === value)\r\n return \"[Circular ~]\";\r\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\r\n };\r\n return function (key, value) {\r\n if (stack.length > 0) {\r\n var thisPos = stack.indexOf(this);\r\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\r\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\r\n if (~stack.indexOf(value))\r\n value = decycler.call(this, key, value);\r\n }\r\n else\r\n stack.push(value);\r\n return serializer == null ? value : serializer.call(this, key, value);\r\n };\r\n}\r\nfunction isImmutableDefault(value) {\r\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\r\n}\r\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\r\n var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\r\n return {\r\n detectMutations: function () {\r\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\r\n }\r\n };\r\n}\r\nfunction trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {\r\n if (ignorePaths === void 0) { ignorePaths = []; }\r\n if (path === void 0) { path = \"\"; }\r\n if (checkedObjects === void 0) { checkedObjects = new Set(); }\r\n var tracked = { value: obj };\r\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\r\n checkedObjects.add(obj);\r\n tracked.children = {};\r\n for (var key in obj) {\r\n var childPath = path ? path + \".\" + key : key;\r\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\r\n continue;\r\n }\r\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\r\n }\r\n }\r\n return tracked;\r\n}\r\nfunction detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n if (sameParentRef === void 0) { sameParentRef = false; }\r\n if (path === void 0) { path = \"\"; }\r\n var prevObj = trackedProperty ? trackedProperty.value : void 0;\r\n var sameRef = prevObj === obj;\r\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\r\n return { wasMutated: true, path: path };\r\n }\r\n if (isImmutable(prevObj) || isImmutable(obj)) {\r\n return { wasMutated: false };\r\n }\r\n var keysToDetect = {};\r\n for (var key in trackedProperty.children) {\r\n keysToDetect[key] = true;\r\n }\r\n for (var key in obj) {\r\n keysToDetect[key] = true;\r\n }\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n var _loop_1 = function (key) {\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths) {\r\n var hasMatches = ignoredPaths.some(function (ignored) {\r\n if (ignored instanceof RegExp) {\r\n return ignored.test(nestedPath);\r\n }\r\n return nestedPath === ignored;\r\n });\r\n if (hasMatches) {\r\n return \"continue\";\r\n }\r\n }\r\n var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\r\n if (result.wasMutated) {\r\n return { value: result };\r\n }\r\n };\r\n for (var key in keysToDetect) {\r\n var state_1 = _loop_1(key);\r\n if (typeof state_1 === \"object\")\r\n return state_1.value;\r\n }\r\n return { wasMutated: false };\r\n}\r\nfunction createImmutableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;\r\n ignoredPaths = ignoredPaths || ignore;\r\n var track = trackForMutations.bind(null, isImmutable, ignoredPaths);\r\n return function (_c) {\r\n var getState = _c.getState;\r\n var state = getState();\r\n var tracker = track(state);\r\n var result;\r\n return function (next) { return function (action) {\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n invariant(!result.wasMutated, \"A state mutation was detected between dispatches, in the path '\" + (result.path || \"\") + \"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n var dispatchedAction = next(action);\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n result.wasMutated && invariant(!result.wasMutated, \"A state mutation was detected inside a dispatch, in the path: \" + (result.path || \"\") + \". Take a look at the reducer(s) handling the action \" + stringify(action) + \". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n measureUtils.warnIfExceeded();\r\n return dispatchedAction;\r\n }; };\r\n };\r\n}\r\n// src/serializableStateInvariantMiddleware.ts\r\nfunction isPlain(val) {\r\n var type = typeof val;\r\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\r\n}\r\nfunction findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {\r\n if (path === void 0) { path = \"\"; }\r\n if (isSerializable === void 0) { isSerializable = isPlain; }\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n var foundNestedSerializable;\r\n if (!isSerializable(value)) {\r\n return {\r\n keyPath: path || \"\",\r\n value: value\r\n };\r\n }\r\n if (typeof value !== \"object\" || value === null) {\r\n return false;\r\n }\r\n if (cache == null ? void 0 : cache.has(value))\r\n return false;\r\n var entries = getEntries != null ? getEntries(value) : Object.entries(value);\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n var _loop_2 = function (key, nestedValue) {\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths) {\r\n var hasMatches = ignoredPaths.some(function (ignored) {\r\n if (ignored instanceof RegExp) {\r\n return ignored.test(nestedPath);\r\n }\r\n return nestedPath === ignored;\r\n });\r\n if (hasMatches) {\r\n return \"continue\";\r\n }\r\n }\r\n if (!isSerializable(nestedValue)) {\r\n return { value: {\r\n keyPath: nestedPath,\r\n value: nestedValue\r\n } };\r\n }\r\n if (typeof nestedValue === \"object\") {\r\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\r\n if (foundNestedSerializable) {\r\n return { value: foundNestedSerializable };\r\n }\r\n }\r\n };\r\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\r\n var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];\r\n var state_2 = _loop_2(key, nestedValue);\r\n if (typeof state_2 === \"object\")\r\n return state_2.value;\r\n }\r\n if (cache && isNestedFrozen(value))\r\n cache.add(value);\r\n return false;\r\n}\r\nfunction isNestedFrozen(value) {\r\n if (!Object.isFrozen(value))\r\n return false;\r\n for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {\r\n var nestedValue = _c[_i];\r\n if (typeof nestedValue !== \"object\" || nestedValue === null)\r\n continue;\r\n if (!isNestedFrozen(nestedValue))\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction createSerializableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? [\"meta.arg\", \"meta.baseQueryMeta\"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;\r\n var cache = !disableCache && WeakSet ? new WeakSet() : void 0;\r\n return function (storeAPI) { return function (next) { return function (action) {\r\n var result = next(action);\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\r\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\r\n measureUtils.measureTime(function () {\r\n var foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\r\n if (foundActionNonSerializableValue) {\r\n var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in an action, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\r\n }\r\n });\r\n }\r\n if (!ignoreState) {\r\n measureUtils.measureTime(function () {\r\n var state = storeAPI.getState();\r\n var foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\r\n if (foundStateNonSerializableValue) {\r\n var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in the state, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the reducer(s) handling this action type: \" + action.type + \".\\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)\");\r\n }\r\n });\r\n measureUtils.warnIfExceeded();\r\n }\r\n return result;\r\n }; }; };\r\n}\r\n// src/getDefaultMiddleware.ts\r\nfunction isBoolean(x) {\r\n return typeof x === \"boolean\";\r\n}\r\nfunction curryGetDefaultMiddleware() {\r\n return function curriedGetDefaultMiddleware(options) {\r\n return getDefaultMiddleware(options);\r\n };\r\n}\r\nfunction getDefaultMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;\r\n var middlewareArray = new MiddlewareArray();\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware);\r\n }\r\n else {\r\n middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));\r\n }\r\n }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (immutableCheck) {\r\n var immutableOptions = {};\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck;\r\n }\r\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\r\n }\r\n if (serializableCheck) {\r\n var serializableOptions = {};\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck;\r\n }\r\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\r\n }\r\n if (actionCreatorCheck) {\r\n var actionCreatorOptions = {};\r\n if (!isBoolean(actionCreatorCheck)) {\r\n actionCreatorOptions = actionCreatorCheck;\r\n }\r\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\r\n }\r\n }\r\n return middlewareArray;\r\n}\r\n// src/configureStore.ts\r\nvar IS_PRODUCTION = process.env.NODE_ENV === \"production\";\r\nfunction configureStore(options) {\r\n var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();\r\n var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;\r\n var rootReducer;\r\n if (typeof reducer === \"function\") {\r\n rootReducer = reducer;\r\n }\r\n else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer);\r\n }\r\n else {\r\n throw new Error('\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');\r\n }\r\n var finalMiddleware = middleware;\r\n if (typeof finalMiddleware === \"function\") {\r\n finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);\r\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\r\n throw new Error(\"when using a middleware builder function, an array of middleware must be returned\");\r\n }\r\n }\r\n if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== \"function\"; })) {\r\n throw new Error(\"each middleware provided to configureStore must be a function\");\r\n }\r\n var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);\r\n var finalCompose = compose2;\r\n if (devTools) {\r\n finalCompose = composeWithDevTools(__spreadValues({\r\n trace: !IS_PRODUCTION\r\n }, typeof devTools === \"object\" && devTools));\r\n }\r\n var defaultEnhancers = new EnhancerArray(middlewareEnhancer);\r\n var storeEnhancers = defaultEnhancers;\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);\r\n }\r\n else if (typeof enhancers === \"function\") {\r\n storeEnhancers = enhancers(defaultEnhancers);\r\n }\r\n var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);\r\n return createStore(rootReducer, preloadedState, composedEnhancer);\r\n}\r\n// src/createReducer.ts\r\nimport createNextState2, { isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\r\n// src/mapBuilders.ts\r\nfunction executeReducerBuilderCallback(builderCallback) {\r\n var actionsMap = {};\r\n var actionMatchers = [];\r\n var defaultCaseReducer;\r\n var builder = {\r\n addCase: function (typeOrActionCreator, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (actionMatchers.length > 0) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addMatcher`\");\r\n }\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n var type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\r\n if (!type) {\r\n throw new Error(\"`builder.addCase` cannot be called with an empty action type\");\r\n }\r\n if (type in actionsMap) {\r\n throw new Error(\"`builder.addCase` cannot be called with two reducers for the same action type\");\r\n }\r\n actionsMap[type] = reducer;\r\n return builder;\r\n },\r\n addMatcher: function (matcher, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n actionMatchers.push({ matcher: matcher, reducer: reducer });\r\n return builder;\r\n },\r\n addDefaultCase: function (reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addDefaultCase` can only be called once\");\r\n }\r\n }\r\n defaultCaseReducer = reducer;\r\n return builder;\r\n }\r\n };\r\n builderCallback(builder);\r\n return [actionsMap, actionMatchers, defaultCaseReducer];\r\n}\r\n// src/createReducer.ts\r\nfunction isStateFunction(x) {\r\n return typeof x === \"function\";\r\n}\r\nvar hasWarnedAboutObjectNotation = false;\r\nfunction createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {\r\n if (actionMatchers === void 0) { actionMatchers = []; }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof mapOrBuilderCallback === \"object\") {\r\n if (!hasWarnedAboutObjectNotation) {\r\n hasWarnedAboutObjectNotation = true;\r\n console.warn(\"The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\r\n }\r\n }\r\n }\r\n var _c = typeof mapOrBuilderCallback === \"function\" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];\r\n var getInitialState;\r\n if (isStateFunction(initialState)) {\r\n getInitialState = function () { return freezeDraftable(initialState()); };\r\n }\r\n else {\r\n var frozenInitialState_1 = freezeDraftable(initialState);\r\n getInitialState = function () { return frozenInitialState_1; };\r\n }\r\n function reducer(state, action) {\r\n if (state === void 0) { state = getInitialState(); }\r\n var caseReducers = __spreadArray([\r\n actionsMap[action.type]\r\n ], finalActionMatchers.filter(function (_c) {\r\n var matcher = _c.matcher;\r\n return matcher(action);\r\n }).map(function (_c) {\r\n var reducer2 = _c.reducer;\r\n return reducer2;\r\n }));\r\n if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {\r\n caseReducers = [finalDefaultCaseReducer];\r\n }\r\n return caseReducers.reduce(function (previousState, caseReducer) {\r\n if (caseReducer) {\r\n if (isDraft2(previousState)) {\r\n var draft = previousState;\r\n var result = caseReducer(draft, action);\r\n if (result === void 0) {\r\n return previousState;\r\n }\r\n return result;\r\n }\r\n else if (!isDraftable2(previousState)) {\r\n var result = caseReducer(previousState, action);\r\n if (result === void 0) {\r\n if (previousState === null) {\r\n return previousState;\r\n }\r\n throw Error(\"A case reducer on a non-draftable value must not return undefined\");\r\n }\r\n return result;\r\n }\r\n else {\r\n return createNextState2(previousState, function (draft) {\r\n return caseReducer(draft, action);\r\n });\r\n }\r\n }\r\n return previousState;\r\n }, state);\r\n }\r\n reducer.getInitialState = getInitialState;\r\n return reducer;\r\n}\r\n// src/createSlice.ts\r\nvar hasWarnedAboutObjectNotation2 = false;\r\nfunction getType2(slice, actionKey) {\r\n return slice + \"/\" + actionKey;\r\n}\r\nfunction createSlice(options) {\r\n var name = options.name;\r\n if (!name) {\r\n throw new Error(\"`name` is a required option for createSlice\");\r\n }\r\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\r\n if (options.initialState === void 0) {\r\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\r\n }\r\n }\r\n var initialState = typeof options.initialState == \"function\" ? options.initialState : freezeDraftable(options.initialState);\r\n var reducers = options.reducers || {};\r\n var reducerNames = Object.keys(reducers);\r\n var sliceCaseReducersByName = {};\r\n var sliceCaseReducersByType = {};\r\n var actionCreators = {};\r\n reducerNames.forEach(function (reducerName) {\r\n var maybeReducerWithPrepare = reducers[reducerName];\r\n var type = getType2(name, reducerName);\r\n var caseReducer;\r\n var prepareCallback;\r\n if (\"reducer\" in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer;\r\n prepareCallback = maybeReducerWithPrepare.prepare;\r\n }\r\n else {\r\n caseReducer = maybeReducerWithPrepare;\r\n }\r\n sliceCaseReducersByName[reducerName] = caseReducer;\r\n sliceCaseReducersByType[type] = caseReducer;\r\n actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);\r\n });\r\n function buildReducer() {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof options.extraReducers === \"object\") {\r\n if (!hasWarnedAboutObjectNotation2) {\r\n hasWarnedAboutObjectNotation2 = true;\r\n console.warn(\"The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\r\n }\r\n }\r\n }\r\n var _c = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;\r\n var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);\r\n return createReducer(initialState, function (builder) {\r\n for (var key in finalCaseReducers) {\r\n builder.addCase(key, finalCaseReducers[key]);\r\n }\r\n for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {\r\n var m = actionMatchers_1[_i];\r\n builder.addMatcher(m.matcher, m.reducer);\r\n }\r\n if (defaultCaseReducer) {\r\n builder.addDefaultCase(defaultCaseReducer);\r\n }\r\n });\r\n }\r\n var _reducer;\r\n return {\r\n name: name,\r\n reducer: function (state, action) {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer(state, action);\r\n },\r\n actions: actionCreators,\r\n caseReducers: sliceCaseReducersByName,\r\n getInitialState: function () {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer.getInitialState();\r\n }\r\n };\r\n}\r\n// src/entities/entity_state.ts\r\nfunction getInitialEntityState() {\r\n return {\r\n ids: [],\r\n entities: {}\r\n };\r\n}\r\nfunction createInitialStateFactory() {\r\n function getInitialState(additionalState) {\r\n if (additionalState === void 0) { additionalState = {}; }\r\n return Object.assign(getInitialEntityState(), additionalState);\r\n }\r\n return { getInitialState: getInitialState };\r\n}\r\n// src/entities/state_selectors.ts\r\nfunction createSelectorsFactory() {\r\n function getSelectors(selectState) {\r\n var selectIds = function (state) { return state.ids; };\r\n var selectEntities = function (state) { return state.entities; };\r\n var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });\r\n var selectId = function (_, id) { return id; };\r\n var selectById = function (entities, id) { return entities[id]; };\r\n var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });\r\n if (!selectState) {\r\n return {\r\n selectIds: selectIds,\r\n selectEntities: selectEntities,\r\n selectAll: selectAll,\r\n selectTotal: selectTotal,\r\n selectById: createDraftSafeSelector(selectEntities, selectId, selectById)\r\n };\r\n }\r\n var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);\r\n return {\r\n selectIds: createDraftSafeSelector(selectState, selectIds),\r\n selectEntities: selectGlobalizedEntities,\r\n selectAll: createDraftSafeSelector(selectState, selectAll),\r\n selectTotal: createDraftSafeSelector(selectState, selectTotal),\r\n selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)\r\n };\r\n }\r\n return { getSelectors: getSelectors };\r\n}\r\n// src/entities/state_adapter.ts\r\nimport createNextState3, { isDraft as isDraft3 } from \"immer\";\r\nfunction createSingleArgumentStateOperator(mutator) {\r\n var operator = createStateOperator(function (_, state) { return mutator(state); });\r\n return function operation(state) {\r\n return operator(state, void 0);\r\n };\r\n}\r\nfunction createStateOperator(mutator) {\r\n return function operation(state, arg) {\r\n function isPayloadActionArgument(arg2) {\r\n return isFSA(arg2);\r\n }\r\n var runMutator = function (draft) {\r\n if (isPayloadActionArgument(arg)) {\r\n mutator(arg.payload, draft);\r\n }\r\n else {\r\n mutator(arg, draft);\r\n }\r\n };\r\n if (isDraft3(state)) {\r\n runMutator(state);\r\n return state;\r\n }\r\n else {\r\n return createNextState3(state, runMutator);\r\n }\r\n };\r\n}\r\n// src/entities/utils.ts\r\nfunction selectIdValue(entity, selectId) {\r\n var key = selectId(entity);\r\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\r\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\r\n }\r\n return key;\r\n}\r\nfunction ensureEntitiesArray(entities) {\r\n if (!Array.isArray(entities)) {\r\n entities = Object.values(entities);\r\n }\r\n return entities;\r\n}\r\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var added = [];\r\n var updated = [];\r\n for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {\r\n var entity = newEntities_1[_i];\r\n var id = selectIdValue(entity, selectId);\r\n if (id in state.entities) {\r\n updated.push({ id: id, changes: entity });\r\n }\r\n else {\r\n added.push(entity);\r\n }\r\n }\r\n return [added, updated];\r\n}\r\n// src/entities/unsorted_state_adapter.ts\r\nfunction createUnsortedStateAdapter(selectId) {\r\n function addOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (key in state.entities) {\r\n return;\r\n }\r\n state.ids.push(key);\r\n state.entities[key] = entity;\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {\r\n var entity = newEntities_2[_i];\r\n addOneMutably(entity, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (!(key in state.entities)) {\r\n state.ids.push(key);\r\n }\r\n state.entities[key] = entity;\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {\r\n var entity = newEntities_3[_i];\r\n setOneMutably(entity, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.ids = [];\r\n state.entities = {};\r\n addManyMutably(newEntities, state);\r\n }\r\n function removeOneMutably(key, state) {\r\n return removeManyMutably([key], state);\r\n }\r\n function removeManyMutably(keys, state) {\r\n var didMutate = false;\r\n keys.forEach(function (key) {\r\n if (key in state.entities) {\r\n delete state.entities[key];\r\n didMutate = true;\r\n }\r\n });\r\n if (didMutate) {\r\n state.ids = state.ids.filter(function (id) { return id in state.entities; });\r\n }\r\n }\r\n function removeAllMutably(state) {\r\n Object.assign(state, {\r\n ids: [],\r\n entities: {}\r\n });\r\n }\r\n function takeNewKey(keys, update, state) {\r\n var original2 = state.entities[update.id];\r\n var updated = Object.assign({}, original2, update.changes);\r\n var newKey = selectIdValue(updated, selectId);\r\n var hasNewKey = newKey !== update.id;\r\n if (hasNewKey) {\r\n keys[update.id] = newKey;\r\n delete state.entities[update.id];\r\n }\r\n state.entities[newKey] = updated;\r\n return hasNewKey;\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var newKeys = {};\r\n var updatesPerEntity = {};\r\n updates.forEach(function (update) {\r\n if (update.id in state.entities) {\r\n updatesPerEntity[update.id] = {\r\n id: update.id,\r\n changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)\r\n };\r\n }\r\n });\r\n updates = Object.values(updatesPerEntity);\r\n var didMutateEntities = updates.length > 0;\r\n if (didMutateEntities) {\r\n var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;\r\n if (didMutateIds) {\r\n state.ids = Object.keys(state.entities);\r\n }\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n return {\r\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\r\n addOne: createStateOperator(addOneMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n upsertMany: createStateOperator(upsertManyMutably),\r\n removeOne: createStateOperator(removeOneMutably),\r\n removeMany: createStateOperator(removeManyMutably)\r\n };\r\n}\r\n// src/entities/sorted_state_adapter.ts\r\nfunction createSortedStateAdapter(selectId, sort) {\r\n var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;\r\n function addOneMutably(entity, state) {\r\n return addManyMutably([entity], state);\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });\r\n if (models.length !== 0) {\r\n merge(models, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n return setManyMutably([entity], state);\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n if (newEntities.length !== 0) {\r\n merge(newEntities, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.entities = {};\r\n state.ids = [];\r\n addManyMutably(newEntities, state);\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var appliedUpdates = false;\r\n for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {\r\n var update = updates_1[_i];\r\n var entity = state.entities[update.id];\r\n if (!entity) {\r\n continue;\r\n }\r\n appliedUpdates = true;\r\n Object.assign(entity, update.changes);\r\n var newId = selectId(entity);\r\n if (update.id !== newId) {\r\n delete state.entities[update.id];\r\n state.entities[newId] = entity;\r\n }\r\n }\r\n if (appliedUpdates) {\r\n resortEntities(state);\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n function areArraysEqual(a, b) {\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < a.length && i < b.length; i++) {\r\n if (a[i] === b[i]) {\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function merge(models, state) {\r\n models.forEach(function (model) {\r\n state.entities[selectId(model)] = model;\r\n });\r\n resortEntities(state);\r\n }\r\n function resortEntities(state) {\r\n var allEntities = Object.values(state.entities);\r\n allEntities.sort(sort);\r\n var newSortedIds = allEntities.map(selectId);\r\n var ids = state.ids;\r\n if (!areArraysEqual(ids, newSortedIds)) {\r\n state.ids = newSortedIds;\r\n }\r\n }\r\n return {\r\n removeOne: removeOne,\r\n removeMany: removeMany,\r\n removeAll: removeAll,\r\n addOne: createStateOperator(addOneMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertMany: createStateOperator(upsertManyMutably)\r\n };\r\n}\r\n// src/entities/create_adapter.ts\r\nfunction createEntityAdapter(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = __spreadValues({\r\n sortComparer: false,\r\n selectId: function (instance) { return instance.id; }\r\n }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;\r\n var stateFactory = createInitialStateFactory();\r\n var selectorsFactory = createSelectorsFactory();\r\n var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\r\n return __spreadValues(__spreadValues(__spreadValues({\r\n selectId: selectId,\r\n sortComparer: sortComparer\r\n }, stateFactory), selectorsFactory), stateAdapter);\r\n}\r\n// src/nanoid.ts\r\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\r\nvar nanoid = function (size) {\r\n if (size === void 0) { size = 21; }\r\n var id = \"\";\r\n var i = size;\r\n while (i--) {\r\n id += urlAlphabet[Math.random() * 64 | 0];\r\n }\r\n return id;\r\n};\r\n// src/createAsyncThunk.ts\r\nvar commonProperties = [\r\n \"name\",\r\n \"message\",\r\n \"stack\",\r\n \"code\"\r\n];\r\nvar RejectWithValue = /** @class */ (function () {\r\n function RejectWithValue(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return RejectWithValue;\r\n}());\r\nvar FulfillWithMeta = /** @class */ (function () {\r\n function FulfillWithMeta(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return FulfillWithMeta;\r\n}());\r\nvar miniSerializeError = function (value) {\r\n if (typeof value === \"object\" && value !== null) {\r\n var simpleError = {};\r\n for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {\r\n var property = commonProperties_1[_i];\r\n if (typeof value[property] === \"string\") {\r\n simpleError[property] = value[property];\r\n }\r\n }\r\n return simpleError;\r\n }\r\n return { message: String(value) };\r\n};\r\nvar createAsyncThunk = (function () {\r\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\r\n var fulfilled = createAction(typePrefix + \"/fulfilled\", function (payload, requestId, arg, meta) { return ({\r\n payload: payload,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"fulfilled\"\r\n })\r\n }); });\r\n var pending = createAction(typePrefix + \"/pending\", function (requestId, arg, meta) { return ({\r\n payload: void 0,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"pending\"\r\n })\r\n }); });\r\n var rejected = createAction(typePrefix + \"/rejected\", function (error, requestId, arg, payload, meta) { return ({\r\n payload: payload,\r\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n rejectedWithValue: !!payload,\r\n requestStatus: \"rejected\",\r\n aborted: (error == null ? void 0 : error.name) === \"AbortError\",\r\n condition: (error == null ? void 0 : error.name) === \"ConditionError\"\r\n })\r\n }); });\r\n var displayedWarning = false;\r\n var AC = typeof AbortController !== \"undefined\" ? AbortController : /** @class */ (function () {\r\n function class_1() {\r\n this.signal = {\r\n aborted: false,\r\n addEventListener: function () {\r\n },\r\n dispatchEvent: function () {\r\n return false;\r\n },\r\n onabort: function () {\r\n },\r\n removeEventListener: function () {\r\n },\r\n reason: void 0,\r\n throwIfAborted: function () {\r\n }\r\n };\r\n }\r\n class_1.prototype.abort = function () {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (!displayedWarning) {\r\n displayedWarning = true;\r\n console.info(\"This platform does not implement AbortController. \\nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.\");\r\n }\r\n }\r\n };\r\n return class_1;\r\n }());\r\n function actionCreator(arg) {\r\n return function (dispatch, getState, extra) {\r\n var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();\r\n var abortController = new AC();\r\n var abortReason;\r\n var started = false;\r\n function abort(reason) {\r\n abortReason = reason;\r\n abortController.abort();\r\n }\r\n var promise2 = function () {\r\n return __async(this, null, function () {\r\n var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 4, , 5]);\r\n conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });\r\n if (!isThenable(conditionResult)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, conditionResult];\r\n case 1:\r\n conditionResult = _c.sent();\r\n _c.label = 2;\r\n case 2:\r\n if (conditionResult === false || abortController.signal.aborted) {\r\n throw {\r\n name: \"ConditionError\",\r\n message: \"Aborted due to condition callback returning false.\"\r\n };\r\n }\r\n started = true;\r\n abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener(\"abort\", function () { return reject({\r\n name: \"AbortError\",\r\n message: abortReason || \"Aborted\"\r\n }); }); });\r\n dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));\r\n return [4 /*yield*/, Promise.race([\r\n abortedPromise,\r\n Promise.resolve(payloadCreator(arg, {\r\n dispatch: dispatch,\r\n getState: getState,\r\n extra: extra,\r\n requestId: requestId,\r\n signal: abortController.signal,\r\n abort: abort,\r\n rejectWithValue: function (value, meta) {\r\n return new RejectWithValue(value, meta);\r\n },\r\n fulfillWithValue: function (value, meta) {\r\n return new FulfillWithMeta(value, meta);\r\n }\r\n })).then(function (result) {\r\n if (result instanceof RejectWithValue) {\r\n throw result;\r\n }\r\n if (result instanceof FulfillWithMeta) {\r\n return fulfilled(result.payload, requestId, arg, result.meta);\r\n }\r\n return fulfilled(result, requestId, arg);\r\n })\r\n ])];\r\n case 3:\r\n finalAction = _c.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n err_1 = _c.sent();\r\n finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);\r\n return [3 /*break*/, 5];\r\n case 5:\r\n skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\r\n if (!skipDispatch) {\r\n dispatch(finalAction);\r\n }\r\n return [2 /*return*/, finalAction];\r\n }\r\n });\r\n });\r\n }();\r\n return Object.assign(promise2, {\r\n abort: abort,\r\n requestId: requestId,\r\n arg: arg,\r\n unwrap: function () {\r\n return promise2.then(unwrapResult);\r\n }\r\n });\r\n };\r\n }\r\n return Object.assign(actionCreator, {\r\n pending: pending,\r\n rejected: rejected,\r\n fulfilled: fulfilled,\r\n typePrefix: typePrefix\r\n });\r\n }\r\n createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };\r\n return createAsyncThunk2;\r\n})();\r\nfunction unwrapResult(action) {\r\n if (action.meta && action.meta.rejectedWithValue) {\r\n throw action.payload;\r\n }\r\n if (action.error) {\r\n throw action.error;\r\n }\r\n return action.payload;\r\n}\r\nfunction isThenable(value) {\r\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\r\n}\r\n// src/matchers.ts\r\nvar matches = function (matcher, action) {\r\n if (hasMatchFunction(matcher)) {\r\n return matcher.match(action);\r\n }\r\n else {\r\n return matcher(action);\r\n }\r\n};\r\nfunction isAnyOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.some(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction isAllOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.every(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction hasExpectedRequestMetadata(action, validStatus) {\r\n if (!action || !action.meta)\r\n return false;\r\n var hasValidRequestId = typeof action.meta.requestId === \"string\";\r\n var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\r\n return hasValidRequestId && hasValidRequestStatus;\r\n}\r\nfunction isAsyncThunkArray(a) {\r\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\r\n}\r\nfunction isPending() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isPending()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejected() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejected()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejectedWithValue() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n var hasFlag = function (action) {\r\n return action && action.meta && action.meta.rejectedWithValue;\r\n };\r\n if (asyncThunks.length === 0) {\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejectedWithValue()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isFulfilled() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"fulfilled\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isFulfilled()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isAsyncThunkAction() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isAsyncThunkAction()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = [];\r\n for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {\r\n var asyncThunk = asyncThunks_1[_i];\r\n matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);\r\n }\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\n// src/listenerMiddleware/utils.ts\r\nvar assertFunction = function (func, expected) {\r\n if (typeof func !== \"function\") {\r\n throw new TypeError(expected + \" is not a function\");\r\n }\r\n};\r\nvar noop = function () {\r\n};\r\nvar catchRejection = function (promise2, onError) {\r\n if (onError === void 0) { onError = noop; }\r\n promise2.catch(onError);\r\n return promise2;\r\n};\r\nvar addAbortSignalListener = function (abortSignal, callback) {\r\n abortSignal.addEventListener(\"abort\", callback, { once: true });\r\n return function () { return abortSignal.removeEventListener(\"abort\", callback); };\r\n};\r\nvar abortControllerWithReason = function (abortController, reason) {\r\n var signal = abortController.signal;\r\n if (signal.aborted) {\r\n return;\r\n }\r\n if (!(\"reason\" in signal)) {\r\n Object.defineProperty(signal, \"reason\", {\r\n enumerable: true,\r\n value: reason,\r\n configurable: true,\r\n writable: true\r\n });\r\n }\r\n ;\r\n abortController.abort(reason);\r\n};\r\n// src/listenerMiddleware/exceptions.ts\r\nvar task = \"task\";\r\nvar listener = \"listener\";\r\nvar completed = \"completed\";\r\nvar cancelled = \"cancelled\";\r\nvar taskCancelled = \"task-\" + cancelled;\r\nvar taskCompleted = \"task-\" + completed;\r\nvar listenerCancelled = listener + \"-\" + cancelled;\r\nvar listenerCompleted = listener + \"-\" + completed;\r\nvar TaskAbortError = /** @class */ (function () {\r\n function TaskAbortError(code) {\r\n this.code = code;\r\n this.name = \"TaskAbortError\";\r\n this.message = task + \" \" + cancelled + \" (reason: \" + code + \")\";\r\n }\r\n return TaskAbortError;\r\n}());\r\n// src/listenerMiddleware/task.ts\r\nvar validateActive = function (signal) {\r\n if (signal.aborted) {\r\n throw new TaskAbortError(signal.reason);\r\n }\r\n};\r\nfunction raceWithSignal(signal, promise2) {\r\n var cleanup = noop;\r\n return new Promise(function (resolve, reject) {\r\n var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };\r\n if (signal.aborted) {\r\n notifyRejection();\r\n return;\r\n }\r\n cleanup = addAbortSignalListener(signal, notifyRejection);\r\n promise2.finally(function () { return cleanup(); }).then(resolve, reject);\r\n }).finally(function () {\r\n cleanup = noop;\r\n });\r\n}\r\nvar runTask = function (task2, cleanUp) { return __async(void 0, null, function () {\r\n var value, error_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 3, 4, 5]);\r\n return [4 /*yield*/, Promise.resolve()];\r\n case 1:\r\n _c.sent();\r\n return [4 /*yield*/, task2()];\r\n case 2:\r\n value = _c.sent();\r\n return [2 /*return*/, {\r\n status: \"ok\",\r\n value: value\r\n }];\r\n case 3:\r\n error_1 = _c.sent();\r\n return [2 /*return*/, {\r\n status: error_1 instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\r\n error: error_1\r\n }];\r\n case 4:\r\n cleanUp == null ? void 0 : cleanUp();\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n}); };\r\nvar createPause = function (signal) {\r\n return function (promise2) {\r\n return catchRejection(raceWithSignal(signal, promise2).then(function (output) {\r\n validateActive(signal);\r\n return output;\r\n }));\r\n };\r\n};\r\nvar createDelay = function (signal) {\r\n var pause = createPause(signal);\r\n return function (timeoutMs) {\r\n return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));\r\n };\r\n};\r\n// src/listenerMiddleware/index.ts\r\nvar assign = Object.assign;\r\nvar INTERNAL_NIL_TOKEN = {};\r\nvar alm = \"listenerMiddleware\";\r\nvar createFork = function (parentAbortSignal, parentBlockingPromises) {\r\n var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };\r\n return function (taskExecutor, opts) {\r\n assertFunction(taskExecutor, \"taskExecutor\");\r\n var childAbortController = new AbortController();\r\n linkControllers(childAbortController);\r\n var result = runTask(function () { return __async(void 0, null, function () {\r\n var result2;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(parentAbortSignal);\r\n validateActive(childAbortController.signal);\r\n return [4 /*yield*/, taskExecutor({\r\n pause: createPause(childAbortController.signal),\r\n delay: createDelay(childAbortController.signal),\r\n signal: childAbortController.signal\r\n })];\r\n case 1:\r\n result2 = _c.sent();\r\n validateActive(childAbortController.signal);\r\n return [2 /*return*/, result2];\r\n }\r\n });\r\n }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });\r\n if (opts == null ? void 0 : opts.autoJoin) {\r\n parentBlockingPromises.push(result);\r\n }\r\n return {\r\n result: createPause(parentAbortSignal)(result),\r\n cancel: function () {\r\n abortControllerWithReason(childAbortController, taskCancelled);\r\n }\r\n };\r\n };\r\n};\r\nvar createTakePattern = function (startListening, signal) {\r\n var take = function (predicate, timeout) { return __async(void 0, null, function () {\r\n var unsubscribe, tuplePromise, promises, output;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(signal);\r\n unsubscribe = function () {\r\n };\r\n tuplePromise = new Promise(function (resolve, reject) {\r\n var stopListening = startListening({\r\n predicate: predicate,\r\n effect: function (action, listenerApi) {\r\n listenerApi.unsubscribe();\r\n resolve([\r\n action,\r\n listenerApi.getState(),\r\n listenerApi.getOriginalState()\r\n ]);\r\n }\r\n });\r\n unsubscribe = function () {\r\n stopListening();\r\n reject();\r\n };\r\n });\r\n promises = [\r\n tuplePromise\r\n ];\r\n if (timeout != null) {\r\n promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));\r\n }\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, , 3, 4]);\r\n return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];\r\n case 2:\r\n output = _c.sent();\r\n validateActive(signal);\r\n return [2 /*return*/, output];\r\n case 3:\r\n unsubscribe();\r\n return [7 /*endfinally*/];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };\r\n};\r\nvar getListenerEntryPropsFrom = function (options) {\r\n var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;\r\n if (type) {\r\n predicate = createAction(type).match;\r\n }\r\n else if (actionCreator) {\r\n type = actionCreator.type;\r\n predicate = actionCreator.match;\r\n }\r\n else if (matcher) {\r\n predicate = matcher;\r\n }\r\n else if (predicate) {\r\n }\r\n else {\r\n throw new Error(\"Creating or removing a listener requires one of the known fields for matching an action\");\r\n }\r\n assertFunction(effect, \"options.listener\");\r\n return { predicate: predicate, type: type, effect: effect };\r\n};\r\nvar createListenerEntry = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;\r\n var id = nanoid();\r\n var entry = {\r\n id: id,\r\n effect: effect,\r\n type: type,\r\n predicate: predicate,\r\n pending: new Set(),\r\n unsubscribe: function () {\r\n throw new Error(\"Unsubscribe not initialized\");\r\n }\r\n };\r\n return entry;\r\n};\r\nvar cancelActiveListeners = function (entry) {\r\n entry.pending.forEach(function (controller) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n });\r\n};\r\nvar createClearListenerMiddleware = function (listenerMap) {\r\n return function () {\r\n listenerMap.forEach(cancelActiveListeners);\r\n listenerMap.clear();\r\n };\r\n};\r\nvar safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {\r\n try {\r\n errorHandler(errorToNotify, errorInfo);\r\n }\r\n catch (errorHandlerError) {\r\n setTimeout(function () {\r\n throw errorHandlerError;\r\n }, 0);\r\n }\r\n};\r\nvar addListener = createAction(alm + \"/add\");\r\nvar clearAllListeners = createAction(alm + \"/removeAll\");\r\nvar removeListener = createAction(alm + \"/remove\");\r\nvar defaultErrorHandler = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n console.error.apply(console, __spreadArray([alm + \"/error\"], args));\r\n};\r\nfunction createListenerMiddleware(middlewareOptions) {\r\n var _this = this;\r\n if (middlewareOptions === void 0) { middlewareOptions = {}; }\r\n var listenerMap = new Map();\r\n var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;\r\n assertFunction(onError, \"onError\");\r\n var insertEntry = function (entry) {\r\n entry.unsubscribe = function () { return listenerMap.delete(entry.id); };\r\n listenerMap.set(entry.id, entry);\r\n return function (cancelOptions) {\r\n entry.unsubscribe();\r\n if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n };\r\n };\r\n var findListenerEntry = function (comparator) {\r\n for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {\r\n var entry = _c[_i];\r\n if (comparator(entry)) {\r\n return entry;\r\n }\r\n }\r\n return void 0;\r\n };\r\n var startListening = function (options) {\r\n var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });\r\n if (!entry) {\r\n entry = createListenerEntry(options);\r\n }\r\n return insertEntry(entry);\r\n };\r\n var stopListening = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;\r\n var entry = findListenerEntry(function (entry2) {\r\n var matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\r\n return matchPredicateOrType && entry2.effect === effect;\r\n });\r\n if (entry) {\r\n entry.unsubscribe();\r\n if (options.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n }\r\n return !!entry;\r\n };\r\n var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {\r\n var internalTaskController, take, autoJoinPromises, listenerError_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n internalTaskController = new AbortController();\r\n take = createTakePattern(startListening, internalTaskController.signal);\r\n autoJoinPromises = [];\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, 3, 4, 6]);\r\n entry.pending.add(internalTaskController);\r\n return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {\r\n getOriginalState: getOriginalState,\r\n condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },\r\n take: take,\r\n delay: createDelay(internalTaskController.signal),\r\n pause: createPause(internalTaskController.signal),\r\n extra: extra,\r\n signal: internalTaskController.signal,\r\n fork: createFork(internalTaskController.signal, autoJoinPromises),\r\n unsubscribe: entry.unsubscribe,\r\n subscribe: function () {\r\n listenerMap.set(entry.id, entry);\r\n },\r\n cancelActiveListeners: function () {\r\n entry.pending.forEach(function (controller, _, set) {\r\n if (controller !== internalTaskController) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n set.delete(controller);\r\n }\r\n });\r\n }\r\n })))];\r\n case 2:\r\n _c.sent();\r\n return [3 /*break*/, 6];\r\n case 3:\r\n listenerError_1 = _c.sent();\r\n if (!(listenerError_1 instanceof TaskAbortError)) {\r\n safelyNotifyError(onError, listenerError_1, {\r\n raisedBy: \"effect\"\r\n });\r\n }\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)];\r\n case 5:\r\n _c.sent();\r\n abortControllerWithReason(internalTaskController, listenerCompleted);\r\n entry.pending.delete(internalTaskController);\r\n return [7 /*endfinally*/];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\r\n var middleware = function (api) { return function (next) { return function (action) {\r\n if (!isAction(action)) {\r\n return next(action);\r\n }\r\n if (addListener.match(action)) {\r\n return startListening(action.payload);\r\n }\r\n if (clearAllListeners.match(action)) {\r\n clearListenerMiddleware();\r\n return;\r\n }\r\n if (removeListener.match(action)) {\r\n return stopListening(action.payload);\r\n }\r\n var originalState = api.getState();\r\n var getOriginalState = function () {\r\n if (originalState === INTERNAL_NIL_TOKEN) {\r\n throw new Error(alm + \": getOriginalState can only be called synchronously\");\r\n }\r\n return originalState;\r\n };\r\n var result;\r\n try {\r\n result = next(action);\r\n if (listenerMap.size > 0) {\r\n var currentState = api.getState();\r\n var listenerEntries = Array.from(listenerMap.values());\r\n for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {\r\n var entry = listenerEntries_1[_i];\r\n var runListener = false;\r\n try {\r\n runListener = entry.predicate(action, currentState, originalState);\r\n }\r\n catch (predicateError) {\r\n runListener = false;\r\n safelyNotifyError(onError, predicateError, {\r\n raisedBy: \"predicate\"\r\n });\r\n }\r\n if (!runListener) {\r\n continue;\r\n }\r\n notifyListener(entry, action, api, getOriginalState);\r\n }\r\n }\r\n }\r\n finally {\r\n originalState = INTERNAL_NIL_TOKEN;\r\n }\r\n return result;\r\n }; }; };\r\n return {\r\n middleware: middleware,\r\n startListening: startListening,\r\n stopListening: stopListening,\r\n clearListeners: clearListenerMiddleware\r\n };\r\n}\r\n// src/autoBatchEnhancer.ts\r\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\r\nvar prepareAutoBatched = function () { return function (payload) {\r\n var _c;\r\n return ({\r\n payload: payload,\r\n meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)\r\n });\r\n}; };\r\nvar promise;\r\nvar queueMicrotaskShim = typeof queueMicrotask === \"function\" ? queueMicrotask.bind(typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {\r\n throw err;\r\n}, 0); }); };\r\nvar createQueueWithTimer = function (timeout) {\r\n return function (notify) {\r\n setTimeout(notify, timeout);\r\n };\r\n};\r\nvar rAF = typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);\r\nvar autoBatchEnhancer = function (options) {\r\n if (options === void 0) { options = { type: \"raf\" }; }\r\n return function (next) { return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var store = next.apply(void 0, args);\r\n var notifying = true;\r\n var shouldNotifyAtEndOfTick = false;\r\n var notificationQueued = false;\r\n var listeners = new Set();\r\n var queueCallback = options.type === \"tick\" ? queueMicrotaskShim : options.type === \"raf\" ? rAF : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\r\n var notifyListeners = function () {\r\n notificationQueued = false;\r\n if (shouldNotifyAtEndOfTick) {\r\n shouldNotifyAtEndOfTick = false;\r\n listeners.forEach(function (l) { return l(); });\r\n }\r\n };\r\n return Object.assign({}, store, {\r\n subscribe: function (listener2) {\r\n var wrappedListener = function () { return notifying && listener2(); };\r\n var unsubscribe = store.subscribe(wrappedListener);\r\n listeners.add(listener2);\r\n return function () {\r\n unsubscribe();\r\n listeners.delete(listener2);\r\n };\r\n },\r\n dispatch: function (action) {\r\n var _a;\r\n try {\r\n notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);\r\n shouldNotifyAtEndOfTick = !notifying;\r\n if (shouldNotifyAtEndOfTick) {\r\n if (!notificationQueued) {\r\n notificationQueued = true;\r\n queueCallback(notifyListeners);\r\n }\r\n }\r\n return store.dispatch(action);\r\n }\r\n finally {\r\n notifying = true;\r\n }\r\n }\r\n });\r\n }; };\r\n};\r\n// src/index.ts\r\nenableES5();\r\nexport { EnhancerArray, MiddlewareArray, SHOULD_AUTOBATCH, TaskAbortError, addListener, autoBatchEnhancer, clearAllListeners, configureStore, createAction, createActionCreatorInvariantMiddleware, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAction, isActionCreator, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFSA as isFluxStandardAction, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, prepareAutoBatched, removeListener, unwrapResult };\r\n//# sourceMappingURL=redux-toolkit.esm.js.map","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayAggregator;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach');\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseAggregator;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var arrayAggregator = require('./_arrayAggregator'),\n baseAggregator = require('./_baseAggregator'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nmodule.exports = createAggregator;\n","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\nvar keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n});\n\nmodule.exports = keyBy;\n","export const ATTRIBUTE_FIELD_FOR_ESTIMATES = 'Value';\nexport const ATTRIBUTE_FIELD_FOR_POPULATION = 'Population_at_risk';\nexport const ATTRIBUTE_FILED_FOR_UNCERTAINTY = 'Uncertainty_Interval';\nexport const RASTER_FIELD_FOR_ESTIMATES = '';\nexport const RASTER_FIELD_FOR_POPULATION = 'POP';\nexport const RASTER_FILED_FOR_UNCERTAINTY = 'UNCERT';\n\n// Old fields\nexport let ATTRIBUTE_FIELD_ADMIN_0_NAME = 'ADM0';\nexport let ATTRIBUTE_FIELD_ADMIN_1_NAME = 'ADM1_NAME';\nexport let ATTRIBUTE_FIELD_ADMIN_2_NAME = 'ADM2_NAME';\nexport let ATTRIBUTE_FIELD_COUNTRY_CODE = 'DHSCC';\nexport let ATTRIBUTE_FIELD_SURVEY_TYPE = 'SurveyType';\n\n// New fields\nATTRIBUTE_FIELD_ADMIN_0_NAME = 'adm0_name';\nATTRIBUTE_FIELD_ADMIN_1_NAME = 'adm1_name';\nATTRIBUTE_FIELD_ADMIN_2_NAME = 'adm2_name';\nATTRIBUTE_FIELD_COUNTRY_CODE = 'DHS_CountryCode';\n","import _keyBy from 'lodash/keyBy';\n\n// url to the layer of interest to query\nimport {\n ATTRIBUTE_FIELD_FOR_ESTIMATES,\n ATTRIBUTE_FIELD_FOR_POPULATION,\n ATTRIBUTE_FILED_FOR_UNCERTAINTY,\n RASTER_FIELD_FOR_ESTIMATES,\n RASTER_FIELD_FOR_POPULATION,\n RASTER_FILED_FOR_UNCERTAINTY,\n} from './attributeFields.configs';\nimport { SidebarMapFilterFieldsType, SidebarMapFiltersType } from './types';\n\nexport const ADMIN_1_VECTOR_BOUNDARIES =\n 'https://gis.dhsprogram.com/arcgis/rest/services/Geometry/SDR_Regions/MapServer/0';\nexport const ADMIN_2_VECTOR_BOUNDARIES =\n 'https://gis.dhsprogram.com/arcgis/rest/services/Development/Admin2Testing_boundaries/MapServer/0';\nexport const SURVEY_RASTER_SERVICE = 'https://gis.dhsprogram.com/arcgis/rest/services/Admin2SDR';\n\nexport const SERVICES__GEOMETRY__BASEMAP_REGIONS_TEST__MAP_SERVER__URL =\n 'https://gis.dhsprogram.com/arcgis/rest/services/Geometry/Basemap_regions_TEST/MapServer/6';\n\nexport const GO_TO_OPTIONS = {\n animate: true,\n duration: 1000,\n};\n\nexport const NO_VALUE = -1;\nexport const NO_VALUE_LABEL = 'No Data';\nexport const NO_VALUE_COLOR = '#ccc';\nexport const ADMIN_1_BOUNDARY_OUTLINE_COLOR = '#1c1c1c';\nexport const ADMIN_1_BOUNDARY_OUTLINE_WIDTH = 2;\nexport const ADMIN_2_BOUNDARY_OUTLINE_COLOR = ADMIN_1_BOUNDARY_OUTLINE_COLOR;\nexport const ADMIN_2_BOUNDARY_OUTLINE_WIDTH = ADMIN_1_BOUNDARY_OUTLINE_WIDTH;\nexport const ADMIN_2_OUTLINE_COLOR = '#6b6b6b';\nexport const ADMIN_2_REFERENCE_OUTLINE_COLOR = ADMIN_1_BOUNDARY_OUTLINE_COLOR;\nexport const HIGHLIGHT_COLOR = 'rgba(30,255,255,1)';\nexport const HIGHLIGHT_COLOR_OPACITY = 'rgba(30,255,255,0.15)';\n\nexport const ADMIN_1_BOUNDARY_SYMBOL = {\n type: 'simple-line',\n color: ADMIN_1_BOUNDARY_OUTLINE_COLOR,\n width: ADMIN_1_BOUNDARY_OUTLINE_WIDTH,\n};\n\nexport const ADMIN_2_BOUNDARY_SYMBOL = {\n type: 'simple-line',\n color: ADMIN_2_BOUNDARY_OUTLINE_COLOR,\n width: ADMIN_2_BOUNDARY_OUTLINE_WIDTH,\n};\n\nexport const ADMIN__Admin1 = 'Admin1';\nexport const ADMIN__Admin2 = 'Admin2';\nexport const ADMIN__5X5km = '5x5km';\nexport const RASTER_LAYER_VALUE_KEY = 'Classify.Pixel Value';\nexport const DHSREGEN = 'DHSREGEN';\nexport const ADMIN1_REGION_ID_FIELD = 'REG_ID';\nexport const ADMIN_2_INDICATOR = 'IndicatorID';\nexport const ADMIN_2_SURVEY_TYPE = 'SurveyType';\nexport const ADMIN_2_YEAR = 'year';\n\nexport const SIDEBAR_MAP_ADMIN_FILTERS: SidebarMapFiltersType[] = [\n {\n label: 'Admin 1',\n value: ADMIN__Admin1,\n tooltip: 'Largest subnational boundaries within a country. Direct estimates at this level.',\n },\n {\n label: 'Admin 2',\n value: ADMIN__Admin2,\n tooltip: 'Second largest subnational boundaries within a country. Modeled estimates at this level.',\n },\n {\n label: '5 x 5 km',\n value: ADMIN__5X5km,\n tooltip: '5 x 5 km pixels from a uniform grid within a country. Modeled estimates at this level.',\n },\n];\n\nexport const FILTER_FIELDS_ESTIMATES: string = 'Estimates';\nexport const FILTER_FIELDS_POPULATION: string = 'Population';\nexport const FILTER_FIELDS_UNCERTAINTY: string = 'Uncertainty';\nexport const SIDEBAR_MAP_FILTER_FIELDS: SidebarMapFilterFieldsType[] = [\n {\n label: FILTER_FIELDS_ESTIMATES,\n value: ATTRIBUTE_FIELD_FOR_ESTIMATES,\n raster_type: RASTER_FIELD_FOR_ESTIMATES,\n raster_type_multiplier: 100,\n tooltip: 'Estimates (percentage or rate) for the selected indicator.',\n format: (value) => (value ? `${value.toFixed(DATA_VALUE_PRECISION)}%` : NO_VALUE_LABEL),\n },\n {\n label: FILTER_FIELDS_POPULATION,\n value: ATTRIBUTE_FIELD_FOR_POPULATION,\n raster_type: RASTER_FIELD_FOR_POPULATION,\n raster_type_multiplier: 1,\n tooltip: 'Population count affected for each percentage indicator.',\n format: (value) => (value ? `${value.toLocaleString()}` : NO_VALUE_LABEL),\n },\n {\n label: FILTER_FIELDS_UNCERTAINTY,\n value: ATTRIBUTE_FILED_FOR_UNCERTAINTY,\n raster_type: RASTER_FILED_FOR_UNCERTAINTY,\n raster_type_multiplier: 100,\n tooltip: 'Width of the 95% uncertainty interval (upper bound – lower bound).',\n format: (value) => (value ? `${value.toFixed(DATA_VALUE_PRECISION)}%` : NO_VALUE_LABEL),\n },\n];\n\nexport const SIDEBAR_MAP_FILTER_FIELDS_OBJECT = _keyBy(SIDEBAR_MAP_FILTER_FIELDS, 'value');\n\nexport const RASTER_URL_CONFIG: any = {\n [ATTRIBUTE_FIELD_FOR_ESTIMATES]: RASTER_FIELD_FOR_ESTIMATES,\n [ATTRIBUTE_FIELD_FOR_POPULATION]: RASTER_FIELD_FOR_POPULATION,\n [ATTRIBUTE_FILED_FOR_UNCERTAINTY]: RASTER_FILED_FOR_UNCERTAINTY,\n};\n\nexport const ADMIN1_BOUNDARIES_LAYER_ID = 'Admin1_boundaries_layer';\nexport const ADMIN2_BOUNDARIES_LAYER_ID = 'Admin2_boundaries_layer';\nexport const ADMIN_2_REF_FEATURE_LAYER_ID = 'admin2ReferenceFeatureLayer';\n\nexport const DATA_VALUE_PRECISION = 1;\n","/**\n * chroma.js - JavaScript library for color conversions\n *\n * Copyright (c) 2011-2019, Gregor Aisch\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. The name Gregor Aisch may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * -------------------------------------------------------\n *\n * chroma.js includes colors from colorbrewer2.org, which are released under\n * the following license:\n *\n * Copyright (c) 2002 Cynthia Brewer, Mark Harrower,\n * and The Pennsylvania State University.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n * either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n *\n * ------------------------------------------------------\n *\n * Named colors are taken from X11 Color Names.\n * http://www.w3.org/TR/css3-color/#svg-color\n *\n * @preserve\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.chroma = factory());\n})(this, (function () { 'use strict';\n\n var limit$2 = function (x, min, max) {\n if ( min === void 0 ) min=0;\n if ( max === void 0 ) max=1;\n\n return x < min ? min : x > max ? max : x;\n };\n\n var limit$1 = limit$2;\n\n var clip_rgb$3 = function (rgb) {\n rgb._clipped = false;\n rgb._unclipped = rgb.slice(0);\n for (var i=0; i<=3; i++) {\n if (i < 3) {\n if (rgb[i] < 0 || rgb[i] > 255) { rgb._clipped = true; }\n rgb[i] = limit$1(rgb[i], 0, 255);\n } else if (i === 3) {\n rgb[i] = limit$1(rgb[i], 0, 1);\n }\n }\n return rgb;\n };\n\n // ported from jQuery's $.type\n var classToType = {};\n for (var i$1 = 0, list$1 = ['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Undefined', 'Null']; i$1 < list$1.length; i$1 += 1) {\n var name = list$1[i$1];\n\n classToType[(\"[object \" + name + \"]\")] = name.toLowerCase();\n }\n var type$p = function(obj) {\n return classToType[Object.prototype.toString.call(obj)] || \"object\";\n };\n\n var type$o = type$p;\n\n var unpack$B = function (args, keyOrder) {\n if ( keyOrder === void 0 ) keyOrder=null;\n\n \t// if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) { return Array.prototype.slice.call(args); }\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n \tif (type$o(args[0]) == 'object' && keyOrder) {\n \t\treturn keyOrder.split('')\n \t\t\t.filter(function (k) { return args[0][k] !== undefined; })\n \t\t\t.map(function (k) { return args[0][k]; });\n \t}\n \t// otherwise we just return the first argument\n \t// (which we suppose is an array of args)\n return args[0];\n };\n\n var type$n = type$p;\n\n var last$4 = function (args) {\n if (args.length < 2) { return null; }\n var l = args.length-1;\n if (type$n(args[l]) == 'string') { return args[l].toLowerCase(); }\n return null;\n };\n\n var PI$2 = Math.PI;\n\n var utils = {\n \tclip_rgb: clip_rgb$3,\n \tlimit: limit$2,\n \ttype: type$p,\n \tunpack: unpack$B,\n \tlast: last$4,\n \tPI: PI$2,\n \tTWOPI: PI$2*2,\n \tPITHIRD: PI$2/3,\n \tDEG2RAD: PI$2 / 180,\n \tRAD2DEG: 180 / PI$2\n };\n\n var input$h = {\n \tformat: {},\n \tautodetect: []\n };\n\n var last$3 = utils.last;\n var clip_rgb$2 = utils.clip_rgb;\n var type$m = utils.type;\n var _input = input$h;\n\n var Color$D = function Color() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var me = this;\n if (type$m(args[0]) === 'object' &&\n args[0].constructor &&\n args[0].constructor === this.constructor) {\n // the argument is already a Color instance\n return args[0];\n }\n\n // last argument could be the mode\n var mode = last$3(args);\n var autodetect = false;\n\n if (!mode) {\n autodetect = true;\n if (!_input.sorted) {\n _input.autodetect = _input.autodetect.sort(function (a,b) { return b.p - a.p; });\n _input.sorted = true;\n }\n // auto-detect format\n for (var i = 0, list = _input.autodetect; i < list.length; i += 1) {\n var chk = list[i];\n\n mode = chk.test.apply(chk, args);\n if (mode) { break; }\n }\n }\n\n if (_input.format[mode]) {\n var rgb = _input.format[mode].apply(null, autodetect ? args : args.slice(0,-1));\n me._rgb = clip_rgb$2(rgb);\n } else {\n throw new Error('unknown format: '+args);\n }\n\n // add alpha channel\n if (me._rgb.length === 3) { me._rgb.push(1); }\n };\n\n Color$D.prototype.toString = function toString () {\n if (type$m(this.hex) == 'function') { return this.hex(); }\n return (\"[\" + (this._rgb.join(',')) + \"]\");\n };\n\n var Color_1 = Color$D;\n\n var chroma$k = function () {\n \tvar args = [], len = arguments.length;\n \twhile ( len-- ) args[ len ] = arguments[ len ];\n\n \treturn new (Function.prototype.bind.apply( chroma$k.Color, [ null ].concat( args) ));\n };\n\n chroma$k.Color = Color_1;\n chroma$k.version = '2.4.2';\n\n var chroma_1 = chroma$k;\n\n var unpack$A = utils.unpack;\n var max$2 = Math.max;\n\n var rgb2cmyk$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$A(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n r = r / 255;\n g = g / 255;\n b = b / 255;\n var k = 1 - max$2(r,max$2(g,b));\n var f = k < 1 ? 1 / (1-k) : 0;\n var c = (1-r-k) * f;\n var m = (1-g-k) * f;\n var y = (1-b-k) * f;\n return [c,m,y,k];\n };\n\n var rgb2cmyk_1 = rgb2cmyk$1;\n\n var unpack$z = utils.unpack;\n\n var cmyk2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$z(args, 'cmyk');\n var c = args[0];\n var m = args[1];\n var y = args[2];\n var k = args[3];\n var alpha = args.length > 4 ? args[4] : 1;\n if (k === 1) { return [0,0,0,alpha]; }\n return [\n c >= 1 ? 0 : 255 * (1-c) * (1-k), // r\n m >= 1 ? 0 : 255 * (1-m) * (1-k), // g\n y >= 1 ? 0 : 255 * (1-y) * (1-k), // b\n alpha\n ];\n };\n\n var cmyk2rgb_1 = cmyk2rgb;\n\n var chroma$j = chroma_1;\n var Color$C = Color_1;\n var input$g = input$h;\n var unpack$y = utils.unpack;\n var type$l = utils.type;\n\n var rgb2cmyk = rgb2cmyk_1;\n\n Color$C.prototype.cmyk = function() {\n return rgb2cmyk(this._rgb);\n };\n\n chroma$j.cmyk = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$C, [ null ].concat( args, ['cmyk']) ));\n };\n\n input$g.format.cmyk = cmyk2rgb_1;\n\n input$g.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$y(args, 'cmyk');\n if (type$l(args) === 'array' && args.length === 4) {\n return 'cmyk';\n }\n }\n });\n\n var unpack$x = utils.unpack;\n var last$2 = utils.last;\n var rnd = function (a) { return Math.round(a*100)/100; };\n\n /*\n * supported arguments:\n * - hsl2css(h,s,l)\n * - hsl2css(h,s,l,a)\n * - hsl2css([h,s,l], mode)\n * - hsl2css([h,s,l,a], mode)\n * - hsl2css({h,s,l,a}, mode)\n */\n var hsl2css$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var hsla = unpack$x(args, 'hsla');\n var mode = last$2(args) || 'lsa';\n hsla[0] = rnd(hsla[0] || 0);\n hsla[1] = rnd(hsla[1]*100) + '%';\n hsla[2] = rnd(hsla[2]*100) + '%';\n if (mode === 'hsla' || (hsla.length > 3 && hsla[3]<1)) {\n hsla[3] = hsla.length > 3 ? hsla[3] : 1;\n mode = 'hsla';\n } else {\n hsla.length = 3;\n }\n return (mode + \"(\" + (hsla.join(',')) + \")\");\n };\n\n var hsl2css_1 = hsl2css$1;\n\n var unpack$w = utils.unpack;\n\n /*\n * supported arguments:\n * - rgb2hsl(r,g,b)\n * - rgb2hsl(r,g,b,a)\n * - rgb2hsl([r,g,b])\n * - rgb2hsl([r,g,b,a])\n * - rgb2hsl({r,g,b,a})\n */\n var rgb2hsl$3 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$w(args, 'rgba');\n var r = args[0];\n var g = args[1];\n var b = args[2];\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n\n var l = (max + min) / 2;\n var s, h;\n\n if (max === min){\n s = 0;\n h = Number.NaN;\n } else {\n s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);\n }\n\n if (r == max) { h = (g - b) / (max - min); }\n else if (g == max) { h = 2 + (b - r) / (max - min); }\n else if (b == max) { h = 4 + (r - g) / (max - min); }\n\n h *= 60;\n if (h < 0) { h += 360; }\n if (args.length>3 && args[3]!==undefined) { return [h,s,l,args[3]]; }\n return [h,s,l];\n };\n\n var rgb2hsl_1 = rgb2hsl$3;\n\n var unpack$v = utils.unpack;\n var last$1 = utils.last;\n var hsl2css = hsl2css_1;\n var rgb2hsl$2 = rgb2hsl_1;\n var round$6 = Math.round;\n\n /*\n * supported arguments:\n * - rgb2css(r,g,b)\n * - rgb2css(r,g,b,a)\n * - rgb2css([r,g,b], mode)\n * - rgb2css([r,g,b,a], mode)\n * - rgb2css({r,g,b,a}, mode)\n */\n var rgb2css$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgba = unpack$v(args, 'rgba');\n var mode = last$1(args) || 'rgb';\n if (mode.substr(0,3) == 'hsl') {\n return hsl2css(rgb2hsl$2(rgba), mode);\n }\n rgba[0] = round$6(rgba[0]);\n rgba[1] = round$6(rgba[1]);\n rgba[2] = round$6(rgba[2]);\n if (mode === 'rgba' || (rgba.length > 3 && rgba[3]<1)) {\n rgba[3] = rgba.length > 3 ? rgba[3] : 1;\n mode = 'rgba';\n }\n return (mode + \"(\" + (rgba.slice(0,mode==='rgb'?3:4).join(',')) + \")\");\n };\n\n var rgb2css_1 = rgb2css$1;\n\n var unpack$u = utils.unpack;\n var round$5 = Math.round;\n\n var hsl2rgb$1 = function () {\n var assign;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$u(args, 'hsl');\n var h = args[0];\n var s = args[1];\n var l = args[2];\n var r,g,b;\n if (s === 0) {\n r = g = b = l*255;\n } else {\n var t3 = [0,0,0];\n var c = [0,0,0];\n var t2 = l < 0.5 ? l * (1+s) : l+s-l*s;\n var t1 = 2 * l - t2;\n var h_ = h / 360;\n t3[0] = h_ + 1/3;\n t3[1] = h_;\n t3[2] = h_ - 1/3;\n for (var i=0; i<3; i++) {\n if (t3[i] < 0) { t3[i] += 1; }\n if (t3[i] > 1) { t3[i] -= 1; }\n if (6 * t3[i] < 1)\n { c[i] = t1 + (t2 - t1) * 6 * t3[i]; }\n else if (2 * t3[i] < 1)\n { c[i] = t2; }\n else if (3 * t3[i] < 2)\n { c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6; }\n else\n { c[i] = t1; }\n }\n (assign = [round$5(c[0]*255),round$5(c[1]*255),round$5(c[2]*255)], r = assign[0], g = assign[1], b = assign[2]);\n }\n if (args.length > 3) {\n // keep alpha channel\n return [r,g,b,args[3]];\n }\n return [r,g,b,1];\n };\n\n var hsl2rgb_1 = hsl2rgb$1;\n\n var hsl2rgb = hsl2rgb_1;\n var input$f = input$h;\n\n var RE_RGB = /^rgb\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*\\)$/;\n var RE_RGBA = /^rgba\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n var RE_RGB_PCT = /^rgb\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\n var RE_RGBA_PCT = /^rgba\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n var RE_HSL = /^hsl\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\n var RE_HSLA = /^hsla\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n\n var round$4 = Math.round;\n\n var css2rgb$1 = function (css) {\n css = css.toLowerCase().trim();\n var m;\n\n if (input$f.format.named) {\n try {\n return input$f.format.named(css);\n } catch (e) {\n // eslint-disable-next-line\n }\n }\n\n // rgb(250,20,0)\n if ((m = css.match(RE_RGB))) {\n var rgb = m.slice(1,4);\n for (var i=0; i<3; i++) {\n rgb[i] = +rgb[i];\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(250,20,0,0.4)\n if ((m = css.match(RE_RGBA))) {\n var rgb$1 = m.slice(1,5);\n for (var i$1=0; i$1<4; i$1++) {\n rgb$1[i$1] = +rgb$1[i$1];\n }\n return rgb$1;\n }\n\n // rgb(100%,0%,0%)\n if ((m = css.match(RE_RGB_PCT))) {\n var rgb$2 = m.slice(1,4);\n for (var i$2=0; i$2<3; i$2++) {\n rgb$2[i$2] = round$4(rgb$2[i$2] * 2.55);\n }\n rgb$2[3] = 1; // default alpha\n return rgb$2;\n }\n\n // rgba(100%,0%,0%,0.4)\n if ((m = css.match(RE_RGBA_PCT))) {\n var rgb$3 = m.slice(1,5);\n for (var i$3=0; i$3<3; i$3++) {\n rgb$3[i$3] = round$4(rgb$3[i$3] * 2.55);\n }\n rgb$3[3] = +rgb$3[3];\n return rgb$3;\n }\n\n // hsl(0,100%,50%)\n if ((m = css.match(RE_HSL))) {\n var hsl = m.slice(1,4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n var rgb$4 = hsl2rgb(hsl);\n rgb$4[3] = 1;\n return rgb$4;\n }\n\n // hsla(0,100%,50%,0.5)\n if ((m = css.match(RE_HSLA))) {\n var hsl$1 = m.slice(1,4);\n hsl$1[1] *= 0.01;\n hsl$1[2] *= 0.01;\n var rgb$5 = hsl2rgb(hsl$1);\n rgb$5[3] = +m[4]; // default alpha = 1\n return rgb$5;\n }\n };\n\n css2rgb$1.test = function (s) {\n return RE_RGB.test(s) ||\n RE_RGBA.test(s) ||\n RE_RGB_PCT.test(s) ||\n RE_RGBA_PCT.test(s) ||\n RE_HSL.test(s) ||\n RE_HSLA.test(s);\n };\n\n var css2rgb_1 = css2rgb$1;\n\n var chroma$i = chroma_1;\n var Color$B = Color_1;\n var input$e = input$h;\n var type$k = utils.type;\n\n var rgb2css = rgb2css_1;\n var css2rgb = css2rgb_1;\n\n Color$B.prototype.css = function(mode) {\n return rgb2css(this._rgb, mode);\n };\n\n chroma$i.css = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$B, [ null ].concat( args, ['css']) ));\n };\n\n input$e.format.css = css2rgb;\n\n input$e.autodetect.push({\n p: 5,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$k(h) === 'string' && css2rgb.test(h)) {\n return 'css';\n }\n }\n });\n\n var Color$A = Color_1;\n var chroma$h = chroma_1;\n var input$d = input$h;\n var unpack$t = utils.unpack;\n\n input$d.format.gl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgb = unpack$t(args, 'rgba');\n rgb[0] *= 255;\n rgb[1] *= 255;\n rgb[2] *= 255;\n return rgb;\n };\n\n chroma$h.gl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$A, [ null ].concat( args, ['gl']) ));\n };\n\n Color$A.prototype.gl = function() {\n var rgb = this._rgb;\n return [rgb[0]/255, rgb[1]/255, rgb[2]/255, rgb[3]];\n };\n\n var unpack$s = utils.unpack;\n\n var rgb2hcg$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$s(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var delta = max - min;\n var c = delta * 100 / 255;\n var _g = min / (255 - delta) * 100;\n var h;\n if (delta === 0) {\n h = Number.NaN;\n } else {\n if (r === max) { h = (g - b) / delta; }\n if (g === max) { h = 2+(b - r) / delta; }\n if (b === max) { h = 4+(r - g) / delta; }\n h *= 60;\n if (h < 0) { h += 360; }\n }\n return [h, c, _g];\n };\n\n var rgb2hcg_1 = rgb2hcg$1;\n\n var unpack$r = utils.unpack;\n var floor$3 = Math.floor;\n\n /*\n * this is basically just HSV with some minor tweaks\n *\n * hue.. [0..360]\n * chroma .. [0..1]\n * grayness .. [0..1]\n */\n\n var hcg2rgb = function () {\n var assign, assign$1, assign$2, assign$3, assign$4, assign$5;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$r(args, 'hcg');\n var h = args[0];\n var c = args[1];\n var _g = args[2];\n var r,g,b;\n _g = _g * 255;\n var _c = c * 255;\n if (c === 0) {\n r = g = b = _g;\n } else {\n if (h === 360) { h = 0; }\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 60;\n var i = floor$3(h);\n var f = h - i;\n var p = _g * (1 - c);\n var q = p + _c * (1 - f);\n var t = p + _c * f;\n var v = p + _c;\n switch (i) {\n case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break\n case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break\n case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break\n case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break\n case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break\n case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var hcg2rgb_1 = hcg2rgb;\n\n var unpack$q = utils.unpack;\n var type$j = utils.type;\n var chroma$g = chroma_1;\n var Color$z = Color_1;\n var input$c = input$h;\n\n var rgb2hcg = rgb2hcg_1;\n\n Color$z.prototype.hcg = function() {\n return rgb2hcg(this._rgb);\n };\n\n chroma$g.hcg = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$z, [ null ].concat( args, ['hcg']) ));\n };\n\n input$c.format.hcg = hcg2rgb_1;\n\n input$c.autodetect.push({\n p: 1,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$q(args, 'hcg');\n if (type$j(args) === 'array' && args.length === 3) {\n return 'hcg';\n }\n }\n });\n\n var unpack$p = utils.unpack;\n var last = utils.last;\n var round$3 = Math.round;\n\n var rgb2hex$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$p(args, 'rgba');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var a = ref[3];\n var mode = last(args) || 'auto';\n if (a === undefined) { a = 1; }\n if (mode === 'auto') {\n mode = a < 1 ? 'rgba' : 'rgb';\n }\n r = round$3(r);\n g = round$3(g);\n b = round$3(b);\n var u = r << 16 | g << 8 | b;\n var str = \"000000\" + u.toString(16); //#.toUpperCase();\n str = str.substr(str.length - 6);\n var hxa = '0' + round$3(a * 255).toString(16);\n hxa = hxa.substr(hxa.length - 2);\n switch (mode.toLowerCase()) {\n case 'rgba': return (\"#\" + str + hxa);\n case 'argb': return (\"#\" + hxa + str);\n default: return (\"#\" + str);\n }\n };\n\n var rgb2hex_1 = rgb2hex$2;\n\n var RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\n var RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;\n\n var hex2rgb$1 = function (hex) {\n if (hex.match(RE_HEX)) {\n // remove optional leading #\n if (hex.length === 4 || hex.length === 7) {\n hex = hex.substr(1);\n }\n // expand short-notation to full six-digit\n if (hex.length === 3) {\n hex = hex.split('');\n hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];\n }\n var u = parseInt(hex, 16);\n var r = u >> 16;\n var g = u >> 8 & 0xFF;\n var b = u & 0xFF;\n return [r,g,b,1];\n }\n\n // match rgba hex format, eg #FF000077\n if (hex.match(RE_HEXA)) {\n if (hex.length === 5 || hex.length === 9) {\n // remove optional leading #\n hex = hex.substr(1);\n }\n // expand short-notation to full eight-digit\n if (hex.length === 4) {\n hex = hex.split('');\n hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2]+hex[3]+hex[3];\n }\n var u$1 = parseInt(hex, 16);\n var r$1 = u$1 >> 24 & 0xFF;\n var g$1 = u$1 >> 16 & 0xFF;\n var b$1 = u$1 >> 8 & 0xFF;\n var a = Math.round((u$1 & 0xFF) / 0xFF * 100) / 100;\n return [r$1,g$1,b$1,a];\n }\n\n // we used to check for css colors here\n // if _input.css? and rgb = _input.css hex\n // return rgb\n\n throw new Error((\"unknown hex color: \" + hex));\n };\n\n var hex2rgb_1 = hex2rgb$1;\n\n var chroma$f = chroma_1;\n var Color$y = Color_1;\n var type$i = utils.type;\n var input$b = input$h;\n\n var rgb2hex$1 = rgb2hex_1;\n\n Color$y.prototype.hex = function(mode) {\n return rgb2hex$1(this._rgb, mode);\n };\n\n chroma$f.hex = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$y, [ null ].concat( args, ['hex']) ));\n };\n\n input$b.format.hex = hex2rgb_1;\n input$b.autodetect.push({\n p: 4,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$i(h) === 'string' && [3,4,5,6,7,8,9].indexOf(h.length) >= 0) {\n return 'hex';\n }\n }\n });\n\n var unpack$o = utils.unpack;\n var TWOPI$2 = utils.TWOPI;\n var min$2 = Math.min;\n var sqrt$4 = Math.sqrt;\n var acos = Math.acos;\n\n var rgb2hsi$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp\n */\n var ref = unpack$o(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n r /= 255;\n g /= 255;\n b /= 255;\n var h;\n var min_ = min$2(r,g,b);\n var i = (r+g+b) / 3;\n var s = i > 0 ? 1 - min_/i : 0;\n if (s === 0) {\n h = NaN;\n } else {\n h = ((r-g)+(r-b)) / 2;\n h /= sqrt$4((r-g)*(r-g) + (r-b)*(g-b));\n h = acos(h);\n if (b > g) {\n h = TWOPI$2 - h;\n }\n h /= TWOPI$2;\n }\n return [h*360,s,i];\n };\n\n var rgb2hsi_1 = rgb2hsi$1;\n\n var unpack$n = utils.unpack;\n var limit = utils.limit;\n var TWOPI$1 = utils.TWOPI;\n var PITHIRD = utils.PITHIRD;\n var cos$4 = Math.cos;\n\n /*\n * hue [0..360]\n * saturation [0..1]\n * intensity [0..1]\n */\n var hsi2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp\n */\n args = unpack$n(args, 'hsi');\n var h = args[0];\n var s = args[1];\n var i = args[2];\n var r,g,b;\n\n if (isNaN(h)) { h = 0; }\n if (isNaN(s)) { s = 0; }\n // normalize hue\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 360;\n if (h < 1/3) {\n b = (1-s)/3;\n r = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n g = 1 - (b+r);\n } else if (h < 2/3) {\n h -= 1/3;\n r = (1-s)/3;\n g = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n b = 1 - (r+g);\n } else {\n h -= 2/3;\n g = (1-s)/3;\n b = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n r = 1 - (g+b);\n }\n r = limit(i*r*3);\n g = limit(i*g*3);\n b = limit(i*b*3);\n return [r*255, g*255, b*255, args.length > 3 ? args[3] : 1];\n };\n\n var hsi2rgb_1 = hsi2rgb;\n\n var unpack$m = utils.unpack;\n var type$h = utils.type;\n var chroma$e = chroma_1;\n var Color$x = Color_1;\n var input$a = input$h;\n\n var rgb2hsi = rgb2hsi_1;\n\n Color$x.prototype.hsi = function() {\n return rgb2hsi(this._rgb);\n };\n\n chroma$e.hsi = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$x, [ null ].concat( args, ['hsi']) ));\n };\n\n input$a.format.hsi = hsi2rgb_1;\n\n input$a.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$m(args, 'hsi');\n if (type$h(args) === 'array' && args.length === 3) {\n return 'hsi';\n }\n }\n });\n\n var unpack$l = utils.unpack;\n var type$g = utils.type;\n var chroma$d = chroma_1;\n var Color$w = Color_1;\n var input$9 = input$h;\n\n var rgb2hsl$1 = rgb2hsl_1;\n\n Color$w.prototype.hsl = function() {\n return rgb2hsl$1(this._rgb);\n };\n\n chroma$d.hsl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$w, [ null ].concat( args, ['hsl']) ));\n };\n\n input$9.format.hsl = hsl2rgb_1;\n\n input$9.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$l(args, 'hsl');\n if (type$g(args) === 'array' && args.length === 3) {\n return 'hsl';\n }\n }\n });\n\n var unpack$k = utils.unpack;\n var min$1 = Math.min;\n var max$1 = Math.max;\n\n /*\n * supported arguments:\n * - rgb2hsv(r,g,b)\n * - rgb2hsv([r,g,b])\n * - rgb2hsv({r,g,b})\n */\n var rgb2hsl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$k(args, 'rgb');\n var r = args[0];\n var g = args[1];\n var b = args[2];\n var min_ = min$1(r, g, b);\n var max_ = max$1(r, g, b);\n var delta = max_ - min_;\n var h,s,v;\n v = max_ / 255.0;\n if (max_ === 0) {\n h = Number.NaN;\n s = 0;\n } else {\n s = delta / max_;\n if (r === max_) { h = (g - b) / delta; }\n if (g === max_) { h = 2+(b - r) / delta; }\n if (b === max_) { h = 4+(r - g) / delta; }\n h *= 60;\n if (h < 0) { h += 360; }\n }\n return [h, s, v]\n };\n\n var rgb2hsv$1 = rgb2hsl;\n\n var unpack$j = utils.unpack;\n var floor$2 = Math.floor;\n\n var hsv2rgb = function () {\n var assign, assign$1, assign$2, assign$3, assign$4, assign$5;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$j(args, 'hsv');\n var h = args[0];\n var s = args[1];\n var v = args[2];\n var r,g,b;\n v *= 255;\n if (s === 0) {\n r = g = b = v;\n } else {\n if (h === 360) { h = 0; }\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 60;\n\n var i = floor$2(h);\n var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - s * f);\n var t = v * (1 - s * (1 - f));\n\n switch (i) {\n case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break\n case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break\n case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break\n case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break\n case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break\n case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break\n }\n }\n return [r,g,b,args.length > 3?args[3]:1];\n };\n\n var hsv2rgb_1 = hsv2rgb;\n\n var unpack$i = utils.unpack;\n var type$f = utils.type;\n var chroma$c = chroma_1;\n var Color$v = Color_1;\n var input$8 = input$h;\n\n var rgb2hsv = rgb2hsv$1;\n\n Color$v.prototype.hsv = function() {\n return rgb2hsv(this._rgb);\n };\n\n chroma$c.hsv = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$v, [ null ].concat( args, ['hsv']) ));\n };\n\n input$8.format.hsv = hsv2rgb_1;\n\n input$8.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$i(args, 'hsv');\n if (type$f(args) === 'array' && args.length === 3) {\n return 'hsv';\n }\n }\n });\n\n var labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n Xn: 0.950470,\n Yn: 1,\n Zn: 1.088830,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452, // t1 * t1 * t1\n };\n\n var LAB_CONSTANTS$3 = labConstants;\n var unpack$h = utils.unpack;\n var pow$a = Math.pow;\n\n var rgb2lab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$h(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2xyz(r,g,b);\n var x = ref$1[0];\n var y = ref$1[1];\n var z = ref$1[2];\n var l = 116 * y - 16;\n return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];\n };\n\n var rgb_xyz = function (r) {\n if ((r /= 255) <= 0.04045) { return r / 12.92; }\n return pow$a((r + 0.055) / 1.055, 2.4);\n };\n\n var xyz_lab = function (t) {\n if (t > LAB_CONSTANTS$3.t3) { return pow$a(t, 1 / 3); }\n return t / LAB_CONSTANTS$3.t2 + LAB_CONSTANTS$3.t0;\n };\n\n var rgb2xyz = function (r,g,b) {\n r = rgb_xyz(r);\n g = rgb_xyz(g);\n b = rgb_xyz(b);\n var x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS$3.Xn);\n var y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS$3.Yn);\n var z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS$3.Zn);\n return [x,y,z];\n };\n\n var rgb2lab_1 = rgb2lab$2;\n\n var LAB_CONSTANTS$2 = labConstants;\n var unpack$g = utils.unpack;\n var pow$9 = Math.pow;\n\n /*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\n var lab2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$g(args, 'lab');\n var l = args[0];\n var a = args[1];\n var b = args[2];\n var x,y,z, r,g,b_;\n\n y = (l + 16) / 116;\n x = isNaN(a) ? y : y + a / 500;\n z = isNaN(b) ? y : y - b / 200;\n\n y = LAB_CONSTANTS$2.Yn * lab_xyz(y);\n x = LAB_CONSTANTS$2.Xn * lab_xyz(x);\n z = LAB_CONSTANTS$2.Zn * lab_xyz(z);\n\n r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB\n g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);\n b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);\n\n return [r,g,b_,args.length > 3 ? args[3] : 1];\n };\n\n var xyz_rgb = function (r) {\n return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow$9(r, 1 / 2.4) - 0.055)\n };\n\n var lab_xyz = function (t) {\n return t > LAB_CONSTANTS$2.t1 ? t * t * t : LAB_CONSTANTS$2.t2 * (t - LAB_CONSTANTS$2.t0)\n };\n\n var lab2rgb_1 = lab2rgb$1;\n\n var unpack$f = utils.unpack;\n var type$e = utils.type;\n var chroma$b = chroma_1;\n var Color$u = Color_1;\n var input$7 = input$h;\n\n var rgb2lab$1 = rgb2lab_1;\n\n Color$u.prototype.lab = function() {\n return rgb2lab$1(this._rgb);\n };\n\n chroma$b.lab = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$u, [ null ].concat( args, ['lab']) ));\n };\n\n input$7.format.lab = lab2rgb_1;\n\n input$7.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$f(args, 'lab');\n if (type$e(args) === 'array' && args.length === 3) {\n return 'lab';\n }\n }\n });\n\n var unpack$e = utils.unpack;\n var RAD2DEG = utils.RAD2DEG;\n var sqrt$3 = Math.sqrt;\n var atan2$2 = Math.atan2;\n var round$2 = Math.round;\n\n var lab2lch$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$e(args, 'lab');\n var l = ref[0];\n var a = ref[1];\n var b = ref[2];\n var c = sqrt$3(a * a + b * b);\n var h = (atan2$2(b, a) * RAD2DEG + 360) % 360;\n if (round$2(c*10000) === 0) { h = Number.NaN; }\n return [l, c, h];\n };\n\n var lab2lch_1 = lab2lch$2;\n\n var unpack$d = utils.unpack;\n var rgb2lab = rgb2lab_1;\n var lab2lch$1 = lab2lch_1;\n\n var rgb2lch$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$d(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2lab(r,g,b);\n var l = ref$1[0];\n var a = ref$1[1];\n var b_ = ref$1[2];\n return lab2lch$1(l,a,b_);\n };\n\n var rgb2lch_1 = rgb2lch$1;\n\n var unpack$c = utils.unpack;\n var DEG2RAD = utils.DEG2RAD;\n var sin$3 = Math.sin;\n var cos$3 = Math.cos;\n\n var lch2lab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n var ref = unpack$c(args, 'lch');\n var l = ref[0];\n var c = ref[1];\n var h = ref[2];\n if (isNaN(h)) { h = 0; }\n h = h * DEG2RAD;\n return [l, cos$3(h) * c, sin$3(h) * c]\n };\n\n var lch2lab_1 = lch2lab$2;\n\n var unpack$b = utils.unpack;\n var lch2lab$1 = lch2lab_1;\n var lab2rgb = lab2rgb_1;\n\n var lch2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$b(args, 'lch');\n var l = args[0];\n var c = args[1];\n var h = args[2];\n var ref = lch2lab$1 (l,c,h);\n var L = ref[0];\n var a = ref[1];\n var b_ = ref[2];\n var ref$1 = lab2rgb (L,a,b_);\n var r = ref$1[0];\n var g = ref$1[1];\n var b = ref$1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var lch2rgb_1 = lch2rgb$1;\n\n var unpack$a = utils.unpack;\n var lch2rgb = lch2rgb_1;\n\n var hcl2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var hcl = unpack$a(args, 'hcl').reverse();\n return lch2rgb.apply(void 0, hcl);\n };\n\n var hcl2rgb_1 = hcl2rgb;\n\n var unpack$9 = utils.unpack;\n var type$d = utils.type;\n var chroma$a = chroma_1;\n var Color$t = Color_1;\n var input$6 = input$h;\n\n var rgb2lch = rgb2lch_1;\n\n Color$t.prototype.lch = function() { return rgb2lch(this._rgb); };\n Color$t.prototype.hcl = function() { return rgb2lch(this._rgb).reverse(); };\n\n chroma$a.lch = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$t, [ null ].concat( args, ['lch']) ));\n };\n chroma$a.hcl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$t, [ null ].concat( args, ['hcl']) ));\n };\n\n input$6.format.lch = lch2rgb_1;\n input$6.format.hcl = hcl2rgb_1;\n\n ['lch','hcl'].forEach(function (m) { return input$6.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$9(args, m);\n if (type$d(args) === 'array' && args.length === 3) {\n return m;\n }\n }\n }); });\n\n /**\n \tX11 color names\n\n \thttp://www.w3.org/TR/css3-color/#svg-color\n */\n\n var w3cx11$1 = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflower: '#6495ed',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n laserlemon: '#ffff54',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrod: '#fafad2',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n maroon2: '#7f0000',\n maroon3: '#b03060',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n purple2: '#7f007f',\n purple3: '#a020f0',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32'\n };\n\n var w3cx11_1 = w3cx11$1;\n\n var Color$s = Color_1;\n var input$5 = input$h;\n var type$c = utils.type;\n\n var w3cx11 = w3cx11_1;\n var hex2rgb = hex2rgb_1;\n var rgb2hex = rgb2hex_1;\n\n Color$s.prototype.name = function() {\n var hex = rgb2hex(this._rgb, 'rgb');\n for (var i = 0, list = Object.keys(w3cx11); i < list.length; i += 1) {\n var n = list[i];\n\n if (w3cx11[n] === hex) { return n.toLowerCase(); }\n }\n return hex;\n };\n\n input$5.format.named = function (name) {\n name = name.toLowerCase();\n if (w3cx11[name]) { return hex2rgb(w3cx11[name]); }\n throw new Error('unknown color name: '+name);\n };\n\n input$5.autodetect.push({\n p: 5,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$c(h) === 'string' && w3cx11[h.toLowerCase()]) {\n return 'named';\n }\n }\n });\n\n var unpack$8 = utils.unpack;\n\n var rgb2num$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$8(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n return (r << 16) + (g << 8) + b;\n };\n\n var rgb2num_1 = rgb2num$1;\n\n var type$b = utils.type;\n\n var num2rgb = function (num) {\n if (type$b(num) == \"number\" && num >= 0 && num <= 0xFFFFFF) {\n var r = num >> 16;\n var g = (num >> 8) & 0xFF;\n var b = num & 0xFF;\n return [r,g,b,1];\n }\n throw new Error(\"unknown num color: \"+num);\n };\n\n var num2rgb_1 = num2rgb;\n\n var chroma$9 = chroma_1;\n var Color$r = Color_1;\n var input$4 = input$h;\n var type$a = utils.type;\n\n var rgb2num = rgb2num_1;\n\n Color$r.prototype.num = function() {\n return rgb2num(this._rgb);\n };\n\n chroma$9.num = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$r, [ null ].concat( args, ['num']) ));\n };\n\n input$4.format.num = num2rgb_1;\n\n input$4.autodetect.push({\n p: 5,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (args.length === 1 && type$a(args[0]) === 'number' && args[0] >= 0 && args[0] <= 0xFFFFFF) {\n return 'num';\n }\n }\n });\n\n var chroma$8 = chroma_1;\n var Color$q = Color_1;\n var input$3 = input$h;\n var unpack$7 = utils.unpack;\n var type$9 = utils.type;\n var round$1 = Math.round;\n\n Color$q.prototype.rgb = function(rnd) {\n if ( rnd === void 0 ) rnd=true;\n\n if (rnd === false) { return this._rgb.slice(0,3); }\n return this._rgb.slice(0,3).map(round$1);\n };\n\n Color$q.prototype.rgba = function(rnd) {\n if ( rnd === void 0 ) rnd=true;\n\n return this._rgb.slice(0,4).map(function (v,i) {\n return i<3 ? (rnd === false ? v : round$1(v)) : v;\n });\n };\n\n chroma$8.rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$q, [ null ].concat( args, ['rgb']) ));\n };\n\n input$3.format.rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgba = unpack$7(args, 'rgba');\n if (rgba[3] === undefined) { rgba[3] = 1; }\n return rgba;\n };\n\n input$3.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$7(args, 'rgba');\n if (type$9(args) === 'array' && (args.length === 3 ||\n args.length === 4 && type$9(args[3]) == 'number' && args[3] >= 0 && args[3] <= 1)) {\n return 'rgb';\n }\n }\n });\n\n /*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n */\n\n var log$1 = Math.log;\n\n var temperature2rgb$1 = function (kelvin) {\n var temp = kelvin / 100;\n var r,g,b;\n if (temp < 66) {\n r = 255;\n g = temp < 6 ? 0 : -155.25485562709179 - 0.44596950469579133 * (g = temp-2) + 104.49216199393888 * log$1(g);\n b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp-10) + 115.67994401066147 * log$1(b);\n } else {\n r = 351.97690566805693 + 0.114206453784165 * (r = temp-55) - 40.25366309332127 * log$1(r);\n g = 325.4494125711974 + 0.07943456536662342 * (g = temp-50) - 28.0852963507957 * log$1(g);\n b = 255;\n }\n return [r,g,b,1];\n };\n\n var temperature2rgb_1 = temperature2rgb$1;\n\n /*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n **/\n\n var temperature2rgb = temperature2rgb_1;\n var unpack$6 = utils.unpack;\n var round = Math.round;\n\n var rgb2temperature$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgb = unpack$6(args, 'rgb');\n var r = rgb[0], b = rgb[2];\n var minTemp = 1000;\n var maxTemp = 40000;\n var eps = 0.4;\n var temp;\n while (maxTemp - minTemp > eps) {\n temp = (maxTemp + minTemp) * 0.5;\n var rgb$1 = temperature2rgb(temp);\n if ((rgb$1[2] / rgb$1[0]) >= (b / r)) {\n maxTemp = temp;\n } else {\n minTemp = temp;\n }\n }\n return round(temp);\n };\n\n var rgb2temperature_1 = rgb2temperature$1;\n\n var chroma$7 = chroma_1;\n var Color$p = Color_1;\n var input$2 = input$h;\n\n var rgb2temperature = rgb2temperature_1;\n\n Color$p.prototype.temp =\n Color$p.prototype.kelvin =\n Color$p.prototype.temperature = function() {\n return rgb2temperature(this._rgb);\n };\n\n chroma$7.temp =\n chroma$7.kelvin =\n chroma$7.temperature = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$p, [ null ].concat( args, ['temp']) ));\n };\n\n input$2.format.temp =\n input$2.format.kelvin =\n input$2.format.temperature = temperature2rgb_1;\n\n var unpack$5 = utils.unpack;\n var cbrt = Math.cbrt;\n var pow$8 = Math.pow;\n var sign$1 = Math.sign;\n\n var rgb2oklab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // OKLab color space implementation taken from\n // https://bottosson.github.io/posts/oklab/\n var ref = unpack$5(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = [rgb2lrgb(r / 255), rgb2lrgb(g / 255), rgb2lrgb(b / 255)];\n var lr = ref$1[0];\n var lg = ref$1[1];\n var lb = ref$1[2];\n var l = cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n var m = cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n var s = cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s\n ];\n };\n\n var rgb2oklab_1 = rgb2oklab$2;\n\n function rgb2lrgb(c) {\n var abs = Math.abs(c);\n if (abs < 0.04045) {\n return c / 12.92;\n }\n return (sign$1(c) || 1) * pow$8((abs + 0.055) / 1.055, 2.4);\n }\n\n var unpack$4 = utils.unpack;\n var pow$7 = Math.pow;\n var sign = Math.sign;\n\n /*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\n var oklab2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$4(args, 'lab');\n var L = args[0];\n var a = args[1];\n var b = args[2];\n\n var l = pow$7(L + 0.3963377774 * a + 0.2158037573 * b, 3);\n var m = pow$7(L - 0.1055613458 * a - 0.0638541728 * b, 3);\n var s = pow$7(L - 0.0894841775 * a - 1.291485548 * b, 3);\n\n return [\n 255 * lrgb2rgb(+4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n 255 * lrgb2rgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n 255 * lrgb2rgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),\n args.length > 3 ? args[3] : 1\n ];\n };\n\n var oklab2rgb_1 = oklab2rgb$1;\n\n function lrgb2rgb(c) {\n var abs = Math.abs(c);\n if (abs > 0.0031308) {\n return (sign(c) || 1) * (1.055 * pow$7(abs, 1 / 2.4) - 0.055);\n }\n return c * 12.92;\n }\n\n var unpack$3 = utils.unpack;\n var type$8 = utils.type;\n var chroma$6 = chroma_1;\n var Color$o = Color_1;\n var input$1 = input$h;\n\n var rgb2oklab$1 = rgb2oklab_1;\n\n Color$o.prototype.oklab = function () {\n return rgb2oklab$1(this._rgb);\n };\n\n chroma$6.oklab = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$o, [ null ].concat( args, ['oklab']) ));\n };\n\n input$1.format.oklab = oklab2rgb_1;\n\n input$1.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$3(args, 'oklab');\n if (type$8(args) === 'array' && args.length === 3) {\n return 'oklab';\n }\n }\n });\n\n var unpack$2 = utils.unpack;\n var rgb2oklab = rgb2oklab_1;\n var lab2lch = lab2lch_1;\n\n var rgb2oklch$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$2(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2oklab(r, g, b);\n var l = ref$1[0];\n var a = ref$1[1];\n var b_ = ref$1[2];\n return lab2lch(l, a, b_);\n };\n\n var rgb2oklch_1 = rgb2oklch$1;\n\n var unpack$1 = utils.unpack;\n var lch2lab = lch2lab_1;\n var oklab2rgb = oklab2rgb_1;\n\n var oklch2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$1(args, 'lch');\n var l = args[0];\n var c = args[1];\n var h = args[2];\n var ref = lch2lab(l, c, h);\n var L = ref[0];\n var a = ref[1];\n var b_ = ref[2];\n var ref$1 = oklab2rgb(L, a, b_);\n var r = ref$1[0];\n var g = ref$1[1];\n var b = ref$1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var oklch2rgb_1 = oklch2rgb;\n\n var unpack = utils.unpack;\n var type$7 = utils.type;\n var chroma$5 = chroma_1;\n var Color$n = Color_1;\n var input = input$h;\n\n var rgb2oklch = rgb2oklch_1;\n\n Color$n.prototype.oklch = function () {\n return rgb2oklch(this._rgb);\n };\n\n chroma$5.oklch = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$n, [ null ].concat( args, ['oklch']) ));\n };\n\n input.format.oklch = oklch2rgb_1;\n\n input.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack(args, 'oklch');\n if (type$7(args) === 'array' && args.length === 3) {\n return 'oklch';\n }\n }\n });\n\n var Color$m = Color_1;\n var type$6 = utils.type;\n\n Color$m.prototype.alpha = function(a, mutate) {\n if ( mutate === void 0 ) mutate=false;\n\n if (a !== undefined && type$6(a) === 'number') {\n if (mutate) {\n this._rgb[3] = a;\n return this;\n }\n return new Color$m([this._rgb[0], this._rgb[1], this._rgb[2], a], 'rgb');\n }\n return this._rgb[3];\n };\n\n var Color$l = Color_1;\n\n Color$l.prototype.clipped = function() {\n return this._rgb._clipped || false;\n };\n\n var Color$k = Color_1;\n var LAB_CONSTANTS$1 = labConstants;\n\n Color$k.prototype.darken = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \tvar me = this;\n \tvar lab = me.lab();\n \tlab[0] -= LAB_CONSTANTS$1.Kn * amount;\n \treturn new Color$k(lab, 'lab').alpha(me.alpha(), true);\n };\n\n Color$k.prototype.brighten = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \treturn this.darken(-amount);\n };\n\n Color$k.prototype.darker = Color$k.prototype.darken;\n Color$k.prototype.brighter = Color$k.prototype.brighten;\n\n var Color$j = Color_1;\n\n Color$j.prototype.get = function (mc) {\n var ref = mc.split('.');\n var mode = ref[0];\n var channel = ref[1];\n var src = this[mode]();\n if (channel) {\n var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) { return src[i]; }\n throw new Error((\"unknown channel \" + channel + \" in mode \" + mode));\n } else {\n return src;\n }\n };\n\n var Color$i = Color_1;\n var type$5 = utils.type;\n var pow$6 = Math.pow;\n\n var EPS = 1e-7;\n var MAX_ITER = 20;\n\n Color$i.prototype.luminance = function(lum) {\n if (lum !== undefined && type$5(lum) === 'number') {\n if (lum === 0) {\n // return pure black\n return new Color$i([0,0,0,this._rgb[3]], 'rgb');\n }\n if (lum === 1) {\n // return pure white\n return new Color$i([255,255,255,this._rgb[3]], 'rgb');\n }\n // compute new color using...\n var cur_lum = this.luminance();\n var mode = 'rgb';\n var max_iter = MAX_ITER;\n\n var test = function (low, high) {\n var mid = low.interpolate(high, 0.5, mode);\n var lm = mid.luminance();\n if (Math.abs(lum - lm) < EPS || !max_iter--) {\n // close enough\n return mid;\n }\n return lm > lum ? test(low, mid) : test(mid, high);\n };\n\n var rgb = (cur_lum > lum ? test(new Color$i([0,0,0]), this) : test(this, new Color$i([255,255,255]))).rgb();\n return new Color$i(rgb.concat( [this._rgb[3]]));\n }\n return rgb2luminance.apply(void 0, (this._rgb).slice(0,3));\n };\n\n\n var rgb2luminance = function (r,g,b) {\n // relative luminance\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n r = luminance_x(r);\n g = luminance_x(g);\n b = luminance_x(b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n };\n\n var luminance_x = function (x) {\n x /= 255;\n return x <= 0.03928 ? x/12.92 : pow$6((x+0.055)/1.055, 2.4);\n };\n\n var interpolator$1 = {};\n\n var Color$h = Color_1;\n var type$4 = utils.type;\n var interpolator = interpolator$1;\n\n var mix$1 = function (col1, col2, f) {\n if ( f === void 0 ) f=0.5;\n var rest = [], len = arguments.length - 3;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 3 ];\n\n var mode = rest[0] || 'lrgb';\n if (!interpolator[mode] && !rest.length) {\n // fall back to the first supported mode\n mode = Object.keys(interpolator)[0];\n }\n if (!interpolator[mode]) {\n throw new Error((\"interpolation mode \" + mode + \" is not defined\"));\n }\n if (type$4(col1) !== 'object') { col1 = new Color$h(col1); }\n if (type$4(col2) !== 'object') { col2 = new Color$h(col2); }\n return interpolator[mode](col1, col2, f)\n .alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));\n };\n\n var Color$g = Color_1;\n var mix = mix$1;\n\n Color$g.prototype.mix =\n Color$g.prototype.interpolate = function(col2, f) {\n \tif ( f === void 0 ) f=0.5;\n \tvar rest = [], len = arguments.length - 2;\n \twhile ( len-- > 0 ) rest[ len ] = arguments[ len + 2 ];\n\n \treturn mix.apply(void 0, [ this, col2, f ].concat( rest ));\n };\n\n var Color$f = Color_1;\n\n Color$f.prototype.premultiply = function(mutate) {\n \tif ( mutate === void 0 ) mutate=false;\n\n \tvar rgb = this._rgb;\n \tvar a = rgb[3];\n \tif (mutate) {\n \t\tthis._rgb = [rgb[0]*a, rgb[1]*a, rgb[2]*a, a];\n \t\treturn this;\n \t} else {\n \t\treturn new Color$f([rgb[0]*a, rgb[1]*a, rgb[2]*a, a], 'rgb');\n \t}\n };\n\n var Color$e = Color_1;\n var LAB_CONSTANTS = labConstants;\n\n Color$e.prototype.saturate = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \tvar me = this;\n \tvar lch = me.lch();\n \tlch[1] += LAB_CONSTANTS.Kn * amount;\n \tif (lch[1] < 0) { lch[1] = 0; }\n \treturn new Color$e(lch, 'lch').alpha(me.alpha(), true);\n };\n\n Color$e.prototype.desaturate = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \treturn this.saturate(-amount);\n };\n\n var Color$d = Color_1;\n var type$3 = utils.type;\n\n Color$d.prototype.set = function (mc, value, mutate) {\n if ( mutate === void 0 ) mutate = false;\n\n var ref = mc.split('.');\n var mode = ref[0];\n var channel = ref[1];\n var src = this[mode]();\n if (channel) {\n var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) {\n if (type$3(value) == 'string') {\n switch (value.charAt(0)) {\n case '+':\n src[i] += +value;\n break;\n case '-':\n src[i] += +value;\n break;\n case '*':\n src[i] *= +value.substr(1);\n break;\n case '/':\n src[i] /= +value.substr(1);\n break;\n default:\n src[i] = +value;\n }\n } else if (type$3(value) === 'number') {\n src[i] = value;\n } else {\n throw new Error(\"unsupported value for Color.set\");\n }\n var out = new Color$d(src, mode);\n if (mutate) {\n this._rgb = out._rgb;\n return this;\n }\n return out;\n }\n throw new Error((\"unknown channel \" + channel + \" in mode \" + mode));\n } else {\n return src;\n }\n };\n\n var Color$c = Color_1;\n\n var rgb = function (col1, col2, f) {\n var xyz0 = col1._rgb;\n var xyz1 = col2._rgb;\n return new Color$c(\n xyz0[0] + f * (xyz1[0]-xyz0[0]),\n xyz0[1] + f * (xyz1[1]-xyz0[1]),\n xyz0[2] + f * (xyz1[2]-xyz0[2]),\n 'rgb'\n )\n };\n\n // register interpolator\n interpolator$1.rgb = rgb;\n\n var Color$b = Color_1;\n var sqrt$2 = Math.sqrt;\n var pow$5 = Math.pow;\n\n var lrgb = function (col1, col2, f) {\n var ref = col1._rgb;\n var x1 = ref[0];\n var y1 = ref[1];\n var z1 = ref[2];\n var ref$1 = col2._rgb;\n var x2 = ref$1[0];\n var y2 = ref$1[1];\n var z2 = ref$1[2];\n return new Color$b(\n sqrt$2(pow$5(x1,2) * (1-f) + pow$5(x2,2) * f),\n sqrt$2(pow$5(y1,2) * (1-f) + pow$5(y2,2) * f),\n sqrt$2(pow$5(z1,2) * (1-f) + pow$5(z2,2) * f),\n 'rgb'\n )\n };\n\n // register interpolator\n interpolator$1.lrgb = lrgb;\n\n var Color$a = Color_1;\n\n var lab = function (col1, col2, f) {\n var xyz0 = col1.lab();\n var xyz1 = col2.lab();\n return new Color$a(\n xyz0[0] + f * (xyz1[0]-xyz0[0]),\n xyz0[1] + f * (xyz1[1]-xyz0[1]),\n xyz0[2] + f * (xyz1[2]-xyz0[2]),\n 'lab'\n )\n };\n\n // register interpolator\n interpolator$1.lab = lab;\n\n var Color$9 = Color_1;\n\n var _hsx = function (col1, col2, f, m) {\n var assign, assign$1;\n\n var xyz0, xyz1;\n if (m === 'hsl') {\n xyz0 = col1.hsl();\n xyz1 = col2.hsl();\n } else if (m === 'hsv') {\n xyz0 = col1.hsv();\n xyz1 = col2.hsv();\n } else if (m === 'hcg') {\n xyz0 = col1.hcg();\n xyz1 = col2.hcg();\n } else if (m === 'hsi') {\n xyz0 = col1.hsi();\n xyz1 = col2.hsi();\n } else if (m === 'lch' || m === 'hcl') {\n m = 'hcl';\n xyz0 = col1.hcl();\n xyz1 = col2.hcl();\n } else if (m === 'oklch') {\n xyz0 = col1.oklch().reverse();\n xyz1 = col2.oklch().reverse();\n }\n\n var hue0, hue1, sat0, sat1, lbv0, lbv1;\n if (m.substr(0, 1) === 'h' || m === 'oklch') {\n (assign = xyz0, hue0 = assign[0], sat0 = assign[1], lbv0 = assign[2]);\n (assign$1 = xyz1, hue1 = assign$1[0], sat1 = assign$1[1], lbv1 = assign$1[2]);\n }\n\n var sat, hue, lbv, dh;\n\n if (!isNaN(hue0) && !isNaN(hue1)) {\n // both colors have hue\n if (hue1 > hue0 && hue1 - hue0 > 180) {\n dh = hue1 - (hue0 + 360);\n } else if (hue1 < hue0 && hue0 - hue1 > 180) {\n dh = hue1 + 360 - hue0;\n } else {\n dh = hue1 - hue0;\n }\n hue = hue0 + f * dh;\n } else if (!isNaN(hue0)) {\n hue = hue0;\n if ((lbv1 == 1 || lbv1 == 0) && m != 'hsv') { sat = sat0; }\n } else if (!isNaN(hue1)) {\n hue = hue1;\n if ((lbv0 == 1 || lbv0 == 0) && m != 'hsv') { sat = sat1; }\n } else {\n hue = Number.NaN;\n }\n\n if (sat === undefined) { sat = sat0 + f * (sat1 - sat0); }\n lbv = lbv0 + f * (lbv1 - lbv0);\n return m === 'oklch' ? new Color$9([lbv, sat, hue], m) : new Color$9([hue, sat, lbv], m);\n };\n\n var interpolate_hsx$5 = _hsx;\n\n var lch = function (col1, col2, f) {\n \treturn interpolate_hsx$5(col1, col2, f, 'lch');\n };\n\n // register interpolator\n interpolator$1.lch = lch;\n interpolator$1.hcl = lch;\n\n var Color$8 = Color_1;\n\n var num = function (col1, col2, f) {\n var c1 = col1.num();\n var c2 = col2.num();\n return new Color$8(c1 + f * (c2-c1), 'num')\n };\n\n // register interpolator\n interpolator$1.num = num;\n\n var interpolate_hsx$4 = _hsx;\n\n var hcg = function (col1, col2, f) {\n \treturn interpolate_hsx$4(col1, col2, f, 'hcg');\n };\n\n // register interpolator\n interpolator$1.hcg = hcg;\n\n var interpolate_hsx$3 = _hsx;\n\n var hsi = function (col1, col2, f) {\n \treturn interpolate_hsx$3(col1, col2, f, 'hsi');\n };\n\n // register interpolator\n interpolator$1.hsi = hsi;\n\n var interpolate_hsx$2 = _hsx;\n\n var hsl = function (col1, col2, f) {\n \treturn interpolate_hsx$2(col1, col2, f, 'hsl');\n };\n\n // register interpolator\n interpolator$1.hsl = hsl;\n\n var interpolate_hsx$1 = _hsx;\n\n var hsv = function (col1, col2, f) {\n \treturn interpolate_hsx$1(col1, col2, f, 'hsv');\n };\n\n // register interpolator\n interpolator$1.hsv = hsv;\n\n var Color$7 = Color_1;\n\n var oklab = function (col1, col2, f) {\n var xyz0 = col1.oklab();\n var xyz1 = col2.oklab();\n return new Color$7(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'oklab'\n );\n };\n\n // register interpolator\n interpolator$1.oklab = oklab;\n\n var interpolate_hsx = _hsx;\n\n var oklch = function (col1, col2, f) {\n return interpolate_hsx(col1, col2, f, 'oklch');\n };\n\n // register interpolator\n interpolator$1.oklch = oklch;\n\n var Color$6 = Color_1;\n var clip_rgb$1 = utils.clip_rgb;\n var pow$4 = Math.pow;\n var sqrt$1 = Math.sqrt;\n var PI$1 = Math.PI;\n var cos$2 = Math.cos;\n var sin$2 = Math.sin;\n var atan2$1 = Math.atan2;\n\n var average = function (colors, mode, weights) {\n if ( mode === void 0 ) mode='lrgb';\n if ( weights === void 0 ) weights=null;\n\n var l = colors.length;\n if (!weights) { weights = Array.from(new Array(l)).map(function () { return 1; }); }\n // normalize weights\n var k = l / weights.reduce(function(a, b) { return a + b; });\n weights.forEach(function (w,i) { weights[i] *= k; });\n // convert colors to Color objects\n colors = colors.map(function (c) { return new Color$6(c); });\n if (mode === 'lrgb') {\n return _average_lrgb(colors, weights)\n }\n var first = colors.shift();\n var xyz = first.get(mode);\n var cnt = [];\n var dx = 0;\n var dy = 0;\n // initial color\n for (var i=0; i= 360) { A$1 -= 360; }\n xyz[i$1] = A$1;\n } else {\n xyz[i$1] = xyz[i$1]/cnt[i$1];\n }\n }\n alpha /= l;\n return (new Color$6(xyz, mode)).alpha(alpha > 0.99999 ? 1 : alpha, true);\n };\n\n\n var _average_lrgb = function (colors, weights) {\n var l = colors.length;\n var xyz = [0,0,0,0];\n for (var i=0; i < colors.length; i++) {\n var col = colors[i];\n var f = weights[i] / l;\n var rgb = col._rgb;\n xyz[0] += pow$4(rgb[0],2) * f;\n xyz[1] += pow$4(rgb[1],2) * f;\n xyz[2] += pow$4(rgb[2],2) * f;\n xyz[3] += rgb[3] * f;\n }\n xyz[0] = sqrt$1(xyz[0]);\n xyz[1] = sqrt$1(xyz[1]);\n xyz[2] = sqrt$1(xyz[2]);\n if (xyz[3] > 0.9999999) { xyz[3] = 1; }\n return new Color$6(clip_rgb$1(xyz));\n };\n\n // minimal multi-purpose interface\n\n // @requires utils color analyze\n\n var chroma$4 = chroma_1;\n var type$2 = utils.type;\n\n var pow$3 = Math.pow;\n\n var scale$2 = function(colors) {\n\n // constructor\n var _mode = 'rgb';\n var _nacol = chroma$4('#ccc');\n var _spread = 0;\n // const _fixed = false;\n var _domain = [0, 1];\n var _pos = [];\n var _padding = [0,0];\n var _classes = false;\n var _colors = [];\n var _out = false;\n var _min = 0;\n var _max = 1;\n var _correctLightness = false;\n var _colorCache = {};\n var _useCache = true;\n var _gamma = 1;\n\n // private methods\n\n var setColors = function(colors) {\n colors = colors || ['#fff', '#000'];\n if (colors && type$2(colors) === 'string' && chroma$4.brewer &&\n chroma$4.brewer[colors.toLowerCase()]) {\n colors = chroma$4.brewer[colors.toLowerCase()];\n }\n if (type$2(colors) === 'array') {\n // handle single color\n if (colors.length === 1) {\n colors = [colors[0], colors[0]];\n }\n // make a copy of the colors\n colors = colors.slice(0);\n // convert to chroma classes\n for (var c=0; c= _classes[i]) {\n i++;\n }\n return i-1;\n }\n return 0;\n };\n\n var tMapLightness = function (t) { return t; };\n var tMapDomain = function (t) { return t; };\n\n // const classifyValue = function(value) {\n // let val = value;\n // if (_classes.length > 2) {\n // const n = _classes.length-1;\n // const i = getClass(value);\n // const minc = _classes[0] + ((_classes[1]-_classes[0]) * (0 + (_spread * 0.5))); // center of 1st class\n // const maxc = _classes[n-1] + ((_classes[n]-_classes[n-1]) * (1 - (_spread * 0.5))); // center of last class\n // val = _min + ((((_classes[i] + ((_classes[i+1] - _classes[i]) * 0.5)) - minc) / (maxc-minc)) * (_max - _min));\n // }\n // return val;\n // };\n\n var getColor = function(val, bypassMap) {\n var col, t;\n if (bypassMap == null) { bypassMap = false; }\n if (isNaN(val) || (val === null)) { return _nacol; }\n if (!bypassMap) {\n if (_classes && (_classes.length > 2)) {\n // find the class\n var c = getClass(val);\n t = c / (_classes.length-2);\n } else if (_max !== _min) {\n // just interpolate between min/max\n t = (val - _min) / (_max - _min);\n } else {\n t = 1;\n }\n } else {\n t = val;\n }\n\n // domain map\n t = tMapDomain(t);\n\n if (!bypassMap) {\n t = tMapLightness(t); // lightness correction\n }\n\n if (_gamma !== 1) { t = pow$3(t, _gamma); }\n\n t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));\n\n t = Math.min(1, Math.max(0, t));\n\n var k = Math.floor(t * 10000);\n\n if (_useCache && _colorCache[k]) {\n col = _colorCache[k];\n } else {\n if (type$2(_colors) === 'array') {\n //for i in [0.._pos.length-1]\n for (var i=0; i<_pos.length; i++) {\n var p = _pos[i];\n if (t <= p) {\n col = _colors[i];\n break;\n }\n if ((t >= p) && (i === (_pos.length-1))) {\n col = _colors[i];\n break;\n }\n if (t > p && t < _pos[i+1]) {\n t = (t-p)/(_pos[i+1]-p);\n col = chroma$4.interpolate(_colors[i], _colors[i+1], t, _mode);\n break;\n }\n }\n } else if (type$2(_colors) === 'function') {\n col = _colors(t);\n }\n if (_useCache) { _colorCache[k] = col; }\n }\n return col;\n };\n\n var resetCache = function () { return _colorCache = {}; };\n\n setColors(colors);\n\n // public interface\n\n var f = function(v) {\n var c = chroma$4(getColor(v));\n if (_out && c[_out]) { return c[_out](); } else { return c; }\n };\n\n f.classes = function(classes) {\n if (classes != null) {\n if (type$2(classes) === 'array') {\n _classes = classes;\n _domain = [classes[0], classes[classes.length-1]];\n } else {\n var d = chroma$4.analyze(_domain);\n if (classes === 0) {\n _classes = [d.min, d.max];\n } else {\n _classes = chroma$4.limits(d, 'e', classes);\n }\n }\n return f;\n }\n return _classes;\n };\n\n\n f.domain = function(domain) {\n if (!arguments.length) {\n return _domain;\n }\n _min = domain[0];\n _max = domain[domain.length-1];\n _pos = [];\n var k = _colors.length;\n if ((domain.length === k) && (_min !== _max)) {\n // update positions\n for (var i = 0, list = Array.from(domain); i < list.length; i += 1) {\n var d = list[i];\n\n _pos.push((d-_min) / (_max-_min));\n }\n } else {\n for (var c=0; c 2) {\n // set domain map\n var tOut = domain.map(function (d,i) { return i/(domain.length-1); });\n var tBreaks = domain.map(function (d) { return (d - _min) / (_max - _min); });\n if (!tBreaks.every(function (val, i) { return tOut[i] === val; })) {\n tMapDomain = function (t) {\n if (t <= 0 || t >= 1) { return t; }\n var i = 0;\n while (t >= tBreaks[i+1]) { i++; }\n var f = (t - tBreaks[i]) / (tBreaks[i+1] - tBreaks[i]);\n var out = tOut[i] + f * (tOut[i+1] - tOut[i]);\n return out;\n };\n }\n\n }\n }\n _domain = [_min, _max];\n return f;\n };\n\n f.mode = function(_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n\n f.range = function(colors, _pos) {\n setColors(colors);\n return f;\n };\n\n f.out = function(_o) {\n _out = _o;\n return f;\n };\n\n f.spread = function(val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\n };\n\n f.correctLightness = function(v) {\n if (v == null) { v = true; }\n _correctLightness = v;\n resetCache();\n if (_correctLightness) {\n tMapLightness = function(t) {\n var L0 = getColor(0, true).lab()[0];\n var L1 = getColor(1, true).lab()[0];\n var pol = L0 > L1;\n var L_actual = getColor(t, true).lab()[0];\n var L_ideal = L0 + ((L1 - L0) * t);\n var L_diff = L_actual - L_ideal;\n var t0 = 0;\n var t1 = 1;\n var max_iter = 20;\n while ((Math.abs(L_diff) > 1e-2) && (max_iter-- > 0)) {\n (function() {\n if (pol) { L_diff *= -1; }\n if (L_diff < 0) {\n t0 = t;\n t += (t1 - t) * 0.5;\n } else {\n t1 = t;\n t += (t0 - t) * 0.5;\n }\n L_actual = getColor(t, true).lab()[0];\n return L_diff = L_actual - L_ideal;\n })();\n }\n return t;\n };\n } else {\n tMapLightness = function (t) { return t; };\n }\n return f;\n };\n\n f.padding = function(p) {\n if (p != null) {\n if (type$2(p) === 'number') {\n p = [p,p];\n }\n _padding = p;\n return f;\n } else {\n return _padding;\n }\n };\n\n f.colors = function(numColors, out) {\n // If no arguments are given, return the original colors that were provided\n if (arguments.length < 2) { out = 'hex'; }\n var result = [];\n\n if (arguments.length === 0) {\n result = _colors.slice(0);\n\n } else if (numColors === 1) {\n result = [f(0.5)];\n\n } else if (numColors > 1) {\n var dm = _domain[0];\n var dd = _domain[1] - dm;\n result = __range__(0, numColors, false).map(function (i) { return f( dm + ((i/(numColors-1)) * dd) ); });\n\n } else { // returns all colors based on the defined classes\n colors = [];\n var samples = [];\n if (_classes && (_classes.length > 2)) {\n for (var i = 1, end = _classes.length, asc = 1 <= end; asc ? i < end : i > end; asc ? i++ : i--) {\n samples.push((_classes[i-1]+_classes[i])*0.5);\n }\n } else {\n samples = _domain;\n }\n result = samples.map(function (v) { return f(v); });\n }\n\n if (chroma$4[out]) {\n result = result.map(function (c) { return c[out](); });\n }\n return result;\n };\n\n f.cache = function(c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\n }\n };\n\n f.gamma = function(g) {\n if (g != null) {\n _gamma = g;\n return f;\n } else {\n return _gamma;\n }\n };\n\n f.nodata = function(d) {\n if (d != null) {\n _nacol = chroma$4(d);\n return f;\n } else {\n return _nacol;\n }\n };\n\n return f;\n };\n\n function __range__(left, right, inclusive) {\n var range = [];\n var ascending = left < right;\n var end = !inclusive ? right : ascending ? right + 1 : right - 1;\n for (var i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {\n range.push(i);\n }\n return range;\n }\n\n //\n // interpolates between a set of colors uzing a bezier spline\n //\n\n // @requires utils lab\n var Color$5 = Color_1;\n\n var scale$1 = scale$2;\n\n // nth row of the pascal triangle\n var binom_row = function(n) {\n var row = [1, 1];\n for (var i = 1; i < n; i++) {\n var newrow = [1];\n for (var j = 1; j <= row.length; j++) {\n newrow[j] = (row[j] || 0) + row[j - 1];\n }\n row = newrow;\n }\n return row;\n };\n\n var bezier = function(colors) {\n var assign, assign$1, assign$2;\n\n var I, lab0, lab1, lab2;\n colors = colors.map(function (c) { return new Color$5(c); });\n if (colors.length === 2) {\n // linear interpolation\n (assign = colors.map(function (c) { return c.lab(); }), lab0 = assign[0], lab1 = assign[1]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return lab0[i] + (t * (lab1[i] - lab0[i])); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length === 3) {\n // quadratic bezier interpolation\n (assign$1 = colors.map(function (c) { return c.lab(); }), lab0 = assign$1[0], lab1 = assign$1[1], lab2 = assign$1[2]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t) * lab0[i]) + (2 * (1-t) * t * lab1[i]) + (t * t * lab2[i]); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length === 4) {\n // cubic bezier interpolation\n var lab3;\n (assign$2 = colors.map(function (c) { return c.lab(); }), lab0 = assign$2[0], lab1 = assign$2[1], lab2 = assign$2[2], lab3 = assign$2[3]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t)*(1-t) * lab0[i]) + (3 * (1-t) * (1-t) * t * lab1[i]) + (3 * (1-t) * t * t * lab2[i]) + (t*t*t * lab3[i]); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length >= 5) {\n // general case (degree n bezier)\n var labs, row, n;\n labs = colors.map(function (c) { return c.lab(); });\n n = colors.length - 1;\n row = binom_row(n);\n I = function (t) {\n var u = 1 - t;\n var lab = ([0, 1, 2].map(function (i) { return labs.reduce(function (sum, el, j) { return (sum + row[j] * Math.pow( u, (n - j) ) * Math.pow( t, j ) * el[i]); }, 0); }));\n return new Color$5(lab, 'lab');\n };\n } else {\n throw new RangeError(\"No point in running bezier with only one color.\")\n }\n return I;\n };\n\n var bezier_1 = function (colors) {\n var f = bezier(colors);\n f.scale = function () { return scale$1(f); };\n return f;\n };\n\n /*\n * interpolates between a set of colors uzing a bezier spline\n * blend mode formulas taken from http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/\n */\n\n var chroma$3 = chroma_1;\n\n var blend = function (bottom, top, mode) {\n if (!blend[mode]) {\n throw new Error('unknown blend mode ' + mode);\n }\n return blend[mode](bottom, top);\n };\n\n var blend_f = function (f) { return function (bottom,top) {\n var c0 = chroma$3(top).rgb();\n var c1 = chroma$3(bottom).rgb();\n return chroma$3.rgb(f(c0, c1));\n }; };\n\n var each = function (f) { return function (c0, c1) {\n var out = [];\n out[0] = f(c0[0], c1[0]);\n out[1] = f(c0[1], c1[1]);\n out[2] = f(c0[2], c1[2]);\n return out;\n }; };\n\n var normal = function (a) { return a; };\n var multiply = function (a,b) { return a * b / 255; };\n var darken = function (a,b) { return a > b ? b : a; };\n var lighten = function (a,b) { return a > b ? a : b; };\n var screen = function (a,b) { return 255 * (1 - (1-a/255) * (1-b/255)); };\n var overlay = function (a,b) { return b < 128 ? 2 * a * b / 255 : 255 * (1 - 2 * (1 - a / 255 ) * ( 1 - b / 255 )); };\n var burn = function (a,b) { return 255 * (1 - (1 - b / 255) / (a/255)); };\n var dodge = function (a,b) {\n if (a === 255) { return 255; }\n a = 255 * (b / 255) / (1 - a / 255);\n return a > 255 ? 255 : a\n };\n\n // # add = (a,b) ->\n // # if (a + b > 255) then 255 else a + b\n\n blend.normal = blend_f(each(normal));\n blend.multiply = blend_f(each(multiply));\n blend.screen = blend_f(each(screen));\n blend.overlay = blend_f(each(overlay));\n blend.darken = blend_f(each(darken));\n blend.lighten = blend_f(each(lighten));\n blend.dodge = blend_f(each(dodge));\n blend.burn = blend_f(each(burn));\n // blend.add = blend_f(each(add));\n\n var blend_1 = blend;\n\n // cubehelix interpolation\n // based on D.A. Green \"A colour scheme for the display of astronomical intensity images\"\n // http://astron-soc.in/bulletin/11June/289392011.pdf\n\n var type$1 = utils.type;\n var clip_rgb = utils.clip_rgb;\n var TWOPI = utils.TWOPI;\n var pow$2 = Math.pow;\n var sin$1 = Math.sin;\n var cos$1 = Math.cos;\n var chroma$2 = chroma_1;\n\n var cubehelix = function(start, rotations, hue, gamma, lightness) {\n if ( start === void 0 ) start=300;\n if ( rotations === void 0 ) rotations=-1.5;\n if ( hue === void 0 ) hue=1;\n if ( gamma === void 0 ) gamma=1;\n if ( lightness === void 0 ) lightness=[0,1];\n\n var dh = 0, dl;\n if (type$1(lightness) === 'array') {\n dl = lightness[1] - lightness[0];\n } else {\n dl = 0;\n lightness = [lightness, lightness];\n }\n\n var f = function(fract) {\n var a = TWOPI * (((start+120)/360) + (rotations * fract));\n var l = pow$2(lightness[0] + (dl * fract), gamma);\n var h = dh !== 0 ? hue[0] + (fract * dh) : hue;\n var amp = (h * l * (1-l)) / 2;\n var cos_a = cos$1(a);\n var sin_a = sin$1(a);\n var r = l + (amp * ((-0.14861 * cos_a) + (1.78277* sin_a)));\n var g = l + (amp * ((-0.29227 * cos_a) - (0.90649* sin_a)));\n var b = l + (amp * (+1.97294 * cos_a));\n return chroma$2(clip_rgb([r*255,g*255,b*255,1]));\n };\n\n f.start = function(s) {\n if ((s == null)) { return start; }\n start = s;\n return f;\n };\n\n f.rotations = function(r) {\n if ((r == null)) { return rotations; }\n rotations = r;\n return f;\n };\n\n f.gamma = function(g) {\n if ((g == null)) { return gamma; }\n gamma = g;\n return f;\n };\n\n f.hue = function(h) {\n if ((h == null)) { return hue; }\n hue = h;\n if (type$1(hue) === 'array') {\n dh = hue[1] - hue[0];\n if (dh === 0) { hue = hue[1]; }\n } else {\n dh = 0;\n }\n return f;\n };\n\n f.lightness = function(h) {\n if ((h == null)) { return lightness; }\n if (type$1(h) === 'array') {\n lightness = h;\n dl = h[1] - h[0];\n } else {\n lightness = [h,h];\n dl = 0;\n }\n return f;\n };\n\n f.scale = function () { return chroma$2.scale(f); };\n\n f.hue(hue);\n\n return f;\n };\n\n var Color$4 = Color_1;\n var digits = '0123456789abcdef';\n\n var floor$1 = Math.floor;\n var random = Math.random;\n\n var random_1 = function () {\n var code = '#';\n for (var i=0; i<6; i++) {\n code += digits.charAt(floor$1(random() * 16));\n }\n return new Color$4(code, 'hex');\n };\n\n var type = type$p;\n var log = Math.log;\n var pow$1 = Math.pow;\n var floor = Math.floor;\n var abs$1 = Math.abs;\n\n\n var analyze = function (data, key) {\n if ( key === void 0 ) key=null;\n\n var r = {\n min: Number.MAX_VALUE,\n max: Number.MAX_VALUE*-1,\n sum: 0,\n values: [],\n count: 0\n };\n if (type(data) === 'object') {\n data = Object.values(data);\n }\n data.forEach(function (val) {\n if (key && type(val) === 'object') { val = val[key]; }\n if (val !== undefined && val !== null && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) { r.min = val; }\n if (val > r.max) { r.max = val; }\n r.count += 1;\n }\n });\n\n r.domain = [r.min, r.max];\n\n r.limits = function (mode, num) { return limits(r, mode, num); };\n\n return r;\n };\n\n\n var limits = function (data, mode, num) {\n if ( mode === void 0 ) mode='equal';\n if ( num === void 0 ) num=7;\n\n if (type(data) == 'array') {\n data = analyze(data);\n }\n var min = data.min;\n var max = data.max;\n var values = data.values.sort(function (a,b) { return a-b; });\n\n if (num === 1) { return [min,max]; }\n\n var limits = [];\n\n if (mode.substr(0,1) === 'c') { // continuous\n limits.push(min);\n limits.push(max);\n }\n\n if (mode.substr(0,1) === 'e') { // equal interval\n limits.push(min);\n for (var i=1; i 0');\n }\n var min_log = Math.LOG10E * log(min);\n var max_log = Math.LOG10E * log(max);\n limits.push(min);\n for (var i$1=1; i$1 pb\n var pr = p - pb;\n limits.push((values[pb]*(1-pr)) + (values[pb+1]*pr));\n }\n }\n limits.push(max);\n\n }\n\n else if (mode.substr(0,1) === 'k') { // k-means clustering\n /*\n implementation based on\n http://code.google.com/p/figue/source/browse/trunk/figue.js#336\n simplified for 1-d input values\n */\n var cluster;\n var n = values.length;\n var assignments = new Array(n);\n var clusterSizes = new Array(num);\n var repeat = true;\n var nb_iters = 0;\n var centroids = null;\n\n // get seed values\n centroids = [];\n centroids.push(min);\n for (var i$3=1; i$3 200) {\n repeat = false;\n }\n }\n\n // finished k-means clustering\n // the next part is borrowed from gabrielflor.it\n var kClusters = {};\n for (var j$5=0; j$5 l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);\n };\n\n var Color$2 = Color_1;\n var sqrt = Math.sqrt;\n var pow = Math.pow;\n var min = Math.min;\n var max = Math.max;\n var atan2 = Math.atan2;\n var abs = Math.abs;\n var cos = Math.cos;\n var sin = Math.sin;\n var exp = Math.exp;\n var PI = Math.PI;\n\n var deltaE = function(a, b, Kl, Kc, Kh) {\n if ( Kl === void 0 ) Kl=1;\n if ( Kc === void 0 ) Kc=1;\n if ( Kh === void 0 ) Kh=1;\n\n // Delta E (CIE 2000)\n // see http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html\n var rad2deg = function(rad) {\n return 360 * rad / (2 * PI);\n };\n var deg2rad = function(deg) {\n return (2 * PI * deg) / 360;\n };\n a = new Color$2(a);\n b = new Color$2(b);\n var ref = Array.from(a.lab());\n var L1 = ref[0];\n var a1 = ref[1];\n var b1 = ref[2];\n var ref$1 = Array.from(b.lab());\n var L2 = ref$1[0];\n var a2 = ref$1[1];\n var b2 = ref$1[2];\n var avgL = (L1 + L2)/2;\n var C1 = sqrt(pow(a1, 2) + pow(b1, 2));\n var C2 = sqrt(pow(a2, 2) + pow(b2, 2));\n var avgC = (C1 + C2)/2;\n var G = 0.5*(1-sqrt(pow(avgC, 7)/(pow(avgC, 7) + pow(25, 7))));\n var a1p = a1*(1+G);\n var a2p = a2*(1+G);\n var C1p = sqrt(pow(a1p, 2) + pow(b1, 2));\n var C2p = sqrt(pow(a2p, 2) + pow(b2, 2));\n var avgCp = (C1p + C2p)/2;\n var arctan1 = rad2deg(atan2(b1, a1p));\n var arctan2 = rad2deg(atan2(b2, a2p));\n var h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;\n var h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;\n var avgHp = abs(h1p - h2p) > 180 ? (h1p + h2p + 360)/2 : (h1p + h2p)/2;\n var T = 1 - 0.17*cos(deg2rad(avgHp - 30)) + 0.24*cos(deg2rad(2*avgHp)) + 0.32*cos(deg2rad(3*avgHp + 6)) - 0.2*cos(deg2rad(4*avgHp - 63));\n var deltaHp = h2p - h1p;\n deltaHp = abs(deltaHp) <= 180 ? deltaHp : h2p <= h1p ? deltaHp + 360 : deltaHp - 360;\n deltaHp = 2*sqrt(C1p*C2p)*sin(deg2rad(deltaHp)/2);\n var deltaL = L2 - L1;\n var deltaCp = C2p - C1p; \n var sl = 1 + (0.015*pow(avgL - 50, 2))/sqrt(20 + pow(avgL - 50, 2));\n var sc = 1 + 0.045*avgCp;\n var sh = 1 + 0.015*avgCp*T;\n var deltaTheta = 30*exp(-pow((avgHp - 275)/25, 2));\n var Rc = 2*sqrt(pow(avgCp, 7)/(pow(avgCp, 7) + pow(25, 7)));\n var Rt = -Rc*sin(2*deg2rad(deltaTheta));\n var result = sqrt(pow(deltaL/(Kl*sl), 2) + pow(deltaCp/(Kc*sc), 2) + pow(deltaHp/(Kh*sh), 2) + Rt*(deltaCp/(Kc*sc))*(deltaHp/(Kh*sh)));\n return max(0, min(100, result));\n };\n\n var Color$1 = Color_1;\n\n // simple Euclidean distance\n var distance = function(a, b, mode) {\n if ( mode === void 0 ) mode='lab';\n\n // Delta E (CIE 1976)\n // see http://www.brucelindbloom.com/index.html?Equations.html\n a = new Color$1(a);\n b = new Color$1(b);\n var l1 = a.get(mode);\n var l2 = b.get(mode);\n var sum_sq = 0;\n for (var i in l1) {\n var d = (l1[i] || 0) - (l2[i] || 0);\n sum_sq += d*d;\n }\n return Math.sqrt(sum_sq);\n };\n\n var Color = Color_1;\n\n var valid = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n try {\n new (Function.prototype.bind.apply( Color, [ null ].concat( args) ));\n return true;\n } catch (e) {\n return false;\n }\n };\n\n // some pre-defined color scales:\n var chroma$1 = chroma_1;\n\n var scale = scale$2;\n\n var scales = {\n \tcool: function cool() { return scale([chroma$1.hsl(180,1,.9), chroma$1.hsl(250,.7,.4)]) },\n \thot: function hot() { return scale(['#000','#f00','#ff0','#fff']).mode('rgb') }\n };\n\n /**\n ColorBrewer colors for chroma.js\n\n Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The\n Pennsylvania State University.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed\n under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n CONDITIONS OF ANY KIND, either express or implied. See the License for the\n specific language governing permissions and limitations under the License.\n */\n\n var colorbrewer = {\n // sequential\n OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],\n PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],\n BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],\n Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],\n BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],\n YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],\n YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],\n Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],\n RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],\n Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],\n YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],\n Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],\n GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],\n Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],\n YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],\n PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],\n Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],\n PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],\n Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],\n\n // diverging\n\n Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],\n RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],\n RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],\n PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],\n PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],\n RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],\n BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],\n RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],\n PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],\n\n // qualitative\n\n Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],\n Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],\n Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],\n Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],\n Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],\n Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],\n Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],\n Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2'],\n };\n\n // add lowercase aliases for case-insensitive matches\n for (var i = 0, list = Object.keys(colorbrewer); i < list.length; i += 1) {\n var key = list[i];\n\n colorbrewer[key.toLowerCase()] = colorbrewer[key];\n }\n\n var colorbrewer_1 = colorbrewer;\n\n var chroma = chroma_1;\n\n // feel free to comment out anything to rollup\n // a smaller chroma.js built\n\n // io --> convert colors\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // operators --> modify existing Colors\n\n\n\n\n\n\n\n\n\n\n // interpolators\n\n\n\n\n\n\n\n\n\n\n\n\n // generators -- > create new colors\n chroma.average = average;\n chroma.bezier = bezier_1;\n chroma.blend = blend_1;\n chroma.cubehelix = cubehelix;\n chroma.mix = chroma.interpolate = mix$1;\n chroma.random = random_1;\n chroma.scale = scale$2;\n\n // other utility methods\n chroma.analyze = analyze_1.analyze;\n chroma.contrast = contrast;\n chroma.deltaE = deltaE;\n chroma.distance = distance;\n chroma.limits = analyze_1.limits;\n chroma.valid = valid;\n\n // scale\n chroma.scales = scales;\n\n // colors\n chroma.colors = w3cx11_1;\n chroma.brewer = colorbrewer_1;\n\n var chroma_js = chroma;\n\n return chroma_js;\n\n}));\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n","import chroma from 'chroma-js';\nimport _range from 'lodash/range';\n\nexport const COLOR_RANGE_STEPS_MIN = 3;\nexport const COLOR_RANGE_STEPS_MAX = 5;\nexport const COLOR_RANGE_STEPS_DEFAULT = 5;\nexport const RENDERER_COLOR_RANGES = [\n ['#f5f502', '#f50100'],\n ['#fef0d9', '#b30000'],\n ['#edf8fb', '#006d2c'],\n ['#edf8fb', '#810f7c'],\n ['#f0f9e8', '#0868ac'],\n ['#f1eef6', '#980043'],\n];\nexport const COLOR_RANGE_STEPS_DROPDOWN = _range(COLOR_RANGE_STEPS_MIN, COLOR_RANGE_STEPS_MAX + 1);\nexport const COLOR_RANGE_1 = chroma.scale(RENDERER_COLOR_RANGES[0]).mode('lch').colors(COLOR_RANGE_STEPS_MAX);\nexport const COLOR_RANGE_2 = chroma.scale(RENDERER_COLOR_RANGES[1]).mode('lch').colors(COLOR_RANGE_STEPS_MAX);\nexport const COLOR_RANGE_3 = chroma.scale(RENDERER_COLOR_RANGES[2]).mode('lch').colors(COLOR_RANGE_STEPS_MAX);\nexport const COLOR_RANGE_4 = chroma.scale(RENDERER_COLOR_RANGES[3]).mode('lch').colors(COLOR_RANGE_STEPS_MAX);\nexport const COLOR_RANGE_5 = chroma.scale(RENDERER_COLOR_RANGES[4]).mode('lch').colors(COLOR_RANGE_STEPS_MAX);\nexport const COLOR_RANGE_6 = chroma.scale(RENDERER_COLOR_RANGES[5]).mode('lch').colors(COLOR_RANGE_STEPS_MAX);\nexport const COLOR_RANGES = [COLOR_RANGE_1, COLOR_RANGE_2, COLOR_RANGE_3, COLOR_RANGE_4, COLOR_RANGE_5, COLOR_RANGE_6];\n\nexport const ADDITIONAL_EXTERNAL_FIELDS = [\n { name: 'Value', alias: 'Value', type: 'double' },\n { name: 'Population_at_risk', alias: 'Population_at_risk', type: 'double' },\n { name: 'Uncertainty_Interval', alias: 'Uncertainty_Interval', type: 'double' },\n { name: 'region_id', alias: 'region_id', type: 'string' },\n];\n","import { RendererClassificationMethodType } from '../store/slices/sidebarMapFiltersSlice';\n\nexport type RendererClassificationMethodsType = {\n label: string;\n value: RendererClassificationMethodType;\n};\n\nexport const RENDERER_CLASSIFICATION_METHODS: RendererClassificationMethodsType[] = [\n { label: 'Natural Breaks', value: 'natural-breaks' },\n { label: 'Equal Interval', value: 'equal-interval' },\n { label: 'Quantile', value: 'quantile' },\n // { label: 'Standard Deviation', value: 'standard-deviation' },\n];\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { RootState } from '../store';\nimport { ADMIN__Admin1, SIDEBAR_MAP_FILTER_FIELDS } from '../../configs/map.configs';\n\nimport { COLOR_RANGE_STEPS_DEFAULT, COLOR_RANGES } from '../../configs/mapColor.configs';\nimport { RENDERER_CLASSIFICATION_METHODS } from '../../configs/mapRendererClassificationMethods.configs';\n\nexport type RendererClassificationMethodType =\n | 'equal-interval'\n | 'natural-breaks'\n | 'quantile'\n | 'standard-deviation'\n | undefined;\n\ntype sidebarMapFiltersStateTypes = {\n adminSelected: string;\n fieldSelected: string;\n colorRangeSteps: number;\n colorRangeIndexSelected: number;\n colorRangeSelected: string[];\n rendererClassificationMethod: RendererClassificationMethodType;\n};\n\nconst sidebarMapFiltersInitialState: sidebarMapFiltersStateTypes = {\n adminSelected: ADMIN__Admin1,\n fieldSelected: SIDEBAR_MAP_FILTER_FIELDS[0].value,\n colorRangeSteps: COLOR_RANGE_STEPS_DEFAULT,\n colorRangeIndexSelected: 0,\n colorRangeSelected: COLOR_RANGES[0].slice(0, COLOR_RANGE_STEPS_DEFAULT),\n rendererClassificationMethod: RENDERER_CLASSIFICATION_METHODS[0].value,\n};\n\nexport const sidebarMapFiltersSlice = createSlice({\n name: 'sidebarMapFiltersSlice',\n initialState: sidebarMapFiltersInitialState,\n reducers: {\n setAdminSelected: (state, action: PayloadAction) => {\n state.adminSelected = action.payload;\n },\n setFieldSelected: (state, action: PayloadAction) => {\n state.fieldSelected = action.payload;\n },\n setColorRangeSteps: (state, action: PayloadAction) => {\n state.colorRangeSteps = action.payload;\n state.colorRangeSelected = COLOR_RANGES[state.colorRangeIndexSelected].slice(0, action.payload);\n },\n setColorRangeIndexSelected: (state, action: PayloadAction) => {\n state.colorRangeIndexSelected = action.payload;\n },\n setColorRangeSelected: (state, action: PayloadAction) => {\n state.colorRangeSelected = action.payload;\n },\n setRendererClassificationMethod: (state, action: PayloadAction) => {\n state.rendererClassificationMethod = action.payload;\n },\n },\n});\n\nexport const {\n setAdminSelected,\n setFieldSelected,\n setColorRangeSteps,\n setColorRangeIndexSelected,\n setColorRangeSelected,\n setRendererClassificationMethod,\n} = sidebarMapFiltersSlice.actions;\n\nexport const $adminSelected = (state: RootState) => state.sidebarMapFiltersSlice.adminSelected;\nexport const $fieldSelected = (state: RootState) => state.sidebarMapFiltersSlice.fieldSelected;\nexport const $colorRangeSteps = (state: RootState) => state.sidebarMapFiltersSlice.colorRangeSteps;\nexport const $colorRangeIndexSelected = (state: RootState) => state.sidebarMapFiltersSlice.colorRangeIndexSelected;\nexport const $colorRangeSelected = (state: RootState) => state.sidebarMapFiltersSlice.colorRangeSelected;\nexport const $rendererClassificationMethod = (state: RootState) =>\n state.sidebarMapFiltersSlice.rendererClassificationMethod;\n\nexport default sidebarMapFiltersSlice.reducer;\n","import { createTheme } from '@mui/material';\n\nexport const muiTheme = createTheme({\n typography: {\n fontSize: 20,\n fontFamily: \"'GillSansRegular', 'GillSansLight', 'Raleway', serif\",\n },\n});\n\nexport const RADIO_BUTTON_STYLE = {\n '& .MuiSvgIcon-root': {\n fontSize: 20,\n },\n color: '#0961a7',\n '&.Mui-checked': {\n color: '#0961a7',\n },\n};\n","import React, { useEffect } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FormControl, FormControlLabel, Radio, RadioGroup } from '@mui/material';\n\n// Components\nimport SidebarMapDisableContainer from '../SidebarMapDisableContainer/SidebarMapDisableContainer';\n\n// Store\nimport { $adminSelected, $fieldSelected, setFieldSelected } from '../../../store/slices/sidebarMapFiltersSlice';\n\n// Configs\nimport { RADIO_BUTTON_STYLE } from '../../../configs/muiStyling.config';\nimport { ADMIN__Admin1, SIDEBAR_MAP_FILTER_FIELDS } from '../../../configs/map.configs';\nimport { SidebarMapFilterFieldsType } from '../../../configs/types';\n\n// Styles\nimport './SidebarMapFiltersField.scss';\n\nfunction SidebarMapFiltersField() {\n const dispatch = useDispatch();\n const adminSelected = useSelector($adminSelected);\n const fieldSelected = useSelector($fieldSelected);\n\n const admin1Selected = adminSelected === ADMIN__Admin1;\n\n useEffect(() => {\n if (admin1Selected) {\n dispatch(setFieldSelected(SIDEBAR_MAP_FILTER_FIELDS[0].value));\n }\n }, [adminSelected]);\n\n const handleSidebarMapTypeFilters = (event: any) => {\n const fieldSelected = event.target.value;\n if (import.meta.env.MODE === 'development') {\n console.log('value:', fieldSelected);\n }\n\n dispatch(setFieldSelected(fieldSelected));\n };\n\n return (\n
\n {admin1Selected && }\n\n \n \n {SIDEBAR_MAP_FILTER_FIELDS.map((field: SidebarMapFilterFieldsType, index: number) => {\n const { label, value, tooltip } = field;\n\n return (\n }\n />\n );\n })}\n \n \n
\n );\n}\n\nexport default SidebarMapFiltersField;\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { RootState } from '../store';\n\nimport { TOOLS_OPTIONS_OBJECT } from '../../configs/tools.configs';\n\ninterface modelSurfaceState {\n toolSelected: string;\n}\n\nconst initialState: modelSurfaceState = {\n toolSelected: TOOLS_OPTIONS_OBJECT.map.label,\n};\n\nexport const admin2ToolsSlice = createSlice({\n name: 'admin2ToolsSlice',\n initialState,\n reducers: {\n setToolSelected: (state, action: PayloadAction) => {\n state.toolSelected = action.payload;\n },\n },\n});\n\nexport const { setToolSelected } = admin2ToolsSlice.actions;\n\nexport const $toolSelected = (state: RootState) => state.admin2ToolsSlice.toolSelected;\n\nexport default admin2ToolsSlice.reducer;\n","import React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\n\n// Components\nimport ToolTableIcon from '../Images/ToolTableIcon';\nimport ToolChartIcon from '../Images/ToolChartIcon';\nimport ToolMapIcon from '../Images/ToolMapIcon';\n// import ToolLineIcon from '../Images/ToolLineIcon';\nimport SidebarMapFiltersField from '../Admin2Map/SidebarMapFiltersType/SidebarMapFiltersField';\n\n// Store\nimport { $toolSelected, setToolSelected } from '../../store/slices/admin2ToolsSlice';\nimport { $adminSelected } from '../../store/slices/sidebarMapFiltersSlice';\n\n// Configs\nimport { ADMIN__5X5km, ADMIN__Admin2 } from '../../configs/map.configs';\nimport { TOOLS_OPTIONS_OBJECT, TOOLS_ICON_TITLE_PLACEHOLDER } from '../../configs/tools.configs';\n\n// Styles\nimport './Admin2Tools.scss';\n\nfunction Admin2Tools() {\n const toolSelected = useSelector($toolSelected);\n const adminSelected = useSelector($adminSelected);\n const dispatch = useDispatch();\n\n function handleToolSelected(toolSelected: string) {\n dispatch(setToolSelected(toolSelected));\n }\n\n return (\n
\n
\n
\n \n\n {adminSelected !== ADMIN__5X5km && (\n <>\n \n \n \n )}\n\n {TOOLS_OPTIONS_OBJECT.chart.label === toolSelected && adminSelected === ADMIN__Admin2 && (\n \n )}\n\n {/**/}\n
\n
\n
\n );\n}\n\nexport default Admin2Tools;\n","import * as React from 'react';\n\nconst DownloadIcon = ({ color = '#FD7548' }) => (\n \n \n \n \n \n \n);\nexport default DownloadIcon;\n","export type IndicatorType = {\n label: string;\n value: string;\n model_name: string;\n type?: string;\n};\n\nexport const INDICATOR_TYPE_WASH: string = 'WASH';\nexport const NO_IMPROVED_WATER_PREMISES_FIELD_VALUE_BACKUP: string = 'WS_SRCE_P_IMP';\nexport const NO_IMPROVED_WATER_PREMISES_FIELD_VALUE: string = 'WS_SRCE_P_IOP';\n\nexport const INDICATORS: IndicatorType[] = [\n // {\n // label: 'Children stunted',\n // value: 'CN_NUTS_C_HA2',\n // model_name: 'stunted_test',\n // },\n // {\n // label: 'Children with any anemia',\n // value: 'CN_ANMC_C_ANY',\n // model_name: 'any_anemia_ch',\n // },\n // {\n // label: 'DPT 3 vaccination received',\n // value: 'CH_VACS_C_DP3',\n // model_name: 'vaccinedpt3_test',\n // },\n // {\n // label: 'Received all 8 basic vaccinations',\n // value: 'CH_VACS_C_BAS',\n // model_name: 'vaccineall_test',\n // },\n // {\n // label: 'Treatment of diarrhea: Continued feeding and ORT',\n // value: 'CH_DIAT_C_CFO',\n // model_name: 'ort_fdg_treat',\n // },\n // {\n // label: 'Unmet need for family planning',\n // value: 'FP_NADM_W_UNT',\n // model_name: 'unmet_need',\n // },\n // {\n // label: 'Place of delivery: Health facility',\n // value: 'RH_DELP_C_DHF',\n // model_name: 'hf_delivery',\n // },\n // {\n // label: 'Antenatal visits for pregnancy: 4+ visits',\n // value: 'RH_ANCN_W_N4P',\n // model_name: 'anc_visit_test',\n // },\n // {\n // label: 'Women with secondary or higher education',\n // value: 'ED_EDUC_W_SEH',\n // model_name: 'women_literate',\n // },\n // {\n // label: 'Married women currently using any method of contraception',\n // value: 'FP_CUSM_W_ANY',\n // model_name: 'modern_cpr',\n // },\n // {\n // label: 'Persons with access to an insecticide-treated mosquito net (ITN)',\n // value: 'ML_ITNA_P_ACC',\n // model_name: 'itn_test',\n // },\n {\n label: 'Population without basic water service',\n value: 'WS_SRCE_P_BAS',\n model_name: 'basic_water',\n type: INDICATOR_TYPE_WASH,\n },\n {\n label: 'Population using open defecation',\n value: 'WS_TLET_P_NFC',\n model_name: 'open_defecation',\n type: INDICATOR_TYPE_WASH,\n },\n {\n label: 'Population without basic sanitation service',\n value: 'WS_TLET_P_BAS',\n model_name: 'basic_sanitation',\n type: INDICATOR_TYPE_WASH,\n },\n // TODO: 2:42 PM - ok, we will fix it next time we make a change to the app: 'WS_SRCE_P_IMP' => 'WS_SRCE_P_IOP'\n // TODO: This is a temporary fix to handle the fact that the indicator value is not the same as the field name in the GIS REST API\n {\n label: 'Population without improved water source on the premises',\n value: NO_IMPROVED_WATER_PREMISES_FIELD_VALUE_BACKUP,\n model_name: 'no_improved_water_premises',\n type: INDICATOR_TYPE_WASH,\n },\n // {\n // label: 'Physical or sexual or emotional violence committed by husband/partner in last 12 months',\n // value: 'DV_SPV1_W_ANY',\n // model_name: 'spousal_viol',\n // },\n // {\n // label: 'Discriminatory attitudes towards people living with HIV',\n // value: 'HA_DATT_W_DIS',\n // model_name: 'hiv_discrimination',\n // },\n // {\n // label: 'Children under 5 with fever in the last two weeks',\n // value: 'ML_FEVR_C_FEV',\n // model_name: 'fever_test',\n // },\n // {\n // label: 'Children wasted',\n // value: 'CN_NUTS_C_WH',\n // model_name: 'wasted_tes',\n // },\n];\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\n\n// Store\nimport { RootState } from '../store';\n\n// Configs\nimport { INDICATORS, IndicatorType } from '../../configs/indicators.config';\nimport { SurveySelectedType } from '../../configs/types';\n\nexport type LevelSelectedType = {\n level: string;\n admin1RegionID?: string;\n};\n\ninterface modelSurfaceState {\n allSurveys: any;\n surveyList: any;\n surveySelected: SurveySelectedType | null;\n levelList: any;\n levelSelected: LevelSelectedType;\n indicatorsObject: any;\n indicatorSelected: IndicatorType;\n admin2FeaturesData: any;\n admin2FeaturesIndicatorSelectedData: any;\n}\n\nexport const LEVEL_ALL: LevelSelectedType = { level: 'ALL' };\n\nconst initialState: modelSurfaceState = {\n allSurveys: null,\n surveyList: null,\n surveySelected: null,\n levelList: null,\n levelSelected: LEVEL_ALL,\n indicatorsObject: {},\n indicatorSelected: INDICATORS[0],\n admin2FeaturesData: {},\n admin2FeaturesIndicatorSelectedData: [],\n};\n\nexport const admin2EstimatesSlice = createSlice({\n name: 'admin2EstimatesSlice',\n initialState,\n reducers: {\n setAllSurveys: (state, action: PayloadAction) => {\n state.allSurveys = action.payload;\n },\n setSurveyList: (state, action: PayloadAction) => {\n state.surveyList = action.payload;\n },\n setSurveySelected: (state, action: PayloadAction) => {\n state.surveySelected = action.payload;\n },\n setLevelList: (state, action: PayloadAction) => {\n state.levelList = [LEVEL_ALL, ...action.payload];\n },\n setLevelSelected: (state, action: PayloadAction) => {\n state.levelSelected = action.payload;\n },\n setIndicatorsObject: (state, action: PayloadAction) => {\n state.indicatorsObject = action.payload;\n },\n setIndicatorSelected: (state, action: PayloadAction) => {\n state.indicatorSelected = action.payload;\n },\n setAdmin2FeaturesData: (state, action: PayloadAction) => {\n state.admin2FeaturesData = {\n ...state.admin2FeaturesData,\n ...action.payload,\n };\n },\n setAdmin2FeaturesIndicatorSelectedData: (state, action: PayloadAction<[]>) => {\n state.admin2FeaturesIndicatorSelectedData = action.payload;\n },\n },\n});\n\nexport const {\n setAllSurveys,\n setSurveyList,\n setSurveySelected,\n setLevelList,\n setLevelSelected,\n setIndicatorsObject,\n setIndicatorSelected,\n setAdmin2FeaturesData,\n setAdmin2FeaturesIndicatorSelectedData,\n} = admin2EstimatesSlice.actions;\n\nexport const $allSurveys = (state: RootState) => state.admin2EstimatesSlice.allSurveys;\nexport const $surveyList = (state: RootState) => state.admin2EstimatesSlice.surveyList;\nexport const $surveySelected = (state: RootState) => state.admin2EstimatesSlice.surveySelected;\nexport const $levelList = (state: RootState) => state.admin2EstimatesSlice.levelList;\nexport const $levelSelected = (state: RootState) => state.admin2EstimatesSlice.levelSelected;\nexport const $indicatorsObject = (state: RootState) => state.admin2EstimatesSlice.indicatorsObject;\nexport const $indicatorSelected = (state: RootState) => state.admin2EstimatesSlice.indicatorSelected;\nexport const $admin2FeaturesData = (state: RootState) => state.admin2EstimatesSlice.admin2FeaturesData;\nexport const $admin2FeaturesIndicatorSelectedData = (state: RootState) =>\n state.admin2EstimatesSlice.admin2FeaturesIndicatorSelectedData;\n\nexport default admin2EstimatesSlice.reducer;\n","import React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\n// Components\nimport DownloadIcon from '../DownloadIcon';\n\n// Store\nimport {\n $levelList,\n $levelSelected,\n $surveyList,\n $surveySelected,\n LEVEL_ALL,\n LevelSelectedType,\n setIndicatorSelected,\n setLevelSelected,\n setSurveySelected,\n} from '../../store/slices/admin2EstimatesSlice';\nimport { $toolSelected } from '../../store/slices/admin2ToolsSlice';\n\n//Configs\nimport { INDICATORS } from '../../configs/indicators.config';\nimport { TOOLS_OPTIONS_OBJECT } from '../../configs/tools.configs';\n\n// Styles\nimport './Admin2Filters.scss';\n\nfunction Admin2Filters() {\n const dispatch = useDispatch();\n const surveyList = useSelector($surveyList);\n const surveySelected = useSelector($surveySelected);\n const levelList = useSelector($levelList);\n const levelSelected = useSelector($levelSelected);\n const toolSelected = useSelector($toolSelected);\n\n const handleSurveyChange = (event: any, child: any) => {\n const survey = child?.props['data-survey'];\n dispatch(setSurveySelected(survey));\n dispatch(setLevelSelected(LEVEL_ALL));\n };\n\n const handleLevelChange = (event: any, element: any) => {\n const data = element.props['data-tag'];\n dispatch(setLevelSelected(data));\n };\n\n const handleIndicatorChange = (event: any, child: any) => {\n const indicator = child?.props['data-indicator'];\n dispatch(setIndicatorSelected(indicator));\n };\n\n return (\n
\n
\n
\n

Select a Survey

\n
\n \n Survey\n {surveyList && (\n \n {surveyList.map((survey: any, index: number) => {\n const { value } = survey;\n\n return (\n \n {value}\n \n );\n })}\n \n )}\n \n
\n\n
\n
\n

Select a Level

\n
\n \n Level\n {levelList && (\n \n {levelList.map((levelItem: LevelSelectedType, index: number) => {\n const { level } = levelItem;\n\n return (\n \n {level}\n \n );\n })}\n \n )}\n \n
\n\n
\n
\n

Select an Indicator

\n
\n \n Indicator\n \n {INDICATORS.map((indicator: any) => {\n const { label, value } = indicator;\n\n return (\n \n {label}\n \n );\n })}\n \n \n
\n\n \n
\n );\n}\n\nexport default Admin2Filters;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","var baseOrderBy = require('./_baseOrderBy'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\nfunction orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n}\n\nmodule.exports = orderBy;\n","import { createContext, useContext, useMemo, useEffect, useLayoutEffect as useLayoutEffect$1, useRef, useState, useCallback, memo, useId, forwardRef, useImperativeHandle } from 'react';\nimport { flushSync } from 'react-dom';\nimport clsx from 'clsx';\nimport { jsx, jsxs, Fragment } from 'react/jsx-runtime';\n\nfunction getColSpan(column, lastFrozenColumnIndex, args) {\n const colSpan = typeof column.colSpan === 'function' ? column.colSpan(args) : 1;\n if (Number.isInteger(colSpan) && colSpan > 1 && (!column.frozen || column.idx + colSpan - 1 <= lastFrozenColumnIndex)) {\n return colSpan;\n }\n return undefined;\n}\n\nfunction stopPropagation(event) {\n event.stopPropagation();\n}\nfunction scrollIntoView(element) {\n element?.scrollIntoView({\n inline: 'nearest',\n block: 'nearest'\n });\n}\n\nfunction createCellEvent(event) {\n let defaultPrevented = false;\n const cellEvent = {\n ...event,\n preventGridDefault() {\n defaultPrevented = true;\n },\n isGridDefaultPrevented() {\n return defaultPrevented;\n }\n };\n Object.setPrototypeOf(cellEvent, Object.getPrototypeOf(event));\n return cellEvent;\n}\n\nconst nonInputKeys = new Set(['Unidentified', 'Alt', 'AltGraph', 'CapsLock', 'Control', 'Fn', 'FnLock', 'Meta', 'NumLock', 'ScrollLock', 'Shift', 'Tab', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'End', 'Home', 'PageDown', 'PageUp', 'Insert', 'ContextMenu', 'Escape', 'Pause', 'Play', 'PrintScreen', 'F1', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12']);\nfunction isCtrlKeyHeldDown(e) {\n return (e.ctrlKey || e.metaKey) && e.key !== 'Control';\n}\nfunction isDefaultCellInput(event) {\n const vKey = 86;\n if (isCtrlKeyHeldDown(event) && event.keyCode !== vKey) return false;\n return !nonInputKeys.has(event.key);\n}\nfunction onEditorNavigation({\n key,\n target\n}) {\n if (key === 'Tab' && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement)) {\n return target.closest('.rdg-editor-container')?.querySelectorAll('input, textarea, select').length === 1;\n }\n return false;\n}\n\nconst measuringCellClassname = \"mlln6zg7-0-0-beta-42\";\nfunction renderMeasuringCells(viewportColumns) {\n return viewportColumns.map(({\n key,\n idx,\n minWidth,\n maxWidth\n }) => /*#__PURE__*/jsx(\"div\", {\n className: measuringCellClassname,\n style: {\n gridColumnStart: idx + 1,\n minWidth,\n maxWidth\n },\n \"data-measuring-cell-key\": key\n }, key));\n}\n\nfunction isSelectedCellEditable({\n selectedPosition,\n columns,\n rows\n}) {\n const column = columns[selectedPosition.idx];\n const row = rows[selectedPosition.rowIdx];\n return isCellEditableUtil(column, row);\n}\nfunction isCellEditableUtil(column, row) {\n return column.renderEditCell != null && (typeof column.editable === 'function' ? column.editable(row) : column.editable) !== false;\n}\nfunction getSelectedCellColSpan({\n rows,\n topSummaryRows,\n bottomSummaryRows,\n rowIdx,\n mainHeaderRowIdx,\n lastFrozenColumnIndex,\n column\n}) {\n const topSummaryRowsCount = topSummaryRows?.length ?? 0;\n if (rowIdx === mainHeaderRowIdx) {\n return getColSpan(column, lastFrozenColumnIndex, {\n type: 'HEADER'\n });\n }\n if (topSummaryRows && rowIdx > mainHeaderRowIdx && rowIdx <= topSummaryRowsCount + mainHeaderRowIdx) {\n return getColSpan(column, lastFrozenColumnIndex, {\n type: 'SUMMARY',\n row: topSummaryRows[rowIdx + topSummaryRowsCount]\n });\n }\n if (rowIdx >= 0 && rowIdx < rows.length) {\n const row = rows[rowIdx];\n return getColSpan(column, lastFrozenColumnIndex, {\n type: 'ROW',\n row\n });\n }\n if (bottomSummaryRows) {\n return getColSpan(column, lastFrozenColumnIndex, {\n type: 'SUMMARY',\n row: bottomSummaryRows[rowIdx - rows.length]\n });\n }\n return undefined;\n}\nfunction getNextSelectedCellPosition({\n moveUp,\n moveNext,\n cellNavigationMode,\n columns,\n colSpanColumns,\n rows,\n topSummaryRows,\n bottomSummaryRows,\n minRowIdx,\n mainHeaderRowIdx,\n maxRowIdx,\n currentPosition: {\n idx: currentIdx,\n rowIdx: currentRowIdx\n },\n nextPosition,\n lastFrozenColumnIndex,\n isCellWithinBounds\n}) {\n let {\n idx: nextIdx,\n rowIdx: nextRowIdx\n } = nextPosition;\n const columnsCount = columns.length;\n const setColSpan = moveNext => {\n for (const column of colSpanColumns) {\n const colIdx = column.idx;\n if (colIdx > nextIdx) break;\n const colSpan = getSelectedCellColSpan({\n rows,\n topSummaryRows,\n bottomSummaryRows,\n rowIdx: nextRowIdx,\n mainHeaderRowIdx,\n lastFrozenColumnIndex,\n column\n });\n if (colSpan && nextIdx > colIdx && nextIdx < colSpan + colIdx) {\n nextIdx = colIdx + (moveNext ? colSpan : 0);\n break;\n }\n }\n };\n const getParentRowIdx = parent => {\n return parent.level + mainHeaderRowIdx;\n };\n const setHeaderGroupColAndRowSpan = () => {\n if (moveNext) {\n const nextColumn = columns[nextIdx];\n let parent = nextColumn.parent;\n while (parent !== undefined) {\n const parentRowIdx = getParentRowIdx(parent);\n if (nextRowIdx === parentRowIdx) {\n nextIdx = parent.idx + parent.colSpan;\n break;\n }\n parent = parent.parent;\n }\n } else if (moveUp) {\n const nextColumn = columns[nextIdx];\n let parent = nextColumn.parent;\n let found = false;\n while (parent !== undefined) {\n const parentRowIdx = getParentRowIdx(parent);\n if (nextRowIdx >= parentRowIdx) {\n nextIdx = parent.idx;\n nextRowIdx = parentRowIdx;\n found = true;\n break;\n }\n parent = parent.parent;\n }\n if (!found) {\n nextIdx = currentIdx;\n nextRowIdx = currentRowIdx;\n }\n }\n };\n if (isCellWithinBounds(nextPosition)) {\n setColSpan(moveNext);\n if (nextRowIdx < mainHeaderRowIdx) {\n setHeaderGroupColAndRowSpan();\n }\n }\n if (cellNavigationMode === 'CHANGE_ROW') {\n const isAfterLastColumn = nextIdx === columnsCount;\n const isBeforeFirstColumn = nextIdx === -1;\n if (isAfterLastColumn) {\n const isLastRow = nextRowIdx === maxRowIdx;\n if (!isLastRow) {\n nextIdx = 0;\n nextRowIdx += 1;\n }\n } else if (isBeforeFirstColumn) {\n const isFirstRow = nextRowIdx === minRowIdx;\n if (!isFirstRow) {\n nextRowIdx -= 1;\n nextIdx = columnsCount - 1;\n }\n setColSpan(false);\n }\n }\n if (nextRowIdx < mainHeaderRowIdx) {\n const nextColumn = columns[nextIdx];\n let parent = nextColumn.parent;\n const nextParentRowIdx = nextRowIdx;\n nextRowIdx = mainHeaderRowIdx;\n while (parent !== undefined) {\n const parentRowIdx = getParentRowIdx(parent);\n if (parentRowIdx >= nextParentRowIdx) {\n nextRowIdx = parentRowIdx;\n nextIdx = parent.idx;\n }\n parent = parent.parent;\n }\n }\n return {\n idx: nextIdx,\n rowIdx: nextRowIdx\n };\n}\nfunction canExitGrid({\n maxColIdx,\n minRowIdx,\n maxRowIdx,\n selectedPosition: {\n rowIdx,\n idx\n },\n shiftKey\n}) {\n const atLastCellInRow = idx === maxColIdx;\n const atFirstCellInRow = idx === 0;\n const atLastRow = rowIdx === maxRowIdx;\n const atFirstRow = rowIdx === minRowIdx;\n return shiftKey ? atFirstCellInRow && atFirstRow : atLastCellInRow && atLastRow;\n}\n\nconst cell = \"cj343x07-0-0-beta-42\";\nconst cellClassname = `rdg-cell ${cell}`;\nconst cellFrozen = \"csofj7r7-0-0-beta-42\";\nconst cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;\nconst cellFrozenLast = \"ch2wcw87-0-0-beta-42\";\nconst cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;\n\nfunction getRowStyle(rowIdx, height) {\n if (height !== undefined) {\n return {\n '--rdg-grid-row-start': rowIdx,\n '--rdg-row-height': `${height}px`\n };\n }\n return {\n '--rdg-grid-row-start': rowIdx\n };\n}\nfunction getHeaderCellStyle(column, rowIdx, rowSpan) {\n const gridRowEnd = rowIdx + 1;\n const paddingBlockStart = `calc(${rowSpan - 1} * var(--rdg-header-row-height))`;\n if (column.parent === undefined) {\n return {\n insetBlockStart: 0,\n gridRowStart: 1,\n gridRowEnd,\n paddingBlockStart\n };\n }\n return {\n insetBlockStart: `calc(${rowIdx - rowSpan} * var(--rdg-header-row-height))`,\n gridRowStart: gridRowEnd - rowSpan,\n gridRowEnd,\n paddingBlockStart\n };\n}\nfunction getCellStyle(column, colSpan = 1) {\n const index = column.idx + 1;\n return {\n gridColumnStart: index,\n gridColumnEnd: index + colSpan,\n insetInlineStart: column.frozen ? `var(--rdg-frozen-left-${column.idx})` : undefined\n };\n}\nfunction getCellClassname(column, ...extraClasses) {\n return clsx(cellClassname, ...extraClasses, column.frozen && cellFrozenClassname, column.isLastFrozenColumn && cellFrozenLastClassname);\n}\n\nconst {\n min,\n max,\n floor,\n sign,\n abs\n} = Math;\nfunction assertIsValidKeyGetter(keyGetter) {\n if (typeof keyGetter !== 'function') {\n throw new Error('Please specify the rowKeyGetter prop to use selection');\n }\n}\nfunction clampColumnWidth(width, {\n minWidth,\n maxWidth\n}) {\n width = max(width, minWidth);\n if (typeof maxWidth === 'number' && maxWidth >= minWidth) {\n return min(width, maxWidth);\n }\n return width;\n}\nfunction getHeaderCellRowSpan(column, rowIdx) {\n return column.parent === undefined ? rowIdx : column.level - column.parent.level;\n}\n\nconst checkboxLabel = \"c1bn88vv7-0-0-beta-42\";\nconst checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;\nconst checkboxInput = \"c1qt073l7-0-0-beta-42\";\nconst checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;\nconst checkbox = \"cf71kmq7-0-0-beta-42\";\nconst checkboxClassname = `rdg-checkbox ${checkbox}`;\nconst checkboxLabelDisabled = \"c1lwve4p7-0-0-beta-42\";\nconst checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;\nfunction renderCheckbox({\n onChange,\n ...props\n}) {\n function handleChange(e) {\n onChange(e.target.checked, e.nativeEvent.shiftKey);\n }\n return /*#__PURE__*/jsxs(\"label\", {\n className: clsx(checkboxLabelClassname, props.disabled && checkboxLabelDisabledClassname),\n children: [/*#__PURE__*/jsx(\"input\", {\n type: \"checkbox\",\n ...props,\n className: checkboxInputClassname,\n onChange: handleChange\n }), /*#__PURE__*/jsx(\"div\", {\n className: checkboxClassname\n })]\n });\n}\n\nconst groupCellContent = \"g1s9ylgp7-0-0-beta-42\";\nconst groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;\nconst caret = \"cz54e4y7-0-0-beta-42\";\nconst caretClassname = `rdg-caret ${caret}`;\nfunction renderToggleGroup(props) {\n return /*#__PURE__*/jsx(ToggleGroup, {\n ...props\n });\n}\nfunction ToggleGroup({\n groupKey,\n isExpanded,\n tabIndex,\n toggleGroup\n}) {\n function handleKeyDown({\n key\n }) {\n if (key === 'Enter') {\n toggleGroup();\n }\n }\n const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';\n return /*#__PURE__*/jsxs(\"span\", {\n className: groupCellContentClassname,\n tabIndex: tabIndex,\n onKeyDown: handleKeyDown,\n children: [groupKey, /*#__PURE__*/jsx(\"svg\", {\n viewBox: \"0 0 14 8\",\n width: \"14\",\n height: \"8\",\n className: caretClassname,\n \"aria-hidden\": true,\n children: /*#__PURE__*/jsx(\"path\", {\n d: d\n })\n })]\n });\n}\n\nfunction renderValue(props) {\n try {\n return props.row[props.column.key];\n } catch {\n return null;\n }\n}\n\nconst DataGridDefaultRenderersContext = /*#__PURE__*/createContext(undefined);\nconst DataGridDefaultRenderersProvider = DataGridDefaultRenderersContext.Provider;\nfunction useDefaultRenderers() {\n return useContext(DataGridDefaultRenderersContext);\n}\n\nfunction SelectCellFormatter({\n value,\n tabIndex,\n disabled,\n onChange,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy\n}) {\n const renderCheckbox = useDefaultRenderers().renderCheckbox;\n return renderCheckbox({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n tabIndex,\n disabled,\n checked: value,\n onChange\n });\n}\n\nconst RowSelectionContext = /*#__PURE__*/createContext(undefined);\nconst RowSelectionProvider = RowSelectionContext.Provider;\nconst RowSelectionChangeContext = /*#__PURE__*/createContext(undefined);\nconst RowSelectionChangeProvider = RowSelectionChangeContext.Provider;\nfunction useRowSelection() {\n const rowSelectionContext = useContext(RowSelectionContext);\n const rowSelectionChangeContext = useContext(RowSelectionChangeContext);\n if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) {\n throw new Error('useRowSelection must be used within DataGrid cells');\n }\n return [rowSelectionContext, rowSelectionChangeContext];\n}\n\nconst SELECT_COLUMN_KEY = 'select-row';\nfunction HeaderRenderer(props) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n return /*#__PURE__*/jsx(SelectCellFormatter, {\n \"aria-label\": \"Select All\",\n tabIndex: props.tabIndex,\n value: isRowSelected,\n onChange: checked => {\n onRowSelectionChange({\n type: 'HEADER',\n checked\n });\n }\n });\n}\nfunction SelectFormatter(props) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n return /*#__PURE__*/jsx(SelectCellFormatter, {\n \"aria-label\": \"Select\",\n tabIndex: props.tabIndex,\n value: isRowSelected,\n onChange: (checked, isShiftClick) => {\n onRowSelectionChange({\n type: 'ROW',\n row: props.row,\n checked,\n isShiftClick\n });\n }\n });\n}\nfunction SelectGroupFormatter(props) {\n const [isRowSelected, onRowSelectionChange] = useRowSelection();\n return /*#__PURE__*/jsx(SelectCellFormatter, {\n \"aria-label\": \"Select Group\",\n tabIndex: props.tabIndex,\n value: isRowSelected,\n onChange: checked => {\n onRowSelectionChange({\n type: 'ROW',\n row: props.row,\n checked,\n isShiftClick: false\n });\n }\n });\n}\nconst SelectColumn = {\n key: SELECT_COLUMN_KEY,\n name: '',\n width: 35,\n minWidth: 35,\n maxWidth: 35,\n resizable: false,\n sortable: false,\n frozen: true,\n renderHeaderCell(props) {\n return /*#__PURE__*/jsx(HeaderRenderer, {\n ...props\n });\n },\n renderCell(props) {\n return /*#__PURE__*/jsx(SelectFormatter, {\n ...props\n });\n },\n renderGroupCell(props) {\n return /*#__PURE__*/jsx(SelectGroupFormatter, {\n ...props\n });\n }\n};\n\nconst DEFAULT_COLUMN_WIDTH = 'auto';\nconst DEFAULT_COLUMN_MIN_WIDTH = 50;\nfunction useCalculatedColumns({\n rawColumns,\n defaultColumnOptions,\n getColumnWidth,\n viewportWidth,\n scrollLeft,\n enableVirtualization\n}) {\n const defaultWidth = defaultColumnOptions?.width ?? DEFAULT_COLUMN_WIDTH;\n const defaultMinWidth = defaultColumnOptions?.minWidth ?? DEFAULT_COLUMN_MIN_WIDTH;\n const defaultMaxWidth = defaultColumnOptions?.maxWidth ?? undefined;\n const defaultCellRenderer = defaultColumnOptions?.renderCell ?? renderValue;\n const defaultSortable = defaultColumnOptions?.sortable ?? false;\n const defaultResizable = defaultColumnOptions?.resizable ?? false;\n const defaultDraggable = defaultColumnOptions?.draggable ?? false;\n const {\n columns,\n colSpanColumns,\n lastFrozenColumnIndex,\n headerRowsCount\n } = useMemo(() => {\n let lastFrozenColumnIndex = -1;\n let headerRowsCount = 1;\n const columns = [];\n collectColumns(rawColumns, 1);\n function collectColumns(rawColumns, level, parent) {\n for (const rawColumn of rawColumns) {\n if ('children' in rawColumn) {\n const calculatedColumnParent = {\n name: rawColumn.name,\n parent,\n idx: -1,\n colSpan: 0,\n level: 0,\n headerCellClass: rawColumn.headerCellClass\n };\n collectColumns(rawColumn.children, level + 1, calculatedColumnParent);\n continue;\n }\n const frozen = rawColumn.frozen ?? false;\n const column = {\n ...rawColumn,\n parent,\n idx: 0,\n level: 0,\n frozen,\n isLastFrozenColumn: false,\n width: rawColumn.width ?? defaultWidth,\n minWidth: rawColumn.minWidth ?? defaultMinWidth,\n maxWidth: rawColumn.maxWidth ?? defaultMaxWidth,\n sortable: rawColumn.sortable ?? defaultSortable,\n resizable: rawColumn.resizable ?? defaultResizable,\n draggable: rawColumn.draggable ?? defaultDraggable,\n renderCell: rawColumn.renderCell ?? defaultCellRenderer\n };\n columns.push(column);\n if (frozen) {\n lastFrozenColumnIndex++;\n }\n if (level > headerRowsCount) {\n headerRowsCount = level;\n }\n }\n }\n columns.sort(({\n key: aKey,\n frozen: frozenA\n }, {\n key: bKey,\n frozen: frozenB\n }) => {\n if (aKey === SELECT_COLUMN_KEY) return -1;\n if (bKey === SELECT_COLUMN_KEY) return 1;\n if (frozenA) {\n if (frozenB) return 0;\n return -1;\n }\n if (frozenB) return 1;\n return 0;\n });\n const colSpanColumns = [];\n columns.forEach((column, idx) => {\n column.idx = idx;\n updateColumnParent(column, idx, 0);\n if (column.colSpan != null) {\n colSpanColumns.push(column);\n }\n });\n if (lastFrozenColumnIndex !== -1) {\n columns[lastFrozenColumnIndex].isLastFrozenColumn = true;\n }\n return {\n columns,\n colSpanColumns,\n lastFrozenColumnIndex,\n headerRowsCount\n };\n }, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultCellRenderer, defaultResizable, defaultSortable, defaultDraggable]);\n const {\n templateColumns,\n layoutCssVars,\n totalFrozenColumnWidth,\n columnMetrics\n } = useMemo(() => {\n const columnMetrics = new Map();\n let left = 0;\n let totalFrozenColumnWidth = 0;\n const templateColumns = [];\n for (const column of columns) {\n let width = getColumnWidth(column);\n if (typeof width === 'number') {\n width = clampColumnWidth(width, column);\n } else {\n width = column.minWidth;\n }\n templateColumns.push(`${width}px`);\n columnMetrics.set(column, {\n width,\n left\n });\n left += width;\n }\n if (lastFrozenColumnIndex !== -1) {\n const columnMetric = columnMetrics.get(columns[lastFrozenColumnIndex]);\n totalFrozenColumnWidth = columnMetric.left + columnMetric.width;\n }\n const layoutCssVars = {};\n for (let i = 0; i <= lastFrozenColumnIndex; i++) {\n const column = columns[i];\n layoutCssVars[`--rdg-frozen-left-${column.idx}`] = `${columnMetrics.get(column).left}px`;\n }\n return {\n templateColumns,\n layoutCssVars,\n totalFrozenColumnWidth,\n columnMetrics\n };\n }, [getColumnWidth, columns, lastFrozenColumnIndex]);\n const [colOverscanStartIdx, colOverscanEndIdx] = useMemo(() => {\n if (!enableVirtualization) {\n return [0, columns.length - 1];\n }\n const viewportLeft = scrollLeft + totalFrozenColumnWidth;\n const viewportRight = scrollLeft + viewportWidth;\n const lastColIdx = columns.length - 1;\n const firstUnfrozenColumnIdx = min(lastFrozenColumnIndex + 1, lastColIdx);\n if (viewportLeft >= viewportRight) {\n return [firstUnfrozenColumnIdx, firstUnfrozenColumnIdx];\n }\n let colVisibleStartIdx = firstUnfrozenColumnIdx;\n while (colVisibleStartIdx < lastColIdx) {\n const {\n left,\n width\n } = columnMetrics.get(columns[colVisibleStartIdx]);\n if (left + width > viewportLeft) {\n break;\n }\n colVisibleStartIdx++;\n }\n let colVisibleEndIdx = colVisibleStartIdx;\n while (colVisibleEndIdx < lastColIdx) {\n const {\n left,\n width\n } = columnMetrics.get(columns[colVisibleEndIdx]);\n if (left + width >= viewportRight) {\n break;\n }\n colVisibleEndIdx++;\n }\n const colOverscanStartIdx = max(firstUnfrozenColumnIdx, colVisibleStartIdx - 1);\n const colOverscanEndIdx = min(lastColIdx, colVisibleEndIdx + 1);\n return [colOverscanStartIdx, colOverscanEndIdx];\n }, [columnMetrics, columns, lastFrozenColumnIndex, scrollLeft, totalFrozenColumnWidth, viewportWidth, enableVirtualization]);\n return {\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n templateColumns,\n layoutCssVars,\n headerRowsCount,\n lastFrozenColumnIndex,\n totalFrozenColumnWidth\n };\n}\nfunction updateColumnParent(column, index, level) {\n if (level < column.level) {\n column.level = level;\n }\n if (column.parent !== undefined) {\n const {\n parent\n } = column;\n if (parent.idx === -1) {\n parent.idx = index;\n }\n parent.colSpan += 1;\n updateColumnParent(parent, index, level - 1);\n }\n}\n\nconst useLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect$1;\n\nfunction useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize) {\n const prevGridWidthRef = useRef(gridWidth);\n const columnsCanFlex = columns.length === viewportColumns.length;\n const ignorePreviouslyMeasuredColumns = columnsCanFlex && gridWidth !== prevGridWidthRef.current;\n const newTemplateColumns = [...templateColumns];\n const columnsToMeasure = [];\n for (const {\n key,\n idx,\n width\n } of viewportColumns) {\n if (typeof width === 'string' && (ignorePreviouslyMeasuredColumns || !measuredColumnWidths.has(key)) && !resizedColumnWidths.has(key)) {\n newTemplateColumns[idx] = width;\n columnsToMeasure.push(key);\n }\n }\n const gridTemplateColumns = newTemplateColumns.join(' ');\n useLayoutEffect(() => {\n prevGridWidthRef.current = gridWidth;\n updateMeasuredWidths(columnsToMeasure);\n });\n function updateMeasuredWidths(columnsToMeasure) {\n if (columnsToMeasure.length === 0) return;\n setMeasuredColumnWidths(measuredColumnWidths => {\n const newMeasuredColumnWidths = new Map(measuredColumnWidths);\n let hasChanges = false;\n for (const key of columnsToMeasure) {\n const measuredWidth = measureColumnWidth(gridRef, key);\n hasChanges ||= measuredWidth !== measuredColumnWidths.get(key);\n if (measuredWidth === undefined) {\n newMeasuredColumnWidths.delete(key);\n } else {\n newMeasuredColumnWidths.set(key, measuredWidth);\n }\n }\n return hasChanges ? newMeasuredColumnWidths : measuredColumnWidths;\n });\n }\n function handleColumnResize(column, nextWidth) {\n const {\n key: resizingKey\n } = column;\n const newTemplateColumns = [...templateColumns];\n const columnsToMeasure = [];\n for (const {\n key,\n idx,\n width\n } of viewportColumns) {\n if (resizingKey === key) {\n const width = typeof nextWidth === 'number' ? `${nextWidth}px` : nextWidth;\n newTemplateColumns[idx] = width;\n } else if (columnsCanFlex && typeof width === 'string' && !resizedColumnWidths.has(key)) {\n newTemplateColumns[idx] = width;\n columnsToMeasure.push(key);\n }\n }\n gridRef.current.style.gridTemplateColumns = newTemplateColumns.join(' ');\n const measuredWidth = typeof nextWidth === 'number' ? nextWidth : measureColumnWidth(gridRef, resizingKey);\n flushSync(() => {\n setResizedColumnWidths(resizedColumnWidths => {\n const newResizedColumnWidths = new Map(resizedColumnWidths);\n newResizedColumnWidths.set(resizingKey, measuredWidth);\n return newResizedColumnWidths;\n });\n updateMeasuredWidths(columnsToMeasure);\n });\n onColumnResize?.(column.idx, measuredWidth);\n }\n return {\n gridTemplateColumns,\n handleColumnResize\n };\n}\nfunction measureColumnWidth(gridRef, key) {\n const selector = `[data-measuring-cell-key=\"${CSS.escape(key)}\"]`;\n const measuringCell = gridRef.current.querySelector(selector);\n return measuringCell?.getBoundingClientRect().width;\n}\n\nfunction useGridDimensions() {\n const gridRef = useRef(null);\n const [inlineSize, setInlineSize] = useState(1);\n const [blockSize, setBlockSize] = useState(1);\n useLayoutEffect(() => {\n const {\n ResizeObserver\n } = window;\n if (ResizeObserver == null) return;\n const {\n clientWidth,\n clientHeight,\n offsetWidth,\n offsetHeight\n } = gridRef.current;\n const {\n width,\n height\n } = gridRef.current.getBoundingClientRect();\n const initialWidth = width - offsetWidth + clientWidth;\n const initialHeight = height - offsetHeight + clientHeight;\n setInlineSize(initialWidth);\n setBlockSize(initialHeight);\n const resizeObserver = new ResizeObserver(entries => {\n const size = entries[0].contentBoxSize[0];\n flushSync(() => {\n setInlineSize(size.inlineSize);\n setBlockSize(size.blockSize);\n });\n });\n resizeObserver.observe(gridRef.current);\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n return [gridRef, inlineSize, blockSize];\n}\n\nfunction useLatestFunc(fn) {\n const ref = useRef(fn);\n useEffect(() => {\n ref.current = fn;\n });\n const callbackFn = useCallback((...args) => {\n ref.current(...args);\n }, []);\n return fn ? callbackFn : fn;\n}\n\nfunction useRovingTabIndex(isSelected) {\n const [isChildFocused, setIsChildFocused] = useState(false);\n if (isChildFocused && !isSelected) {\n setIsChildFocused(false);\n }\n function onFocus(event) {\n if (event.target !== event.currentTarget) {\n setIsChildFocused(true);\n }\n }\n const isFocusable = isSelected && !isChildFocused;\n return {\n tabIndex: isFocusable ? 0 : -1,\n childTabIndex: isSelected ? 0 : -1,\n onFocus: isSelected ? onFocus : undefined\n };\n}\n\nfunction useViewportColumns({\n columns,\n colSpanColumns,\n rows,\n topSummaryRows,\n bottomSummaryRows,\n colOverscanStartIdx,\n colOverscanEndIdx,\n lastFrozenColumnIndex,\n rowOverscanStartIdx,\n rowOverscanEndIdx\n}) {\n const startIdx = useMemo(() => {\n if (colOverscanStartIdx === 0) return 0;\n let startIdx = colOverscanStartIdx;\n const updateStartIdx = (colIdx, colSpan) => {\n if (colSpan !== undefined && colIdx + colSpan > colOverscanStartIdx) {\n startIdx = colIdx;\n return true;\n }\n return false;\n };\n for (const column of colSpanColumns) {\n const colIdx = column.idx;\n if (colIdx >= startIdx) break;\n if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {\n type: 'HEADER'\n }))) {\n break;\n }\n for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {\n const row = rows[rowIdx];\n if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {\n type: 'ROW',\n row\n }))) {\n break;\n }\n }\n if (topSummaryRows != null) {\n for (const row of topSummaryRows) {\n if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {\n type: 'SUMMARY',\n row\n }))) {\n break;\n }\n }\n }\n if (bottomSummaryRows != null) {\n for (const row of bottomSummaryRows) {\n if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {\n type: 'SUMMARY',\n row\n }))) {\n break;\n }\n }\n }\n }\n return startIdx;\n }, [rowOverscanStartIdx, rowOverscanEndIdx, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, lastFrozenColumnIndex, colSpanColumns]);\n return useMemo(() => {\n const viewportColumns = [];\n for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {\n const column = columns[colIdx];\n if (colIdx < startIdx && !column.frozen) continue;\n viewportColumns.push(column);\n }\n return viewportColumns;\n }, [startIdx, colOverscanEndIdx, columns]);\n}\n\nfunction useViewportRows({\n rows,\n rowHeight,\n clientHeight,\n scrollTop,\n enableVirtualization\n}) {\n const {\n totalRowHeight,\n gridTemplateRows,\n getRowTop,\n getRowHeight,\n findRowIdx\n } = useMemo(() => {\n if (typeof rowHeight === 'number') {\n return {\n totalRowHeight: rowHeight * rows.length,\n gridTemplateRows: ` repeat(${rows.length}, ${rowHeight}px)`,\n getRowTop: rowIdx => rowIdx * rowHeight,\n getRowHeight: () => rowHeight,\n findRowIdx: offset => floor(offset / rowHeight)\n };\n }\n let totalRowHeight = 0;\n let gridTemplateRows = ' ';\n const rowPositions = rows.map(row => {\n const currentRowHeight = rowHeight(row);\n const position = {\n top: totalRowHeight,\n height: currentRowHeight\n };\n gridTemplateRows += `${currentRowHeight}px `;\n totalRowHeight += currentRowHeight;\n return position;\n });\n const validateRowIdx = rowIdx => {\n return max(0, min(rows.length - 1, rowIdx));\n };\n return {\n totalRowHeight,\n gridTemplateRows,\n getRowTop: rowIdx => rowPositions[validateRowIdx(rowIdx)].top,\n getRowHeight: rowIdx => rowPositions[validateRowIdx(rowIdx)].height,\n findRowIdx(offset) {\n let start = 0;\n let end = rowPositions.length - 1;\n while (start <= end) {\n const middle = start + floor((end - start) / 2);\n const currentOffset = rowPositions[middle].top;\n if (currentOffset === offset) return middle;\n if (currentOffset < offset) {\n start = middle + 1;\n } else if (currentOffset > offset) {\n end = middle - 1;\n }\n if (start > end) return end;\n }\n return 0;\n }\n };\n }, [rowHeight, rows]);\n let rowOverscanStartIdx = 0;\n let rowOverscanEndIdx = rows.length - 1;\n if (enableVirtualization) {\n const overscanThreshold = 4;\n const rowVisibleStartIdx = findRowIdx(scrollTop);\n const rowVisibleEndIdx = findRowIdx(scrollTop + clientHeight);\n rowOverscanStartIdx = max(0, rowVisibleStartIdx - overscanThreshold);\n rowOverscanEndIdx = min(rows.length - 1, rowVisibleEndIdx + overscanThreshold);\n }\n return {\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n totalRowHeight,\n gridTemplateRows,\n getRowTop,\n getRowHeight,\n findRowIdx\n };\n}\n\nconst cellDragHandle = \"c1w9bbhr7-0-0-beta-42\";\nconst cellDragHandleFrozenClassname = \"c1creorc7-0-0-beta-42\";\nconst cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;\nfunction DragHandle({\n gridRowStart,\n rows,\n column,\n columnWidth,\n maxColIdx,\n isLastRow,\n selectedPosition,\n latestDraggedOverRowIdx,\n isCellEditable,\n onRowsChange,\n onFill,\n onClick,\n setDragging,\n setDraggedOverRowIdx\n}) {\n const {\n idx,\n rowIdx\n } = selectedPosition;\n function handleMouseDown(event) {\n event.preventDefault();\n if (event.buttons !== 1) return;\n setDragging(true);\n window.addEventListener('mouseover', onMouseOver);\n window.addEventListener('mouseup', onMouseUp);\n function onMouseOver(event) {\n if (event.buttons !== 1) onMouseUp();\n }\n function onMouseUp() {\n window.removeEventListener('mouseover', onMouseOver);\n window.removeEventListener('mouseup', onMouseUp);\n setDragging(false);\n handleDragEnd();\n }\n }\n function handleDragEnd() {\n const overRowIdx = latestDraggedOverRowIdx.current;\n if (overRowIdx === undefined) return;\n const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx;\n const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;\n updateRows(startRowIndex, endRowIndex);\n setDraggedOverRowIdx(undefined);\n }\n function handleDoubleClick(event) {\n event.stopPropagation();\n updateRows(rowIdx + 1, rows.length);\n }\n function updateRows(startRowIdx, endRowIdx) {\n const sourceRow = rows[rowIdx];\n const updatedRows = [...rows];\n const indexes = [];\n for (let i = startRowIdx; i < endRowIdx; i++) {\n if (isCellEditable({\n rowIdx: i,\n idx\n })) {\n const updatedRow = onFill({\n columnKey: column.key,\n sourceRow,\n targetRow: rows[i]\n });\n if (updatedRow !== rows[i]) {\n updatedRows[i] = updatedRow;\n indexes.push(i);\n }\n }\n }\n if (indexes.length > 0) {\n onRowsChange?.(updatedRows, {\n indexes,\n column\n });\n }\n }\n function getStyle() {\n const colSpan = column.colSpan?.({\n type: 'ROW',\n row: rows[rowIdx]\n }) ?? 1;\n const {\n insetInlineStart,\n ...style\n } = getCellStyle(column, colSpan);\n const marginEnd = 'calc(var(--rdg-drag-handle-size) * -0.5 + 1px)';\n const isLastColumn = column.idx + colSpan - 1 === maxColIdx;\n return {\n ...style,\n gridRowStart,\n marginInlineEnd: isLastColumn ? undefined : marginEnd,\n marginBlockEnd: isLastRow ? undefined : marginEnd,\n insetInlineStart: insetInlineStart ? `calc(${insetInlineStart} + ${columnWidth}px + var(--rdg-drag-handle-size) * -0.5 - 1px)` : undefined\n };\n }\n return /*#__PURE__*/jsx(\"div\", {\n style: getStyle(),\n className: clsx(cellDragHandleClassname, column.frozen && cellDragHandleFrozenClassname),\n onClick: onClick,\n onMouseDown: handleMouseDown,\n onDoubleClick: handleDoubleClick\n });\n}\n\nconst cellEditing = \"cis5rrm7-0-0-beta-42\";\nfunction EditCell({\n column,\n colSpan,\n row,\n rowIdx,\n onRowChange,\n closeEditor,\n onKeyDown,\n navigate\n}) {\n const frameRequestRef = useRef();\n const commitOnOutsideClick = column.editorOptions?.commitOnOutsideClick !== false;\n const commitOnOutsideMouseDown = useLatestFunc(() => {\n onClose(true, false);\n });\n useEffect(() => {\n if (!commitOnOutsideClick) return;\n function onWindowCaptureMouseDown() {\n frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown);\n }\n addEventListener('mousedown', onWindowCaptureMouseDown, {\n capture: true\n });\n return () => {\n removeEventListener('mousedown', onWindowCaptureMouseDown, {\n capture: true\n });\n cancelFrameRequest();\n };\n }, [commitOnOutsideClick, commitOnOutsideMouseDown]);\n function cancelFrameRequest() {\n cancelAnimationFrame(frameRequestRef.current);\n }\n function handleKeyDown(event) {\n if (onKeyDown) {\n const cellEvent = createCellEvent(event);\n onKeyDown({\n mode: 'EDIT',\n row,\n column,\n rowIdx,\n navigate() {\n navigate(event);\n },\n onClose\n }, cellEvent);\n if (cellEvent.isGridDefaultPrevented()) return;\n }\n if (event.key === 'Escape') {\n onClose();\n } else if (event.key === 'Enter') {\n onClose(true);\n } else if (onEditorNavigation(event)) {\n navigate(event);\n }\n }\n function onClose(commitChanges = false, shouldFocusCell = true) {\n if (commitChanges) {\n onRowChange(row, true, shouldFocusCell);\n } else {\n closeEditor(shouldFocusCell);\n }\n }\n function onEditorRowChange(row, commitChangesAndFocus = false) {\n onRowChange(row, commitChangesAndFocus, commitChangesAndFocus);\n }\n const {\n cellClass\n } = column;\n const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !column.editorOptions?.displayCellContent && cellEditing);\n return /*#__PURE__*/jsx(\"div\", {\n role: \"gridcell\",\n \"aria-colindex\": column.idx + 1,\n \"aria-colspan\": colSpan,\n \"aria-selected\": true,\n className: className,\n style: getCellStyle(column, colSpan),\n onKeyDown: handleKeyDown,\n onMouseDownCapture: cancelFrameRequest,\n children: column.renderEditCell != null && /*#__PURE__*/jsxs(Fragment, {\n children: [column.renderEditCell({\n column,\n row,\n onRowChange: onEditorRowChange,\n onClose\n }), column.editorOptions?.displayCellContent && column.renderCell({\n column,\n row,\n rowIdx,\n isCellEditable: true,\n tabIndex: -1,\n onRowChange: onEditorRowChange\n })]\n })\n });\n}\n\nfunction GroupedColumnHeaderCell({\n column,\n rowIdx,\n isCellSelected,\n selectCell\n}) {\n const {\n tabIndex,\n onFocus\n } = useRovingTabIndex(isCellSelected);\n const {\n colSpan\n } = column;\n const rowSpan = getHeaderCellRowSpan(column, rowIdx);\n const index = column.idx + 1;\n function onClick() {\n selectCell({\n idx: column.idx,\n rowIdx\n });\n }\n return /*#__PURE__*/jsx(\"div\", {\n role: \"columnheader\",\n \"aria-colindex\": index,\n \"aria-colspan\": colSpan,\n \"aria-rowspan\": rowSpan,\n \"aria-selected\": isCellSelected,\n tabIndex: tabIndex,\n className: clsx(cellClassname, column.headerCellClass),\n style: {\n ...getHeaderCellStyle(column, rowIdx, rowSpan),\n gridColumnStart: index,\n gridColumnEnd: index + colSpan\n },\n onFocus: onFocus,\n onClick: onClick,\n children: column.name\n });\n}\n\nconst headerSortCellClassname = \"h44jtk67-0-0-beta-42\";\nconst headerSortName = \"hcgkhxz7-0-0-beta-42\";\nconst headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;\nfunction renderHeaderCell({\n column,\n sortDirection,\n priority\n}) {\n if (!column.sortable) return column.name;\n return /*#__PURE__*/jsx(SortableHeaderCell, {\n sortDirection: sortDirection,\n priority: priority,\n children: column.name\n });\n}\nfunction SortableHeaderCell({\n sortDirection,\n priority,\n children\n}) {\n const renderSortStatus = useDefaultRenderers().renderSortStatus;\n return /*#__PURE__*/jsxs(\"span\", {\n className: headerSortCellClassname,\n children: [/*#__PURE__*/jsx(\"span\", {\n className: headerSortNameClassname,\n children: children\n }), /*#__PURE__*/jsx(\"span\", {\n children: renderSortStatus({\n sortDirection,\n priority\n })\n })]\n });\n}\n\nconst cellSortableClassname = \"c6l2wv17-0-0-beta-42\";\nconst cellResizable = \"c1kqdw7y7-0-0-beta-42\";\nconst cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;\nconst resizeHandleClassname = \"r1y6ywlx7-0-0-beta-42\";\nconst cellDraggableClassname = 'rdg-cell-draggable';\nconst cellDragging = \"c1bezg5o7-0-0-beta-42\";\nconst cellDraggingClassname = `rdg-cell-dragging ${cellDragging}`;\nconst cellOver = \"c1vc96037-0-0-beta-42\";\nconst cellOverClassname = `rdg-cell-drag-over ${cellOver}`;\nfunction HeaderCell({\n column,\n colSpan,\n rowIdx,\n isCellSelected,\n onColumnResize,\n onColumnsReorder,\n sortColumns,\n onSortColumnsChange,\n selectCell,\n shouldFocusGrid,\n direction,\n dragDropKey\n}) {\n const [isDragging, setIsDragging] = useState(false);\n const [isOver, setIsOver] = useState(false);\n const isRtl = direction === 'rtl';\n const rowSpan = getHeaderCellRowSpan(column, rowIdx);\n const {\n tabIndex,\n childTabIndex,\n onFocus\n } = useRovingTabIndex(isCellSelected);\n const sortIndex = sortColumns?.findIndex(sort => sort.columnKey === column.key);\n const sortColumn = sortIndex !== undefined && sortIndex > -1 ? sortColumns[sortIndex] : undefined;\n const sortDirection = sortColumn?.direction;\n const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined;\n const ariaSort = sortDirection && !priority ? sortDirection === 'ASC' ? 'ascending' : 'descending' : undefined;\n const {\n sortable,\n resizable,\n draggable\n } = column;\n const className = getCellClassname(column, column.headerCellClass, sortable && cellSortableClassname, resizable && cellResizableClassname, draggable && cellDraggableClassname, isDragging && cellDraggingClassname, isOver && cellOverClassname);\n const renderHeaderCell$1 = column.renderHeaderCell ?? renderHeaderCell;\n function onPointerDown(event) {\n if (event.pointerType === 'mouse' && event.buttons !== 1) {\n return;\n }\n event.preventDefault();\n const {\n currentTarget,\n pointerId\n } = event;\n const headerCell = currentTarget.parentElement;\n const {\n right,\n left\n } = headerCell.getBoundingClientRect();\n const offset = isRtl ? event.clientX - left : right - event.clientX;\n function onPointerMove(event) {\n const {\n right,\n left\n } = headerCell.getBoundingClientRect();\n const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;\n if (width > 0) {\n onColumnResize(column, clampColumnWidth(width, column));\n }\n }\n function onLostPointerCapture() {\n currentTarget.removeEventListener('pointermove', onPointerMove);\n currentTarget.removeEventListener('lostpointercapture', onLostPointerCapture);\n }\n currentTarget.setPointerCapture(pointerId);\n currentTarget.addEventListener('pointermove', onPointerMove);\n currentTarget.addEventListener('lostpointercapture', onLostPointerCapture);\n }\n function onSort(ctrlClick) {\n if (onSortColumnsChange == null) return;\n const {\n sortDescendingFirst\n } = column;\n if (sortColumn === undefined) {\n const nextSort = {\n columnKey: column.key,\n direction: sortDescendingFirst ? 'DESC' : 'ASC'\n };\n onSortColumnsChange(sortColumns && ctrlClick ? [...sortColumns, nextSort] : [nextSort]);\n } else {\n let nextSortColumn;\n if (sortDescendingFirst === true && sortDirection === 'DESC' || sortDescendingFirst !== true && sortDirection === 'ASC') {\n nextSortColumn = {\n columnKey: column.key,\n direction: sortDirection === 'ASC' ? 'DESC' : 'ASC'\n };\n }\n if (ctrlClick) {\n const nextSortColumns = [...sortColumns];\n if (nextSortColumn) {\n nextSortColumns[sortIndex] = nextSortColumn;\n } else {\n nextSortColumns.splice(sortIndex, 1);\n }\n onSortColumnsChange(nextSortColumns);\n } else {\n onSortColumnsChange(nextSortColumn ? [nextSortColumn] : []);\n }\n }\n }\n function onClick(event) {\n selectCell({\n idx: column.idx,\n rowIdx\n });\n if (sortable) {\n onSort(event.ctrlKey || event.metaKey);\n }\n }\n function onDoubleClick() {\n onColumnResize(column, 'max-content');\n }\n function handleFocus(event) {\n onFocus?.(event);\n if (shouldFocusGrid) {\n selectCell({\n idx: 0,\n rowIdx\n });\n }\n }\n function onKeyDown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n onSort(event.ctrlKey || event.metaKey);\n }\n }\n function onDragStart(event) {\n event.dataTransfer.setData(dragDropKey, column.key);\n event.dataTransfer.dropEffect = 'move';\n setIsDragging(true);\n }\n function onDragEnd() {\n setIsDragging(false);\n }\n function onDragOver(event) {\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n }\n function onDrop(event) {\n setIsOver(false);\n if (event.dataTransfer.types.includes(dragDropKey)) {\n const sourceKey = event.dataTransfer.getData(dragDropKey);\n if (sourceKey !== column.key) {\n event.preventDefault();\n onColumnsReorder?.(sourceKey, column.key);\n }\n }\n }\n function onDragEnter(event) {\n if (isEventPertinent(event)) {\n setIsOver(true);\n }\n }\n function onDragLeave(event) {\n if (isEventPertinent(event)) {\n setIsOver(false);\n }\n }\n let draggableProps;\n if (draggable) {\n draggableProps = {\n draggable: true,\n onDragStart,\n onDragEnd,\n onDragOver,\n onDragEnter,\n onDragLeave,\n onDrop\n };\n }\n return /*#__PURE__*/jsxs(\"div\", {\n role: \"columnheader\",\n \"aria-colindex\": column.idx + 1,\n \"aria-colspan\": colSpan,\n \"aria-rowspan\": rowSpan,\n \"aria-selected\": isCellSelected,\n \"aria-sort\": ariaSort,\n tabIndex: shouldFocusGrid ? 0 : tabIndex,\n className: className,\n style: {\n ...getHeaderCellStyle(column, rowIdx, rowSpan),\n ...getCellStyle(column, colSpan)\n },\n onFocus: handleFocus,\n onClick: onClick,\n onKeyDown: sortable ? onKeyDown : undefined,\n ...draggableProps,\n children: [renderHeaderCell$1({\n column,\n sortDirection,\n priority,\n tabIndex: childTabIndex\n }), resizable && /*#__PURE__*/jsx(\"div\", {\n className: resizeHandleClassname,\n onClick: stopPropagation,\n onDoubleClick: onDoubleClick,\n onPointerDown: onPointerDown\n })]\n });\n}\nfunction isEventPertinent(event) {\n const relatedTarget = event.relatedTarget;\n return !event.currentTarget.contains(relatedTarget);\n}\n\nconst row = \"r1upfr807-0-0-beta-42\";\nconst rowClassname = `rdg-row ${row}`;\nconst rowSelected = \"r190mhd37-0-0-beta-42\";\nconst rowSelectedClassname = 'rdg-row-selected';\nconst rowSelectedWithFrozenCell = \"r139qu9m7-0-0-beta-42\";\n\nconst headerRow = \"h10tskcx7-0-0-beta-42\";\nconst headerRowClassname = `rdg-header-row ${headerRow}`;\nfunction HeaderRow({\n rowIdx,\n columns,\n onColumnResize,\n onColumnsReorder,\n sortColumns,\n onSortColumnsChange,\n lastFrozenColumnIndex,\n selectedCellIdx,\n selectCell,\n shouldFocusGrid,\n direction\n}) {\n const dragDropKey = useId();\n const cells = [];\n for (let index = 0; index < columns.length; index++) {\n const column = columns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, {\n type: 'HEADER'\n });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n cells.push( /*#__PURE__*/jsx(HeaderCell, {\n column: column,\n colSpan: colSpan,\n rowIdx: rowIdx,\n isCellSelected: selectedCellIdx === column.idx,\n onColumnResize: onColumnResize,\n onColumnsReorder: onColumnsReorder,\n onSortColumnsChange: onSortColumnsChange,\n sortColumns: sortColumns,\n selectCell: selectCell,\n shouldFocusGrid: shouldFocusGrid && index === 0,\n direction: direction,\n dragDropKey: dragDropKey\n }, column.key));\n }\n return /*#__PURE__*/jsx(\"div\", {\n role: \"row\",\n \"aria-rowindex\": rowIdx,\n className: clsx(headerRowClassname, selectedCellIdx === -1 && rowSelectedClassname),\n children: cells\n });\n}\nconst HeaderRow$1 = /*#__PURE__*/memo(HeaderRow);\n\nfunction GroupedColumnHeaderRow({\n rowIdx,\n level,\n columns,\n selectedCellIdx,\n selectCell\n}) {\n const cells = [];\n const renderedParents = new Set();\n for (const column of columns) {\n let {\n parent\n } = column;\n if (parent === undefined) continue;\n while (parent.level > level) {\n if (parent.parent === undefined) break;\n parent = parent.parent;\n }\n if (parent.level === level && !renderedParents.has(parent)) {\n renderedParents.add(parent);\n const {\n idx\n } = parent;\n cells.push( /*#__PURE__*/jsx(GroupedColumnHeaderCell, {\n column: parent,\n rowIdx: rowIdx,\n isCellSelected: selectedCellIdx === idx,\n selectCell: selectCell\n }, idx));\n }\n }\n return /*#__PURE__*/jsx(\"div\", {\n role: \"row\",\n \"aria-rowindex\": rowIdx,\n className: headerRowClassname,\n children: cells\n });\n}\nconst GroupedColumnHeaderRow$1 = /*#__PURE__*/memo(GroupedColumnHeaderRow);\n\nconst cellCopied = \"c6ra8a37-0-0-beta-42\";\nconst cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;\nconst cellDraggedOver = \"cq910m07-0-0-beta-42\";\nconst cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;\nfunction Cell({\n column,\n colSpan,\n isCellSelected,\n isCopied,\n isDraggedOver,\n row,\n rowIdx,\n onClick,\n onDoubleClick,\n onContextMenu,\n onRowChange,\n selectCell,\n ...props\n}) {\n const {\n tabIndex,\n childTabIndex,\n onFocus\n } = useRovingTabIndex(isCellSelected);\n const {\n cellClass\n } = column;\n const className = getCellClassname(column, typeof cellClass === 'function' ? cellClass(row) : cellClass, isCopied && cellCopiedClassname, isDraggedOver && cellDraggedOverClassname);\n const isEditable = isCellEditableUtil(column, row);\n function selectCellWrapper(openEditor) {\n selectCell({\n rowIdx,\n idx: column.idx\n }, openEditor);\n }\n function handleClick(event) {\n if (onClick) {\n const cellEvent = createCellEvent(event);\n onClick({\n row,\n column,\n selectCell: selectCellWrapper\n }, cellEvent);\n if (cellEvent.isGridDefaultPrevented()) return;\n }\n selectCellWrapper();\n }\n function handleContextMenu(event) {\n if (onContextMenu) {\n const cellEvent = createCellEvent(event);\n onContextMenu({\n row,\n column,\n selectCell: selectCellWrapper\n }, cellEvent);\n if (cellEvent.isGridDefaultPrevented()) return;\n }\n selectCellWrapper();\n }\n function handleDoubleClick(event) {\n if (onDoubleClick) {\n const cellEvent = createCellEvent(event);\n onDoubleClick({\n row,\n column,\n selectCell: selectCellWrapper\n }, cellEvent);\n if (cellEvent.isGridDefaultPrevented()) return;\n }\n selectCellWrapper(true);\n }\n function handleRowChange(newRow) {\n onRowChange(column, newRow);\n }\n return /*#__PURE__*/jsx(\"div\", {\n role: \"gridcell\",\n \"aria-colindex\": column.idx + 1,\n \"aria-colspan\": colSpan,\n \"aria-selected\": isCellSelected,\n \"aria-readonly\": !isEditable || undefined,\n tabIndex: tabIndex,\n className: className,\n style: getCellStyle(column, colSpan),\n onClick: handleClick,\n onDoubleClick: handleDoubleClick,\n onContextMenu: handleContextMenu,\n onFocus: onFocus,\n ...props,\n children: column.renderCell({\n column,\n row,\n rowIdx,\n isCellEditable: isEditable,\n tabIndex: childTabIndex,\n onRowChange: handleRowChange\n })\n });\n}\nconst Cell$1 = /*#__PURE__*/memo(Cell);\n\nfunction Row({\n className,\n rowIdx,\n gridRowStart,\n height,\n selectedCellIdx,\n isRowSelected,\n copiedCellIdx,\n draggedOverCellIdx,\n lastFrozenColumnIndex,\n row,\n viewportColumns,\n selectedCellEditor,\n onCellClick,\n onCellDoubleClick,\n onCellContextMenu,\n rowClass,\n setDraggedOverRowIdx,\n onMouseEnter,\n onRowChange,\n selectCell,\n ...props\n}, ref) {\n const handleRowChange = useLatestFunc((column, newRow) => {\n onRowChange(column, rowIdx, newRow);\n });\n function handleDragEnter(event) {\n setDraggedOverRowIdx?.(rowIdx);\n onMouseEnter?.(event);\n }\n className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass?.(row, rowIdx), className, selectedCellIdx === -1 && rowSelectedClassname);\n const cells = [];\n for (let index = 0; index < viewportColumns.length; index++) {\n const column = viewportColumns[index];\n const {\n idx\n } = column;\n const colSpan = getColSpan(column, lastFrozenColumnIndex, {\n type: 'ROW',\n row\n });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n const isCellSelected = selectedCellIdx === idx;\n if (isCellSelected && selectedCellEditor) {\n cells.push(selectedCellEditor);\n } else {\n cells.push( /*#__PURE__*/jsx(Cell$1, {\n column: column,\n colSpan: colSpan,\n row: row,\n rowIdx: rowIdx,\n isCopied: copiedCellIdx === idx,\n isDraggedOver: draggedOverCellIdx === idx,\n isCellSelected: isCellSelected,\n onClick: onCellClick,\n onDoubleClick: onCellDoubleClick,\n onContextMenu: onCellContextMenu,\n onRowChange: handleRowChange,\n selectCell: selectCell\n }, column.key));\n }\n }\n return /*#__PURE__*/jsx(RowSelectionProvider, {\n value: isRowSelected,\n children: /*#__PURE__*/jsx(\"div\", {\n role: \"row\",\n ref: ref,\n className: className,\n onMouseEnter: handleDragEnter,\n style: getRowStyle(gridRowStart, height),\n ...props,\n children: cells\n })\n });\n}\nconst RowComponent = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(Row));\nconst RowComponent$1 = RowComponent;\nfunction defaultRenderRow(key, props) {\n return /*#__PURE__*/jsx(RowComponent, {\n ...props\n }, key);\n}\n\nfunction ScrollToCell({\n scrollToPosition: {\n idx,\n rowIdx\n },\n gridElement,\n setScrollToCellPosition\n}) {\n const ref = useRef(null);\n useLayoutEffect(() => {\n scrollIntoView(ref.current);\n });\n useLayoutEffect(() => {\n function removeScrollToCell() {\n setScrollToCellPosition(null);\n }\n const observer = new IntersectionObserver(removeScrollToCell, {\n root: gridElement,\n threshold: 1.0\n });\n observer.observe(ref.current);\n return () => {\n observer.disconnect();\n };\n }, [gridElement, setScrollToCellPosition]);\n return /*#__PURE__*/jsx(\"div\", {\n ref: ref,\n style: {\n gridColumn: idx === undefined ? '1/-1' : idx + 1,\n gridRow: rowIdx === undefined ? '1/-1' : rowIdx + 2\n }\n });\n}\n\nconst arrow = \"a3ejtar7-0-0-beta-42\";\nconst arrowClassname = `rdg-sort-arrow ${arrow}`;\nfunction renderSortStatus({\n sortDirection,\n priority\n}) {\n return /*#__PURE__*/jsxs(Fragment, {\n children: [renderSortIcon({\n sortDirection\n }), renderSortPriority({\n priority\n })]\n });\n}\nfunction renderSortIcon({\n sortDirection\n}) {\n if (sortDirection === undefined) return null;\n return /*#__PURE__*/jsx(\"svg\", {\n viewBox: \"0 0 12 8\",\n width: \"12\",\n height: \"8\",\n className: arrowClassname,\n \"aria-hidden\": true,\n children: /*#__PURE__*/jsx(\"path\", {\n d: sortDirection === 'ASC' ? 'M0 8 6 0 12 8' : 'M0 0 6 8 12 0'\n })\n });\n}\nfunction renderSortPriority({\n priority\n}) {\n return priority;\n}\n\nconst root = \"rnvodz57-0-0-beta-42\";\nconst rootClassname = `rdg ${root}`;\nconst viewportDragging = \"vlqv91k7-0-0-beta-42\";\nconst viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;\nconst focusSinkClassname = \"f1lsfrzw7-0-0-beta-42\";\nconst focusSinkHeaderAndSummaryClassname = \"f1cte0lg7-0-0-beta-42\";\n\nconst summaryCellClassname = \"s8wc6fl7-0-0-beta-42\";\nfunction SummaryCell({\n column,\n colSpan,\n row,\n rowIdx,\n isCellSelected,\n selectCell\n}) {\n const {\n tabIndex,\n childTabIndex,\n onFocus\n } = useRovingTabIndex(isCellSelected);\n const {\n summaryCellClass\n } = column;\n const className = getCellClassname(column, summaryCellClassname, typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass);\n function onClick() {\n selectCell({\n rowIdx,\n idx: column.idx\n });\n }\n return /*#__PURE__*/jsx(\"div\", {\n role: \"gridcell\",\n \"aria-colindex\": column.idx + 1,\n \"aria-colspan\": colSpan,\n \"aria-selected\": isCellSelected,\n tabIndex: tabIndex,\n className: className,\n style: getCellStyle(column, colSpan),\n onClick: onClick,\n onFocus: onFocus,\n children: column.renderSummaryCell?.({\n column,\n row,\n tabIndex: childTabIndex\n })\n });\n}\nconst SummaryCell$1 = /*#__PURE__*/memo(SummaryCell);\n\nconst summaryRow = \"skuhp557-0-0-beta-42\";\nconst topSummaryRow = \"tf8l5ub7-0-0-beta-42\";\nconst topSummaryRowBorderClassname = \"tb9ughf7-0-0-beta-42\";\nconst bottomSummaryRowBorderClassname = \"b1yssfnt7-0-0-beta-42\";\nconst summaryRowClassname = `rdg-summary-row ${summaryRow}`;\nconst topSummaryRowClassname = `rdg-top-summary-row ${topSummaryRow}`;\nfunction SummaryRow({\n rowIdx,\n gridRowStart,\n row,\n viewportColumns,\n top,\n bottom,\n lastFrozenColumnIndex,\n selectedCellIdx,\n isTop,\n showBorder,\n selectCell,\n 'aria-rowindex': ariaRowIndex\n}) {\n const cells = [];\n for (let index = 0; index < viewportColumns.length; index++) {\n const column = viewportColumns[index];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, {\n type: 'SUMMARY',\n row\n });\n if (colSpan !== undefined) {\n index += colSpan - 1;\n }\n const isCellSelected = selectedCellIdx === column.idx;\n cells.push( /*#__PURE__*/jsx(SummaryCell$1, {\n column: column,\n colSpan: colSpan,\n row: row,\n rowIdx: rowIdx,\n isCellSelected: isCellSelected,\n selectCell: selectCell\n }, column.key));\n }\n return /*#__PURE__*/jsx(\"div\", {\n role: \"row\",\n \"aria-rowindex\": ariaRowIndex,\n className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, isTop ? [topSummaryRowClassname, showBorder && topSummaryRowBorderClassname] : ['rdg-bottom-summary-row', showBorder && bottomSummaryRowBorderClassname], selectedCellIdx === -1 && rowSelectedClassname),\n style: {\n ...getRowStyle(gridRowStart),\n '--rdg-summary-row-top': top !== undefined ? `${top}px` : undefined,\n '--rdg-summary-row-bottom': bottom !== undefined ? `${bottom}px` : undefined\n },\n children: cells\n });\n}\nconst SummaryRow$1 = /*#__PURE__*/memo(SummaryRow);\n\nfunction DataGrid(props, ref) {\n const {\n columns: rawColumns,\n rows,\n topSummaryRows,\n bottomSummaryRows,\n rowKeyGetter,\n onRowsChange,\n rowHeight: rawRowHeight,\n headerRowHeight: rawHeaderRowHeight,\n summaryRowHeight: rawSummaryRowHeight,\n selectedRows,\n onSelectedRowsChange,\n sortColumns,\n onSortColumnsChange,\n defaultColumnOptions,\n onCellClick,\n onCellDoubleClick,\n onCellContextMenu,\n onCellKeyDown,\n onSelectedCellChange,\n onScroll,\n onColumnResize,\n onColumnsReorder,\n onFill,\n onCopy,\n onPaste,\n enableVirtualization: rawEnableVirtualization,\n renderers,\n className,\n style,\n rowClass,\n direction: rawDirection,\n role: rawRole,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-rowcount': rawAriaRowCount,\n 'data-testid': testId\n } = props;\n const defaultRenderers = useDefaultRenderers();\n const role = rawRole ?? 'grid';\n const rowHeight = rawRowHeight ?? 35;\n const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);\n const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);\n const renderRow = renderers?.renderRow ?? defaultRenderers?.renderRow ?? defaultRenderRow;\n const renderSortStatus$1 = renderers?.renderSortStatus ?? defaultRenderers?.renderSortStatus ?? renderSortStatus;\n const renderCheckbox$1 = renderers?.renderCheckbox ?? defaultRenderers?.renderCheckbox ?? renderCheckbox;\n const noRowsFallback = renderers?.noRowsFallback ?? defaultRenderers?.noRowsFallback;\n const enableVirtualization = rawEnableVirtualization ?? true;\n const direction = rawDirection ?? 'ltr';\n const [scrollTop, setScrollTop] = useState(0);\n const [scrollLeft, setScrollLeft] = useState(0);\n const [resizedColumnWidths, setResizedColumnWidths] = useState(() => new Map());\n const [measuredColumnWidths, setMeasuredColumnWidths] = useState(() => new Map());\n const [copiedCell, setCopiedCell] = useState(null);\n const [isDragging, setDragging] = useState(false);\n const [draggedOverRowIdx, setOverRowIdx] = useState(undefined);\n const [scrollToPosition, setScrollToPosition] = useState(null);\n const getColumnWidth = useCallback(column => {\n return resizedColumnWidths.get(column.key) ?? measuredColumnWidths.get(column.key) ?? column.width;\n }, [measuredColumnWidths, resizedColumnWidths]);\n const [gridRef, gridWidth, gridHeight] = useGridDimensions();\n const {\n columns,\n colSpanColumns,\n lastFrozenColumnIndex,\n headerRowsCount,\n colOverscanStartIdx,\n colOverscanEndIdx,\n templateColumns,\n layoutCssVars,\n totalFrozenColumnWidth\n } = useCalculatedColumns({\n rawColumns,\n defaultColumnOptions,\n getColumnWidth,\n scrollLeft,\n viewportWidth: gridWidth,\n enableVirtualization\n });\n const topSummaryRowsCount = topSummaryRows?.length ?? 0;\n const bottomSummaryRowsCount = bottomSummaryRows?.length ?? 0;\n const summaryRowsCount = topSummaryRowsCount + bottomSummaryRowsCount;\n const headerAndTopSummaryRowsCount = headerRowsCount + topSummaryRowsCount;\n const groupedColumnHeaderRowsCount = headerRowsCount - 1;\n const minRowIdx = -headerAndTopSummaryRowsCount;\n const mainHeaderRowIdx = minRowIdx + groupedColumnHeaderRowsCount;\n const maxRowIdx = rows.length + bottomSummaryRowsCount - 1;\n const [selectedPosition, setSelectedPosition] = useState(() => ({\n idx: -1,\n rowIdx: minRowIdx - 1,\n mode: 'SELECT'\n }));\n const prevSelectedPosition = useRef(selectedPosition);\n const latestDraggedOverRowIdx = useRef(draggedOverRowIdx);\n const lastSelectedRowIdx = useRef(-1);\n const focusSinkRef = useRef(null);\n const shouldFocusCellRef = useRef(false);\n const isTreeGrid = role === 'treegrid';\n const headerRowsHeight = headerRowsCount * headerRowHeight;\n const clientHeight = gridHeight - headerRowsHeight - summaryRowsCount * summaryRowHeight;\n const isSelectable = selectedRows != null && onSelectedRowsChange != null;\n const isRtl = direction === 'rtl';\n const leftKey = isRtl ? 'ArrowRight' : 'ArrowLeft';\n const rightKey = isRtl ? 'ArrowLeft' : 'ArrowRight';\n const ariaRowCount = rawAriaRowCount ?? headerRowsCount + rows.length + summaryRowsCount;\n const defaultGridComponents = useMemo(() => ({\n renderCheckbox: renderCheckbox$1,\n renderSortStatus: renderSortStatus$1\n }), [renderCheckbox$1, renderSortStatus$1]);\n const allRowsSelected = useMemo(() => {\n const {\n length\n } = rows;\n return length !== 0 && selectedRows != null && rowKeyGetter != null && selectedRows.size >= length && rows.every(row => selectedRows.has(rowKeyGetter(row)));\n }, [rows, selectedRows, rowKeyGetter]);\n const {\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n totalRowHeight,\n gridTemplateRows,\n getRowTop,\n getRowHeight,\n findRowIdx\n } = useViewportRows({\n rows,\n rowHeight,\n clientHeight,\n scrollTop,\n enableVirtualization\n });\n const viewportColumns = useViewportColumns({\n columns,\n colSpanColumns,\n colOverscanStartIdx,\n colOverscanEndIdx,\n lastFrozenColumnIndex,\n rowOverscanStartIdx,\n rowOverscanEndIdx,\n rows,\n topSummaryRows,\n bottomSummaryRows\n });\n const {\n gridTemplateColumns,\n handleColumnResize\n } = useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize);\n const minColIdx = isTreeGrid ? -1 : 0;\n const maxColIdx = columns.length - 1;\n const selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition);\n const selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition);\n const handleColumnResizeLatest = useLatestFunc(handleColumnResize);\n const onColumnsReorderLastest = useLatestFunc(onColumnsReorder);\n const onSortColumnsChangeLatest = useLatestFunc(onSortColumnsChange);\n const onCellClickLatest = useLatestFunc(onCellClick);\n const onCellDoubleClickLatest = useLatestFunc(onCellDoubleClick);\n const onCellContextMenuLatest = useLatestFunc(onCellContextMenu);\n const selectRowLatest = useLatestFunc(selectRow);\n const handleFormatterRowChangeLatest = useLatestFunc(updateRow);\n const selectCellLatest = useLatestFunc(selectCell);\n const selectHeaderCellLatest = useLatestFunc(({\n idx,\n rowIdx\n }) => {\n selectCell({\n rowIdx: minRowIdx + rowIdx - 1,\n idx\n });\n });\n useLayoutEffect(() => {\n if (!selectedCellIsWithinSelectionBounds || isSamePosition(selectedPosition, prevSelectedPosition.current)) {\n prevSelectedPosition.current = selectedPosition;\n return;\n }\n prevSelectedPosition.current = selectedPosition;\n if (selectedPosition.idx === -1) {\n focusSinkRef.current.focus({\n preventScroll: true\n });\n scrollIntoView(focusSinkRef.current);\n }\n });\n useLayoutEffect(() => {\n if (!shouldFocusCellRef.current) return;\n shouldFocusCellRef.current = false;\n focusCellOrCellContent();\n });\n useImperativeHandle(ref, () => ({\n element: gridRef.current,\n scrollToCell({\n idx,\n rowIdx\n }) {\n const scrollToIdx = idx !== undefined && idx > lastFrozenColumnIndex && idx < columns.length ? idx : undefined;\n const scrollToRowIdx = rowIdx !== undefined && isRowIdxWithinViewportBounds(rowIdx) ? rowIdx : undefined;\n if (scrollToIdx !== undefined || scrollToRowIdx !== undefined) {\n setScrollToPosition({\n idx: scrollToIdx,\n rowIdx: scrollToRowIdx\n });\n }\n },\n selectCell\n }));\n const setDraggedOverRowIdx = useCallback(rowIdx => {\n setOverRowIdx(rowIdx);\n latestDraggedOverRowIdx.current = rowIdx;\n }, []);\n function selectRow(args) {\n if (!onSelectedRowsChange) return;\n assertIsValidKeyGetter(rowKeyGetter);\n if (args.type === 'HEADER') {\n const newSelectedRows = new Set(selectedRows);\n for (const row of rows) {\n const rowKey = rowKeyGetter(row);\n if (args.checked) {\n newSelectedRows.add(rowKey);\n } else {\n newSelectedRows.delete(rowKey);\n }\n }\n onSelectedRowsChange(newSelectedRows);\n return;\n }\n const {\n row,\n checked,\n isShiftClick\n } = args;\n const newSelectedRows = new Set(selectedRows);\n const rowKey = rowKeyGetter(row);\n if (checked) {\n newSelectedRows.add(rowKey);\n const previousRowIdx = lastSelectedRowIdx.current;\n const rowIdx = rows.indexOf(row);\n lastSelectedRowIdx.current = rowIdx;\n if (isShiftClick && previousRowIdx !== -1 && previousRowIdx !== rowIdx) {\n const step = sign(rowIdx - previousRowIdx);\n for (let i = previousRowIdx + step; i !== rowIdx; i += step) {\n const row = rows[i];\n newSelectedRows.add(rowKeyGetter(row));\n }\n }\n } else {\n newSelectedRows.delete(rowKey);\n lastSelectedRowIdx.current = -1;\n }\n onSelectedRowsChange(newSelectedRows);\n }\n function handleKeyDown(event) {\n const {\n idx,\n rowIdx,\n mode\n } = selectedPosition;\n if (mode === 'EDIT') return;\n if (onCellKeyDown && isRowIdxWithinViewportBounds(rowIdx)) {\n const row = rows[rowIdx];\n const cellEvent = createCellEvent(event);\n onCellKeyDown({\n mode: 'SELECT',\n row,\n column: columns[idx],\n rowIdx,\n selectCell\n }, cellEvent);\n if (cellEvent.isGridDefaultPrevented()) return;\n }\n if (!(event.target instanceof Element)) return;\n const isCellEvent = event.target.closest('.rdg-cell') !== null;\n const isRowEvent = isTreeGrid && event.target === focusSinkRef.current;\n if (!isCellEvent && !isRowEvent) return;\n const {\n keyCode\n } = event;\n if (selectedCellIsWithinViewportBounds && (onPaste != null || onCopy != null) && isCtrlKeyHeldDown(event)) {\n const cKey = 67;\n const vKey = 86;\n if (keyCode === cKey) {\n if (window.getSelection()?.isCollapsed === false) return;\n handleCopy();\n return;\n }\n if (keyCode === vKey) {\n handlePaste();\n return;\n }\n }\n switch (event.key) {\n case 'Escape':\n setCopiedCell(null);\n return;\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'Tab':\n case 'Home':\n case 'End':\n case 'PageUp':\n case 'PageDown':\n navigate(event);\n break;\n default:\n handleCellInput(event);\n break;\n }\n }\n function handleScroll(event) {\n const {\n scrollTop,\n scrollLeft\n } = event.currentTarget;\n flushSync(() => {\n setScrollTop(scrollTop);\n setScrollLeft(abs(scrollLeft));\n });\n onScroll?.(event);\n }\n function updateRow(column, rowIdx, row) {\n if (typeof onRowsChange !== 'function') return;\n if (row === rows[rowIdx]) return;\n const updatedRows = [...rows];\n updatedRows[rowIdx] = row;\n onRowsChange(updatedRows, {\n indexes: [rowIdx],\n column\n });\n }\n function commitEditorChanges() {\n if (selectedPosition.mode !== 'EDIT') return;\n updateRow(columns[selectedPosition.idx], selectedPosition.rowIdx, selectedPosition.row);\n }\n function handleCopy() {\n const {\n idx,\n rowIdx\n } = selectedPosition;\n const sourceRow = rows[rowIdx];\n const sourceColumnKey = columns[idx].key;\n setCopiedCell({\n row: sourceRow,\n columnKey: sourceColumnKey\n });\n onCopy?.({\n sourceRow,\n sourceColumnKey\n });\n }\n function handlePaste() {\n if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition)) {\n return;\n }\n const {\n idx,\n rowIdx\n } = selectedPosition;\n const targetColumn = columns[idx];\n const targetRow = rows[rowIdx];\n const updatedTargetRow = onPaste({\n sourceRow: copiedCell.row,\n sourceColumnKey: copiedCell.columnKey,\n targetRow,\n targetColumnKey: targetColumn.key\n });\n updateRow(targetColumn, rowIdx, updatedTargetRow);\n }\n function handleCellInput(event) {\n if (!selectedCellIsWithinViewportBounds) return;\n const row = rows[selectedPosition.rowIdx];\n const {\n key,\n shiftKey\n } = event;\n if (isSelectable && shiftKey && key === ' ') {\n assertIsValidKeyGetter(rowKeyGetter);\n const rowKey = rowKeyGetter(row);\n selectRow({\n type: 'ROW',\n row,\n checked: !selectedRows.has(rowKey),\n isShiftClick: false\n });\n event.preventDefault();\n return;\n }\n if (isCellEditable(selectedPosition) && isDefaultCellInput(event)) {\n setSelectedPosition(({\n idx,\n rowIdx\n }) => ({\n idx,\n rowIdx,\n mode: 'EDIT',\n row,\n originalRow: row\n }));\n }\n }\n function isColIdxWithinSelectionBounds(idx) {\n return idx >= minColIdx && idx <= maxColIdx;\n }\n function isRowIdxWithinViewportBounds(rowIdx) {\n return rowIdx >= 0 && rowIdx < rows.length;\n }\n function isCellWithinSelectionBounds({\n idx,\n rowIdx\n }) {\n return rowIdx >= minRowIdx && rowIdx <= maxRowIdx && isColIdxWithinSelectionBounds(idx);\n }\n function isCellWithinEditBounds({\n idx,\n rowIdx\n }) {\n return isRowIdxWithinViewportBounds(rowIdx) && idx >= 0 && idx <= maxColIdx;\n }\n function isCellWithinViewportBounds({\n idx,\n rowIdx\n }) {\n return isRowIdxWithinViewportBounds(rowIdx) && isColIdxWithinSelectionBounds(idx);\n }\n function isCellEditable(position) {\n return isCellWithinEditBounds(position) && isSelectedCellEditable({\n columns,\n rows,\n selectedPosition: position\n });\n }\n function selectCell(position, enableEditor) {\n if (!isCellWithinSelectionBounds(position)) return;\n commitEditorChanges();\n const row = rows[position.rowIdx];\n const samePosition = isSamePosition(selectedPosition, position);\n if (enableEditor && isCellEditable(position)) {\n setSelectedPosition({\n ...position,\n mode: 'EDIT',\n row,\n originalRow: row\n });\n } else if (samePosition) {\n scrollIntoView(getCellToScroll(gridRef.current));\n } else {\n shouldFocusCellRef.current = true;\n setSelectedPosition({\n ...position,\n mode: 'SELECT'\n });\n }\n if (onSelectedCellChange && !samePosition) {\n onSelectedCellChange({\n rowIdx: position.rowIdx,\n row,\n column: columns[position.idx]\n });\n }\n }\n function getNextPosition(key, ctrlKey, shiftKey) {\n const {\n idx,\n rowIdx\n } = selectedPosition;\n const isRowSelected = selectedCellIsWithinSelectionBounds && idx === -1;\n switch (key) {\n case 'ArrowUp':\n return {\n idx,\n rowIdx: rowIdx - 1\n };\n case 'ArrowDown':\n return {\n idx,\n rowIdx: rowIdx + 1\n };\n case leftKey:\n return {\n idx: idx - 1,\n rowIdx\n };\n case rightKey:\n return {\n idx: idx + 1,\n rowIdx\n };\n case 'Tab':\n return {\n idx: idx + (shiftKey ? -1 : 1),\n rowIdx\n };\n case 'Home':\n if (isRowSelected) return {\n idx,\n rowIdx: minRowIdx\n };\n return {\n idx: 0,\n rowIdx: ctrlKey ? minRowIdx : rowIdx\n };\n case 'End':\n if (isRowSelected) return {\n idx,\n rowIdx: maxRowIdx\n };\n return {\n idx: maxColIdx,\n rowIdx: ctrlKey ? maxRowIdx : rowIdx\n };\n case 'PageUp':\n {\n if (selectedPosition.rowIdx === minRowIdx) return selectedPosition;\n const nextRowY = getRowTop(rowIdx) + getRowHeight(rowIdx) - clientHeight;\n return {\n idx,\n rowIdx: nextRowY > 0 ? findRowIdx(nextRowY) : 0\n };\n }\n case 'PageDown':\n {\n if (selectedPosition.rowIdx >= rows.length) return selectedPosition;\n const nextRowY = getRowTop(rowIdx) + clientHeight;\n return {\n idx,\n rowIdx: nextRowY < totalRowHeight ? findRowIdx(nextRowY) : rows.length - 1\n };\n }\n default:\n return selectedPosition;\n }\n }\n function navigate(event) {\n const {\n key,\n shiftKey\n } = event;\n let cellNavigationMode = 'NONE';\n if (key === 'Tab') {\n if (canExitGrid({\n shiftKey,\n maxColIdx,\n minRowIdx,\n maxRowIdx,\n selectedPosition\n })) {\n commitEditorChanges();\n return;\n }\n cellNavigationMode = 'CHANGE_ROW';\n }\n event.preventDefault();\n const ctrlKey = isCtrlKeyHeldDown(event);\n const nextPosition = getNextPosition(key, ctrlKey, shiftKey);\n if (isSamePosition(selectedPosition, nextPosition)) return;\n const nextSelectedCellPosition = getNextSelectedCellPosition({\n moveUp: key === 'ArrowUp',\n moveNext: key === rightKey || key === 'Tab' && !shiftKey,\n columns,\n colSpanColumns,\n rows,\n topSummaryRows,\n bottomSummaryRows,\n minRowIdx,\n mainHeaderRowIdx,\n maxRowIdx,\n lastFrozenColumnIndex,\n cellNavigationMode,\n currentPosition: selectedPosition,\n nextPosition,\n isCellWithinBounds: isCellWithinSelectionBounds\n });\n selectCell(nextSelectedCellPosition);\n }\n function getDraggedOverCellIdx(currentRowIdx) {\n if (draggedOverRowIdx === undefined) return;\n const {\n rowIdx\n } = selectedPosition;\n const isDraggedOver = rowIdx < draggedOverRowIdx ? rowIdx < currentRowIdx && currentRowIdx <= draggedOverRowIdx : rowIdx > currentRowIdx && currentRowIdx >= draggedOverRowIdx;\n return isDraggedOver ? selectedPosition.idx : undefined;\n }\n function focusCellOrCellContent() {\n const cell = getCellToScroll(gridRef.current);\n if (cell === null) return;\n scrollIntoView(cell);\n const elementToFocus = cell.querySelector('[tabindex=\"0\"]') ?? cell;\n elementToFocus.focus({\n preventScroll: true\n });\n }\n function renderDragHandle() {\n if (onFill == null || selectedPosition.mode === 'EDIT' || !isCellWithinViewportBounds(selectedPosition)) {\n return;\n }\n const {\n idx,\n rowIdx\n } = selectedPosition;\n const column = columns[idx];\n if (column.renderEditCell == null || column.editable === false) {\n return;\n }\n const columnWidth = getColumnWidth(column);\n return /*#__PURE__*/jsx(DragHandle, {\n gridRowStart: headerAndTopSummaryRowsCount + rowIdx + 1,\n rows: rows,\n column: column,\n columnWidth: columnWidth,\n maxColIdx: maxColIdx,\n isLastRow: rowIdx === maxRowIdx,\n selectedPosition: selectedPosition,\n isCellEditable: isCellEditable,\n latestDraggedOverRowIdx: latestDraggedOverRowIdx,\n onRowsChange: onRowsChange,\n onClick: focusCellOrCellContent,\n onFill: onFill,\n setDragging: setDragging,\n setDraggedOverRowIdx: setDraggedOverRowIdx\n });\n }\n function getCellEditor(rowIdx) {\n if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === 'SELECT') return;\n const {\n idx,\n row\n } = selectedPosition;\n const column = columns[idx];\n const colSpan = getColSpan(column, lastFrozenColumnIndex, {\n type: 'ROW',\n row\n });\n const closeEditor = shouldFocusCell => {\n shouldFocusCellRef.current = shouldFocusCell;\n setSelectedPosition(({\n idx,\n rowIdx\n }) => ({\n idx,\n rowIdx,\n mode: 'SELECT'\n }));\n };\n const onRowChange = (row, commitChanges, shouldFocusCell) => {\n if (commitChanges) {\n flushSync(() => {\n updateRow(column, selectedPosition.rowIdx, row);\n closeEditor(shouldFocusCell);\n });\n } else {\n setSelectedPosition(position => ({\n ...position,\n row\n }));\n }\n };\n if (rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) {\n closeEditor(false);\n }\n return /*#__PURE__*/jsx(EditCell, {\n column: column,\n colSpan: colSpan,\n row: row,\n rowIdx: rowIdx,\n onRowChange: onRowChange,\n closeEditor: closeEditor,\n onKeyDown: onCellKeyDown,\n navigate: navigate\n }, column.key);\n }\n function getRowViewportColumns(rowIdx) {\n const selectedColumn = selectedPosition.idx === -1 ? undefined : columns[selectedPosition.idx];\n if (selectedColumn !== undefined && selectedPosition.rowIdx === rowIdx && !viewportColumns.includes(selectedColumn)) {\n return selectedPosition.idx > colOverscanEndIdx ? [...viewportColumns, selectedColumn] : [...viewportColumns.slice(0, lastFrozenColumnIndex + 1), selectedColumn, ...viewportColumns.slice(lastFrozenColumnIndex + 1)];\n }\n return viewportColumns;\n }\n function getViewportRows() {\n const rowElements = [];\n const {\n idx: selectedIdx,\n rowIdx: selectedRowIdx\n } = selectedPosition;\n const startRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx < rowOverscanStartIdx ? rowOverscanStartIdx - 1 : rowOverscanStartIdx;\n const endRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx > rowOverscanEndIdx ? rowOverscanEndIdx + 1 : rowOverscanEndIdx;\n for (let viewportRowIdx = startRowIdx; viewportRowIdx <= endRowIdx; viewportRowIdx++) {\n const isRowOutsideViewport = viewportRowIdx === rowOverscanStartIdx - 1 || viewportRowIdx === rowOverscanEndIdx + 1;\n const rowIdx = isRowOutsideViewport ? selectedRowIdx : viewportRowIdx;\n let rowColumns = viewportColumns;\n const selectedColumn = selectedIdx === -1 ? undefined : columns[selectedIdx];\n if (selectedColumn !== undefined) {\n if (isRowOutsideViewport) {\n rowColumns = [selectedColumn];\n } else {\n rowColumns = getRowViewportColumns(rowIdx);\n }\n }\n const row = rows[rowIdx];\n const gridRowStart = headerAndTopSummaryRowsCount + rowIdx + 1;\n let key = rowIdx;\n let isRowSelected = false;\n if (typeof rowKeyGetter === 'function') {\n key = rowKeyGetter(row);\n isRowSelected = selectedRows?.has(key) ?? false;\n }\n rowElements.push(renderRow(key, {\n 'aria-rowindex': headerAndTopSummaryRowsCount + rowIdx + 1,\n 'aria-selected': isSelectable ? isRowSelected : undefined,\n rowIdx,\n row,\n viewportColumns: rowColumns,\n isRowSelected,\n onCellClick: onCellClickLatest,\n onCellDoubleClick: onCellDoubleClickLatest,\n onCellContextMenu: onCellContextMenuLatest,\n rowClass,\n gridRowStart,\n height: getRowHeight(rowIdx),\n copiedCellIdx: copiedCell !== null && copiedCell.row === row ? columns.findIndex(c => c.key === copiedCell.columnKey) : undefined,\n selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined,\n draggedOverCellIdx: getDraggedOverCellIdx(rowIdx),\n setDraggedOverRowIdx: isDragging ? setDraggedOverRowIdx : undefined,\n lastFrozenColumnIndex,\n onRowChange: handleFormatterRowChangeLatest,\n selectCell: selectCellLatest,\n selectedCellEditor: getCellEditor(rowIdx)\n }));\n }\n return rowElements;\n }\n if (selectedPosition.idx > maxColIdx || selectedPosition.rowIdx > maxRowIdx) {\n setSelectedPosition({\n idx: -1,\n rowIdx: minRowIdx - 1,\n mode: 'SELECT'\n });\n setDraggedOverRowIdx(undefined);\n }\n let templateRows = `repeat(${headerRowsCount}, ${headerRowHeight}px)`;\n if (topSummaryRowsCount > 0) {\n templateRows += ` repeat(${topSummaryRowsCount}, ${summaryRowHeight}px)`;\n }\n if (rows.length > 0) {\n templateRows += gridTemplateRows;\n }\n if (bottomSummaryRowsCount > 0) {\n templateRows += ` repeat(${bottomSummaryRowsCount}, ${summaryRowHeight}px)`;\n }\n const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== minRowIdx - 1;\n return /*#__PURE__*/jsxs(\"div\", {\n role: role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-multiselectable\": isSelectable ? true : undefined,\n \"aria-colcount\": columns.length,\n \"aria-rowcount\": ariaRowCount,\n className: clsx(rootClassname, className, isDragging && viewportDraggingClassname),\n style: {\n ...style,\n scrollPaddingInlineStart: selectedPosition.idx > lastFrozenColumnIndex || scrollToPosition?.idx !== undefined ? `${totalFrozenColumnWidth}px` : undefined,\n scrollPaddingBlock: isRowIdxWithinViewportBounds(selectedPosition.rowIdx) || scrollToPosition?.rowIdx !== undefined ? `${headerRowsHeight + topSummaryRowsCount * summaryRowHeight}px ${bottomSummaryRowsCount * summaryRowHeight}px` : undefined,\n gridTemplateColumns,\n gridTemplateRows: templateRows,\n '--rdg-header-row-height': `${headerRowHeight}px`,\n '--rdg-summary-row-height': `${summaryRowHeight}px`,\n '--rdg-sign': isRtl ? -1 : 1,\n ...layoutCssVars\n },\n dir: direction,\n ref: gridRef,\n onScroll: handleScroll,\n onKeyDown: handleKeyDown,\n \"data-testid\": testId,\n children: [/*#__PURE__*/jsx(DataGridDefaultRenderersProvider, {\n value: defaultGridComponents,\n children: /*#__PURE__*/jsxs(RowSelectionChangeProvider, {\n value: selectRowLatest,\n children: [/*#__PURE__*/jsxs(RowSelectionProvider, {\n value: allRowsSelected,\n children: [Array.from({\n length: groupedColumnHeaderRowsCount\n }, (_, index) => /*#__PURE__*/jsx(GroupedColumnHeaderRow$1, {\n rowIdx: index + 1,\n level: -groupedColumnHeaderRowsCount + index,\n columns: getRowViewportColumns(minRowIdx + index),\n selectedCellIdx: selectedPosition.rowIdx === minRowIdx + index ? selectedPosition.idx : undefined,\n selectCell: selectHeaderCellLatest\n }, index)), /*#__PURE__*/jsx(HeaderRow$1, {\n rowIdx: headerRowsCount,\n columns: getRowViewportColumns(mainHeaderRowIdx),\n onColumnResize: handleColumnResizeLatest,\n onColumnsReorder: onColumnsReorderLastest,\n sortColumns: sortColumns,\n onSortColumnsChange: onSortColumnsChangeLatest,\n lastFrozenColumnIndex: lastFrozenColumnIndex,\n selectedCellIdx: selectedPosition.rowIdx === mainHeaderRowIdx ? selectedPosition.idx : undefined,\n selectCell: selectHeaderCellLatest,\n shouldFocusGrid: !selectedCellIsWithinSelectionBounds,\n direction: direction\n })]\n }), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/jsxs(Fragment, {\n children: [topSummaryRows?.map((row, rowIdx) => {\n const gridRowStart = headerRowsCount + 1 + rowIdx;\n const summaryRowIdx = mainHeaderRowIdx + 1 + rowIdx;\n const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;\n const top = headerRowsHeight + summaryRowHeight * rowIdx;\n return /*#__PURE__*/jsx(SummaryRow$1, {\n \"aria-rowindex\": gridRowStart,\n rowIdx: summaryRowIdx,\n gridRowStart: gridRowStart,\n row: row,\n top: top,\n bottom: undefined,\n viewportColumns: getRowViewportColumns(summaryRowIdx),\n lastFrozenColumnIndex: lastFrozenColumnIndex,\n selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,\n isTop: true,\n showBorder: rowIdx === topSummaryRowsCount - 1,\n selectCell: selectCellLatest\n }, rowIdx);\n }), getViewportRows(), bottomSummaryRows?.map((row, rowIdx) => {\n const gridRowStart = headerAndTopSummaryRowsCount + rows.length + rowIdx + 1;\n const summaryRowIdx = rows.length + rowIdx;\n const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;\n const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (bottomSummaryRows.length - rowIdx) : undefined;\n const bottom = top === undefined ? summaryRowHeight * (bottomSummaryRows.length - 1 - rowIdx) : undefined;\n return /*#__PURE__*/jsx(SummaryRow$1, {\n \"aria-rowindex\": ariaRowCount - bottomSummaryRowsCount + rowIdx + 1,\n rowIdx: summaryRowIdx,\n gridRowStart: gridRowStart,\n row: row,\n top: top,\n bottom: bottom,\n viewportColumns: getRowViewportColumns(summaryRowIdx),\n lastFrozenColumnIndex: lastFrozenColumnIndex,\n selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,\n isTop: false,\n showBorder: rowIdx === 0,\n selectCell: selectCellLatest\n }, rowIdx);\n })]\n })]\n })\n }), renderDragHandle(), renderMeasuringCells(viewportColumns), isTreeGrid && /*#__PURE__*/jsx(\"div\", {\n ref: focusSinkRef,\n tabIndex: isGroupRowFocused ? 0 : -1,\n className: clsx(focusSinkClassname, isGroupRowFocused && [rowSelected, lastFrozenColumnIndex !== -1 && rowSelectedWithFrozenCell], !isRowIdxWithinViewportBounds(selectedPosition.rowIdx) && focusSinkHeaderAndSummaryClassname),\n style: {\n gridRowStart: selectedPosition.rowIdx + headerAndTopSummaryRowsCount + 1\n }\n }), scrollToPosition !== null && /*#__PURE__*/jsx(ScrollToCell, {\n scrollToPosition: scrollToPosition,\n setScrollToCellPosition: setScrollToPosition,\n gridElement: gridRef.current\n })]\n });\n}\nfunction getCellToScroll(gridEl) {\n return gridEl.querySelector(':scope > [role=\"row\"] > [tabindex=\"0\"]');\n}\nfunction isSamePosition(p1, p2) {\n return p1.idx === p2.idx && p1.rowIdx === p2.rowIdx;\n}\nconst DataGrid$1 = /*#__PURE__*/forwardRef(DataGrid);\n\nfunction GroupCell({\n id,\n groupKey,\n childRows,\n isExpanded,\n isCellSelected,\n column,\n row,\n groupColumnIndex,\n isGroupByColumn,\n toggleGroup: toggleGroupWrapper\n}) {\n const {\n tabIndex,\n childTabIndex,\n onFocus\n } = useRovingTabIndex(isCellSelected);\n function toggleGroup() {\n toggleGroupWrapper(id);\n }\n const isLevelMatching = isGroupByColumn && groupColumnIndex === column.idx;\n return /*#__PURE__*/jsx(\"div\", {\n role: \"gridcell\",\n \"aria-colindex\": column.idx + 1,\n \"aria-selected\": isCellSelected,\n tabIndex: tabIndex,\n className: getCellClassname(column),\n style: {\n ...getCellStyle(column),\n cursor: isLevelMatching ? 'pointer' : 'default'\n },\n onClick: isLevelMatching ? toggleGroup : undefined,\n onFocus: onFocus,\n children: (!isGroupByColumn || isLevelMatching) && column.renderGroupCell?.({\n groupKey,\n childRows,\n column,\n row,\n isExpanded,\n tabIndex: childTabIndex,\n toggleGroup\n })\n }, column.key);\n}\nconst GroupCell$1 = /*#__PURE__*/memo(GroupCell);\n\nconst groupRow = \"g1yxluv37-0-0-beta-42\";\nconst groupRowClassname = `rdg-group-row ${groupRow}`;\nfunction GroupedRow({\n className,\n row,\n rowIdx,\n viewportColumns,\n selectedCellIdx,\n isRowSelected,\n selectCell,\n gridRowStart,\n height,\n groupBy,\n toggleGroup,\n ...props\n}) {\n const idx = viewportColumns[0].key === SELECT_COLUMN_KEY ? row.level + 1 : row.level;\n function handleSelectGroup() {\n selectCell({\n rowIdx,\n idx: -1\n });\n }\n return /*#__PURE__*/jsx(RowSelectionProvider, {\n value: isRowSelected,\n children: /*#__PURE__*/jsx(\"div\", {\n role: \"row\",\n \"aria-level\": row.level + 1,\n \"aria-setsize\": row.setSize,\n \"aria-posinset\": row.posInSet + 1,\n \"aria-expanded\": row.isExpanded,\n className: clsx(rowClassname, groupRowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, className, selectedCellIdx === -1 && rowSelectedClassname),\n onClick: handleSelectGroup,\n style: getRowStyle(gridRowStart, height),\n ...props,\n children: viewportColumns.map(column => /*#__PURE__*/jsx(GroupCell$1, {\n id: row.id,\n groupKey: row.groupKey,\n childRows: row.childRows,\n isExpanded: row.isExpanded,\n isCellSelected: selectedCellIdx === column.idx,\n column: column,\n row: row,\n groupColumnIndex: idx,\n toggleGroup: toggleGroup,\n isGroupByColumn: groupBy.includes(column.key)\n }, column.key))\n })\n });\n}\nconst GroupedRow$1 = /*#__PURE__*/memo(GroupedRow);\n\nfunction TreeDataGrid({\n columns: rawColumns,\n rows: rawRows,\n rowHeight: rawRowHeight,\n rowKeyGetter: rawRowKeyGetter,\n onCellKeyDown: rawOnCellKeyDown,\n onRowsChange,\n selectedRows: rawSelectedRows,\n onSelectedRowsChange: rawOnSelectedRowsChange,\n renderers,\n groupBy: rawGroupBy,\n rowGrouper,\n expandedGroupIds,\n onExpandedGroupIdsChange,\n ...props\n}, ref) {\n const defaultRenderers = useDefaultRenderers();\n const rawRenderRow = renderers?.renderRow ?? defaultRenderers?.renderRow ?? defaultRenderRow;\n const headerAndTopSummaryRowsCount = 1 + (props.topSummaryRows?.length ?? 0);\n const isRtl = props.direction === 'rtl';\n const leftKey = isRtl ? 'ArrowRight' : 'ArrowLeft';\n const rightKey = isRtl ? 'ArrowLeft' : 'ArrowRight';\n const toggleGroupLatest = useLatestFunc(toggleGroup);\n const {\n columns,\n groupBy\n } = useMemo(() => {\n const columns = [...rawColumns].sort(({\n key: aKey\n }, {\n key: bKey\n }) => {\n if (aKey === SELECT_COLUMN_KEY) return -1;\n if (bKey === SELECT_COLUMN_KEY) return 1;\n if (rawGroupBy.includes(aKey)) {\n if (rawGroupBy.includes(bKey)) {\n return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey);\n }\n return -1;\n }\n if (rawGroupBy.includes(bKey)) return 1;\n return 0;\n });\n const groupBy = [];\n for (const [index, column] of columns.entries()) {\n if (rawGroupBy.includes(column.key)) {\n groupBy.push(column.key);\n columns[index] = {\n ...column,\n frozen: true,\n renderCell: () => null,\n renderGroupCell: column.renderGroupCell ?? renderToggleGroup,\n editable: false\n };\n }\n }\n return {\n columns,\n groupBy\n };\n }, [rawColumns, rawGroupBy]);\n const [groupedRows, rowsCount] = useMemo(() => {\n if (groupBy.length === 0) return [undefined, rawRows.length];\n const groupRows = (rows, [groupByKey, ...remainingGroupByKeys], startRowIndex) => {\n let groupRowsCount = 0;\n const groups = {};\n for (const [key, childRows] of Object.entries(rowGrouper(rows, groupByKey))) {\n const [childGroups, childRowsCount] = remainingGroupByKeys.length === 0 ? [childRows, childRows.length] : groupRows(childRows, remainingGroupByKeys, startRowIndex + groupRowsCount + 1);\n groups[key] = {\n childRows,\n childGroups,\n startRowIndex: startRowIndex + groupRowsCount\n };\n groupRowsCount += childRowsCount + 1;\n }\n return [groups, groupRowsCount];\n };\n return groupRows(rawRows, groupBy, 0);\n }, [groupBy, rowGrouper, rawRows]);\n const [rows, isGroupRow] = useMemo(() => {\n const allGroupRows = new Set();\n if (!groupedRows) return [rawRows, isGroupRow];\n const flattenedRows = [];\n const expandGroup = (rows, parentId, level) => {\n if (isReadonlyArray(rows)) {\n flattenedRows.push(...rows);\n return;\n }\n Object.keys(rows).forEach((groupKey, posInSet, keys) => {\n const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey;\n const isExpanded = expandedGroupIds.has(id);\n const {\n childRows,\n childGroups,\n startRowIndex\n } = rows[groupKey];\n const groupRow = {\n id,\n parentId,\n groupKey,\n isExpanded,\n childRows,\n level,\n posInSet,\n startRowIndex,\n setSize: keys.length\n };\n flattenedRows.push(groupRow);\n allGroupRows.add(groupRow);\n if (isExpanded) {\n expandGroup(childGroups, id, level + 1);\n }\n });\n };\n expandGroup(groupedRows, undefined, 0);\n return [flattenedRows, isGroupRow];\n function isGroupRow(row) {\n return allGroupRows.has(row);\n }\n }, [expandedGroupIds, groupedRows, rawRows]);\n const rowHeight = useMemo(() => {\n if (typeof rawRowHeight === 'function') {\n return row => {\n if (isGroupRow(row)) {\n return rawRowHeight({\n type: 'GROUP',\n row\n });\n }\n return rawRowHeight({\n type: 'ROW',\n row\n });\n };\n }\n return rawRowHeight;\n }, [isGroupRow, rawRowHeight]);\n const getParentRowAndIndex = useCallback(row => {\n const rowIdx = rows.indexOf(row);\n for (let i = rowIdx - 1; i >= 0; i--) {\n const parentRow = rows[i];\n if (isGroupRow(parentRow) && (!isGroupRow(row) || row.parentId === parentRow.id)) {\n return [parentRow, i];\n }\n }\n return undefined;\n }, [isGroupRow, rows]);\n const rowKeyGetter = useCallback(row => {\n if (isGroupRow(row)) {\n return row.id;\n }\n if (typeof rawRowKeyGetter === 'function') {\n return rawRowKeyGetter(row);\n }\n const parentRowAndIndex = getParentRowAndIndex(row);\n if (parentRowAndIndex !== undefined) {\n const {\n startRowIndex,\n childRows\n } = parentRowAndIndex[0];\n const groupIndex = childRows.indexOf(row);\n return startRowIndex + groupIndex + 1;\n }\n return rows.indexOf(row);\n }, [getParentRowAndIndex, isGroupRow, rawRowKeyGetter, rows]);\n const selectedRows = useMemo(() => {\n if (rawSelectedRows == null) return null;\n assertIsValidKeyGetter(rawRowKeyGetter);\n const selectedRows = new Set(rawSelectedRows);\n for (const row of rows) {\n if (isGroupRow(row)) {\n const isGroupRowSelected = row.childRows.every(cr => rawSelectedRows.has(rawRowKeyGetter(cr)));\n if (isGroupRowSelected) {\n selectedRows.add(row.id);\n }\n }\n }\n return selectedRows;\n }, [isGroupRow, rawRowKeyGetter, rawSelectedRows, rows]);\n function onSelectedRowsChange(newSelectedRows) {\n if (!rawOnSelectedRowsChange) return;\n assertIsValidKeyGetter(rawRowKeyGetter);\n const newRawSelectedRows = new Set(rawSelectedRows);\n for (const row of rows) {\n const key = rowKeyGetter(row);\n if (selectedRows?.has(key) && !newSelectedRows.has(key)) {\n if (isGroupRow(row)) {\n for (const cr of row.childRows) {\n newRawSelectedRows.delete(rawRowKeyGetter(cr));\n }\n } else {\n newRawSelectedRows.delete(key);\n }\n } else if (!selectedRows?.has(key) && newSelectedRows.has(key)) {\n if (isGroupRow(row)) {\n for (const cr of row.childRows) {\n newRawSelectedRows.add(rawRowKeyGetter(cr));\n }\n } else {\n newRawSelectedRows.add(key);\n }\n }\n }\n rawOnSelectedRowsChange(newRawSelectedRows);\n }\n function handleKeyDown(args, event) {\n rawOnCellKeyDown?.(args, event);\n if (event.isGridDefaultPrevented()) return;\n if (args.mode === 'EDIT') return;\n const {\n column,\n rowIdx,\n selectCell\n } = args;\n const idx = column?.idx ?? -1;\n const row = rows[rowIdx];\n if (!isGroupRow(row)) return;\n if (idx === -1 && (event.key === leftKey && row.isExpanded || event.key === rightKey && !row.isExpanded)) {\n event.preventDefault();\n event.preventGridDefault();\n toggleGroup(row.id);\n }\n if (idx === -1 && event.key === leftKey && !row.isExpanded && row.level !== 0) {\n const parentRowAndIndex = getParentRowAndIndex(row);\n if (parentRowAndIndex !== undefined) {\n event.preventGridDefault();\n selectCell({\n idx,\n rowIdx: parentRowAndIndex[1]\n });\n }\n }\n if (isCtrlKeyHeldDown(event) && (event.keyCode === 67 || event.keyCode === 86)) {\n event.preventGridDefault();\n }\n }\n function handleRowsChange(updatedRows, {\n indexes,\n column\n }) {\n if (!onRowsChange) return;\n const updatedRawRows = [...rawRows];\n const rawIndexes = [];\n for (const index of indexes) {\n const rawIndex = rawRows.indexOf(rows[index]);\n updatedRawRows[rawIndex] = updatedRows[index];\n rawIndexes.push(rawIndex);\n }\n onRowsChange(updatedRawRows, {\n indexes: rawIndexes,\n column\n });\n }\n function toggleGroup(groupId) {\n const newExpandedGroupIds = new Set(expandedGroupIds);\n if (newExpandedGroupIds.has(groupId)) {\n newExpandedGroupIds.delete(groupId);\n } else {\n newExpandedGroupIds.add(groupId);\n }\n onExpandedGroupIdsChange(newExpandedGroupIds);\n }\n function renderRow(key, {\n row,\n rowClass,\n onCellClick,\n onCellDoubleClick,\n onCellContextMenu,\n onRowChange,\n lastFrozenColumnIndex,\n copiedCellIdx,\n draggedOverCellIdx,\n setDraggedOverRowIdx,\n selectedCellEditor,\n ...rowProps\n }) {\n if (isGroupRow(row)) {\n const {\n startRowIndex\n } = row;\n return /*#__PURE__*/jsx(GroupedRow$1, {\n ...rowProps,\n \"aria-rowindex\": headerAndTopSummaryRowsCount + startRowIndex + 1,\n row: row,\n groupBy: groupBy,\n toggleGroup: toggleGroupLatest\n }, key);\n }\n let ariaRowIndex = rowProps['aria-rowindex'];\n const parentRowAndIndex = getParentRowAndIndex(row);\n if (parentRowAndIndex !== undefined) {\n const {\n startRowIndex,\n childRows\n } = parentRowAndIndex[0];\n const groupIndex = childRows.indexOf(row);\n ariaRowIndex = startRowIndex + headerAndTopSummaryRowsCount + groupIndex + 2;\n }\n return rawRenderRow(key, {\n ...rowProps,\n 'aria-rowindex': ariaRowIndex,\n row,\n rowClass,\n onCellClick,\n onCellDoubleClick,\n onCellContextMenu,\n onRowChange,\n lastFrozenColumnIndex,\n copiedCellIdx,\n draggedOverCellIdx,\n setDraggedOverRowIdx,\n selectedCellEditor\n });\n }\n return /*#__PURE__*/jsx(DataGrid$1, {\n ...props,\n role: \"treegrid\",\n \"aria-rowcount\": rowsCount + 1 + (props.topSummaryRows?.length ?? 0) + (props.bottomSummaryRows?.length ?? 0),\n ref: ref,\n columns: columns,\n rows: rows,\n rowHeight: rowHeight,\n rowKeyGetter: rowKeyGetter,\n onRowsChange: handleRowsChange,\n selectedRows: selectedRows,\n onSelectedRowsChange: onSelectedRowsChange,\n onCellKeyDown: handleKeyDown,\n renderers: {\n ...renderers,\n renderRow\n }\n });\n}\nfunction isReadonlyArray(arr) {\n return Array.isArray(arr);\n}\nconst TreeDataGrid$1 = /*#__PURE__*/forwardRef(TreeDataGrid);\n\nconst textEditorInternalClassname = \"t7vyx3i7-0-0-beta-42\";\nconst textEditorClassname = `rdg-text-editor ${textEditorInternalClassname}`;\nfunction autoFocusAndSelect(input) {\n input?.focus();\n input?.select();\n}\nfunction textEditor({\n row,\n column,\n onRowChange,\n onClose\n}) {\n return /*#__PURE__*/jsx(\"input\", {\n className: textEditorClassname,\n ref: autoFocusAndSelect,\n value: row[column.key],\n onChange: event => onRowChange({\n ...row,\n [column.key]: event.target.value\n }),\n onBlur: () => onClose(true, false)\n });\n}\n\nexport { DataGridDefaultRenderersProvider, RowComponent$1 as Row, SELECT_COLUMN_KEY, SelectCellFormatter, SelectColumn, ToggleGroup, TreeDataGrid$1 as TreeDataGrid, DataGrid$1 as default, renderCheckbox, renderHeaderCell, renderSortIcon, renderSortPriority, renderToggleGroup, renderValue, textEditor, useRowSelection };\n//# sourceMappingURL=bundle.js.map\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e,t,n,r){var o,c=arguments.length,f=c<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)f=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(f=(c<3?o(f):c>3?o(t,n,f):o(t,n))||f);return c>3&&f&&Object.defineProperty(t,n,f),f}function t(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,c){function f(e){try{i(r.next(e))}catch(t){c(t)}}function u(e){try{i(r.throw(e))}catch(t){c(t)}}function i(e){e.done?n(e.value):o(e.value).then(f,u)}i((r=r.apply(e,t||[])).next())}))}\"function\"==typeof SuppressedError&&SuppressedError;export{e as _,t as a};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet e;function has(a){return\"function\"==typeof e[a]?e[a]=e[a](globalThis):e[a]}e=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},has.add=(a,d,o,r)=>((r||void 0===e[a])&&(e[a]=d),o&&has(a)),has.cache=e,has.add(\"big-integer-warning-enabled\",!0),has.add(\"esri-deprecation-warnings\",!0),has.add(\"esri-tests-disable-screenshots\",!1),has.add(\"esri-tests-use-full-window\",!1),has.add(\"esri-tests-post-to-influx\",!0),(()=>{has.add(\"host-webworker\",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e=\"undefined\"!=typeof window&&\"undefined\"!=typeof location&&\"undefined\"!=typeof document&&window.location===location&&window.document===document;if(has.add(\"host-browser\",e),has.add(\"host-node\",\"object\"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),has.add(\"dom\",e),has(\"host-browser\")){const e=navigator,a=e.userAgent,d=e.appVersion,o=parseFloat(d);if(has.add(\"wp\",parseFloat(a.split(\"Windows Phone\")[1])||void 0),has.add(\"msapp\",parseFloat(a.split(\"MSAppHost/\")[1])||void 0),has.add(\"khtml\",d.includes(\"Konqueror\")?o:void 0),has.add(\"edge\",parseFloat(a.split(\"Edge/\")[1])||void 0),has.add(\"opr\",parseFloat(a.split(\"OPR/\")[1])||void 0),has.add(\"webkit\",!has(\"wp\")&&!has(\"edge\")&&parseFloat(a.split(\"WebKit/\")[1])||void 0),has.add(\"chrome\",!has(\"edge\")&&!has(\"opr\")&&parseFloat(a.split(\"Chrome/\")[1])||void 0),has.add(\"android\",!has(\"wp\")&&parseFloat(a.split(\"Android \")[1])||void 0),has.add(\"safari\",!d.includes(\"Safari\")||has(\"wp\")||has(\"chrome\")||has(\"android\")||has(\"edge\")||has(\"opr\")?void 0:parseFloat(d.split(\"Version/\")[1])),has.add(\"mac\",d.includes(\"Macintosh\")),!has(\"wp\")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,\"p\"),d=/OS ([\\d_]+)/.test(a)?RegExp.$1:\"1\",o=parseFloat(d.replace(/_/,\".\").replaceAll(\"_\",\"\"));has.add(e,o),has.add(\"ios\",o)}has(\"webkit\")||(!a.includes(\"Gecko\")||has(\"wp\")||has(\"khtml\")||has(\"edge\")||has.add(\"mozilla\",o),has(\"mozilla\")&&has.add(\"ff\",parseFloat(a.split(\"Firefox/\")[1]||a.split(\"Minefield/\")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add(\"esri-mobile\",a),d&&has.add(\"esri-iPhone\",d),has.add(\"esri-geolocation\",!!navigator.geolocation)}has.add(\"esri-wasm\",\"WebAssembly\"in globalThis),has.add(\"esri-performance-mode-frames-between-render\",20),has.add(\"esri-force-performance-mode\",!1),has.add(\"esri-shared-array-buffer\",(()=>{const e=\"SharedArrayBuffer\"in globalThis,a=!1===globalThis.crossOriginIsolated;return e&&!a})),has.add(\"wasm-simd\",(()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))})),has.add(\"esri-atomics\",\"Atomics\"in globalThis),has.add(\"esri-workers\",\"Worker\"in globalThis),has.add(\"web-feat:cache\",\"caches\"in globalThis),has.add(\"esri-workers-arraybuffer-transfer\",!has(\"safari\")||Number(has(\"safari\"))>=12),has.add(\"workers-pool-size\",8),has.add(\"featurelayer-simplify-thresholds\",[.5,.5,.5,.5]),has.add(\"featurelayer-simplify-payload-size-factors\",[1,1,4]),has.add(\"featurelayer-animation-enabled\",!0),has.add(\"featurelayer-snapshot-enabled\",!0),has.add(\"featurelayer-snapshot-point-min-threshold\",8e4),has.add(\"featurelayer-snapshot-point-max-threshold\",4e5),has.add(\"featurelayer-snapshot-point-coverage\",.1),has.add(\"featurelayer-advanced-symbols\",!1),has.add(\"featurelayer-pbf\",!0),has.add(\"featurelayer-pbf-statistics\",!1),has.add(\"feature-layers-workers\",!0),has.add(\"feature-polyline-generalization-factor\",1),has.add(\"mapview-transitions-duration\",200),has.add(\"mapview-srswitch-adjust-rotation-scale-threshold\",24e6),has.add(\"mapserver-pbf-version-support\",10.81),has.add(\"mapservice-popup-identify-max-tolerance\",20),has.add(\"heatmap-allow-raster-fallback\",!1),has.add(\"heatmap-force-raster\",!1),has(\"host-webworker\")||has(\"host-browser\")&&(has.add(\"esri-csp-restrictions\",(()=>{try{new Function}catch{return!0}return!1})),has.add(\"esri-image-decode\",(()=>{if(\"decode\"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,',void e.decode().then((()=>{has.add(\"esri-image-decode\",!0,!0,!0)})).catch((()=>{has.add(\"esri-image-decode\",!1,!0,!0)}))}return!1})),has.add(\"esri-url-encodes-apostrophe\",(()=>{const e=window.document.createElement(\"a\");return e.href=\"?'\",e.href.includes(\"?%27\")})))})();export{has as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass t{constructor(t=1){this._seed=t}set seed(e){this._seed=e??Math.random()*t._m}getInt(){return this._seed=(t._a*this._seed+t._c)%t._m,this._seed}getFloat(){return this.getInt()/(t._m-1)}getIntRange(t,e){return Math.round(this.getFloatRange(t,e))}getFloatRange(e,s){const n=s-e;return e+this.getInt()/t._m*n}}t._m=2147483647,t._a=48271,t._c=0;export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport n from\"./RandomLCG.js\";const t=1.5,e=1/t,r=.5;function o(n,t){if(!t)return n;for(const e of t)n.push(e);return n}function l(n){if(!n)return;return n.length>0?n[0]:void 0}function u(n){if(!n)return;const t=n.length;return t>0?n[t-1]:void 0}function f(n){return n}function i(n,t=f){if(!n||0===n.length)return;let e=n[0],r=t(e);for(let o=1;or&&(r=u,e=l)}return e}function c(n,t=f){return i(n,(n=>-t(n)))}function s(n,t){return t?n.filter(((n,e,r)=>r.findIndex(t.bind(null,n))===e)):Array.from(new Set(n))}function h(n,t,e){if(null==n&&null==t)return!0;if(null==n||null==t||n.length!==t.length)return!1;if(e){for(let r=0;r!n.some((n=>e(n,t))))),o=n.filter((n=>!t.some((t=>e(t,n)))))):(r=t.filter((t=>!n.includes(t))),o=n.filter((n=>!t.includes(n)))),{added:r,removed:o}}function d(n,t,e){return n&&t?e?n.filter((n=>t.findIndex((t=>e(n,t)))>-1)):n.filter((n=>t.includes(n))):[]}function p(n){return n&&\"number\"==typeof n.length}function m(n,t){const e=n.length;if(0===e)return[];const r=[];for(let o=0;on[e]?o=e+1:l=e}const u=n[o];return e?t>=n[r-1]?-1:u===t?o:o-1:u===t?o:-1}function A(n,t,e){if(!n||0===n.length)return;const r=n.length-1,o=n[0];if(t<=e(o))return o;const l=n[r];if(t>=e(l))return l;let u=0,f=0,i=r;for(;u0){const r=n[f-1],u=e(r);if(t>u)return t-u>=l-t?o:r}i=f}else{if(f=u-t?r:o}u=f+1}}return n[f]}class v{constructor(){this.last=0}}const b=new v;function S(n,t,e,r){r=r||b;const o=Math.max(0,r.last-10);for(let u=o;u=r)return n.slice(0);const o=G(e),l=new Set,u=[];for(;u.lengthN.getFloat()):Math.random}function L(n,t){const e=G(t);for(let r=n.length-1;r>0;r--){const t=Math.floor(e()*(r+1)),o=n[r];n[r]=n[t],n[t]=o}return n}const N=new n;function O(n,t){const e=n.indexOf(t);return-1!==e?(n.splice(e,1),t):null}function R(n,t){const e=new Map,r=n.length;for(let o=0;ot+(o?y(o)?n(o,r()):o.byteLength+p:0)),0)}const p=145,U=1024;function b(n){return m(n)||s(n)||a(n)||c(n)||o(n)}function l(n){return m(n)||s(n)}function I(n){return m(n)?179769e303:s(n)?3402823e32:f(n)?4294967295:i(n)?65535:u(n)||e(n)?255:a(n)?2147483647:c(n)?32767:o(n)?127:256}export{A as estimateSize,y as isArray,t as isArrayBuffer,l as isFloat,s as isFloat32Array,m as isFloat64Array,c as isInt16Array,a as isInt32Array,o as isInt8Array,b as isSigned,i as isUint16Array,f as isUint32Array,u as isUint8Array,e as isUint8ClampedArray,I as maximumValue,U as nativeArrayMaxSize,p as typedArrayStaticSize};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{equals as t}from\"./arrayUtils.js\";import{isInt8Array as n,isUint8Array as e,isUint8ClampedArray as r,isInt16Array as o,isUint16Array as f,isInt32Array as i,isUint32Array as u,isFloat32Array as c,isFloat64Array as s}from\"./typedArrayUtil.js\";function l(t,n){let e;if(n)for(e in t)t.hasOwnProperty(e)&&(void 0===t[e]?delete t[e]:t[e]instanceof Object&&l(t[e],!0));else for(e in t)t.hasOwnProperty(e)&&void 0===t[e]&&delete t[e];return t}function a(t){if(!t||\"object\"!=typeof t||\"function\"==typeof t)return t;const n=O(t);if(null!=n)return n;if(y(t))return t.clone();if(m(t))return t.map(a);if(b(t))return t.clone();const e={};for(const r of Object.getOwnPropertyNames(t))e[r]=a(t[r]);return e}function p(t){if(!t||\"object\"!=typeof t||\"function\"==typeof t||\"HTMLElement\"in globalThis&&t instanceof HTMLElement)return t;const n=O(t);if(null!=n)return n;if(m(t)){let n=!0;const e=t.map((t=>{const e=p(t);return null!=t&&null==e&&(n=!1),e}));return n?e:null}if(y(t))return t.clone();if(t instanceof File||t instanceof Blob)return t;if(!b(t)){const n=new(0,Object.getPrototypeOf(t).constructor);for(const e of Object.getOwnPropertyNames(t)){const r=t[e],o=p(r);if(null!=r&&null==o)return null;n[e]=o}return n}return null}function y(t){return\"function\"==typeof t.clone}function m(t){return\"function\"==typeof t.map&&\"function\"==typeof t.forEach}function b(t){return\"function\"==typeof t.notifyChange&&\"function\"==typeof t.watch}function g(t){if(\"[object Object]\"!==Object.prototype.toString.call(t))return!1;const n=Object.getPrototypeOf(t);return null===n||n===Object.prototype}function O(t){if(n(t)||e(t)||r(t)||o(t)||f(t)||i(t)||u(t)||c(t)||s(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof ArrayBuffer){return t.slice(0,t.byteLength)}if(t instanceof Map){const n=new Map;for(const[e,r]of t)n.set(e,a(r));return n}if(t instanceof Set){const n=new Set;for(const e of t)n.add(a(e));return n}return null}function j(t,n){return t===n||\"number\"==typeof t&&isNaN(t)&&\"number\"==typeof n&&isNaN(n)||\"function\"==typeof t?.getTime&&\"function\"==typeof n?.getTime&&t.getTime()===n.getTime()||!1}function h(n,e){return n===e||(null==n||\"string\"==typeof n?n===e:\"number\"==typeof n?n===e||\"number\"==typeof e&&isNaN(n)&&isNaN(e):n instanceof Date?e instanceof Date&&n.getTime()===e.getTime():Array.isArray(n)?Array.isArray(e)&&t(n,e):n instanceof Set?e instanceof Set&&N(n,e):n instanceof Map?e instanceof Map&&T(n,e):!!g(n)&&(g(e)&&w(n,e)))}function w(t,n){if(null===t||null===n)return!1;const e=Object.keys(t);if(null===n||Object.keys(n).length!==e.length)return!1;for(const r of e)if(t[r]!==n[r]||!Object.prototype.hasOwnProperty.call(n,r))return!1;return!0}function N(t,n){if(t.size!==n.size)return!1;for(const e of t)if(!n.has(e))return!1;return!0}function T(t,n){if(t.size!==n.size)return!1;for(const[e,r]of t){const t=n.get(e);if(t!==r||void 0===t&&!n.has(e))return!1}return!0}export{a as clone,j as equals,h as equalsShallow,l as fixJson,b as isAccessorLike,y as isClonable,g as isPlainObject,p as tryClone};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as r}from\"./lang.js\";function n(r,n,t=!1){return i(r,n,t)}function t(r,n){if(null!=n)return n[r]||e(r.split(\".\"),!1,n)}function o(r,n,t){const o=r.split(\".\"),i=o.pop(),u=e(o,!0,t);u&&i&&(u[i]=n)}function e(r,n,t){let o=t;for(const e of r){if(null==o)return;if(!(e in o)){if(!n)return;o[e]={}}o=o[e]}return o}function i(n,t,o){return t?Object.keys(t).reduce(((n,e)=>{let u=n[e],c=t[e];return u===c?n:void 0===u?(n[e]=r(c),n):(Array.isArray(c)||Array.isArray(n)?(u=u?Array.isArray(u)?n[e]=u.concat():n[e]=[u]:n[e]=[],c&&(Array.isArray(c)||(c=[c]),o?c.forEach((r=>{u.includes(r)||u.push(r)})):n[e]=c.concat())):c&&\"object\"==typeof c?n[e]=i(u,c,o):n.hasOwnProperty(e)&&!t.hasOwnProperty(e)||(n[e]=c),n)}),n||{}):n}export{n as deepMerge,t as getDeepValue,o as setDeepValue};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"./core/has.js\";import{deepMerge as e}from\"./core/object.js\";const s={apiKey:void 0,applicationName:\"\",applicationUrl:globalThis.location?.href,assetsPath:\"\",fontsUrl:\"https://static.arcgis.com/fonts\",geometryServiceUrl:\"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer\",geoRSSServiceUrl:\"https://utility.arcgis.com/sharing/rss\",kmlServiceUrl:\"https://utility.arcgis.com/sharing/kml\",userPrivilegesApplied:!0,portalUrl:\"https://www.arcgis.com\",routeServiceUrl:\"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World\",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:[\"arcgis.com\",\"arcgisonline.com\",\"esrikr.com\",\"premiumservices.blackbridge.com\",\"esripremium.accuweather.com\",\"gbm.digitalglobe.com\",\"firstlook.digitalglobe.com\",\"msi.digitalglobe.com\"],interceptors:[],maxUrlLength:2e3,priority:\"high\",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e=\"4.28\";s.assetsPath=`https://js.arcgis.com/${e}/@arcgis/core/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getDeepValue as t}from\"./object.js\";const e=/\\{([^\\}]+)\\}/g;function n(t){return t??\"\"}function r(r,o){return o?r.replaceAll(e,\"object\"==typeof o?(e,r)=>n(t(r,o)):(t,e)=>n(o(e))):r}function o(t,e){return t.replaceAll(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+\\-^])/g,(t=>e&&e.includes(t)?t:`\\\\${t}`))}function c(t){let e=0;for(let n=0;ne._loggedMessages.warn.clear()}}static get test(){return{resetLoggers(e=new Map){const t=s._loggers;return s._loggers=e,t},set throttlingDisabled(e){s._throttlingDisabled=e}}}static getLogger(e){return e=\"string\"!=typeof e?e.declaredClass:e,s._loggers.get(e)||new s({module:e})}_log(t,r,...n){if(!this._matchLevel(t))return;if(\"always\"!==r&&!s._throttlingDisabled){const e=this._argsToKey(n),o=this._loggedMessages[t].get(e);if(\"once\"===r&&null!=o||\"oncePerTick\"===r&&o&&o>=s._tickCounter)return;this._loggedMessages[t].set(e,s._tickCounter),s._scheduleTickCounterIncrement()}for(const s of e.log.interceptors)if(s(t,this.module,...n))return;this._inheritedWriter()(t,this.module,...n)}_parentWithMember(e,t){let r=this;for(;null!=r;){const t=r[e];if(null!=t)return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember(\"writer\",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(t){const s=e.log.level||\"warn\";return r[this._parentWithMember(\"level\",s)]<=r[t]}_argsToKey(...e){const r=(e,t)=>\"object\"!=typeof t||Array.isArray(t)?t:\"[Object]\";return t(JSON.stringify(e,r))}static _scheduleTickCounterIncrement(){s._tickCounterScheduled||(s._tickCounterScheduled=!0,Promise.resolve().then((()=>{s._tickCounter++,s._tickCounterScheduled=!1})))}}s._loggers=new Map,s._tickCounter=0,s._tickCounterScheduled=!1,s._throttlingDisabled=!1;export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(n,t){for(const[r,o]of n)if(t(o,r))return!0;return!1}function t(n,t){for(const[r,o]of n)if(t(o,r))return o;return null}function r(n,t,r){const o=n.get(t);if(void 0!==o)return o;const u=r();return n.set(t,u),u}function o(n){const t=n.values().next();return!0!==t.done?t.value:null}export{t as findInMap,o as first,r as getOrCreateMapValue,n as someMap};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../has.js\";import e from\"../Logger.js\";import{getOrCreateMapValue as n}from\"../MapUtils.js\";const r=e.getLogger(\"esri.core.accessorSupport.ensureTypes\");function t(e){return null==e?e:new Date(e)}function o(e){return null==e?e:!!e}function u(e){return null==e?e:e.toString()}function a(e){return null==e?e:(e=parseFloat(e),isNaN(e)?0:e)}function s(e){return null==e?e:Math.round(parseFloat(e))}function i(e){return e?.constructor&&void 0!==e.constructor.__accessorMetadata__}function c(e,n){return null!=n&&e&&!(n instanceof e)}function l(e){return e&&\"isCollection\"in e}function f(e){return e?.Type?\"function\"==typeof e.Type?e.Type:e.Type.base:null}function p(e,n){if(!n?.constructor||!l(n.constructor))return y(e,n)?n:new e(n);const r=f(e.prototype.itemType),t=f(n.constructor.prototype.itemType);return r?t?r===t?n:r.prototype.isPrototypeOf(t.prototype)?new e(n):(y(e,n),n):new e(n):n}function y(e,n){return!!i(n)&&(r.error(\"Accessor#set\",\"Assigning an instance of '\"+(n.declaredClass||\"unknown\")+\"' which is not a subclass of '\"+g(e)+\"'\"),!0)}function v(e,n){return null==n?n:l(e)?p(e,n):c(e,n)?y(e,n)?n:new e(n):n}function g(e){return e?.prototype?.declaredClass||\"unknown\"}const h=new WeakMap;function m(e){switch(e){case Number:return a;case T:return s;case Boolean:return o;case String:return u;case Date:return t;default:return n(h,e,(()=>v.bind(null,e)))}}function d(e,n){const r=m(e);return 1===arguments.length?r:r(n)}function b(e,n,r){return 1===arguments.length?b.bind(null,e):n?Array.isArray(n)?n.map((n=>e(n,r))):[e(n,r)]:n}function w(e,n){return 1===arguments.length?b((n=>d(e,n))):b((n=>d(e,n)),n)}function A(e,n,r){return 0!==n&&Array.isArray(r)?r.map((r=>A(e,n-1,r))):e(r)}function $(e,n,r){if(2===arguments.length)return r=>$(e,n,r);if(!r)return r;r=A(e,n,r);let t=n,o=r;for(;t>0&&Array.isArray(o);)t--,o=o[0];if(void 0!==o)for(let u=0;ud(e,n)),n):$((n=>d(e,n)),n,r)}function k(e){return!!Array.isArray(e)&&!e.some((n=>{const r=typeof n;return!(\"string\"===r||\"number\"===r||\"function\"===r&&e.length>1)}))}function M(e,n){if(2===arguments.length)return M(e).call(null,n);const t=new Set,o=e.filter((e=>\"function\"!=typeof e)),u=e.filter((e=>\"function\"==typeof e));for(const r of e)\"string\"!=typeof r&&\"number\"!=typeof r||t.add(r);let a=null,s=null;return(e,n)=>{if(null==e)return e;const i=typeof e,l=\"string\"===i||\"number\"===i;return l&&(t.has(e)||u.some((e=>\"string\"===i&&e===String||\"number\"===i&&e===Number)))||\"object\"===i&&u.some((n=>!c(e,n)))?e:(l&&o.length?(a||(a=o.map((e=>\"string\"==typeof e?`'${e}'`:`${e}`)).join(\", \")),r.error(\"Accessor#set\",`'${e}' is not a valid value for this property, only the following values are valid: ${a}`)):\"object\"==typeof e&&u.length?(s||(s=u.map((e=>g(e))).join(\", \")),r.error(\"Accessor#set\",`'${e}' is not a valid value for this property, value must be one of ${s}`)):r.error(\"Accessor#set\",`'${e}' is not a valid value for this property`),n&&(n.valid=!1),null)}}function S(e,n){if(2===arguments.length)return S(e).call(null,n);const t={},o=[],u=[];for(const r in e.typeMap){const n=e.typeMap[r];t[r]=d(n),o.push(g(n)),u.push(r)}const a=()=>`'${o.join(\"', '\")}'`,s=()=>`'${u.join(\"', '\")}'`,l=\"string\"==typeof e.key?n=>n[e.key]:e.key;return n=>{if(e.base&&!c(e.base,n))return n;if(null==n)return n;const o=l(n)||e.defaultKeyValue,u=t[o];if(!u)return r.error(\"Accessor#set\",`Invalid property value, value needs to be one of ${a()}, or a plain object that can autocast (having .type = ${s()})`),null;if(!c(e.typeMap[o],n))return n;if(\"string\"==typeof e.key&&!i(n)){const r={};for(const t in n)t!==e.key&&(r[t]=n[t]);return u(r)}return u(n)}}class T{}const N={native:e=>({type:\"native\",value:e}),array:e=>({type:\"array\",value:e}),oneOf:e=>({type:\"one-of\",values:e})};function _(e){if(!e||!(\"type\"in e))return!1;switch(e.type){case\"native\":case\"array\":case\"one-of\":return!0}return!1}function B(e){switch(e.type){case\"native\":return d(e.value);case\"array\":return b(B(e.value));case\"one-of\":return C(e);default:return null}}function C(e){let n=null;return(t,o)=>F(t,e)?t:(null==n&&(n=D(e)),r.error(\"Accessor#set\",`Invalid property value, value needs to be of type ${n}`),o&&(o.valid=!1),null)}function D(e){switch(e.type){case\"native\":switch(e.value){case Number:return\"number\";case String:return\"string\";case Boolean:return\"boolean\";case T:return\"integer\";case Date:return\"date\";default:return g(e.value)}case\"array\":return`array of ${D(e.value)}`;case\"one-of\":{const n=e.values.map((e=>D(e)));return`one of ${n.slice(0,-1)} or ${n[n.length-1]}`}}return\"unknown\"}function F(e,n){if(null==e)return!0;switch(n.type){case\"native\":switch(n.value){case Number:case T:return\"number\"==typeof e;case Boolean:return\"boolean\"==typeof e;case String:return\"string\"==typeof e}return e instanceof n.value;case\"array\":return!!Array.isArray(e)&&!e.some((e=>!F(e,n.value)));case\"one-of\":return n.values.some((n=>F(e,n)))}}export{T as Integer,w as ensureArray,b as ensureArrayTyped,o as ensureBoolean,v as ensureClass,t as ensureDate,s as ensureInteger,B as ensureLongFormType,j as ensureNArray,$ as ensureNArrayTyped,a as ensureNumber,M as ensureOneOf,S as ensureOneOfType,u as ensureString,d as ensureType,i as isClassedType,_ as isLongFormType,k as isOneOf,c as requiresType,N as types};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n={remove:()=>{}};function e(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function r(n){n.forEach((n=>n?.remove()))}function t(n){return e((()=>r(n)))}function o(n){return e((()=>n()?.remove()))}function u(n){return e((()=>n?.abort()))}function c(n){return e(null!=n?()=>n.destroy():void 0)}function i(n,r){const t=setTimeout(n,r);return e((()=>clearTimeout(t)))}function l(n,r){let t=!1,o=null;return n.then((n=>{t?n.remove():o=n})),e((()=>{t=!0,null!=o?o.remove():null!=r&&(r.abort(),r=null)}))}export{u as abortHandle,l as asyncHandle,c as destroyHandle,t as handlesGroup,e as makeHandle,o as refHandle,r as removeHandles,i as timeoutHandle};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{handlesGroup as r}from\"../handleUtils.js\";import{clone as n}from\"../lang.js\";function t(r){return r.__accessor__??null}function e(r,n){return null!=r?.metadatas?.[n]}function i(r,n){const e=t(r);return e?e.getDependsInfo(r,n,\"\"):\"\"}function u(r,n,t){if(t){return o(r,n,{policy:t,path:\"\"})}return o(r,n,null)}function o(r,t,e){return t?Object.keys(t).reduce(((r,i)=>{const u=i;let s=null,a=\"merge\";if(e&&(s=e.path?`${e.path}.${i}`:i,a=e.policy(s)),\"replace\"===a)return r[u]=t[u],r;if(\"replace-arrays\"===a&&Array.isArray(r[u]))return r[u]=t[u],r;if(void 0===r[u])return r[u]=n(t[u]),r;let l=r[u],c=t[u];if(l===c)return r;if(Array.isArray(c)||Array.isArray(r))l=l?Array.isArray(l)?r[u]=l.concat():r[u]=[l]:r[u]=[],c&&(Array.isArray(c)||(c=[c]),c.forEach((r=>{l.includes(r)||l.push(r)})));else if(c&&\"object\"==typeof c)if(e){const n=e.path;e.path=s,r[u]=o(l,c,e),e.path=n}else r[u]=o(l,c,null);else r.hasOwnProperty(i)&&!t.hasOwnProperty(i)||(r[u]=c);return r}),r||{}):r}function s(r){return r&&(\"string\"!=typeof r||r.includes(\".\"))?a(r):r}function a(r){return Array.isArray(r)?r:r.split(\".\")}function l(r){return r.includes(\",\")?r.split(\",\").map((r=>r.trim())):[r.trim()]}function c(r){if(Array.isArray(r)){const n=[];for(const t of r)n.push(...l(t));return n}return l(r)}function f(r){if(!r.includes(\"?\"))return null;const n=a(r),t=new Array(n.length);for(let e=0;ei(n,r,e)));return r(t)}return i(n,u[0],e)}export{i as getDependsInfo,t as getProperties,e as isPropertyDeclared,u as merge,p as parse,f as parseConditionalPath,a as pathToArray,s as pathToStringOrArray,c as splitPath};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{pathToArray as t,getProperties as n,isPropertyDeclared as r}from\"./utils.js\";function e(t,e){const i=\"?\"===t[t.length-1]?t.slice(0,-1):t;if(null!=e.getItemAt||Array.isArray(e)){const t=parseInt(i,10);if(!isNaN(t))return Array.isArray(e)?e[t]:e.at(t)}const u=n(e);return r(u,i)?u.get(i):e[i]}function i(t,n,r){if(null==t)return t;const u=e(n[r],t);return!u&&r{if(\"\"===r)return\"$\";const n=t(r,e);return(n??\"\").toString()}))}class e{constructor(t,e,r){this.name=t,this.details=r,this.message=(e&&s(e,r))??\"\"}toString(){return\"[\"+this.name+\"]: \"+this.message}}export{e as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as e}from\"./lang.js\";import t from\"./Logger.js\";import r from\"./Message.js\";class s extends r{constructor(e,t,r){super(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((t,r)=>{if(r&&\"object\"==typeof r&&\"function\"==typeof r.toJSON)return r;try{return e(r)}catch(s){return\"[object]\"}})))}}catch(r){throw t.getLogger(\"esri.core.Error\").error(r),r}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new s(e.name,e.message,e.details)}}s.prototype.type=\"error\";export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport o from\"../Error.js\";import has from\"../has.js\";import\"../Logger.js\";import{get as r}from\"./get.js\";function t(o,e,s){if(o&&e)if(\"object\"==typeof e)for(const r of Object.getOwnPropertyNames(e))t(o,r,e[r]);else{if(e.includes(\".\")){const n=e.split(\".\"),i=n.splice(-1,1)[0];return void t(r(o,n),i,s)}const i=o.__accessor__;null!=i&&n(e,i),o[e]=s}}function n(r,t){if(has(\"esri-unknown-property-errors\")&&!e(r,t))throw new o(\"set:unknown-property\",s(r,t))}function e(o,r){return null!=r.metadatas[o]}function s(o,r){return\"setting unknown property '\"+o+\"' on instance of \"+r.host.declaredClass}export{t as set};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../Logger.js\";import{ensureArrayTyped as e,ensureOneOfType as r,isLongFormType as n,ensureLongFormType as o,isOneOf as s,ensureOneOf as i,ensureNArrayTyped as a,ensureArray as p,ensureNArray as u,ensureType as c}from\"../ensureType.js\";import{get as f}from\"../get.js\";import{getPropertyMetadata as l,mergeProperty as g}from\"../metadata.js\";import{set as m}from\"../set.js\";function y(n={}){return(o,s)=>{if(o===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${o.name}.${s}. Accessor does not support static properties.`);const i=Object.getOwnPropertyDescriptor(o,s),a=l(o,s);i&&(i.get||i.set?(a.get=i.get||a.get,a.set=i.set||a.set):\"value\"in i&&(\"value\"in n&&t.getLogger(\"esri.core.accessorSupport.decorators.property\").warn(`@property() will redefine the value of \"${s}\" on \"${o.constructor.name}\" already defined in the metadata`,n),a.value=n.value=i.value)),null!=n.readOnly&&(a.readOnly=n.readOnly);const p=n.aliasOf;if(p){const t=\"string\"==typeof p?p:p.source,e=\"string\"==typeof p?null:!0===p.overridable;let r;a.dependsOn=[t],a.get=function(){let e=f(this,t);if(\"function\"==typeof e){r||(r=t.split(\".\").slice(0,-1).join(\".\"));const n=f(this,r);n&&(e=e.bind(n))}return e},a.readOnly||(a.set=e?function(t){this._override(s,t)}:function(e){m(this,t,e)})}const u=n.type,c=n.types;a.cast||(u?a.cast=h(u):c&&(Array.isArray(c)?a.cast=e(r(c[0])):a.cast=r(c))),g(a,n),n.range&&(a.cast=j(a.cast,n.range))}}function d(t,e,r){const n=l(t,r);n.json||(n.json={});let o=n.json;return void 0!==e&&(o.origins||(o.origins={}),o.origins[e]||(o.origins[e]={}),o=o.origins[e]),o}function h(t){let e=0,r=t;if(n(t))return o(t);for(;Array.isArray(r)&&1===r.length&&\"string\"!=typeof r[0]&&\"number\"!=typeof r[0];)r=r[0],e++;const f=r;if(s(f))return 0===e?i(f):a(i(f),e);if(1===e)return p(f);if(e>1)return u(f,e);const l=t;return l.from?l.from:c(l)}function j(t,e){return r=>{let n=+t(r);return null!=e.step&&(n=Math.round(n/e.step)*e.step),null!=e.min&&(n=Math.max(e.min,n)),null!=e.max&&(n=Math.min(e.max,n)),n}}export{j as ensureRange,y as property,d as propertyJSONMeta};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst o=Symbol(\"Accessor-beforeDestroy\");export{o as beforeDestroySymbol};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar I;!function(I){I[I.INITIALIZING=0]=\"INITIALIZING\",I[I.CONSTRUCTING=1]=\"CONSTRUCTING\",I[I.CONSTRUCTED=2]=\"CONSTRUCTED\"}(I||(I={}));export{I as Lifecycle};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar i;!function(i){i[i.Dirty=1]=\"Dirty\",i[i.Overriden=2]=\"Overriden\",i[i.Computing=4]=\"Computing\",i[i.NonNullable=8]=\"NonNullable\",i[i.HasDefaultValue=16]=\"HasDefaultValue\",i[i.DepTrackingInitialized=32]=\"DepTrackingInitialized\",i[i.AutoTracked=64]=\"AutoTracked\",i[i.ExplicitlyTracking=128]=\"ExplicitlyTracking\"}(i||(i={}));export{i as Flags};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../has.js\";import t from\"../Logger.js\";import{pathToArray as n,getProperties as r}from\"./utils.js\";import{Flags as e}from\"./tracking/Flags.js\";const o={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},c=[];let i=o;function s(t){i.onObservableAccessed(t)}let l=!1,a=!1;function f(t,n,r){if(l)return u(t,n,r);p(t);const e=n.call(r);return d(),e}function g(t,n){return f(o,t,n)}function u(n,r,e){const o=l;l=!0,p(n);let c=null;try{c=r.call(e)}catch(i){a&&t.getLogger(\"esri.core.accessorSupport.tracking\").error(i)}return d(),l=o,c}function p(t){i=t,c.push(t)}function d(){const t=c.length;if(t>1){const n=c.pop();i=c[t-2],n.onTrackingEnd()}else if(1===t){const t=c.pop();i=o,t.onTrackingEnd()}else i=o}function m(t,n){if(n.flags&e.DepTrackingInitialized)return;const r=a;a=!1,n.flags&e.AutoTracked?u(n,n.metadata.get,t):k(t,n),a=r}const y=[];function k(t,r){r.flags&e.ExplicitlyTracking||(r.flags|=e.ExplicitlyTracking,u(r,(()=>{const e=r.metadata.dependsOn||y;for(const r of e)if(\"string\"!=typeof r||r.includes(\".\")){const e=n(r);for(let n=0,r=t;n{o[n]=s})),delete o[n]}}}export{n as process};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"./Message.js\";class s extends e{constructor(e,s,t){super(e,s,t)}}s.prototype.type=\"warning\";export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e){return!!e&&e.prototype?.declaredClass&&0===e.prototype.declaredClass.indexOf(\"esri.core.Collection\")}export{e as isCollection};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../Logger.js\";import{setDeepValue as e}from\"../../../object.js\";import r from\"../../../Warning.js\";import{getPropertiesMetadata as n}from\"../../metadata.js\";import{isCollection as o}from\"./type.js\";const i=t.getLogger(\"esri.core.accessorSupport.extensions.serializableProperty.reader\");function p(t,r,n){t&&(!n&&!r.read||r.read?.reader||!1===r.read?.enabled||l(t)&&e(\"read.reader\",u(t),r))}function u(t){const e=t.ndimArray??0;if(e>1)return c(t);if(1===e)return a(t);if(\"type\"in t&&d(t.type)){const e=t.type.prototype?.itemType?.Type,r=a(\"function\"==typeof e?{type:e}:{types:e});return(e,n,o)=>{const i=r(e,n,o);return i?new t.type(i):i}}return s(t)}function s(t){return\"type\"in t?y(t.type):g(t.types)}function y(t){return t.prototype.read?(e,r,n)=>{if(null==e)return e;const o=typeof e;if(\"object\"!==o)return void i.error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${o}'`);const p=new t;return p.read(e,n),p}:t.fromJSON}function f(t,e,r,n){return 0!==n&&Array.isArray(e)?e.map((e=>f(t,e,r,n-1))):t(e,void 0,r)}function c(t){const e=s(t),r=f.bind(null,e),n=t.ndimArray??0;return(t,e,o)=>{if(null==t)return t;t=r(t,o,n);let i=n,p=t;for(;i>0&&Array.isArray(p);)i--,p=p[0];if(void 0!==p)for(let r=0;r{if(null==t)return t;if(Array.isArray(t)){const r=[];for(const o of t){const t=e(o,void 0,n);void 0!==t&&r.push(t)}return r}const o=e(t,void 0,n);return void 0!==o?[o]:void 0}}function d(t){if(!o(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&(\"function\"==typeof e.Type?m(e.Type):j(e.Type))}function l(t){return\"types\"in t?j(t.types):m(t.type)}function m(t){return!Array.isArray(t)&&(!!t&&t.prototype&&(\"read\"in t.prototype||\"fromJSON\"in t||d(t)))}function j(t){for(const e in t.typeMap){if(!m(t.typeMap[e]))return!1}return!0}function g(t){let e=null;const n=t.errorContext??\"type\",o=t.validate;return(p,u,s)=>{if(null==p)return p;const y=typeof p;if(\"object\"!==y)return void i.error(`Expected JSON value of type 'object' to deserialize, but got '${y}'`);e||(e=v(t));const f=t.key;if(\"string\"!=typeof f)return;const c=p[f],a=c?e[c]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!a){const t=`Type '${c||\"unknown\"}' is not supported`;return s?.messages&&p&&s.messages.push(new r(`${n}:unsupported`,t,{definition:p,context:s})),void i.error(t)}const d=new a;return d.read(p,s),o?o(d):d}}function v(t){const e={};for(const r in t.typeMap){const o=t.typeMap[r],i=n(o.prototype);if(\"function\"==typeof t.key)continue;const p=i[t.key];if(!p)continue;p.json?.type&&Array.isArray(p.json.type)&&1===p.json.type.length&&\"string\"==typeof p.json.type[0]&&(e[p.json.type[0]]=o);const u=p.json?.write;if(!u?.writer){e[r]=o;continue}const s=u.target,y=\"string\"==typeof s?s:t.key,f={};u.writer(r,f,y),f[y]&&(e[f[y]]=o)}return e}export{p as create,u as createTypeReader};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e){if(e.json||(e.json={}),o(e.json),n(e.json),r(e.json),e.json.origins)for(const t in e.json.origins)o(e.json.origins[t]),n(e.json.origins[t]),r(e.json.origins[t]);return!0}function r(e){e.name&&(e.read&&\"object\"==typeof e.read?void 0===e.read.source&&(e.read.source=e.name):e.read={source:e.name},e.write&&\"object\"==typeof e.write?void 0===e.write.target&&(e.write.target=e.name):e.write={target:e.name})}function o(e){\"boolean\"==typeof e.read?e.read={enabled:e.read}:\"function\"==typeof e.read?e.read={enabled:!0,reader:e.read}:e.read&&\"object\"==typeof e.read&&void 0===e.read.enabled&&(e.read.enabled=!0)}function n(e){\"boolean\"==typeof e.write?e.write={enabled:e.write}:\"function\"==typeof e.write?e.write={enabled:!0,writer:e.write}:e.write&&\"object\"==typeof e.write&&void 0===e.write.enabled&&(e.write.enabled=!0)}export{e as process};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"../../../Error.js\";import e from\"../../../Logger.js\";import{setDeepValue as t}from\"../../../object.js\";import{isCollection as n}from\"./type.js\";function i(r,e){if(!e.write||e.write.writer||!1===e.write.enabled&&!e.write.overridePolicy)return;const t=r?.ndimArray??0;r&&(1===t||\"type\"in r&&n(r.type))?e.write.writer=a:t>1?e.write.writer=l(t):e.types?Array.isArray(e.types)?e.write.writer=f(e.types[0]):e.write.writer=o(e.types):e.write.writer=s}function o(r){return(e,t,n,i)=>e?u(e,r,i)?s(e,t,n,i):void 0:s(e,t,n,i)}function u(t,n,i){for(const r in n.typeMap)if(t instanceof n.typeMap[r])return!0;if(i?.messages){const o=n.errorContext??\"type\",u=`Values of type '${(\"function\"!=typeof n.key?t[n.key]:t.declaredClass)??\"Unknown\"}' cannot be written`;i&&i.messages&&t&&i.messages.push(new r(`${o}:unsupported`,u,{definition:t,context:i})),e.getLogger(\"esri.core.accessorSupport.extensions.serializableProperty.writer\").error(u)}return!1}function f(r){return(e,t,n,i)=>{if(!e||!Array.isArray(e))return s(e,t,n,i);return s(e.filter((e=>u(e,r,i))),t,n,i)}}function s(r,e,n,i){t(n,p(r,i),e)}function p(r,e){return r&&\"function\"==typeof r.write?r.write({},e):r&&\"function\"==typeof r.toJSON?r.toJSON():\"number\"==typeof r?y(r):r}function y(r){return r===-1/0?-Number.MAX_VALUE:r===1/0?Number.MAX_VALUE:isNaN(r)?null:r}function a(r,e,n,i){let o;null===r?o=null:r&&\"function\"==typeof r.map?(o=r.map((r=>p(r,i))),\"function\"==typeof o.toArray&&(o=o.toArray())):o=[p(r,i)],t(n,o,e)}function c(r,e,t){return 0!==t&&Array.isArray(r)?r.map((r=>c(r,e,t-1))):p(r,e)}function l(r){return(e,n,i,o)=>{let u;if(null===e)u=null;else{u=c(e,o,r);let t=r,n=u;for(;t>0&&Array.isArray(n);)t--,n=n[0];if(void 0!==n)for(let r=0;r{t??=\"esri.core.Accessor\",o.prototype.declaredClass=t,l(o);const s=[],c=[];let a=o.prototype;for(;a;)a.hasOwnProperty(\"initialize\")&&!i.has(a.initialize)&&(i.add(a.initialize),s.push(a.initialize)),a.hasOwnProperty(\"destroy\")&&!n.has(a.destroy)&&(n.add(a.destroy),c.push(a.destroy)),a=Object.getPrototypeOf(a);i.clear(),n.clear();const p=class extends o{constructor(...t){if(super(...t),this.constructor===p&&\"function\"==typeof this.postscript){if(s.length&&Object.defineProperty(this,\"initialize\",{enumerable:!1,configurable:!0,value(){for(let e=s.length-1;e>=0;e--)s[e].call(this)}}),c.length){let t=!1;const r=this[e];Object.defineProperty(this,\"destroy\",{enumerable:!1,configurable:!0,value(){if(!t){t=!0,r.call(this);for(let e=0;e{r+=e.length})),r}add(e,t){if(r(e)){const r=this._getOrCreateGroup(t);for(const t of e)this._isHandle(t)&&r.push(t)}else if(this._isHandle(e)){this._getOrCreateGroup(t).push(e)}return this}forEach(r,e){if(\"function\"==typeof r)this._groups.forEach((e=>e.forEach(r)));else{const t=this._getGroup(r);t&&e&&t.forEach(e)}}has(r){return this._groups.has(this._ensureGroupKey(r))}remove(e){if(\"string\"!=typeof e&&r(e)){for(const r of e)this.remove(r);return this}return this.has(e)?(this._removeAllFromGroup(this._getGroup(e)),this._groups.delete(this._ensureGroupKey(e)),this):this}removeAll(){return this._groups.forEach((r=>this._removeAllFromGroup(r))),this._groups.clear(),this}_isHandle(r){return r&&(!!r.remove||r instanceof e)}_getOrCreateGroup(r){if(this.has(r))return this._getGroup(r);const e=[];return this._groups.set(this._ensureGroupKey(r),e),e}_getGroup(r){return this._groups.get(this._ensureGroupKey(r))}_ensureGroupKey(r){return r||\"_default_\"}_removeAllFromGroup(r){for(const t of r)t instanceof e?t.removeAll():t.remove()}}export{e as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(n,u){if(null==n)throw new Error(u??\"value is None\")}function u(n){return n?.destroy(),null}function r(n){return n?.dispose(),null}function l(n){return n?.remove(),null}function e(n){return n?.abort(),null}function t(n){return n?.release(),null}function o(n,u,r){return null!=n&&null!=u?null!=r?r(n,u):n.equals(u):n===u}function i(n,u){return n?.[u]}function f(n,u){let r;return n.some(((n,l)=>(r=u(n,l),null!=r))),r??void 0}export{e as abortMaybe,n as assertIsSome,u as destroyMaybe,r as disposeMaybe,o as equalsMaybe,f as mappedFind,i as maybeProperty,t as releaseMaybe,l as removeMaybe};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction t(t){return t?.release&&\"function\"==typeof t.release}function i(t){return t?.acquire&&\"function\"==typeof t.acquire}class e{constructor(t,i,e,o=1,s=0){if(this._ctor=t,this._acquireFunction=i,this._releaseFunction=e,this.allocationSize=o,this._pool=new Array(s),this._initialSize=s,this._ctor)for(let n=0;n=this._pool.length)){for(let i=t;i0){if(!(t+r0)for(const s of t)s.onInvalidated()}onCommitted(){const t=this._observers;if(t&&t.length>0){const s=t.slice();for(const t of s)t.onCommitted()}}}export{o as Property};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as e}from\"../lang.js\";import{OriginId as s}from\"./PropertyOrigin.js\";class t{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(s){const r=new t;return this._values.forEach(((t,i)=>{s&&s.has(i)||r.set(i,e(t))})),r}get(e){return this._values.get(e)}originOf(){return s.USER}keys(){return[...this._values.keys()]}set(e,s){this._values.set(e,s)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}}export{t as Store};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../has.js\";import{equals as t}from\"../lang.js\";import e from\"../Logger.js\";import i from\"../ObjectPool.js\";import{Lifecycle as s}from\"./interfaces.js\";import{Property as r}from\"./Property.js\";import{OriginId as o,idToName as n,nameToId as a}from\"./PropertyOrigin.js\";import{Store as l}from\"./Store.js\";import{trackAccess as c,runTracked as h,initializeDependencyTracking as f}from\"./tracking.js\";import{Flags as p}from\"./tracking/Flags.js\";function g(t,e,i){return void 0!==t}function u(t,e,i,r){return void 0!==t&&(!(null==i&&t.flags&p.NonNullable)||(r.lifecycle,s.INITIALIZING,!1))}function d(t){return t&&\"function\"==typeof t.destroy}e.getLogger(\"esri.core.accessorSupport.Properties\");class m{constructor(t){this.host=t,this.propertiesByName=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=s.INITIALIZING,this.store=new l,this._origin=o.USER;const e=this.host.constructor.__accessorMetadata__;for(const i in e){const t=new r(i,e[i]);this.propertiesByName.set(i,t)}this.metadatas=e}initialize(){this.lifecycle=s.CONSTRUCTING}constructed(){this.lifecycle=s.CONSTRUCTED}destroy(){this.destroyed=!0;for(const[t,e]of this.propertiesByName){if(e.metadata.autoDestroy){const i=this.internalGet(t);i&&d(i)&&(i.destroy(),~e.flags&p.NonNullable&&this._internalSet(e,null))}e.destroy()}}get initialized(){return this.lifecycle!==s.INITIALIZING}get(t){const e=this.propertiesByName.get(t);if(e.metadata.get)return e.getComputed(this);c(e);const i=this.store;return i.has(t)?i.get(t):e.metadata.value}originOf(t){const e=this.store.originOf(t);if(void 0===e){const e=this.propertiesByName.get(t);if(void 0!==e&&e.flags&p.HasDefaultValue)return\"defaults\"}return n(e)}has(t){return!!this.propertiesByName.has(t)&&this.store.has(t)}keys(){return[...this.propertiesByName.keys()]}internalGet(t){const e=this.propertiesByName.get(t);if(g(e))return this.store.has(t)?this.store.get(t):e.metadata.value}internalSet(t,e){const i=this.propertiesByName.get(t);g(i)&&this._internalSet(i,e)}getDependsInfo(t,e,i){const s=this.propertiesByName.get(e);if(!g(s))return\"\";const o=new Set,n=h({onObservableAccessed:t=>o.add(t),onTrackingEnd:()=>{}},(()=>s.metadata.get?.call(t)));let a=`${i}${t.declaredClass.split(\".\").pop()}.${e}: ${n}\\n`;if(0===o.size)return a;i+=\" \";for(const l of o){if(!(l instanceof r))continue;a+=`${i}${l.propertyName}: undefined\\n`}return a}setAtOrigin(t,e,i){const s=this.propertiesByName.get(t);if(g(s))return this._setAtOrigin(s,e,i)}isOverridden(t){const e=this.propertiesByName.get(t);return void 0!==e&&!!(e.flags&p.Overriden)}clearOverride(t){const e=this.propertiesByName.get(t);e&&e.flags&p.Overriden&&(e.flags&=~p.Overriden,e.notifyChange())}override(t,e){const i=this.propertiesByName.get(t);if(!u(i,t,e,this))return;const s=i.metadata.cast;if(s){const t=this._cast(s,e),{valid:i,value:r}=t;if(N.release(t),!i)return;e=r}i.flags|=p.Overriden,this._internalSet(i,e)}set(t,e){const i=this.propertiesByName.get(t);if(!u(i,t,e,this))return;const s=i.metadata.cast;if(s){const t=this._cast(s,e),{valid:i,value:r}=t;if(N.release(t),!i)return;e=r}const r=i.metadata.set;r?r.call(this.host,e):this._internalSet(i,e)}setDefaultOrigin(t){this._origin=a(t)}getDefaultOrigin(){return n(this._origin)}notifyChange(t){const e=this.propertiesByName.get(t);void 0!==e&&e.notifyChange()}invalidate(t){const e=this.propertiesByName.get(t);void 0!==e&&e.invalidate()}commit(t){const e=this.propertiesByName.get(t);void 0!==e&&e.commit()}_internalSet(t,e){const i=this.lifecycle!==s.INITIALIZING?this._origin:o.DEFAULTS;this._setAtOrigin(t,e,i)}_setAtOrigin(e,i,s){const r=this.store,o=e.propertyName;r.has(o,s)&&t(i,r.get(o))&&~e.flags&p.Overriden&&s===r.originOf(o)||(e.invalidate(),r.set(o,i,s),e.commit(),f(this.host,e))}_cast(t,e){const i=N.acquire();return i.valid=!0,i.value=e,t&&(i.value=t.call(this.host,e,i)),i}}class y{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}}const N=new i(y);export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet r;function o(){return r}function n(o){r=o}var t;!function(r){r[r.Ignore=0]=\"Ignore\",r[r.Destroy=1]=\"Destroy\",r[r.ThrowError=2]=\"ThrowError\"}(t||(t={}));export{t as InterceptorCollectAction,o as getAccessorInterceptor,n as setAccessorInterceptor};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"./ObjectPool.js\";function r(e){e.length=0}class t{constructor(t=50,o=50){this._pool=new e(Array,void 0,r,o,t)}acquire(){return this._pool.acquire()}release(e){this._pool.release(e)}prune(){this._pool.prune(0)}static acquire(){return o.acquire()}static release(e){return o.release(e)}static prune(){o.prune()}}const o=new t(100);export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"./ObjectPool.js\";class s extends e{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...e){const s=super.acquire(...e);return this._set.delete(s),s}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}}export{s as ReentrantObjectPool};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst o=[];function t(t){o.push(t),1===o.length&&queueMicrotask((()=>{const t=o.slice();o.length=0;for(const o of t)o()}))}export{t as nextTick};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass s{constructor(s,e=30){this.name=s,this._counter=0,this._samples=new Array(e)}record(s){null!=s&&(this._samples[++this._counter%this._samples.length]=s)}get median(){return this._samples.slice().sort(((s,e)=>s-e))[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce(((s,e)=>s+e),0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}}export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar o;!function(o){const t=(o,t,n,e)=>{let i=t,c=t;const l=n>>>1,r=o[i-1];for(;c<=l;){c=i<<1,cot?1:0;function e(o,e,i,c){void 0===e&&(e=0),void 0===i&&(i=o.length),void 0===c&&(c=n);for(let n=i>>>1;n>e;n--)t(o,n,i,c);const l=e+1;for(let n=i-1;n>e;n--){const i=o[e];o[e]=o[n],o[n]=i,t(o,l,n,c)}}function*i(o,e,i,c){void 0===e&&(e=0),void 0===i&&(i=o.length),void 0===c&&(c=n);for(let n=i>>>1;n>e;n--)t(o,n,i,c),yield;const l=e+1;for(let n=i-1;n>e;n--){const i=o[e];o[e]=o[n],o[n]=i,t(o,l,n,c),yield}}o.sort=e,o.iterableSort=i}(o||(o={}));const t=o;export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{PositionHint as t,indexOf as h,removeUnorderedMany as i}from\"./arrayUtils.js\";import s from\"./HeapSort.js\";const a=1.5,e=1.1;class l{constructor(h){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new t,h&&(h.initialSize&&(this.data=new Array(h.initialSize)),h.allocator&&(this._allocator=h.allocator),void 0!==h.deallocator&&(this._deallocator=h.deallocator),h.shrink&&(this._shrink=()=>n(this)))}toArray(){return this.data.slice(0,this.length)}filter(t){const h=new Array;for(let i=0;i=this._length))return this.data[t]}includes(t,h){const i=this.data.indexOf(t,h);return-1!==i&&ithis._length){if(this._allocator){for(;this._length=this.length||t<0))return this.swapElements(t,this.length-1),this.pop()}removeUnorderedMany(t,h=t.length,s){this.length=i(this.data,t,this.length,h,this._hint,s),this._shrink()}front(){if(0!==this.length)return this.data[0]}back(){if(0!==this.length)return this.data[this.length-1]}swapElements(t,h){if(t>=this.length||h>=this.length||t===h)return;const i=this.data[t];this.data[t]=this.data[h],this.data[h]=i}sort(t){s.sort(this.data,0,this.length,t)}iterableSort(t){return s.iterableSort(this.data,0,this.length,t)}some(t,h){for(let i=0;ia*t.length&&(t.data.length=Math.floor(t.length*e))}export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{makeHandle as t}from\"./handleUtils.js\";function e(e){return{setTimeout:(o,r)=>{const i=e.setTimeout(o,r);return t((()=>e.clearTimeout(i)))}}}const o=e(globalThis);export{o as clock,e as wrap};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{makeHandle as e}from\"./handleUtils.js\";function t(e){return e&&(\"function\"==typeof e.on||\"function\"==typeof e.addEventListener)}function r(r,n,o){if(!t(r))throw new TypeError(\"target is not a Evented or EventTarget object\");if(\"on\"in r)return r.on(n,o);if(Array.isArray(n)){const t=n.slice();for(const e of t)r.addEventListener(e,o);return e((()=>{for(const e of t)r.removeEventListener(e,o)}))}return r.addEventListener(n,o),e((()=>r.removeEventListener(n,o)))}function n(e,n,o){if(!t(e))throw new TypeError(\"target is not a Evented or EventTarget object\");if(\"once\"in e)return e.once(n,o);const i=r(e,n,(t=>{i.remove(),o.call(e,t)}));return i}function o(e,t,n){let o=!1;const i=r(e,t,(t=>{o||n.call(e,t)}));return{resume(){o=!1},pause(){o=!0},remove(){i.remove()}}}const i={Win:\"Meta\",Scroll:\"ScrollLock\",Spacebar:\" \",Down:\"ArrowDown\",Left:\"ArrowLeft\",Right:\"ArrowRight\",Up:\"ArrowUp\",Del:\"Delete\",Apps:\"ContextMenu\",Esc:\"Escape\",Multiply:\"*\",Add:\"+\",Subtract:\"-\",Decimal:\".\",Divide:\"/\"};function c({key:e}){return i[e]||e}export{c as eventKey,i as ieKeyNormalizationMap,t as isEventTarget,r as on,n as once,o as pausable};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clock as t}from\"./clock.js\";import e from\"./Error.js\";import{once as r}from\"./events.js\";import n from\"./Logger.js\";import{removeMaybe as o}from\"./maybe.js\";async function i(t,e){const r=t.slice(),n=await Promise.all(t.map(((t,r)=>e(t,r))));return r.filter(((t,e)=>n[e]))}function u(t=\"Aborted\"){return new e(\"AbortError\",t)}function s(t,e=\"Aborted\"){if(c(t))throw u(e)}function l(t){return null!=t?\"aborted\"in t?t:t.signal:t}function c(t){const e=l(t);return null!=e&&e.aborted}function a(t){if(b(t))throw t}function f(t){if(!b(t))throw t}function m(t,e){const n=l(t);if(null!=n){if(!n.aborted)return r(n,\"abort\",(()=>e()));e()}}function w(t,e){const n=l(t);if(null!=n)return s(n),r(n,\"abort\",(()=>e(u())))}function h(t,e){return null==l(e)?t:new Promise(((r,n)=>{let i=m(e,(()=>n(u())));const s=()=>{i=o(i)};t.then(s,s),t.then(r,n)}))}function p(t,r,n){return Promise.race([t,A(r).then((()=>{throw new e(\"timeout\",`Did not resolve within ${r} milliseconds (${n??\"timeout\"})`)}))])}function b(t){return\"AbortError\"===t?.name}async function d(t){try{return await t}catch(e){if(!b(e))throw e;return}}async function y(t,e=n.getLogger(\"esri\")){try{return await t}catch(r){b(r)||e.error(r)}}async function v(t){if(!t)return;if(\"function\"!=typeof t.forEach){const e=Object.keys(t),r=e.map((e=>t[e])),n=await v(r),o={};return e.map(((t,e)=>o[t]=n[e])),o}const e=t;return Promise.allSettled(e).then((t=>Array.from(e,((e,r)=>{const n=t[r];return\"fulfilled\"===n.status?{promise:e,value:n.value}:{promise:e,error:n.reason}}))))}async function j(t){return(await v(t)).filter((t=>!!t.value)).map((t=>t.value))}async function P(t){return(await Promise.allSettled(t)).filter((t=>\"fulfilled\"===t.status)).map((t=>t.value))}async function g(t){return(await Promise.allSettled(t)).filter((t=>\"rejected\"===t.status)).map((t=>t.reason))}function A(t,e=void 0,r){const n=new AbortController;return m(r,(()=>n.abort())),new Promise(((r,o)=>{let i=setTimeout((()=>{i=0,r(e)}),t);m(n,(()=>{i&&(clearTimeout(i),o(u()))}))}))}function T(t,r,n,o){const i=n&&\"abort\"in n?n:null;null!=o||i||(o=n);let u=setTimeout((()=>{u=0,i?.abort()}),r);const s=()=>o||new e(\"promiseUtils:timeout\",\"The wrapped promise did not resolve within \"+r+\" ms\");return t.then((t=>{if(0===u)throw s();return clearTimeout(u),t}),(t=>{throw clearTimeout(u),0===u?s():t}))}function E(t){return t&&\"function\"==typeof t.then}function S(t){return E(t)?t:Promise.resolve(t)}function k(t,e=-1){let r,n,o,i,s=null;const l=(...c)=>{if(r){n=c,i&&i.reject(u()),i=C();const t=i.promise;if(s){const t=s;s=null,t.abort()}return t}if(o=i||C(),i=null,e>0){const n=new AbortController;r=S(t(...c,n.signal));const o=r;A(e).then((()=>{r===o&&(i?n.abort():s=n)}))}else r=1,r=S(t(...c));const a=()=>{const t=n;n=o=r=s=null,null!=t&&l(...t)},f=r,m=o;return f.then(a,a),f.then(m.resolve,m.reject),m.promise};return l}function C(){let e,r;const n=new Promise(((t,n)=>{e=t,r=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=t=>r(t),o.timeout=(e,r)=>t.setTimeout((()=>o.reject(r)),e),o.promise=n,o}function L(t,e){return t.then(e,e)}function $(t,e){e.then(t.resolve,t.reject)}async function x(t){await Promise.resolve(),s(t)}export{A as after,g as allSettledErrors,P as allSettledValues,L as always,u as createAbortError,C as createResolver,k as debounce,v as eachAlways,j as eachAlwaysValues,i as filter,d as ignoreAbortErrors,b as isAbortError,c as isAborted,E as isPromiseLike,y as logOnError,m as onAbort,w as onAbortOrThrow,$ as settleWithPromise,a as throwIfAbortError,s as throwIfAborted,f as throwIfNotAbortError,T as timeout,x as waitTick,S as when,h as whenOrAbort,p as whenOrTimeout};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(n){return n}function r(r){return n(1e3*r)}function t(n){return n}function u(n){return t(.001*n)}function e(){return n(performance.now())}export{n as Milliseconds,t as Seconds,r as millisecondsFromSeconds,e as now,u as secondsFromMilliseconds};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{nextTick as e}from\"./nextTick.js\";import t from\"./PerformanceSampler.js\";import r from\"./PooledArray.js\";import{createResolver as s,isAborted as n,createAbortError as o}from\"./promiseUtils.js\";import{Milliseconds as a}from\"./time.js\";class i{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}}class c{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}}let m=0,l=0;const p={time:a(0),deltaTime:a(0),elapsedFrameTime:a(0),frameDuration:a(0)},u=[\"prepare\",\"preRender\",\"render\",\"postRender\",\"update\",\"finish\"],f=[],h=new r;class d{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}}const w={frameTasks:h,willDispatch:!1,clearFrameTasks:T,dispatch:_,executeFrameTasks:x};function k(t){const r=new c(t);return f.push(r),w.willDispatch||(w.willDispatch=!0,e(_)),r}function v(e){const t=new i(e);return h.push(t),null==A&&(m=performance.now(),A=requestAnimationFrame(j)),new d(t)}let A=null;function T(e=!1){h.forAll((e=>{e.removed=!0})),e&&g()}function F(e){l=Math.max(0,e)}function j(){const e=performance.now();A=null,A=h.length>0?requestAnimationFrame(j):null,w.executeFrameTasks(e)}function x(e){const t=a(e-m);m=e;const r=l>0?l:1e3/60,s=Math.max(0,t-r);p.time=e,p.frameDuration=a(r-s);for(let n=0;n{if(r.paused||r.removed)return;0===n&&r.ticks++;r.phases[s]&&(p.elapsedFrameTime=a(performance.now()-e),p.deltaTime=0===r.ticks?a(0):t,r.phases[s]?.call(r,p))})),b[n].record(performance.now()-r)}g(),q.record(performance.now()-e)}const D=new r;function g(){h.forAll((e=>{e.removed&&D.push(e)})),h.removeUnorderedMany(D.data,D.length),D.clear()}function _(){for(;f.length;){const e=f.shift();e.isActive&&e.callback()}w.willDispatch=!1}function M(t=1,r){const a=s(),i=()=>{n(r)?a.reject(o()):0===t?a():(--t,e((()=>i())))};return i(),a.promise}function R(){const e=s(),t=v({postRender:()=>{t.remove(),k(e)}});return e.promise}const b=u.map((e=>new t(e))),q=new t(\"total\");export{d as FrameTaskHandle,v as addFrameTask,w as debug,b as performanceInfo,q as performanceTotal,k as schedule,F as setFrameDuration,R as waitAnimationFrame,M as waitTicks};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(n,r){for(const t of n.entries())if(r(t[0]))return!0;return!1}function r(n,r){if(!r)return n;for(const t of r)n.add(t);return n}function t(n,t){const o=new Set;return r(o,n),r(o,t),o}function o(n,r){const t=new Set;for(const o of r)n.has(o)&&t.add(o);return t}function e(n,r){if(!n||!r)return!1;if(n===r)return!0;for(const t of n)if(!r.has(t))return!1;return!0}function f(n,r){if(null==n&&null==r)return!0;if(null==n||null==r||n.size!==r.size)return!1;for(const t of n)if(!r.has(t))return!1;return!0}function u(n,r){const t=new Set(n);for(const o of r)t.delete(o);return t}function i(n,r){return u(t(n,r),o(n,r))}function c(n){let r;for(r of n);return r}export{r as addMany,u as difference,f as equals,o as intersection,e as isSubsetOf,c as last,n as someSet,i as symmetricDifference,t as union};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet t=0;const n=0;function e(){return++t}export{n as NullUID,e as generateUID};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass t{constructor(t){this._accessed=[],this._handles=[],this._observerObject=new e(t),s.register(this,new WeakRef(this._observerObject),this)}destroy(){s.unregister(this._observerObject),this._accessed.length=0,this._observerObject?.destroy(),this.clear()}onObservableAccessed(t){const e=this._accessed;e.includes(t)||e.push(t)}onTrackingEnd(){const t=this._handles,e=this._accessed,s=this._observerObject;for(let i=0;i0?t-1:0}destroy(){this.destroyed=!0,this._notify=i}}const s=new FinalizationRegistry((t=>{t.deref()?.destroy()}));function i(){}export{t as SimpleTrackingTarget};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{makeHandle as n}from\"../handleUtils.js\";import{runTracked as t}from\"./tracking.js\";import{SimpleTrackingTarget as r}from\"./tracking/SimpleTrackingTarget.js\";let l=!1;const u=[];function o(u,o){let e=new r(a),i=null,s=!1;function a(){if(!e||s)return;if(l)return void c(a);const n=i;e.clear(),l=!0,s=!0,i=t(e,u),s=!1,l=!1,o(i,n),f()}function m(){e&&(e.destroy(),e=null,i=null)}return s=!0,i=t(e,u),s=!1,n(m)}function e(l,u){let o=new r(i),e=null;function i(){u(e,f)}function c(){o&&(o.destroy(),o=null),e=null}function f(){return o?(o.clear(),e=t(o,l),e):null}return f(),n(c)}function i(u){let o=new r(i),e=!1;function i(){o&&!e&&(l?c(i):(o.clear(),l=!0,e=!0,t(o,u),e=!1,l=!1,f()))}function s(){o&&(o.destroy(),o=null)}return e=!0,t(o,u),e=!1,n(s)}function c(n){u.includes(n)||u.unshift(n)}function f(){for(;u.length;)u.pop()()}export{i as autorun,o as reaction,e as reactionDeferred};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../ArrayPool.js\";import{makeHandle as t}from\"../handleUtils.js\";import{equals as r,equalsShallow as o}from\"../lang.js\";import{ReentrantObjectPool as l}from\"../ReentrantObjectPool.js\";import{schedule as i}from\"../scheduling.js\";import{someSet as n}from\"../SetUtils.js\";import{generateUID as s}from\"../uid.js\";import{valueOf as u}from\"./get.js\";import{reactionDeferred as a,reaction as c}from\"./trackingUtils.js\";import{parse as d}from\"./utils.js\";var h;!function(e){e[e.Untracked=0]=\"Untracked\",e[e.Tracked=1]=\"Tracked\"}(h||(h={}));class f{constructor(){this.uid=s(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,t,o,l,i){return this.pool.acquire(h.Untracked,e,t,o,l,i,r)}static acquireTracked(e,t,r,o){return this.pool.acquire(h.Tracked,e,t,r,null,null,o)}notify(e,t){this.type===h.Untracked?this.callback.call(this.target,e,t,this.path,this.target):this.callback.call(null,e,t,void 0,void 0)}acquire(e,t,r,o,l,i,n){this.uid=s(),this.removed=!1,this.type=e,this.oldValue=t,this.callback=r,this.getValue=o,this.target=l,this.path=i,this.equals=n}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=s(),this.removed=!0}}f.pool=new l(f);const m=new e,p=new Set;let v;function k(e){p.delete(e),p.add(e),v||(v=i(q))}function _(e){if(e.removed)return;const t=e.oldValue,r=e.getValue();e.equals(t,r)||(e.oldValue=r,e.notify(r,t))}function g(e){for(const t of p.values())t.target===e&&(t.removed=!0)}function q(){let e=10;for(;v&&e--;){v=null;const e=j(),t=m.acquire();for(const r of e){const e=r.uid;_(r),e===r.uid&&r.removed&&t.push(r)}for(const r of p)r.removed&&(t.push(r),p.delete(r));for(const r of t)f.pool.release(r);m.release(t),m.release(e),V.forEach((e=>e()))}}function j(){const e=m.acquire();e.length=p.size;let t=0;for(const r of p)e[t]=r,++t;return p.clear(),e}const V=new Set;function y(e){return V.add(e),t((()=>V.delete(e)))}function U(e,r,o){let l=d(e,r,o,((e,r,o)=>{let i,n,s=a((()=>u(e,r)),((t,s)=>{e.__accessor__.destroyed||i&&i.uid!==n?l.remove():(i||(i=f.acquireUntracked(t,o,s,e,r),n=i.uid),k(i))}));return t((()=>{s.remove(),i&&(i.uid!==n||i.removed||(i.removed=!0,k(i)),i=null),l=s=null}))}));return l}function b(e,t,o){const l=d(e,t,o,((e,t,o)=>{let i=!1;return c((()=>u(e,t)),((n,s)=>{e.__accessor__.destroyed?l.remove():i||(i=!0,r(s,n)||o.call(e,n,s,t,e),i=!1)}))}));return l}function T(e,r,o,l=!1){return!e.__accessor__||e.__accessor__.destroyed?t():l?b(e,r,o):U(e,r,o)}function w(e,r,o){let l,i,n=a(e,((e,t)=>{l&&l.uid!==i?n.remove():(l||(l=f.acquireTracked(e,r,t,o),i=l.uid),k(l))}));return t((()=>{n.remove(),l&&(l.uid!==i||l.removed||(l.removed=!0,k(l)),l=null),n=null}))}function S(e,t,r){let o=!1;return c(e,((e,l)=>{o||(o=!0,r(l,e)||t(e,l),o=!1)}))}function P(e,t,r=!1,l=o){return r?S(e,t,l):w(e,t,l)}function x(e){return n(p,(t=>t.oldValue===e))}export{y as afterDispatch,q as dispatch,x as isValueInUse,g as removeTarget,T as watch,P as watchTracked};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{deprecatedFunction as t}from\"./deprecate.js\";import e from\"./Handles.js\";import r from\"./Logger.js\";import{destroyMaybe as s}from\"./maybe.js\";import{beforeDestroySymbol as o}from\"./accessorSupport/beforeDestroy.js\";import{get as i}from\"./accessorSupport/get.js\";import{getPropertiesMetadata as c}from\"./accessorSupport/metadata.js\";import n from\"./accessorSupport/Properties.js\";import{set as a}from\"./accessorSupport/set.js\";import{getAccessorInterceptor as _}from\"./accessorSupport/testSupport.js\";import{removeTarget as l,watch as p}from\"./accessorSupport/watch.js\";import{property as h}from\"./accessorSupport/decorators/property.js\";import{subclass as u}from\"./accessorSupport/decorators/subclass.js\";var d,y;function m(t){if(null==t)return{value:t};if(Array.isArray(t))return{type:[t[0]],value:null};switch(typeof t){case\"object\":return t.constructor?.__accessorMetadata__||t instanceof Date?{type:t.constructor,value:t}:t;case\"boolean\":return{type:Boolean,value:t};case\"string\":return{type:String,value:t};case\"number\":return{type:Number,value:t};case\"function\":return{type:t,value:null};default:return}}const f=Symbol(\"Accessor-Handles\"),v=Symbol(\"Accessor-Initialized\");class g{static createSubclass(t={}){if(Array.isArray(t))throw new Error(\"Multi-inheritance unsupported since 4.16\");const{properties:e,declaredClass:r,constructor:s}=t;delete t.declaredClass,delete t.properties,delete t.constructor;const o=this;class i extends o{constructor(...t){super(...t),this.inherited=null,s&&s.apply(this,t)}}c(i.prototype);for(const c in t){const e=t[c];i.prototype[c]=\"function\"==typeof e?function(...t){const r=this.inherited;let s;this.inherited=function(...t){if(o.prototype[c])return o.prototype[c].apply(this,t)};try{s=e.apply(this,t)}catch(i){throw this.inherited=r,i}return this.inherited=r,s}:t[c]}for(const c in e){const t=m(e[c]);h(t)(i.prototype,c)}return u(r)(i)}constructor(...t){if(this[d]=null,this[y]=!1,this.constructor===g)throw new Error(\"[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor\");const e=new n(this);Object.defineProperty(this,\"__accessor__\",{enumerable:!1,value:e}),t.length>0&&this.normalizeCtorArgs&&(e.ctorArgs=this.normalizeCtorArgs.apply(this,t)),_()?.onInstanceConstruct(this)}postscript(t){const e=this.__accessor__,r=e.ctorArgs||t;e.initialize(),r&&(this.set(r),e.ctorArgs=null),e.constructed(),this.initialize(),this[v]=!0}initialize(){}[o](){this[f]=s(this[f])}destroy(){this.destroyed||(l(this),this.__accessor__.destroy(),_()?.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[v]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(t){i(this,t)}get(e){return t(r.getLogger(this),\"`Accessor.get` is deprecated in favor of using optional chaining\",{version:\"4.28\",see:\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining\"}),i(this,e)}hasOwnProperty(t){return this.__accessor__?this.__accessor__.has(t):Object.prototype.hasOwnProperty.call(this,t)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(t,e){return a(this,t,e),this}watch(t,e,r){return p(this,t,e,r)}addHandles(t,r){if(this.destroyed){const e=Array.isArray(t)?t:[t];for(const t of e)t.remove();return}let s=this[f];null==s&&(s=this[f]=new e),s.add(t,r)}removeHandles(t){const e=this[f];null!=e&&e.remove(t)}removeAllHandles(){const t=this[f];null!=t&&t.removeAll()}hasHandles(t){const e=this[f];return null!=e&&e.has(t)}_override(t,e){void 0===e?this.__accessor__.clearOverride(t):this.__accessor__.override(t,e)}_clearOverride(t){return this.__accessor__.clearOverride(t)}_overrideIfSome(t,e){null==e?this.__accessor__.clearOverride(t):this.__accessor__.override(t,e)}_isOverridden(t){return this.__accessor__.isOverridden(t)}notifyChange(t){this.__accessor__.notifyChange(t)}_get(t){return this.__accessor__.internalGet(t)}_set(t,e){return this.__accessor__.internalSet(t,e),this}}d=f,y=v;export{g as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as i}from\"../lang.js\";import{OriginId as e}from\"./PropertyOrigin.js\";class s{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new s;return this._values.forEach(((s,r)=>{e&&e.has(r)||t.set(r,i(s.value),s.origin)})),t}get(i,e){e=this._normalizeOrigin(e);const s=this._values.get(i);return null==e||s?.origin===e?s?.value:void 0}originOf(i){return this._values.get(i)?.origin??e.USER}keys(i){i=this._normalizeOrigin(i);const e=[...this._values.keys()];return null==i?e:e.filter((e=>this._values.get(e)?.origin===i))}set(i,s,r){if((r=this._normalizeOrigin(r))===e.DEFAULTS){const e=this._values.get(i);if(null!=e?.origin&&e.origin>r)return}this._values.set(i,new t(s,r))}delete(i,e){null!=(e=this._normalizeOrigin(e))&&this._values.get(i)?.origin!==e||this._values.delete(i)}has(i,e){return null!=(e=this._normalizeOrigin(e))?this._values.get(i)?.origin===e:this._values.has(i)}forEach(i){this._values.forEach((({value:e},s)=>i(e,s)))}_normalizeOrigin(i){if(null!=i)return i===e.DEFAULTS?i:e.USER}}class t{constructor(i,e){this.value=i,this.origin=e}}export{s as DefaultsStore};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{OriginId as t}from\"./PropertyOrigin.js\";function e(e,r,n){r.keys().forEach((e=>{n.set(e,r.get(e),t.DEFAULTS)}));const o=e.metadatas;Object.keys(o).forEach((r=>{e.internalGet(r)&&n.set(r,e.internalGet(r),t.DEFAULTS)}))}export{e as setupConstructedDefaults};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{valueOf as e,exists as t}from\"./get.js\";import{getProperties as r}from\"./utils.js\";import{originSpecificReadPropertyDefinition as o,originSpecificPropertyDefinition as n}from\"./extensions/serializableProperty.js\";function s(e,r,o){if(!e?.read||!1===e.read.enabled||!e.read.source)return!1;const n=e.read.source;if(\"string\"==typeof n){if(n===r)return!0;if(n.includes(\".\")&&0===n.indexOf(r)&&t(n,o))return!0}else for(const s of n){if(s===r)return!0;if(s.includes(\".\")&&0===s.indexOf(r)&&t(s,o))return!0}return!1}function i(e){return e&&(!e.read||!1!==e.read.enabled&&!e.read.source)}function f(e,t,r,n,f){let a=o(t[r],f);i(a)&&(e[r]=!0);for(const i of Object.getOwnPropertyNames(t))a=o(t[i],f),s(a,r,n)&&(e[i]=!0)}function a(e,t,r,o){const s=r.metadatas,i=n(s[t],o),f=i?.default;if(void 0===f)return;const a=\"function\"==typeof f?f.call(e,t,o):f;void 0!==a&&r.set(t,a)}const c={origin:\"service\"};function u(t,n,s=c){if(!n||\"object\"!=typeof n)return;const i=r(t),u=i.metadatas,d={};for(const e of Object.getOwnPropertyNames(n))f(d,u,e,n,s);i.setDefaultOrigin(s.origin);for(const r of Object.getOwnPropertyNames(d)){const f=o(u[r],s).read,a=f?.source;let c;c=a&&\"string\"==typeof a?e(n,a):n[r],f?.reader&&(c=f.reader.call(t,c,n,s)),void 0!==c&&i.set(r,c)}if(!s||!s.ignoreDefaults){i.setDefaultOrigin(\"defaults\");for(const e of Object.getOwnPropertyNames(u))d[e]||a(t,e,i,s)}i.setDefaultOrigin(\"user\")}function d(e,t,r,o=c){const n={...o,messages:[]};r(n),n.messages?.forEach((t=>{\"warning\"!==t.type||e.loaded?o?.messages&&o.messages.push(t):e.loadWarnings.push(t)}))}export{u as read,d as readLoadable};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{equals as r}from\"../arrayUtils.js\";import e from\"../Error.js\";import t from\"../Logger.js\";import{get as i}from\"./get.js\";import{idToReadableName as o,OriginId as n,nameToId as s}from\"./PropertyOrigin.js\";import{getProperties as u,merge as l}from\"./utils.js\";import{originSpecificWritePropertyDefinition as a}from\"./extensions/serializableProperty.js\";function p(r,e,t,i,o){const n={};return e.write?.writer?.call(r,i,n,t,o),n}function f(r,o,u,l,a,p){if(!l?.write)return!1;const f=i(r,u);if(!a&&l.write.overridePolicy){const e=l.write.overridePolicy.call(r,f,u,p??void 0);void 0!==e&&(a=e)}if(a||(a=l.write),!a||!1===a.enabled)return!1;if(a.layerContainerTypes&&p?.layerContainerType&&!a.layerContainerTypes.includes(p.layerContainerType))return!1;if((null===f&&!a.allowNull&&!a.writerEnsuresNonNull||void 0===f)&&a.isRequired){const i=new e(\"web-document-write:property-required\",`Missing value for required property '${u}' on '${r.declaredClass}'`,{propertyName:u,target:r});return i&&p?.messages?p.messages.push(i):i&&!p&&t.getLogger(\"esri.core.accessorSupport.write\").error(i.name,i.message),!1}if(void 0===f)return!1;if(null===f&&!a.allowNull&&!a.writerEnsuresNonNull)return!1;if(!a.alwaysWriteDefaults&&(!o.store.multipleOriginsSupported||o.store.originOf(u)===n.DEFAULTS)&&c(r,u,p,l,f))return!1;if(!a.ignoreOrigin&&p?.origin&&o.store.multipleOriginsSupported){if(o.store.originOf(u)0&&(e=l(e,d),t?.resources?.pendingOperations?.length&&t.resources.pendingOperations.push(Promise.all(t.resources.pendingOperations).then((()=>l(e,d,(()=>\"replace-arrays\"))))),t?.writtenProperties&&t.writtenProperties.push({target:r,propName:u,oldOrigin:o(n.store.originOf(u)),newOrigin:t.origin}))}return e}export{g as willPropertyWrite,d as write};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import t from\"./Accessor.js\";import{DefaultsStore as o}from\"./accessorSupport/DefaultsStore.js\";import{setupConstructedDefaults as s}from\"./accessorSupport/defaultsStoreUtils.js\";import{read as e}from\"./accessorSupport/read.js\";import{getProperties as c}from\"./accessorSupport/utils.js\";import{write as i}from\"./accessorSupport/write.js\";import{subclass as p}from\"./accessorSupport/decorators/subclass.js\";const u=t=>{let u=class extends t{constructor(...r){super(...r);const t=c(this),e=t.store,i=new o;t.store=i,s(t,e,i)}read(r,t){e(this,r,t)}write(r,t){return i(this,r??{},t)}toJSON(r){return this.write({},r)}static fromJSON(r,t){return n.call(this,r,t)}};return u=r([p(\"esri.core.JSONSupport\")],u),u.prototype.toJSON.isDefaultToJSON=!0,u};function n(r,t){if(!r)return null;if(r.declaredClass)throw new Error(\"JSON object is already hydrated\");const o=new this;return o.read(r,t),o}function a(r){return r&&\"object\"==typeof r&&\"toJSON\"in r&&\"function\"==typeof r.toJSON}let f=class extends(u(t)){};f=r([p(\"esri.core.JSONSupport\")],f);export{f as JSONSupport,u as JSONSupportMixin,a as isSerializable};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{propertyJSONMeta as r}from\"./property.js\";function o(o,e,t){let a,c;return void 0===e||Array.isArray(e)?(c=o,t=e,a=[void 0]):(c=e,a=Array.isArray(o)?o:[o]),(o,e)=>{const d=o.constructor.prototype;a.forEach((a=>{const s=r(o,a,c);s.read&&\"object\"==typeof s.read||(s.read={}),s.read.reader=d[e],t&&(s.read.source=(s.read.source||[]).concat(t))}))}}export{o as reader};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{setDeepValue as t}from\"./object.js\";class s{constructor(s,o={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=s,this._options=o,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(s),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=t=>this.fromJSON(t),this.write=(s,o,i)=>{const n=this.toJSON(s);void 0!==n&&t(i,n,o)},this.write.isJSONMapWriter=!0}toJSON(t){if(null==t)return null;if(this._apiToJSON.hasOwnProperty(t)){const s=this._apiToJSON[t];return this._options.useNumericKeys?+s:s}return this._options.ignoreUnknown?void 0:t}fromJSON(t){return null!=t&&this._jsonToAPI.hasOwnProperty(t)?this._jsonToAPI[t]:this._options.ignoreUnknown?void 0:t}_invertMap(t){const s={};for(const o in t)s[t[o]]=o;return s}_getKeysSorted(t){const s=[];for(const o in t)s.push(o);return s.sort(),s}}function o(){return function(t,o){return new s(t,{ignoreUnknown:!0,...o})}}export{s as JSONMap,o as strict};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass i{constructor(i,s,t,e){this.semiMajorAxis=i,this.flattening=s,this.outerAtmosphereRimWidth=t;const h=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*h,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=e||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}}const s=new i(6378137,1/298.257223563,3e5,.006694379990137799),t=new i(3396190,1/169.8944472236118,23e4),e=new i(1737400,0,0);export{i as Ellipsoid,s as earth,t as mars,e as moon};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e=/^https:\\/\\/([a-z\\d-]+)(\\.maps([^.]*))?\\.arcgis\\.com/i,s={devext:{customBaseUrl:\"mapsdevext.arcgis.com\",portalHostname:\"devext.arcgis.com\"},qaext:{customBaseUrl:\"mapsqa.arcgis.com\",portalHostname:\"qaext.arcgis.com\"},www:{customBaseUrl:\"maps.arcgis.com\",portalHostname:\"www.arcgis.com\"}};function a(a){const t=a?.match(e);if(!t)return null;const[,r,o,l]=t;if(!r)return null;let c=null,m=null,n=null;const{devext:u,qaext:i,www:p}=s;if(o)if(c=r,l)switch(l.toLowerCase()){case\"devext\":({customBaseUrl:m,portalHostname:n}=u);break;case\"qa\":({customBaseUrl:m,portalHostname:n}=i);break;default:return null}else({customBaseUrl:m,portalHostname:n}=p);else switch(r.toLowerCase()){case\"devext\":({customBaseUrl:m,portalHostname:n}=u);break;case\"qaext\":({customBaseUrl:m,portalHostname:n}=i);break;case\"www\":({customBaseUrl:m,portalHostname:n}=p);break;default:return null}return{customBaseUrl:m,isPortal:!1,portalHostname:n,urlKey:c}}function t(e){return/\\/(sharing|usrsvcs)\\/(appservices|servers)\\//i.test(e)}export{t as isSecureProxyService,a as parseKnownArcGISOnlineDomain};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction t(t){const n=atob(t),r=new Uint8Array(n.length);for(let e=0;eU,q=()=>b;function j(){const t=U.path,n=t.substring(0,t.lastIndexOf(t.split(\"/\")[t.split(\"/\").length-1]));return`${`${U.scheme}://${U.host}${null!=U.port?`:${U.port}`:\"\"}`}${n}`}const L={setAppUrl:t=>U=t,setAppBaseUrl:t=>b=t,restoreUrls:()=>{U=O,b=R}};function I(t){if(!t)return null;const n={path:null,query:null},e=new x(t),r=t.indexOf(\"?\");return null===e.query?n.path=t:(n.path=t.substring(0,r),n.query=A(e.query)),e.fragment&&(n.hash=e.fragment,null===e.query&&(n.path=n.path.substring(0,n.path.length-(e.fragment.length+1)))),n}function A(t){const n=t.split(\"&\"),e={};for(const r of n){if(!r)continue;const t=r.indexOf(\"=\");let n,o;t<0?(n=decodeURIComponent(r),o=\"\"):(n=decodeURIComponent(r.slice(0,t)),o=decodeURIComponent(r.slice(t+1)));let s=e[n];\"string\"==typeof s&&(s=e[n]=[s]),Array.isArray(s)?s.push(o):e[n]=o}return e}function v(t,n){return t?n&&\"function\"==typeof n?Object.keys(t).map((e=>encodeURIComponent(e)+\"=\"+encodeURIComponent(n(e,t[e])))).join(\"&\"):Object.keys(t).map((e=>{const o=t[e];if(null==o)return\"\";const s=encodeURIComponent(e)+\"=\",i=n?.[e];return i?s+encodeURIComponent(i(o)):Array.isArray(o)?o.map((t=>r(t)?s+encodeURIComponent(JSON.stringify(t)):s+encodeURIComponent(t))).join(\"&\"):r(o)?s+encodeURIComponent(JSON.stringify(o)):s+encodeURIComponent(o)})).filter((t=>t)).join(\"&\"):\"\"}function P(t=!1){let n,r=c.proxyUrl;if(\"string\"==typeof t){n=dt(t);const e=T(t);e&&(r=e.proxyUrl)}else n=!!t;if(!r)throw l.warn(f),new e(\"urlutils:proxy-not-set\",f);n&&wt()&&(r=$t(r));return I(r)}function S(t){const n=T(t);let e,r;if(n){const t=E(n.proxyUrl);e=t.path,r=t.query?A(t.query):null}if(e){const n=I(t);t=e+\"?\"+n.path;const o=v({...r,...n.query});o&&(t=`${t}?${o}`)}return t}const k={path:\"\",query:\"\"};function E(t){const n=t.indexOf(\"?\");return-1!==n?(k.path=t.slice(0,n),k.query=t.slice(n+1)):(k.path=t,k.query=null),k}function B(t){return t=(t=Ot(t=Ct(t=E(t).path),!0)).toLowerCase()}function H(t){const n={proxyUrl:t.proxyUrl,urlPrefix:B(t.urlPrefix)},e=c.proxyRules,r=n.urlPrefix;let o=e.length;for(let s=0;s0?t.substring(0,n):t.replace(/\\/+$/,\"\")}function D(t){const n=n=>null==n||n instanceof RegExp&&n.test(t)||\"string\"==typeof n&&t.startsWith(n),e=c.interceptors;if(e)for(const r of e)if(Array.isArray(r.urls)){if(r.urls.some(n))return r}else if(n(r.urls))return r;return null}function F(t,n,e=!1){if(!t||!n)return!1;const r=vt(t),o=vt(n);return!(!e&&r.scheme!==o.scheme)&&(null!=r.host&&null!=o.host&&(r.host.toLowerCase()===o.host.toLowerCase()&&r.port===o.port))}function M(t){if(\"string\"==typeof t){if(!Y(t))return!0;t=vt(t)}if(F(t,U))return!0;const n=c.trustedServers||[];for(let e=0;e-1===(e=t.indexOf(n,e))?t.length:e;let l=u(o,\"/\",o.indexOf(\"//\")+2),c=-1;for(;o.slice(0,l+1)===s.slice(0,l)+\"/\"&&(c=l+1,l!==o.length);)l=u(o,\"/\",l+1);if(-1===c)return t;if(i&&c0)for(let a=0;an?t.concat(n.split(\"/\")):t),[]);for(let n=0;n0&&\"..\"!==r[r.length-1]?r.pop():(!t&&n===o.length-1||t&&(\".\"!==t||0===r.length))&&r.push(t)}return r.join(\"/\")}function X(t,n=!1){if(null==t||Z(t)||tt(t))return null;let e=t.indexOf(\"://\");if(-1===e&&pt(t))e=2;else{if(-1===e)return null;e+=3}const r=t.indexOf(\"/\",e);return-1!==r&&(t=t.slice(0,r)),n&&(t=Ot(t,!0)),t}function Y(t){return pt(t)||ht(t)}function Z(t){return null!=t&&\"blob:\"===t.slice(0,5)}function tt(t){return null!=t&&\"data:\"===t.slice(0,5)}function nt(t){const n=ot(t);return n&&n.isBase64?i(n.data):null}function et(t){return u(t).replaceAll(\"+\",\"-\").replaceAll(\"/\",\"_\").replace(/=+$/,\"\")}const rt=/^data:(.*?)(;base64)?,(.*)$/;function ot(t){const n=t.match(rt);if(!n)return null;const[,e,r,o]=n;return{mediaType:e,isBase64:!!r,data:o}}function st(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function it(t){return(await fetch(t)).blob()}function ut(t){const n=nt(t);if(!n)return null;const e=ot(t);return new Blob([n],{type:e.mediaType})}function lt(t,n){ft(t,n)}function ct(t,n){at(t,n)}function ft(t,n){const e=ut(t);return!!e&&at(e,n)}function at(t,n){if(!t)return!1;const e=document.createElement(\"a\");if(!(\"download\"in e))return!1;const r=URL.createObjectURL(t);return e.download=n,e.href=r,e.style.display=\"none\",document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(r),!0}function pt(t){return null!=t&&\"/\"===t[0]&&\"/\"===t[1]}function ht(t){return null!=t&&a.test(t)}function dt(t){return null!=t&&h.test(t)||\"https\"===U.scheme&&pt(t)}function mt(t){return null!=t&&p.test(t)||\"http\"===U.scheme&&pt(t)}function gt(t){return null!=t&&d.test(t)}function yt(t){return pt(t)?`http:${t}`:t.replace(h,\"http:\")}function $t(t){return pt(t)?`https:${t}`:t.replace(p,\"https:\")}function xt(){return\"http\"===U.scheme}function wt(){return\"https\"===U.scheme}function Ot(t,n=!1){return pt(t)?t.slice(2):(t=t.replace(a,\"\"),n&&t.length>1&&\"/\"===t[0]&&\"/\"===t[1]&&(t=t.slice(2)),t)}function Ut(t){const n=t.indexOf(\"//\"),e=t.indexOf(\"/\",n+2);return-1===e?t:t.slice(0,e)}function Rt(t){let n=0;if(Y(t)){const e=t.indexOf(\"//\");-1!==e&&(n=e+2)}const e=t.lastIndexOf(\"/\");return er===t||r.endsWith(`.${t}`)))||wt()&&!T(t))&&(t=$t(t)),t}function At(t,n,e){if(!(n&&e&&t&&Y(t)))return t;const r=t.indexOf(\"//\"),o=t.indexOf(\"/\",r+2),s=t.indexOf(\":\",r+2),i=Math.min(o<0?t.length:o,s<0?t.length:s);if(t.slice(r+2,i).toLowerCase()!==n.toLowerCase())return t;return`${t.slice(0,r+2)}${e}${t.slice(i)}`}function vt(t){return\"string\"==typeof t?new x(_(t)):(t.scheme||(t.scheme=U.scheme),t)}function Pt(t){return Nt.test(t)}function St(t,n){const e=I(t),r=Object.keys(e.query||{});return r.length>0&&n&&n.warn(\"removeQueryParameters()\",`Url query parameters are not supported, the following parameters have been removed: ${r.join(\", \")}.`),e.path}function kt(t,n,e){const r=I(t),o=r.query||{};return o[n]=String(e),`${r.path}?${v(o)}`}function Et(t,n){if(!n)return t;const e=I(t),r=e.query||{};for(const[s,i]of Object.entries(n))null!=i&&(r[s]=i);const o=v(r);return o?`${e.path}?${o}`:e.path}function Bt(t,n){const{path:e,query:r}=I(t);if(!r)return t;delete r[n];const o=v(r);return o?`${e}?${o}`:e}function Ht(t){if(null==t)return null;const n=t.match(Jt);return n?n[2]:null}function Tt(t){if(null==t)return null;const n=t.match(Jt);return n?{path:n[1],extension:n[2]}:{path:t,extension:null}}async function Wt(t){if(\"string\"==typeof t){return ot(t)??{data:t}}return new Promise(((n,e)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>n(ot(r.result)),r.onerror=t=>e(t)}))}const Jt=/([^.]*)\\.([^\\/]*)$/,Nt=/(^data:image\\/svg|\\.svg$)/i;export{x as Url,S as addProxy,H as addProxyRule,kt as addQueryParameter,Et as addQueryParameters,et as base64UrlEncode,it as blobUrlToBlob,At as changeDomain,ot as dataComponents,nt as dataToArrayBuffer,ut as dataToBlob,ct as downloadBlobAsFile,lt as downloadDataAsFile,Ct as ensureTrailingSlash,q as getAppBaseUrl,C as getAppUrl,bt as getFilename,D as getInterceptor,X as getOrigin,Ht as getPathExtension,T as getProxyRule,P as getProxyUrl,ht as hasProtocol,J as hasSameCanonicalArcGISOnlinePortal,W as hasSameCanonicalPortal,F as hasSameOrigin,N as hasSamePortal,Y as isAbsolute,wt as isAppHTTPS,Z as isBlobProtocol,tt as isDataProtocol,dt as isHTTPSProtocol,pt as isProtocolRelative,Pt as isSVG,M as isTrustedServer,V as join,_ as makeAbsolute,st as makeData,G as makeRelative,K as normalize,v as objectToQuery,Wt as parseData,A as queryToObject,Rt as removeFile,Bt as removeQueryParameter,St as removeQueryParameters,qt as removeTrailingSlash,Tt as splitPathExtension,L as test,yt as toHTTP,$t as toHTTPS,w as trustedServersUrlCache,I as urlToObject};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e=\"20231115\",f=\"a6fcf2901ef678ef17a528e11b93ffe09e3ec267\";export{e as buildDate,f as commitHash};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport has from\"./core/has.js\";import{addQueryParameter as o}from\"./core/urlUtils.js\";import{buildDate as s,commitHash as e}from\"./support/revision.js\";Symbol.dispose??=Symbol(\"Symbol.dispose\"),Symbol.asyncDispose??=Symbol(\"Symbol.asyncDispose\");const r=\"4.28\";let t,i=r;i=\"4.28.10\";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,\"token\",e.token):s}has(\"host-webworker\");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getOrigin as s}from\"../core/urlUtils.js\";const t=new Set([\"elevation3d.arcgis.com\",\"js.arcgis.com\",\"jsdev.arcgis.com\",\"jsqa.arcgis.com\",\"static.arcgis.com\"]);function r(s){return!!s&&s.length>4&&s.startsWith(\"AAPK\")}function c(r){const c=s(r,!0);return!!c&&(c.endsWith(\".arcgis.com\")&&!t.has(c)&&!r.endsWith(\"/sharing/rest/generateToken\"))}export{r as isApiKey,c as supportsApiKey};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../config.js\";import has from\"../core/has.js\";import{isAborted as r}from\"../core/promiseUtils.js\";import{getOrigin as o,hasSameOrigin as t,getAppUrl as n,urlToObject as s}from\"../core/urlUtils.js\";function i(e,o,t=!1,n){return new Promise(((s,i)=>{if(r(n))return void i(c());let a=()=>{l(),i(new Error(`Unable to load ${o}`))},u=()=>{const r=e;l(),s(r)},m=()=>{if(!e)return;const r=e;l(),r.src=\"\",i(c())};const l=()=>{has(\"esri-image-decode\")||(e.removeEventListener(\"error\",a),e.removeEventListener(\"load\",u)),a=null,u=null,e=null,null!=n&&n.removeEventListener(\"abort\",m),m=null,t&&URL.revokeObjectURL(o)};null!=n&&n.addEventListener(\"abort\",m),has(\"esri-image-decode\")?e.decode().then(u,a):(e.addEventListener(\"error\",a),e.addEventListener(\"load\",u))}))}function c(){try{return new DOMException(\"Aborted\",\"AbortError\")}catch{const e=new Error;return e.name=\"AbortError\",e}}const a=\"Timeout exceeded\";function u(){return new Error(a)}function m(e){return\"object\"==typeof e&&!!e&&\"message\"in e&&e.message===a}function l(r){e.request.crossOriginNoCorsDomains||(e.request.crossOriginNoCorsDomains={});const t=e.request.crossOriginNoCorsDomains;for(let e of r)e=e.toLowerCase(),/^https?:\\/\\//.test(e)?t[o(e)??\"\"]=0:(t[o(\"http://\"+e)??\"\"]=0,t[o(\"https://\"+e)??\"\"]=0)}function d(r){const s=e.request.crossOriginNoCorsDomains;if(s){let e=o(r);if(e)return e=e.toLowerCase(),!t(e,n())&&s[e]i.abort()));const h={controller:i,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:n,params:a,redoRequest:!1,useIdentity:D.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},m=await V(h);return n?.after?.(m),m}let P;const D=e.request,_=\"FormData\"in globalThis,A=new Set([499,498,403,401]),F=new Set([\"COM_0056\",\"COM_0057\",\"SB_0008\"]),I=[/\\/arcgis\\/tokens/i,/\\/sharing(\\/rest)?\\/generatetoken/i,/\\/rest\\/info/i],R=()=>null,M=Symbol();function H(e){const t=m(e);t&&!j._corsServers.includes(t)&&j._corsServers.push(t)}function N(e){const t=m(e);return!t||t.endsWith(\".arcgis.com\")||j._corsServers.includes(t)||h(t)}function B(e,t,o,i){let l=\"Error\";const u={url:o.url,requestOptions:o.requestOptions,getHeader:R,ssl:!1};if(t instanceof r)return t.details?(t.details=s(t.details),t.details.url=o.url,t.details.requestOptions=o.requestOptions):t.details=u,t;if(t){const e=i&&(e=>i.headers.get(e)),r=i?.status,s=t.message;s&&(l=s),e&&(u.getHeader=e),u.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||r||0,u.subCode=t.subcode,u.messageCode=t.messageCode,\"string\"==typeof t.details?u.messages=[t.details]:u.messages=t.details,u.raw=M in t?t[M]:t}return a(t)?n():new r(e,l,u)}async function $(){has(\"host-webworker\")?P||(P=await import(\"./core/workers/request.js\")):j._abortableFetch||(j._abortableFetch=globalThis.fetch.bind(globalThis))}async function z(){t||await import(\"./identity/IdentityManager.js\")}async function K(r){const s=r.params.url,o=r.params.requestOptions,a=r.controller.signal,n=o.body;let l=null,u=null;if(_&&\"HTMLFormElement\"in globalThis&&(n instanceof FormData?l=n:n instanceof HTMLFormElement&&(l=new FormData(n))),\"string\"==typeof n&&(u=n),r.fetchOptions={cache:o.cacheBust&&!(\"polyfill\"in j._abortableFetch)?\"no-cache\":\"default\",credentials:\"same-origin\",headers:o.headers||{},method:\"head\"===o.method?\"HEAD\":\"GET\",mode:\"cors\",priority:D.priority,redirect:\"follow\",signal:a},(l||u)&&(r.fetchOptions.body=l||u),\"anonymous\"===o.authMode&&(r.useIdentity=!1),r.hasToken=!!(/token=/i.test(s)||o.query?.token||l?.get(\"token\")),!r.hasToken&&e.apiKey&&C(s)&&(o.query||(o.query={}),o.query.token=e.apiKey,r.hasToken=!0),r.useIdentity&&!r.hasToken&&!r.credentialToken&&!W(s)&&!i(a)){let e;\"immediate\"===o.authMode?(await z(),e=await t.getCredential(s,{signal:a}),r.credential=e):\"no-prompt\"===o.authMode?(await z(),e=await t.getCredential(s,{prompt:!1,signal:a}).catch((()=>{})),r.credential=e):t&&(e=t.findCredential(s)),e&&(r.credentialToken=e.token,r.useSSL=!!e.ssl)}}function W(e){return I.some((t=>t.test(e)))}async function G(e){let r=e.params.url;const s=e.params.requestOptions,o=e.fetchOptions??{},a=c(r)||u(r),i=s.responseType||\"json\",l=a?0:null!=s.timeout?s.timeout:D.timeout;let d=!1;if(!a){e.useSSL&&(r=f(r)),s.cacheBust&&\"default\"===o.cache&&(r=y(r,\"request.preventCache\",Date.now()));let a={...s.query};e.credentialToken&&(a.token=e.credentialToken);let n=w(a);has(\"esri-url-encodes-apostrophe\")&&(n=n.replaceAll(\"'\",\"%27\"));const i=r.length+1+n.length;let l;d=\"delete\"===s.method||\"post\"===s.method||\"put\"===s.method||!!s.body||i>D.maxUrlLength;const u=s.useProxy||!!g(r);if(u){const e=b(r);l=e.path,!d&&l.length+1+i>D.maxUrlLength&&(d=!0),e.query&&(a={...e.query,...a})}if(\"HEAD\"===o.method&&(d||u)){if(d){if(i>D.maxUrlLength)throw B(\"request:invalid-parameters\",new Error(\"URL exceeds maximum length\"),e.params);throw B(\"request:invalid-parameters\",new Error(\"cannot use POST request when method is 'head'\"),e.params)}if(u)throw B(\"request:invalid-parameters\",new Error(\"cannot use proxy when method is 'head'\"),e.params)}if(d?(o.method=\"delete\"===s.method?\"DELETE\":\"put\"===s.method?\"PUT\":\"POST\",s.body?r=q(r,a):(o.body=w(a),o.headers||(o.headers={}),o.headers[\"Content-Type\"]=\"application/x-www-form-urlencoded\")):r=q(r,a),u&&(e.useProxy=!0,r=`${l}?${r}`),a.token&&_&&o.body instanceof FormData&&!O(r)&&o.body.set(\"token\",a.token),s.hasOwnProperty(\"withCredentials\"))e.withCredentials=s.withCredentials;else if(!T(r,S()))if(h(r))e.withCredentials=!0;else if(t){const s=t.findServerInfo(r);s?.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(o.credentials=\"include\",x(r)&&await L(d?q(r,a):r))}let p,C,v=0,U=!1;l>0&&(v=setTimeout((()=>{U=!0,e.controller.abort()}),l));try{if(\"native-request-init\"===s.responseType)C=o,C.url=r;else if(\"image\"!==s.responseType||\"default\"!==o.cache||\"GET\"!==o.method||d||X(s.headers)||!a&&!e.useProxy&&D.proxyUrl&&!N(r)){if(p=await j._abortableFetch(r,o),e.useProxy||H(r),\"native\"===s.responseType)C=p;else if(\"HEAD\"!==o.method)if(p.ok){switch(i){case\"array-buffer\":C=await p.arrayBuffer();break;case\"blob\":case\"image\":C=await p.blob();break;default:C=await p.text()}if(v&&(clearTimeout(v),v=0),\"json\"===i||\"xml\"===i||\"document\"===i)if(C)switch(i){case\"json\":C=JSON.parse(C);break;case\"xml\":C=Q(C,\"application/xml\");break;case\"document\":C=Q(C,\"text/html\")}else C=null;if(C){if(\"array-buffer\"===i||\"blob\"===i){const e=p.headers.get(\"Content-Type\");if(e&&/application\\/json|text\\/plain/i.test(e)&&C[\"blob\"===i?\"size\":\"byteLength\"]<=750)try{const e=await new Response(C).json();e.error&&(C=e)}catch{}}\"image\"===i&&C instanceof Blob&&(C=await Z(URL.createObjectURL(C),e,!0))}}else{C=await p.text();try{C=JSON.parse(C)}catch{}}}else C=await Z(r,e)}catch(P){if(\"AbortError\"===P.name){if(U)throw E();throw n(\"Request canceled\")}if(!(!p&&P instanceof TypeError&&D.proxyUrl)||s.body||\"delete\"===s.method||\"head\"===s.method||\"post\"===s.method||\"put\"===s.method||e.useProxy||N(r))throw P;e.redoRequest=!0,k({proxyUrl:D.proxyUrl,urlPrefix:m(r)??\"\"})}finally{v&&clearTimeout(v)}return[p,C]}async function J(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let o,a;try{a=await e.before(t)}catch(s){o=B(\"request:interceptor\",s,t)}if((a instanceof Error||a instanceof r)&&(o=B(\"request:interceptor\",a,t)),o)throw e.error&&e.error(o),o;return a}}function X(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}function Q(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName(\"parsererror\").length)throw new SyntaxError(\"XML Parse error\");return r}async function V(e){let r,s;await K(e);try{do{[r,s]=await G(e)}while(!await Y(e,r,s))}catch(n){const t=B(\"request:server\",n,e.params,r);throw t.details.ssl=e.useSSL,e.interceptor?.error&&e.interceptor.error(t),t}const o=e.params.url;if(s&&/\\/sharing\\/rest\\/(accounts|portals)\\/self/i.test(o)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!h(o)){const e=m(o,!0);e&&D.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&v(s.authorizedCrossOriginNoCorsDomains)}const a=e.credential;if(a&&t){const e=t.findServerInfo(a.server);let r=e?.owningSystemUrl;if(r){r=r.replace(/\\/?$/,\"/sharing\");const e=t.findCredential(r,a.userId);e&&-1===t._getIdenticalSvcIdx(r,e)&&e.resources.unshift(r)}}return{data:s,getHeader:r?e=>r?.headers.get(e):R,httpStatus:r?.status??200,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function Y(e,r,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.params.requestOptions;if(!r||\"native\"===o.responseType||\"native-request-init\"===o.responseType)return!0;let a,n;if(s&&(s.error?a=s.error:\"error\"===s.status&&Array.isArray(s.messages)&&(a={...s},a[M]=s,a.details=s.messages)),!a&&!r.ok)throw a=new Error(`Unable to load ${r.url} status: ${r.status}`),a[M]=s,a;let i,l=null;a&&(n=Number(a.code),l=a.hasOwnProperty(\"subcode\")?Number(a.subcode):null,i=a.messageCode,i=i?.toUpperCase());const u=o.authMode;if(403===n&&(4===l||a.message?.toLowerCase().includes(\"ssl\")&&!a.message.toLowerCase().includes(\"permission\"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&(\"no-prompt\"!==u||498===n)&&void 0!==n&&A.has(n)&&!W(e.params.url)&&(403!==n||(!i||!F.has(i))&&(null==l||2===l&&e.credentialToken))){await z();try{const r=await t.getCredential(e.params.url,{error:B(\"request:server\",a,e.params),prompt:\"no-prompt\"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=r,e.credentialToken=r.token,e.useSSL=e.useSSL||r.ssl,!1}catch(c){if(\"no-prompt\"===u)return e.credential=void 0,e.credentialToken=void 0,!1;a=c}}if(a)throw a;return!0}function Z(e,t,r=!1){const s=t.controller.signal,o=new Image;return t.withCredentials?o.crossOrigin=\"use-credentials\":o.crossOrigin=\"anonymous\",o.alt=\"\",o.fetchPriority=D.priority,o.src=e,U(o,e,r,s)}j._abortableFetch=null,j._corsServers=[\"https://server.arcgisonline.com\",\"https://services.arcgisonline.com\"];export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport s from\"./config.js\";import t from\"./request.js\";import o from\"./core/Error.js\";import r from\"./core/Logger.js\";import{join as e}from\"./core/urlUtils.js\";const i=r.getLogger(\"esri.assets\");function n(s,o){return t(a(s),o)}function a(t){if(!s.assetsPath)throw i.errorOnce(\"The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50\"),new o(\"assets:path-not-set\",\"config.assetsPath is not set\");return e(s.assetsPath,t)}export{n as fetchAsset,a as getAssetUrl};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getAssetUrl as e}from\"../assets.js\";import has from\"../core/has.js\";let t,o=null;function r(){return!!o}function n(){return!!has(\"esri-wasm\")}function _(){return t||(t=import(\"./pe-wasm.js\").then((e=>e.p)).then((({default:t})=>t({locateFile:t=>e(`esri/geometry/support/${t}`)}))).then((e=>{l(e)})),t)}var P,s,E;!function(e){function t(e,t,r){o.ensureCache.prepare();const n=M(r),_=r===n,P=o.ensureFloat64(n),s=o._pe_geog_to_proj(o.getPointer(e),t,P);return s&&A(r,t,P,_),s}function r(e,o,r,_){switch(_){case s.PE_TRANSFORM_P_TO_G:return n(e,o,r);case s.PE_TRANSFORM_G_TO_P:return t(e,o,r)}return 0}function n(e,t,o){return _(e,t,o,0)}function _(e,t,r,n){o.ensureCache.prepare();const _=M(r),P=r===_,s=o.ensureFloat64(_),E=o._pe_proj_to_geog_center(o.getPointer(e),t,s,n);return E&&A(r,t,s,P),E}e.geogToProj=t,e.projGeog=r,e.projToGeog=n,e.projToGeogCenter=_}(P||(P={})),function(e){function t(){e.PE_BUFFER_MAX=o.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=o.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=o.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=o.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=o.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=o.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=o.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=o.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=o.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=o.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=o.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=o.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=o.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=o.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=o.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=o.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=o.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=o.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=o.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=o.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_STR_FMT_WKT=o.PeDefs.prototype.PE_STR_FMT_WKT,e.PE_STR_FMT_WKT2=o.PeDefs.prototype.PE_STR_FMT_WKT2,e.PE_PARM_X0=o.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=o.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=o.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=o.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=o.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=o.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=o.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=o.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=o.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=o.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(s||(s={})),function(e){const t={},r={},n=e=>{if(e){const t=e.getType();switch(t){case s.PE_TYPE_GEOGCS:e=o.castObject(e,o.PeGeogcs);break;case s.PE_TYPE_PROJCS:e=o.castObject(e,o.PeProjcs);break;case s.PE_TYPE_GEOGTRAN:e=o.castObject(e,o.PeGeogtran);break;default:t&s.PE_TYPE_UNIT&&(e=o.castObject(e,o.PeUnit))}}return e};function _(){o.PeFactory.prototype.initialize(null)}function P(e){return E(s.PE_TYPE_COORDSYS,e)}function E(e,r){let _=null,P=t[e];if(P||(P={},t[e]=P),P.hasOwnProperty(String(r)))_=P[r];else{const t=o.PeFactory.prototype.factoryByType(e,r);o.compare(t,o.NULL)||(_=t,P[r]=_)}return _=n(_),_}function i(e,t){let _=null,P=r[e];if(P||(P={},r[e]=P),P.hasOwnProperty(t))_=P[t];else{const r=o.PeFactory.prototype.fromString(e,t);o.compare(r,o.NULL)||(_=r,P[t]=_)}return _=n(_),_}function p(e){return E(s.PE_TYPE_GEOGCS,e)}function u(e){return E(s.PE_TYPE_GEOGTRAN,e)}function a(e){return o.PeFactory.prototype.getCode(e)}function c(e){return E(s.PE_TYPE_PROJCS,e)}function T(e){return E(s.PE_TYPE_UNIT,e)}e.initialize=_,e.coordsys=P,e.factoryByType=E,e.fromString=i,e.geogcs=p,e.geogtran=u,e.getCode=a,e.projcs=c,e.unit=T}(E||(E={}));let i=null;var p,u,a,c,T,g,f,S,O;function l(e){function t(e,t,o){e[t]=o(e[t])}o=e,s.init(),p.init(),T.init(),f.init(),S.init(),i=class extends o.PeGCSExtent{destroy(){o.destroy(this)}};const r=[o.PeDatum,o.PeGeogcs,o.PeGeogtran,o.PeObject,o.PeParameter,o.PePrimem,o.PeProjcs,o.PeSpheroid,o.PeUnit];for(const o of r)t(o.prototype,\"getName\",(e=>function(){return e.call(this,new Array(s.PE_NAME_MAX))}));for(const P of[o.PeGeogtran,o.PeProjcs])t(P.prototype,\"getParameters\",(e=>function(){const t=new Array(s.PE_PARM_MAX);let r=e.call(this);for(let e=0;efunction(){const t=this.getSize();if(!t)return null;const o=[];return A(o,t,e.call(this)),o})),t(o.PeGTlistExtendedEntry.prototype,\"getEntries\",(e=>{const t=o._pe_getPeGTlistExtendedGTsSize();return function(){let r=null;const n=e.call(this);if(!o.compare(n,o.NULL)){r=[n];const e=this.getSteps();if(e>1){const _=o.getPointer(n);for(let n=1;nfunction(){let t=this._cache;if(t||(t=new Map,this._cache=t),t.has(e))return t.get(e);let r=null;const _=e.call(this);if(!o.compare(_,o.NULL)){r=[_];const e=_.getNump();if(e>1){const t=o.getPointer(_);for(let _=1;_{t.push(e[0],e[1])}))):t=e,t}function A(e,t,r,n=!1){if(n)for(let _=0;_<2*t;_++)e[_]=o.getValue(r+_*Float64Array.BYTES_PER_ELEMENT,\"double\");else{const n=0===e.length;for(let _=0;_1)){const e=o.getPointer(p);for(let r=1;r{N(e);const t=e.getGeogtran();N(t),t.getParameters().forEach(N),[t.getGeogcs1(),t.getGeogcs2()].forEach((e=>{N(e);const t=e.getDatum();N(t),N(t.getSpheroid()),N(e.getPrimem()),N(e.getUnit())}))}));o.PeGTlistExtendedEntry.prototype.Delete(e[0])}}e.destroy=t}(u||(u={})),function(e){function t(e,t,r,n,_){o.ensureCache.prepare();const P=M(r),s=r===P,E=o.ensureFloat64(P);let i=0;n&&(i=o.ensureFloat64(n));const p=o._pe_geog_to_geog(o.getPointer(e),t,E,i,_);return p&&A(r,t,E,s),p}e.geogToGeog=t}(a||(a={})),function(e){const t=(e,t,r,n,_,P)=>{let E,i;switch(o.ensureCache.prepare(),e){case\"dd\":E=o._pe_geog_to_dd,i=s.PE_DD_MAX;break;case\"ddm\":E=o._pe_geog_to_ddm,i=s.PE_DDM_MAX;break;case\"dms\":E=o._pe_geog_to_dms,i=s.PE_DMS_MAX}let p=0;t&&(p=o.getPointer(t));const u=M(n),a=o.ensureFloat64(u),c=y(r,i),T=E(p,r,a,_,o.ensureInt32(c));if(T)for(let s=0;s{let P;switch(o.ensureCache.prepare(),e){case\"dd\":P=o._pe_dd_to_geog;break;case\"ddm\":P=o._pe_ddm_to_geog;break;case\"dms\":P=o._pe_dms_to_geog}let s=0;t&&(s=o.getPointer(t));const E=n.map((e=>o.ensureString(e))),i=o.ensureInt32(E),p=o.ensureFloat64(new Array(2*r)),u=P(s,r,i,p);return u&&A(_,r,p),u};function n(e,o,r,n,_){return t(\"dms\",e,o,r,n,_)}function _(e,t,o,n){return r(\"dms\",e,t,o,n)}function P(e,o,r,n,_){return t(\"ddm\",e,o,r,n,_)}function E(e,t,o,n){return r(\"ddm\",e,t,o,n)}function i(e,o,r,n,_){return t(\"dd\",e,o,r,n,_)}function p(e,t,o,n){return r(\"dd\",e,t,o,n)}e.geogToDms=n,e.dmsToGeog=_,e.geogToDdm=P,e.ddmToGeog=E,e.geogToDd=i,e.ddToGeog=p}(c||(c={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=o.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=o.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function r(e,t,r,n,_,P,E){o.ensureCache.prepare();let i=0;e&&(i=o.getPointer(e));const p=M(r),u=o.ensureFloat64(p),a=y(t,s.PE_MGRS_MAX),c=o.ensureInt32(a),T=o._pe_geog_to_mgrs_extended(i,t,u,n,_,P,c);if(T)for(let s=0;so.ensureString(e))),E=o.ensureInt32(s),i=o.ensureFloat64(new Array(2*t)),p=o._pe_mgrs_to_geog_extended(P,t,E,n,i);return p&&A(_,t,i),p}e.init=t,e.geogToMgrsExtended=r,e.mgrsToGeogExtended=n}(T||(T={})),function(e){function t(e,t,r,n,_,P,E){o.ensureCache.prepare();let i=0;e&&(i=o.getPointer(e));const p=M(r),u=o.ensureFloat64(p),a=y(t,s.PE_MGRS_MAX),c=o.ensureInt32(a),T=o._pe_geog_to_usng(i,t,u,n,_,P,c);if(T)for(let s=0;so.ensureString(e))),s=o.ensureInt32(P),E=o.ensureFloat64(new Array(2*t)),i=o._pe_usng_to_geog(_,t,s,E);return i&&A(n,t,E),i}e.geogToUsng=t,e.usngToGeog=r}(g||(g={})),function(e){function t(){e.PE_UTM_OPTS_NONE=o.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=o.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=o.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function r(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const E=M(r),i=o.ensureFloat64(E),p=y(t,s.PE_UTM_MAX),u=o.ensureInt32(p),a=o._pe_geog_to_utm(P,t,i,n,u);if(a)for(let s=0;so.ensureString(e))),E=o.ensureInt32(s),i=o.ensureFloat64(new Array(2*t)),p=o._pe_utm_to_geog(P,t,E,n,i);return p&&A(_,t,i),p}e.init=t,e.geogToUtm=r,e.utmToGeog=n}(f||(f={})),function(e){const t=new Map;function r(){e.PE_PCSINFO_OPTION_NONE=o.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=o.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=o.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=o.PePCSInfo.prototype.PE_POLE_POINT}function n(r,n=e.PE_PCSINFO_OPTION_DOMAIN){let _=null,P=null;return t.has(r)&&(P=t.get(r),P[n]&&(_=P[n])),_||(_=o.PePCSInfo.prototype.generate(r,n),P||(P=[],t.set(r,P)),P[n]=_),_}e.init=r,e.generate=n}(S||(S={})),function(e){function t(){return o.PeVersion.prototype.version_string()}e.versionString=t}(O||(O={}));const d=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return P},get PeDefs(){return s},get PeFactory(){return E},get PeGCSExtent(){return i},get PeGTTransformations(){return a},get PeGTlistExtended(){return p},get PeGTlistExtendedEntry(){return u},get PeNotationDms(){return c},get PeNotationMgrs(){return T},get PeNotationUsng(){return g},get PeNotationUtm(){return f},get PePCSInfo(){return S},get PeVersion(){return O},_init:l,get _pe(){return o},isLoaded:r,isSupported:n,load:_},Symbol.toStringTag,{value:\"Module\"}));export{E as P,o as _,s as a,n as b,c,T as d,g as e,f,P as g,a as h,r as i,S as j,i as k,_ as l,p as m,u as n,O as o,d as p,l as q};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar S;!function(S){S[S.CGCS2000=4490]=\"CGCS2000\",S[S.GCSMARS2000=104971]=\"GCSMARS2000\",S[S.GCSMARS2000_SPHERE=104905]=\"GCSMARS2000_SPHERE\",S[S.GCSMOON2000=104903]=\"GCSMOON2000\"}(S||(S={}));export{S as SupportedGCSWkids};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet o;const r={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:[\"Meter\",\"Foot\",\"Foot_US\",\"Foot_Clarke\",\"Yard_Clarke\",\"Link_Clarke\",\"Yard_Sears\",\"Foot_Sears\",\"Chain_Sears\",\"Chain_Benoit_1895_B\",\"Yard_Indian\",\"Yard_Indian_1937\",\"Foot_Gold_Coast\",\"Chain\",\"Chain_Sears_1922_Truncated\",\"50_Kilometers\",\"150_Kilometers\"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(o=2e3;o<=2045;o++)r[o]=0;for(o=2056;o<=2065;o++)r[o]=0;for(o=2067;o<=2135;o++)r[o]=0;for(o=2137;o<=2154;o++)r[o]=0;for(o=2161;o<=2170;o++)r[o]=0;for(o=2172;o<=2193;o++)r[o]=0;for(o=2195;o<=2198;o++)r[o]=0;for(o=2200;o<=2203;o++)r[o]=0;for(o=2205;o<=2217;o++)r[o]=0;for(o=2222;o<=2224;o++)r[o]=1;for(o=2225;o<=2250;o++)r[o]=2;for(o=2251;o<=2253;o++)r[o]=1;for(o=2257;o<=2264;o++)r[o]=2;for(o=2274;o<=2279;o++)r[o]=2;for(o=2280;o<=2282;o++)r[o]=1;for(o=2283;o<=2289;o++)r[o]=2;for(o=2290;o<=2292;o++)r[o]=0;for(o=2308;o<=2313;o++)r[o]=0;for(o=2315;o<=2491;o++)r[o]=0;for(o=2494;o<=2866;o++)r[o]=0;for(o=2867;o<=2869;o++)r[o]=1;for(o=2870;o<=2888;o++)r[o]=2;for(o=2891;o<=2895;o++)r[o]=2;for(o=2896;o<=2898;o++)r[o]=1;for(o=2902;o<=2908;o++)r[o]=2;for(o=2915;o<=2920;o++)r[o]=2;for(o=2921;o<=2923;o++)r[o]=1;for(o=2924;o<=2930;o++)r[o]=2;for(o=2931;o<=2962;o++)r[o]=0;for(o=2964;o<=2968;o++)r[o]=2;for(o=2969;o<=2973;o++)r[o]=0;for(o=2975;o<=2991;o++)r[o]=0;for(o=2995;o<=3051;o++)r[o]=0;for(o=3054;o<=3079;o++)r[o]=0;for(o=3081;o<=3088;o++)r[o]=0;for(o=3092;o<=3101;o++)r[o]=0;for(o=3106;o<=3138;o++)r[o]=0;for(o=3146;o<=3151;o++)r[o]=0;for(o=3153;o<=3166;o++)r[o]=0;for(o=3168;o<=3172;o++)r[o]=0;for(o=3174;o<=3203;o++)r[o]=0;for(o=3294;o<=3358;o++)r[o]=0;for(o=3367;o<=3403;o++)r[o]=0;for(o=3408;o<=3416;o++)r[o]=0;for(o=3417;o<=3438;o++)r[o]=2;for(o=3441;o<=3446;o++)r[o]=2;for(o=3447;o<=3450;o++)r[o]=0;for(o=3451;o<=3459;o++)r[o]=2;for(o=3460;o<=3478;o++)r[o]=0;for(o=3554;o<=3559;o++)r[o]=0;for(o=3560;o<=3570;o++)r[o]=2;for(o=3571;o<=3581;o++)r[o]=0;for(o=3594;o<=3597;o++)r[o]=0;for(o=3601;o<=3604;o++)r[o]=0;for(o=3637;o<=3639;o++)r[o]=0;for(o=3665;o<=3667;o++)r[o]=0;for(o=3693;o<=3695;o++)r[o]=0;for(o=3701;o<=3727;o++)r[o]=0;for(o=3728;o<=3739;o++)r[o]=2;for(o=3740;o<=3751;o++)r[o]=0;for(o=3753;o<=3760;o++)r[o]=2;for(o=3761;o<=3773;o++)r[o]=0;for(o=3775;o<=3777;o++)r[o]=0;for(o=3779;o<=3781;o++)r[o]=0;for(o=3783;o<=3785;o++)r[o]=0;for(o=3788;o<=3791;o++)r[o]=0;for(o=3797;o<=3802;o++)r[o]=0;for(o=3814;o<=3816;o++)r[o]=0;for(o=3825;o<=3829;o++)r[o]=0;for(o=3832;o<=3841;o++)r[o]=0;for(o=3844;o<=3852;o++)r[o]=0;for(o=3873;o<=3885;o++)r[o]=0;for(o=3890;o<=3893;o++)r[o]=0;for(o=3907;o<=3912;o++)r[o]=0;for(o=3942;o<=3950;o++)r[o]=0;for(o=3968;o<=3970;o++)r[o]=0;for(o=3973;o<=3976;o++)r[o]=0;for(o=3986;o<=3989;o++)r[o]=0;for(o=3994;o<=3997;o++)r[o]=0;for(o=4048;o<=4051;o++)r[o]=0;for(o=4056;o<=4063;o++)r[o]=0;for(o=4093;o<=4096;o++)r[o]=0;for(o=4390;o<=4398;o++)r[o]=0;for(o=4399;o<=4413;o++)r[o]=2;for(o=4418;o<=4433;o++)r[o]=2;for(o=4455;o<=4457;o++)r[o]=2;for(o=4484;o<=4489;o++)r[o]=0;for(o=4491;o<=4554;o++)r[o]=0;for(o=4568;o<=4589;o++)r[o]=0;for(o=4652;o<=4656;o++)r[o]=0;for(o=4766;o<=4800;o++)r[o]=0;for(o=5014;o<=5016;o++)r[o]=0;for(o=5069;o<=5072;o++)r[o]=0;for(o=5105;o<=5130;o++)r[o]=0;for(o=5167;o<=5188;o++)r[o]=0;for(o=5253;o<=5259;o++)r[o]=0;for(o=5269;o<=5275;o++)r[o]=0;for(o=5292;o<=5311;o++)r[o]=0;for(o=5329;o<=5331;o++)r[o]=0;for(o=5343;o<=5349;o++)r[o]=0;for(o=5355;o<=5357;o++)r[o]=0;for(o=5387;o<=5389;o++)r[o]=0;for(o=5459;o<=5463;o++)r[o]=0;for(o=5479;o<=5482;o++)r[o]=0;for(o=5518;o<=5520;o++)r[o]=0;for(o=5530;o<=5539;o++)r[o]=0;for(o=5550;o<=5552;o++)r[o]=0;for(o=5562;o<=5583;o++)r[o]=0;for(o=5623;o<=5625;o++)r[o]=2;for(o=5631;o<=5639;o++)r[o]=0;for(o=5649;o<=5653;o++)r[o]=0;for(o=5663;o<=5680;o++)r[o]=0;for(o=5682;o<=5685;o++)r[o]=0;for(o=5875;o<=5877;o++)r[o]=0;for(o=5896;o<=5899;o++)r[o]=0;for(o=5921;o<=5940;o++)r[o]=0;for(o=6050;o<=6125;o++)r[o]=0;for(o=6244;o<=6275;o++)r[o]=0;for(o=6328;o<=6348;o++)r[o]=0;for(o=6350;o<=6356;o++)r[o]=0;for(o=6366;o<=6372;o++)r[o]=0;for(o=6381;o<=6387;o++)r[o]=0;for(o=6393;o<=6404;o++)r[o]=0;for(o=6480;o<=6483;o++)r[o]=0;for(o=6511;o<=6514;o++)r[o]=0;for(o=6579;o<=6581;o++)r[o]=0;for(o=6619;o<=6624;o++)r[o]=0;for(o=6625;o<=6627;o++)r[o]=2;for(o=6628;o<=6632;o++)r[o]=0;for(o=6634;o<=6637;o++)r[o]=0;for(o=6669;o<=6692;o++)r[o]=0;for(o=6707;o<=6709;o++)r[o]=0;for(o=6720;o<=6723;o++)r[o]=0;for(o=6732;o<=6738;o++)r[o]=0;for(o=6931;o<=6933;o++)r[o]=0;for(o=6956;o<=6959;o++)r[o]=0;for(o=7005;o<=7007;o++)r[o]=0;for(o=7057;o<=7070;o++)r[o]=2;for(o=7074;o<=7082;o++)r[o]=0;for(o=7109;o<=7118;o++)r[o]=0;for(o=7119;o<=7127;o++)r[o]=1;for(o=7374;o<=7376;o++)r[o]=0;for(o=7528;o<=7586;o++)r[o]=0;for(o=7587;o<=7645;o++)r[o]=2;for(o=7692;o<=7696;o++)r[o]=0;for(o=7755;o<=7787;o++)r[o]=0;for(o=7791;o<=7795;o++)r[o]=0;for(o=7799;o<=7801;o++)r[o]=0;for(o=7803;o<=7805;o++)r[o]=0;for(o=7825;o<=7831;o++)r[o]=0;for(o=7845;o<=7859;o++)r[o]=0;for(o=8013;o<=8032;o++)r[o]=0;for(o=8065;o<=8068;o++)r[o]=1;for(o=8518;o<=8529;o++)r[o]=2;for(o=8533;o<=8536;o++)r[o]=2;for(o=8538;o<=8540;o++)r[o]=2;for(o=8677;o<=8679;o++)r[o]=0;for(o=8836;o<=8840;o++)r[o]=0;for(o=8857;o<=8859;o++)r[o]=0;for(o=8908;o<=8910;o++)r[o]=0;for(o=9154;o<=9159;o++)r[o]=0;for(o=9205;o<=9218;o++)r[o]=0;for(o=9271;o<=9273;o++)r[o]=0;for(o=9295;o<=9297;o++)r[o]=0;for(o=9356;o<=9360;o++)r[o]=0;for(o=9404;o<=9407;o++)r[o]=0;for(o=9476;o<=9482;o++)r[o]=0;for(o=9487;o<=9494;o++)r[o]=0;for(o=9697;o<=9699;o++)r[o]=0;for(o=9821;o<=9865;o++)r[o]=0;for(o=10285;o<=10291;o++)r[o]=0;for(o=10314;o<=10317;o++)r[o]=0;for(o=10448;o<=10465;o++)r[o]=0;for(o=11114;o<=11118;o++)r[o]=0;for(o=20004;o<=20032;o++)r[o]=0;for(o=20047;o<=20049;o++)r[o]=0;for(o=20062;o<=20092;o++)r[o]=0;for(o=20135;o<=20138;o++)r[o]=0;for(o=20248;o<=20258;o++)r[o]=0;for(o=20348;o<=20358;o++)r[o]=0;for(o=20436;o<=20440;o++)r[o]=0;for(o=20822;o<=20824;o++)r[o]=0;for(o=20904;o<=20932;o++)r[o]=0;for(o=20934;o<=20936;o++)r[o]=0;for(o=21004;o<=21032;o++)r[o]=0;for(o=21035;o<=21037;o++)r[o]=0;for(o=21095;o<=21097;o++)r[o]=0;for(o=21148;o<=21150;o++)r[o]=0;for(o=21207;o<=21264;o++)r[o]=0;for(o=21307;o<=21364;o++)r[o]=0;for(o=21413;o<=21423;o++)r[o]=0;for(o=21453;o<=21463;o++)r[o]=0;for(o=21473;o<=21483;o++)r[o]=0;for(o=21780;o<=21782;o++)r[o]=0;for(o=21891;o<=21894;o++)r[o]=0;for(o=21896;o<=21899;o++)r[o]=0;for(o=22171;o<=22177;o++)r[o]=0;for(o=22181;o<=22187;o++)r[o]=0;for(o=22191;o<=22197;o++)r[o]=0;for(o=22207;o<=22222;o++)r[o]=0;for(o=22229;o<=22232;o++)r[o]=0;for(o=22234;o<=22236;o++)r[o]=0;for(o=22243;o<=22250;o++)r[o]=0;for(o=22262;o<=22265;o++)r[o]=0;for(o=22307;o<=22322;o++)r[o]=0;for(o=22348;o<=22357;o++)r[o]=0;for(o=22407;o<=22422;o++)r[o]=0;for(o=22462;o<=22465;o++)r[o]=0;for(o=22521;o<=22525;o++)r[o]=0;for(o=22607;o<=22622;o++)r[o]=0;for(o=22641;o<=22646;o++)r[o]=0;for(o=22648;o<=22657;o++)r[o]=0;for(o=22707;o<=22722;o++)r[o]=0;for(o=22762;o<=22765;o++)r[o]=0;for(o=22807;o<=22822;o++)r[o]=0;for(o=22991;o<=22994;o++)r[o]=0;for(o=23028;o<=23038;o++)r[o]=0;for(o=23301;o<=23333;o++)r[o]=2;for(o=23830;o<=23853;o++)r[o]=0;for(o=23866;o<=23872;o++)r[o]=0;for(o=23877;o<=23884;o++)r[o]=0;for(o=23886;o<=23894;o++)r[o]=0;for(o=23946;o<=23948;o++)r[o]=0;for(o=24311;o<=24313;o++)r[o]=0;for(o=24342;o<=24347;o++)r[o]=0;for(o=24370;o<=24374;o++)r[o]=10;for(o=24375;o<=24381;o++)r[o]=0;for(o=24718;o<=24721;o++)r[o]=0;for(o=24817;o<=24821;o++)r[o]=0;for(o=24877;o<=24882;o++)r[o]=0;for(o=24891;o<=24893;o++)r[o]=0;for(o=25391;o<=25395;o++)r[o]=0;for(o=25828;o<=25838;o++)r[o]=0;for(o=26191;o<=26195;o++)r[o]=0;for(o=26391;o<=26393;o++)r[o]=0;for(o=26701;o<=26722;o++)r[o]=0;for(o=26729;o<=26799;o++)r[o]=2;for(o=26801;o<=26803;o++)r[o]=2;for(o=26811;o<=26813;o++)r[o]=2;for(o=26847;o<=26870;o++)r[o]=2;for(o=26891;o<=26899;o++)r[o]=0;for(o=26901;o<=26923;o++)r[o]=0;for(o=26929;o<=26946;o++)r[o]=0;for(o=26948;o<=26998;o++)r[o]=0;for(o=27037;o<=27040;o++)r[o]=0;for(o=27205;o<=27232;o++)r[o]=0;for(o=27258;o<=27260;o++)r[o]=0;for(o=27391;o<=27398;o++)r[o]=0;for(o=27561;o<=27564;o++)r[o]=0;for(o=27571;o<=27574;o++)r[o]=0;for(o=27581;o<=27584;o++)r[o]=0;for(o=27591;o<=27594;o++)r[o]=0;for(o=28191;o<=28193;o++)r[o]=0;for(o=28348;o<=28358;o++)r[o]=0;for(o=28402;o<=28432;o++)r[o]=0;for(o=28462;o<=28492;o++)r[o]=0;for(o=29118;o<=29122;o++)r[o]=0;for(o=29168;o<=29172;o++)r[o]=0;for(o=29177;o<=29185;o++)r[o]=0;for(o=29187;o<=29195;o++)r[o]=0;for(o=29900;o<=29903;o++)r[o]=0;for(o=30161;o<=30179;o++)r[o]=0;for(o=30491;o<=30494;o++)r[o]=0;for(o=30729;o<=30732;o++)r[o]=0;for(o=31251;o<=31259;o++)r[o]=0;for(o=31265;o<=31268;o++)r[o]=0;for(o=31275;o<=31279;o++)r[o]=0;for(o=31281;o<=31297;o++)r[o]=0;for(o=31461;o<=31469;o++)r[o]=0;for(o=31491;o<=31495;o++)r[o]=0;for(o=31917;o<=31922;o++)r[o]=0;for(o=31965;o<=32e3;o++)r[o]=0;for(o=32001;o<=32003;o++)r[o]=2;for(o=32005;o<=32031;o++)r[o]=2;for(o=32033;o<=32060;o++)r[o]=2;for(o=32064;o<=32067;o++)r[o]=2;for(o=32074;o<=32077;o++)r[o]=2;for(o=32081;o<=32086;o++)r[o]=0;for(o=32107;o<=32130;o++)r[o]=0;for(o=32133;o<=32159;o++)r[o]=0;for(o=32164;o<=32167;o++)r[o]=2;for(o=32180;o<=32199;o++)r[o]=0;for(o=32201;o<=32260;o++)r[o]=0;for(o=32301;o<=32360;o++)r[o]=0;for(o=32401;o<=32460;o++)r[o]=0;for(o=32501;o<=32560;o++)r[o]=0;for(o=32601;o<=32662;o++)r[o]=0;for(o=32664;o<=32667;o++)r[o]=2;for(o=32701;o<=32761;o++)r[o]=0;for(o=53001;o<=53004;o++)r[o]=0;for(o=53008;o<=53019;o++)r[o]=0;for(o=53021;o<=53032;o++)r[o]=0;for(o=53034;o<=53037;o++)r[o]=0;for(o=53042;o<=53046;o++)r[o]=0;for(o=53074;o<=53080;o++)r[o]=0;for(o=54001;o<=54004;o++)r[o]=0;for(o=54008;o<=54019;o++)r[o]=0;for(o=54021;o<=54032;o++)r[o]=0;for(o=54034;o<=54037;o++)r[o]=0;for(o=54042;o<=54046;o++)r[o]=0;for(o=54048;o<=54053;o++)r[o]=0;for(o=54074;o<=54080;o++)r[o]=0;for(o=54098;o<=54101;o++)r[o]=0;for(o=102001;o<=102040;o++)r[o]=0;for(o=102042;o<=102063;o++)r[o]=0;for(o=102065;o<=102067;o++)r[o]=0;for(o=102070;o<=102117;o++)r[o]=0;for(o=102122;o<=102216;o++)r[o]=0;for(o=102221;o<=102377;o++)r[o]=0;for(o=102382;o<=102388;o++)r[o]=0;for(o=102389;o<=102398;o++)r[o]=2;for(o=102399;o<=102444;o++)r[o]=0;for(o=102445;o<=102447;o++)r[o]=2;for(o=102448;o<=102458;o++)r[o]=0;for(o=102459;o<=102468;o++)r[o]=2;for(o=102469;o<=102499;o++)r[o]=0;for(o=102500;o<=102519;o++)r[o]=1;for(o=102520;o<=102524;o++)r[o]=0;for(o=102525;o<=102529;o++)r[o]=2;for(o=102530;o<=102588;o++)r[o]=0;for(o=102590;o<=102598;o++)r[o]=0;for(o=102601;o<=102603;o++)r[o]=0;for(o=102605;o<=102628;o++)r[o]=0;for(o=102629;o<=102646;o++)r[o]=2;for(o=102648;o<=102700;o++)r[o]=2;for(o=102701;o<=102703;o++)r[o]=0;for(o=102707;o<=102730;o++)r[o]=2;for(o=102733;o<=102758;o++)r[o]=2;for(o=102767;o<=102900;o++)r[o]=0;for(o=102901;o<=102933;o++)r[o]=2;for(o=102934;o<=102950;o++)r[o]=13;for(o=102951;o<=102955;o++)r[o]=0;for(o=102961;o<=102963;o++)r[o]=0;for(o=102965;o<=102969;o++)r[o]=0;for(o=102971;o<=102973;o++)r[o]=0;for(o=102975;o<=102989;o++)r[o]=0;for(o=102990;o<=102992;o++)r[o]=1;for(o=102997;o<=103002;o++)r[o]=0;for(o=103003;o<=103008;o++)r[o]=2;for(o=103009;o<=103011;o++)r[o]=0;for(o=103012;o<=103014;o++)r[o]=2;for(o=103019;o<=103021;o++)r[o]=0;for(o=103022;o<=103024;o++)r[o]=2;for(o=103029;o<=103031;o++)r[o]=0;for(o=103032;o<=103034;o++)r[o]=2;for(o=103065;o<=103068;o++)r[o]=0;for(o=103074;o<=103076;o++)r[o]=0;for(o=103077;o<=103079;o++)r[o]=1;for(o=103080;o<=103082;o++)r[o]=0;for(o=103083;o<=103085;o++)r[o]=2;for(o=103090;o<=103093;o++)r[o]=0;for(o=103097;o<=103099;o++)r[o]=0;for(o=103100;o<=103102;o++)r[o]=2;for(o=103107;o<=103109;o++)r[o]=0;for(o=103110;o<=103112;o++)r[o]=2;for(o=103113;o<=103116;o++)r[o]=0;for(o=103117;o<=103120;o++)r[o]=2;for(o=103153;o<=103157;o++)r[o]=0;for(o=103158;o<=103162;o++)r[o]=2;for(o=103163;o<=103165;o++)r[o]=0;for(o=103166;o<=103168;o++)r[o]=1;for(o=103169;o<=103171;o++)r[o]=2;for(o=103186;o<=103188;o++)r[o]=0;for(o=103189;o<=103191;o++)r[o]=2;for(o=103192;o<=103195;o++)r[o]=0;for(o=103196;o<=103199;o++)r[o]=2;for(o=103200;o<=103224;o++)r[o]=0;for(o=103225;o<=103227;o++)r[o]=1;for(o=103232;o<=103237;o++)r[o]=0;for(o=103238;o<=103243;o++)r[o]=2;for(o=103244;o<=103246;o++)r[o]=0;for(o=103247;o<=103249;o++)r[o]=2;for(o=103254;o<=103256;o++)r[o]=0;for(o=103257;o<=103259;o++)r[o]=2;for(o=103264;o<=103266;o++)r[o]=0;for(o=103267;o<=103269;o++)r[o]=2;for(o=103300;o<=103375;o++)r[o]=0;for(o=103381;o<=103383;o++)r[o]=0;for(o=103384;o<=103386;o++)r[o]=1;for(o=103387;o<=103389;o++)r[o]=0;for(o=103390;o<=103392;o++)r[o]=2;for(o=103397;o<=103399;o++)r[o]=0;for(o=103400;o<=103471;o++)r[o]=2;for(o=103476;o<=103478;o++)r[o]=0;for(o=103479;o<=103481;o++)r[o]=2;for(o=103486;o<=103488;o++)r[o]=0;for(o=103489;o<=103491;o++)r[o]=2;for(o=103492;o<=103495;o++)r[o]=0;for(o=103496;o<=103499;o++)r[o]=2;for(o=103528;o<=103543;o++)r[o]=0;for(o=103544;o<=103548;o++)r[o]=2;for(o=103549;o<=103551;o++)r[o]=0;for(o=103552;o<=103554;o++)r[o]=1;for(o=103555;o<=103557;o++)r[o]=2;for(o=103558;o<=103560;o++)r[o]=0;for(o=103571;o<=103573;o++)r[o]=0;for(o=103574;o<=103576;o++)r[o]=2;for(o=103577;o<=103580;o++)r[o]=0;for(o=103581;o<=103583;o++)r[o]=2;for(o=103595;o<=103694;o++)r[o]=0;for(o=103696;o<=103699;o++)r[o]=0;for(o=103700;o<=103793;o++)r[o]=2;for(o=103794;o<=103890;o++)r[o]=0;for(o=103891;o<=103896;o++)r[o]=2;for(o=103900;o<=103971;o++)r[o]=2;for(o=103972;o<=103977;o++)r[o]=0;for(o=112e3;o<=112101;o++)r[o]=0;export{r as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{replace as e}from\"../../core/string.js\";import{i as r,l as i,P as n,a as t}from\"../../chunks/pe.js\";import{SupportedGCSWkids as _}from\"./SupportedGCSWkids.js\";import a from\"./WKIDUnitConversion.js\";const l={102113:!0,102100:!0,3857:!0,3785:!0},E={4326:!0,3785:!0,3857:!0,102113:!0,102100:!0,104905:!0,104971:!0},M='PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator_Auxiliary_Sphere\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",{Central_Meridian}],PARAMETER[\"Standard_Parallel_1\",0.0],PARAMETER[\"Auxiliary_Sphere_Type\",0.0],UNIT[\"Meter\",1.0]]',S=[-20037508.342788905,20037508.342788905],R=[-20037508.342787,20037508.342787],u={102113:{wkTemplate:'PROJCS[\"WGS_1984_Web_Mercator\",GEOGCS[\"GCS_WGS_1984_Major_Auxiliary_Sphere\",DATUM[\"D_WGS_1984_Major_Auxiliary_Sphere\",SPHEROID[\"WGS_1984_Major_Auxiliary_Sphere\",6378137.0,0.0]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",{Central_Meridian}],PARAMETER[\"Standard_Parallel_1\",0.0],UNIT[\"Meter\",1.0]]',valid:S,origin:R,dx:1e-5},102100:{wkTemplate:M,valid:S,origin:R,dx:1e-5},3785:{wkTemplate:'PROJCS[\"WGS_1984_Web_Mercator\",GEOGCS[\"GCS_WGS_1984_Major_Auxiliary_Sphere\",DATUM[\"D_WGS_1984_Major_Auxiliary_Sphere\",SPHEROID[\"WGS_1984_Major_Auxiliary_Sphere\",6378137.0,0.0]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",{Central_Meridian}],PARAMETER[\"Standard_Parallel_1\",0.0],UNIT[\"Meter\",1.0]]',valid:S,origin:R,dx:1e-5},3857:{wkTemplate:M,valid:S,origin:R,dx:1e-5},4326:{wkTemplate:'GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",{Central_Meridian}],UNIT[\"Degree\",0.0174532925199433]]',altTemplate:'PROJCS[\"WGS_1984_Plate_Carree\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Plate_Carree\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",{Central_Meridian}],UNIT[\"Degrees\",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS[\"Mars_2000_(Sphere)\",DATUM[\"Mars_2000_(Sphere)\",SPHEROID[\"Mars_2000_(Sphere)\",3396190.0,0.0]],PRIMEM[\"Reference_Meridian\",0.0],UNIT[\"Degree\",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS[\"GCS_Mars_2000\",DATUM[\"D_Mars_2000\",SPHEROID[\"Mars_2000_IAU_IAG\",3396190.0,169.8944472236118]],PRIMEM[\"Reference_Meridian\",0.0],UNIT[\"Degree\",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function d(e,r){if(e===r)return!0;if(null==e||null==r)return!1;if(null!=e.wkid||null!=r.wkid)return e.wkid===r.wkid||s(e)&&s(r)||null!=r.latestWkid&&e.wkid===r.latestWkid||null!=e.latestWkid&&r.wkid===e.latestWkid;const i=e.wkt2??e.wkt,n=r.wkt2??r.wkt;return!(!i||!n)&&i.toUpperCase()===n.toUpperCase()}function G(e){return W(e)&&e.wkid&&u[e.wkid]||null}async function o(e,_){if(1===_&&!w(e)||2===_&&w(e))return e;r()||await i();const a=n.fromString(t.PE_TYPE_NONE,e);return a?.toString(1===_?t.PE_STR_FMT_WKT:t.PE_STR_FMT_WKT2)??null}function T(e){if(!e)return;if(e.wkid)return String(e.wkid);const r=e.wkt||e.wkt2;return JSON.stringify(r?{wkt:r}:{})}function A(e){if(!W(e))return!1;if(e.wkid)return null==a[e.wkid];const r=e.wkt2||e.wkt;return!!r&&/^\\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(r)}function P(e){return!(c(e)||p(e))}function k(e){return W(e)&&4326===e.wkid}function w(e){return/^\\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(e)}function C(e){return W(e)&&e.wkid===_.CGCS2000}function s(e){return W(e)&&null!=e.wkid&&!0===l[e.wkid]}function O(e){return W(e)&&32662===e.wkid}function I(e){return e===_.GCSMARS2000||e===_.GCSMARS2000_SPHERE}function c(e){return W(e)&&null!=e.wkid&&I(e.wkid)}function D(e){return e===_.GCSMOON2000}function p(e){return W(e)&&null!=e.wkid&&D(e.wkid)}function f(e){return W(e)&&null!=e.wkid&&!0===E[e.wkid]}function W(e){return null!=e&&(null!=e.wkid&&e.wkid>=2e3||null!=e.wkt2||null!=e.wkt)}const N={wkid:4326,wkt:e(u[4326].wkTemplate,{Central_Meridian:\"0.0\"})},g={wkid:102100,latestWkid:3857},U={wkid:32662};export{U as PlateCarree,N as WGS84,g as WebMercator,d as equals,G as getInfo,o as getWKT,C as isCGCS2000,P as isEarth,A as isGeographic,c as isMars,p as isMoon,O as isPlateCarree,W as isValid,k as isWGS84,I as isWKIDFromMars,D as isWKIDFromMoon,w as isWKT2,s as isWebMercator,f as isWrappable,T as srToRESTValue};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{earth as n,mars as e,moon as r}from\"./support/Ellipsoid.js\";import{isMars as t,equals as c,isMoon as i,isWKIDFromMars as o,isWKIDFromMoon as S}from\"./support/spatialReferenceUtils.js\";function T(n){return{wkt:`GEOCCS[\"Spherical geocentric\",\\n DATUM[\"Not specified\",\\n SPHEROID[\"Sphere\",${n.radius},0]],\\n PRIMEM[\"Greenwich\",0.0,\\n AUTHORITY[\"EPSG\",\"8901\"]],\\n UNIT[\"m\",1.0],\\n AXIS[\"Geocentric X\",OTHER],\\n AXIS[\"Geocentric Y\",EAST],\\n AXIS[\"Geocentric Z\",NORTH]\\n ]`}}const G=T(n),I=T(e),E=T(r),u={wkt:`GEOCCS[\"WGS 84\",\\n DATUM[\"WGS_1984\",\\n SPHEROID[\"WGS 84\",${n.radius},298.257223563,\\n AUTHORITY[\"EPSG\",\"7030\"]],\\n AUTHORITY[\"EPSG\",\"6326\"]],\\n PRIMEM[\"Greenwich\",0,\\n AUTHORITY[\"EPSG\",\"8901\"]],\\n UNIT[\"m\",1.0,\\n AUTHORITY[\"EPSG\",\"9001\"]],\\n AXIS[\"Geocentric X\",OTHER],\\n AXIS[\"Geocentric Y\",OTHER],\\n AXIS[\"Geocentric Z\",NORTH],\\n AUTHORITY[\"EPSG\",\"4978\"]\\n]`};function R(o){return null!=o&&(t(o)||c(o,I))?e:null!=o&&(i(o)||c(o,E))?r:n}function A(t){return o(t)?e:S(t)?r:n}function O(n){return c(n,G)}function H(n){return O(n)||c(n,I)||c(n,E)}export{G as SphericalECEFSpatialReferenceLike,I as SphericalPCPFMarsLike,E as SphericalPCPFMoonLike,u as WGS84ECEFSpatialReferenceLike,R as getReferenceEllipsoid,A as getReferenceEllipsoidFromWKID,O as isSphericalECEF,H as isSphericalPCPF};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"./has.js\";import{strict as e}from\"./jsonMap.js\";import{getReferenceEllipsoid as s}from\"../geometry/ellipsoidUtils.js\";import{earth as t,mars as r,moon as n}from\"../geometry/support/Ellipsoid.js\";import{isEarth as i,isWKIDFromMars as a,isWKIDFromMoon as u,isGeographic as c}from\"../geometry/support/spatialReferenceUtils.js\";import l from\"../geometry/support/WKIDUnitConversion.js\";const o=39.37,m=t.radius*Math.PI/200,f=/(?:LENGTH)?UNIT\\[([^\\]]+)]]$/i,d=l,U=/UNIT\\[([^\\]]+)]/i,q=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),h=e()({meter:\"meters\",foot:\"feet\",foot_us:\"us-feet\",foot_clarke:\"clarke-feet\",yard_clarke:\"clarke-yards\",link_clarke:\"clarke-links\",yard_sears:\"sears-yards\",foot_sears:\"sears-feet\",chain_sears:\"sears-chains\",chain_benoit_1895_b:\"benoit-1895-b-chains\",yard_indian:\"indian-yards\",yard_indian_1937:\"indian-1937-yards\",foot_gold_coast:\"gold-coast-feet\",chain_sears_1922_truncated:\"sears-1922-truncated-chains\",\"50_kilometers\":\"50-kilometers\",\"150_kilometers\":\"150-kilometers\"}),B=e=>e*e,k=e=>e*e*e,p={length:{baseUnit:\"meters\",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},\"nautical-miles\":{inBaseUnits:1852},\"us-feet\":{inBaseUnits:1200/3937}}},area:{baseUnit:\"square-meters\",units:{\"square-millimeters\":{inBaseUnits:B(.001)},\"square-centimeters\":{inBaseUnits:B(.01)},\"square-decimeters\":{inBaseUnits:B(.1)},\"square-meters\":{inBaseUnits:1},\"square-kilometers\":{inBaseUnits:B(1e3)},\"square-inches\":{inBaseUnits:B(.0254)},\"square-feet\":{inBaseUnits:B(.3048)},\"square-yards\":{inBaseUnits:B(.9144)},\"square-miles\":{inBaseUnits:B(1609.344)},\"square-us-feet\":{inBaseUnits:B(1200/3937)},acres:{inBaseUnits:.0015625*B(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:\"liters\",units:{liters:{inBaseUnits:1},\"cubic-millimeters\":{inBaseUnits:1e3*k(.001)},\"cubic-centimeters\":{inBaseUnits:1e3*k(.01)},\"cubic-decimeters\":{inBaseUnits:1e3*k(.1)},\"cubic-meters\":{inBaseUnits:1e3},\"cubic-kilometers\":{inBaseUnits:1e3*k(1e3)},\"cubic-inches\":{inBaseUnits:1e3*k(.0254)},\"cubic-feet\":{inBaseUnits:1e3*k(.3048)},\"cubic-yards\":{inBaseUnits:1e3*k(.9144)},\"cubic-miles\":{inBaseUnits:1e3*k(1609.344)}}},angle:{baseUnit:\"radians\",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},b=(()=>{const e={};for(const s in p)for(const t in p[s].units)e[t]=s;return e})();function y(e,s,t){return e*p[t].units[s].inBaseUnits}function w(e,s,t){return e/p[t].units[s].inBaseUnits}const _=[\"metric\",\"imperial\",\"square-inches\",\"square-feet\",\"square-yards\",\"square-miles\",\"square-us-feet\",\"square-meters\",\"square-kilometers\",\"acres\",\"ares\",\"hectares\"],M=[\"metric\",\"imperial\",\"inches\",\"feet\",\"yards\",\"miles\",\"nautical-miles\",\"us-feet\",\"meters\",\"kilometers\"],g=new Map([[\"meters\",\"square-meters\"],[\"feet\",\"square-feet\"],[\"us-feet\",\"square-us-feet\"]]);function S(e){return\"imperial\"===e||\"metric\"===e}function D(e){const s=b[e];if(!s)throw new Error(\"unknown type\");return s}function C(e){return p[e].baseUnit}function P(e){return C(D(e))}function I(e,s=null){return s=s||D(e),p[s].baseUnit===e}function j(e,s,t){if(s===t)return e;const r=D(s);if(r!==D(t))throw new Error(\"incompatible units\");const n=I(s,r)?e:y(e,s,r);return I(t,r)?n:w(n,t,r)}function E(e){switch(e){case\"metric\":return\"meters\";case\"imperial\":return\"feet\";default:return e}}function R(e){return E(e)}function N(e){switch(e){case\"metric\":return\"square-meters\";case\"imperial\":return\"square-feet\";default:return e}}function O(e,s,t){switch(t){case\"metric\":return v(e,s);case\"imperial\":return T(e,s);default:return t}}function x(e,s,t){switch(t){case\"metric\":return F(e,s);case\"imperial\":return K(e,s);default:return t}}function J(e,s,t){switch(t){case\"metric\":return A(e,s);case\"imperial\":return G(e,s);default:return t}}function v(e,s){const t=j(e,s,\"meters\");return Math.abs(t)<3e3?\"meters\":\"kilometers\"}function F(e,s){const t=j(e,s,\"meters\");return Math.abs(t)<1e5?\"meters\":\"kilometers\"}function T(e,s){const t=j(e,s,\"feet\");return Math.abs(t)<1e3?\"feet\":\"miles\"}function K(e,s){const t=j(e,s,\"feet\");return Math.abs(t)<1e5?\"feet\":\"miles\"}function A(e,s){const t=j(e,s,\"square-meters\");return Math.abs(t)<3e6?\"square-meters\":\"square-kilometers\"}function G(e,s){const t=j(e,s,\"square-feet\");return Math.abs(t)<1e6?\"square-feet\":\"square-miles\"}function H(e,s,t){return j(e,s,\"meters\")/(t*Math.PI/180)}function L(e){return h.fromJSON(e.toLowerCase())||null}function Y(e){return h.toJSON(e)||null}function W(e){if(null!=e&&!i(e))return 1;const s=z(e);return s>1e5?1:s}function $(e){return z(e)>=s(e).metersPerDegree?\"meters\":ee(e)}function z(e,s=t.metersPerDegree){return Q(e,!0)??s}function Q(e,s=!1){const t=e?.wkid??null,i=e?.wkt2??e?.wkt??null;let c=null;if(t){if(a(t))return r.metersPerDegree;if(u(t))return n.metersPerDegree;c=d.values[d[t]],!c&&s&&q.has(t)&&(c=m)}else i&&(ie(i)?c=X(f.exec(i),c):ne(i)&&(c=X(U.exec(i),c)));return c}function V(e){return c(e)?1:z(e)}function X(e,s){return e?.[1]?Z(e[1]):s}function Z(e){return parseFloat(e.split(\",\")[1])}function ee(e){const s=e?.wkid??null,t=e?.wkt2??e?.wkt??null;let r=null;if(s)r=d.units[d[s]];else if(t){const e=ie(t)?f:ne(t)?U:null;if(e){const s=e.exec(t);s?.[1]&&(r=ue(s[1]))}}return null!=r?L(r):null}function se(e){const s=ee(e);return null!=s&&M.includes(s)?s:null}function te(e){const s=$(e);return null!=s&&M.includes(s)?s:null}function re(e){const s=ee(e);return null==s?null:g.get(s)}function ne(e){return/^GEOCCS/i.test(e)}function ie(e){return/^\\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const ae=1e-7;function ue(e){const s=/[\\\\\"']{1}([^\\\\\"']+)/.exec(e);let t=s?.[1];if(!t||!d.units.includes(t)){const s=Z(e);t=null;const r=d.values;for(let e=0;e{const p=r.constructor.prototype;for(const c of i){const i=t(r,c,n);i.write&&\"object\"==typeof i.write||(i.write={}),e&&(i.write.target=e),i.write.writer=p[o]}}}export{r as writer};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../core/JSONSupport.js\";import{clone as r}from\"../core/lang.js\";import{getMetersPerUnitForSR as i,getUnitString as o}from\"../core/unitUtils.js\";import{Integer as s}from\"../core/accessorSupport/ensureType.js\";import{property as n}from\"../core/accessorSupport/decorators/property.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as a}from\"../core/accessorSupport/decorators/writer.js\";import{WGS84 as p,WebMercator as u,PlateCarree as c,isWGS84 as d,isWebMercator as m,isGeographic as w,isWrappable as y,equals as k}from\"./support/spatialReferenceUtils.js\";var h;let S=h=class extends t{static fromJSON(e){if(!e)return null;if(e.wkid){if(102100===e.wkid)return h.WebMercator;if(4326===e.wkid)return h.WGS84}const t=new h;return t.read(e),t}constructor(e){super(e),this.latestWkid=null,this.wkid=null,this.wkt=null,this.wkt2=null,this.vcsWkid=null,this.latestVcsWkid=null,this.imageCoordinateSystem=null}normalizeCtorArgs(e){if(e&&\"object\"==typeof e)return e;return{[\"string\"==typeof e?\"wkt\":\"wkid\"]:e}}get isWGS84(){return d(this)}get isWebMercator(){return m(this)}get isGeographic(){return w(this)}get isWrappable(){return y(this)}get metersPerUnit(){return i(this)}get unit(){return o(this)||(this.isGeographic?\"degrees\":null)}writeWkt(e,t){this.wkid||(t.wkt=e)}clone(){if(this===h.WGS84)return h.WGS84;if(this===h.WebMercator)return h.WebMercator;const e=new h;return null!=this.wkid?(e.wkid=this.wkid,null!=this.latestWkid&&(e.latestWkid=this.latestWkid),null!=this.vcsWkid&&(e.vcsWkid=this.vcsWkid),null!=this.latestVcsWkid&&(e.latestVcsWkid=this.latestVcsWkid)):(null!=this.wkt&&(e.wkt=this.wkt),null!=this.wkt2&&(e.wkt2=this.wkt2)),this.imageCoordinateSystem&&(e.imageCoordinateSystem=r(this.imageCoordinateSystem)),e}equals(e){if(null==e)return!1;if(this.imageCoordinateSystem||e.imageCoordinateSystem){if(null==this.imageCoordinateSystem||null==e.imageCoordinateSystem)return!1;const{id:t,referenceServiceName:r}=e.imageCoordinateSystem,{geodataXform:i}=e.imageCoordinateSystem,o=this.imageCoordinateSystem;return null==t||i?JSON.stringify(o)===JSON.stringify(e.imageCoordinateSystem):r?o.id===t&&o.referenceServiceName===r:o.id===t}return k(this,e)}toJSON(e){return this.write(void 0,e)}};S.GCS_NAD_1927=null,S.WGS84=null,S.WebMercator=null,S.PlateCarree=null,e([n({readOnly:!0})],S.prototype,\"isWGS84\",null),e([n({readOnly:!0})],S.prototype,\"isWebMercator\",null),e([n({readOnly:!0})],S.prototype,\"isGeographic\",null),e([n({readOnly:!0})],S.prototype,\"isWrappable\",null),e([n({type:s,json:{write:!0}})],S.prototype,\"latestWkid\",void 0),e([n({readOnly:!0})],S.prototype,\"metersPerUnit\",null),e([n({readOnly:!0})],S.prototype,\"unit\",null),e([n({type:s,json:{write:!0,origins:{\"web-scene\":{write:{overridePolicy(){return{isRequired:null==this.wkt}}}}}}})],S.prototype,\"wkid\",void 0),e([n({type:String,json:{origins:{\"web-scene\":{write:{overridePolicy(){return{isRequired:null==this.wkid}}}}}}})],S.prototype,\"wkt\",void 0),e([a(\"wkt\"),a(\"web-scene\",\"wkt\")],S.prototype,\"writeWkt\",null),e([n({type:String,json:{write:!1}})],S.prototype,\"wkt2\",void 0),e([n({type:s,json:{write:!0}})],S.prototype,\"vcsWkid\",void 0),e([n({type:s,json:{write:!0}})],S.prototype,\"latestVcsWkid\",void 0),e([n()],S.prototype,\"imageCoordinateSystem\",void 0),S=h=e([l(\"esri.geometry.SpatialReference\")],S),S.prototype.toJSON.isDefaultToJSON=!0,S.GCS_NAD_1927=new S({wkid:4267,wkt:'GEOGCS[\"GCS_North_American_1927\",DATUM[\"D_North_American_1927\",SPHEROID[\"Clarke_1866\",6378206.4,294.9786982]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]'}),S.WGS84=new S(p),S.WebMercator=new S(u),S.PlateCarree=new S(c),Object.freeze&&(Object.freeze(S.GCS_NAD_1927),Object.freeze(S.WGS84),Object.freeze(S.WebMercator));const f=S;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as o}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import a from\"./SpatialReference.js\";let c=class extends r{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=a.WGS84}get cache(){return this.commitProperty(\"spatialReference\"),{}}get extent(){return null}readSpatialReference(e,r){if(e instanceof a)return e;if(null!=e){const t=new a;return t.read(e,r),t}return e}clone(){return console.warn(\".clone() is not implemented for \"+this.declaredClass),null}clearCache(){this.notifyChange(\"cache\")}getCacheValue(e){return this.cache[e]}setCacheValue(e,r){this.cache[e]=r}};e([t()],c.prototype,\"type\",void 0),e([t({readOnly:!0})],c.prototype,\"cache\",null),e([t({readOnly:!0})],c.prototype,\"extent\",null),e([t({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],c.prototype,\"hasM\",void 0),e([t({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],c.prototype,\"hasZ\",void 0),e([t({type:a,json:{write:!0},value:a.WGS84})],c.prototype,\"spatialReference\",void 0),e([o(\"spatialReference\")],c.prototype,\"readSpatialReference\",null),c=e([s(\"esri.geometry.Geometry\")],c);const p=c;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ensureType as t}from\"../ensureType.js\";import{getPropertyMetadata as n}from\"../metadata.js\";const r=Object.prototype.toString;function o(n){const r=\"__accessorMetadata__\"in n?t(n):n;return function(...t){if(t.push(r),\"number\"==typeof t[2])throw new Error(\"Using @cast has parameter decorator is not supported since 4.16\");return e.apply(this,t)}}function e(t,r,o,e){n(t,r).cast=e}function i(t){return(r,o)=>{n(r,t).cast=r[o]}}function s(...t){if(3!==t.length||\"string\"!=typeof t[1])return 1===t.length&&\"[object Function]\"===r.call(t[0])?o(t[0]):1===t.length&&\"string\"==typeof t[0]?i(t[0]):void 0}export{s as cast};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction t(t,n){const s=t.x-n.x,r=t.y-n.y,a=t.hasZ&&n.hasZ?t.z-n.z:0;return Math.sqrt(s*s+r*r+a*a)}function n(t,n){const s=t.x-n.x,r=t.y-n.y,a=t.hasZ&&n.hasZ?t.z-n.z:0;return s*s+r*r+a*a}export{t as distance,n as squareDistance};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as n}from\"../../core/lang.js\";import t from\"../SpatialReference.js\";import{earth as e}from\"./Ellipsoid.js\";import{equals as i,isWebMercator as r,isWGS84 as s}from\"./spatialReferenceUtils.js\";const a=57.29577951308232,o=.017453292519943;function u(n){return n*a}function l(n){return n*o}function p(n){return n/e.radius}function f(n){return Math.PI/2-2*Math.atan(Math.exp(-n/e.radius))}function c(n){return null!=n.wkid||null!=n.wkt}const h=[0,0];function m(n,t,e,i,r){const s=n,a=r;if(a.spatialReference=e,\"x\"in s&&\"x\"in a)[a.x,a.y]=t(s.x,s.y,h,i);else if(\"xmin\"in s&&\"xmin\"in a)[a.xmin,a.ymin]=t(s.xmin,s.ymin,h,i),[a.xmax,a.ymax]=t(s.xmax,s.ymax,h,i);else if(\"paths\"in s&&\"paths\"in a||\"rings\"in s&&\"rings\"in a){const n=\"paths\"in s?s.paths:s.rings,e=[];let r;for(let s=0;s2&&r[n].push(a[n][2]),a[n].length>3&&r[n].push(a[n][3])}\"paths\"in a?a.paths=e:a.rings=e}else if(\"points\"in s&&\"points\"in a){const n=s.points,e=[];for(let r=0;r2&&e[r].push(n[r][2]),n[r].length>3&&e[r].push(n[r][3]);a.points=e}return r}function x(n,t){const e=n&&(c(n)?n:n.spatialReference),a=t&&(c(t)?t:t.spatialReference);return!(n&&\"type\"in n&&\"mesh\"===n.type||t&&\"type\"in t&&\"mesh\"===t.type||!e||!a)&&(!!i(a,e)||(r(a)&&s(e)||r(e)&&s(a)))}function g(e,a){if(null==e)return null;const o=e.spatialReference,u=a&&(c(a)?a:a.spatialReference);return x(o,u)?i(o,u)?n(e):r(u)?m(e,M,t.WebMercator,!1,n(e)):s(u)?m(e,y,t.WGS84,!1,n(e)):null:null}function M(n,t,i=[0,0]){t>89.99999?t=89.99999:t<-89.99999&&(t=-89.99999);const r=l(t);return i[0]=l(n)*e.radius,i[1]=e.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),i}function y(n,t,i=[0,0],r=!1){const s=u(n/e.radius);return i[0]=r?s:s-360*Math.floor((s+180)/360),i[1]=u(Math.PI/2-2*Math.atan(Math.exp(-t/e.radius))),i}function d(e,i=!1,r=n(e)){return m(e,M,t.WebMercator,i,r)}function R(e,i=!1,r=n(e)){return m(e,y,t.WGS84,i,r)}export{x as canProject,d as geographicToWebMercator,M as lngLatToXY,g as project,R as webMercatorToGeographic,p as x2lon,y as xyToLngLat,f as y2lat};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../core/Logger.js\";import{property as r}from\"../core/accessorSupport/decorators/property.js\";import{cast as i}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as s}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as o}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as a}from\"../core/accessorSupport/decorators/writer.js\";import{ensureNumber as l}from\"../core/accessorSupport/ensureType.js\";import n from\"./Geometry.js\";import u from\"./SpatialReference.js\";import{distance as c}from\"./support/pointUtils.js\";import{getInfo as p}from\"./support/spatialReferenceUtils.js\";import{lngLatToXY as h,xyToLngLat as d}from\"./support/webMercatorUtils.js\";var y;const m=[0,0];function f(e){return e&&(\"esri.geometry.SpatialReference\"===e.declaredClass||null!=e.wkid)}let g=y=class extends n{static copy(e,t){t._set(\"x\",e._get(\"x\")),t._set(\"y\",e._get(\"y\")),t._set(\"z\",e._get(\"z\")),t._set(\"m\",e._get(\"m\"));const r=e._get(\"spatialReference\");t._set(\"spatialReference\",Object.isFrozen(r)?r:r.clone())}constructor(...e){super(...e),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type=\"point\"}normalizeCtorArgs(e,r,i,s,o){let a;if(Array.isArray(e))a=e,o=r,e=a[0],r=a[1],i=a[2],s=a[3];else if(e&&\"object\"==typeof e){if(a=e,e=null!=a.x?a.x:a.longitude,r=null!=a.y?a.y:a.latitude,i=a.z,s=a.m,(o=a.spatialReference)&&\"esri.geometry.SpatialReference\"!==o.declaredClass&&(o=new u(o)),null!=a.longitude||null!=a.latitude)if(null==a.longitude)t.getLogger(this).warn(\".longitude=\",\"Latitude was defined without longitude\");else if(null==a.latitude)t.getLogger(this).warn(\".latitude=\",\"Longitude was defined without latitude\");else if(!a.declaredClass&&o&&o.isWebMercator){const t=h(a.longitude,a.latitude,m);e=t[0],r=t[1]}}else f(i)?(o=i,i=null):f(s)&&(o=s,s=null);const l={x:e,y:r};return null==l.x&&null!=l.y?t.getLogger(this).warn(\".y=\",\"Y coordinate was defined without an X coordinate\"):null==l.y&&null!=l.x&&t.getLogger(this).warn(\".x=\",\"X coordinate was defined without a Y coordinate\"),null!=o&&(l.spatialReference=o),null!=i&&(l.z=i),null!=s&&(l.m=s),l}get cache(){return this.commitProperty(\"x\"),this.commitProperty(\"y\"),this.commitProperty(\"z\"),this.commitProperty(\"m\"),this.commitProperty(\"spatialReference\"),{}}get hasM(){return void 0!==this.m}set hasM(e){e!==(void 0!==this._get(\"m\"))&&(this._set(\"m\",e?0:void 0),this._set(\"hasM\",e))}get hasZ(){return void 0!==this.z}set hasZ(e){e!==(void 0!==this._get(\"z\"))&&(this._set(\"z\",e?0:void 0),this._set(\"hasZ\",e))}get latitude(){const{spatialReference:e,x:t,y:r}=this;if(e){if(e.isWebMercator)return d(t,r,m)[1];if(e.isGeographic)return r}return null}set latitude(e){const{spatialReference:t,x:r}=this;null!=e&&t&&(t.isWebMercator?this._set(\"y\",h(r,e,m)[1]):t.isGeographic&&this._set(\"y\",e),this._set(\"latitude\",e))}get longitude(){const{x:e,y:t,spatialReference:r}=this;if(r){if(r.isWebMercator)return d(e,t,m)[0];if(r.isGeographic)return e}return null}set longitude(e){const{y:t,spatialReference:r}=this;null!=e&&r&&(r.isWebMercator?this._set(\"x\",h(e,t,m)[0]):r.isGeographic&&this._set(\"x\",e),this._set(\"longitude\",e))}writeX(e,t,r){t[r]=isNaN(e)?\"NaN\":e}readX(e){return\"string\"==typeof e?NaN:e}clone(){const e=new y;return e.x=this.x,e.y=this.y,e.z=this.z,e.m=this.m,e.spatialReference=this.spatialReference,e}copy(e){return y.copy(e,this),this}equals(e){if(null==e)return!1;const{x:t,y:r,z:i,m:s,spatialReference:o}=this,{z:a,m:l}=e;let{x:n,y:u,spatialReference:c}=e;if(!o.equals(c))if(o.isWebMercator&&c.isWGS84)[n,u]=h(n,u),c=o;else{if(!o.isWGS84||!c.isWebMercator)return!1;[n,u]=d(n,u),c=o}return t===n&&r===u&&i===a&&s===l&&o.wkid===c.wkid}offset(e,t,r){return this.x+=e,this.y+=t,null!=r&&(this.z=(this.z??0)+r),this}normalize(){if(!this.spatialReference)return this;const e=p(this.spatialReference);if(!e)return this;let t=this.x;const[r,i]=e.valid,s=2*i;let o;return t>i?(o=Math.ceil(Math.abs(t-i)/s),t-=o*s):tisNaN(e)?e:l(e)))],g.prototype,\"x\",void 0),e([a(\"x\")],g.prototype,\"writeX\",null),e([s(\"x\")],g.prototype,\"readX\",null),e([r({type:Number,json:{write:!0}})],g.prototype,\"y\",void 0),e([r({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],g.prototype,\"z\",void 0),e([r({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],g.prototype,\"m\",void 0),g=y=e([o(\"esri.geometry.Point\")],g),g.prototype.toJSON.isDefaultToJSON=!0;const x=g;export{x as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n=[0,0];function t(n,t){return null!=t&&e(n,t.x,t.y,t.z)}function r(n,t){if(!t.points||t.points.length)return!1;for(const r of t.points)if(!i(n,r))return!1;return!0}function u(n,t){const{xmin:r,ymin:u,zmin:i,xmax:o,ymax:f,zmax:c}=t;return n.hasZ&&t.hasZ?e(n,r,u,i)&&e(n,r,f,i)&&e(n,o,f,i)&&e(n,o,u,i)&&e(n,r,u,c)&&e(n,r,f,c)&&e(n,o,f,c)&&e(n,o,u,c):e(n,r,u)&&e(n,r,f)&&e(n,o,f)&&e(n,o,u)}function i(n,t){return e(n,t[0],t[1])}function o(n,t){return e(n,t[0],t[1],t[2])}function e(n,t,r,u){return t>=n.xmin&&t<=n.xmax&&r>=n.ymin&&r<=n.ymax&&(null==u||!n.hasZ||u>=n.zmin&&u<=n.zmax)}function f(t,r){return n[1]=r.y,n[0]=r.x,c(t,n)}function c(n,t){return s(n.rings,t)}function s(n,t){if(!n)return!1;if(x(n))return m(!1,n,t);let r=!1;for(let u=0,i=n.length;u=i||x=i)&&n+(i-r)/(x-r)*(s-n)=0&&Z<=1&&P>=0&&P<=1&&(i&&(i[0]=o+Z*(s-o),i[1]=f+Z*(u-f)),!0)}function Z(n){switch(n){case\"esriGeometryEnvelope\":case\"extent\":return o;case\"esriGeometryMultipoint\":case\"multipoint\":return f;case\"esriGeometryPoint\":case\"point\":return i;case\"esriGeometryPolygon\":case\"polygon\":return x;case\"esriGeometryPolyline\":case\"polyline\":return h}}export{o as extentIntersectsExtent,f as extentIntersectsMultipoint,i as extentIntersectsPoint,x as extentIntersectsPolygon,h as extentIntersectsPolyline,y as extentIntersectsRings,Z as getFeatureExtentIntersector,p as isSelfIntersecting,G as segmentIntersects};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{replace as i}from\"../core/string.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import n from\"./Geometry.js\";import m from\"./Point.js\";import r from\"./SpatialReference.js\";import{extentContainsPoint as a,extentContainsExtent as h}from\"./support/contains.js\";import{getFeatureExtentIntersector as o}from\"./support/intersectsBase.js\";import{equals as x,getInfo as l}from\"./support/spatialReferenceUtils.js\";import{canProject as p,geographicToWebMercator as c,webMercatorToGeographic as y}from\"./support/webMercatorUtils.js\";var u;function f(t){return t&&(\"esri.geometry.SpatialReference\"===t.declaredClass||null!=t.wkid)}function d(t,i,e){return null==i?e:null==e?i:t(i,e)}let z=u=class extends n{constructor(...t){super(...t),this.type=\"extent\",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,i,e,s,n){return f(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:\"object\"==typeof t?(t.spatialReference=null==t.spatialReference?r.WGS84:t.spatialReference,t):{xmin:t,ymin:i,xmax:e,ymax:s,spatialReference:n??r.WGS84}}static fromBounds(t,i){return new u({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:i})}static fromPoint(t){return new u({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty(\"xmin\"),this.commitProperty(\"ymin\"),this.commitProperty(\"zmin\"),this.commitProperty(\"mmin\"),this.commitProperty(\"xmax\"),this.commitProperty(\"ymax\"),this.commitProperty(\"zmax\"),this.commitProperty(\"mmax\"),this.commitProperty(\"spatialReference\"),{}}get center(){const t=new m({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const i=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-i.x,t.y-i.y,t.z-i.z):this.offset(t.x-i.x,t.y-i.y)}clone(){const t=new u;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0)),\"point\"===t.type?a(this,t):\"extent\"===t.type&&h(this,t)}equals(t){if(this===t)return!0;if(null==t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const i=.5*(1-t),e=this.width*i,s=this.height*i;if(this.xmin+=e,this.ymin+=s,this.xmax-=e,this.ymax-=s,this.hasZ){const t=(this.zmax-this.zmin)*i;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*i;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(null==t)return!1;\"mesh\"===t.type&&(t=t.extent);const i=this.spatialReference,e=t.spatialReference;i&&e&&!x(i,e)&&p(i,e)&&(t=i.isWebMercator?c(t):y(t,!0));return o(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,i,e){return this.xmin+=t,this.ymin+=i,this.xmax+=t,this.ymax+=i,null!=e&&(this.zmin+=e,this.zmax+=e),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=d(Math.min,this.zmin,t.zmin),this.zmax=d(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=d(Math.min,this.mmin,t.mmin),this.mmax=d(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:null!=t&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=d(Math.max,this.zmin,t.zmin),this.zmax=d(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=d(Math.max,this.mmin,t.mmin),this.mmax=d(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=l(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,s=this._getCM(t);if(s){const n=e.isWebMercator?y(s):s;this.xmin-=s.x,this.xmax-=s.x,e.isWebMercator||(n.x=this._normalizeX(n.x,t).x),this.spatialReference=new r(i((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:n.x}))}return this}_getCM(t){let i=null;const[e,s]=t.valid,n=this.xmin,m=this.xmax;return n>=e&&n<=s&&(m>=e&&m<=s)||(i=this.center),i}_normalize(t,i,e){const s=this.spatialReference;if(!s)return this;const n=e??l(s);if(null==n)return this;const m=this._getParts(n).map((t=>t.extent));if(m.length<2)return m[0]||this;if(m.length>2)return t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)return this._shiftCM(n);if(i)return m;let r=!0,a=!0;return m.forEach((t=>{t.hasZ||(r=!1),t.hasM||(a=!1)})),{rings:m.map((t=>{const i=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(r){const e=(t.zmax-t.zmin)/2;for(let t=0;t0;if(m>2*x){const t=new u(ry||d?i.push({extent:new u(p,e,x,s,n),frameIds:[c]},{extent:new u(o,e,y,s,n),frameIds:[f]}):i.push({extent:new u(p,e,y,s,n),frameIds:[c]});this.cache._parts=i}const e=this.hasZ,s=this.hasM;if(e||s){const t={};e&&(t.zmin=this.zmin,t.zmax=this.zmax),s&&(t.mmin=this.mmin,t.mmax=this.mmax);for(let e=0;es?(m=Math.ceil(Math.abs(t-s)/n),t-=m*n,r=m):tnull==s?e:null==e?s:t(s,e)}function c(t){return t&&(\"esri.geometry.SpatialReference\"===t.declaredClass||null!=t.wkid)}let m=h=class extends n{constructor(...t){super(...t),this.points=[],this.type=\"multipoint\"}normalizeCtorArgs(t,s){if(!t&&!s)return{};const e={};Array.isArray(t)?(e.points=t,e.spatialReference=s):c(t)?e.spatialReference=t:(t.points&&(e.points=t.points),t.spatialReference&&(e.spatialReference=t.spatialReference),t.hasZ&&(e.hasZ=t.hasZ),t.hasM&&(e.hasM=t.hasM));const i=e.points?.[0];return i&&(void 0===e.hasZ&&void 0===e.hasM?(e.hasZ=i.length>2,e.hasM=!1):void 0===e.hasZ?e.hasZ=i.length>3:void 0===e.hasM&&(e.hasM=i.length>3)),e}get cache(){return this.commitProperty(\"points\"),this.commitProperty(\"hasZ\"),this.commitProperty(\"hasM\"),this.commitProperty(\"spatialReference\"),{}}get extent(){const t=this.points;if(!t.length)return null;const s=new o,e=this.hasZ,i=this.hasM,r=e?3:2,n=t[0],a=l(Math.min),p=l(Math.max);let h,c,m,u,[f,y]=n,[d,g]=n;for(let o=0,l=t.length;o2){const t=s[2];h=a(h,t),m=p(m,t)}if(i&&s.length>r){const t=s[r];c=a(c,t),u=p(u,t)}}return s.xmin=f,s.ymin=y,s.xmax=d,s.ymax=g,s.spatialReference=this.spatialReference,e?(s.zmin=h,s.zmax=m):(s.zmin=void 0,s.zmax=void 0),i?(s.mmin=c,s.mmax=u):(s.mmin=void 0,s.mmax=void 0),s}writePoints(t,e){e.points=s(this.points)}addPoint(t){return p(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange(\"points\"),this}clone(){const t={points:s(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new h(t)}getPoint(t){if(!this._validateInputs(t))return null;const s=this.points[t],e={x:s[0],y:s[1],spatialReference:this.spatialReference};let i=2;return this.hasZ&&(e.z=s[2],i=3),this.hasM&&(e.m=s[i]),new a(e)}removePoint(t){if(!this._validateInputs(t))return null;const s=new a(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange(\"points\"),s}setPoint(t,s){return this._validateInputs(t)?(p(this,s),Array.isArray(s)||(s=s.toArray()),this.points[t]=s,this.notifyChange(\"points\"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return null!=t&&t>=0&&t{t.hasZ&&(e=!0),t.hasM&&(r=!0)})),n.map((t=>{const n=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(e&&t.hasZ){const e=.5*(t.zmax-t.zmin);for(let t=0;t2&&n.length>2){const i=t[2]-n[2];return Math.sqrt(e*e+r*r+i*i)}return Math.sqrt(e*e+r*r)}function o(t,n,e){const r=t[0]+e*(n[0]-t[0]),i=t[1]+e*(n[1]-t[1]);return t.length>2&&n.length>2?[r,i,t[2]+e*(n[2]-t[2])]:[r,i]}function s(t,n,e,r){return f(t,n,e[r],e[r+1])}function f(t,n,e,r){const[i,o]=n,[s,f]=e,[l,u]=r,c=l-s,h=u-f,p=c*c+h*h,a=(i-s)*c+(o-f)*h,y=Math.min(1,Math.max(0,a/p));return t[0]=s+c*y,t[1]=f+h*y,t}function l(t,n,e){let r,i,o,s,f=!1,l=1/0;for(e.reset();e.nextPath();)if(e.nextPoint())for(r=e.x,i=e.y;e.nextPoint();)o=e.x,s=e.y,i>n!=s>n&&t<(o-r)*(n-i)/(s-i)+r&&(f=!f),l=Math.min(l,u(t,n,r,i,o,s)),r=o,i=s;return 0===l?0:(f?1:-1)*Math.sqrt(l)}function u(t,n,e,r,i,o){let s=e,f=r,l=i-s,u=o-f;if(0!==l||0!==u){const e=((t-s)*l+(n-f)*u)/(l*l+u*u);e>1?(s=i,f=o):e>0&&(s+=l*e,f+=u*e)}return l=t-s,u=n-f,l*l+u*u}function c(t,n){return o(t,n,.5)}function h(t){const n=t.length;let e=0;for(let r=0;r=0}function y(n){const e=n.length;return e>2&&t(n[0],n[e-1])}function m(t){if(\"rings\"in t&&(g(t),t.rings.length>0&&!a(t.rings[0])))for(const n of t.rings)n.reverse()}function g(t){if(\"rings\"in t)for(const n of t.rings)y(n)||n.push(n[0].slice())}function x(t){if(\"polygon\"!==t.type&&\"polyline\"!==t.type)return t;return M(\"polygon\"===t.type?t.rings:t.paths,t.spatialReference),t}function M(t,n){const r=e(n);if(!r)return;const i=r.valid[0],o=r.valid[1],s=o-i;for(const e of t){let t=1/0,n=-1/0;for(const s of e){const e=z(s[0],i,o);t=Math.min(t,e),n=Math.max(n,e),s[0]=e}const r=n-t;s-r{t[0]<0&&(t[0]+=s)}))}}function z(t,n,e){const r=e-n;return te?n+(t-n)%r:t}function v(t){if(!t||t.length<3)return 0;let n=0;const e=t.length-1;for(let r=0;rt.length===r[n].length))}export{g as closeRings,m as closeRingsAndFixWinding,l as distanceFromPointToPolygon,u as distanceToSegmentSquared,r as geometryToCoordinates,i as getLength,c as getMidpoint,h as getPathLength,p as getPointOnPath,v as getRingArea,j as hasCompatibleTopology,a as isClockwise,y as isClosed,s as projectPointOnLine,f as projectPointOnLineSeg,x as unnormalizeGeometryOnDatelineCrossing,M as unnormalizeVerticesOnDatelineCrossing,z as unnormalizedCoordinate};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{collectPath as t}from\"../geometryCursorCollectUtils.js\";import{getLength as n,getMidpoint as e}from\"./coordsUtils.js\";function r(t){return t?t.hasZ?[t.xmax-t.xmin/2,t.ymax-t.ymin/2,t.zmax-t.zmin/2]:[t.xmax-t.xmin/2,t.ymax-t.ymin/2]:null}function l(t){return t?o(t.rings,t.hasZ??!1):null}function o(t,n){if(!t?.length)return null;const e=[],r=[],l=n?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let o=0,i=t.length;o{let r=t[2]-e[2];return 0===r&&n&&(r=t[4]-e[4]),r})),r.length&&(e[0]=r[0][0],e[1]=r[0][1],n&&(e[2]=r[0][3]),(e[0]l[1]||e[1]l[3]||n&&(e[2]l[5]))&&(e.length=0)),!e.length){const r=t[0]&&t[0].length?s(t[0],n):null;if(!r)return null;e[0]=r[0],e[1]=r[1],n&&r.length>2&&(e[2]=r[2])}return e}function u(t,n,e){let r=0,l=0,o=0,u=0,i=0;const s=t.length?t[0][0]:0,I=t.length?t[0][1]:0,h=t.length&&n?t[0][2]:0;for(let f=0;f2&&N.length>2){const t=a-h,n=E-h,e=m*n-S*t;o+=(t+n)*e,i+=e}xe[1]&&(e[1]=x),ge[3]&&(e[3]=g),n&&(ae[5]&&(e[5]=a))}if(u>0&&(u*=-1),i>0&&(i*=-1),!u)return null;u*=.5,i*=.5;const c=[r/(6*u)+s,l/(6*u)+I,u];return n&&(e[4]===e[5]||0===i?(c[3]=(e[4]+e[5])/2,c[4]=0):(c[3]=o/(6*i)+h,c[4]=i)),c}function i(t,n){let e=0,r=0,l=0;t.nextPoint();const o=t.pathSize?t.x:0,u=t.pathSize?t.y:0;for(let i=0;in[1]&&(n[1]=h),cn[3]&&(n[3]=c)}if(l>0&&(l*=-1),!l)return null;l*=.5;return[e/(6*l)+o,r/(6*l)+u,l]}function s(t,r){const l=r?[0,0,0]:[0,0],o=r?[0,0,0]:[0,0];let u=0,i=0,s=0,I=0;for(let h=0,c=t.length;h2&&f.length>2&&(l[2]=c[2],o[2]=f[2]);const t=n(l,o);if(t){u+=t;const n=e(c,f);i+=t*n[0],s+=t*n[1],r&&n.length>2&&(I+=t*n[2])}}}return u>0?r?[i/u,s/u,I/u]:[i/u,s/u]:t.length?t[0]:null}function I(n){const{hasZ:e,totalSize:r}=n;if(0===r)return null;const l=[],o=[],i=e?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(n.reset();n.nextPath();){const e=u(t(n),n.hasZ,i);e&&o.push(e)}if(o.sort(((t,n)=>{let r=t[2]-n[2];return 0===r&&e&&(r=t[4]-n[4]),r})),o.length&&(l[0]=o[0][0],l[1]=o[0][1],e&&(l[2]=o[0][3]),(l[0]i[1]||l[1]i[3]||e&&(l[2]i[5]))&&(l.length=0)),!l.length){n.reset(),n.nextPath();const t=n.pathSize?h(n):null;if(!t)return null;l[0]=t[0],l[1]=t[1],e&&t.length>2&&(l[2]=t[2])}return l}function h(t){const{hasZ:r}=t,l=r?[0,0,0]:[0,0],o=r?[0,0,0]:[0,0];let u=0,i=0,s=0,I=0;if(t.nextPoint()){let h=t.x,c=t.y,f=t.z;for(;t.nextPoint();){const N=t.x,x=t.y,g=t.z;l[0]=h,l[1]=c,o[0]=N,o[1]=x,r&&(l[2]=f,o[2]=g);const a=n(l,o);if(a){u+=a;const t=e(l,o);i+=a*t[0],s+=a*t[1],r&&t.length>2&&(I+=a*t[2])}h=N,c=x,f=g}}return u>0?r?[i/u,s/u,I/u]:[i/u,s/u]:t.pathSize?(t.seekPathStart(),t.nextPoint(),[t.x,t.y]):null}const c=1e-6;function f(t){let n=0;for(t.reset();t.nextPath();)n+=t.getCurrentRingArea();if(n0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function P(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function _(t,n,a){const s=n[0],r=n[1],o=n[2],u=a[0],e=a[1],c=a[2];return t[0]=r*c-o*e,t[1]=o*u-s*c,t[2]=s*e-r*u,t}function A(t,n,a,s){const r=n[0],o=n[1],u=n[2];return t[0]=r+s*(a[0]-r),t[1]=o+s*(a[1]-o),t[2]=u+s*(a[2]-u),t}function D(t,n,a,s,r,o){const u=o*o,e=u*(2*o-3)+1,c=u*(o-2)+o,i=u*(o-1),h=u*(3-2*o);return t[0]=n[0]*e+a[0]*c+s[0]*i+r[0]*h,t[1]=n[1]*e+a[1]*c+s[1]*i+r[1]*h,t[2]=n[2]*e+a[2]*c+s[2]*i+r[2]*h,t}function I(t,n,a,s,r,o){const u=1-o,e=u*u,c=o*o,i=e*u,h=3*o*e,M=3*c*u,f=c*o;return t[0]=n[0]*i+a[0]*h+s[0]*M+r[0]*f,t[1]=n[1]*i+a[1]*h+s[1]*M+r[1]*f,t[2]=n[2]*i+a[2]*h+s[2]*M+r[2]*f,t}function L(t,n){n=n||1;const s=a,r=2*s()*Math.PI,o=2*s()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(r)*u,t[1]=Math.sin(r)*u,t[2]=o*n,t}function O(t,n,a){const s=n[0],r=n[1],o=n[2];return t[0]=a[0]*s+a[4]*r+a[8]*o+a[12],t[1]=a[1]*s+a[5]*r+a[9]*o+a[13],t[2]=a[2]*s+a[6]*r+a[10]*o+a[14],t}function S(t,n,a){const s=n[0],r=n[1],o=n[2];return t[0]=s*a[0]+r*a[3]+o*a[6],t[1]=s*a[1]+r*a[4]+o*a[7],t[2]=s*a[2]+r*a[5]+o*a[8],t}function E(t,n,a){const s=a[0],r=a[1],o=a[2],u=a[3],e=n[0],c=n[1],i=n[2];let h=r*i-o*c,M=o*e-s*i,f=s*c-r*e,l=r*f-o*M,m=o*h-s*f,d=s*M-r*h;const b=2*u;return h*=b,M*=b,f*=b,l*=2,m*=2,d*=2,t[0]=e+h+l,t[1]=c+M+m,t[2]=i+f+d,t}function Q(t,n,a,s){const r=[],o=[];return r[0]=n[0]-a[0],r[1]=n[1]-a[1],r[2]=n[2]-a[2],o[0]=r[0],o[1]=r[1]*Math.cos(s)-r[2]*Math.sin(s),o[2]=r[1]*Math.sin(s)+r[2]*Math.cos(s),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function R(t,n,a,s){const r=[],o=[];return r[0]=n[0]-a[0],r[1]=n[1]-a[1],r[2]=n[2]-a[2],o[0]=r[2]*Math.sin(s)+r[0]*Math.cos(s),o[1]=r[1],o[2]=r[2]*Math.cos(s)-r[0]*Math.sin(s),t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function T(t,n,a,s){const r=[],o=[];return r[0]=n[0]-a[0],r[1]=n[1]-a[1],r[2]=n[2]-a[2],o[0]=r[0]*Math.cos(s)-r[1]*Math.sin(s),o[1]=r[0]*Math.sin(s)+r[1]*Math.cos(s),o[2]=r[2],t[0]=o[0]+a[0],t[1]=o[1]+a[1],t[2]=o[2]+a[2],t}function k(t,n){r(w,t),r(B,n),z(w,w),z(B,B);const a=P(w,B);return a>1?0:a<-1?Math.PI:Math.acos(a)}const w=t(),B=t();function C(t){return\"vec3(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\")\"}function F(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function G(t,a){if(t===a)return!0;const s=t[0],r=t[1],o=t[2],u=a[0],e=a[1],c=a[2],i=n();return Math.abs(s-u)<=i*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(r-e)<=i*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(o-c)<=i*Math.max(1,Math.abs(o),Math.abs(c))}function H(t,n,a){const s=a[0]-n[0],r=a[1]-n[1],o=a[2]-n[2];let u=s*s+r*r+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=s*u,t[1]=r*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const J=e,K=c,N=i,U=x,X=p,Y=s,Z=v,V=Object.freeze(Object.defineProperty({__proto__:null,abs:f,add:u,angle:k,bezier:I,ceil:h,copy:r,cross:_,direction:H,dist:U,distance:x,div:N,divide:i,dot:P,equals:G,exactEquals:F,floor:M,hermite:D,inverse:y,len:Y,length:s,lerp:A,max:d,min:m,mul:K,multiply:c,negate:j,normalize:z,random:L,rotateX:Q,rotateY:R,rotateZ:T,round:b,scale:g,scaleAndAdd:q,set:o,sign:l,sqrDist:X,sqrLen:Z,squaredDistance:p,squaredLength:v,str:C,sub:J,subtract:e,transformMat3:S,transformMat4:O,transformQuat:E},Symbol.toStringTag,{value:\"Module\"}));export{c as A,i as B,H as C,d as D,j as E,Z as F,G,V as H,M as I,T as J,h as K,b as L,y as M,D as N,I as O,L as P,Q,R,C as S,K as T,N as U,p as a,_ as b,r as c,k as d,O as e,e as f,u as g,F as h,g as i,P as j,Y as k,s as l,v as m,z as n,x as o,A as p,q,U as r,o as s,S as t,J as u,E as v,f as w,m as x,X as y,l as z};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as t,R as n}from\"./common.js\";function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function r(t,n,a,r,s){return t[0]=n,t[1]=a,t[2]=r,t[3]=s,t}function s(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function o(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function u(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function e(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t[3]=n[3]/a[3],t}function c(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t}function i(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t}function h(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t}function M(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3],a[3]),t}function f(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t}function l(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}function m(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t}function d(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return Math.sqrt(a*a+r*r+s*s+o*o)}function b(t,n){const a=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2],o=n[3]-t[3];return a*a+r*r+s*s+o*o}function x(t){const n=t[0],a=t[1],r=t[2],s=t[3];return Math.sqrt(n*n+a*a+r*r+s*s)}function q(t){const n=t[0],a=t[1],r=t[2],s=t[3];return n*n+a*a+r*r+s*s}function p(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t}function g(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t}function v(t,n){const a=n[0],r=n[1],s=n[2],o=n[3];let u=a*a+r*r+s*s+o*o;return u>0&&(u=1/Math.sqrt(u),t[0]=a*u,t[1]=r*u,t[2]=s*u,t[3]=o*u),t}function y(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function j(t,n,a,r){const s=n[0],o=n[1],u=n[2],e=n[3];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t[2]=u+r*(a[2]-u),t[3]=e+r*(a[3]-e),t}function _(t,a){const r=n;let s,o,u,e,c,i;a=a||1;do{s=2*r()-1,o=2*r()-1,c=s*s+o*o}while(c>=1);do{u=2*r()-1,e=2*r()-1,i=u*u+e*e}while(i>=1);const h=Math.sqrt((1-c)/i);return t[0]=a*s,t[1]=a*o,t[2]=a*u*h,t[3]=a*e*h,t}function w(t,n,a){const r=n[0],s=n[1],o=n[2],u=n[3];return t[0]=a[0]*r+a[4]*s+a[8]*o+a[12]*u,t[1]=a[1]*r+a[5]*s+a[9]*o+a[13]*u,t[2]=a[2]*r+a[6]*s+a[10]*o+a[14]*u,t[3]=a[3]*r+a[7]*s+a[11]*o+a[15]*u,t}function z(t,n,a){const r=n[0],s=n[1],o=n[2],u=a[0],e=a[1],c=a[2],i=a[3],h=i*r+e*o-c*s,M=i*s+c*r-u*o,f=i*o+u*s-e*r,l=-u*r-e*s-c*o;return t[0]=h*i+l*-u+M*-c-f*-e,t[1]=M*i+l*-e+f*-u-h*-c,t[2]=f*i+l*-c+h*-e-M*-u,t[3]=n[3],t}function A(t){return\"vec4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\")\"}function D(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function E(n,a){const r=n[0],s=n[1],o=n[2],u=n[3],e=a[0],c=a[1],i=a[2],h=a[3],M=t();return Math.abs(r-e)<=M*Math.max(1,Math.abs(r),Math.abs(e))&&Math.abs(s-c)<=M*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(o-i)<=M*Math.max(1,Math.abs(o),Math.abs(i))&&Math.abs(u-h)<=M*Math.max(1,Math.abs(u),Math.abs(h))}const L=o,O=u,S=e,k=d,B=b,C=x,F=q,G=Object.freeze(Object.defineProperty({__proto__:null,add:s,ceil:c,copy:a,dist:k,distance:d,div:S,divide:e,dot:y,equals:E,exactEquals:D,floor:i,inverse:g,len:C,length:x,lerp:j,max:M,min:h,mul:O,multiply:u,negate:p,normalize:v,random:_,round:f,scale:l,scaleAndAdd:m,set:r,sqrDist:B,sqrLen:F,squaredDistance:b,squaredLength:q,str:A,sub:L,subtract:o,transformMat4:w,transformQuat:z},Symbol.toStringTag,{value:\"Module\"}));export{_ as A,z as B,A as C,L as D,O as E,S as F,k as G,B as H,C as I,F as J,s as a,l as b,a as c,y as d,E as e,x as f,q as g,D as h,b as i,o as j,e as k,j as l,u as m,v as n,c as o,i as p,h as q,M as r,r as s,w as t,f as u,G as v,m as w,d as x,p as y,g as z};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{l as n,s as t}from\"../chunks/vec3.js\";import{s as r}from\"../chunks/vec4.js\";const u=new Float32Array(1);function e(n){--n;for(let t=1;t<32;t<<=1)n|=n>>t;return n+1}function i(n,t,r){return Math.min(Math.max(n,t),r)}function a(n,t){return 0===t?0:Math.round(n/t)*t}function o(n){return 0==(n&n-1)}function c(n){return n--,n|=n>>1,n|=n>>2,n|=n>>4,n|=n>>8,n|=n>>16,++n}function f(n){return 10**Math.ceil(Math.LOG10E*Math.log(n))}function s(n,t,r){return n+(t-n)*r}function h(n,t,r,u,e){return s(u,e,(n-t)/(r-t))}function M(n){return n*Math.PI/180}function m(n){return 180*n/Math.PI}function b(n,t=1e-6){return(n<0?-1:1)/Math.max(Math.abs(n),t)}function l(n){return Math.acos(i(n,-1,1))}function F(n){return Math.asin(i(n,-1,1))}function N(n,t,r=1e-6){if(n===t)return!0;if(!Number.isFinite(n)||!Number.isFinite(t))return!1;return(n>t?n-t:t-n)<=r}const g=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function E(n){return g.setFloat64(0,n),g.getBigInt64(0)}function B(n){return g.setBigInt64(0,n),g.getFloat64(0)}const I=BigInt(\"1000000\"),w=x(1);function x(n){const t=E(n=Math.abs(n)),r=B(t<=I?I:t-I);return Math.abs(n-r)}function p(n,t,r=w){if(n===t)return!0;if(!Number.isFinite(n)||!Number.isFinite(t))return!1;if(null!=r){if(x(Math.min(Math.abs(n),Math.abs(t)))I)}function y(n,t,r=1e-6){if(n===t)return!0;if(!Number.isFinite(n)||!Number.isFinite(t))return!1;const u=Math.abs(n-t),e=Math.abs(n),i=Math.abs(t);if(0===n||0===t||e<1e-12&&i<1e-12){if(u>.01*r)return!1}else if(u/(e+i)>r)return!1;return!0}function A(n){return P(Math.max(-D,Math.min(n,D)))}function P(n){return u[0]=n,u[0]}function j(n,t){return tn[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function m(n,t,r){if(null!=t)if(\"length\"in t)G(t)?(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3])):2!==t.length&&3!==t.length||(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[0]),r[3]=Math.max(n[3],t[1]));else switch(t.type){case\"extent\":r[0]=Math.min(n[0],t.xmin),r[1]=Math.min(n[1],t.ymin),r[2]=Math.max(n[2],t.xmax),r[3]=Math.max(n[3],t.ymax);break;case\"point\":r[0]=Math.min(n[0],t.x),r[1]=Math.min(n[1],t.y),r[2]=Math.max(n[2],t.x),r[3]=Math.max(n[3],t.y)}else e(r,n)}function h(n,t,r=n){const u=t.length;let i=n[0],e=n[1],a=n[2],o=n[3];for(let c=0;c=n[2]?0:n[2]-n[0]}function s(n){return null==n||n[1]>=n[3]?0:n[3]-n[1]}function l(n){return M(n)*s(n)}function y(n){return M(n)>0&&s(n)>0}function p(n,t=[0,0]){return t[0]=(n[0]+n[2])/2,t[1]=(n[1]+n[3])/2,t}function b(n,t){return w(n,t[0],t[1])}function g(n,t){const r=t[3],u=.5*(n[0]+n[2]),i=Math.abs(t[0]-u),e=.5*(n[2]-n[0]);if(i>r+e)return!1;const a=.5*(n[1]+n[3]),o=.5*(n[3]-n[1]),c=Math.abs(t[1]-a);if(c>r+o)return!1;if(i(m-c)*n+(o-f)*t+(f*c-o*m)<0,x=h(u,a),M=h(e,a),s=h(e,i),l=h(u,i);return!(x===M&&M===s&&s===l&&l===x||oe&&f>e||c>a&&m>a||c=n[0]&&r>=n[1]&&t<=n[2]&&r<=n[3]}function k(n,t,r,u){return t>=n[0]-u&&r>=n[1]-u&&t<=n[2]+u&&r<=n[3]+u}function q(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[0]<=n[2]+r&&t[1]<=n[3]+r}function E(n,t){return Math.max(t[0],n[0])<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])<=Math.min(t[3],n[3])}function R(n,t){return t[0]>=n[0]&&t[2]<=n[2]&&t[1]>=n[1]&&t[3]<=n[3]}function U(t,r,u){if(null==r)return e(u,t);const i=r[0],a=r[1],o=r[2],c=r[3];return u[0]=n(t[0],i,o),u[1]=n(t[1],a,c),u[2]=n(t[2],i,o),u[3]=n(t[3],a,c),u}function d(n,t){const r=(n[0]+n[2])/2,u=(n[1]+n[3])/2,i=Math.max(Math.abs(t[0]-r)-M(n)/2,0),e=Math.max(Math.abs(t[1]-u)-s(n)/2,0);return Math.sqrt(i*i+e*e)}function v(n,t){t[0]=n[2]-n[0],t[1]=n[3]-n[1]}function z(n,t,r,u=n){return u[0]=n[0]+t,u[1]=n[1]+r,u[2]=n[2]+t,u[3]=n[3]+r,u}function A(n,t,r=n){return r[0]=n[0]-t,r[1]=n[1]-t,r[2]=n[2]+t,r[3]=n[3]+t,r}function B(n,t,r=n){return r[0]=t[0],r[1]=t[1],r!==n&&(r[2]=n[2],r[3]=n[3]),r}function C(n,t,r=n){return r[2]=t[0],r[3]=t[1],r!==n&&(r[0]=n[0],r[1]=n[1]),n}function D(n){return n?e(n,K):u(K)}function G(n){return null!=n&&4===n.length}function H(n){return!(0!==M(n)&&isFinite(n[0])||0!==s(n)&&isFinite(n[1]))}function I(n,t){return G(n)&&G(t)?n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]:n===t}const J=r([-1/0,-1/0,1/0,1/0]),K=r([1/0,1/0,-1/0,-1/0]),L=r([0,0,0,0]),N=r([0,0,1,1]);export{x as allFinite,l as area,p as center,i as clone,R as contains,b as containsPoint,F as containsPointObject,q as containsPointWithMargin,w as containsXY,k as containsXYWithMargin,e as copy,u as create,d as distance,D as empty,I as equals,m as expand,f as expandPointInPlace,h as expandWithNestedArray,o as fromExtent,a as fromValues,y as hasArea,s as height,U as intersection,E as intersects,j as intersectsSegment,g as intersectsSphere,G as is,H as isPoint,K as negativeInfinity,z as offset,A as pad,J as positiveInfinity,C as setMax,B as setMin,v as size,c as toExtent,N as unit,M as width,L as zero};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{create as n}from\"./aaBoundingRect.js\";function t(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function i(n){return void 0!==n.points}function o(n){return void 0!==n.x&&void 0!==n.y}function e(n){return void 0!==n.paths}function r(n){return void 0!==n.rings}function u(n){function t(t,i){return null==t?i:null==i?t:n(t,i)}return t}const l=u(Math.min),h=u(Math.max);function a(n,u){return e(u)?x(n,u.paths,!1,!1):r(u)?x(n,u.rings,!1,!1):i(u)?g(n,u.points,!1,!1,!1,!1):t(u)?s(n,u):(o(u)&&(n[0]=u.x,n[1]=u.y,n[2]=u.x,n[3]=u.y),n)}function c(t){let i,o,e,r;for(t.reset(),i=e=1/0,o=r=-1/0;t.nextPath();){const n=f(t);i=Math.min(n[0],i),e=Math.min(n[1],e),o=Math.max(n[2],o),r=Math.max(n[3],r)}return n([i,e,o,r])}function f(t){let i,o,e,r;for(i=e=1/0,o=r=-1/0;t.nextPoint();)i=Math.min(t.x,i),e=Math.min(t.y,e),o=Math.max(t.x,o),r=Math.max(t.y,r);return n([i,e,o,r])}function m(n,u){return e(u)?x(n,u.paths,!0,!1):r(u)?x(n,u.rings,!0,!1):i(u)?g(n,u.points,!0,!1,!0,!1):t(u)?s(n,u,!0,!1,!0,!1):(o(u)&&(n[0]=u.x,n[1]=u.y,n[2]=u.z,n[3]=u.x,n[4]=u.y,n[5]=u.z),n)}function x(n,t,i,o){const e=i?3:2;if(!t.length||!t[0].length)return null;let r,u,a,c,[f,m]=t[0][0],[x,s]=t[0][0];for(let g=0;g2){const n=g[2];r=l(r,n),u=h(u,n)}if(o&&g.length>e){const n=g[e];a=l(r,n),c=h(u,n)}}}return i?o?(n[0]=f,n[1]=m,n[2]=r,n[3]=a,n[4]=x,n[5]=s,n[6]=u,n[7]=c,n.length=8,n):(n[0]=f,n[1]=m,n[2]=r,n[3]=x,n[4]=s,n[5]=u,n.length=6,n):o?(n[0]=f,n[1]=m,n[2]=a,n[3]=x,n[4]=s,n[5]=c,n.length=6,n):(n[0]=f,n[1]=m,n[2]=x,n[3]=s,n.length=4,n)}function s(n,t,i,o,e,r){const u=t.xmin,l=t.xmax,h=t.ymin,a=t.ymax;let c=t.zmin,f=t.zmax,m=t.mmin,x=t.mmax;return e?(c=c||0,f=f||0,r?(m=m||0,x=x||0,n[0]=u,n[1]=h,n[2]=c,n[3]=m,n[4]=l,n[5]=a,n[6]=f,n[7]=x,n):(n[0]=u,n[1]=h,n[2]=c,n[3]=l,n[4]=a,n[5]=f,n)):r?(m=m||0,x=x||0,n[0]=u,n[1]=h,n[2]=m,n[3]=l,n[4]=a,n[5]=x,n):(n[0]=u,n[1]=h,n[2]=l,n[3]=a,n)}function g(n,t,i,o,e,r){const u=i?3:2,a=o&&r,c=i&&e;if(!t.length||!t[0].length)return null;let f,m,x,s,[g,y]=t[0],[d,M]=t[0];for(let v=0;v2){const t=n[2];f=l(f,t),m=h(m,t)}if(a&&n.length>u){const t=n[u];x=l(f,t),s=h(m,t)}}return e?(f=f||0,m=m||0,r?(x=x||0,s=s||0,n[0]=g,n[1]=y,n[2]=f,n[3]=x,n[4]=d,n[5]=M,n[6]=m,n[7]=s,n):(n[0]=g,n[1]=y,n[2]=f,n[3]=d,n[4]=M,n[5]=m,n)):r?(x=x||0,s=s||0,n[0]=g,n[1]=y,n[2]=x,n[3]=d,n[4]=M,n[5]=s,n):(n[0]=g,n[1]=y,n[2]=d,n[3]=M,n)}export{a as getBoundsXY,m as getBoundsXYZ,c as getCursorBoundsXY,f as getCursorPathBounds,s as getExtentBounds,g as getPointsBounds,x as getRingsOrPathsBounds};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getPointsBounds as n,getRingsOrPathsBounds as i}from\"./boundsUtils.js\";function t(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function u(n){return void 0!==n.points}function m(n){return void 0!==n.x&&void 0!==n.y}function o(n){return void 0!==n.paths}function r(n){return void 0!==n.rings}const x=[];function a(n,i,t,u){return{xmin:n,ymin:i,xmax:t,ymax:u}}function c(n,i,t,u,m,o){return{xmin:n,ymin:i,zmin:t,xmax:u,ymax:m,zmax:o}}function s(n,i,t,u,m,o){return{xmin:n,ymin:i,mmin:t,xmax:u,ymax:m,mmax:o}}function e(n,i,t,u,m,o,r,x){return{xmin:n,ymin:i,zmin:t,mmin:u,xmax:m,ymax:o,zmax:r,mmax:x}}function f(n,i=!1,t=!1){return i?t?e(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]):c(n[0],n[1],n[2],n[3],n[4],n[5]):t?s(n[0],n[1],n[2],n[3],n[4],n[5]):a(n[0],n[1],n[2],n[3])}function l(n){return n?t(n)?n:m(n)?d(n):r(n)?v(n):o(n)?h(n):u(n)?y(n):null:null}function y(i){const{hasZ:t,hasM:u,points:m}=i;return f(n(x,m,t??!1,u??!1),t,u)}function d(n){const{x:i,y:t,z:u,m}=n,o=null!=m;return null!=u?o?e(i,t,u,m,i,t,u,m):c(i,t,u,i,t,u):o?s(i,t,m,i,t,m):a(i,t,i,t)}function v(n){const{hasZ:t,hasM:u,rings:m}=n,o=i(x,m,t??!1,u??!1);return o?f(o,t,u):null}function h(n){const{hasZ:t,hasM:u,paths:m}=n,o=i(x,m,t??!1,u??!1);return o?f(o,t,u):null}export{l as getGeometryExtent,y as getMultipointExtent,d as getPointExtent,v as getPolygonExtent,h as getPolylineExtent};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{equals as e}from\"../core/arrayUtils.js\";import{clone as r}from\"../core/lang.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../core/accessorSupport/decorators/writer.js\";import o from\"./Extent.js\";import a from\"./Geometry.js\";import l from\"./Point.js\";import h from\"./SpatialReference.js\";import{polygonCentroid as p}from\"./support/centroid.js\";import{polygonContainsPoint as u}from\"./support/contains.js\";import{isClockwise as c}from\"./support/coordsUtils.js\";import{getPolygonExtent as f}from\"./support/extentUtils.js\";import{isSelfIntersecting as m}from\"./support/intersectsBase.js\";import{project as g}from\"./support/webMercatorUtils.js\";import{updateSupportFromPoint as y}from\"./support/zmUtils.js\";var d;function R(t){return!Array.isArray(t[0])}let x=d=class extends a{static fromExtent(t){const e=t.clone().normalize(),r=t.spatialReference;let s=!1,n=!1;for(const o of e)o.hasZ&&(s=!0),o.hasM&&(n=!0);const i={rings:e.map((t=>{const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(s&&t.hasZ){const r=t.zmin+.5*(t.zmax-t.zmin);for(let t=0;t2,s=i.length>3):void 0===r?r=s?i.length>3:i.length>2:void 0===s&&(s=r?i.length>3:i.length>2)),{rings:n,spatialReference:e,hasZ:r,hasM:s}}get cache(){return this.commitProperty(\"rings\"),this.commitProperty(\"hasZ\"),this.commitProperty(\"hasM\"),this.commitProperty(\"spatialReference\"),{}}get centroid(){const t=p(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new l;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}get extent(){const{spatialReference:t}=this,e=f(this);if(!e)return null;const r=new o(e);return r.spatialReference=t,r}get isSelfIntersecting(){return m(this.rings)}writeRings(t,e){e.rings=r(this.rings)}addRing(t){if(!t)return;const e=this.rings,r=e.length;if(R(t)){const s=[];for(let e=0,r=t.length;et===n&&e===i&&(null==r&&null==o||r===o)&&(null==s&&null==a||s===a);for(let i=0;ithis.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])):t,c(e)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const r=this.rings[t][e],s=this.hasZ,n=this.hasM;return s&&!n?new l(r[0],r[1],r[2],void 0,this.spatialReference):n&&!s?new l(r[0],r[1],void 0,r[2],this.spatialReference):s&&n?new l(r[0],r[1],r[2],r[3],this.spatialReference):new l(r[0],r[1],this.spatialReference)}insertPoint(t,e,r){return this._validateInputs(t,e,!0)?(y(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t].splice(e,0,r),this.notifyChange(\"rings\"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const r=new l(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange(\"rings\"),r}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],r=this.spatialReference,s=e.map((t=>new l(t,r)));return this.notifyChange(\"rings\"),s}setPoint(t,e,r){return this._validateInputs(t,e)?(y(this,r),Array.isArray(r)||(r=r.toArray()),this.rings[t][e]=r,this.notifyChange(\"rings\"),this):this}_validateInputs(t,e,r=!1){if(null==t||t<0||t>=this.rings.length)return!1;if(null!=e){const s=this.rings[t];if(r&&(e<0||e>s.length))return!1;if(!r&&(e<0||e>=s.length))return!1}return!0}toJSON(t){return this.write({},t)}};t([s({readOnly:!0})],x.prototype,\"cache\",null),t([s({readOnly:!0})],x.prototype,\"centroid\",null),t([s({readOnly:!0})],x.prototype,\"extent\",null),t([s({readOnly:!0})],x.prototype,\"isSelfIntersecting\",null),t([s({type:[[[Number]]],json:{write:{isRequired:!0}}})],x.prototype,\"rings\",void 0),t([i(\"rings\")],x.prototype,\"writeRings\",null),x=d=t([n(\"esri.geometry.Polygon\")],x),x.prototype.toJSON.isDefaultToJSON=!0;const j=x;export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{clone as e}from\"../core/lang.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{subclass as r}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../core/accessorSupport/decorators/writer.js\";import a from\"./Extent.js\";import n from\"./Geometry.js\";import o from\"./Point.js\";import h from\"./SpatialReference.js\";import{getPolylineExtent as p}from\"./support/extentUtils.js\";import{updateSupportFromPoint as l}from\"./support/zmUtils.js\";var c;function u(t){return!Array.isArray(t[0])}let f=c=class extends n{constructor(...t){super(...t),this.paths=[],this.type=\"polyline\"}normalizeCtorArgs(t,e){let s,r,i=null,a=null;return t&&!Array.isArray(t)?(i=t.paths??null,e||(t.spatialReference?e=t.spatialReference:t.paths||(e=t)),s=t.hasZ,r=t.hasM):i=t,i=i||[],e=e||h.WGS84,i.length&&null!=i[0]?.[0]&&\"number\"==typeof i[0][0]&&(i=[i]),a=i[0]?.[0],a&&(void 0===s&&void 0===r?(s=a.length>2,r=!1):void 0===s?s=!r&&a.length>3:void 0===r&&(r=!s&&a.length>3)),{paths:i,spatialReference:e,hasZ:s,hasM:r}}get cache(){return this.commitProperty(\"paths\"),this.commitProperty(\"hasZ\"),this.commitProperty(\"hasM\"),this.commitProperty(\"spatialReference\"),{}}get extent(){const{spatialReference:t}=this,e=p(this);if(!e)return null;const s=new a(e);return s.spatialReference=t,s}writePaths(t,s){s.paths=e(this.paths)}addPath(t){if(!t)return;const e=this.paths,s=e.length;if(u(t)){const r=[];for(let e=0,s=t.length;enew o(t,s)));return this.notifyChange(\"paths\"),r}removePoint(t,e){if(!this._validateInputs(t,e))return null;const s=new o(this.paths[t].splice(e,1)[0],this.spatialReference);return this.notifyChange(\"paths\"),s}setPoint(t,e,s){return this._validateInputs(t,e)?(l(this,s),Array.isArray(s)||(s=s.toArray()),this.paths[t][e]=s,this.notifyChange(\"paths\"),this):this}_validateInputs(t,e,s=!1){if(null==t||t<0||t>=this.paths.length)return!1;if(null!=e){const r=this.paths[t];if(s&&(e<0||e>r.length))return!1;if(!s&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};t([s({readOnly:!0})],f.prototype,\"cache\",null),t([s({readOnly:!0})],f.prototype,\"extent\",null),t([s({type:[[[Number]]],json:{write:{isRequired:!0}}})],f.prototype,\"paths\",void 0),t([i(\"paths\")],f.prototype,\"writePaths\",null),f=c=t([r(\"esri.geometry.Polyline\")],f),f.prototype.toJSON.isDefaultToJSON=!0;const m=f;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{strict as e}from\"../../core/jsonMap.js\";const o=e()({esriGeometryPoint:\"point\",esriGeometryMultipoint:\"multipoint\",esriGeometryPolyline:\"polyline\",esriGeometryPolygon:\"polygon\"}),i=e()({esriGeometryPoint:\"point\",esriGeometryMultipoint:\"multipoint\",esriGeometryPolyline:\"polyline\",esriGeometryPolygon:\"polygon\",esriGeometryEnvelope:\"extent\",mesh:\"mesh\"});export{o as featureGeometryTypeKebabDictionary,i as typeKebabDictionary};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport o from\"../Extent.js\";import r from\"../Geometry.js\";import n from\"../Multipoint.js\";import t from\"../Point.js\";import e from\"../Polygon.js\";import i from\"../Polyline.js\";function m(o){return void 0!==o.xmin&&void 0!==o.ymin&&void 0!==o.xmax&&void 0!==o.ymax}function u(o){return void 0!==o.points}function l(o){return void 0!==o.x&&void 0!==o.y}function s(o){return void 0!==o.paths}function f(o){return void 0!==o.rings}function y(o){return void 0!==o.vertexAttributes}function p(y){return null==y?null:y instanceof r?y:l(y)?t.fromJSON(y):s(y)?i.fromJSON(y):f(y)?e.fromJSON(y):u(y)?n.fromJSON(y):m(y)?o.fromJSON(y):null}function v(o){return o?l(o)?\"esriGeometryPoint\":s(o)?\"esriGeometryPolyline\":f(o)?\"esriGeometryPolygon\":m(o)?\"esriGeometryEnvelope\":u(o)?\"esriGeometryMultipoint\":null:null}const c={esriGeometryPoint:t,esriGeometryPolyline:i,esriGeometryPolygon:e,esriGeometryEnvelope:o,esriGeometryMultipoint:n};function G(o){return o&&c[o]||null}export{p as fromJSON,G as getGeometryType,v as getJsonType,m as isExtent,y as isMesh,u as isMultipoint,l as isPoint,f as isPolygon,s as isPolyline};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ensureOneOfType as e}from\"./core/accessorSupport/ensureType.js\";import o from\"./geometry/Extent.js\";import t from\"./geometry/Geometry.js\";import r from\"./geometry/Multipoint.js\";import p from\"./geometry/Point.js\";import m from\"./geometry/Polygon.js\";import i from\"./geometry/Polyline.js\";export{default as SpatialReference}from\"./geometry/SpatialReference.js\";export{featureGeometryTypeKebabDictionary,typeKebabDictionary}from\"./geometry/support/typeUtils.js\";export{fromJSON}from\"./geometry/support/jsonUtils.js\";function y(e){return e instanceof t}const n={base:t,key:\"type\",typeMap:{extent:o,multipoint:r,point:p,polyline:i,polygon:m}},s=e(n);export{t as BaseGeometry,o as Extent,r as Multipoint,p as Point,m as Polygon,i as Polyline,s as ensureType,n as geometryTypes,y as isGeometry};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import s from\"./Accessor.js\";import\"./has.js\";import{tryClone as t}from\"./lang.js\";import\"./Logger.js\";import{assertIsSome as r}from\"./maybe.js\";import{OriginId as e}from\"./accessorSupport/PropertyOrigin.js\";import{getProperties as n}from\"./accessorSupport/utils.js\";import{subclass as c}from\"./accessorSupport/decorators/subclass.js\";const i=s=>{let i=class extends s{clone(){const o=n(this);r(o,\"unable to clone instance of non-accessor class\");const s=o.metadatas,c=o.store,i={},l=new Map;for(const r in s){const o=s[r],n=c?.originOf(r),a=o.clonable;if(o.readOnly||!1===a||n!==e.USER&&n!==e.DEFAULTS&&n!==e.WEB_MAP&&n!==e.WEB_SCENE)continue;const p=this[r];let f=null;f=\"function\"==typeof a?a(p):\"reference\"===a?p:t(p),null!=p&&null==f||(n===e.DEFAULTS?l.set(r,f):i[r]=f)}const a=new(0,Object.getPrototypeOf(this).constructor)(i);if(l.size){const o=n(a)?.store;if(o)for(const[s,t]of l)o.set(s,t,e.DEFAULTS)}return a}};return i=o([c(\"esri.core.Clonable\")],i),i};let l=class extends(i(s)){};l=o([c(\"esri.core.Clonable\")],l);export{l as Clonable,i as ClonableMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"./Accessor.js\";import{handlesGroup as r,makeHandle as s}from\"./handleUtils.js\";import{subclass as n}from\"./accessorSupport/decorators/subclass.js\";class i{constructor(){this._emitter=new i.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(o){class c{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){let r=this._listenersMap?.get(e);if(!r)return!1;const s=this._target||this;let n=!1;for(const i of r.slice()){const e=\"deref\"in i?i.deref():i;e?e?.call(s,t):n=!0}return n&&(r=r.filter((e=>!(\"deref\"in e)||null!=e.deref())),this._listenersMap.set(e,r)),r.length>0}on(e,t){if(Array.isArray(e)){const s=e.map((e=>this.on(e,t)));return r(s)}if(e.includes(\",\"))throw new TypeError(\"Evented.on() with a comma delimited string of event types is not supported\");this._listenersMap??=new Map;const n=this._listenersMap.get(e)||[];return n.push(t),this._listenersMap.set(e,n),s((()=>{const r=this._listenersMap?.get(e),s=r?.indexOf(t)??-1;s>=0&&r.splice(s,1)}))}once(e,t){const r=this.on(e,(e=>{r.remove();const s=\"deref\"in t?t.deref():t;s?.call(null,e)}));return r}hasEventListener(e){const t=this._listenersMap?.get(e);return null!=t&&t.length>0}}o.EventEmitter=c,o.EventedMixin=t=>{let r=class extends t{constructor(){super(...arguments),this._emitter=new c}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return r=e([n(\"esri.core.Evented\")],r),r};let l=class extends t{constructor(){super(...arguments),this._emitter=new i.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};l=e([n(\"esri.core.Evented\")],l),o.EventedAccessor=l}(i||(i={}));const o=i;export{o as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar E;!function(E){E[E.ADD=1]=\"ADD\",E[E.REMOVE=2]=\"REMOVE\",E[E.MOVE=4]=\"MOVE\"}(E||(E={}));export{E as ObservableChangesType};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(n){return(r,t)=>{r[t]=n}}export{n as shared};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ObservableBase as o}from\"../ObservableBase.js\";class s extends o{notify(){const o=this._observers;if(o&&o.length>0){const s=o.slice();for(const o of s)o.onInvalidated(),o.onCommitted()}}}export{s as SimpleObservable};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"./ArrayPool.js\";import s from\"./Evented.js\";import{makeHandle as i}from\"./handleUtils.js\";import{clone as r}from\"./lang.js\";import n from\"./ObjectPool.js\";import{ObservableChangesType as h}from\"./ObservableChangesType.js\";import{schedule as o}from\"./scheduling.js\";import{ensureType as l,ensureOneOfType as a}from\"./accessorSupport/ensureType.js\";import{trackAccess as c}from\"./accessorSupport/tracking.js\";import{property as f}from\"./accessorSupport/decorators/property.js\";import{shared as _}from\"./accessorSupport/decorators/shared.js\";import{subclass as m}from\"./accessorSupport/decorators/subclass.js\";import{SimpleObservable as u}from\"./accessorSupport/tracking/SimpleObservable.js\";var g;class d{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class p{constructor(e,t,s,i,r){this.target=e,this.added=t,this.removed=s,this.start=i,this.deleteCount=r}}const b=new n(d,void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function v(e){return e?e instanceof R?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function E(e){if(e?.length)return e[0]}function C(e,t,s,i){const r=Math.min(e.length-s,t.length-i);let n=0;for(;n{e.push(t),y(e,s.call(i,t,r,n),s,i)}))}const A=new Set,O=new Set,M=new Set,D=new Map;let x=0,R=g=class extends s.EventedAccessor{static isCollection(e){return null!=e&&e instanceof g}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new u,this.length=0,this._items=[],Object.defineProperty(this,\"uid\",{value:x++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof g?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return c(this._observable),this._items}set items(e){this._emitBeforeChanges(h.ADD)||(this._splice(0,this.length,v(e)),this._emitAfterChanges(h.ADD))}hasEventListener(e){return\"change\"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if(\"change\"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i((()=>{s.removed=!0,e.splice(e.indexOf(s),1)}))}return this._emitter.on(e,t)}once(e,t){const s=\"deref\"in t?()=>t.deref():()=>t,i=this.on(e,(e=>{s()?.call(null,e),i.remove()}));return i}add(e,t){if(c(this._observable),this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(h.ADD),this}addMany(e,t=this._items.length){if(c(this._observable),!e?.length)return this;if(this._emitBeforeChanges(h.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,v(e)),this._emitAfterChanges(h.ADD),this}at(e){if(c(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(h.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return c(this._observable),this._createNewInstance({items:this._items.map(r)})}concat(...e){c(this._observable);const t=e.map(v);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const s=this._splice(0,this.length),i=s.length;for(let r=0;rt&&(e=t),e}includes(e,t=0){return c(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return c(this._observable),this._items.indexOf(e,t)}join(e=\",\"){return c(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return c(this._observable),this._items.lastIndexOf(e,t)}map(e,t){c(this._observable);const s=this._items.map(e,t);return new g({items:s})}reorder(e,t=this.length-1){c(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(h.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(h.MOVE)}return e}}pop(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=E(this._splice(this.length-1,1));return this._emitAfterChanges(h.REMOVE),e}push(...e){return c(this._observable),this._emitBeforeChanges(h.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(h.ADD)),this.length}reduce(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){c(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return c(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(c(this._observable),e<0||e>=this.length||this._emitBeforeChanges(h.REMOVE))return;const t=E(this._splice(e,1));return this._emitAfterChanges(h.REMOVE),t}removeMany(e){if(c(this._observable),!e?.length||this._emitBeforeChanges(h.REMOVE))return[];const t=e instanceof g?e.toArray():e,s=this._items,i=[],r=t.length;for(let n=0;n-1){const e=1+C(t,s,n+1,r+1),h=this._splice(r,e);h&&h.length>0&&i.push.apply(i,h),n+=e-1}}return this._emitAfterChanges(h.REMOVE),i}reverse(){if(c(this._observable),this._emitBeforeChanges(h.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(h.MOVE),this}shift(){if(c(this._observable),!this.length||this._emitBeforeChanges(h.REMOVE))return;const e=E(this._splice(0,1));return this._emitAfterChanges(h.REMOVE),e}slice(e=0,t=this.length){return c(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return c(this._observable),this._items.some(e,t)}sort(e){if(c(this._observable),!this.length||this._emitBeforeChanges(h.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(h.MOVE),this}splice(e,t,...s){c(this._observable);const i=(t?h.REMOVE:0)|(s.length?h.ADD:0);if(this._emitBeforeChanges(i))return[];const r=this._splice(e,t,s)||[];return this._emitAfterChanges(i),r}toArray(){return c(this._observable),this._items.slice()}toJSON(){return c(this._observable),this.toArray()}toLocaleString(){return c(this._observable),this._items.toLocaleString()}toString(){return c(this._observable),this._items.toString()}unshift(...e){return c(this._observable),!e.length||this._emitBeforeChanges(h.ADD)||(this._splice(0,0,e),this._emitAfterChanges(h.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const i=this._items,r=this.itemType;let n,h;if(!this._notifications&&this.hasEventListener(\"change\")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=o((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(h=i.splice(e,t),this.hasEventListener(\"before-remove\")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let s=0,r=h.length;s{i.push(e)}));const r=t.acquire();O.forEach((e=>{r.push(e)}));const n=this._items,h=s.items,o=t.acquire();if(M.forEach((e=>{h.indexOf(e)!==n.indexOf(e)&&o.push(e)})),s.listeners&&(i.length||r.length||o.length)){const e={target:this,added:i,removed:r,moved:o},t=s.listeners.length;for(let i=0;i{if(!t)return g;if(D.has(t))return D.get(t);let s=null;if(\"function\"==typeof t)s=t.prototype.declaredClass;else if(t.base)s=t.base.prototype.declaredClass;else for(const e in t.typeMap){const i=t.typeMap[e].prototype.declaredClass;s?s+=` | ${i}`:s=i}let i=class extends g{};return e([_({Type:t,ensureType:\"function\"==typeof t?l(t):a(t)})],i.prototype,\"itemType\",void 0),i=e([m(`esri.core.Collection<${s}>`)],i),D.set(t,i),i},e([f()],R.prototype,\"length\",void 0),e([f()],R.prototype,\"items\",null),R=g=e([m(\"esri.core.Collection\")],R);const V=R;export{V as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nasync function e(e,n){const{WhereClause:r}=await import(\"./sql/WhereClause.js\");return r.create(e,n)}function n(e,n){return null!=e?null!=n?`(${e}) AND (${n})`:e:n}export{e as parseWhereClause,n as sqlAnd};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(n){return\"number\"==typeof n}function t(n){return\"string\"==typeof n||n instanceof String}export{n as isNumber,t as isString};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{makeHandle as n}from\"../core/handleUtils.js\";let o,e;const t=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function l(){return t??globalThis.navigator?.language??\"en\"}function c(){return void 0===e&&(e=l()),e}function i(n){o=n||void 0,d()}function r(n=c()){const o=/^([a-zA-Z]{2,3})(?:[_\\-]\\w+)*$/.exec(n);return o?.[1].toLowerCase()}const a={he:!0,ar:!0};function s(n=c()){const o=r(n);return void 0!==o&&(a[o]||!1)}const u=[];function f(o){return u.push(o),n((()=>u.splice(u.indexOf(o),1)))}const g=[];function h(o){return g.push(o),n((()=>u.splice(g.indexOf(o),1)))}function d(){const n=o??l();e!==n&&(e=n,[...g].forEach((o=>{o.call(null,n)})),[...u].forEach((o=>{o.call(null,n)})))}globalThis.addEventListener?.(\"languagechange\",d);export{h as beforeLocaleChange,l as getDefaultLocale,r as getLanguage,c as getLocale,f as onLocaleChange,s as prefersRTL,i as setLocale};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst a=new Map([[\"AUS Central Standard Time\",\"Australia/Darwin\"],[\"AUS Eastern Standard Time\",\"Australia/Sydney\"],[\"Afghanistan Standard Time\",\"Asia/Kabul\"],[\"Alaskan Standard Time\",\"America/Anchorage\"],[\"Aleutian Standard Time\",\"America/Adak\"],[\"Altai Standard Time\",\"Asia/Barnaul\"],[\"Arab Standard Time\",\"Asia/Riyadh\"],[\"Arabian Standard Time\",\"Asia/Dubai\"],[\"Arabic Standard Time\",\"Asia/Baghdad\"],[\"Argentina Standard Time\",\"America/Buenos_Aires\"],[\"Astrakhan Standard Time\",\"Europe/Astrakhan\"],[\"Atlantic Standard Time\",\"America/Halifax\"],[\"Aus Central W. Standard Time\",\"Australia/Eucla\"],[\"Azerbaijan Standard Time\",\"Asia/Baku\"],[\"Azores Standard Time\",\"Atlantic/Azores\"],[\"Bahia Standard Time\",\"America/Bahia\"],[\"Bangladesh Standard Time\",\"Asia/Dhaka\"],[\"Belarus Standard Time\",\"Europe/Minsk\"],[\"Bougainville Standard Time\",\"Pacific/Bougainville\"],[\"Canada Central Standard Time\",\"America/Regina\"],[\"Cape Verde Standard Time\",\"Atlantic/Cape_Verde\"],[\"Caucasus Standard Time\",\"Asia/Yerevan\"],[\"Cen. Australia Standard Time\",\"Australia/Adelaide\"],[\"Central America Standard Time\",\"America/Guatemala\"],[\"Central Asia Standard Time\",\"Asia/Almaty\"],[\"Central Brazilian Standard Time\",\"America/Cuiaba\"],[\"Central Europe Standard Time\",\"Europe/Budapest\"],[\"Central European Standard Time\",\"Europe/Warsaw\"],[\"Central Pacific Standard Time\",\"Pacific/Guadalcanal\"],[\"Central Standard Time\",\"America/Chicago\"],[\"Central Standard Time (Mexico)\",\"America/Mexico_City\"],[\"Chatham Islands Standard Time\",\"Pacific/Chatham\"],[\"China Standard Time\",\"Asia/Shanghai\"],[\"Cuba Standard Time\",\"America/Havana\"],[\"Dateline Standard Time\",\"Etc/GMT+12\"],[\"E. Africa Standard Time\",\"Africa/Nairobi\"],[\"E. Australia Standard Time\",\"Australia/Brisbane\"],[\"E. Europe Standard Time\",\"Europe/Chisinau\"],[\"E. South America Standard Time\",\"America/Sao_Paulo\"],[\"Easter Island Standard Time\",\"Pacific/Easter\"],[\"Eastern Standard Time\",\"America/New_York\"],[\"Eastern Standard Time (Mexico)\",\"America/Cancun\"],[\"Egypt Standard Time\",\"Africa/Cairo\"],[\"Ekaterinburg Standard Time\",\"Asia/Yekaterinburg\"],[\"FLE Standard Time\",\"Europe/Kiev\"],[\"Fiji Standard Time\",\"Pacific/Fiji\"],[\"GMT Standard Time\",\"Europe/London\"],[\"GTB Standard Time\",\"Europe/Bucharest\"],[\"Georgian Standard Time\",\"Asia/Tbilisi\"],[\"Greenland Standard Time\",\"America/Godthab\"],[\"Greenwich Standard Time\",\"Atlantic/Reykjavik\"],[\"Haiti Standard Time\",\"America/Port-au-Prince\"],[\"Hawaiian Standard Time\",\"Pacific/Honolulu\"],[\"India Standard Time\",\"Asia/Calcutta\"],[\"Iran Standard Time\",\"Asia/Tehran\"],[\"Israel Standard Time\",\"Asia/Jerusalem\"],[\"Jordan Standard Time\",\"Asia/Amman\"],[\"Kaliningrad Standard Time\",\"Europe/Kaliningrad\"],[\"Korea Standard Time\",\"Asia/Seoul\"],[\"Libya Standard Time\",\"Africa/Tripoli\"],[\"Line Islands Standard Time\",\"Pacific/Kiritimati\"],[\"Lord Howe Standard Time\",\"Australia/Lord_Howe\"],[\"Magadan Standard Time\",\"Asia/Magadan\"],[\"Magallanes Standard Time\",\"America/Punta_Arenas\"],[\"Marquesas Standard Time\",\"Pacific/Marquesas\"],[\"Mauritius Standard Time\",\"Indian/Mauritius\"],[\"Middle East Standard Time\",\"Asia/Beirut\"],[\"Montevideo Standard Time\",\"America/Montevideo\"],[\"Morocco Standard Time\",\"Africa/Casablanca\"],[\"Mountain Standard Time\",\"America/Denver\"],[\"Mountain Standard Time (Mexico)\",\"America/Mazatlan\"],[\"Myanmar Standard Time\",\"Asia/Rangoon\"],[\"N. Central Asia Standard Time\",\"Asia/Novosibirsk\"],[\"Namibia Standard Time\",\"Africa/Windhoek\"],[\"Nepal Standard Time\",\"Asia/Katmandu\"],[\"New Zealand Standard Time\",\"Pacific/Auckland\"],[\"Newfoundland Standard Time\",\"America/St_Johns\"],[\"Norfolk Standard Time\",\"Pacific/Norfolk\"],[\"North Asia East Standard Time\",\"Asia/Irkutsk\"],[\"North Asia Standard Time\",\"Asia/Krasnoyarsk\"],[\"North Korea Standard Time\",\"Asia/Pyongyang\"],[\"Omsk Standard Time\",\"Asia/Omsk\"],[\"Pacific SA Standard Time\",\"America/Santiago\"],[\"Pacific Standard Time\",\"America/Los_Angeles\"],[\"Pacific Standard Time (Mexico)\",\"America/Tijuana\"],[\"Pakistan Standard Time\",\"Asia/Karachi\"],[\"Paraguay Standard Time\",\"America/Asuncion\"],[\"Qyzylorda Standard Time\",\"Asia/Qyzylorda\"],[\"Romance Standard Time\",\"Europe/Paris\"],[\"Russia Time Zone 10\",\"Asia/Srednekolymsk\"],[\"Russia Time Zone 11\",\"Asia/Kamchatka\"],[\"Russia Time Zone 3\",\"Europe/Samara\"],[\"Russian Standard Time\",\"Europe/Moscow\"],[\"SA Eastern Standard Time\",\"America/Cayenne\"],[\"SA Pacific Standard Time\",\"America/Bogota\"],[\"SA Western Standard Time\",\"America/La_Paz\"],[\"SE Asia Standard Time\",\"Asia/Bangkok\"],[\"Saint Pierre Standard Time\",\"America/Miquelon\"],[\"Sakhalin Standard Time\",\"Asia/Sakhalin\"],[\"Samoa Standard Time\",\"Pacific/Apia\"],[\"Sao Tome Standard Time\",\"Africa/Sao_Tome\"],[\"Saratov Standard Time\",\"Europe/Saratov\"],[\"Singapore Standard Time\",\"Asia/Singapore\"],[\"South Africa Standard Time\",\"Africa/Johannesburg\"],[\"South Sudan Standard Time\",\"Africa/Juba\"],[\"Sri Lanka Standard Time\",\"Asia/Colombo\"],[\"Sudan Standard Time\",\"Africa/Khartoum\"],[\"Syria Standard Time\",\"Asia/Damascus\"],[\"Taipei Standard Time\",\"Asia/Taipei\"],[\"Tasmania Standard Time\",\"Australia/Hobart\"],[\"Tocantins Standard Time\",\"America/Araguaina\"],[\"Tokyo Standard Time\",\"Asia/Tokyo\"],[\"Tomsk Standard Time\",\"Asia/Tomsk\"],[\"Tonga Standard Time\",\"Pacific/Tongatapu\"],[\"Transbaikal Standard Time\",\"Asia/Chita\"],[\"Turkey Standard Time\",\"Europe/Istanbul\"],[\"Turks And Caicos Standard Time\",\"America/Grand_Turk\"],[\"US Eastern Standard Time\",\"America/Indianapolis\"],[\"US Mountain Standard Time\",\"America/Phoenix\"],[\"UTC\",\"Etc/GMT\"],[\"UTC+01\",\"Etc/GMT-1\"],[\"UTC+02\",\"Etc/GMT-2\"],[\"UTC+03\",\"Etc/GMT-3\"],[\"UTC+04\",\"Etc/GMT-4\"],[\"UTC+05\",\"Etc/GMT-5\"],[\"UTC+06\",\"Etc/GMT-6\"],[\"UTC+07\",\"Etc/GMT-7\"],[\"UTC+08\",\"Etc/GMT-8\"],[\"UTC+09\",\"Etc/GMT-9\"],[\"UTC+10\",\"Etc/GMT-10\"],[\"UTC+11\",\"Etc/GMT-11\"],[\"UTC+12\",\"Etc/GMT-12\"],[\"UTC+13\",\"Etc/GMT-13\"],[\"UTC+14\",\"Etc/GMT-14\"],[\"UTC-01\",\"Etc/GMT+1\"],[\"UTC-02\",\"Etc/GMT+2\"],[\"UTC-03\",\"Etc/GMT+3\"],[\"UTC-04\",\"Etc/GMT+4\"],[\"UTC-05\",\"Etc/GMT+5\"],[\"UTC-06\",\"Etc/GMT+6\"],[\"UTC-07\",\"Etc/GMT+7\"],[\"UTC-08\",\"Etc/GMT+8\"],[\"UTC-09\",\"Etc/GMT+9\"],[\"UTC-10\",\"Etc/GMT+10\"],[\"UTC-11\",\"Etc/GMT+11\"],[\"UTC-12\",\"Etc/GMT+12\"],[\"Ulaanbaatar Standard Time\",\"Asia/Ulaanbaatar\"],[\"Venezuela Standard Time\",\"America/Caracas\"],[\"Vladivostok Standard Time\",\"Asia/Vladivostok\"],[\"Volgograd Standard Time\",\"Europe/Volgograd\"],[\"W. Australia Standard Time\",\"Australia/Perth\"],[\"W. Central Africa Standard Time\",\"Africa/Lagos\"],[\"W. Europe Standard Time\",\"Europe/Berlin\"],[\"W. Mongolia Standard Time\",\"Asia/Hovd\"],[\"West Asia Standard Time\",\"Asia/Tashkent\"],[\"West Bank Standard Time\",\"Asia/Hebron\"],[\"West Pacific Standard Time\",\"Pacific/Port_Moresby\"],[\"Yakutsk Standard Time\",\"Asia/Yakutsk\"],[\"Yukon Standard Time\",\"America/Whitehorse\"]]);export{a as legacyTimeZoneMap};\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{legacyTimeZoneMap as t}from\"./legacyTimeZoneMap.js\";import{DateTime as e,FixedOffsetZone as n}from\"luxon\";const o=\"system\",r=\"unknown\",i=\"UTC\",s=Intl.DateTimeFormat().resolvedOptions().timeZone,a=\"shortOffset\";function m(t){return\"timeZoneIANA\"in t}function u(t){return t.startsWith(\"UTC\")}function c(t,e=!1){return{json:{read:{source:t,reader:(e,n)=>n[t]?f(n[t]):null},write:!!e&&{allowNull:!0,writer(e,n){n[t]=e?l(e):null}}}}}function f(t,e=o){return t?m(t)?t.timeZoneIANA:Z(t,e):e}function l(t){return{timeZoneIANA:t}}function Z(e,n=o){if(!e||!t.has(e.timeZone))return n;const r=t.get(e.timeZone);return u(e.timeZone)||e.respectsDaylightSaving?r:d(r)}function d(t){const o=e.local().setZone(t),r=Math.min(o.set({month:1,day:1}).offset,o.set({month:5}).offset);if(0===r)return\"Etc/UTC\";return`Etc/GMT${n.instance(-r).formatOffset(0,\"narrow\")}`}function g(t,e,n,o,s){if(e&&\"date\"===s)return{timeZone:i,timeZoneName:void 0};const m=o.timeStyle||o.hour,u=n===r;return{timeZone:u?\"timestamp-offset\"===s?void 0:t??i:n,timeZoneName:u&&m?a:void 0}}function h(t){const e=t===o?s:t,n=/^(?[\\w-]+)(?:\\/(?[\\w-]+))?\\/(?[\\w+-]+)$/;if(n.test(e)){const t=n.exec(e)?.groups,{area:o,region:r,location:i}=t;return{area:o,region:r,location:i,timeZone:e}}return{timeZone:e}}export{Z as convertLegacyTimeZone,f as fromTimeReference,h as getTimeZoneComponents,g as getTimeZoneFormattingOptions,a as shortTimeZoneName,o as system,s as systemTimeZone,c as timeZoneProperty,l as toTimeReference,r as unknown,i as utc};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{strict as t}from\"../core/jsonMap.js\";import{beforeLocaleChange as e,getLocale as o}from\"./locale.js\";import{system as r,utc as n,unknown as a,systemTimeZone as m,shortTimeZoneName as h}from\"../time/timeZoneUtils.js\";import{DateTime as i}from\"luxon\";const s={year:void 0,month:void 0,day:void 0,weekday:void 0},l={hour:void 0,minute:void 0,second:void 0},y={timeZone:n},d={year:\"numeric\",month:\"numeric\",day:\"numeric\"},g={year:\"numeric\",month:\"long\",day:\"numeric\"},u={year:\"numeric\",month:\"short\",day:\"numeric\"},c={year:\"numeric\",month:\"long\",weekday:\"long\",day:\"numeric\"},D={hour:\"numeric\",minute:\"numeric\"},T={...D,second:\"numeric\"},f={hourCycle:\"h23\"},S={...D,...f},L={...T,...f},M={\"short-date\":d,\"short-date-short-time\":{...d,...D},\"short-date-short-time-24\":{...d,...S},\"short-date-long-time\":{...d,...T},\"short-date-long-time-24\":{...d,...L},\"short-date-le\":d,\"short-date-le-short-time\":{...d,...D},\"short-date-le-short-time-24\":{...d,...S},\"short-date-le-long-time\":{...d,...T},\"short-date-le-long-time-24\":{...d,...L},\"long-month-day-year\":g,\"long-month-day-year-short-time\":{...g,...D},\"long-month-day-year-short-time-24\":{...g,...S},\"long-month-day-year-long-time\":{...g,...T},\"long-month-day-year-long-time-24\":{...g,...L},\"day-short-month-year\":u,\"day-short-month-year-short-time\":{...u,...D},\"day-short-month-year-short-time-24\":{...u,...S},\"day-short-month-year-long-time\":{...u,...T},\"day-short-month-year-long-time-24\":{...u,...L},\"long-date\":c,\"long-date-short-time\":{...c,...D},\"long-date-short-time-24\":{...c,...S},\"long-date-long-time\":{...c,...T},\"long-date-long-time-24\":{...c,...L},\"long-month-year\":{month:\"long\",year:\"numeric\"},\"short-month-year\":{month:\"short\",year:\"numeric\"},year:{year:\"numeric\"},\"short-time\":D,\"long-time\":T},Y=t()({shortDate:\"short-date\",shortDateShortTime:\"short-date-short-time\",shortDateShortTime24:\"short-date-short-time-24\",shortDateLongTime:\"short-date-long-time\",shortDateLongTime24:\"short-date-long-time-24\",shortDateLE:\"short-date-le\",shortDateLEShortTime:\"short-date-le-short-time\",shortDateLEShortTime24:\"short-date-le-short-time-24\",shortDateLELongTime:\"short-date-le-long-time\",shortDateLELongTime24:\"short-date-le-long-time-24\",longMonthDayYear:\"long-month-day-year\",longMonthDayYearShortTime:\"long-month-day-year-short-time\",longMonthDayYearShortTime24:\"long-month-day-year-short-time-24\",longMonthDayYearLongTime:\"long-month-day-year-long-time\",longMonthDayYearLongTime24:\"long-month-day-year-long-time-24\",dayShortMonthYear:\"day-short-month-year\",dayShortMonthYearShortTime:\"day-short-month-year-short-time\",dayShortMonthYearShortTime24:\"day-short-month-year-short-time-24\",dayShortMonthYearLongTime:\"day-short-month-year-long-time\",dayShortMonthYearLongTime24:\"day-short-month-year-long-time-24\",longDate:\"long-date\",longDateShortTime:\"long-date-short-time\",longDateShortTime24:\"long-date-short-time-24\",longDateLongTime:\"long-date-long-time\",longDateLongTime24:\"long-date-long-time-24\",longMonthYear:\"long-month-year\",shortMonthYear:\"short-month-year\",year:\"year\"}),Z={ar:\"ar-u-nu-latn-ca-gregory\"};let w=new WeakMap;const p=M[\"short-date-short-time\"];function v(t){let e=w.get(t);if(!e){const n=o(),a=Z[n]||n,m=F(t.timeZone??r),h={...t,timeZone:m};e=new Intl.DateTimeFormat(a,h),w.set(t,e)}return e}function E(t){return M[t]}function j(t,e=p){return v(e).format(t)}function k(t,e=p){return j(new Date(t),{...e,...y,...l})}function I(t,e=p){return j(new Date(`1970-01-01T${t}Z`),{...e,...y,...s})}function x(t,e=p){if(e.timeZone)return j(new Date(t),e);const r=i.fromISO(t,{setZone:!0}),a=o(),m=Z[a]??a,h=0===r.offset?n:e.timeZone,s={...e,timeZone:h};return r.toLocaleString(s,{locale:m})}function F(t){switch(t){case r:return m;case a:return n;default:return t}}function N(t,e){const r=o(),n=Z[r]??r;return new Intl.DateTimeFormat(n,e).formatToParts(t)}function W(t,e=new Date){return N(e,{timeZone:t,timeZoneName:h}).find((({type:t})=>\"timeZoneName\"===t))?.value}e((()=>{w=new WeakMap}));export{E as convertDateFormatToIntlOptions,Y as dateFormatJSONMap,j as formatDate,k as formatDateOnly,I as formatTimeOnly,x as formatTimestamp,v as getDateTimeFormatter,W as getShortOffsetTimeZoneSuffix,F as resolveTimeZone};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{beforeLocaleChange as t,getLocale as n}from\"./locale.js\";const r={ar:\"ar-u-nu-latn\"};let a=new WeakMap,e={};function i(t){const i=t||e;if(!a.has(i)){const e=n(),o=r[n()]||e;a.set(i,new Intl.NumberFormat(o,t))}return a.get(i)}function o(t={}){const n={};return null!=t.digitSeparator&&(n.useGrouping=t.digitSeparator),null!=t.places&&(n.minimumFractionDigits=n.maximumFractionDigits=t.places),n}function u(t,n){return Object.is(t,-0)&&(t=0),i(n).format(t)}t((()=>{a=new WeakMap,e={}}));export{o as convertNumberFormatToIntlOptions,u as formatNumber,i as getFormatter};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../core/Logger.js\";import{getDeepValue as r}from\"../core/object.js\";import{replace as e}from\"../core/string.js\";import{formatDate as n}from\"./date.js\";import{formatNumber as o}from\"./number.js\";const i=t.getLogger(\"esri.intl.substitute\");function s(t,r,n={}){const{format:o={}}=n;return e(t,(t=>u(t,r,o)))}function u(t,e,n){let o,i;const s=t.indexOf(\":\");if(-1===s?o=t.trim():(o=t.slice(0,s).trim(),i=t.slice(s+1).trim()),!o)return\"\";const u=r(o,e);if(null==u)return\"\";const m=(i?n?.[i]:null)??n?.[o];return m?c(u,m):i?a(u,i):f(u)}function c(t,r){switch(r.type){case\"date\":return n(t,r.intlOptions);case\"number\":return o(t,r.intlOptions);default:return i.warn(\"missing format descriptor for key {key}\"),f(t)}}function a(t,r){switch(r.toLowerCase()){case\"dateformat\":return n(t);case\"numberformat\":return o(t);default:return i.warn(`inline format is unsupported since 4.12: ${r}`),/^(dateformat|datestring)/i.test(r)?n(t):/^numberformat/i.test(r)?o(t):f(t)}}function f(t){switch(typeof t){case\"string\":return t;case\"number\":return o(t);case\"boolean\":return\"\"+t;default:return t instanceof Date?n(t):\"\"}}export{s as substitute};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../core/Error.js\";import{makeHandle as e}from\"../core/handleUtils.js\";import{createResolver as n}from\"../core/promiseUtils.js\";import{beforeLocaleChange as s,getLocale as r}from\"./locale.js\";const o=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,i={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,\"pt-BR\":!0,\"pt-PT\":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,\"zh-CN\":!0,\"zh-HK\":!0,\"zh-TW\":!0},a=Object.keys(i);function c(t){return t in i}const d=[],l=new Map;function u(t){for(const e of l.keys())p(t.pattern,e)&&l.delete(e)}function h(t){return d.includes(t)||(u(t),d.unshift(t)),e((()=>{const e=d.indexOf(t);e>-1&&(d.splice(e,1),u(t))}))}async function f(t){const e=r();l.has(t)||l.set(t,_(t,e));const n=l.get(t);return n&&await g.add(n),n}function m(t){if(!o.test(t))return null;const e=o.exec(t);if(null===e)return null;const[,n,s]=e,r=n+(s?\"-\"+s.toUpperCase():\"\");return c(r)?r:c(n)?n:null}async function _(e,n){const s=[];for(const t of d)if(p(t.pattern,e))try{return await t.fetchMessageBundle(e,n)}catch(r){s.push(r)}if(s.length)throw new t(\"intl:message-bundle-error\",`Errors occurred while loading \"${e}\"`,{errors:s});throw new t(\"intl:no-message-bundle-loader\",`No loader found for message bundle \"${e}\"`)}function p(t,e){return\"string\"==typeof t?e.startsWith(t):t.test(e)}s((()=>{l.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(t){return this._increase(),t.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=n())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}},w={cache:l,loaders:d};export{f as fetchMessageBundle,a as messageBundlesLocales,m as normalizeMessageBundleLocale,h as registerMessageBundleLoader,w as test};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../request.js\";import t from\"../core/Error.js\";import{normalizeMessageBundleLocale as n}from\"./messages.js\";async function r(e,r,s,i){const a=r.exec(s);if(!a)throw new t(\"esri-intl:invalid-bundle\",`Bundle id \"${s}\" is not compatible with the pattern \"${r}\"`);const c=a[1]?`${a[1]}/`:\"\",l=a[2],w=n(i),h=`${c}${l}.json`,u=w?`${c}${l}_${w}.json`:h;let d;try{d=await o(e(u))}catch(f){if(u===h)throw new t(\"intl:unknown-bundle\",`Bundle \"${s}\" cannot be loaded`,{error:f});try{d=await o(e(h))}catch(f){throw new t(\"intl:unknown-bundle\",`Bundle \"${s}\" cannot be loaded`,{error:f})}}return d}async function o(t){if(null!=a.fetchBundleAsset)return a.fetchBundleAsset(t);const n=await e(t,{responseType:\"text\"});return JSON.parse(n.data)}class s{constructor({base:e=\"\",pattern:t,location:n=new URL(window.location.href)}){let r;r=\"string\"==typeof n?e=>new URL(e,new URL(n,window.location.href)).href:n instanceof URL?e=>new URL(e,n).href:n,this.pattern=\"string\"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=r,e=e?e.endsWith(\"/\")?e:e+\"/\":\"\",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return r(this.getAssetUrl,this.matcher,e,t)}}function i(e){return new s(e)}const a={};export{s as JSONLoader,i as createJSONLoader,a as test};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nexport{convertDateFormatToIntlOptions,formatDate,formatDateOnly,formatTimeOnly,formatTimestamp}from\"./intl/date.js\";export{convertNumberFormatToIntlOptions,formatNumber}from\"./intl/number.js\";export{substitute}from\"./intl/substitute.js\";export{getLocale,onLocaleChange,prefersRTL,setLocale}from\"./intl/locale.js\";import{registerMessageBundleLoader as t}from\"./intl/messages.js\";export{fetchMessageBundle,normalizeMessageBundleLocale}from\"./intl/messages.js\";import{createJSONLoader as e}from\"./intl/t9n.js\";import{getAssetUrl as o}from\"./assets.js\";t(e({pattern:\"esri/\",location:o}));export{e as createJSONLoader,t as registerMessageBundleLoader};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../intl.js\";import\"../../core/has.js\";import t from\"../../core/Error.js\";import{clamp as e}from\"../../core/mathUtils.js\";import{convertDateFormatToIntlOptions as n,formatTimestamp as o,formatTimeOnly as l,formatDateOnly as i,formatDate as r}from\"../../intl/date.js\";import{utc as a}from\"../../time/timeZoneUtils.js\";import{isString as u,isNumber as s}from\"./dataUtils.js\";import{DateTime as m,FixedOffsetZone as f,Interval as c}from\"luxon\";import{getLocale as d}from\"../../intl/locale.js\";const y=a,p={date:null,time:null,timeZoneOffset:null},h=new Map([[\"hours\",3600],[\"minutes\",60],[\"seconds\",1],[\"deciseconds\",.1],[\"centiseconds\",.01],[\"milliseconds\",.001]]),v=\"yyyy-MM-dd\",S=\"TT\";var M;!function(t){t.HM=\"HH:mm\",t.HMS=\"HH:mm:ss\",t.HMS_MS=\"HH:mm:ss.SSS\"}(M||(M={}));const O=[M.HMS_MS,M.HMS,M.HM,S],w=\"latn\",H=new Set([\"date-only\",\"time-only\",\"timestamp-offset\"]),j=t=>\"valueAsDate\"in t;function Z(t){return{locale:d(),numberingSystem:w,zone:t??y}}function g(t){return t?.isValid?t.toMillis():null}function x(t,e){return null===t?null:m.fromMillis(t,Z(e))}function V(t){if(null==t||!u(t)||\"\"===t)return p;const e=m.fromISO(t,{setZone:!0});return{date:e.toFormat(v,Z()),time:e.toFormat(M.HMS_MS,Z()),timeZoneOffset:e.offset.toString()}}function I(t,e){if(null==t||!s(t)||isNaN(t))return p;const n=x(t,e);return n?{date:n.toFormat(v,Z(e)),time:n.toFormat(S,Z(e))}:p}function F(t){switch(t.type){case\"date\":default:return n(\"short-date-short-time\");case\"date-only\":return n(\"short-date\");case\"time-only\":return n(\"short-time\");case\"timestamp-offset\":return{...n(\"short-date-short-time\"),timeZone:void 0,timeZoneName:\"short\"}}}function T(t,e,n){if(!t||null==e)return null;switch(t.type){case\"date\":return r(e,n);case\"date-only\":return i(e,n);case\"time-only\":return l(e,n);case\"timestamp-offset\":return o(e,n);default:return null}}function C(t){const{dateComponent:e,timeComponent:n,timeZoneComponent:o,oldValue:l}=t;if(!e?.value||!n?.value)return null;const{year:i,month:r,day:u}=m.fromFormat(e.value,v),{hour:s,minute:c,second:d,millisecond:y}=b(n,a)??m.now(),p=V(l),h=null!=o?.value?parseInt(o.value,10):null!=p.timeZoneOffset?parseInt(p.timeZoneOffset,10):(new Date).getTimezoneOffset(),S=f.instance(h),M=m.fromObject({year:i,month:r,day:u,hour:s,minute:c,second:d,millisecond:y},{zone:S});return M.isValid?M.toISO({includeOffset:!0}):null}function D(t){const{dateComponent:e,timeComponent:n,timeZone:o,max:l,min:i,oldValue:r}=t,a=b(e,o);let u=!!t.applyRange;if(!a)return null;let s=null;if(null!=n?.value){const t=b(n,o),e=Date.now(),i=null!=l&&le)&&!(null!=n&&on?n:null!=o&&l(e=m.fromFormat(t,n),e.isValid))),e}function R(t){return m.fromISO(t)}function $(t){const{type:e,range:n,value:o}=t;if(null==o||!n)return!0;if(\"date\"===e)return N({value:o,min:n.min,max:n.max});const{rawMax:l,rawMin:i}=n;if(!u(l)||!u(i)||!u(o))return!0;let r=null,a=null,s=null;switch(e){case\"date-only\":r=k(l),a=k(i),s=k(o);break;case\"time-only\":r=E(l),a=E(i),s=E(o);break;case\"timestamp-offset\":r=R(l),a=R(i),s=R(o)}return!(r?.isValid&&a?.isValid&&s?.isValid)||(c.fromDateTimes(a,r).contains(s)||a.valueOf()===s.valueOf()||r.valueOf()===s.valueOf())}export{M as TimeStampOffsetPattern,U as arcadeDateToFieldValue,A as clampValueToRange,x as createDateTimeFromFieldValue,H as dateFieldsWithStringFieldValue,k as dateOnlyToDateTime,$ as dateTimeIsInRange,g as dateTimeToFieldValue,v as defaultDatePattern,S as defaultTimePattern,Z as getDefaultLocaleOptions,C as getISOFieldValueFromDateComponents,F as getIntlOptionsForField,T as getLabelForDateFieldValue,b as getLocalDateTimeFromComponent,D as getUnixFieldValueFromDateComponents,_ as isArcadeDate,j as isCalciteDateComponent,z as normalizeTimeOnlyString,w as numberingSystem,V as prepareISOFieldValueForDateComponents,I as prepareUnixFieldValueForDateComponents,O as supportedTimeFormats,E as timeOnlyToDateTime,h as timeResolutionToStepMap,R as timestampOffsetToDateTime,N as valueIsInRange};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{isString as n}from\"../../widgets/support/dataUtils.js\";import{dateOnlyToDateTime as e,timeOnlyToDateTime as l,timestampOffsetToDateTime as i}from\"../../widgets/support/dateUtils.js\";var t;!function(n){n.VALUE_OUT_OF_RANGE=\"domain-validation-error::value-out-of-range\",n.INVALID_CODED_VALUE=\"domain-validation-error::invalid-coded-value\"}(t||(t={}));const r=new Set([\"integer\",\"small-integer\",\"big-integer\",\"esriFieldTypeInteger\",\"esriFieldTypeSmallInteger\",\"esriFieldTypeBigInteger\"]);function u(n){return null!=n&&r.has(n.type)}function a(n){return null!=n&&(\"date-only\"===n.type||\"esriFieldTypeDateOnly\"===n.type)}function o(n){return null!=n&&(\"timestamp-offset\"===n.type||\"esriFieldTypeTimestampOffset\"===n.type)}function s(n){return null!=n&&(\"time-only\"===n.type||\"esriFieldTypeTimeOnly\"===n.type)}function m(n,e){const l=n?.domain;if(!l)return null;switch(l.type){case\"range\":{const{min:l,max:i}=d(n);if(null!=l&&+ei)return t.VALUE_OUT_OF_RANGE;break}case\"coded-value\":case\"codedValue\":if(null==l.codedValues||l.codedValues.every((n=>null==n||n.code!==e)))return t.INVALID_CODED_VALUE}return null}function d(n,e){const l=e??n?.domain;if(!l||\"range\"!==l.type)return;const i=\"range\"in l?l.range[0]:l.minValue,t=\"range\"in l?l.range[1]:l.maxValue,r=u(n);return a(n)||s(n)||o(n)?{...p(n,t,i),isInteger:r}:{min:null!=i&&\"number\"==typeof i?i:null,max:null!=t&&\"number\"==typeof t?t:null,rawMin:i,rawMax:t,isInteger:r}}function p(t,r,u){if(a(t)){return{min:null!=u&&n(u)?e(u).toMillis():null,max:null!=r&&n(r)?e(r).toMillis():null,rawMin:u,rawMax:r}}if(s(t)){return{min:null!=u&&n(u)?l(u).toMillis():null,max:null!=r&&n(r)?l(r).toMillis():null,rawMin:u,rawMax:r}}if(o(t)){return{min:null!=u&&n(u)?i(u).toMillis():null,max:null!=r&&n(r)?i(r).toMillis():null,rawMin:u,rawMax:r}}return{max:null,min:null}}export{t as DomainValidationError,p as dateTimeFieldValuesToNumericRange,d as getDomainRange,m as validateDomainValue};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../geometry.js\";import e from\"../core/Error.js\";import r from\"../core/Logger.js\";import t from\"../geometry/SpatialReference.js\";const a=r.getLogger(\"esri.support.arcadeOnDemand\");let s;function i(){return s||(s=(async()=>{const e=await import(\"./arcadeUtils.js\");return{arcade:e.arcade,arcadeUtils:e,Dictionary:e.Dictionary,Feature:e.arcadeFeature}})()),s}const c=(e,r,t)=>u.create(e,r,t,null,[\"$feature\",\"$view\"],[]),n=(e,r,t)=>u.create(e,r,t,null,[\"$feature\",\"$view\"],[]),o=n,l=(e,r,t,a)=>u.create(e,r,t,a,[\"$feature\",\"$view\"],[]);class u{constructor(e,r,t,a,s,i,c){this.services=null,this.script=e,this.evaluate=a;const n=Array.isArray(i)?i:i.fields;this.fields=n,this._syntaxTree=t,this._arcade=r,this._arcadeFeature=s,this._spatialReference=c,this._referencesGeometry=r.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,\"scale\")}static async create(r,s,c,n,o,l){const{arcade:p,Feature:m,Dictionary:f}=await i(),d=t.fromJSON(s);let y;try{y=p.parseScript(r,l)}catch(x){return a.error(new e(\"arcade-bad-expression\",\"Failed to parse arcade script\",{script:r,error:x})),null}const h=o.reduce(((e,r)=>({...e,[r]:null})),{});let w=null;null!=n&&(w=new f(n),w.immutable=!0,h.$config=null);const v=p.scriptUsesGeometryEngine(y),$=v&&p.enableGeometrySupport(),g=p.scriptUsesFeatureSet(y)&&p.enableFeatureSetSupport(),_=p.scriptIsAsync(y),F=_&&p.enableAsyncSupport(),S={vars:h,spatialReference:d,useAsync:!!F};await Promise.all([$,g,F]);const b=new Set;await p.loadDependentModules(b,y,null,_,v);const j=new f;j.immutable=!1,j.setField(\"scale\",0);const G=p.compileScript(y,S),R=(e,r)=>{const t=e.$view?.timeZone;return\"$view\"in e&&e.$view&&(j.setField(\"scale\",\"object\"==typeof e.$view&&\"scale\"in e.$view?e.$view.scale:void 0),e.$view=j),w&&(e.$config=w),G({vars:e,spatialReference:d,services:r,timeZone:t})};return new u(r,p,y,R,new m,c,d)}repurposeFeature(e){return e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry,e.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}}export{u as ArcadeExpression,l as createDictionaryExpression,c as createLabelExpression,n as createRendererExpression,o as createVVExpression,i as loadArcade};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import{getDeepValue as n,setDeepValue as i}from\"../../core/object.js\";import{union as t}from\"../../core/SetUtils.js\";import{parseWhereClause as r}from\"../../core/sql.js\";import{validateDomainValue as l,getDomainRange as o,DomainValidationError as s}from\"./domainUtils.js\";import{loadArcade as a}from\"../../support/arcadeOnDemand.js\";const u=/^([0-9_])/,f=/[^a-z0-9_\\u0080-\\uffff]+/gi;function d(e){if(null==e)return null;return e.trim().replaceAll(f,\"_\").replace(u,\"F$1\")||null}const c=[\"field\",\"field2\",\"field3\",\"normalizationField\",\"rotationInfo.field\",\"proportionalSymbolInfo.field\",\"proportionalSymbolInfo.normalizationField\",\"colorInfo.field\",\"colorInfo.normalizationField\"],m=[\"field\",\"normalizationField\"];function p(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(y(c,i,n),\"visualVariables\"in i&&i.visualVariables)for(const e of i.visualVariables)y(m,e,n)}function y(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&\"function\"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function g(e,n){if(null!=e&&n?.fields?.length)if(\"startField\"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const F=new Set;function I(e,n){return e&&n?(F.clear(),b(F,e,n),Array.from(F).sort()):[]}function b(e,n,i){if(i)if(n?.fields?.length)if(i.includes(\"*\"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)w(e,n,t);else{if(i.includes(\"*\"))return e.clear(),void e.add(\"*\");for(const n of i)null!=n&&e.add(n)}}function w(e,n,i){if(\"string\"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function x(e,n){return null==n||null==e?[]:n.includes(\"*\")?(e.fields??[]).map((e=>e.name)):n}function T(e,n,i=1){if(!n||!e)return[];if(n.includes(\"*\"))return[\"*\"];const t=I(e,n);return t.length/e.fields.length>=i?[\"*\"]:t}async function h(e,n,i){if(!i)return;const{arcadeUtils:t}=await a(),r=t.extractFieldNames(i,n?.fields?.map((e=>e.name)));for(const l of r)w(e,n,l)}async function E(n,i,t){if(t&&\"1=1\"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e(\"fieldUtils:collectFilterFields\",\"Where clause is not standardized\",{where:t});b(n,i,l.fieldNames)}}function _({displayField:e,fields:n}){return e||(n?.length?N(n,\"name-or-title\")||N(n,\"unique-identifier\")||N(n,\"type-or-category\")||A(n):null)}function A(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes(\"name\")||e.includes(\"title\"))return n.name}return null}function N(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function S(e){if(!e)return[];const n=new Set;return await v(n,e),Array.from(n).sort()}async function v(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function $(e,n,i){i.onStatisticExpression?h(e,n,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function L(e,n,i){if(!n||!i||!(\"fields\"in i))return;const t=[],r=i.popupTemplate;t.push(D(e,n,r)),i.fields&&t.push(...i.fields.map((async i=>$(e,n.fieldsIndex,i)))),await Promise.all(t)}async function D(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map((i=>h(e,n.fieldsIndex,i.expression))));const r=i?.content;if(Array.isArray(r))for(const l of r)\"expression\"===l.type&&l.expressionInfo&&t.push(h(e,n.fieldsIndex,l.expressionInfo.expression));await Promise.all(t)}async function M(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&b(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&b(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await E(e,n.fieldsIndex,i.where))}async function O(e,n,i){n&&i&&await Promise.all(i.map((i=>V(e,n,i))))}async function V(e,n,i){n&&i&&(i.valueExpression?await h(e,n.fieldsIndex,i.valueExpression):i.field&&w(e,n.fieldsIndex,i.field))}async function U(e){if(!e)return[];const n=\"timeInfo\"in e&&e.timeInfo;return n?I(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function j(e){return e?I(e.fieldsIndex,z(e)):[]}function C(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?I(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}const R=new Set([\"oid\",\"global-id\",\"guid\"]),G=new Set([\"oid\",\"global-id\"]),k=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i];function X(e){const n=new Set;P(e).forEach((e=>n.add(e))),C(e).forEach((e=>n.add(e.toLowerCase())));const i=e&&\"infoFor3D\"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach((e=>n.add(e.toLowerCase()))),Object.values(i.transformFieldRoles).forEach((e=>n.add(e.toLowerCase())))),Array.from(n)}function z(e){if(!e)return[];const n=\"editFieldsInfo\"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function P(e){return z(e).map((e=>e.toLowerCase()))}function B(e,n){return e.editable&&!R.has(e.type)&&!P(n).includes(e.name?.toLowerCase()??\"\")}function q(e,n){const i=e.name?.toLowerCase()??\"\";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||X(n).includes(i)||G.has(e.type)||k.some((e=>e.test(i))))}async function Y(e){if(!e)return[];const n=new Set;return await J(n,e),Array.from(n).sort()}async function J(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map((n=>W(e,t,n))))}async function W(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if(\"arcade\"===t.type)await h(e,n,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach((i=>{w(e,n,i.slice(1,-1))}))}await E(e,n,r)}function H(e){const n=e.defaultValue;return void 0!==n&&re(e,n)?n:e.nullable?null:void 0}function K(e){const n=\"string\"==typeof e?{type:e}:e;return ye(n)?255:\"esriFieldTypeDate\"===n.type||\"date\"===n.type?8:void 0}function Q(e){return\"number\"==typeof e&&!isNaN(e)&&isFinite(e)}function Z(e){return null===e||Q(e)}function ee(e){return null===e||Number.isInteger(e)}function ne(e){return null!=e&&\"string\"==typeof e}function ie(e){return null===e||ne(e)}function te(){return!0}function re(e,n){let i;switch(e.type){case\"date\":case\"integer\":case\"long\":case\"small-integer\":case\"big-integer\":case\"esriFieldTypeDate\":case\"esriFieldTypeInteger\":case\"esriFieldTypeLong\":case\"esriFieldTypeSmallInteger\":case\"esriFieldTypeBigInteger\":i=e.nullable?ee:Number.isInteger;break;case\"double\":case\"single\":case\"esriFieldTypeSingle\":case\"esriFieldTypeDouble\":i=e.nullable?Z:Q;break;case\"string\":case\"esriFieldTypeString\":i=e.nullable?ie:ne;break;default:i=te}return 1===arguments.length?i:i(n)}const le=[\"integer\",\"small-integer\",\"big-integer\"],oe=[\"single\",\"double\"],se=[...le,...oe],ae=[\"esriFieldTypeInteger\",\"esriFieldTypeSmallInteger\",\"esriFieldTypeBigInteger\"],ue=[\"esriFieldTypeSingle\",\"esriFieldTypeDouble\"],fe=new Set([...le,...ae]),de=new Set([...oe,...ue]),ce=t(fe,de);function me(e){return null!=e&&fe.has(e.type)}function pe(e){return null!=e&&ce.has(e.type)}function ye(e){return null!=e&&(\"string\"===e.type||\"esriFieldTypeString\"===e.type)}function ge(e){return null!=e&&(\"date\"===e.type||\"esriFieldTypeDate\"===e.type)}function Fe(e){return null!=e&&(\"date-only\"===e.type||\"esriFieldTypeDateOnly\"===e.type)}function Ie(e){return null!=e&&(\"timestamp-offset\"===e.type||\"esriFieldTypeTimestampOffset\"===e.type)}function be(e){return null!=e&&(\"time-only\"===e.type||\"esriFieldTypeTimeOnly\"===e.type)}function we(e){return null!=e&&(\"oid\"===e.type||\"esriFieldTypeOID\"===e.type)}function xe(e){return null!=e&&(\"global-id\"===e.type||\"esriFieldTypeGlobalID\"===e.type)}function Te(e,n){return null===Ae(e,n)}var he,Ee;function _e(e){return null==e||\"number\"==typeof e&&isNaN(e)?null:e}function Ae(e,n){return null==e||e.nullable&&null===n?null:pe(e)&&!Ne(e.type,Number(n))?he.OUT_OF_RANGE:re(e,n)?e.domain?l(e,n):null:Ee.INVALID_TYPE}function Ne(e,n){const i=\"string\"==typeof e?ve(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function Se(e,n){const i=o(e,n);return i||(pe(e)?ve(e.type):void 0)}function ve(e){switch(e){case\"esriFieldTypeSmallInteger\":case\"small-integer\":return Le;case\"esriFieldTypeInteger\":case\"integer\":return De;case\"esriFieldTypeBigInteger\":case\"big-integer\":return Me;case\"esriFieldTypeSingle\":case\"single\":return Oe;case\"esriFieldTypeDouble\":case\"double\":return Ve}}function $e(e){if(!Q(e))return null;if(Number.isInteger(e)){if(e>=Le.min&&e<=Le.max)return\"esriFieldTypeSmallInteger\";if(e>=De.min&&e<=De.max)return\"esriFieldTypeInteger\";if(e>=Me.min&&e<=Me.max)return\"esriFieldTypeBigInteger\"}return e>=Oe.min&&e<=Oe.max?\"esriFieldTypeSingle\":\"esriFieldTypeDouble\"}!function(e){e.OUT_OF_RANGE=\"numeric-range-validation-error::out-of-range\"}(he||(he={})),function(e){e.INVALID_TYPE=\"type-validation-error::invalid-type\"}(Ee||(Ee={}));const Le={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},De={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Me={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Oe={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},Ve={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ue(e,n,i){switch(e){case s.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case s.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case Ee.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case he.OUT_OF_RANGE:{const{min:e,max:t}=ve(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function je(e,n){return!Ce(e,n,null)}function Ce(e,n,i){if(!n?.attributes||!e){if(null!=i)for(const n of e??[])i.add(n);return!0}const t=new Set(Object.keys(n.attributes));let r=!1;for(const l of e)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Re(e,n){const i=new Set;for(const t of n)await h(i,e.fieldsIndex,t);return Array.from(i).sort()}function Ge(e){return!!e&&[\"raster.itempixelvalue\",\"raster.servicepixelvalue\"].some((n=>e.toLowerCase().startsWith(n)))}export{he as NumericRangeValidationError,Ee as TypeValidationError,Me as bigIntegerRange,h as collectArcadeFieldNames,v as collectElevationFields,L as collectFeatureReductionFields,w as collectField,b as collectFields,M as collectFilterFields,J as collectLabelingFields,O as collectOrderByInfos,D as collectPopupTemplateFields,Ve as doubleRange,je as featureHasFields,I as fixFields,p as fixRendererFields,g as fixTimeInfoFields,ue as floatJSONTypes,oe as floatTypes,_ as getDisplayFieldName,z as getEditTrackingFields,S as getElevationFields,Re as getExpressionFields,j as getFeatureEditFields,C as getFeatureGeometryFields,K as getFieldDefaultLength,H as getFieldDefaultValue,Se as getFieldRange,Y as getLabelingFields,X as getLowerCaseDefaultHiddenFields,P as getLowerCaseEditTrackingFields,$e as getNumericTypeForValue,U as getTimeFields,ae as integerJSONTypes,De as integerRange,le as integerTypes,ge as isDateField,Fe as isDateOnlyField,B as isFieldEditable,q as isFieldVisibleByDefault,xe as isGlobalIDField,me as isIntegerField,Ne as isNumberInRange,pe as isNumericField,we as isObjectIDField,Ge as isRasterPixelValueField,ye as isStringField,be as isTimeOnlyField,Ie as isTimestampOffsetField,Te as isValidFieldValue,re as isValueMatchingFieldType,d as normalizeFieldName,se as numericTypes,T as packFields,Ce as populateMissingFields,c as rendererFields,_e as sanitizeNullFieldValue,Oe as singleRange,Le as smallIntegerRange,x as unpackFieldNames,Ae as validateFieldValue,Ue as validationErrorToString,m as visualVariableFields};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";let e=class extends o{constructor(r){super(r),this.type=null}};r([s({type:[\"attachments\",\"custom\",\"fields\",\"media\",\"text\",\"expression\",\"relationship\"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,\"type\",void 0),e=r([t(\"esri.popup.content.Content\")],e);const p=e;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import r from\"./Content.js\";var s;let p=s=class extends r{constructor(t){super(t),this.description=null,this.displayType=\"auto\",this.title=null,this.type=\"attachments\"}clone(){return new s({description:this.description,displayType:this.displayType,title:this.title})}};t([e({type:String,json:{write:!0}})],p.prototype,\"description\",void 0),t([e({type:[\"auto\",\"preview\",\"list\"],json:{write:!0}})],p.prototype,\"displayType\",void 0),t([e({type:String,json:{write:!0}})],p.prototype,\"title\",void 0),t([e({type:[\"attachments\"],readOnly:!0,json:{read:!1,write:!0}})],p.prototype,\"type\",void 0),p=s=t([o(\"esri.popup.content.AttachmentsContent\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{clone as t}from\"../../core/lang.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./Content.js\";var p;let c=p=class extends s{constructor(o){super(o),this.creator=null,this.destroyer=null,this.outFields=null,this.type=\"custom\"}clone(){return new p({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?t(this.outFields):null})}};o([r()],c.prototype,\"creator\",void 0),o([r()],c.prototype,\"destroyer\",void 0),o([r()],c.prototype,\"outFields\",void 0),o([r({type:[\"custom\"],readOnly:!0})],c.prototype,\"type\",void 0),c=p=o([e(\"esri.popup.content.CustomContent\")],c);const i=c;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as o}from\"../core/accessorSupport/decorators/subclass.js\";var s;let p=s=class extends e{constructor(r){super(r),this.title=null,this.expression=null,this.returnType=\"dictionary\"}clone(){return new s({title:this.title,expression:this.expression})}};r([t({type:String,json:{write:!0}})],p.prototype,\"title\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"expression\",void 0),r([t({type:[\"dictionary\"],readOnly:!0,json:{read:!1,write:!0}})],p.prototype,\"returnType\",void 0),p=s=r([o(\"esri.popup.ElementExpressionInfo\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"../ElementExpressionInfo.js\";import t from\"./Content.js\";var p;let n=p=class extends t{constructor(o){super(o),this.expressionInfo=null,this.type=\"expression\"}clone(){return new p({expressionInfo:this.expressionInfo?.clone()})}};o([e({type:s,json:{write:!0}})],n.prototype,\"expressionInfo\",void 0),o([e({type:[\"expression\"],readOnly:!0,json:{read:!1,write:!0}})],n.prototype,\"type\",void 0),n=p=o([r(\"esri.popup.content.ExpressionContent\")],n);const i=n;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{JSONMap as e}from\"../../jsonMap.js\";import{property as n}from\"./property.js\";function o(o,r={}){const a=o instanceof e?o:new e(o,r),l={type:r?.ignoreUnknown??1?a.apiValues:String,json:{type:a.jsonValues,read:!r?.readOnly&&{reader:a.read},write:{writer:a.write}}};return void 0!==r?.readOnly&&(l.readOnly=!!r.readOnly),void 0!==r?.default&&(l.json.default=r.default),void 0!==r?.name&&(l.json.name=r.name),void 0!==r?.nonNullable&&(l.nonNullable=r.nonNullable),n(l)}export{o as enumeration};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as e}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as p}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as a}from\"../../core/accessorSupport/decorators/subclass.js\";import{dateFormatJSONMap as i}from\"../../intl/date.js\";let c=class extends(r(t)){constructor(o){super(o),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};o([p(i)],c.prototype,\"dateFormat\",void 0),o([s({type:Boolean,json:{write:!0}})],c.prototype,\"digitSeparator\",void 0),o([s({type:e,json:{write:!0}})],c.prototype,\"places\",void 0),c=o([a(\"esri.popup.support.FieldInfoFormat\")],c);const m=c;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{JSONMap as o}from\"../core/jsonMap.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{clone as i}from\"../core/lang.js\";import{property as r}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import l from\"./support/FieldInfoFormat.js\";var a;let n=a=class extends e{constructor(t){super(t),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption=\"text-box\",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new a({fieldName:this.fieldName,format:this.format?i(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};t([r({type:String,json:{write:!0}})],n.prototype,\"fieldName\",void 0),t([r({type:l,json:{write:!0}})],n.prototype,\"format\",void 0),t([r({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],n.prototype,\"isEditable\",void 0),t([r({type:String,json:{write:!0}})],n.prototype,\"label\",void 0),t([s(new o({richtext:\"rich-text\",textarea:\"text-area\",textbox:\"text-box\"}),{default:\"text-box\"})],n.prototype,\"stringFieldOption\",void 0),t([r({type:[\"count\",\"sum\",\"min\",\"max\",\"avg\",\"stddev\",\"var\"],json:{write:!0}})],n.prototype,\"statisticType\",void 0),t([r({type:String,json:{write:!0}})],n.prototype,\"tooltip\",void 0),t([r({type:Boolean,json:{write:!0}})],n.prototype,\"visible\",void 0),n=a=t([p(\"esri.popup.FieldInfo\")],n);const c=n;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{clone as o}from\"../../core/lang.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as s}from\"../../core/accessorSupport/decorators/writer.js\";import i from\"../FieldInfo.js\";import p from\"./Content.js\";var n;let l=n=class extends p{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type=\"fields\"}writeFieldInfos(t,o){o.fieldInfos=t&&t.map((t=>t.toJSON()))}clone(){return new n(o({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};t([e({type:Object,json:{write:!0}})],l.prototype,\"attributes\",void 0),t([e({type:String,json:{write:!0}})],l.prototype,\"description\",void 0),t([e({type:[i]})],l.prototype,\"fieldInfos\",void 0),t([s(\"fieldInfos\")],l.prototype,\"writeFieldInfos\",null),t([e({type:String,json:{write:!0}})],l.prototype,\"title\",void 0),t([e({type:[\"fields\"],readOnly:!0,json:{read:!1,write:!0}})],l.prototype,\"type\",void 0),l=n=t([r(\"esri.popup.content.FieldsContent\")],l);const c=l;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../../core/JSONSupport.js\";import{property as o}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as e}from\"../../../core/accessorSupport/decorators/subclass.js\";let s=class extends r{constructor(t){super(t),this.altText=null,this.caption=\"\",this.title=\"\",this.type=null}};t([o({type:String,json:{write:!0}})],s.prototype,\"altText\",void 0),t([o({type:String,json:{write:!0}})],s.prototype,\"caption\",void 0),t([o({type:String,json:{write:!0}})],s.prototype,\"title\",void 0),t([o({type:[\"image\",\"bar-chart\",\"column-chart\",\"line-chart\",\"pie-chart\"],readOnly:!0,json:{read:!1,write:!0}})],s.prototype,\"type\",void 0),s=t([e(\"esri.popup.content.mixins.MediaInfo\")],s);const p=s;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function r(r){return!!e[r]||!!e[r.toLowerCase()]}function l(r){return e[r]??e[r.toLowerCase()]}function a(e){return[...l(e)]}function n(e,r,l){l<0&&++l,l>1&&--l;const a=6*l;return a<1?e+(r-e)*a:2*l<1?r:3*l<2?e+(r-e)*(2/3-l)*6:e}function o(e,r,l,a=1){const o=(e%360+360)%360/360,i=l<=.5?l*(r+1):l+r-l*r,t=2*l-i;return[Math.round(255*n(t,i,o+1/3)),Math.round(255*n(t,i,o)),Math.round(255*n(t,i,o-1/3)),a]}function i(e){const r=e.length>5,l=r?8:4,a=(1<>=l,t[3]=n*u/255),u=i&a,i>>=l,t[2]=n*u,u=i&a,i>>=l,t[1]=n*u,u=i&a,i>>=l,t[0]=n*u,t}export{l as getNamedColor,a as getNamedColorCopy,i as hex2rgba,o as hsla2rgba,r as isNamedColor};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{hsla2rgba as t,isNamedColor as r,getNamedColor as s}from\"./colorUtils.js\";import{clamp as i}from\"./core/mathUtils.js\";import{ensureInteger as n}from\"./core/accessorSupport/ensureType.js\";function a(t){return i(n(t),0,255)}function e(t,r,s){return t=Number(t),isNaN(t)?s:ts?s:t}function o(t,r){const s=t.toString(16).padStart(2,\"0\");return r?s.substring(0,1):s}class h{static blendColors(t,r,s,i=new h){return i.r=Math.round(t.r+(r.r-t.r)*s),i.g=Math.round(t.g+(r.g-t.g)*s),i.b=Math.round(t.b+(r.b-t.b)*s),i.a=t.a+(r.a-t.a)*s,i._sanitize()}static fromRgb(r,s){const i=r.toLowerCase().match(/^(rgba?|hsla?)\\(([\\s\\.\\-,%0-9]+)\\)/);if(i){const r=i[2].split(/\\s*,\\s*/),n=i[1];if(\"rgb\"===n&&3===r.length||\"rgba\"===n&&4===r.length){const t=r[0];if(\"%\"===t.charAt(t.length-1)){const t=r.map((t=>2.56*parseFloat(t)));return 4===r.length&&(t[3]=parseFloat(r[3])),h.fromArray(t,s)}return h.fromArray(r.map((t=>parseFloat(t))),s)}if(\"hsl\"===n&&3===r.length||\"hsla\"===n&&4===r.length)return h.fromArray(t(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100,parseFloat(r[3])),s)}return null}static fromHex(t,r=new h){if(\"#\"!==t[0]||isNaN(Number(`0x${t.substring(1)}`)))return null;switch(t.length){case 4:case 5:{const s=parseInt(t.substring(1,2),16),i=parseInt(t.substring(2,3),16),n=parseInt(t.substring(3,4),16),a=5===t.length?15:parseInt(t.substring(4),16);return h.fromArray([s+16*s,i+16*i,n+16*n,(a+16*a)/255],r)}case 7:case 9:{const s=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),n=parseInt(t.substring(5,7),16),a=7===t.length?255:parseInt(t.substring(7),16);return h.fromArray([s,i,n,a/255],r)}default:return null}}static fromArray(t,r=new h){return r._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(r.a)&&(r.a=1),r._sanitize()}static fromString(t,i){const n=r(t)?s(t):null;return n&&h.fromArray(n,i)||h.fromRgb(t,i)||h.fromHex(t,i)}static fromJSON(t){return null!=t?new h([t[0],t[1],t[2],(t[3]??255)/255]):void 0}static toUnitRGB(t){return null!=t?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return null!=t?[t.r/255,t.g/255,t.b/255,null!=t.a?t.a:1]:null}constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(t){return\"string\"==typeof t?h.fromString(t,this):Array.isArray(t)?h.fromArray(t,this):(this._set(t.r??0,t.g??0,t.b??0,t.a??1),t instanceof h||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(t){const r=t?.capitalize??!1,s=t?.digits??6,i=3===s||4===s,n=4===s||8===s,a=`#${o(this.r,i)}${o(this.g,i)}${o(this.b,i)}${n?o(Math.round(255*this.a),i):\"\"}`;return r?a.toUpperCase():a}toCss(t=!1){const r=this.r+\", \"+this.g+\", \"+this.b;return t?`rgba(${r}, ${this.a})`:`rgb(${r})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=h.AlphaMode.ALWAYS){const r=a(this.r),s=a(this.g),i=a(this.b);return t===h.AlphaMode.ALWAYS||1!==this.a?[r,s,i,a(255*this.a)]:[r,s,i]}clone(){return new h(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return null!=t&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(e(this.r,0,255)),this.g=Math.round(e(this.g,0,255)),this.b=Math.round(e(this.b,0,255)),this.a=e(this.a,0,1),this}_set(t,r,s,i){this.r=t,this.g=r,this.b=s,this.a=i}}h.prototype.declaredClass=\"esri.Color\",function(t){var r;(r=t.AlphaMode||(t.AlphaMode={}))[r.ALWAYS=0]=\"ALWAYS\",r[r.UNLESS_OPAQUE=1]=\"UNLESS_OPAQUE\"}(h||(h={}));const u=h;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../../chunks/tslib.es6.js\";import r from\"../../../core/Accessor.js\";import{property as t}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as e}from\"../../../core/accessorSupport/decorators/subclass.js\";var s;let p=s=class extends r{constructor(o){super(o),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new s({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};o([t()],p.prototype,\"color\",void 0),o([t()],p.prototype,\"fieldName\",void 0),o([t()],p.prototype,\"tooltip\",void 0),o([t()],p.prototype,\"value\",void 0),p=s=o([e(\"esri.popup.content.support.ChartMediaInfoValueSeries\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../../chunks/tslib.es6.js\";import r from\"../../../Color.js\";import{JSONSupport as t}from\"../../../core/JSONSupport.js\";import{clone as e}from\"../../../core/lang.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import{Integer as i}from\"../../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../../core/accessorSupport/decorators/subclass.js\";import l from\"./ChartMediaInfoValueSeries.js\";var n;let c=n=class extends t{constructor(o){super(o),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new n({colors:e(this.colors),fields:e(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};o([s({type:[r],json:{type:[[i]],write:!0}})],c.prototype,\"colors\",void 0),o([s({type:[String],json:{write:!0}})],c.prototype,\"fields\",void 0),o([s({type:String,json:{write:!0}})],c.prototype,\"normalizeField\",void 0),o([s({type:[l],json:{read:!1}})],c.prototype,\"series\",void 0),o([s({type:String,json:{write:!0}})],c.prototype,\"tooltipField\",void 0),c=n=o([p(\"esri.popup.content.support.ChartMediaInfoValue\")],c);const d=c;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../../chunks/tslib.es6.js\";import{property as o}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as t}from\"../../../core/accessorSupport/decorators/subclass.js\";import e from\"./MediaInfo.js\";import s from\"../support/ChartMediaInfoValue.js\";let p=class extends e{constructor(r){super(r),this.type=null,this.value=null}};r([o({type:[\"bar-chart\",\"column-chart\",\"line-chart\",\"pie-chart\"],readOnly:!0,json:{read:!1,write:!0}})],p.prototype,\"type\",void 0),r([o({type:s,json:{write:!0}})],p.prototype,\"value\",void 0),p=r([t(\"esri.popup.content.mixins.ChartMediaInfo\")],p);const a=p;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{strict as r}from\"../../../core/jsonMap.js\";const c=r()({barchart:\"bar-chart\",columnchart:\"column-chart\",linechart:\"line-chart\",piechart:\"pie-chart\"});export{c as chartTypeKebabDict};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./mixins/ChartMediaInfo.js\";import{chartTypeKebabDict as s}from\"./support/chartMediaInfoUtils.js\";var a;let p=a=class extends e{constructor(t){super(t),this.type=\"bar-chart\"}clone(){return new a({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};t([r({type:[\"bar-chart\"],readOnly:!0,json:{type:[\"barchart\"],read:!1,write:s.write}})],p.prototype,\"type\",void 0),p=a=t([o(\"esri.popup.content.BarChartMediaInfo\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./mixins/ChartMediaInfo.js\";import{chartTypeKebabDict as s}from\"./support/chartMediaInfoUtils.js\";var a;let p=a=class extends e{constructor(t){super(t),this.type=\"column-chart\"}clone(){return new a({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};t([r({type:[\"column-chart\"],readOnly:!0,json:{type:[\"columnchart\"],read:!1,write:s.write}})],p.prototype,\"type\",void 0),p=a=t([o(\"esri.popup.content.ColumnChartMediaInfo\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../../core/JSONSupport.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as t}from\"../../../core/accessorSupport/decorators/subclass.js\";var e;let p=e=class extends o{constructor(r){super(r),this.linkURL=null,this.sourceURL=null}clone(){return new e({linkURL:this.linkURL,sourceURL:this.sourceURL})}};r([s({type:String,json:{write:!0}})],p.prototype,\"linkURL\",void 0),r([s({type:String,json:{write:!0}})],p.prototype,\"sourceURL\",void 0),p=e=r([t(\"esri.popup.content.support.ImageMediaInfoValue\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./mixins/MediaInfo.js\";import s from\"./support/ImageMediaInfoValue.js\";var a;let i=a=class extends o{constructor(e){super(e),this.refreshInterval=null,this.type=\"image\",this.value=null}clone(){return new a({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};e([t({type:Number,json:{write:!0}})],i.prototype,\"refreshInterval\",void 0),e([t({type:[\"image\"],readOnly:!0,json:{read:!1,write:!0}})],i.prototype,\"type\",void 0),e([t({type:s,json:{write:!0}})],i.prototype,\"value\",void 0),i=a=e([r(\"esri.popup.content.ImageMediaInfo\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./mixins/ChartMediaInfo.js\";import{chartTypeKebabDict as s}from\"./support/chartMediaInfoUtils.js\";var i;let a=i=class extends o{constructor(t){super(t),this.type=\"line-chart\"}clone(){return new i({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};t([r({type:[\"line-chart\"],readOnly:!0,json:{type:[\"linechart\"],read:!1,write:s.write}})],a.prototype,\"type\",void 0),a=i=t([e(\"esri.popup.content.LineChartMediaInfo\")],a);const p=a;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./mixins/ChartMediaInfo.js\";import{chartTypeKebabDict as s}from\"./support/chartMediaInfoUtils.js\";var p;let i=p=class extends o{constructor(t){super(t),this.type=\"pie-chart\"}clone(){return new p({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};t([r({type:[\"pie-chart\"],readOnly:!0,json:{type:[\"piechart\"],read:!1,write:s.write}})],i.prototype,\"type\",void 0),i=p=t([e(\"esri.popup.content.PieChartMediaInfo\")],i);const a=i;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport a from\"../BarChartMediaInfo.js\";import r from\"../ColumnChartMediaInfo.js\";import o from\"../ImageMediaInfo.js\";import e from\"../LineChartMediaInfo.js\";import i from\"../PieChartMediaInfo.js\";import t from\"../mixins/MediaInfo.js\";const m={base:t,key:\"type\",defaultKeyValue:\"image\",typeMap:{\"bar-chart\":a,\"column-chart\":r,\"line-chart\":e,\"pie-chart\":i,image:o}};export{m as types};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{clone as o}from\"../../core/lang.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{reader as r}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as s}from\"../../core/accessorSupport/decorators/writer.js\";import p from\"./BarChartMediaInfo.js\";import a from\"./ColumnChartMediaInfo.js\";import n from\"./Content.js\";import d from\"./ImageMediaInfo.js\";import m from\"./LineChartMediaInfo.js\";import c from\"./PieChartMediaInfo.js\";import{types as f}from\"./support/mediaInfoTypes.js\";var l;let u=l=class extends n{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type=\"media\"}readMediaInfos(t){return t&&t.map((t=>\"image\"===t.type?d.fromJSON(t):\"barchart\"===t.type?p.fromJSON(t):\"columnchart\"===t.type?a.fromJSON(t):\"linechart\"===t.type?m.fromJSON(t):\"piechart\"===t.type?c.fromJSON(t):void 0)).filter(Boolean)}writeMediaInfos(t,o){o.mediaInfos=t&&t.map((t=>t.toJSON()))}clone(){return new l(o({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};t([e()],u.prototype,\"activeMediaInfoIndex\",void 0),t([e({type:Object,json:{write:!0}})],u.prototype,\"attributes\",void 0),t([e({type:String,json:{write:!0}})],u.prototype,\"description\",void 0),t([e({types:[f]})],u.prototype,\"mediaInfos\",void 0),t([r(\"mediaInfos\")],u.prototype,\"readMediaInfos\",null),t([s(\"mediaInfos\")],u.prototype,\"writeMediaInfos\",null),t([e({type:String,json:{write:!0}})],u.prototype,\"title\",void 0),t([e({type:[\"media\"],readOnly:!0,json:{read:!1,write:!0}})],u.prototype,\"type\",void 0),u=l=t([i(\"esri.popup.content.MediaContent\")],u);const I=u;export{I as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";var t;let p=t=class extends o{constructor(r){super(r),this.field=null,this.order=null}clone(){return new t({field:this.field,order:this.order})}};r([e({type:String,json:{write:!0}})],p.prototype,\"field\",void 0),r([e({type:[\"asc\",\"desc\"],json:{write:!0}})],p.prototype,\"order\",void 0),p=t=r([s(\"esri.popup.support.RelatedRecordsInfoFieldOrder\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as o}from\"../../core/Clonable.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as r}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./Content.js\";import i from\"../support/RelatedRecordsInfoFieldOrder.js\";let n=class extends(o(p)){constructor(t){super(t),this.description=null,this.displayCount=null,this.displayType=\"list\",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type=\"relationship\"}};t([e({type:String,json:{write:!0}})],n.prototype,\"description\",void 0),t([e({type:Number,json:{type:r,write:!0}})],n.prototype,\"displayCount\",void 0),t([e({type:[\"list\"],json:{write:!0}})],n.prototype,\"displayType\",void 0),t([e({type:[i],json:{write:!0}})],n.prototype,\"orderByFields\",void 0),t([e({type:Number,json:{type:r,write:!0}})],n.prototype,\"relationshipId\",void 0),t([e({type:String,json:{write:!0}})],n.prototype,\"title\",void 0),t([e({type:[\"relationship\"],readOnly:!0,json:{read:!1,write:!0}})],n.prototype,\"type\",void 0),n=t([s(\"esri.popup.content.RelationshipContent\")],n);const l=n;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./Content.js\";var s;let p=s=class extends o{constructor(t){super(t),this.text=null,this.type=\"text\"}clone(){return new s({text:this.text})}};t([r({type:String,json:{write:!0}})],p.prototype,\"text\",void 0),t([r({type:[\"text\"],readOnly:!0,json:{read:!1,write:!0}})],p.prototype,\"type\",void 0),p=s=t([e(\"esri.popup.content.TextContent\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"./content/AttachmentsContent.js\";import n from\"./content/Content.js\";export{default as CustomContent}from\"./content/CustomContent.js\";import o from\"./content/ExpressionContent.js\";import e from\"./content/FieldsContent.js\";import r from\"./content/MediaContent.js\";import s from\"./content/RelationshipContent.js\";import m from\"./content/TextContent.js\";function i(t){return t instanceof n}const p={base:null,key:\"type\",typeMap:{attachment:t,media:r,text:m,expression:o,field:e,relationship:s}};export{t as AttachmentsContent,n as BaseContent,o as ExpressionContent,e as FieldsContent,r as MediaContent,s as RelationshipContent,m as TextContent,i as isContent,p as persistableTypes};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as o}from\"../core/accessorSupport/decorators/subclass.js\";var s;let p=s=class extends e{constructor(r){super(r),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new s({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};r([t({type:String,json:{write:!0}})],p.prototype,\"name\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"title\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"expression\",void 0),r([t({type:[\"string\",\"number\"],json:{write:!0}})],p.prototype,\"returnType\",void 0),p=s=r([o(\"esri.popup.ExpressionInfo\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";var e;let p=e=class extends r{constructor(o){super(o),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new e({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};o([s({type:Boolean,json:{write:!0}})],p.prototype,\"returnTopmostRaster\",void 0),o([s({type:Boolean,json:{write:!0}})],p.prototype,\"showNoDataRecords\",void 0),p=e=o([t(\"esri.popup.LayerOptions\")],p);const a=p;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{clone as e}from\"../core/lang.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import p from\"./support/RelatedRecordsInfoFieldOrder.js\";var d;let c=d=class extends r{constructor(o){super(o),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new d({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?e(this.orderByFields):null})}};o([s({type:Boolean,json:{write:!0}})],c.prototype,\"showRelatedRecords\",void 0),o([s({type:[p],json:{write:!0}})],c.prototype,\"orderByFields\",void 0),c=d=o([t(\"esri.popup.RelatedRecordsInfo\")],c);const l=c;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{subclass as r}from\"./accessorSupport/decorators/subclass.js\";let t=0;const s=s=>{let i=class extends s{constructor(...e){super(...e),Object.defineProperty(this,\"uid\",{writable:!1,configurable:!1,value:Date.now().toString(16)+\"-object-\"+t++})}};return i=e([r(\"esri.core.Identifiable\")],i),i},i=s=>{let i=class extends s{constructor(...e){super(...e),Object.defineProperty(this,\"uid\",{writable:!1,configurable:!1,value:t++})}};return i=e([r(\"esri.core.NumericIdentifiable\")],i),i};let o=class extends(s(class{})){};o=e([r(\"esri.core.Identifiable\")],o);export{o as Identifiable,s as IdentifiableMixin,i as NumericIdentifiableMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import i from\"../../core/Accessor.js\";import{IdentifiableMixin as o}from\"../../core/Identifiable.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";var r;let c=r=class extends(o(i)){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new r({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};t([s()],c.prototype,\"active\",void 0),t([s()],c.prototype,\"className\",void 0),t([s()],c.prototype,\"disabled\",void 0),t([s()],c.prototype,\"icon\",void 0),t([s()],c.prototype,\"id\",void 0),t([s()],c.prototype,\"indicator\",void 0),t([s()],c.prototype,\"title\",void 0),t([s()],c.prototype,\"type\",void 0),t([s()],c.prototype,\"visible\",void 0),c=r=t([e(\"esri.support.actions.ActionBase\")],c);const p=c;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"../../chunks/tslib.es6.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./ActionBase.js\";var r;let e=r=class extends o{constructor(s){super(s),this.image=null,this.type=\"button\"}clone(){return new r({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};s([t()],e.prototype,\"image\",void 0),e=r=s([i(\"esri.support.Action.ActionButton\")],e);const c=e;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"../../chunks/tslib.es6.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./ActionBase.js\";var o;let r=o=class extends e{constructor(s){super(s),this.image=null,this.type=\"toggle\",this.value=!1}clone(){return new o({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};s([t()],r.prototype,\"image\",void 0),s([t()],r.prototype,\"value\",void 0),r=o=s([i(\"esri.support.Action.ActionToggle\")],r);const a=r;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"./chunks/tslib.es6.js\";import{ClonableMixin as e}from\"./core/Clonable.js\";import o from\"./core/Collection.js\";import{JSONSupport as s}from\"./core/JSONSupport.js\";import{clone as r}from\"./core/lang.js\";import i from\"./core/Logger.js\";import{isPromiseLike as n}from\"./core/promiseUtils.js\";import{property as p}from\"./core/accessorSupport/decorators/property.js\";import{cast as l}from\"./core/accessorSupport/decorators/cast.js\";import{reader as a}from\"./core/accessorSupport/decorators/reader.js\";import{subclass as d}from\"./core/accessorSupport/decorators/subclass.js\";import{writer as c}from\"./core/accessorSupport/decorators/writer.js\";import{ensureOneOfType as f}from\"./core/accessorSupport/ensureType.js\";import{collectFields as m,collectArcadeFieldNames as u}from\"./layers/support/fieldUtils.js\";import{persistableTypes as h}from\"./popup/content.js\";import y from\"./popup/ExpressionInfo.js\";import I from\"./popup/FieldInfo.js\";import F from\"./popup/LayerOptions.js\";import _ from\"./popup/RelatedRecordsInfo.js\";import{types as x}from\"./popup/content/support/mediaInfoTypes.js\";import g from\"./support/actions/ActionBase.js\";import w from\"./support/actions/ActionButton.js\";import A from\"./support/actions/ActionToggle.js\";import C from\"./popup/content/MediaContent.js\";import N from\"./popup/content/TextContent.js\";import j from\"./popup/content/AttachmentsContent.js\";import S from\"./popup/content/FieldsContent.js\";import E from\"./popup/content/ExpressionContent.js\";import O from\"./popup/content/RelationshipContent.js\";import R from\"./popup/content/Content.js\";import v from\"./popup/content/CustomContent.js\";const T=\"esri.PopupTemplate\",b=i.getLogger(T),J=\"relationships/\",L=\"expression/\",B=o.ofType({key:\"type\",defaultKeyValue:\"button\",base:g,typeMap:{button:w,toggle:A}}),M={base:R,key:\"type\",typeMap:{media:C,custom:v,text:N,attachments:j,fields:S,expression:E,relationship:O}},P=new Set([\"attachments\",\"fields\",\"media\",\"text\",\"expression\",\"relationship\"]);let $=class extends(e(s)){constructor(){super(...arguments),this.actions=null,this.content=\"\",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=\"\"}castContent(t){return Array.isArray(t)?t.map((t=>f(M,t))):\"string\"==typeof t||\"function\"==typeof t||t instanceof HTMLElement||n(t)?t:(b.error(\"content error\",\"unsupported content value\",{value:t}),null)}readContent(t,e){const{popupElements:o}=e;return Array.isArray(o)&&o.length>0?this._readPopupInfoElements(e.description,e.mediaInfos,o):this._readPopupInfo(e)}writeContent(t,e,o,s){\"string\"!=typeof t?Array.isArray(t)&&(e.popupElements=t.filter((t=>P.has(t.type))).map((t=>t?.toJSON(s))),e.popupElements.forEach((t=>{\"attachments\"===t.type?this._writeAttachmentContent(e):\"media\"===t.type?this._writeMediaContent(t,e):\"text\"===t.type?this._writeTextContent(t,e):\"relationship\"===t.type&&this._writeRelationshipContent(t,e)}))):e.description=t}writeFieldInfos(t,e,o,s){const{content:r}=this,i=Array.isArray(r)?r:null;if(t){const o=i?i.filter((t=>\"fields\"===t.type)):[],r=o.length&&o.every((t=>t.fieldInfos?.length));e.fieldInfos=t.filter(Boolean).map((t=>{const e=t.toJSON(s);return r&&(e.visible=!1),e}))}if(i)for(const n of i)\"fields\"===n.type&&this._writeFieldsContent(n,e)}writeLayerOptions(t,e,o,s){e[o]=!t||null===t.showNoDataRecords&&null===t.returnTopmostRaster?null:t.toJSON(s)}writeTitle(t,e){e.title=t||\"\"}async collectRequiredFields(t,e){const o=this.expressionInfos||[];await this._collectExpressionInfoFields(t,e,[...o,...this._getContentExpressionInfos(this.content,o)]),m(t,e,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t){const e=new Set;return await this.collectRequiredFields(e,t),[...e].sort()}_writeFieldsContent(t,e){if(!Array.isArray(t.fieldInfos)||!t.fieldInfos.length)return;const o=r(t.fieldInfos);Array.isArray(e.fieldInfos)?o.forEach((t=>{const o=e.fieldInfos.find((e=>e.fieldName.toLowerCase()===t.fieldName.toLowerCase()));o?o.visible=!0:e.fieldInfos.push(t)})):e.fieldInfos=o}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,e){const o=t.orderByFields?.map((e=>this._toFieldOrderJSON(e,t.relationshipId)))||[],s=[...e.relatedRecordsInfo?.orderByFields||[],...o];e.relatedRecordsInfo={showRelatedRecords:!0,...s?.length&&{orderByFields:s}}}_writeTextContent(t,e){!e.description&&t.text&&(e.description=t.text)}_writeMediaContent(t,e){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const o=r(t.mediaInfos);Array.isArray(e.mediaInfos)?e.mediaInfos=[...e.mediaInfos,...o]:e.mediaInfos=o}_readPopupInfoElements(t,e,o){const s={description:!1,mediaInfos:!1};return o.map((o=>\"media\"===o.type?(o.mediaInfos||!e||s.mediaInfos||(o.mediaInfos=e,s.mediaInfos=!0),C.fromJSON(o)):\"text\"===o.type?(o.text||!t||s.description||(o.text=t,s.description=!0),N.fromJSON(o)):\"attachments\"===o.type?j.fromJSON(o):\"fields\"===o.type?S.fromJSON(o):\"expression\"===o.type?E.fromJSON(o):\"relationship\"===o.type?O.fromJSON(o):void 0)).filter(Boolean)}_toRelationshipContent(t){const{field:e,order:o}=t;if(!e?.startsWith(J))return null;const s=e.replace(J,\"\").split(\"/\");if(2!==s.length)return null;const r=parseInt(s[0],10),i=s[1];return\"number\"==typeof r&&i?O.fromJSON({relationshipId:r,orderByFields:[{field:i,order:o}]}):null}_toFieldOrderJSON(t,e){const{order:o,field:s}=t;return{field:`${J}${e}/${s}`,order:o}}_readPopupInfo({description:t,mediaInfos:e,showAttachments:o,relatedRecordsInfo:s={showRelatedRecords:!1}}){const r=[];t?r.push(new N({text:t})):r.push(new S),Array.isArray(e)&&e.length&&r.push(C.fromJSON({mediaInfos:e})),o&&r.push(j.fromJSON({displayType:\"auto\"}));const{showRelatedRecords:i,orderByFields:n}=s;return i&&n?.length&&n.forEach((t=>{const e=this._toRelationshipContent(t);e&&r.push(e)})),r.length?r:t}_getContentElementFields(t){const e=t?.type;if(\"attachments\"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if(\"custom\"===e)return t.outFields||[];if(\"fields\"===e)return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if(\"media\"===e){const e=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...e.reduce(((t,e)=>[...t,...this._getMediaInfoFields(e)]),[])]}return\"text\"===e?this._extractFieldNames(t.text):[]}_getMediaInfoFields(t){const{caption:e,title:o,value:s}=t,r=s||{},{fields:i,normalizeField:n,tooltipField:p,sourceURL:l,linkURL:a}=r,d=[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(l),...this._extractFieldNames(a),...i??[]];return n&&d.push(n),p&&d.push(p),d}_getContentExpressionInfos(t,e){return Array.isArray(t)?t.reduce(((t,e)=>[...t,...\"expression\"===e.type&&e.expressionInfo?[e.expressionInfo]:[]]),e):[]}_getContentFields(t){return\"string\"==typeof t?this._extractFieldNames(t):Array.isArray(t)?t.reduce(((t,e)=>[...t,...this._getContentElementFields(e)]),[]):[]}async _collectExpressionInfoFields(t,e,o){o&&await Promise.all(o.map((o=>u(t,e,o.expression))))}_getFieldInfoFields(t){return t?t.filter((t=>void 0===t.visible||!!t.visible)).map((t=>t.fieldName)).filter((t=>!t.startsWith(J)&&!t.startsWith(L))):[]}_getActionsFields(t){return t?t.toArray().reduce(((t,e)=>[...t,...this._getActionFields(e)]),[]):[]}_getActionFields(t){const{className:e,title:o,type:s}=t,r=\"button\"===s||\"toggle\"===s?t.image:\"\";return[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(r)]}_getTitleFields(t){return\"string\"==typeof t?this._extractFieldNames(t):[]}_extractFieldNames(t){if(!t||\"string\"!=typeof t)return[];const e=/{[^}]*}/g,o=t.match(e);if(!o)return[];const s=/\\{(\\w+):.+\\}/,r=o.filter((t=>!(0===t.indexOf(`{${J}`)||0===t.indexOf(`{${L}`)))).map((t=>t.replace(s,\"{$1}\")));return r?r.map((t=>t.slice(1,-1))):[]}};t([p({type:B})],$.prototype,\"actions\",void 0),t([p()],$.prototype,\"content\",void 0),t([l(\"content\")],$.prototype,\"castContent\",null),t([a(\"content\",[\"description\",\"fieldInfos\",\"popupElements\",\"mediaInfos\",\"showAttachments\",\"relatedRecordsInfo\"])],$.prototype,\"readContent\",null),t([c(\"content\",{popupElements:{type:o.ofType(h)},showAttachments:{type:Boolean},mediaInfos:{type:o.ofType(x)},description:{type:String},relatedRecordsInfo:{type:_}})],$.prototype,\"writeContent\",null),t([p({type:[y],json:{write:!0}})],$.prototype,\"expressionInfos\",void 0),t([p({type:[I]})],$.prototype,\"fieldInfos\",void 0),t([c(\"fieldInfos\")],$.prototype,\"writeFieldInfos\",null),t([p({type:F})],$.prototype,\"layerOptions\",void 0),t([c(\"layerOptions\")],$.prototype,\"writeLayerOptions\",null),t([p({type:Boolean,json:{read:{source:\"showLastEditInfo\"},write:{target:\"showLastEditInfo\"},default:!0}})],$.prototype,\"lastEditInfoEnabled\",void 0),t([p()],$.prototype,\"outFields\",void 0),t([p()],$.prototype,\"overwriteActions\",void 0),t([p()],$.prototype,\"returnGeometry\",void 0),t([p({json:{type:String}})],$.prototype,\"title\",void 0),t([c(\"title\")],$.prototype,\"writeTitle\",null),$=t([d(\"esri.PopupTemplate\")],$);const k=$;export{k as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import o from\"../Color.js\";import{JSONMap as e}from\"../core/jsonMap.js\";import{JSONSupport as s}from\"../core/JSONSupport.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as l}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";const p=new e({esriSMS:\"simple-marker\",esriPMS:\"picture-marker\",esriSLS:\"simple-line\",esriSFS:\"simple-fill\",esriPFS:\"picture-fill\",esriTS:\"text\",esriSHD:\"shield-label-symbol\",PointSymbol3D:\"point-3d\",LineSymbol3D:\"line-3d\",PolygonSymbol3D:\"polygon-3d\",WebStyleSymbol:\"web-style\",MeshSymbol3D:\"mesh-3d\",LabelSymbol3D:\"label-3d\",CIMSymbolReference:\"cim\"});let c=0,m=class extends s{constructor(r){super(r),this.id=\"sym\"+c++,this.type=null,this.color=new o([0,0,0,1])}readColor(r){return null!=r?.[0]?[r[0],r[1],r[2],r[3]/255]:r}async collectRequiredFields(r,o){}hash(){return JSON.stringify(this.toJSON())}clone(){}};r([t({type:p.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:p.write}}})],m.prototype,\"type\",void 0),r([t({type:o,json:{write:{allowNull:!0}}})],m.prototype,\"color\",void 0),r([l(\"color\")],m.prototype,\"readColor\",null),m=r([i(\"esri.symbols.Symbol\")],m);const a=m;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{clone as o}from\"../core/lang.js\";import{numericHash as t}from\"../core/string.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as a}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as p}from\"../core/accessorSupport/decorators/writer.js\";import{collectArcadeFieldNames as c}from\"../layers/support/fieldUtils.js\";import m from\"./Symbol.js\";var n;let l=n=class extends m{constructor(r){super(r),this.data=null,this.type=\"cim\"}readData(r,o){return o}writeData(r,o){Object.assign(o,r)}async collectRequiredFields(r,o){if(\"CIMSymbolReference\"===this.data?.type){const t=this.data.primitiveOverrides;if(t){const e=t.map((t=>{const e=t.valueExpressionInfo;return c(r,o,e.expression)}));await Promise.all(e)}}}clone(){return new n({data:o(this.data)})}hash(){return t(JSON.stringify(this.data)).toString()}};r([e({json:{write:!1}})],l.prototype,\"color\",void 0),r([e({json:{write:!0}})],l.prototype,\"data\",void 0),r([a(\"data\",[\"symbol\"])],l.prototype,\"readData\",null),r([p(\"data\",{})],l.prototype,\"writeData\",null),r([s({CIMSymbolReference:\"cim\"},{readOnly:!0})],l.prototype,\"type\",void 0),l=n=r([i(\"esri.symbols.CIMSymbol\")],l);const d=l;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as s}from\"../core/accessorSupport/decorators/writer.js\";let p=class extends r{constructor(e){super(e),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(e,r,o){e||(r[o]=e)}};e([o({type:Boolean,json:{read:{source:\"enable\"},write:{target:\"enable\"}}})],p.prototype,\"enabled\",void 0),e([s(\"enabled\")],p.prototype,\"writeEnabled\",null),e([o({type:[\"icon\",\"object\",\"line\",\"path\",\"fill\",\"water\",\"extrude\",\"text\"],readOnly:!0})],p.prototype,\"type\",void 0),p=e([t(\"esri.symbols.Symbol3DLayer\")],p);const a=p;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n=/^-?(\\d+(\\.\\d+)?)\\s*((px)|(pt))?$/i,t=\"screenUtils.toPt: input not recognized!\",r=96;function u(n){return n?n/72*r:0}function e(n){return n?72*n/r:0}function o(r){if(\"string\"==typeof r){const u=r.match(n);if(u){const n=Number(u[1]),t=u[3]&&u[3].toLowerCase(),o=\"-\"===r.charAt(0),c=\"px\"===t?e(n):n;return o?-c:c}return console.warn(t),null}return r}function c(n=0,t=0){return{x:n,y:t}}function i(n=0,t=0){return[n,t]}function f(n=0,t=0){return{x:n,y:t}}function s(n=0,t=0){return y([n,t])}function x(n=0,t=0,r=0){return p([n,t,r])}function y(n){return n}function p(n){return n}function l(n){return n}function a(n,t){return t?(t.x=n[0],t.y=n[1],t):{x:n[0],y:n[1]}}function d(n,t){return t?(t[0]=n.x,t[1]=n.y,t.length>2&&(t[2]=0),t):[n.x,n.y]}export{y as castRenderScreenPointArray,p as castRenderScreenPointArray3,l as castScreenPointArray,f as createRenderScreenPoint,s as createRenderScreenPointArray,x as createRenderScreenPointArray3,c as createScreenPoint,i as createScreenPointArray,u as pt2px,e as px2pt,a as screenPointArrayToObject,d as screenPointObjectToArray,o as toPt};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ensureInteger as t}from\"../../core/accessorSupport/ensureType.js\";function n(n){const r=t(100*(1-n));return Math.max(0,Math.min(r,100))}function r(t){const n=1-t/100;return Math.max(0,Math.min(n,1))}export{n as opacityToTransparency,r as transparencyToOpacity};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"../../Color.js\";import{toPt as o}from\"../../core/screenUtils.js\";import{Integer as t}from\"../../core/accessorSupport/ensureType.js\";import{transparencyToOpacity as e,opacityToTransparency as n}from\"../../webdoc/support/opacityUtils.js\";function s(o,t){const n=null!=t.transparency?e(t.transparency):1,s=t.color;return s&&Array.isArray(s)?new r([s[0]||0,s[1]||0,s[2]||0,n]):null}function c(r,o){o.color=r.toJSON().slice(0,3);const t=n(r.a);0!==t&&(o.transparency=t)}const p={type:r,json:{type:[t],default:null,read:{source:[\"color\",\"transparency\"],reader:s},write:{target:{color:{type:[t]},transparency:{type:t}},writer:c}}},a={type:Number,cast:o,json:{write:!0}};export{p as colorAndTransparencyProperty,a as screenSizeProperty};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import e from\"../../Color.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as s}from\"../../core/lang.js\";import{px2pt as t}from\"../../core/screenUtils.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import{colorAndTransparencyProperty as c,screenSizeProperty as n}from\"../support/materialUtils.js\";let l=class extends r{constructor(o){super(o),this.color=new e([0,0,0,1]),this.extensionLength=0,this.size=t(1)}clone(){}cloneProperties(){return{color:s(this.color),size:this.size,extensionLength:this.extensionLength}}};o([i({type:[\"solid\",\"sketch\"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],l.prototype,\"type\",void 0),o([i(c)],l.prototype,\"color\",void 0),o([i({...n,json:{write:{overridePolicy:o=>({enabled:!!o})}}})],l.prototype,\"extensionLength\",void 0),o([i(n)],l.prototype,\"size\",void 0),l=o([p(\"esri.symbols.edges.Edges3D\")],l);const m=l;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../core/Logger.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import\"../../core/Error.js\";import{enumeration as s}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./Edges3D.js\";var t;let c=t=class extends o{constructor(r){super(r),this.type=\"sketch\"}clone(){return new t(this.cloneProperties())}};r([s({sketch:\"sketch\"},{readOnly:!0})],c.prototype,\"type\",void 0),c=t=r([e(\"esri.symbols.edges.SketchEdges3D\")],c);const p=c;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../core/Logger.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import\"../../core/Error.js\";import{enumeration as o}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./Edges3D.js\";var t;let p=t=class extends e{constructor(r){super(r),this.type=\"solid\"}clone(){return new t(this.cloneProperties())}};r([o({solid:\"solid\"},{readOnly:!0})],p.prototype,\"type\",void 0),p=t=r([s(\"esri.symbols.support.SolidEdges3D\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"./Edges3D.js\";import s from\"./SketchEdges3D.js\";import o from\"./SolidEdges3D.js\";const t={types:{key:\"type\",base:e,typeMap:{solid:o,sketch:s}},json:{write:!0}};export{t as symbol3dEdgesProperty};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import{colorAndTransparencyProperty as e}from\"./materialUtils.js\";var c;let p=c=class extends r{constructor(o){super(o),this.color=null}clone(){const o={color:null!=this.color?this.color.clone():null};return new c(o)}};o([s(e)],p.prototype,\"color\",void 0),p=c=o([t(\"esri.symbols.support.Symbol3DMaterial\")],p);export{p as Symbol3DMaterial};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import r from\"./Symbol3DLayer.js\";import{symbol3dEdgesProperty as a}from\"./edges/utils.js\";import{Symbol3DMaterial as i}from\"./support/Symbol3DMaterial.js\";var l;let p=l=class extends r{constructor(e){super(e),this.type=\"extrude\",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new l({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:null!=this.material?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};e([s({Extrude:\"extrude\"},{readOnly:!0})],p.prototype,\"type\",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],p.prototype,\"size\",void 0),e([o({type:i,json:{write:!0}})],p.prototype,\"material\",void 0),e([o({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],p.prototype,\"castShadows\",void 0),e([o(a)],p.prototype,\"edges\",void 0),p=l=e([t(\"esri.symbols.ExtrudeSymbol3DLayer\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{toPt as o}from\"../core/screenUtils.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as e}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import p from\"./Symbol.js\";let i=class extends p{constructor(r){super(r),this.type=\"simple-line\",this.width=.75}hash(){return`${this.type}.${this.width}`}};r([e({esriSLS:\"simple-line\"},{readOnly:!0})],i.prototype,\"type\",void 0),r([s({type:Number,cast:o,json:{write:!0}})],i.prototype,\"width\",void 0),i=r([t(\"esri.symbols.LineSymbol\")],i);const c=i;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e=[\"begin\",\"end\",\"begin-end\"],n=[\"arrow\",\"circle\",\"square\",\"diamond\",\"cross\",\"x\"];export{e as lineMarkerPlacements,n as lineMarkerStyles};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import o from\"../Color.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{clone as t}from\"../core/lang.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as p}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as l}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as c}from\"../core/accessorSupport/decorators/writer.js\";import{lineMarkerStyles as a}from\"./support/lineMarkers.js\";var n;let m=n=class extends e{constructor(r){super(r),this.placement=\"begin-end\",this.type=\"line-marker\",this.style=\"arrow\"}writeStyle(r,o,e,t){o[e]=\"web-map\"===t?.origin?\"arrow\":r}set color(r){this._set(\"color\",r)}readColor(r){return null!=r?.[0]?[r[0],r[1],r[2],r[3]/255]:r}writeColor(r,o,e,t){\"web-map\"===t?.origin||(o[e]=r)}clone(){return new n({color:t(this.color),placement:this.placement,style:this.style})}hash(){return`${this.placement}.${this.color?.hash()}.${this.style}`}};r([s({type:[\"begin\",\"end\",\"begin-end\"],json:{write:!0}})],m.prototype,\"placement\",void 0),r([p({\"line-marker\":\"line-marker\"},{readOnly:!0}),s({json:{origins:{\"web-map\":{write:!1}}}})],m.prototype,\"type\",void 0),r([s({type:a})],m.prototype,\"style\",void 0),r([c(\"style\")],m.prototype,\"writeStyle\",null),r([s({type:o,value:null,json:{write:{allowNull:!0}}})],m.prototype,\"color\",null),r([l(\"color\")],m.prototype,\"readColor\",null),r([c(\"color\")],m.prototype,\"writeColor\",null),m=n=r([i(\"esri.symbols.LineSymbolMarker\")],m);const u=m;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{JSONMap as o}from\"../core/jsonMap.js\";import{clone as e}from\"../core/lang.js\";import{toPt as t}from\"../core/screenUtils.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as i}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import l from\"./LineSymbol.js\";import a from\"./LineSymbolMarker.js\";var p;const h=new o({esriSLSSolid:\"solid\",esriSLSDash:\"dash\",esriSLSDot:\"dot\",esriSLSDashDot:\"dash-dot\",esriSLSDashDotDot:\"long-dash-dot-dot\",esriSLSNull:\"none\",esriSLSInsideFrame:\"inside-frame\",esriSLSShortDash:\"short-dash\",esriSLSShortDot:\"short-dot\",esriSLSShortDashDot:\"short-dash-dot\",esriSLSShortDashDotDot:\"short-dash-dot-dot\",esriSLSLongDash:\"long-dash\",esriSLSLongDashDot:\"long-dash-dot\"});let d=p=class extends l{constructor(...r){super(...r),this.type=\"simple-line\",this.style=\"solid\",this.cap=\"round\",this.join=\"round\",this.marker=null,this.miterLimit=2}normalizeCtorArgs(r,o,e,s,i,n){if(r&&\"string\"!=typeof r)return r;const l={};return null!=r&&(l.style=r),null!=o&&(l.color=o),null!=e&&(l.width=t(e)),null!=s&&(l.cap=s),null!=i&&(l.join=i),null!=n&&(l.miterLimit=t(n)),l}clone(){return new p({color:e(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:this.marker?.clone()})}hash(){return`${super.hash()}.${this.color?.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${this.marker?.hash()}`}};r([i({esriSLS:\"simple-line\"},{readOnly:!0})],d.prototype,\"type\",void 0),r([s({type:h.apiValues,json:{read:h.read,write:h.write}})],d.prototype,\"style\",void 0),r([s({type:[\"butt\",\"round\",\"square\"],json:{write:{overridePolicy:(r,o,e)=>({enabled:\"round\"!==r&&null==e?.origin})}}})],d.prototype,\"cap\",void 0),r([s({type:[\"miter\",\"round\",\"bevel\"],json:{write:{overridePolicy:(r,o,e)=>({enabled:\"round\"!==r&&null==e?.origin})}}})],d.prototype,\"join\",void 0),r([s({types:{key:\"type\",base:null,defaultKeyValue:\"line-marker\",typeMap:{\"line-marker\":a}},json:{write:!0,origins:{\"web-scene\":{write:!1}}}})],d.prototype,\"marker\",void 0),r([s({type:Number,json:{read:!1,write:!1}})],d.prototype,\"miterLimit\",void 0),d=p=r([n(\"esri.symbols.SimpleLineSymbol\")],d);const m=d;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as o}from\"../core/accessorSupport/decorators/subclass.js\";import t from\"./SimpleLineSymbol.js\";import r from\"./Symbol.js\";let l=class extends r{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};e([s({types:{key:\"type\",base:null,defaultKeyValue:\"simple-line\",typeMap:{\"simple-line\":t}},json:{default:null,write:!0}})],l.prototype,\"outline\",void 0),e([s({type:[\"simple-fill\",\"picture-fill\"],readOnly:!0})],l.prototype,\"type\",void 0),l=e([o(\"esri.symbols.FillSymbol\")],l);const p=l;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(r){super(r)}clone(){}};r([s({type:[\"style\"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],t.prototype,\"type\",void 0),t=r([e(\"esri.symbols.patterns.LinePattern3D\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst o=[\"dash\",\"dash-dot\",\"dot\",\"long-dash\",\"long-dash-dot\",\"long-dash-dot-dot\",\"none\",\"short-dash\",\"short-dash-dot\",\"short-dash-dot-dot\",\"short-dot\",\"solid\"];export{o as lineStyles};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{strict as s}from\"../../core/jsonMap.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as r}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import d from\"./LinePattern3D.js\";import{lineStyles as a}from\"./lineStyles.js\";var p;const h=s()({dash:\"dash\",\"dash-dot\":\"dash-dot\",\"dash-dot-dot\":\"long-dash-dot-dot\",dot:\"dot\",\"long-dash\":\"long-dash\",\"long-dash-dot\":\"long-dash-dot\",null:\"none\",\"short-dash\":\"short-dash\",\"short-dash-dot\":\"short-dash-dot\",\"short-dash-dot-dot\":\"short-dash-dot-dot\",\"short-dot\":\"short-dot\",solid:\"solid\"});let c=p=class extends d{constructor(o){super(o),this.type=\"style\",this.style=\"solid\"}clone(){const o={style:this.style};return new p(o)}};o([t({type:[\"style\"]})],c.prototype,\"type\",void 0),o([r(h),t({type:a})],c.prototype,\"style\",void 0),c=p=o([e(\"esri.symbols.patterns.LineStylePattern3D\")],c);const l=c;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(r){super(r)}clone(){}};r([s({type:[\"style\"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],t.prototype,\"type\",void 0),t=r([e(\"esri.symbols.patterns.Pattern3D\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst a=[\"backward-diagonal\",\"cross\",\"diagonal-cross\",\"forward-diagonal\",\"horizontal\",\"none\",\"solid\",\"vertical\"];export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"../../chunks/tslib.es6.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./Pattern3D.js\";import o from\"./styles.js\";var p;let c=p=class extends e{constructor(s){super(s),this.type=\"style\",this.style=\"solid\"}clone(){const s={style:this.style};return new p(s)}};s([t({type:[\"style\"]})],c.prototype,\"type\",void 0),s([t({type:o,json:{read:!0,write:!0}})],c.prototype,\"style\",void 0),c=p=s([r(\"esri.symbols.patterns.StylePattern3D\")],c);const a=c;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"./LinePattern3D.js\";import e from\"./LineStylePattern3D.js\";import r from\"./Pattern3D.js\";import p from\"./StylePattern3D.js\";const s={types:{key:\"type\",base:r,typeMap:{style:p}},json:{write:!0}},o={types:{key:\"type\",base:t,typeMap:{style:e}},json:{write:!0}};export{o as symbol3dLinePatternProperty,s as symbol3dPatternProperty};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport n from\"../../Color.js\";const o=new n(\"white\"),r=new n(\"black\"),e=new n([255,255,255,0]);function t(n){return 0===n.r&&0===n.g&&0===n.b}export{r as black,t as isBlack,e as transparentWhite,o as white};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import\"../../core/Logger.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import\"../../core/Error.js\";import{enumeration as r}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{Symbol3DMaterial as e}from\"./Symbol3DMaterial.js\";var t;let l=t=class extends e{constructor(o){super(o),this.colorMixMode=null}clone(){const o={color:null!=this.color?this.color.clone():null,colorMixMode:this.colorMixMode};return new t(o)}};o([r({multiply:\"multiply\",replace:\"replace\",tint:\"tint\"})],l.prototype,\"colorMixMode\",void 0),l=t=o([s(\"esri.symbols.support.Symbol3DFillMaterial\")],l);export{l as Symbol3DFillMaterial};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport n from\"../Extent.js\";import{create as t}from\"./aaBoundingRect.js\";function r(n){return n}function i(n=D){return r([n[0],n[1],n[2],n[3],n[4],n[5]])}function a(n,t,r,a,u,e,m=i()){return m[0]=n,m[1]=t,m[2]=r,m[3]=a,m[4]=u,m[5]=e,m}function u(n,t=i()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.hasZ?n.zmin:-1/0,t[3]=n.xmax,t[4]=n.ymax,t[5]=n.hasZ?n.zmax:1/0,t}function e(t,r){const i=isFinite(t[2])||isFinite(t[5]);return new n(i?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:r}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:r})}function m(n,t,r=i()){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=t[0],r[4]=t[1],r[5]=t[2],r}function o(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[3]),n[4]=Math.max(n[4],t[4]),n[5]=Math.max(n[5],t[5])}function f(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[3]=Math.max(n[3],t[2]),n[4]=Math.max(n[4],t[3])}function h(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[0]),n[4]=Math.max(n[4],t[1]),n[5]=Math.max(n[5],t[2])}function c(n,t,r=0,i=t.length/3){let a=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];for(let h=0;h=n[3]?0:n[3]-n[0]}function I(n){return n[1]>=n[4]?0:n[4]-n[1]}function N(n){return n[2]>=n[5]?0:n[5]-n[2]}function T(n){const t=s(n),r=N(n),i=I(n);return Math.sqrt(t*t+r*r+i*i)}function E(n,t=[0,0,0]){return t[0]=n[0]+s(n)/2,t[1]=n[1]+I(n)/2,t[2]=n[2]+N(n)/2,t}function F(n,t=[0,0,0]){return t[0]=s(n),t[1]=I(n),t[2]=N(n),t}function g(n){return Math.max(s(n),N(n),I(n))}function y(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[0]<=n[3]&&t[1]<=n[4]&&t[2]<=n[5]}function p(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[2]>=n[2]-r&&t[0]<=n[3]+r&&t[1]<=n[4]+r&&t[2]<=n[5]+r}function b(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[3]<=n[3]&&t[4]<=n[4]&&t[5]<=n[5]}function z(n,t){return Math.max(t[0],n[0])<=Math.min(t[3],n[3])&&Math.max(t[1],n[1])<=Math.min(t[4],n[4])&&Math.max(t[2],n[2])<=Math.min(t[5],n[5])}function V(n,t){return null==t||z(n,t)}function Y(n,t,r,i,a=n){return a[0]=n[0]+t,a[1]=n[1]+r,a[2]=n[2]+i,a[3]=n[3]+t,a[4]=n[4]+r,a[5]=n[5]+i,a}function _(n,t,r=n){const i=n[0]+s(n)/2,a=n[1]+I(n)/2,u=n[2]+N(n)/2;return r[0]=i+(n[0]-i)*t,r[1]=a+(n[1]-a)*t,r[2]=u+(n[2]-u)*t,r[3]=i+(n[3]-i)*t,r[4]=a+(n[4]-a)*t,r[5]=u+(n[5]-u)*t,r}function R(n,t){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function j(n,t){return t[0]=n[3],t[1]=n[4],t[2]=n[5],t}function A(n,t,r=n){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==n&&(r[3]=n[3],r[4]=n[4],r[5]=n[5]),r}function G(n,t,r=n){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==n&&(r[0]=n[0],r[1]=n[1],r[2]=n[2]),n}function O(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function P(n){return n?O(n,C):i(C)}function S(n,r){return r||(r=t()),r[0]=n[0],r[1]=n[1],r[2]=n[3],r[3]=n[4],r}function Z(n,t){return n[0]=t[0],n[1]=t[1],n[2]=Number.NEGATIVE_INFINITY,n[3]=t[2],n[4]=t[3],n[5]=Number.POSITIVE_INFINITY,n}function d(n,t,r,i,a){return n[0]=t,n[1]=r,n[2]=Number.NEGATIVE_INFINITY,n[3]=i,n[4]=a,n[5]=Number.POSITIVE_INFINITY,n}function q(n){return 6===n.length}function w(n){return 0===s(n)&&0===I(n)&&0===N(n)}function B(n,t,r){if(null==n||null==t)return n===t;if(!q(n)||!q(t))return!1;if(r){for(let i=0;i{const t=o(l);return 0===t?1:e(t,.1,4)},nonNullable:!0},i=[\"left\",\"right\",\"center\"],a=[\"baseline\",\"top\",\"middle\",\"bottom\"],m={type:i,nonNullable:!0},p={type:a,nonNullable:!0},s=8;export{s as backgroundPadding,l as fontDecorations,t as fontStyles,r as fontWeights,m as horizontalAlignmentProperty,i as horizontalAlignments,n as lineHeightProperty,p as verticalAlignmentProperty,a as verticalAlignments};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../core/JSONSupport.js\";import{toPt as e}from\"../core/screenUtils.js\";import{property as r}from\"../core/accessorSupport/decorators/property.js\";import{cast as s}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import{fontDecorations as p,fontStyles as a,fontWeights as c}from\"./support/textUtils.js\";var n;let l=n=class extends o{constructor(t){super(t),this.decoration=\"none\",this.family=\"sans-serif\",this.size=9,this.style=\"normal\",this.weight=\"normal\"}castSize(t){return e(t)}clone(){return new n({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};t([r({type:p,json:{default:\"none\",write:!0}})],l.prototype,\"decoration\",void 0),t([r({type:String,json:{write:!0}})],l.prototype,\"family\",void 0),t([r({type:Number,json:{write:{overridePolicy:(t,o,e)=>({enabled:!e||!e.textSymbol3D})}}})],l.prototype,\"size\",void 0),t([s(\"size\")],l.prototype,\"castSize\",null),t([r({type:a,json:{default:\"normal\",write:!0}})],l.prototype,\"style\",void 0),t([r({type:c,json:{default:\"normal\",write:!0}})],l.prototype,\"weight\",void 0),l=n=t([i(\"esri.symbols.Font\")],l);const m=l;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{makeAbsolute as e,makeRelative as r,isAbsolute as t,normalize as o,isDataProtocol as s,splitPathExtension as n,changeDomain as l,hasSameOrigin as a,getAppUrl as u}from\"../core/urlUtils.js\";function i(t,o){const s=o?.url?.path;if(t&&s&&(t=e(t,s,{preserveProtocolRelative:!0}),o.portalItem&&o.readResourcePaths)){const e=r(t,o.portalItem.itemUrl);null!=e&&h.test(e)&&o.readResourcePaths.push(o.portalItem.resourceFromPath(e).path)}return I(t,o?.portal)}function c(n,l,a=R.YES){if(null==n)return n;!t(n)&&l?.blockedRelativeUrls&&l.blockedRelativeUrls.push(n);let u=e(n);if(l){const e=l.verifyItemRelativeUrls?.rootPath||l.url?.path;if(e){const t=I(e,l.portal),o=I(u,l.portal);u=r(o,t,t);null!=u&&u!==o&&u!==n&&l.verifyItemRelativeUrls&&l.verifyItemRelativeUrls.writtenUrls.push(u)}}return u=d(u,l?.portal),t(u)&&(u=o(u)),l?.resources&&l?.portalItem&&!t(u)&&!s(u)&&a===R.YES&&l.resources.toKeep.push({resource:l.portalItem.resourceFromPath(u),compress:!1}),u}function m(e,r,t){return i(e,t)}function p(e,r,t,o){const s=c(e,o);void 0!==s&&(r[t]=s)}const f=/\\/items\\/([^\\/]+)\\/resources\\/(.*)/,h=/^\\.\\/resources\\//;function U(e){const r=e?.match(f)??null;return r?.[1]??null}function v(e){const r=e?.match(f)??null;if(null==r)return null;const t=r[2],o=t.lastIndexOf(\"/\");if(-1===o){const{path:e,extension:r}=n(t);return{prefix:null,filename:e,extension:r}}const{path:s,extension:l}=n(t.slice(o+1));return{prefix:t.slice(0,o),filename:s,extension:l}}function d(e,r){return r&&!r.isPortal&&r.urlKey&&r.customBaseUrl?l(e,`${r.urlKey}.${r.customBaseUrl}`,r.portalHostname):e}function I(e,r){if(!r||r.isPortal||!r.urlKey||!r.customBaseUrl)return e;const t=`${r.urlKey}.${r.customBaseUrl}`,o=u();return a(o,`${o.scheme}://${t}`)?l(e,r.portalHostname,t):l(e,t,r.portalHostname)}var R;!function(e){e[e.YES=0]=\"YES\",e[e.NO=1]=\"NO\"}(R||(R={}));const x=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return R},ensureMainOnlineDomain:d,fromJSON:i,itemIdFromResourceUrl:U,prefixAndFilenameFromResourceUrl:v,read:m,toJSON:c,write:p},Symbol.toStringTag,{value:\"Module\"}));export{R as M,x as a,d as e,i as f,U as i,v as p,m as r,c as t,p as w};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{strict as e}from\"../../core/jsonMap.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{isDataProtocol as t,isAbsolute as s,normalize as p}from\"../../core/urlUtils.js\";import{property as c}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as i}from\"../../core/accessorSupport/decorators/enumeration.js\";import{reader as a}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as f}from\"../../core/accessorSupport/decorators/writer.js\";import{f as u,t as n}from\"../../chunks/persistableUrlUtils.js\";var l;const d=e()({circle:\"circle\",square:\"square\",cross:\"cross\",x:\"x\",kite:\"kite\",triangle:\"triangle\"});let h=l=class extends o{constructor(r){super(r)}readHref(r,e,o){return r?u(r,o):e.dataURI}writeHref(r,e,o,c){r&&(t(r)?e.dataURI=r:(e.href=n(r,c),s(e.href)&&(e.href=p(e.href))))}clone(){return new l({href:this.href,primitive:this.primitive})}};r([c({type:String,json:{write:!0,read:{source:[\"href\",\"dataURI\"]}}})],h.prototype,\"href\",void 0),r([a(\"href\")],h.prototype,\"readHref\",null),r([f(\"href\",{href:{type:String},dataURI:{type:String}})],h.prototype,\"writeHref\",null),r([i(d)],h.prototype,\"primitive\",void 0),h=l=r([m(\"esri.symbols.support.IconSymbol3DLayerResource\")],h);const j=\"circle\";export{h as IconSymbol3DLayerResource,j as defaultPrimitive};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";var e;let p=e=class extends o{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new e({x:this.x,y:this.y})}};r([s({type:Number})],p.prototype,\"x\",void 0),r([s({type:Number})],p.prototype,\"y\",void 0),p=e=r([t(\"esri.symbols.support.Symbol3DAnchorPosition2D\")],p);export{p as Symbol3DAnchorPosition2D};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{px2pt as t}from\"../../core/screenUtils.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import{colorAndTransparencyProperty as p,screenSizeProperty as i}from\"./materialUtils.js\";var l;let m=l=class extends s{constructor(o){super(o),this.color=new r([0,0,0,1]),this.size=t(1)}clone(){const o={color:null!=this.color?this.color.clone():null,size:this.size};return new l(o)}};o([e(p)],m.prototype,\"color\",void 0),o([e(i)],m.prototype,\"size\",void 0),m=l=o([c(\"esri.symbols.support.Symbol3DIconOutline\")],m);export{m as Symbol3DIconOutline};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import t from\"../core/Logger.js\";import{makeData as r}from\"../core/urlUtils.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as i}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import n from\"./Symbol3DLayer.js\";import{white as l,isBlack as c}from\"./support/colors.js\";import{IconSymbol3DLayerResource as a}from\"./support/IconSymbol3DLayerResource.js\";import{screenSizeProperty as p}from\"./support/materialUtils.js\";import{Symbol3DAnchorPosition2D as u}from\"./support/Symbol3DAnchorPosition2D.js\";import{Symbol3DIconOutline as m}from\"./support/Symbol3DIconOutline.js\";import{Symbol3DMaterial as h}from\"./support/Symbol3DMaterial.js\";var y;const d=\"esri.symbols.IconSymbol3DLayer\";let f=y=class extends n{constructor(o){super(o),this.material=null,this.resource=null,this.type=\"icon\",this.size=12,this.anchor=\"center\",this.anchorPosition=null,this.outline=null}clone(){return new y({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:null!=this.material?this.material.clone():null,outline:null!=this.outline?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(o){const t=o.color||l,r=b(o),e=o.outline&&o.outline.width>0?{size:o.outline.width,color:(o.outline.color||l).clone()}:null;return new y({size:o.size,resource:{primitive:v(o.style)},material:{color:t},outline:e,anchor:r?\"relative\":void 0,anchorPosition:r})}static fromPictureMarkerSymbol(o){const t=!o.color||c(o.color)?l:o.color,r=b(o);return new y({size:o.width<=o.height?o.height:o.width,resource:{href:o.url},material:{color:t.clone()},anchor:r?\"relative\":void 0,anchorPosition:r})}static fromCIMSymbol(o){return new y({resource:{href:r({mediaType:\"application/json\",data:JSON.stringify(o.data)})}})}};function b(o){const t=\"width\"in o?o.width:o.size,r=\"height\"in o?o.height:o.size,e=j(o.xoffset),i=j(o.yoffset);return(e||i)&&t&&r?{x:-e/t,y:i/r}:null}function j(o){return isFinite(o)?o:0}o([e({type:h,json:{write:!0}})],f.prototype,\"material\",void 0),o([e({type:a,json:{write:!0}})],f.prototype,\"resource\",void 0),o([i({Icon:\"icon\"},{readOnly:!0})],f.prototype,\"type\",void 0),o([e(p)],f.prototype,\"size\",void 0),o([i({center:\"center\",left:\"left\",right:\"right\",top:\"top\",bottom:\"bottom\",topLeft:\"top-left\",topRight:\"top-right\",bottomLeft:\"bottom-left\",bottomRight:\"bottom-right\",relative:\"relative\"}),e({json:{default:\"center\"}})],f.prototype,\"anchor\",void 0),o([e({type:u,json:{type:[Number],read:{reader:o=>new u({x:o[0],y:o[1]})},write:{writer:(o,t)=>{t.anchorPosition=[o.x,o.y]},overridePolicy(){return{enabled:\"relative\"===this.anchor}}}}})],f.prototype,\"anchorPosition\",void 0),o([e({type:m,json:{write:!0}})],f.prototype,\"outline\",void 0),f=y=o([s(d)],f);const g={circle:\"circle\",cross:\"cross\",diamond:\"kite\",square:\"square\",x:\"x\",triangle:\"triangle\",path:null};function v(o){const r=g[o];return r||(t.getLogger(d).warn(`${o} cannot be mapped to Icon symbol. Fallback to \"circle\"`),\"circle\")}const w=f;export{w as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"./Collection.js\";function n(n,t,i=r){return t||(t=new i),t===n||(t.removeAll(),e(n)?t.addMany(n):n&&t.add(n)),t}function t(r){return r}function e(r){return r&&(Array.isArray(r)||\"items\"in r&&Array.isArray(r.items))}export{t as castForReferenceSetter,n as referenceSetter};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"../chunks/tslib.es6.js\";import e from\"./Accessor.js\";import{createResolver as r,createAbortError as i,isAbortError as t}from\"./promiseUtils.js\";import{subclass as o}from\"./accessorSupport/decorators/subclass.js\";var l;!function(s){s[s.PENDING=0]=\"PENDING\",s[s.RESOLVED=1]=\"RESOLVED\",s[s.REJECTED=2]=\"REJECTED\"}(l||(l={}));class h{constructor(){this._resolver=r(),this._status=l.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=l.RESOLVED,this._cleanUp()}),(()=>{this._status=l.REJECTED,this._cleanUp()})),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(s){this._resolvingPromises.push(s),this._tryResolve()}isResolved(){return this._status===l.RESOLVED}isRejected(){return this._status===l.REJECTED}isFulfilled(){return this._status!==l.PENDING}abort(){this._resolver.reject(i())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const s=r(),e=[...this._resolvingPromises,s.promise],i=this._allPromise=Promise.all(e);i.then((()=>{this.isFulfilled()||this._allPromise!==i||this._resolver.resolve()}),(s=>{this.isFulfilled()||this._allPromise!==i||t(s)||this._resolver.reject(s)})),s.resolve()}}const n=e=>{let r=class extends e{constructor(...s){super(...s),this._promiseProps=new h,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(s,e){return this._promiseProps.promise.then((()=>this)).then(s,e)}catch(s){return this.when(null,s)}addResolvingPromise(s){s&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise(\"_promiseProps\"in s?s.when():s)}};return r=s([o(\"esri.core.Promise\")],r),r};let m=class extends(n(e)){};m=s([o(\"esri.core.Promise\")],m);export{m as EsriPromise,n as EsriPromiseMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import t from\"./Error.js\";import{abortMaybe as r}from\"./maybe.js\";import{EsriPromise as s}from\"./Promise.js\";import{onAbortOrThrow as l}from\"./promiseUtils.js\";import e from\"./Warning.js\";import{property as a}from\"./accessorSupport/decorators/property.js\";import{subclass as n}from\"./accessorSupport/decorators/subclass.js\";const i=\"not-loaded\",d=\"loading\",h=\"failed\",c=\"loaded\",u=s=>{let u=class extends s{constructor(...o){super(...o),this._loadController=null,this.loadError=null,this.loadStatus=\"not-loaded\",this._set(\"loadWarnings\",[]),this.addResolvingPromise(new Promise((o=>{const r=this.load.bind(this);this.load=s=>{const e=new Promise(((o,r)=>{const e=l(s,r);this.destroyed&&r(new t(\"load:instance-destroyed\",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(o,r).finally((()=>{e&&e.remove()}))}));if(this.loadStatus===i){this._set(\"loadStatus\",d);const o=this._loadController=new AbortController;r({signal:o.signal})}return o(),e}}))),this.when((()=>{this._set(\"loadStatus\",c),this._loadController=null}),(o=>{this._set(\"loadStatus\",h),this._set(\"loadError\",o),this._loadController=null}))}destroy(){this._loadController&&(this._loadController=r(this._loadController),this._promiseProps.abort()),this._set(\"loadError\",null),this._set(\"loadWarnings\",[])}get loaded(){return this.loadStatus===c}get loadWarnings(){return this._get(\"loadWarnings\")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set(\"loadError\",new t(\"load:cancelled\",\"Cancelled\")),this._loadController?.abort(),this._promiseProps.abort()),this}};return o([a({readOnly:!0})],u.prototype,\"loaded\",null),o([a({readOnly:!0})],u.prototype,\"loadError\",void 0),o([a({clonable:!1})],u.prototype,\"loadStatus\",void 0),o([a({type:[e],readOnly:!0})],u.prototype,\"loadWarnings\",null),u=o([n(\"esri.core.Loadable\")],u),u};let p=class extends(u(s)){};p=o([n(\"esri.core.Loadable\")],p),function(o){function t(o){return!(!o||!o.load)}o.LoadableMixin=u,o.isLoadable=t}(p||(p={}));const m=p;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet t;function e(){t=void 0}function n(e){return t&&!t.destroyed||(t=e()),t}export{e as clearDefaultPortalInstance,n as ensureDefaultPortalInstance};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import r from\"../core/Accessor.js\";import{JSONMap as e}from\"../core/jsonMap.js\";import{clone as s}from\"../core/lang.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import a from\"../geometry/Extent.js\";import n from\"../geometry/SpatialReference.js\";import{project as l}from\"../geometry/support/webMercatorUtils.js\";var u;const p=new e({avgRating:\"avg-rating\",numRatings:\"num-ratings\",numComments:\"num-comments\",numViews:\"num-views\"});let m=u=class extends r{constructor(t){super(t),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get(\"sortOrder\")||\"asc\"}set sortOrder(t){\"asc\"!==t&&\"desc\"!==t||this._set(\"sortOrder\",t)}clone(){return new u({categories:this.categories?s(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(t,r){let e=[];this.categories&&(e=this.categories.map((t=>Array.isArray(t)?JSON.stringify(t):t)));let s=\"\";if(this.extent){const t=l(this.extent,n.WGS84);null!=t&&(s=`${t.xmin},${t.ymin},${t.xmax},${t.ymax}`)}let o=this.query;!this.disableExtraQuery&&t.extraQuery&&(o=\"(\"+o+\")\"+t.extraQuery);const i={categories:e,bbox:s,q:o,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(i.sortField=this.sortField.split(\",\").map((t=>p.toJSON(t.trim()))).join(\",\"),i.sortOrder=this.sortOrder),{query:{...r,...i}}}};t([o()],m.prototype,\"categories\",void 0),t([o()],m.prototype,\"disableExtraQuery\",void 0),t([o({type:a})],m.prototype,\"extent\",void 0),t([o()],m.prototype,\"filter\",void 0),t([o()],m.prototype,\"num\",void 0),t([o()],m.prototype,\"query\",void 0),t([o()],m.prototype,\"sortField\",void 0),t([o()],m.prototype,\"sortOrder\",null),t([o()],m.prototype,\"start\",void 0),m=u=t([i(\"esri.portal.PortalQueryParams\")],m);const c=m;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import r from\"../core/Error.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import{ensureType as s}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"./PortalQueryParams.js\";var l;let u=l=class extends e{constructor(t){super(t),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const t=this.url,r=this.thumbnail;return t&&r&&this.portal?this.portal?.normalizeUrl(`${t}/info/${r}?f=json`):null}get url(){const t=this.portal?.restUrl;return t?t+\"/community/groups/\"+this.id:null}fetchCategorySchema(t){return this.portal.request(this.url+\"/categorySchema\",t).then((r=>{const e=r.categorySchema||[];return e.some((t=>\"contentCategorySetsGroupQuery.LivingAtlas\"===t.source))?this._fetchCategorySchemaSet(\"LivingAtlas\",t):e}))}fetchMembers(t){return this.portal.request(this.url+\"/users\",t)}getThumbnailUrl(t){let r=this.thumbnailUrl;return r&&t&&(r+=`&w=${t}`),r}toJSON(){throw new r(\"internal:not-yet-implemented\",\"PortalGroup.toJSON is not yet implemented\")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error(\"JSON object is already hydrated\");const r=new l;return r.sourceJSON=t,r.read(t),r}queryItems(t,r){let e=s(i,t);const o=this.portal;return parseFloat(o.currentVersion)>5?(e=e||new i,o.queryPortal(`/content/groups/${this.id}/search`,e,\"PortalItem\",r)):(e=e?e.clone():new i,e.query=\"group:\"+this.id+(e.query?\" \"+e.query:\"\"),o.queryItems(e,r))}_fetchCategorySchemaSet(t,e){const o=this.portal;return o.fetchSelf(o.authMode,!0,e).then((t=>{const s=t.contentCategorySetsGroupQuery;if(s){const t=new i;return t.disableExtraQuery=!0,t.num=1,t.query=s,o.queryGroups(t,e)}throw new r(\"portal-group:fetchCategorySchema\",\"contentCategorySetsGroupQuery value not found\")})).then((o=>{if(o.total){const r=o.results[0],s=new i;return s.num=1,s.query=`typekeywords:\"${t}\"`,r.queryItems(s,e)}throw new r(\"portal-group:fetchCategorySchema\",\"contentCategorySetsGroupQuery group not found\")})).then((t=>{if(t.total){return t.results[0].fetchData(\"json\",e).then((t=>{const r=t?.categorySchema;return r?.length?r:[]}))}return[]}))}};t([o()],u.prototype,\"access\",void 0),t([o({type:Date})],u.prototype,\"created\",void 0),t([o()],u.prototype,\"description\",void 0),t([o()],u.prototype,\"id\",void 0),t([o()],u.prototype,\"isInvitationOnly\",void 0),t([o({type:Date})],u.prototype,\"modified\",void 0),t([o()],u.prototype,\"owner\",void 0),t([o()],u.prototype,\"portal\",void 0),t([o()],u.prototype,\"snippet\",void 0),t([o()],u.prototype,\"sortField\",void 0),t([o()],u.prototype,\"sortOrder\",void 0),t([o()],u.prototype,\"sourceJSON\",void 0),t([o()],u.prototype,\"tags\",void 0),t([o()],u.prototype,\"thumbnail\",void 0),t([o({readOnly:!0})],u.prototype,\"thumbnailUrl\",null),t([o()],u.prototype,\"title\",void 0),t([o({readOnly:!0})],u.prototype,\"url\",null),u=l=t([n(\"esri.portal.PortalGroup\")],u);const a=u;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import o from\"../core/Accessor.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";let e=class extends o{constructor(r){super(r),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};r([s()],e.prototype,\"nextQueryParams\",void 0),r([s()],e.prototype,\"queryParams\",void 0),r([s()],e.prototype,\"results\",void 0),r([s()],e.prototype,\"total\",void 0),e=r([t(\"esri.portal.PortalQueryResult\")],e);const p=e;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import r from\"../core/Error.js\";import{JSONSupport as o}from\"../core/JSONSupport.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";let p=class extends o{constructor(t){super(t),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const t=this.portal?.restUrl;return t?`${t}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new r(\"internal:not-yet-implemented\",\"PortalFolder.toJSON is not yet implemented\")}};t([e({type:Date})],p.prototype,\"created\",void 0),t([e()],p.prototype,\"id\",void 0),t([e()],p.prototype,\"portal\",void 0),t([e()],p.prototype,\"title\",void 0),t([e({readOnly:!0})],p.prototype,\"url\",null),t([e()],p.prototype,\"username\",void 0),p=t([s(\"esri.portal.PortalFolder\")],p);const l=p;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import r from\"../core/Error.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import l from\"./PortalFolder.js\";import n from\"./PortalGroup.js\";var i;let u=i=class extends e{constructor(...t){super(...t),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const t=this.url,r=this.thumbnail;return t&&r?this.portal.normalizeUrl(`${t}/info/${r}?f=json`):null}get userContentUrl(){const t=this.portal?.restUrl;return t?`${t}/content/users/${this.username}`:null}get url(){const t=this.portal?.restUrl;return t?`${t}/community/users/${this.username}`:null}addItem(t){const r=t&&t.item,e=t?.data,o=t?.folder,s={method:\"post\"};r&&(s.query=r.createPostQuery(),null!=e&&(\"string\"==typeof e?s.query.text=e:\"object\"==typeof e&&(s.query.text=JSON.stringify(e))));let l=this.userContentUrl;return o&&(l+=\"/\"+(\"string\"==typeof o?o:o.id)),this.portal.request(l+\"/addItem\",s).then((t=>(r.id=t.id,r.portal=this.portal,r.loaded?r.reload():r.load())))}deleteItem(t){let r=this.userContentUrl;return t.ownerFolder&&(r+=\"/\"+t.ownerFolder),this.portal.request(r+`/items/${t.id}/delete`,{method:\"post\"}).then((()=>{t.id=null,t.portal=null}))}deleteItems(t){const r=this.userContentUrl+\"/deleteItems\",e=t.map((t=>t.id));if(e.length){const o={method:\"post\",query:{items:e.join(\",\")}};return this.portal.request(r,o).then((()=>{t.forEach((t=>{t.id=null,t.portal=null}))}))}return Promise.resolve(void 0)}fetchFolders(){const t={query:{num:1}};return this.portal.request(this.userContentUrl??\"\",t).then((t=>{let r;return r=t&&t.folders?t.folders.map((t=>{const r=l.fromJSON(t);return r.portal=this.portal,r})):[],r}))}fetchGroups(){return this.portal.request(this.url??\"\").then((t=>{let r;return r=t&&t.groups?t.groups.map((t=>{const r=n.fromJSON(t);return r.portal=this.portal,r})):[],r}))}fetchItems(t){const r=t??{};let e,o=this.userContentUrl??\"\";return r.folder&&(o+=\"/\"+r.folder.id),import(\"./PortalItem.js\").then((({default:t})=>{e=t;const s={folders:!1,num:r.num||10,start:r.start||1,sortField:r.sortField||\"created\",sortOrder:r.sortOrder||\"asc\"};return this.portal.request(o,{query:s})})).then((t=>{let r;return t?.items?(r=t.items.map((t=>{const r=e.fromJSON(t);return r.portal=this.portal,r})),Promise.all(r.map((t=>t.load()))).catch((t=>t)).then((()=>({items:r,nextStart:t.nextStart,total:t.total})))):{items:[],nextStart:-1,total:0}}))}fetchTags(){return this.portal.request(this.url+\"/tags\").then((t=>t.tags))}getThumbnailUrl(t){let r=this.thumbnailUrl;return r&&t&&(r+=`&w=${t}`),r}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new n({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new r(\"internal:unknown\",\"Unknown internal error\",{internalError:\"Unknown favGroupId\"}))}toJSON(){throw new r(\"internal:not-yet-implemented\",\"PortalUser.toJSON is not yet implemented\")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error(\"JSON object is already hydrated\");const r=new i;return r.sourceJSON=t,r.read(t),r}};t([o()],u.prototype,\"access\",void 0),t([o({type:Date})],u.prototype,\"created\",void 0),t([o()],u.prototype,\"culture\",void 0),t([o()],u.prototype,\"description\",void 0),t([o()],u.prototype,\"email\",void 0),t([o()],u.prototype,\"favGroupId\",void 0),t([o()],u.prototype,\"fullName\",void 0),t([o({type:Date})],u.prototype,\"modified\",void 0),t([o()],u.prototype,\"orgId\",void 0),t([o()],u.prototype,\"portal\",void 0),t([o()],u.prototype,\"preferredView\",void 0),t([o()],u.prototype,\"privileges\",void 0),t([o()],u.prototype,\"region\",void 0),t([o()],u.prototype,\"role\",void 0),t([o()],u.prototype,\"roleId\",void 0),t([o()],u.prototype,\"sourceJSON\",void 0),t([o()],u.prototype,\"thumbnail\",void 0),t([o({readOnly:!0})],u.prototype,\"thumbnailUrl\",null),t([o()],u.prototype,\"units\",void 0),t([o({readOnly:!0})],u.prototype,\"userContentUrl\",null),t([o({readOnly:!0})],u.prototype,\"url\",null),t([o()],u.prototype,\"username\",void 0),t([o()],u.prototype,\"userType\",void 0),u=i=t([s(\"esri.portal.PortalUser\")],u);const p=u;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../config.js\";import{id as r}from\"../kernel.js\";import o from\"../request.js\";import s from\"../core/Error.js\";import{JSONSupportMixin as i}from\"../core/JSONSupport.js\";import a from\"../core/Loadable.js\";import{destroyMaybe as l,removeMaybe as u}from\"../core/maybe.js\";import{throwIfAborted as n,isAborted as p,createAbortError as d,throwIfAbortError as h}from\"../core/promiseUtils.js\";import{property as y}from\"../core/accessorSupport/decorators/property.js\";import{ensureType as c}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as m}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as f}from\"../core/accessorSupport/decorators/subclass.js\";import v from\"../geometry/Extent.js\";import{getLocale as S}from\"../intl/locale.js\";import{ensureDefaultPortalInstance as g}from\"./portalDefault.js\";import P from\"./PortalGroup.js\";import G from\"./PortalQueryParams.js\";import B from\"./PortalQueryResult.js\";import O from\"./PortalUser.js\";import{supportsApiKey as D}from\"../support/apiKeyUtils.js\";var U;let b;const Q={PortalGroup:()=>Promise.resolve({default:P}),PortalItem:()=>import(\"./PortalItem.js\"),PortalUser:()=>Promise.resolve({default:O})};let C=U=class extends(i(a)){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode=\"auto\",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=t.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return\"string\"==typeof e?{url:e}:e}destroy(){q.unregister(this),this.defaultBasemap=l(this.defaultBasemap),this.defaultDevBasemap=l(this.defaultDevBasemap),this.defaultVectorBasemap=l(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=u(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const r of e)t.request.trustedServers.includes(r)||t.request.trustedServers.push(r);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=this.user?.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf(\"/sharing\");e=t>0?e.substring(0,t):this.url.replace(/\\/+$/,\"\"),e+=\"/sharing/rest\"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+\"/portals/self/resources/\"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=O.fromJSON(e),t.portal=this),t}load(e){const t=import(\"../Basemap.js\").then((({default:t})=>{n(e),b=t})).then((()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e))).then((e=>{if(r){const e=r;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==U.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on(\"credential-create\",w(new WeakRef(this))),q.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService(\"defaultElevationLayers\"),t=(await import(\"../layers/ElevationLayer.js\")).default;return e?e.map((e=>new t({id:e.id,url:e.url}))):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){const o=await this._fetchBasemaps3D(e,t);r.unshift(...o)}return r}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+\"/portals/self/categorySchema\",e).then((e=>e.categorySchema)):p(e)?Promise.reject(d()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new G;if(r.num=100,r.sortField=\"title\",t&&t.length){const o=[];for(const e of t)o.push(`(title:\"${e.title}\" AND owner:${e.owner})`);return r.query=o.join(\" OR \"),this.queryGroups(r,e).then((e=>e.results))}return p(e)?Promise.reject(d()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+\"/portals/regions\",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+\"/portals/self/settings\",{...e,query:{culture:t}})}static getDefault(){return g((()=>new U))}queryGroups(e,t){return this.queryPortal(\"/community/groups\",e,\"PortalGroup\",t)}queryItems(e,t){return this.queryPortal(\"/search\",e,\"PortalItem\",t)}queryUsers(e,t){return e.sortField||(e.sortField=\"username\"),this.queryPortal(\"/community/users\",e,\"PortalUser\",t)}fetchSelf(e=this.authMode,t=!1,r){const o=this.restUrl+\"/portals/self\",s={authMode:e,query:{culture:S().toLowerCase()},...r};return\"auto\"===s.authMode&&(s.authMode=\"no-prompt\"),t&&(s.query.default=!0),this.request(o,s)}queryPortal(e,t,r,o){const s=c(G,t),i=t=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...o}).then((e=>{const r=s.clone();return r.start=e.nextStart,new B({nextQueryParams:r,queryParams:s,total:e.total,results:U._resultsToTypedArray(t,{portal:this},e,o)})})).then((e=>Promise.all(e.results.map((t=>\"function\"==typeof t.when?t.when():e))).then((()=>e),(t=>(h(t),e)))));return r&&Q[r]?Q[r]().then((({default:e})=>(n(o),i(e)))):i()}signIn(){if(this.authMode===U.AUTH_MODE_ANONYMOUS)return Promise.reject(new s(\"portal:invalid-auth-mode\",`Current \"authMode\"' is \"${this.authMode}\"`));if(\"failed\"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then((()=>\"not-loaded\"===this.loadStatus?(e||(this.authMode=\"immediate\"),this.load().then((()=>null))):\"loading\"===this.loadStatus?this.load().then((()=>this.credential?null:(this.credential=e,this.fetchSelf(\"immediate\")))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf(\"immediate\")))).then((e=>{e&&(this.sourceJSON=e,this.read(e))}));return r?r.getCredential(this.restUrl).then((t=>e(t))):e(this.credential)}normalizeUrl(e){const t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes(\"?\")?\"&\":\"?\")+\"token=\"+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then((e=>{const t=U._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map((t=>\"function\"==typeof t.when?t.when():e))).then((()=>t),(()=>t))}))}request(e,t={}){const r={f:\"json\",...t.query},{authMode:s=(this.authMode===U.AUTH_MODE_ANONYMOUS?\"anonymous\":\"auto\"),body:i=null,cacheBust:a=!1,method:l=\"auto\",responseType:u=\"json\",signal:n}=t,p={authMode:s,body:i,cacheBust:a,method:l,query:r,responseType:u,timeout:0,signal:n};return o(this._normalizeSSL(e),p).then((e=>e.data))}toJSON(){throw new s(\"internal:not-yet-implemented\",\"Portal.toJSON is not yet implemented\")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error(\"JSON object is already hydrated\");return new U({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new s(\"portal:service-not-found\",`The \\`helperServices\\` do not include an entry named \"${e}\"`);return t}async _fetchBasemaps(e,r){const o=new G;o.query=e||(t.apiKey&&D(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),o.disableExtraQuery=!0;const s=await this.queryGroups(o,r);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:\"Web Map\" -type:\"Web Application\"',o.sortField=i.sortField||\"name\",o.sortOrder=i.sortOrder||\"desc\";const a=await i.queryItems(o,r);if(!a.total)return[];return a.results.filter((e=>\"Web Map\"===e.type)).map((e=>new b({portalItem:e})))}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];const o=new G({query:r,disableExtraQuery:!0}),s=await this.queryGroups(o,t);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:\"Web Scene\"',o.sortField=i.sortField||\"name\",o.sortOrder=i.sortOrder||\"desc\";const a=await i.queryItems(o,t);if(!a.total)return[];return a.results.filter((e=>\"Web Scene\"===e.type)).map((e=>new b({portalItem:e})))}_normalizeSSL(e){return e.replace(/^http:/i,\"https:\").replace(\":7080\",\":7443\")}_readBasemap(e){if(e){const t=b.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,o){let s=[];if(r){const i=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(s=s.map((r=>{const o=Object.assign(e?e.fromJSON(r):r,t);return\"function\"==typeof o.load&&o.load(i),o})))}else s=[];return s}};C.AUTH_MODE_ANONYMOUS=\"anonymous\",C.AUTH_MODE_AUTO=\"auto\",C.AUTH_MODE_IMMEDIATE=\"immediate\",e([y()],C.prototype,\"access\",void 0),e([y()],C.prototype,\"allSSL\",void 0),e([y()],C.prototype,\"authMode\",void 0),e([y()],C.prototype,\"authorizedCrossOriginDomains\",void 0),e([m(\"authorizedCrossOriginDomains\")],C.prototype,\"readAuthorizedCrossOriginDomains\",null),e([y()],C.prototype,\"basemapGalleryGroupQuery\",void 0),e([y({json:{name:\"3DBasemapGalleryGroupQuery\"}})],C.prototype,\"basemapGalleryGroupQuery3D\",void 0),e([y()],C.prototype,\"bingKey\",void 0),e([y()],C.prototype,\"canListApps\",void 0),e([y()],C.prototype,\"canListData\",void 0),e([y()],C.prototype,\"canListPreProvisionedItems\",void 0),e([y()],C.prototype,\"canProvisionDirectPurchase\",void 0),e([y()],C.prototype,\"canSearchPublic\",void 0),e([y()],C.prototype,\"canShareBingPublic\",void 0),e([y()],C.prototype,\"canSharePublic\",void 0),e([y()],C.prototype,\"canSignInArcGIS\",void 0),e([y()],C.prototype,\"canSignInIDP\",void 0),e([y()],C.prototype,\"colorSetsGroupQuery\",void 0),e([y()],C.prototype,\"commentsEnabled\",void 0),e([y({type:Date})],C.prototype,\"created\",void 0),e([y()],C.prototype,\"credential\",void 0),e([y()],C.prototype,\"culture\",void 0),e([y()],C.prototype,\"currentVersion\",void 0),e([y()],C.prototype,\"customBaseUrl\",void 0),e([y()],C.prototype,\"defaultBasemap\",void 0),e([m(\"defaultBasemap\")],C.prototype,\"readDefaultBasemap\",null),e([y()],C.prototype,\"defaultDevBasemap\",void 0),e([m(\"defaultDevBasemap\")],C.prototype,\"readDefaultDevBasemap\",null),e([y({type:v})],C.prototype,\"defaultExtent\",void 0),e([y()],C.prototype,\"defaultVectorBasemap\",void 0),e([m(\"defaultVectorBasemap\")],C.prototype,\"readDefaultVectorBasemap\",null),e([y()],C.prototype,\"description\",void 0),e([y()],C.prototype,\"devBasemapGalleryGroupQuery\",void 0),e([y()],C.prototype,\"eueiEnabled\",void 0),e([y({readOnly:!0})],C.prototype,\"extraQuery\",null),e([y()],C.prototype,\"featuredGroups\",void 0),e([y()],C.prototype,\"featuredItemsGroupQuery\",void 0),e([y()],C.prototype,\"galleryTemplatesGroupQuery\",void 0),e([y()],C.prototype,\"livingAtlasGroupQuery\",void 0),e([y()],C.prototype,\"hasCategorySchema\",void 0),e([y()],C.prototype,\"helpBase\",void 0),e([y()],C.prototype,\"helperServices\",void 0),e([y()],C.prototype,\"helpMap\",void 0),e([y()],C.prototype,\"homePageFeaturedContent\",void 0),e([y()],C.prototype,\"homePageFeaturedContentCount\",void 0),e([y()],C.prototype,\"httpPort\",void 0),e([y()],C.prototype,\"httpsPort\",void 0),e([y()],C.prototype,\"id\",void 0),e([y()],C.prototype,\"ipCntryCode\",void 0),e([y({readOnly:!0})],C.prototype,\"isOrganization\",null),e([y()],C.prototype,\"isPortal\",void 0),e([y()],C.prototype,\"isReadOnly\",void 0),e([y({readOnly:!0})],C.prototype,\"itemPageUrl\",null),e([y()],C.prototype,\"layerTemplatesGroupQuery\",void 0),e([y()],C.prototype,\"maxTokenExpirationMinutes\",void 0),e([y({type:Date})],C.prototype,\"modified\",void 0),e([y()],C.prototype,\"name\",void 0),e([y()],C.prototype,\"portalHostname\",void 0),e([y()],C.prototype,\"portalMode\",void 0),e([y()],C.prototype,\"portalProperties\",void 0),e([y()],C.prototype,\"region\",void 0),e([y({readOnly:!0})],C.prototype,\"restUrl\",null),e([y()],C.prototype,\"rotatorPanels\",void 0),e([y()],C.prototype,\"showHomePageDescription\",void 0),e([y()],C.prototype,\"sourceJSON\",void 0),e([y()],C.prototype,\"staticImagesUrl\",void 0),e([y({json:{name:\"2DStylesGroupQuery\"}})],C.prototype,\"stylesGroupQuery2d\",void 0),e([y({json:{name:\"stylesGroupQuery\"}})],C.prototype,\"stylesGroupQuery3d\",void 0),e([y()],C.prototype,\"supportsHostedServices\",void 0),e([y()],C.prototype,\"symbolSetsGroupQuery\",void 0),e([y()],C.prototype,\"templatesGroupQuery\",void 0),e([y()],C.prototype,\"thumbnail\",void 0),e([y({readOnly:!0})],C.prototype,\"thumbnailUrl\",null),e([y()],C.prototype,\"units\",void 0),e([y()],C.prototype,\"url\",void 0),e([y()],C.prototype,\"urlKey\",void 0),e([m(\"urlKey\")],C.prototype,\"readUrlKey\",null),e([y()],C.prototype,\"user\",void 0),e([m(\"user\")],C.prototype,\"readUser\",null),e([y()],C.prototype,\"use3dBasemaps\",void 0),e([y()],C.prototype,\"useStandardizedQuery\",void 0),e([y()],C.prototype,\"useVectorBasemaps\",void 0),e([y()],C.prototype,\"vectorBasemapGalleryGroupQuery\",void 0),C=U=e([f(\"esri.portal.Portal\")],C);const j=C,q=new FinalizationRegistry((e=>{e.remove()}));function w(e){const t=r;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch((()=>{}))}}export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import r from\"../Color.js\";import{ClonableMixin as t}from\"../core/Clonable.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import{Integer as l}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import{lineMarkerPlacements as i,lineMarkerStyles as c}from\"./support/lineMarkers.js\";let n=class extends(t(e)){constructor(o){super(o),this.type=\"style\",this.placement=\"begin-end\",this.style=\"arrow\",this.color=null}equals(o){return null!=o&&o.placement===this.placement&&o.style===this.style&&(null==this.color&&null==o.color||null!=this.color&&null!=o.color&&this.color.toJSON()===o.color.toJSON())}};o([s({type:[\"style\"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],n.prototype,\"type\",void 0),o([s({type:i,json:{default:\"begin-end\",write:!0}})],n.prototype,\"placement\",void 0),o([s({type:c,json:{default:\"arrow\",write:!0}})],n.prototype,\"style\",void 0),o([s({type:r,json:{type:[l],default:null,write:!0}})],n.prototype,\"color\",void 0),n=o([p(\"esri.symbols.LineStyleMarker3D\")],n);const a=n;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{px2pt as e}from\"../core/screenUtils.js\";import{property as r}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as o}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"./LineStyleMarker3D.js\";import l from\"./Symbol3DLayer.js\";import p from\"./patterns/LineStylePattern3D.js\";import{symbol3dLinePatternProperty as a}from\"./patterns/utils.js\";import{white as n}from\"./support/colors.js\";import{screenSizeProperty as m}from\"./support/materialUtils.js\";import{Symbol3DMaterial as c}from\"./support/Symbol3DMaterial.js\";import{lineJoins as y,lineCaps as u}from\"./support/symbolLayerUtils3D.js\";var j;let d=j=class extends l{constructor(t){super(t),this.material=null,this.type=\"line\",this.join=\"miter\",this.cap=\"butt\",this.size=e(1),this.pattern=null,this.marker=null}clone(){const t={enabled:this.enabled,material:null!=this.material?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:null!=this.pattern?this.pattern.clone():null,marker:null!=this.marker?this.marker.clone():null};return new j(t)}static fromSimpleLineSymbol(t){const r={enabled:!0,size:t.width??e(1),cap:t.cap||\"butt\",join:t.join||\"miter\",pattern:t.style&&\"inside-frame\"!==t.style?new p({style:t.style}):null,material:new c({color:(t.color||n).clone()}),marker:t.marker?new i({placement:t.marker.placement,style:t.marker.style,color:t.marker.color?.clone()??null}):null};return new j(r)}};t([r({type:c,json:{write:!0}})],d.prototype,\"material\",void 0),t([o({Line:\"line\"},{readOnly:!0})],d.prototype,\"type\",void 0),t([r({type:y,json:{write:!0,default:\"miter\"}})],d.prototype,\"join\",void 0),t([r({type:u,json:{write:!0,default:\"butt\"}})],d.prototype,\"cap\",void 0),t([r(m)],d.prototype,\"size\",void 0),t([r(a)],d.prototype,\"pattern\",void 0),t([r({types:{key:\"type\",base:i,typeMap:{style:i}},json:{write:!0}})],d.prototype,\"marker\",void 0),d=j=t([s(\"esri.symbols.LineSymbol3DLayer\")],d);const h=d;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{strict as e}from\"../../core/jsonMap.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as t}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import{r as i,w as c}from\"../../chunks/persistableUrlUtils.js\";var n;const a=e()({sphere:\"sphere\",cylinder:\"cylinder\",cube:\"cube\",cone:\"cone\",diamond:\"diamond\",tetrahedron:\"tetrahedron\",invertedCone:\"inverted-cone\"});let m=n=class extends o{clone(){return new n({href:this.href,primitive:this.primitive})}};r([s({type:String,json:{read:i,write:c}})],m.prototype,\"href\",void 0),r([t(a)],m.prototype,\"primitive\",void 0),m=n=r([p(\"esri.symbols.support.ObjectSymbol3DLayerResource\")],m);const d=\"sphere\";export{m as ObjectSymbol3DLayerResource,d as defaultPrimitive};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";var e;let p=e=class extends o{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new e({x:this.x,y:this.y,z:this.z})}};r([s({type:Number})],p.prototype,\"x\",void 0),r([s({type:Number})],p.prototype,\"y\",void 0),r([s({type:Number})],p.prototype,\"z\",void 0),p=e=r([t(\"esri.symbols.support.Symbol3DAnchorPosition3D\")],p);export{p as Symbol3DAnchorPosition3D};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as e}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as r}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"./Symbol3DLayer.js\";import{ObjectSymbol3DLayerResource as s}from\"./support/ObjectSymbol3DLayerResource.js\";import{Symbol3DAnchorPosition3D as p}from\"./support/Symbol3DAnchorPosition3D.js\";import{Symbol3DMaterial as a}from\"./support/Symbol3DMaterial.js\";var n;let h=n=class extends i{constructor(o){super(o),this.material=null,this.castShadows=!0,this.resource=null,this.type=\"object\",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new n({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition?.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:this.material?.clone()??null,castShadows:this.castShadows,resource:this.resource?.clone(),width:this.width})}get isPrimitive(){return!this.resource||\"string\"!=typeof this.resource.href}};o([t({type:a,json:{write:!0}})],h.prototype,\"material\",void 0),o([t({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],h.prototype,\"castShadows\",void 0),o([t({type:s,json:{write:!0}})],h.prototype,\"resource\",void 0),o([e({Object:\"object\"},{readOnly:!0})],h.prototype,\"type\",void 0),o([t({type:Number,json:{write:!0}})],h.prototype,\"width\",void 0),o([t({type:Number,json:{write:!0}})],h.prototype,\"height\",void 0),o([t({type:Number,json:{write:!0}})],h.prototype,\"depth\",void 0),o([e({center:\"center\",top:\"top\",bottom:\"bottom\",origin:\"origin\",relative:\"relative\"}),t({json:{default:\"origin\"}})],h.prototype,\"anchor\",void 0),o([t({type:p,json:{type:[Number],read:{reader:o=>new p({x:o[0],y:o[1],z:o[2]})},write:{writer:(o,t)=>{t.anchorPosition=[o.x,o.y,o.z]},overridePolicy(){return{enabled:\"relative\"===this.anchor}}}}})],h.prototype,\"anchorPosition\",void 0),o([t({type:Number,json:{write:!0}})],h.prototype,\"heading\",void 0),o([t({type:Number,json:{write:!0}})],h.prototype,\"tilt\",void 0),o([t({type:Number,json:{write:!0}})],h.prototype,\"roll\",void 0),o([t({readOnly:!0})],h.prototype,\"isPrimitive\",null),h=n=o([r(\"esri.symbols.ObjectSymbol3DLayer\")],h);const c=h;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as o}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as r}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import s from\"./Symbol3DLayer.js\";import{Symbol3DMaterial as p}from\"./support/Symbol3DMaterial.js\";import{lineJoins as a,pathCaps as l}from\"./support/symbolLayerUtils3D.js\";var h;let n=h=class extends s{constructor(t){super(t),this.material=null,this.castShadows=!0,this.type=\"path\",this.profile=\"circle\",this.join=\"miter\",this.cap=\"butt\",this.width=void 0,this.height=void 0,this.anchor=\"center\",this.profileRotation=\"all\"}readWidth(t,e){return null!=t?t:null==e.height&&null!=e.size?e.size:void 0}readHeight(t,e){return null!=t?t:null==e.width&&null!=e.size?e.size:void 0}clone(){return new h({enabled:this.enabled,material:null!=this.material?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};t([e({type:p,json:{write:!0}})],n.prototype,\"material\",void 0),t([e({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],n.prototype,\"castShadows\",void 0),t([o({Path:\"path\"},{readOnly:!0})],n.prototype,\"type\",void 0),t([e({type:[\"circle\",\"quad\"],json:{write:!0,default:\"circle\"}})],n.prototype,\"profile\",void 0),t([e({type:a,json:{write:!0,default:\"miter\"}})],n.prototype,\"join\",void 0),t([e({type:l,json:{write:!0,default:\"butt\"}})],n.prototype,\"cap\",void 0),t([e({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],n.prototype,\"width\",void 0),t([r(\"width\",[\"width\",\"size\",\"height\"])],n.prototype,\"readWidth\",null),t([e({type:Number,json:{write:!0}})],n.prototype,\"height\",void 0),t([r(\"height\",[\"height\",\"size\",\"width\"])],n.prototype,\"readHeight\",null),t([e({type:[\"center\",\"bottom\",\"top\"],json:{write:!0,default:\"center\"}})],n.prototype,\"anchor\",void 0),t([e({type:[\"heading\",\"all\"],json:{write:!0,default:\"all\"}})],n.prototype,\"profileRotation\",void 0),n=h=t([i(\"esri.symbols.PathSymbol3DLayer\")],n);const d=n;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{clone as t}from\"../../core/lang.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import{colorAndTransparencyProperty as c,screenSizeProperty as i}from\"./materialUtils.js\";var m;let l=m=class extends s{constructor(){super(...arguments),this.color=new r([0,0,0,1]),this.size=0}clone(){const o={color:t(this.color),size:this.size};return new m(o)}};o([e(c)],l.prototype,\"color\",void 0),o([e(i)],l.prototype,\"size\",void 0),l=m=o([p(\"esri.symbols.support.Symbol3DHalo\")],l);export{l as Symbol3DHalo};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import{colorAndTransparencyProperty as p}from\"./materialUtils.js\";let c=class extends(r(s)){constructor(o){super(o),this.color=null}};o([t(p)],c.prototype,\"color\",void 0),c=o([e(\"esri.symbols.support.Symbol3DTextBackground\")],c);export{c as Symbol3DTextBackground};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{clone as o}from\"../core/lang.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as r}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as n}from\"../core/accessorSupport/decorators/writer.js\";import l from\"./Font.js\";import s from\"./Symbol3DLayer.js\";import{screenSizeProperty as a}from\"./support/materialUtils.js\";import{Symbol3DHalo as p}from\"./support/Symbol3DHalo.js\";import{Symbol3DMaterial as u}from\"./support/Symbol3DMaterial.js\";import{Symbol3DTextBackground as h}from\"./support/Symbol3DTextBackground.js\";import{horizontalAlignmentProperty as c,lineHeightProperty as m,verticalAlignmentProperty as f}from\"./support/textUtils.js\";var g;let y=g=class extends s{constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment=\"center\",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type=\"text\",this.verticalAlignment=\"baseline\"}get font(){return this._get(\"font\")||null}set font(t){null!=t&&null!=this._userSize&&(t.size=this._userSize),this._set(\"font\",t)}writeFont(t,o,e,r){const i={...r,textSymbol3D:!0};o.font=t.write({},i),delete o.font.size}get size(){return null!=this._userSize?this._userSize:null!=this.font?.size?this.font.size:9}set size(t){this._userSize=t,null!=this.font&&(this.font.size=this._userSize),this.notifyChange(\"size\")}clone(){const t=new g({enabled:this.enabled,font:this.font&&o(this.font),halo:this.halo&&o(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:null!=this.material?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:o(this.background)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new g({font:null!=t.font?t.font.clone():new l,halo:d(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new u({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new h({color:t.backgroundColor.clone()}):null})}};function d(t,e){return t&&null!=e&&e>0?new p({color:o(t),size:e}):null}t([e({type:l,json:{write:!0}})],y.prototype,\"font\",null),t([n(\"font\")],y.prototype,\"writeFont\",null),t([e({type:p,json:{write:!0}})],y.prototype,\"halo\",void 0),t([e({...c,json:{default:\"center\",write:!0}})],y.prototype,\"horizontalAlignment\",void 0),t([e({...m,json:{default:1,write:!0}})],y.prototype,\"lineHeight\",void 0),t([e({type:u,json:{write:!0}})],y.prototype,\"material\",void 0),t([e({type:h,json:{write:!0}})],y.prototype,\"background\",void 0),t([e(a)],y.prototype,\"size\",null),t([e({type:String,json:{write:!0}})],y.prototype,\"text\",void 0),t([r({Text:\"text\"},{readOnly:!0})],y.prototype,\"type\",void 0),t([e({...f,json:{default:\"baseline\",write:!0}})],y.prototype,\"verticalAlignment\",void 0),y=g=t([i(\"esri.symbols.TextSymbol3DLayer\")],y);const z=y;export{z as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import o from\"../Color.js\";import{clone as r}from\"../core/lang.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import{Integer as s}from\"../core/accessorSupport/ensureType.js\";import{enumeration as a}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import p from\"./Symbol3DLayer.js\";var l;let c=l=class extends p{constructor(e){super(e),this.color=m.clone(),this.type=\"water\",this.waterbodySize=\"medium\",this.waveDirection=null,this.waveStrength=\"moderate\"}clone(){return new l({color:r(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};e([t({type:o,nonNullable:!0,json:{type:[s],write:(e,r,t)=>r[t]=e.toArray(o.AlphaMode.UNLESS_OPAQUE),default:()=>m.clone(),defaultEquals:e=>e.toCss(!0)===m.toCss(!0)}})],c.prototype,\"color\",void 0),e([a({Water:\"water\"},{readOnly:!0})],c.prototype,\"type\",void 0),e([t({type:[\"small\",\"medium\",\"large\"],json:{write:!0,default:\"medium\"}})],c.prototype,\"waterbodySize\",void 0),e([t({type:Number,json:{write:!0,default:null}})],c.prototype,\"waveDirection\",void 0),e([t({type:[\"calm\",\"rippled\",\"slight\",\"moderate\"],json:{write:!0,default:\"moderate\"}})],c.prototype,\"waveStrength\",void 0),c=l=e([i(\"esri.symbols.WaterSymbol3DLayer\")],c);const m=new o([0,119,190]),n=c;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import r from\"../../core/Accessor.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"../../portal/Portal.js\";var p;let l=p=class extends r{constructor(t){super(t),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new p({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};t([o({type:String})],l.prototype,\"name\",void 0),t([o({type:String})],l.prototype,\"styleUrl\",void 0),t([o({type:String})],l.prototype,\"styleName\",void 0),t([o({type:e})],l.prototype,\"portal\",void 0),l=p=t([s(\"esri.symbols.support.StyleOrigin\")],l);const a=l;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";var t;let p=t=class extends o{constructor(){super(...arguments),this.url=\"\"}clone(){return new t({url:this.url})}};r([s({type:String})],p.prototype,\"url\",void 0),p=t=r([e(\"esri.symbols.support.Thumbnail\")],p);export{p as Thumbnail};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Collection.js\";import{referenceSetter as t,castForReferenceSetter as o}from\"../core/collectionUtils.js\";import s from\"../core/Logger.js\";import{isAbsolute as l,normalize as i,hasSamePortal as a}from\"../core/urlUtils.js\";import m from\"../core/Warning.js\";import{property as y}from\"../core/accessorSupport/decorators/property.js\";import{cast as n}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as p}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as b}from\"../core/accessorSupport/decorators/writer.js\";import u from\"../portal/Portal.js\";import{f,t as d}from\"../chunks/persistableUrlUtils.js\";import g from\"./ExtrudeSymbol3DLayer.js\";import j from\"./FillSymbol3DLayer.js\";import h from\"./IconSymbol3DLayer.js\";import S from\"./LineSymbol3DLayer.js\";import L from\"./ObjectSymbol3DLayer.js\";import O from\"./PathSymbol3DLayer.js\";import U from\"./Symbol.js\";import _ from\"./Symbol3DLayer.js\";import D from\"./TextSymbol3DLayer.js\";import w from\"./WaterSymbol3DLayer.js\";import N from\"./support/StyleOrigin.js\";import{Thumbnail as x}from\"./support/Thumbnail.js\";const v={icon:h,object:L,line:S,path:O,fill:j,extrude:g,text:D,water:w},C=r.ofType({base:_,key:\"type\",typeMap:v,errorContext:\"symbol-layer\"});let T=class extends U{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const t=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,o=t?.type,s=o||r;this._set(\"symbolLayers\",new s)}get color(){return null}set color(e){this.constructed&&s.getLogger(this).error(\"Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.\")}set symbolLayers(e){t(e,this._get(\"symbolLayers\"))}readStyleOrigin(e,r,t){if(e.styleUrl&&e.name){const r=f(e.styleUrl,t);return new N({styleUrl:r,name:e.name})}if(e.styleName&&e.name)return new N({portal:t?.portal||u.getDefault(),styleName:e.styleName,name:e.name});t?.messages&&t.messages.push(new m(\"symbol3d:incomplete-style-origin\",\"Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property\",{context:t,definition:e}))}writeStyleOrigin(e,r,t,o){if(e.styleUrl&&e.name){let t=d(e.styleUrl,o);l(t)&&(t=i(t)),r.styleOrigin={styleUrl:t,name:e.name}}else e.styleName&&e.name&&(e.portal&&o?.portal&&!a(e.portal.restUrl,o.portal.restUrl)?o?.messages&&o.messages.push(new m(\"symbol:cross-portal\",\"The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.\",{symbol:this})):r.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof _||e&&v[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};e([y({json:{read:!1,write:!1}})],T.prototype,\"color\",null),e([y({type:C,nonNullable:!0,json:{write:!0}}),n(o)],T.prototype,\"symbolLayers\",null),e([y({type:N})],T.prototype,\"styleOrigin\",void 0),e([p(\"styleOrigin\")],T.prototype,\"readStyleOrigin\",null),e([b(\"styleOrigin\",{\"styleOrigin.styleUrl\":{type:String},\"styleOrigin.styleName\":{type:String},\"styleOrigin.name\":{type:String}})],T.prototype,\"writeStyleOrigin\",null),e([y({type:x,json:{read:!1}})],T.prototype,\"thumbnail\",void 0),e([y({type:[\"point-3d\",\"line-3d\",\"polygon-3d\",\"mesh-3d\",\"label-3d\"],readOnly:!0})],T.prototype,\"type\",void 0),T=e([c(\"esri.symbols.Symbol3D\")],T);const k=T;export{k as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends r{constructor(o){super(o),this.visible=!0}clone(){}};o([s({type:[\"line\"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],t.prototype,\"type\",void 0),o([s({readOnly:!0})],t.prototype,\"visible\",void 0),t=o([e(\"esri.symbols.callouts.Callout3D\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{clone as t}from\"../../core/lang.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import{colorAndTransparencyProperty as p}from\"../support/materialUtils.js\";var l;let i=l=class extends s{constructor(o){super(o),this.color=new r(\"white\")}clone(){return new l({color:t(this.color)})}};o([e(p)],i.prototype,\"color\",void 0),i=l=o([c(\"esri.symbols.callouts.LineCallout3DBorder\")],i);const m=i;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{clone as e}from\"../../core/lang.js\";import{px2pt as s}from\"../../core/screenUtils.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{enumeration as i}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import l from\"./Callout3D.js\";import c from\"./LineCallout3DBorder.js\";import{colorAndTransparencyProperty as m,screenSizeProperty as n}from\"../support/materialUtils.js\";var a;let u=a=class extends l{constructor(o){super(o),this.type=\"line\",this.color=new r([0,0,0,1]),this.size=s(1),this.border=null}get visible(){return this.size>0&&null!=this.color&&this.color.a>0}clone(){return new a({color:e(this.color),size:this.size,border:e(this.border)})}};o([i({line:\"line\"})],u.prototype,\"type\",void 0),o([t(m)],u.prototype,\"color\",void 0),o([t(n)],u.prototype,\"size\",void 0),o([t({type:c,json:{write:!0}})],u.prototype,\"border\",void 0),o([t({readOnly:!0})],u.prototype,\"visible\",null),u=a=o([p(\"esri.symbols.callouts.LineCallout3D\")],u);const d=u;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"./Callout3D.js\";import n from\"./LineCallout3D.js\";function e(t){if(!t)return!1;const n=t.verticalOffset;return!!n&&!(n.screenLength<=0||null!=n.maxWorldLength&&n.maxWorldLength<=0)}function r(t){if(!t)return!1;if(!t.supportsCallout||!t.supportsCallout())return!1;const n=t.callout;return!!n&&(!!n.visible&&!!e(t))}function o(t){return\"point-3d\"===t.type||\"label-3d\"===t.type}function l(t){return\"center\"===t.horizontalAlignment}const u={types:{key:\"type\",base:t,typeMap:{line:n}},json:{write:!0}};export{u as calloutProperty,o as hasCalloutSupport,r as hasVisibleCallout,e as hasVisibleVerticalOffset,l as textSymbolLayerSupportsVerticalOffset};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import{screenSizeProperty as s}from\"./materialUtils.js\";var n;let p=n=class extends e{constructor(r){super(r),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new n({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};r([o(s)],p.prototype,\"screenLength\",void 0),r([o({type:Number,nonNullable:!0,json:{write:!0,default:0}})],p.prototype,\"minWorldLength\",void 0),r([o({type:Number,json:{write:!0}})],p.prototype,\"maxWorldLength\",void 0),p=n=r([t(\"esri.symbols.support.Symbol3DVerticalOffset\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import o from\"../core/Collection.js\";import{clone as r}from\"../core/lang.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"./Symbol3D.js\";import a from\"./TextSymbol3DLayer.js\";import{hasVisibleCallout as p,hasVisibleVerticalOffset as c,calloutProperty as m}from\"./callouts/calloutUtils.js\";import y from\"./support/Symbol3DVerticalOffset.js\";var n;const u=o.ofType({base:null,key:\"type\",typeMap:{text:a}});let f=n=class extends i{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new u,this.type=\"label-3d\"}supportsCallout(){return!0}hasVisibleCallout(){return p(this)}hasVisibleVerticalOffset(){return c(this)}clone(){return new n({styleOrigin:r(this.styleOrigin),symbolLayers:r(this.symbolLayers),thumbnail:r(this.thumbnail),callout:r(this.callout),verticalOffset:r(this.verticalOffset)})}static fromTextSymbol(t){return new n({symbolLayers:new o([a.fromTextSymbol(t)])})}};t([e({type:y,json:{write:!0}})],f.prototype,\"verticalOffset\",void 0),t([e(m)],f.prototype,\"callout\",void 0),t([e({json:{read:!1,write:!1}})],f.prototype,\"styleOrigin\",void 0),t([e({type:u})],f.prototype,\"symbolLayers\",void 0),t([s({LabelSymbol3D:\"label-3d\"},{readOnly:!0})],f.prototype,\"type\",void 0),f=n=t([l(\"esri.symbols.LabelSymbol3D\")],f);const b=f;export{b as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import e from\"../core/Collection.js\";import{clone as r}from\"../core/lang.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as t}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"./LineSymbol3DLayer.js\";import m from\"./PathSymbol3DLayer.js\";import y from\"./Symbol3D.js\";var l;const n=e.ofType({base:null,key:\"type\",typeMap:{line:i,path:m}}),a=e.ofType({base:null,key:\"type\",typeMap:{line:i,path:m}});let c=l=class extends y{constructor(o){super(o),this.symbolLayers=new n,this.type=\"line-3d\"}clone(){return new l({styleOrigin:r(this.styleOrigin),symbolLayers:r(this.symbolLayers),thumbnail:r(this.thumbnail)})}static fromSimpleLineSymbol(o){return new l({symbolLayers:new e([i.fromSimpleLineSymbol(o)])})}};o([s({type:n,json:{type:a}})],c.prototype,\"symbolLayers\",void 0),o([t({LineSymbol3D:\"line-3d\"},{readOnly:!0})],c.prototype,\"type\",void 0),c=l=o([p(\"esri.symbols.LineSymbol3D\")],c);const b=c;export{b as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{toPt as e}from\"../core/screenUtils.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as r}from\"../core/accessorSupport/decorators/subclass.js\";import o from\"./Symbol.js\";let p=class extends o{constructor(t){super(t),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};t([s({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],p.prototype,\"angle\",void 0),t([s({type:[\"simple-marker\",\"picture-marker\"],readOnly:!0})],p.prototype,\"type\",void 0),t([s({type:Number,cast:e,json:{write:!0}})],p.prototype,\"xoffset\",void 0),t([s({type:Number,cast:e,json:{write:!0}})],p.prototype,\"yoffset\",void 0),t([s({type:Number,cast:t=>\"auto\"===t?t:e(t),json:{write:!0}})],p.prototype,\"size\",void 0),p=t([r(\"esri.symbols.MarkerSymbol\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import r from\"../core/Collection.js\";import{clone as s}from\"../core/lang.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as t}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import m from\"./FillSymbol3DLayer.js\";import p from\"./Symbol3D.js\";var i;const y=r.ofType({base:null,key:\"type\",typeMap:{fill:m}});let a=i=class extends p{constructor(o){super(o),this.symbolLayers=new y,this.type=\"mesh-3d\"}clone(){return new i({styleOrigin:s(this.styleOrigin),symbolLayers:s(this.symbolLayers),thumbnail:s(this.thumbnail)})}static fromSimpleFillSymbol(o){return new i({symbolLayers:new r([m.fromSimpleFillSymbol(o)])})}};o([e({type:y})],a.prototype,\"symbolLayers\",void 0),o([t({MeshSymbol3D:\"mesh-3d\"},{readOnly:!0})],a.prototype,\"type\",void 0),a=i=o([l(\"esri.symbols.MeshSymbol3D\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{makeData as e,isAbsolute as a,join as r,isDataProtocol as t,dataComponents as i}from\"../../core/urlUtils.js\";import{f as n,w as l}from\"../../chunks/persistableUrlUtils.js\";function o(a,r,t){return r.imageData?e({mediaType:r.contentType||\"image/png\",isBase64:!0,data:r.imageData}):s(r.url,t)}function s(e,t){return p(t)&&!a(e)&&t?.layer?.parsedUrl?r(t.layer.parsedUrl.path,\"images\",e):n(e,t)}function u(e,a,r,n){if(t(e)){const t=i(e);if(!t)return;a.contentType=t.mediaType,a.imageData=t.data,r&&r.imageData===a.imageData&&r.url&&l(r.url,a,\"url\",n)}else l(e,a,\"url\",n)}const m={json:{read:{source:[\"imageData\",\"url\"],reader:o},write:{writer(e,a,r,t){u(e,a,this.source,t)}}}},c={readOnly:!0,json:{read:{source:[\"imageData\",\"url\"],reader(e,a,r){const t={};return a.imageData&&(t.imageData=a.imageData),a.contentType&&(t.contentType=a.contentType),a.url&&(t.url=s(a.url,r)),t}}}};function p(e){return!(null==e||\"service\"!==e.origin&&\"portal-item\"!==e.origin||\"feature\"!==e.layer?.type&&\"stream\"!==e.layer?.type)}export{s as read,o as readImageDataOrUrl,c as sourcePropertyDefinition,m as urlPropertyDefinition,u as writeImageDataAndUrl};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{clone as s}from\"../core/lang.js\";import{toPt as o}from\"../core/screenUtils.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as r}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import l from\"./FillSymbol.js\";import{urlPropertyDefinition as p,sourcePropertyDefinition as h}from\"./support/urlUtils.js\";var c;let u=c=class extends l{constructor(...t){super(...t),this.type=\"picture-fill\",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(t,s,e,r){if(t&&\"string\"!=typeof t&&null==t.imageData)return t;const i={};return t&&(i.url=t),s&&(i.outline=s),null!=e&&(i.width=o(e)),null!=r&&(i.height=o(r)),i}clone(){const t=new c({color:s(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return t._set(\"source\",s(this.source)),t}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};t([r({esriPFS:\"picture-fill\"},{readOnly:!0})],u.prototype,\"type\",void 0),t([e(p)],u.prototype,\"url\",void 0),t([e({type:Number,json:{write:!0}})],u.prototype,\"xscale\",void 0),t([e({type:Number,json:{write:!0}})],u.prototype,\"yscale\",void 0),t([e({type:Number,cast:o,json:{write:!0}})],u.prototype,\"width\",void 0),t([e({type:Number,cast:o,json:{write:!0}})],u.prototype,\"height\",void 0),t([e({type:Number,cast:o,json:{write:!0}})],u.prototype,\"xoffset\",void 0),t([e({type:Number,cast:o,json:{write:!0}})],u.prototype,\"yoffset\",void 0),t([e(h)],u.prototype,\"source\",void 0),u=c=t([i(\"esri.symbols.PictureFillSymbol\")],u);const a=u;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{clone as t}from\"../core/lang.js\";import{toPt as e}from\"../core/screenUtils.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as i}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import h from\"./MarkerSymbol.js\";import{urlPropertyDefinition as u,sourcePropertyDefinition as c}from\"./support/urlUtils.js\";var l;let a=l=class extends h{constructor(...r){super(...r),this.color=null,this.type=\"picture-marker\",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(r,t,o){if(r&&\"string\"!=typeof r&&null==r.imageData)return r;const s={};return r&&(s.url=r),null!=t&&(s.width=e(t)),null!=o&&(s.height=e(o)),s}readHeight(r,t){return t.size||r}readWidth(r,t){return t.size||r}clone(){const r=new l({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return r._set(\"source\",t(this.source)),r}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};r([o({json:{write:!1}})],a.prototype,\"color\",void 0),r([s({esriPMS:\"picture-marker\"},{readOnly:!0})],a.prototype,\"type\",void 0),r([o(u)],a.prototype,\"url\",void 0),r([o(c)],a.prototype,\"source\",void 0),r([o({type:Number,cast:e,json:{write:!0}})],a.prototype,\"height\",void 0),r([i(\"height\",[\"height\",\"size\"])],a.prototype,\"readHeight\",null),r([o({type:Number,cast:e,json:{write:!0}})],a.prototype,\"width\",void 0),r([o({json:{write:!1}})],a.prototype,\"size\",void 0),a=l=r([p(\"esri.symbols.PictureMarkerSymbol\")],a);const n=a;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import t from\"../Color.js\";import r from\"../core/Collection.js\";import{clone as e}from\"../core/lang.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as l}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import m from\"./IconSymbol3DLayer.js\";import a from\"./ObjectSymbol3DLayer.js\";import n from\"./Symbol3D.js\";import y from\"./TextSymbol3DLayer.js\";import{hasVisibleCallout as c,hasVisibleVerticalOffset as p,calloutProperty as u}from\"./callouts/calloutUtils.js\";import f from\"./callouts/LineCallout3D.js\";import b from\"./support/Symbol3DVerticalOffset.js\";var S;const h=r.ofType({base:null,key:\"type\",typeMap:{icon:m,object:a,text:y}});let j=S=class extends n{constructor(o){super(o),this.verticalOffset=null,this.callout=null,this.symbolLayers=new h,this.type=\"point-3d\"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const o of this.symbolLayers.items)switch(o.type){case\"icon\":case\"text\":case\"object\":continue;default:return!1}return!0}hasVisibleCallout(){return c(this)}hasVisibleVerticalOffset(){return p(this)}clone(){return new S({verticalOffset:e(this.verticalOffset),callout:e(this.callout),styleOrigin:e(this.styleOrigin),symbolLayers:e(this.symbolLayers),thumbnail:e(this.thumbnail)})}static fromSimpleMarkerSymbol(o){return new S({symbolLayers:new r([m.fromSimpleMarkerSymbol(o)])})}static fromPictureMarkerSymbol(o){return new S({symbolLayers:new r([m.fromPictureMarkerSymbol(o)])})}static fromCIMSymbol(o){const e=o.data?.symbol?.type;if(\"CIMPointSymbol\"!==e)return null;const s=o.data.symbol;return new S(s?.callout?{symbolLayers:new r([m.fromCIMSymbol(o)]),callout:new f({size:.5,color:new t([0,0,0])}),verticalOffset:new b({screenLength:40})}:{symbolLayers:new r([m.fromCIMSymbol(o)])})}static fromTextSymbol(o){return new S({symbolLayers:new r([y.fromTextSymbol(o)])})}};o([s({type:b,json:{write:!0}})],j.prototype,\"verticalOffset\",void 0),o([s(u)],j.prototype,\"callout\",void 0),o([s({type:h,json:{origins:{\"web-scene\":{write:!0}}}})],j.prototype,\"symbolLayers\",void 0),o([l({PointSymbol3D:\"point-3d\"},{readOnly:!0})],j.prototype,\"type\",void 0),j=S=o([i(\"esri.symbols.PointSymbol3D\")],j);const w=j;export{w as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import t from\"./Accessor.js\";import{abortMaybe as o,removeMaybe as e}from\"./maybe.js\";import{eachAlways as n,throwIfAbortError as s,onAbort as l}from\"./promiseUtils.js\";import{property as i}from\"./accessorSupport/decorators/property.js\";import{subclass as u}from\"./accessorSupport/decorators/subclass.js\";function a(r,t,o){return n(r.map(((r,e)=>t.apply(o,[r,e]))))}async function p(r,t,o){return(await n(r.map(((r,e)=>t.apply(o,[r,e]))))).map((r=>r.value))}function c(r){return{ok:!0,value:r}}function h(r){return{ok:!1,error:r}}function m(r){return null!=r&&!0===r.ok?r.value:null}function f(r){return null!=r&&!1===r.ok?r.error:null}async function _(r){if(null==r)return{ok:!1,error:new Error(\"no promise provided\")};try{return c(await r)}catch(t){return h(t)}}async function b(r){try{return c(await r)}catch(t){return s(t),h(t)}}function y(r){if(!0===r.ok)return r.value;throw r.error}function d(r,t){return new v(r,t)}let v=class extends t{get value(){return m(this._result)}get error(){return f(this._result)}get finished(){return null!=this._result}constructor(r,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=o(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:e}=this._abortController;this.promise=r(e),this.promise.then((r=>{this._result=c(r),this._cleanup()}),(r=>{this._result=h(r),this._cleanup()})),this._abortHandle=l(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=e(this._abortHandle),this._abortController=null}};r([i()],v.prototype,\"value\",null),r([i()],v.prototype,\"error\",null),r([i()],v.prototype,\"finished\",null),r([i()],v.prototype,\"promise\",void 0),r([i()],v.prototype,\"_result\",void 0),v=r([u(\"esri.core.asyncUtils.ReactiveTask\")],v);export{y as assertResult,d as createTask,a as forEach,h as makeResultError,c as makeResultOk,p as map,_ as result,f as resultError,b as resultOrAbort,m as resultValue};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{createTask as n}from\"./asyncUtils.js\";import e from\"./Collection.js\";import{isEventTarget as t,on as o}from\"./events.js\";import{handlesGroup as r,destroyHandle as s,makeHandle as i}from\"./handleUtils.js\";import{removeMaybe as c}from\"./maybe.js\";import{isAborted as u,createAbortError as l,onAbort as a,ignoreAbortErrors as f}from\"./promiseUtils.js\";import{watchTracked as m}from\"./accessorSupport/watch.js\";export{autorun}from\"./accessorSupport/trackingUtils.js\";function d(n,e,t={}){return y(n,e,t,L)}function p(n,e,t={}){return y(n,e,t,M)}function y(n,e,t={},o){let r=null;const s=t.once?(n,t)=>{o(n)&&(c(r),e(n,t))}:(n,t)=>{o(n)&&e(n,t)};if(r=m(n,s,t.sync,t.equals),t.initial){const e=n();s(e,e)}return r}function v(n,e,r,s={}){let u=null,l=null,a=null;function f(){u&&l&&(l.remove(),s.onListenerRemove?.(u),u=null,l=null)}function m(n){s.once&&s.once&&c(a),r(n)}const p=d(n,((n,r)=>{f(),t(n)&&(u=n,l=o(n,e,m),s.onListenerAdd?.(n))}),{sync:s.sync,initial:!0});return a=i((()=>{p.remove(),f()})),a}function j(n,e){return h(n,null,e)}function w(n,e){return h(n,M,e)}function h(n,e,t){if(u(t))return Promise.reject(l());const o=n();if(e?.(o))return Promise.resolve(o);let s=null;function i(){s=c(s)}return new Promise(((o,c)=>{s=r([a(t,(()=>{i(),c(l())})),y(n,(n=>{i(),o(n)}),{sync:!1,once:!0},e??L)])}))}function L(n){return!0}function M(n){return!!n}function U(n,e,t={}){let o=!1;const r=d(n,((n,t)=>{o||e(n,t)}),t);return{remove(){r.remove()},pause(){o=!0},resume(){o=!1}}}function g(n,t){const o=new e,r=v(n,\"after-splice\",(({added:n,start:e,deleteCount:r})=>{const s=o.splice(e,r);for(const t of s)t.remove();if(n?.length){const r=n.map(t);o.addMany(r,e)}}),{sync:!0,onListenerRemove:()=>o.drain((n=>n.remove())),onListenerAdd:n=>o.addMany(n.items.map(t))});return o.addHandles(r),o}function x(t,o){const r=new e,i=g(t,(e=>n((async n=>{const t=await o(e,n);if(u(n))throw t.remove(),l();return t})))),c=()=>null,a=async n=>{const e=await n.promise,t=i.indexOf(n);t<0||r.splice(t,1,e)};r.addMany(i.items.map(c));for(const n of i)f(a(n));const m=i.on(\"after-splice\",(({added:n,start:e,deleteCount:t})=>{const o=r.splice(e,t);for(const r of o)r?.remove();if(n?.length){r.addMany(n.map(c),e);for(const e of n)f(a(e))}}));return r.addHandles([s(i),m]),r}const C={sync:!0},P={initial:!0},A={sync:!0,initial:!0};export{P as initial,g as mapCollection,x as mapCollectionAsync,v as on,j as once,U as pausable,C as sync,A as syncAndInitial,d as watch,p as when,w as whenOnce};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import e from\"../core/Collection.js\";import{deprecated as r}from\"../core/deprecate.js\";import{clone as s}from\"../core/lang.js\";import t from\"../core/Logger.js\";import{on as l,sync as y}from\"../core/reactiveUtils.js\";import{property as m}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as a}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import n from\"./ExtrudeSymbol3DLayer.js\";import p from\"./FillSymbol3DLayer.js\";import b from\"./IconSymbol3DLayer.js\";import c from\"./LineSymbol3DLayer.js\";import L from\"./ObjectSymbol3DLayer.js\";import f from\"./Symbol3D.js\";import S from\"./TextSymbol3DLayer.js\";import u from\"./WaterSymbol3DLayer.js\";var d;const j=e.ofType({base:null,key:\"type\",typeMap:{extrude:n,fill:p,icon:b,line:c,object:L,text:S,water:u}});let g=d=class extends f{constructor(o){super(o),this.symbolLayers=new j,this.type=\"polygon-3d\"}initialize(){const o=o=>{\"line\"===o.type&&r(t.getLogger(this),\"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.\",{replacement:\"Use FillSymbol3DLayer.outline instead.\",version:\"4.28\"}),\"text\"===o.type&&r(t.getLogger(this),\"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.\",{replacement:\"Use Labels instead.\",version:\"4.28\"})};for(const e of this.symbolLayers)o(e);this.addHandles(l((()=>this.symbolLayers),\"after-add\",(({item:e})=>o(e)),y))}clone(){return new d({styleOrigin:s(this.styleOrigin),symbolLayers:s(this.symbolLayers),thumbnail:s(this.thumbnail)})}static fromJSON(o){const e=new d;if(e.read(o),2===e.symbolLayers.length&&\"fill\"===e.symbolLayers.at(0).type&&\"line\"===e.symbolLayers.at(1).type){const r=e.symbolLayers.at(0),s=e.symbolLayers.at(1);!s.enabled||o.symbolLayers?.[1]&&!1===o.symbolLayers[1].enable||(r.outline={size:s.size,color:null!=s.material?s.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(o){return new d({symbolLayers:new e([p.fromSimpleFillSymbol(o)])})}};o([m({type:j,json:{write:!0}})],g.prototype,\"symbolLayers\",void 0),o([a({PolygonSymbol3D:\"polygon-3d\"},{readOnly:!0})],g.prototype,\"type\",void 0),g=d=o([i(\"esri.symbols.PolygonSymbol3D\")],g);const h=g;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import r from\"../Color.js\";import{JSONMap as s}from\"../core/jsonMap.js\";import{clone as e}from\"../core/lang.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as i}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import a from\"./FillSymbol.js\";import n from\"./SimpleLineSymbol.js\";var p;const c=new s({esriSFSSolid:\"solid\",esriSFSNull:\"none\",esriSFSHorizontal:\"horizontal\",esriSFSVertical:\"vertical\",esriSFSForwardDiagonal:\"forward-diagonal\",esriSFSBackwardDiagonal:\"backward-diagonal\",esriSFSCross:\"cross\",esriSFSDiagonalCross:\"diagonal-cross\"});let m=p=class extends a{constructor(...o){super(...o),this.color=new r([0,0,0,.25]),this.outline=new n,this.type=\"simple-fill\",this.style=\"solid\"}normalizeCtorArgs(o,r,s){if(o&&\"string\"!=typeof o)return o;const e={};return o&&(e.style=o),r&&(e.outline=r),s&&(e.color=s),e}clone(){return new p({color:e(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};o([t()],m.prototype,\"color\",void 0),o([t()],m.prototype,\"outline\",void 0),o([i({esriSFS:\"simple-fill\"},{readOnly:!0})],m.prototype,\"type\",void 0),o([t({type:c.apiValues,json:{read:c.read,write:c.write}})],m.prototype,\"style\",void 0),m=p=o([l(\"esri.symbols.SimpleFillSymbol\")],m);const S=m;export{S as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import o from\"../Color.js\";import{JSONMap as r}from\"../core/jsonMap.js\";import{clone as t}from\"../core/lang.js\";import{toPt as s}from\"../core/screenUtils.js\";import{property as i}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as l}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as a}from\"../core/accessorSupport/decorators/writer.js\";import n from\"./MarkerSymbol.js\";import c from\"./SimpleLineSymbol.js\";var h;const m=new r({esriSMSCircle:\"circle\",esriSMSSquare:\"square\",esriSMSCross:\"cross\",esriSMSX:\"x\",esriSMSDiamond:\"diamond\",esriSMSTriangle:\"triangle\",esriSMSPath:\"path\"});let u=h=class extends n{constructor(...e){super(...e),this.color=new o([255,255,255,.25]),this.type=\"simple-marker\",this.size=12,this.style=\"circle\",this.outline=new c}normalizeCtorArgs(e,o,r,t){if(e&&\"string\"!=typeof e)return e;const i={};return e&&(i.style=e),null!=o&&(i.size=s(o)),r&&(i.outline=r),t&&(i.color=t),i}writeColor(e,o){e&&\"x\"!==this.style&&\"cross\"!==this.style&&(o.color=e.toJSON()),null===e&&(o.color=null)}set path(e){this.style=\"path\",this._set(\"path\",e)}clone(){return new h({angle:this.angle,color:t(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${this.outline?.hash()}`}};e([i()],u.prototype,\"color\",void 0),e([a(\"color\")],u.prototype,\"writeColor\",null),e([l({esriSMS:\"simple-marker\"},{readOnly:!0})],u.prototype,\"type\",void 0),e([i()],u.prototype,\"size\",void 0),e([i({type:m.apiValues,json:{read:m.read,write:m.write}})],u.prototype,\"style\",void 0),e([i({type:String,json:{write:!0}})],u.prototype,\"path\",null),e([i({types:{key:\"type\",base:null,defaultKeyValue:\"simple-line\",typeMap:{\"simple-line\":c}},json:{default:null,write:!0}})],u.prototype,\"outline\",void 0),u=h=e([p(\"esri.symbols.SimpleMarkerSymbol\")],u);const y=u;export{y as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import o from\"../Color.js\";import{clone as e}from\"../core/lang.js\";import{toPt as i}from\"../core/screenUtils.js\";import{property as r}from\"../core/accessorSupport/decorators/property.js\";import{cast as s}from\"../core/accessorSupport/decorators/cast.js\";import{enumeration as n}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as h}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as l}from\"../core/accessorSupport/decorators/writer.js\";import p from\"./Font.js\";import a from\"./Symbol.js\";import{horizontalAlignmentProperty as d,verticalAlignmentProperty as c,lineHeightProperty as y}from\"./support/textUtils.js\";var f;let g=f=class extends a{constructor(...t){super(...t),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new p,this.horizontalAlignment=\"center\",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text=\"\",this.type=\"text\",this.verticalAlignment=\"baseline\",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(t,o,e){if(t&&\"string\"!=typeof t)return t;const i={};return t&&(i.text=t),o&&(i.font=o),e&&(i.color=e),i}writeLineWidth(t,o,e,i){i&&\"string\"!=typeof i?i.origin:o[e]=t}castLineWidth(t){return i(t)}writeLineHeight(t,o,e,i){i&&\"string\"!=typeof i?i.origin:o[e]=t}clone(){return new f({angle:this.angle,backgroundColor:e(this.backgroundColor),borderLineColor:e(this.borderLineColor),borderLineSize:this.borderLineSize,color:e(this.color),font:this.font&&this.font.clone(),haloColor:e(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};t([r({type:o,json:{write:!0}})],g.prototype,\"backgroundColor\",void 0),t([r({type:o,json:{write:!0}})],g.prototype,\"borderLineColor\",void 0),t([r({type:Number,json:{write:!0},cast:i})],g.prototype,\"borderLineSize\",void 0),t([r({type:p,json:{write:!0}})],g.prototype,\"font\",void 0),t([r({...d,json:{write:!0}})],g.prototype,\"horizontalAlignment\",void 0),t([r({type:Boolean,json:{write:!0}})],g.prototype,\"kerning\",void 0),t([r({type:o,json:{write:!0}})],g.prototype,\"haloColor\",void 0),t([r({type:Number,cast:i,json:{write:!0}})],g.prototype,\"haloSize\",void 0),t([r({type:Boolean,json:{write:!0}})],g.prototype,\"rightToLeft\",void 0),t([r({type:Boolean,json:{write:!0}})],g.prototype,\"rotated\",void 0),t([r({type:String,json:{write:!0}})],g.prototype,\"text\",void 0),t([n({esriTS:\"text\"},{readOnly:!0})],g.prototype,\"type\",void 0),t([r({...c,json:{write:!0}})],g.prototype,\"verticalAlignment\",void 0),t([r({type:Number,cast:i,json:{write:!0}})],g.prototype,\"xoffset\",void 0),t([r({type:Number,cast:i,json:{write:!0}})],g.prototype,\"yoffset\",void 0),t([r({type:Number,json:{read:t=>t&&-1*t,write:(t,o)=>o.angle=t&&-1*t}})],g.prototype,\"angle\",void 0),t([r({type:Number,json:{write:!0}})],g.prototype,\"width\",void 0),t([r({type:Number})],g.prototype,\"lineWidth\",void 0),t([l(\"lineWidth\")],g.prototype,\"writeLineWidth\",null),t([s(\"lineWidth\")],g.prototype,\"castLineWidth\",null),t([r(y)],g.prototype,\"lineHeight\",void 0),t([l(\"lineHeight\")],g.prototype,\"writeLineHeight\",null),g=f=t([h(\"esri.symbols.TextSymbol\")],g);const m=g;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import e from\"../core/Logger.js\";import{throwIfAborted as r}from\"../core/promiseUtils.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"../portal/Portal.js\";import{r as p,w as a}from\"../chunks/persistableUrlUtils.js\";import n from\"./Symbol.js\";import{Thumbnail as c}from\"./support/Thumbnail.js\";var m;let y=m=class extends n{constructor(t){super(t),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type=\"web-style\"}get _fetchCacheKey(){const t=null!=this.portal?this.portal:i.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e?.portal,super.read(t,e)}clone(){return new m({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol(\"webRef\",t)}fetchCIMSymbol(t){return this._fetchSymbol(\"cimRef\",t)}async _fetchSymbol(t,o){const s=null!=o?o.cache:null,l=s?this._fetchCacheKey:null;if(null!=s){const t=l&&s.get(l);if(t)return t.clone()}const{resolveWebStyleSymbol:i}=await import(\"./support/webStyleSymbolUtils.js\");r(o);const p=i(this,{portal:this.portal},t,o);p.catch((t=>{e.getLogger(this).error(\"#fetchSymbol()\",\"Failed to create symbol from style\",t)}));const a=await p;return\"webRef\"===t&&\"point-3d\"===a.type||\"cimRef\"===t&&\"cim\"===a.type?(null!=s&&s.set(l,a.clone()),a):null}};t([o({json:{write:!1}})],y.prototype,\"color\",void 0),t([o({type:String,json:{write:!0}})],y.prototype,\"styleName\",void 0),t([o({type:i,json:{write:!1}})],y.prototype,\"portal\",void 0),t([o({type:String,json:{read:p,write:a}})],y.prototype,\"styleUrl\",void 0),t([o({type:c,json:{read:!1}})],y.prototype,\"thumbnail\",void 0),t([o({type:String,json:{write:!0}})],y.prototype,\"name\",void 0),t([s({styleSymbolReference:\"web-style\"},{readOnly:!0})],y.prototype,\"type\",void 0),t([o()],y.prototype,\"_fetchCacheKey\",null),y=m=t([l(\"esri.symbols.WebStyleSymbol\")],y);const u=y;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ensureOneOfType as e}from\"./core/accessorSupport/ensureType.js\";import{createTypeReader as o}from\"./core/accessorSupport/extensions/serializableProperty/reader.js\";import l from\"./symbols/CIMSymbol.js\";export{default as ExtrudeSymbol3DLayer}from\"./symbols/ExtrudeSymbol3DLayer.js\";export{default as BaseFillSymbol}from\"./symbols/FillSymbol.js\";export{default as FillSymbol3DLayer}from\"./symbols/FillSymbol3DLayer.js\";export{default as Font}from\"./symbols/Font.js\";export{default as IconSymbol3DLayer}from\"./symbols/IconSymbol3DLayer.js\";import s from\"./symbols/LabelSymbol3D.js\";import r from\"./symbols/LineSymbol3D.js\";export{default as LineSymbol3DLayer}from\"./symbols/LineSymbol3DLayer.js\";export{default as BaseMarkerSymbol}from\"./symbols/MarkerSymbol.js\";import m from\"./symbols/MeshSymbol3D.js\";export{default as ObjectSymbol3DLayer}from\"./symbols/ObjectSymbol3DLayer.js\";export{default as PathSymbol3DLayer}from\"./symbols/PathSymbol3DLayer.js\";import t from\"./symbols/PictureFillSymbol.js\";import y from\"./symbols/PictureMarkerSymbol.js\";import a from\"./symbols/PointSymbol3D.js\";import b from\"./symbols/PolygonSymbol3D.js\";import p from\"./symbols/SimpleFillSymbol.js\";import i from\"./symbols/SimpleLineSymbol.js\";import f from\"./symbols/SimpleMarkerSymbol.js\";import n from\"./symbols/Symbol.js\";export{default as BaseSymbol3D}from\"./symbols/Symbol3D.js\";export{default as BaseSymbol3DLayer}from\"./symbols/Symbol3DLayer.js\";import d from\"./symbols/TextSymbol.js\";export{default as TextSymbol3DLayer}from\"./symbols/TextSymbol3DLayer.js\";export{default as WaterSymbol3DLayer}from\"./symbols/WaterSymbol3DLayer.js\";import u from\"./symbols/WebStyleSymbol.js\";export{default as LineCallout3D}from\"./symbols/callouts/LineCallout3D.js\";export{default as LineCallout3DBorder}from\"./symbols/callouts/LineCallout3DBorder.js\";function c(e){return e instanceof n}function S(e){if(!e)return!1;switch(e.type){case\"picture-fill\":case\"picture-marker\":case\"simple-fill\":case\"simple-line\":case\"simple-marker\":case\"text\":case\"cim\":return!0;default:return!1}}function x(e){if(!e)return!1;switch(e.type){case\"label-3d\":case\"line-3d\":case\"mesh-3d\":case\"point-3d\":case\"polygon-3d\":return!0;default:return!1}}const j={base:n,key:\"type\",typeMap:{\"simple-fill\":p,\"picture-fill\":t,\"picture-marker\":y,\"simple-line\":i,\"simple-marker\":f,text:d,\"label-3d\":s,\"line-3d\":r,\"mesh-3d\":m,\"point-3d\":a,\"polygon-3d\":b,\"web-style\":u,cim:l},errorContext:\"symbol\"},D={base:n,key:\"type\",typeMap:{\"picture-marker\":y,\"simple-marker\":f,text:d,\"web-style\":u,cim:l},errorContext:\"symbol\"},L=o({types:j}),k={base:n,key:\"type\",typeMap:{\"simple-fill\":p,\"picture-fill\":t,\"picture-marker\":y,\"simple-line\":i,\"simple-marker\":f,text:d,\"line-3d\":r,\"mesh-3d\":m,\"point-3d\":a,\"polygon-3d\":b,\"web-style\":u,cim:l},errorContext:\"symbol\"},M={base:n,key:\"type\",typeMap:{text:d,\"label-3d\":s},errorContext:\"symbol\"},C={base:n,key:\"type\",typeMap:{\"label-3d\":s,\"line-3d\":r,\"mesh-3d\":m,\"point-3d\":a,\"polygon-3d\":b,\"web-style\":u},errorContext:\"symbol\"},h={base:n,key:\"type\",typeMap:{\"line-3d\":r,\"mesh-3d\":m,\"point-3d\":a,\"polygon-3d\":b,\"web-style\":u,cim:l},errorContext:\"symbol\"},F={base:n,key:\"type\",typeMap:{\"label-3d\":s},errorContext:\"symbol\"},w=e(j);export{n as BaseSymbol,l as CIMSymbol,s as LabelSymbol3D,r as LineSymbol3D,m as MeshSymbol3D,t as PictureFillSymbol,y as PictureMarkerSymbol,a as PointSymbol3D,b as PolygonSymbol3D,p as SimpleFillSymbol,i as SimpleLineSymbol,f as SimpleMarkerSymbol,d as TextSymbol,u as WebStyleSymbol,w as ensureType,c as isSymbol,S as isSymbol2D,x as isSymbol3D,L as readSymbol,j as symbolTypes,C as symbolTypes3D,D as symbolTypesCluster,M as symbolTypesLabel,F as symbolTypesLabel3D,k as symbolTypesRenderer,h as symbolTypesRenderer3D};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"./chunks/tslib.es6.js\";import{geometryTypes as e}from\"./geometry.js\";import r from\"./PopupTemplate.js\";import{symbolTypes as s}from\"./symbols.js\";import{ClonableMixin as o}from\"./core/Clonable.js\";import{isSerializable as i,JSONSupport as a}from\"./core/JSONSupport.js\";import{generateUID as l}from\"./core/uid.js\";import{property as p}from\"./core/accessorSupport/decorators/property.js\";import\"./core/accessorSupport/ensureType.js\";import\"./core/arrayUtils.js\";import\"./core/has.js\";import{subclass as n}from\"./core/accessorSupport/decorators/subclass.js\";import{fromJSON as u}from\"./geometry/support/jsonUtils.js\";var y;function m(t){if(!t)return null;const e={};for(const r in t){const s=u(t[r]);s&&(e[r]=s)}return 0!==Object.keys(e).length?e:null}function g(t){if(null==t)return null;const e={};for(const r in t){const s=t[r];s&&(e[r]=s.toJSON())}return 0!==Object.keys(e).length?e:null}let h=y=class extends(o(a)){constructor(...t){super(...t),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,\"uid\",{value:l(),configurable:!0})}normalizeCtorArgs(t,e,r,s){return t&&!t.declaredClass?t:{geometry:t,symbol:e,attributes:r,popupTemplate:s}}set aggregateGeometries(t){const e=this._get(\"aggregateGeometries\");JSON.stringify(e)!==JSON.stringify(t)&&this._set(\"aggregateGeometries\",t)}set attributes(t){const e=this._get(\"attributes\");e!==t&&(this._set(\"attributes\",t),this._notifyLayer(\"attributes\",e,t))}set geometry(t){const e=this._get(\"geometry\");e!==t&&(this._set(\"geometry\",t),this._notifyLayer(\"geometry\",e,t))}set symbol(t){const e=this._get(\"symbol\");e!==t&&(this._set(\"symbol\",t),this._notifyLayer(\"symbol\",e,t))}set visible(t){const e=this._get(\"visible\");e!==t&&(this._set(\"visible\",t),this._notifyLayer(\"visible\",e,t))}cloneShallow(){return new y({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible})}getEffectivePopupTemplate(t=!1){if(this.popupTemplate)return this.popupTemplate;for(const e of[this.sourceLayer,this.layer])if(e){if(\"popupTemplate\"in e&&e.popupTemplate)return e.popupTemplate;if(t&&\"defaultPopupTemplate\"in e&&null!=e.defaultPopupTemplate)return e.defaultPopupTemplate}return null}getAttribute(t){return this.attributes?.[t]}setAttribute(t,e){if(this.attributes){const r=this.getAttribute(t);this.attributes[t]=e,this._notifyLayer(\"attributes\",r,e,t)}else this.attributes={[t]:e},this._notifyLayer(\"attributes\",void 0,e,t)}getObjectId(){return this.sourceLayer&&\"objectIdField\"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:g(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:i(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyGeometryChanged(){this._notifyLayer(\"geometry\",this.geometry,this.geometry)}notifyMeshTransformChanged(t={}){const{geometry:e}=this;if(\"mesh\"===e?.type){const r={origin:e.origin,transform:e.transform};this._notifyLayer(\"origin-transform\",r,r,t.action)}}_notifyLayer(t,e,r,s){if(!this.layer||!(\"graphicChanged\"in this.layer))return;const o={graphic:this,property:t,oldValue:e,newValue:r};\"origin-transform\"===t&&(o.action=s),\"attributes\"===t&&(o.attributeName=s),this.layer.graphicChanged(o)}};t([p({value:null,json:{read:m}})],h.prototype,\"aggregateGeometries\",null),t([p({value:null})],h.prototype,\"attributes\",null),t([p({value:null,types:e,json:{read:u}})],h.prototype,\"geometry\",null),t([p({type:Boolean})],h.prototype,\"isAggregate\",void 0),t([p({clonable:\"reference\"})],h.prototype,\"layer\",void 0),t([p({type:r})],h.prototype,\"popupTemplate\",void 0),t([p({clonable:\"reference\"})],h.prototype,\"sourceLayer\",void 0),t([p({value:null,types:s})],h.prototype,\"symbol\",null),t([p({type:Boolean,value:!0})],h.prototype,\"visible\",null),h=y=t([n(\"esri.Graphic\")],h),function(t){t.generateUID=l}(h||(h={}));const c=h;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{map as o,result as l}from\"./asyncUtils.js\";import n from\"./Collection.js\";import r from\"./Loadable.js\";async function t(o,l){return await o.load(),a(o,l)}async function a(t,a){const s=[],c=(...o)=>{for(const l of o)null!=l&&(Array.isArray(l)?c(...l):n.isCollection(l)?l.forEach((o=>c(o))):r.isLoadable(l)&&s.push(l))};a(c);let f=null;if(await o(s,(async o=>{const n=await l(i(o)?o.loadAll():o.load());!1!==n.ok||f||(f=n)})),f)throw f.error;return t}function i(o){return\"loadAll\"in o&&\"function\"==typeof o.loadAll}export{t as loadAll,a as loadAllChildren};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import r from\"../core/Accessor.js\";import e from\"../core/Error.js\";import o from\"../core/Logger.js\";import{isAbsolute as s,makeRelative as a}from\"../core/urlUtils.js\";import{property as l}from\"../core/accessorSupport/decorators/property.js\";import{cast as p}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";let n=class extends r{constructor(t){super(t),this.portalItem=null}normalizeCtorArgs(t){return t?.portalItem&&t.path?{...t,path:this._normalizePath(t.path,t.portalItem)}:t}set path(t){null!=t&&s(t)?o.getLogger(this).error(\"portalitemresource:invalid-path\",\"A portal item resource path must be relative\"):this._set(\"path\",t)}_castPath(t){return this._normalizePath(t,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(t=\"json\",r){const o=this.cdnUrl;if(null==o)throw new e(\"portal-item-resource:fetch\",\"Portal item resource does not refer to a valid item or path\");return this.portalItem.portal.request(o,{responseType:t,query:{token:this.portalItem.apiKey},signal:r?.signal})}async update(t,r){const{addOrUpdateResource:e}=await import(\"./support/resourceUtils.js\");return e(this,\"update\",t,r)}hasPath(){return null!=this.path}_normalizePath(t,r){return null==t?t:(t=t.replace(/^\\/+/,\"\"),null!=r&&s(t)&&(t=a(t,r.itemUrl)),t?.replace(/^\\/+/,\"\").replace(/^(\\.\\/)?resources\\//,\"\"))}};t([l()],n.prototype,\"portalItem\",void 0),t([l({type:String,value:null})],n.prototype,\"path\",null),t([p(\"path\")],n.prototype,\"_castPath\",null),t([l({type:String,readOnly:!0})],n.prototype,\"url\",null),t([l({type:String,readOnly:!0})],n.prototype,\"cdnUrl\",null),t([l({type:String,readOnly:!0})],n.prototype,\"itemRelativeUrl\",null),n=t([i(\"esri.portal.PortalItemResource\")],n);const u=n;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import o from\"../core/Accessor.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";let e=class extends o{constructor(r){super(r),this.created=null,this.rating=null}};r([s()],e.prototype,\"created\",void 0),r([s()],e.prototype,\"rating\",void 0),e=r([t(\"esri.portal.PortalRating\")],e);const c=e;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{getAssetUrl as t}from\"../assets.js\";import{id as i}from\"../kernel.js\";import r from\"../core/Error.js\";import{JSONSupportMixin as o}from\"../core/JSONSupport.js\";import{clone as s,fixJson as a}from\"../core/lang.js\";import n from\"../core/Loadable.js\";import{isDataProtocol as l,makeAbsolute as p}from\"../core/urlUtils.js\";import{property as c}from\"../core/accessorSupport/decorators/property.js\";import{ensureClass as d}from\"../core/accessorSupport/ensureType.js\";import{reader as u}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import h from\"../geometry/Extent.js\";import g from\"./Portal.js\";import y from\"./PortalItemResource.js\";import v from\"./PortalRating.js\";var w;const f=new Set([\"Map Service\",\"Feature Service\",\"Feature Collection\",\"Scene Service\",\"Image Service\",\"Stream Service\",\"Vector Tile Service\",\"GeoJson\",\"CSV\",\"KML\",\"WFS\",\"WMTS\",\"WMS\",\"Feed\"]),b=new Set([\"KML\",\"GeoJson\",\"CSV\"]);let k=w=class extends(o(n)){static from(e){return d(w,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return\"Feature Service\"===e||\"Feature Collection\"===e?i=t.includes(\"Table\")?\"Table\":t.includes(\"Route Layer\")?\"Route Layer\":t.includes(\"Markup\")?\"Markup\":\"Feature Layer\":\"Image Service\"===e?i=t.includes(\"Elevation 3D Layer\")?\"Elevation Layer\":t.includes(\"Tiled Imagery\")?\"Tiled Imagery Layer\":\"Imagery Layer\":\"Scene Service\"===e?i=\"Scene Layer\":\"Video Service\"===e?i=\"Video Layer\":\"Scene Package\"===e?i=\"Scene Layer Package\":\"Stream Service\"===e?i=\"Feature Layer\":\"Geoprocessing Service\"===e?i=t.includes(\"Web Tool\")?\"Tool\":\"Geoprocessing Service\":\"Geocoding Service\"===e?i=\"Locator\":\"Geoenrichment Service\"===e?i=\"GeoEnrichment Service\":\"Microsoft Powerpoint\"===e?i=\"Microsoft PowerPoint\":\"GeoJson\"===e?i=\"GeoJSON\":\"Globe Service\"===e?i=\"Globe Layer\":\"Vector Tile Service\"===e?i=\"Tile Layer\":\"netCDF\"===e?i=\"NetCDF\":\"Map Service\"===e?i=t.includes(\"Spatiotemporal\")||!t.includes(\"Hosted Service\")&&!t.includes(\"Tiled\")||t.includes(\"Relational\")?\"Map Image Layer\":\"Tile Layer\":e&&e.toLowerCase().includes(\"add in\")?i=e.replaceAll(/(add in)/gi,\"Add-In\"):\"datastore catalog service\"===e?i=\"Big Data File Share\":\"Compact Tile Package\"===e?i=\"Tile Package (tpkx)\":\"OGCFeatureServer\"===e?i=\"OGC Feature Layer\":\"web mapping application\"===e&&t.includes(\"configurableApp\")?i=\"Instant App\":\"Insights Page\"===e?i=\"Insights Report\":\"Excalibur Imagery Project\"===e&&(i=\"Excalibur Project\"),i}readExtent(e){return e&&e.length?new h(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||\"\",i=this.typeKeywords||[],r=\"esri/images/portal/\",o=\"16\";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1,u=!1;return e.indexOf(\"service\")>0||\"feature collection\"===e||\"kml\"===e||\"wms\"===e||\"wmts\"===e||\"wfs\"===e?(a=i.includes(\"Hosted Service\"),\"feature service\"===e||\"feature collection\"===e||\"kml\"===e||\"wfs\"===e?(n=i.includes(\"Table\"),l=i.includes(\"Route Layer\"),p=i.includes(\"Markup\"),c=i.includes(\"Spatiotemporal\"),d=i.includes(\"UtilityNetwork\"),s=c&&n?\"spatiotemporaltable\":n?\"table\":l?\"routelayer\":p?\"markup\":c?\"spatiotemporal\":a?\"featureshosted\":d?\"utilitynetwork\":\"features\"):s=\"map service\"===e||\"wms\"===e||\"wmts\"===e?a||i.includes(\"Tiled\")||\"wmts\"===e?\"maptiles\":\"mapimages\":\"scene service\"===e?i.includes(\"Line\")?\"sceneweblayerline\":i.includes(\"3DObject\")?\"sceneweblayermultipatch\":i.includes(\"Point\")?\"sceneweblayerpoint\":i.includes(\"IntegratedMesh\")?\"sceneweblayermesh\":i.includes(\"PointCloud\")?\"sceneweblayerpointcloud\":i.includes(\"Polygon\")?\"sceneweblayerpolygon\":i.includes(\"Building\")?\"sceneweblayerbuilding\":i.includes(\"Voxel\")?\"sceneweblayervoxel\":\"sceneweblayer\":\"image service\"===e?i.includes(\"Elevation 3D Layer\")?\"elevationlayer\":i.includes(\"Tiled Imagery\")?\"tiledimagerylayer\":\"imagery\":\"stream service\"===e?\"streamlayer\":\"video service\"===e?i.includes(\"Live Stream\")?\"livestreamvideolayer\":\"videolayer\":\"vector tile service\"===e?\"vectortile\":\"datastore catalog service\"===e?\"datastorecollection\":\"geocoding service\"===e?\"geocodeservice\":\"geoprocessing service\"===e?i.includes(\"Web Tool\")?\"tool\":\"layers\":\"geodata service\"===e?\"geodataservice\":\"3dtiles service\"===e?\"3dtileslayer\":\"layers\"):\"web map\"===e||\"cityengine web scene\"===e?s=\"maps\":\"web scene\"===e?s=i.includes(\"ViewingMode-Local\")?\"webscenelocal\":\"websceneglobal\":\"web mapping application\"===e&&i.includes(\"configurableApp\")?s=\"instantapps\":\"web mapping application\"===e||\"mobile application\"===e||\"application\"===e||\"operation view\"===e||\"desktop application\"===e?s=\"apps\":\"map document\"===e||\"map package\"===e||\"published map\"===e||\"scene document\"===e||\"globe document\"===e||\"basemap package\"===e||\"mobile basemap package\"===e||\"mobile map package\"===e||\"project package\"===e||\"project template\"===e||\"pro map\"===e||\"layout\"===e||\"layer\"===e&&i.includes(\"ArcGIS Pro\")||\"explorer map\"===e&&i.indexOf(\"Explorer Document\")?s=\"mapsgray\":\"service definition\"===e||\"csv\"===e||\"shapefile\"===e||\"cad drawing\"===e||\"geojson\"===e||\"netcdf\"===e||\"administrative report\"===e?s=\"datafiles\":\"explorer add in\"===e||\"desktop add in\"===e||\"windows viewer add in\"===e||\"windows viewer configuration\"===e?s=\"appsgray\":\"360 vr experience\"===e?s=\"360vr\":\"arcgis pro add in\"===e||\"arcgis pro configuration\"===e?s=\"addindesktop\":\"rule package\"===e||\"file geodatabase\"===e||\"sqlite geodatabase\"===e||\"csv collection\"===e||\"kml collection\"===e||\"windows mobile package\"===e||\"map template\"===e||\"desktop application template\"===e||\"gml\"===e||\"arcpad package\"===e||\"code sample\"===e||\"document link\"===e||\"earth configuration\"===e||\"operations dashboard add in\"===e||\"rules package\"===e||\"image\"===e||\"workflow manager package\"===e||\"explorer map\"===e&&i.includes(\"Explorer Mapping Application\")||i.includes(\"Document\")?s=\"datafilesgray\":\"network analysis service\"===e||\"geoprocessing service\"===e||\"geodata service\"===e||\"geometry service\"===e||\"geoprocessing package\"===e||\"locator package\"===e||\"geoprocessing sample\"===e||\"workflow manager service\"===e?s=\"toolsgray\":\"layer\"===e||\"layer package\"===e||\"explorer layer\"===e?s=\"layersgray\":\"scene package\"===e?s=\"scenepackage\":\"3dtiles package\"===e?s=\"3dtileslayerpackage\":\"mobile scene package\"===e?s=\"mobilescenepackage\":\"tile package\"===e||\"compact tile package\"===e?s=\"tilepackage\":\"task file\"===e?s=\"taskfile\":\"report template\"===e?s=\"report-template\":\"statistical data collection\"===e?s=\"statisticaldatacollection\":\"insights workbook\"===e?s=\"workbook\":\"insights model\"===e?s=\"insightsmodel\":\"insights page\"===e?s=\"insightspage\":\"insights theme\"===e?s=\"insightstheme\":\"hub initiative\"===e?s=\"hubinitiative\":\"hubpage\"===e?s=\"hubpage\":\"hub event\"===e?s=\"hubevent\":\"hub site application\"===e?s=\"hubsite\":\"hub project\"===e?s=\"hubproject\":\"relational database connection\"===e?s=\"relationaldatabaseconnection\":\"big data file share\"===e?s=\"datastorecollection\":\"image collection\"===e?s=\"imagecollection\":\"style\"===e?s=\"style\":\"desktop style\"===e?s=\"desktopstyle\":\"dashboard\"===e?s=\"dashboard\":\"raster function template\"===e?s=\"rasterprocessingtemplate\":\"vector tile package\"===e?s=\"vectortilepackage\":\"ortho mapping project\"===e?s=\"orthomappingproject\":\"ortho mapping template\"===e?s=\"orthomappingtemplate\":\"solution\"===e?s=\"solutions\":\"geopackage\"===e?s=\"geopackage\":\"deep learning package\"===e?s=\"deeplearningpackage\":\"real time analytic\"===e?s=\"realtimeanalytics\":\"big data analytic\"===e?s=\"bigdataanalytics\":\"feed\"===e?s=\"feed\":\"excalibur imagery project\"===e?s=\"excaliburimageryproject\":\"notebook\"===e?s=\"notebook\":\"storymap\"===e?s=\"storymap\":\"survey123 add in\"===e?s=\"survey123addin\":\"mission\"===e?s=\"mission\":\"mission report\"===e?s=\"missionreport\":\"mission template\"===e?s=\"missiontemplate\":\"quickcapture project\"===e?s=\"quickcaptureproject\":\"pro report\"===e?s=\"proreport\":\"pro report template\"===e?s=\"proreporttemplate\":\"urban model\"===e?s=\"urbanmodel\":\"web experience\"===e?s=\"experiencebuilder\":\"web experience template\"===e?s=\"webexperiencetemplate\":\"experience builder widget\"===e?s=\"experiencebuilderwidget\":\"experience builder widget package\"===e?s=\"experiencebuilderwidgetpackage\":\"workflow\"===e?s=\"workflow\":\"insights script\"===e?s=\"insightsscript\":\"kernel gateway connection\"===e?s=\"kernelgatewayconnection\":\"hub initiative template\"===e?s=\"hubinitiativetemplate\":\"storymap theme\"===e?s=\"storymaptheme\":\"knowledge graph\"===e?s=\"knowledgegraph\":\"knowledge studio project\"===e?s=\"knowledgestudio\":\"native application\"===e?s=\"nativeapp\":\"native application installer\"===e?s=\"nativeappinstaller\":\"link chart\"===e?s=\"linkchart\":\"investigation\"===e?s=\"investigation\":\"ogcfeatureserver\"===e?s=\"features\":\"pro project\"===e?s=\"proproject\":\"insights workbook package\"===e?s=\"insightsworkbookpackage\":\"apache parquet\"===e?s=\"apacheparquet\":\"notebook code snippets\"===e||\"notebook code snippet library\"===e?s=\"notebookcodesnippets\":\"suitability model\"===e?s=\"suitabilitymodel\":\"esri classifier definition\"===e?s=\"classifierdefinition\":\"esri classification schema\"===e?s=\"classificationschema\":\"insights data engineering workbook\"===e?s=\"dataengineeringworkbook\":\"insights data engineering model\"===e?s=\"dataengineeringmodel\":\"deep learning studio project\"===e?s=\"deeplearningproject\":\"discussion\"===e?s=\"discussion\":\"allsource project\"===e?s=\"allsourceproject\":\"api key\"===e?s=\"apikey\":\"data pipeline\"===e?s=\"datapipelines\":\"group layer\"===e?(u=i.includes(\"Map\"),s=u?\"layergroup2d\":\"layergroup\"):s=\"media layer\"===e?\"onlinemedialayer\":\"form\"===e?i.includes(\"Survey123\")?\"survey\":\"datafilesgray\":\"maps\",s?t(r+s+o+\".png\"):null}get isLayer(){return null!=this.type&&f.has(this.type)}get itemCdnUrl(){let e=this.itemUrl;return e&&i&&!i.findCredential(e)&&(e=i._normalizeAGOLorgDomain(e),e=e.replace(/^https?:\\/\\/www\\.arcgis\\.com/,\"https://cdn.arcgis.com\"),e=e.replace(/^https?:\\/\\/devext\\.arcgis\\.com/,\"https://cdndev.arcgis.com\"),e=e.replace(/^https?:\\/\\/qaext\\.arcgis\\.com/,\"https://cdnqa.arcgis.com\")),e}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=g.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:\"post\",query:{}};return e instanceof v&&(e=e.rating),null==e||isNaN(e)||\"number\"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+\"/addRating\",t),new v({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:s(this.applicationProxies),avgRating:this.avgRating,categories:s(this.categories),created:s(this.created),culture:this.culture,description:this.description,extent:s(this.extent),groupCategories:s(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:s(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:s(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:s(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:s(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus=\"loaded\");const t=new w({sourceJSON:this.sourceJSON}).set(e);return t._set(\"isOrgItem\",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const i of[\"tags\",\"typeKeywords\",\"categories\"])e[i]=e[i]?.join(\", \");const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await this.portal.request(this.itemUrl+\"/deleteRating\",{method:\"post\"})}fetchData(e=\"json\",t){return this.portal.request(this.itemUrl+\"/data\",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+\"/rating\",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new v(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+\"/relatedItems\",{query:{...e,token:this.apiKey},...t},w)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??\"\",{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e?.data,i={method:\"post\"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]=\"\");return i.query.clearEmptyFields=!0,null!=t&&(\"string\"==typeof t?i.query.text=t:\"object\"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new r(\"portal:item-does-not-exist\",\"The item does not exist yet and cannot be updated\"))}async copy(e){if(!this.id)throw new r(\"portal:item-does-not-exist\",\"The item does not exist yet\");await this.load();const{portal:t,itemUrl:i}=this;await t.signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},l={method:\"post\",query:{copyPrivateResources:\"all\"===o,folder:\"string\"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(\",\"),title:n}},{itemId:p}=await t.request(`${i}/copy`,l);return new w({id:p,portal:t})}updateThumbnail(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:\"post\"};if(\"string\"==typeof t)l(t)?r.query={data:t}:r.query={url:p(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=i?e.append(\"file\",t,i):e.append(\"file\",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new r(\"portal:item-does-not-exist\",\"The item does not exist yet and cannot be updated\"))}async fetchResources(e={},t){const{fetchResources:i}=await import(\"./support/resourceUtils.js\");return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResource:r}=await import(\"./support/resourceUtils.js\");return e.portalItem=this,r(e,\"add\",t,i)}async removeResource(e,t){const{removeResource:i}=await import(\"./support/resourceUtils.js\");if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new r(\"removeresource:portal-item-mismatch\",\"The portal item associated with the provided resource does not match the item\");return i(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await import(\"./support/resourceUtils.js\");return t(this,e)}resourceFromPath(e){return new y({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:s(this.categories),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:s(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:s(this.typeKeywords),url:this.url};return a(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error(\"JSON object is already hydrated\");return new w({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)\"tags\"===t&&null!==e[t]&&(e[t]=e[t].join(\", \")),\"typeKeywords\"===t&&null!==e[t]&&(e[t]=e[t].join(\", \")),\"extent\"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([c({type:[\"private\",\"shared\",\"org\",\"public\"]})],k.prototype,\"access\",void 0),e([c()],k.prototype,\"accessInformation\",void 0),e([c({type:String})],k.prototype,\"apiKey\",void 0),e([c({json:{read:{source:\"appProxies\"}}})],k.prototype,\"applicationProxies\",void 0),e([c()],k.prototype,\"avgRating\",void 0),e([c()],k.prototype,\"categories\",void 0),e([c({type:Date})],k.prototype,\"created\",void 0),e([c()],k.prototype,\"culture\",void 0),e([c()],k.prototype,\"description\",void 0),e([c({readOnly:!0})],k.prototype,\"displayName\",null),e([c({type:h})],k.prototype,\"extent\",void 0),e([u(\"extent\")],k.prototype,\"readExtent\",null),e([c()],k.prototype,\"groupCategories\",void 0),e([c({readOnly:!0})],k.prototype,\"iconUrl\",null),e([c()],k.prototype,\"id\",void 0),e([c({readOnly:!0})],k.prototype,\"isLayer\",null),e([c({type:Boolean,readOnly:!0})],k.prototype,\"isOrgItem\",void 0),e([c()],k.prototype,\"itemControl\",void 0),e([c({readOnly:!0})],k.prototype,\"itemPageUrl\",null),e([c({readOnly:!0})],k.prototype,\"itemUrl\",null),e([c()],k.prototype,\"licenseInfo\",void 0),e([c({type:Date})],k.prototype,\"modified\",void 0),e([c()],k.prototype,\"name\",void 0),e([c()],k.prototype,\"numComments\",void 0),e([c()],k.prototype,\"numRatings\",void 0),e([c()],k.prototype,\"numViews\",void 0),e([c()],k.prototype,\"owner\",void 0),e([c()],k.prototype,\"ownerFolder\",void 0),e([c({type:g})],k.prototype,\"portal\",void 0),e([c()],k.prototype,\"screenshots\",void 0),e([c()],k.prototype,\"size\",void 0),e([c()],k.prototype,\"snippet\",void 0),e([c()],k.prototype,\"sourceJSON\",void 0),e([c({type:String})],k.prototype,\"sourceUrl\",void 0),e([c({type:String})],k.prototype,\"spatialReference\",void 0),e([c()],k.prototype,\"tags\",void 0),e([c()],k.prototype,\"thumbnail\",void 0),e([c({readOnly:!0})],k.prototype,\"thumbnailUrl\",null),e([c()],k.prototype,\"title\",void 0),e([c()],k.prototype,\"type\",void 0),e([c()],k.prototype,\"typeKeywords\",void 0),e([c({type:String,json:{read(e,t){if(b.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],k.prototype,\"url\",void 0),e([c({readOnly:!0})],k.prototype,\"userItemUrl\",null),k=w=e([m(\"esri.portal.PortalItem\")],k);const S=k;export{S as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getAssetUrl as e}from\"../assets.js\";import{fetchMessageBundle as r}from\"../intl/messages.js\";async function a(e){if(!e)return;const a=e.includes(\"-vector\")?e.slice(0,e.indexOf(\"-vector\")):e.includes(\"-3d\")?e.slice(0,e.indexOf(\"-3d\")):e,s=await r(\"esri/t9n/basemaps\");return s[e]||s[a]}const s={satellite:{id:\"satellite\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/satellite.jpg\")},baseMapLayers:[{id:\"satellite-base-layer\",url:\"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Imagery\",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:\"hybrid\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/hybrid.jpg\")},baseMapLayers:[{id:\"hybrid-base-layer\",url:\"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Imagery\",showLegend:!1,visibility:!0,opacity:1},{id:\"hybrid-reference-layer\",styleUrl:\"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Hybrid Reference Layer\",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:\"terrain\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/terrain.jpg\")},baseMapLayers:[{id:\"terrain-base-layer\",url:\"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Terrain Base\",showLegend:!1,visibility:!0,opacity:1},{id:\"terrain-reference-layer\",url:\"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Reference Overlay\",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:\"oceans\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/oceans.jpg\")},baseMapLayers:[{id:\"oceans-base-layer\",url:\"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Ocean Base\",showLegend:!1,visibility:!0,opacity:1},{id:\"oceans-reference-layer\",url:\"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Ocean Reference\",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:\"osm\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/osm.jpg\")},baseMapLayers:[{id:\"osm-base-layer\",layerType:\"OpenStreetMap\",title:\"Open Street Map\",showLegend:!1,visibility:!0,opacity:1}]},\"dark-gray-vector\":{id:\"dark-gray-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/dark-gray-vector.jpg\")},baseMapLayers:[{id:\"dark-gray-base-layer\",styleUrl:\"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Dark Gray Base\",visibility:!0,opacity:1},{id:\"dark-gray-reference-layer\",styleUrl:\"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Dark Gray Reference\",isReference:!0,visibility:!0,opacity:1}]},get\"dark-gray\"(){return{...this[\"dark-gray-vector\"],id:\"dark-gray\"}},\"gray-vector\":{id:\"gray-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/gray-vector.jpg\")},baseMapLayers:[{id:\"gray-base-layer\",styleUrl:\"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Light Gray Base\",visibility:!0,opacity:1},{id:\"gray-reference-layer\",styleUrl:\"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Light Gray Reference\",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this[\"gray-vector\"],id:\"gray\"}},\"streets-vector\":{id:\"streets-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/streets-vector.jpg\")},baseMapLayers:[{id:\"streets-vector-base-layer\",styleUrl:\"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"World Streets\",visibility:!0,opacity:1}]},get streets(){return{...this[\"streets-vector\"],id:\"streets\"}},\"topo-vector\":{id:\"topo-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/topo-vector.jpg\")},baseMapLayers:[{id:\"world-hillshade-layer\",url:\"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Hillshade\",showLegend:!1,visibility:!0,opacity:1},{id:\"topo-vector-base-layer\",styleUrl:\"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"World Topo\",visibility:!0,opacity:1}]},get topo(){return{...this[\"topo-vector\"],id:\"topo\"}},\"streets-night-vector\":{id:\"streets-night-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/streets-night.jpg\")},baseMapLayers:[{id:\"streets-night-vector-base-layer\",styleUrl:\"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"World Streets Night\",visibility:!0,opacity:1}]},\"streets-relief-vector\":{id:\"streets-relief-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/streets-relief.jpg\")},baseMapLayers:[{id:\"world-hillshade-layer\",url:\"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\",layerType:\"ArcGISTiledMapServiceLayer\",title:\"World Hillshade\",showLegend:!1,visibility:!0,opacity:1},{id:\"streets-relief-vector-base-layer\",styleUrl:\"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json\",title:\"World Streets Relief\",layerType:\"VectorTileLayer\",visibility:!0,opacity:1}]},\"streets-navigation-vector\":{id:\"streets-navigation-vector\",classic:!0,get thumbnailUrl(){return e(\"esri/images/basemap/streets-navigation.jpg\")},baseMapLayers:[{id:\"streets-navigation-vector-base-layer\",styleUrl:\"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"World Streets Navigation\",visibility:!0,opacity:1}]},\"topo-3d\":{id:\"topo-3d\",is3d:!0,get thumbnailUrl(){return e(\"esri/images/basemap/topo-3d.png\")},baseMapLayers:[{id:\"topo-3d-base-layer\",styleUrl:\"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Topographic\",visibility:!0,opacity:1},{id:\"topo-3d-trees\",title:\"Trees\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer\",itemId:\"f75fef56b2d944fe92ef9f7737b4f953\",layerType:\"ArcGISSceneServiceLayer\"},{id:\"topo-3d-places-and-labels\",title:\"Places and Labels\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer\",itemId:\"a84404ad39c64c328d0596e361ec459b\",layerType:\"ArcGISSceneServiceLayer\"},{id:\"topo-3d-buildings\",title:\"Buildings\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer\",itemId:\"ca0470dbbddb4db28bad74ed39949e25\",layerType:\"ArcGISSceneServiceLayer\"}]},\"navigation-3d\":{id:\"navigation-3d\",is3d:!0,get thumbnailUrl(){return e(\"esri/images/basemap/navigation-3d.jpg\")},baseMapLayers:[{id:\"navigation-3d-base-layer\",styleUrl:\"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Navigation\",visibility:!0,opacity:1},{id:\"navigation-3d-places-and-labels\",title:\"Places and Labels\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer\",itemId:\"a84404ad39c64c328d0596e361ec459b\",layerType:\"ArcGISSceneServiceLayer\"},{id:\"navigation-3d-buildings\",title:\"Buildings\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer\",itemId:\"ca0470dbbddb4db28bad74ed39949e25\",layerType:\"ArcGISSceneServiceLayer\"}]},\"navigation-dark-3d\":{id:\"navigation-dark-3d\",itemId:\"5a1365328b4943f09a54cf5fd1205707\",is3d:!0,baseMapLayers:[{id:\"navigation-dark-3d-base-layer\",styleUrl:\"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json\",layerType:\"VectorTileLayer\",title:\"Navigation Dark\"},{id:\"navigation-dark-3d-places-and-labels\",title:\"Places and Labels\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0\",itemId:\"f364b70b012a4da5a4b5921e193eac4a\",layerType:\"ArcGISSceneServiceLayer\"},{id:\"navigation-dark-3d-buildings\",title:\"Buildings\",url:\"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer\",itemId:\"ca0470dbbddb4db28bad74ed39949e25\",layerType:\"ArcGISSceneServiceLayer\"}]},\"arcgis-imagery\":{get thumbnailUrl(){return e(\"esri/images/basemap/hybrid.jpg\")},title:\"Imagery Hybrid\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Imagery\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels\",title:\"Hybrid Reference Layer\",isReference:!0}]},\"arcgis-imagery-standard\":{get thumbnailUrl(){return e(\"esri/images/basemap/satellite.jpg\")},title:\"Imagery\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Imagery\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer\"}]},\"arcgis-imagery-labels\":{title:\"Hybrid [Reference]\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels\",title:\"Hybrid Reference Layer\",isReference:!0}]},\"arcgis-light-gray\":{get thumbnailUrl(){return e(\"esri/images/basemap/gray-vector.jpg\")},title:\"Light Gray Canvas\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base\",title:\"Light Gray Canvas Base\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels\",title:\"Light Gray Canvas Labels\",isReference:!0}]},\"arcgis-dark-gray\":{get thumbnailUrl(){return e(\"esri/images/basemap/dark-gray.jpg\")},title:\"Dark Gray Canvas\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base\",title:\"Dark Gray Canvas Base\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels\",title:\"Dark Gray Canvas Labels\",isReference:!0}]},\"arcgis-navigation\":{get thumbnailUrl(){return e(\"esri/images/basemap/streets-navigation.jpg\")},title:\"Navigation\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation\",title:\"World Navigation Map\"}]},\"arcgis-navigation-night\":{title:\"Navigation (Dark Mode)\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight\",title:\"World Navigation Map (Dark Mode)\"}]},\"arcgis-streets\":{get thumbnailUrl(){return e(\"esri/images/basemap/streets-vector.jpg\")},title:\"Streets\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets\",title:\"World Street Map\"}]},\"arcgis-streets-night\":{get thumbnailUrl(){return e(\"esri/images/basemap/streets-night.jpg\")},title:\"Streets (Night)\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight\",title:\"World Street Map (Night)\"}]},\"arcgis-streets-relief\":{get thumbnailUrl(){return e(\"esri/images/basemap/streets-relief.jpg\")},title:\"Streets (with Relief)\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base\",title:\"World Street Map (with Relief)\"}]},\"arcgis-topographic\":{get thumbnailUrl(){return e(\"esri/images/basemap/topo.jpg\")},title:\"Topographic\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base\",title:\"World Topographic Map\"}]},\"arcgis-oceans\":{get thumbnailUrl(){return e(\"esri/images/basemap/oceans.jpg\")},title:\"Oceans\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Ocean Base\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels\",title:\"World Ocean Reference\",isReference:!0}]},\"osm-standard\":{title:\"OpenStreetMap\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard\",title:\"OpenStreetMap\"}]},\"osm-standard-relief\":{title:\"OpenStreetMap (with relief)\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base\",layerType:\"VectorTileLayer\",title:\"OpenStreetMap Relief Base\"}]},\"osm-streets\":{title:\"OpenStreetMap (Streets)\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets\",title:\"OpenStreetMap (Streets)\"}]},\"osm-streets-relief\":{title:\"OpenStreetMap (Streets with relief)\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base\",layerType:\"VectorTileLayer\",title:\"OpenStreetMap Relief Base\"}]},\"osm-light-gray\":{title:\"OpenStreetMap (Light Gray Canvas)\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base\",title:\"OSM (Light Gray Base)\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels\",title:\"OSM (Light Gray Reference)\",isReference:!0}]},\"osm-dark-gray\":{title:\"OpenStreetMap (Dark Gray Canvas)\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base\",title:\"OSM (Dark Gray Base)\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels\",title:\"OSM (Dark Gray Reference)\",isReference:!0}]},\"arcgis-terrain\":{title:\"Terrain with Labels\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base\",title:\"World Terrain Base\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail\",title:\"World Terrain Reference\",isReference:!0}]},\"arcgis-community\":{title:\"Community\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community\",title:\"Community\"}]},\"arcgis-charted-territory\":{title:\"Charted Territory\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base\",title:\"Charted Territory\"}]},\"arcgis-colored-pencil\":{title:\"Colored Pencil\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil\",title:\"Colored Pencil\"}]},\"arcgis-nova\":{title:\"Nova\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova\",title:\"Nova\"}]},\"arcgis-modern-antique\":{title:\"Modern Antique\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base\",title:\"Modern Antique\"}]},\"arcgis-midcentury\":{title:\"Mid-Century\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury\",title:\"Mid-Century\"}]},\"arcgis-newspaper\":{title:\"Newspaper\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper\",title:\"Newspaper\"}]},\"arcgis-hillshade-light\":{title:\"Hillshade\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer\"}]},\"arcgis-hillshade-dark\":{title:\"Hillshade (Dark)\",baseMapLayers:[{layerType:\"ArcGISTiledMapServiceLayer\",showLegend:!1,title:\"World Hillshade (Dark)\",url:\"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer\"}]},\"arcgis-human-geography\":{title:\"Human Geography\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base\",title:\"Human Geography Base\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail\",title:\"Human Geography Detail\",isReference:!0},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label\",title:\"Human Geography Label\",isReference:!0}]},\"arcgis-human-geography-dark\":{title:\"Human Geography (Dark)\",baseMapLayers:[{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base\",title:\"Human Geography Dark Base\"},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail\",title:\"Human Geography Dark Detail\",isReference:!0},{layerType:\"VectorTileLayer\",styleUrl:\"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label\",title:\"Human Geography Dark Label\",isReference:!0}]}};export{s as esriBasemapDefinitions,a as getBasemapTitle};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import s from\"../core/Accessor.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import{getLocale as o,getLanguage as a}from\"../intl/locale.js\";const c=new Set([\"ar\",\"bs\",\"ca\",\"hr\",\"cs\",\"da\",\"nl\",\"en\",\"et\",\"fi\",\"fr\",\"de\",\"el\",\"he\",\"hu\",\"id\",\"it\",\"ja\",\"ko\",\"lv\",\"lt\",\"nb\",\"pl\",\"ro\",\"ru\",\"sr\",\"es\",\"sv\",\"th\",\"tr\",\"uk\",\"vi\"]);let p=class extends s{constructor(r){super(r),this.id=null,this.language=null,this.serviceUrl=\"https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps\"}getLanguageParamValue(){if(this.language)return this.language;const r=o().toLowerCase();switch(r){case\"pt-br\":return\"pt-BR\";case\"pt-pt\":return\"pt-PT\";case\"zh-cn\":return\"zh-CN\";case\"zh-hk\":return\"zh-HK\";case\"zh-tw\":return\"zh-TW\"}const s=a(r);return\"pt\"===s?\"pt-BR\":s&&c.has(s)?s:\"global\"}};r([e()],p.prototype,\"id\",void 0),r([e()],p.prototype,\"language\",void 0),r([e()],p.prototype,\"serviceUrl\",void 0),p=r([t(\"esri.support.BasemapStyle\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{id as e}from\"../../kernel.js\";import t from\"../../request.js\";function n(e){return c(e)||a(e)}function r(e){return null!=e&&\"object\"==typeof e&&\"type\"in e&&\"feature\"===e.type}function i(e){return null!=e&&\"object\"==typeof e&&\"type\"in e&&\"graphics\"===e.type}function u(e){return null!=e&&\"object\"==typeof e&&\"type\"in e&&\"map-notes\"===e.type&&\"sublayers\"in e}function s(e){return null!=e&&\"object\"==typeof e&&\"type\"in e&&\"knowledge-graph\"===e.type&&\"layers\"in e}function a(e){return\"scene\"===e?.type}function o(e){return null!=e&&\"object\"==typeof e&&\"type\"in e&&\"subtype-group\"===e.type&&\"sublayers\"in e}function c(e){const t=e?.type;return\"imagery-tile\"===t||\"tile\"===t||\"open-street-map\"===t||\"vector-tile\"===t||\"web-tile\"===t||\"wmts\"===t}function l(e){const t=e?.type;return\"base-tile\"===t||\"tile\"===t||\"elevation\"===t||\"imagery-tile\"===t||\"base-elevation\"===t||\"open-street-map\"===t||\"wcs\"===t||\"web-tile\"===t||\"wmts\"===t||\"vector-tile\"===t}function f(e){return null!=e&&\"type\"in e&&\"group\"===e.type}const p={Point:\"SceneLayer\",\"3DObject\":\"SceneLayer\",IntegratedMesh:\"IntegratedMeshLayer\",PointCloud:\"PointCloudLayer\",Building:\"BuildingSceneLayer\"};function y(e){const t=e?.type;return\"building-scene\"===t||\"integrated-mesh\"===t||\"point-cloud\"===t||\"scene\"===t}function g(e){return\"voxel\"===e?.type}function b(e){return\"imagery-tile\"===e?.type}function d(e){return null!=e?.parent&&\"declaredClass\"in e.parent&&\"esri.Basemap\"===e.parent.declaredClass&&e.parent.baseLayers.includes(e)}function m(e){return\"feature\"===e?.type&&!e.url&&\"memory\"===e.source?.type}function h(e){return(\"feature\"===e?.type||\"subtype-group\"===e?.type)&&\"feature-layer\"===e.source?.type}function v(e){return\"feature\"===e?.type&&\"feature-layer\"===e.source?.type}function j(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+\":\"+e[1])})),e=t.join(\";\")}return e}return null}function w(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('\"'+n+'\":'+JSON.stringify(e))})),t.length?\"{\"+t.join(\",\")+\"}\":void 0}function E(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function L(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf(\"/rest/services\");if(-1===u)return null;const s=`${n.substring(0,u)}/rest/info`,a=null!=r?r.signal:null,{data:o}=await t(s,{query:{f:\"json\"},responseType:\"json\",signal:a});return o?.owningSystemUrl||null}function S(e){if(!(\"capabilities\"in e))return!1;switch(e.type){case\"csv\":case\"feature\":case\"geojson\":case\"imagery\":case\"knowledge-graph-sublayer\":case\"ogc-feature\":case\"oriented-imagery\":case\"scene\":case\"subtype-group\":case\"subtype-sublayer\":case\"wfs\":return!0;default:return!1}}function C(e){return null!=e&&\"object\"==typeof e&&\"isTable\"in e&&!!e.isTable}function x(e){return S(e)?\"effectiveCapabilities\"in e?e.effectiveCapabilities:e.capabilities:null}function M(e){if(!(\"editingEnabled\"in e))return!1;switch(e.type){case\"csv\":case\"feature\":case\"geojson\":case\"oriented-imagery\":case\"scene\":case\"subtype-group\":case\"subtype-sublayer\":return!0;default:return!1}}function O(e){return!!M(e)&&(\"effectiveEditingEnabled\"in e?e.effectiveEditingEnabled:e.editingEnabled)}export{O as getEffectiveEditingEnabled,x as getEffectiveLayerCapabilities,L as getOwningPortalUrl,E as getTileMaxtrixSetFromActiveLayer,d as isBaseLayer,n as isBasemap3DSupportedLayer,c as isBasemapSupportedTiledLayer,m as isFeatureCollectionLayer,r as isFeatureLayer,v as isFeatureServiceLayer,i as isGraphicsLayer,f as isGroupLayer,b as isImageryTileLayer,s as isKnowledgeGraphLayer,h as isLayerWithFeatureLayerSource,u as isMapNotesLayer,a as isSceneLayer,y as isSceneServiceLayer,o as isSubtypeGroupLayer,C as isTable,l as isTiledLayer,g as isVoxelLayer,p as sceneServiceLayerTypeToClassName,j as serializeLayerDefinitions,w as serializeTimeOptions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import{clone as t}from\"../../core/lang.js\";import{getDeepValue as n}from\"../../core/object.js\";import{numberToJSON as r}from\"../../core/accessorSupport/extensions/serializableProperty/writer.js\";import{isFeatureCollectionLayer as i}from\"../../layers/support/layerUtils.js\";const o=new Set([\"bing-maps\",\"imagery\",\"imagery-tile\",\"map-image\",\"open-street-map\",\"tile\",\"unknown\",\"unsupported\",\"vector-tile\",\"web-tile\",\"wms\",\"wmts\"]),l=new Set([\"csv\",\"feature\",\"geo-rss\",\"geojson\",\"group\",\"imagery\",\"imagery-tile\",\"kml\",\"map-image\",\"map-notes\",\"media\",\"ogc-feature\",\"oriented-imagery\",\"route\",\"stream\",\"subtype-group\",\"tile\",\"unknown\",\"unsupported\",\"vector-tile\",\"web-tile\",\"wfs\",\"wms\",\"wmts\"]);function a(e){o.delete(e),l.delete(e)}function s(e){o.add(e),l.add(e)}function u(e){return\"basemap\"===e.layerContainerType?o:\"operational-layers\"===e.layerContainerType?l:null}function d(e,t){if(t.restrictedWebMapWriting){const n=u(t);return null==n||n.has(e.type)&&!i(e)}return!0}function p(e,t){if(t)if(i(e)){const r=n(\"featureCollection.layers\",t),i=r?.[0]?.layerDefinition;i&&m(e,i)}else\"group\"!==e.type&&m(e,t)}function m(e,t){\"maxScale\"in e&&(t.maxScale=r(e.maxScale)??void 0),\"minScale\"in e&&(t.minScale=r(e.minScale)??void 0)}function c(e,t){if(p(e,t),t&&(t.id=e.id,\"blendMode\"in e&&(t.blendMode=e.blendMode,\"normal\"===t.blendMode&&delete t.blendMode),t.opacity=r(e.opacity)??void 0,t.title=e.title||\"Layer\",t.visibility=e.visible,\"legendEnabled\"in e&&\"wmts\"!==e.type))if(i(e)){const n=t.featureCollection;n&&(n.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function f(n,r,o){if(!n.persistenceEnabled)return null;if(!(\"write\"in n)||!n.write)return o?.messages&&o.messages.push(new e(\"layer:unsupported\",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted`,{layer:n})),null;if(i(n)&&!n.isTable)r=n.resourceInfo;else if(d(n,o)){const e={};return n.write(e,o)?e:null}return null!=r&&c(n,r=t(r)),r}export{s as disableRestrictedWriting,a as enableRestrictedWriting,f as getLayerJSON};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"./chunks/tslib.es6.js\";import r from\"./request.js\";import t from\"./core/Collection.js\";import{referenceSetter as s}from\"./core/collectionUtils.js\";import{JSONSupportMixin as a}from\"./core/JSONSupport.js\";import{isClonable as o,clone as i}from\"./core/lang.js\";import n from\"./core/Loadable.js\";import{loadAll as l}from\"./core/loadAll.js\";import p from\"./core/Logger.js\";import{destroyMaybe as c}from\"./core/maybe.js\";import{throwIfAborted as m}from\"./core/promiseUtils.js\";import{isProtocolRelative as y,urlToObject as u}from\"./core/urlUtils.js\";import{property as h}from\"./core/accessorSupport/decorators/property.js\";import\"./core/accessorSupport/ensureType.js\";import{subclass as d}from\"./core/accessorSupport/decorators/subclass.js\";import{writer as f}from\"./core/accessorSupport/decorators/writer.js\";import b from\"./geometry/SpatialReference.js\";import L from\"./portal/Portal.js\";import w from\"./portal/PortalItem.js\";import{getBasemapTitle as g,esriBasemapDefinitions as I}from\"./support/basemapDefinitions.js\";import S from\"./support/BasemapStyle.js\";import{getLayerJSON as j}from\"./webdoc/support/writeUtils.js\";var _;let v=0;const M=\"esri.Basemap\";let U=_=class extends(a(n)){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title=\"Basemap\",this.id=Date.now().toString(16)+\"-basemap-\"+v++,this.baseLayers=new t,this.referenceLayers=new t;const r=e=>{e.parent&&e.parent!==this&&\"remove\"in e.parent&&e.parent.remove(e),e.parent=this,\"elevation\"===e.type&&p.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=e=>{e.parent=null};this.addHandles([this.baseLayers.on(\"after-add\",(e=>r(e.item))),this.referenceLayers.on(\"after-add\",(e=>r(e.item))),this.baseLayers.on(\"after-remove\",(e=>s(e.item))),this.referenceLayers.on(\"after-remove\",(e=>s(e.item)))])}initialize(){this.when().catch((e=>{p.getLogger(this).error(\"#load()\",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)})),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const t of e)t.destroy();const r=this.referenceLayers.toArray();for(const t of r)t.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=c(this.portalItem)}normalizeCtorArgs(e){return e&&\"resourceInfo\"in e&&(this._set(\"resourceInfo\",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set(\"baseLayers\",s(e,this._get(\"baseLayers\")))}_writeBaseLayers(e,r,t){const s=[];e?(t={...t,layerContainerType:\"basemap\"},this.baseLayers.forEach((e=>{const r=j(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&s.push(r)})),this.referenceLayers.forEach((e=>{const r=j(e,t.webmap?t.webmap.getLayerJSONFromResourceInfo(e):null,t);null!=r&&(\"scene\"!==e.type&&(r.isReference=!0),s.push(r))})),r.baseMapLayers=s):r.baseMapLayers=s}set referenceLayers(e){this._set(\"referenceLayers\",s(e,this._get(\"referenceLayers\")))}writeTitle(e,r){r.title=e||\"Basemap\"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return l(this,(e=>{e(this.baseLayers,this.referenceLayers)}))}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map((e=>o(e)?e.clone():e)),referenceLayers:this.referenceLayers.map((e=>o(e)?e.clone():e))};return this.loaded&&(e.loadStatus=\"loaded\"),new _({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set(\"resourceInfo\",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:\"web-map\",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map((e=>{const r=i(e);return r.url&&y(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&y(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r}))),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:t,style:s}=this;m(e);const a=[];if(r){const t=r.context?r.context.url:null;if(a.push(this._loadLayersFromJSON(r.data,t,e)),r.data.id&&!r.data.title){const e=r.data.id;a.push(g(e).then((e=>{e&&this.read({title:e},r.context)})))}}else t?a.push(this._loadFromItem(t,e)):s&&a.push(this._loadFromStylesService(s,e));await Promise.all(a)}async _loadLayersFromJSON(e,r,t){const s=this.resourceInfo?.context,a=this.portalItem?.portal||s?.portal||null,o=F[s?.origin||\"\"]??\"web-map\",{populateOperationalLayers:i}=await import(\"./layers/support/layersCreator.js\"),n=[];if(m(t),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const t={context:{...s,origin:o,url:r,portal:a,layerContainerType:\"basemap\"},defaultLayerType:\"DefaultTileLayer\"},l=e=>\"web-scene\"===o&&\"ArcGISSceneServiceLayer\"===e.layerType||e.isReference,p=i(this.baseLayers,e.baseMapLayers.filter((e=>!l(e))),t);n.push(p);const c=i(this.referenceLayers,e.baseMapLayers.filter(l),t);n.push(c)}await Promise.allSettled(n)}async _loadFromItem(e,r){const t=await e.load(r),s=await t.fetchData(\"json\",r),a=u(e.itemUrl??\"\");return this._set(\"resourceInfo\",{data:s.baseMap??{},context:{origin:x[e.type||\"\"]??\"web-map\",portal:e.portal||L.getDefault(),url:a}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:\"portal-item\",portal:e.portal||L.getDefault(),url:a}),this._loadLayersFromJSON(this.resourceInfo.data,a,r)}async _loadFromStylesService(e,t){const s=`${e.serviceUrl}/${e.id}`,a=(await r(s,{query:{language:e.getLanguageParamValue()},signal:t?.signal})).data;if(a.baseMap&&Array.isArray(a.baseMap.baseMapLayers))for(const r of a.baseMap.baseMapLayers)if(!r.customParameters&&r.styleUrl?.includes(\"?\")){const e=u(r.styleUrl);e.query&&(r.styleUrl=e.path,r.customParameters=e.query)}const o=u(s);return this._set(\"resourceInfo\",{data:a.baseMap??{},context:{origin:\"web-map\",url:o}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this._loadLayersFromJSON(this.resourceInfo.data,o,t)}static fromId(e){const r=I[e];return r?r.itemId?new _({portalItem:{id:r.itemId,portal:{url:\"https://www.arcgis.com\"}}}):_.fromJSON(r,{origin:r.is3d?\"web-scene\":\"web-map\"}):null}};e([h({json:{write:{ignoreOrigin:!0,target:\"baseMapLayers\",writer(e,r,t,s){this._writeBaseLayers(e,r,s)}},origins:{\"web-scene\":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:t}},writer(e,r,t,s){this._writeBaseLayers(e,r,s)}}}}}})],U.prototype,\"baseLayers\",null),e([h({type:String,json:{origins:{\"web-scene\":{write:!0}}}})],U.prototype,\"id\",void 0),e([h({type:w})],U.prototype,\"portalItem\",void 0),e([h()],U.prototype,\"referenceLayers\",null),e([h({readOnly:!0})],U.prototype,\"resourceInfo\",void 0),e([h({type:b})],U.prototype,\"spatialReference\",void 0),e([h({type:S})],U.prototype,\"style\",void 0),e([h()],U.prototype,\"thumbnailUrl\",void 0),e([h({type:String,json:{origins:{\"web-scene\":{write:{isRequired:!0}}}}})],U.prototype,\"title\",void 0),e([f(\"title\")],U.prototype,\"writeTitle\",null),U=_=e([d(M)],U);const x={\"Web Scene\":\"web-scene\",\"Web Map\":\"web-map\",\"Link Chart\":\"link-chart\"},F={\"web-scene\":\"web-scene\",\"web-map\":\"web-map\",\"link-chart\":\"link-chart\"},R=U;export{R as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"./has.js\";function n(n){}function t(n){}function o(n){return()=>n}export{n as neverReached,t as neverReachedSilent,o as typeCast};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../core/JSONSupport.js\";import\"../core/Logger.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import\"../core/Error.js\";import{enumeration as e}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";var t;let p=t=class extends o{constructor(r){super(r),this.type=\"none\"}clone(){return new t({type:this.type})}};r([e({none:\"none\",stayAbove:\"stay-above\"})],p.prototype,\"type\",void 0),p=t=r([s(\"esri.ground.NavigationConstraint\")],p);export{p as NavigationConstraint};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"./chunks/tslib.es6.js\";import e from\"./Color.js\";import o from\"./core/Collection.js\";import{referenceSetter as t}from\"./core/collectionUtils.js\";import{typeCast as s}from\"./core/compilerUtils.js\";import a from\"./core/Error.js\";import{JSONSupportMixin as i}from\"./core/JSONSupport.js\";import{clone as n}from\"./core/lang.js\";import l from\"./core/Loadable.js\";import{loadAll as p}from\"./core/loadAll.js\";import c from\"./core/Logger.js\";import{destroyMaybe as y}from\"./core/maybe.js\";import{isAbortError as u,throwIfAborted as d}from\"./core/promiseUtils.js\";import{property as m}from\"./core/accessorSupport/decorators/property.js\";import{Integer as f}from\"./core/accessorSupport/ensureType.js\";import{subclass as h}from\"./core/accessorSupport/decorators/subclass.js\";import{writer as g}from\"./core/accessorSupport/decorators/writer.js\";import{NavigationConstraint as v}from\"./ground/NavigationConstraint.js\";import{transparencyToOpacity as j,opacityToTransparency as w}from\"./webdoc/support/opacityUtils.js\";var S;let C=S=class extends(i(l)){constructor(r){super(r),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new o;const e=r=>{r.parent&&r.parent!==this&&\"remove\"in r.parent&&r.parent.remove(r),r.parent=this,\"elevation\"!==r.type&&\"base-elevation\"!==r.type&&c.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},t=r=>{r.parent=null};this.addHandles([this.layers.on(\"after-add\",(r=>e(r.item))),this.layers.on(\"after-remove\",(r=>t(r.item)))])}initialize(){this.when().catch((r=>{u(r)||c.getLogger(this).error(\"#load()\",\"Failed to load ground\",r)})),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const r=this.layers.removeAll();for(const e of r)y(e);this.layers.destroy()}normalizeCtorArgs(r){return r&&\"resourceInfo\"in r&&(this._set(\"resourceInfo\",r.resourceInfo),delete(r={...r}).resourceInfo),r}set layers(r){this._set(\"layers\",t(r,this._get(\"layers\")))}writeLayers(r,e,o,t){const i=[];r?(t={...t,layerContainerType:\"ground\"},r.forEach((r=>{if(\"write\"in r){const e={};s(r)().write(e,t)&&i.push(e)}else t?.messages&&t.messages.push(new a(\"layer:unsupported\",`Layers (${r.title}, ${r.id}) of type '${r.declaredClass}' cannot be persisted in the ground`,{layer:r}))})),e.layers=i):e.layers=i}load(r){return this.addResolvingPromise(this._loadFromSource(r)),Promise.resolve(this)}loadAll(){return p(this,(r=>{r(this.layers)}))}async queryElevation(r,e){await this.load({signal:e?.signal});const{ElevationQuery:o}=await import(\"./layers/support/ElevationQuery.js\");d(e);const t=new o,s=this.layers.filter(L).toArray();return t.queryAll(s,r,e)}async createElevationSampler(r,e){await this.load({signal:e?.signal});const{ElevationQuery:o}=await import(\"./layers/support/ElevationQuery.js\");d(e);const t=new o,s=this.layers.filter(L).toArray();return t.createSamplerAll(s,r,e)}clone(){const r={opacity:this.opacity,surfaceColor:n(this.surfaceColor),navigationConstraint:n(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(r.loadStatus=\"loaded\"),new S({resourceInfo:this.resourceInfo}).set(r)}read(r,e){this.resourceInfo||this._set(\"resourceInfo\",{data:r,context:e}),super.read(r,e)}_loadFromSource(r){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,r):Promise.resolve()}async _loadLayersFromJSON(r,e,o){const t=e?.origin||\"web-scene\",s=e?.portal||null,a=e?.url||null,{populateOperationalLayers:i}=await import(\"./layers/support/layersCreator.js\");d(o);const n=[];if(r.layers&&Array.isArray(r.layers)){const e={context:{origin:t,url:a,portal:s,layerContainerType:\"ground\"},defaultLayerType:\"ArcGISTiledElevationServiceLayer\"};n.push(i(this.layers,r.layers,e))}await Promise.allSettled(n)}};function I(r){return r&&\"createElevationSampler\"in r}function L(r){return\"elevation\"===r.type||I(r)}r([m({json:{read:!1}})],C.prototype,\"layers\",null),r([g(\"layers\")],C.prototype,\"writeLayers\",null),r([m({readOnly:!0})],C.prototype,\"resourceInfo\",void 0),r([m({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:f,read:{reader:j,source:\"transparency\"},write:{writer:(r,e)=>{e.transparency=w(r)},target:\"transparency\"}}})],C.prototype,\"opacity\",void 0),r([m({type:e,json:{type:[f],write:(r,e)=>{e.surfaceColor=r.toJSON().slice(0,3)}}})],C.prototype,\"surfaceColor\",void 0),r([m({type:v,json:{write:!0}})],C.prototype,\"navigationConstraint\",void 0),C=S=r([h(\"esri.Ground\")],C);const b=C;export{b as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import o from\"./Collection.js\";import\"./asyncUtils.js\";import\"./Error.js\";import\"./Logger.js\";import\"./accessorSupport/watch.js\";import{autorun as s}from\"./accessorSupport/trackingUtils.js\";import{property as e}from\"./accessorSupport/decorators/property.js\";import{subclass as r}from\"./accessorSupport/decorators/subclass.js\";let i=class extends o{constructor(t){super(t),this.getCollections=null}initialize(){this.addHandles(s((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const t=null!=this.getCollections?this.getCollections():null;if(null==t)return void this.removeAll();let o=0;for(const s of t)null!=s&&(o=this._processCollection(o,s));this.splice(o,this.length)}_createNewInstance(t){return new o(t)}_processCollection(t,o){if(!o)return t;const s=this.itemFilterFunction??(t=>!!t);for(const e of o)if(e){if(s(e)){const o=this.indexOf(e,t);o>=0?o!==t&&this.reorder(e,t):this.add(e,t),++t}if(this.getChildrenFunction){const o=this.getChildrenFunction(e);if(Array.isArray(o))for(const s of o)t=this._processCollection(t,s);else t=this._processCollection(t,o)}}return t}};t([e()],i.prototype,\"getCollections\",void 0),t([e()],i.prototype,\"getChildrenFunction\",void 0),t([e()],i.prototype,\"itemFilterFunction\",void 0),i=t([r(\"esri.core.CollectionFlattener\")],i);const l=i;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n=[[\"binary\",\"application/octet-stream\",\"bin\",\"\"]];function t(n,t){return null!=d(t.name,n?.supportedFormats??[])}function r(n,t){if(!n)return!1;const r=c(t,n.supportedFormats??[]);return null!=r&&n.editFormats.includes(r)}function o(n){return a(n?.supportedFormats??[]).flatMap(w).map((n=>`.${n}`))}function e(n){const t={};for(const r of a(n?.supportedFormats??[])){const[n,o]=l(r).split(\";\"),e=n.trim().toLowerCase(),u=w(r).map((n=>`.${n}`));t[e]??=[],t[e].push(...u)}return{description:\"3D Models\",accept:t}}function u(n,t){return m(p(n,t))}function i(n,t){return m(d(n,t))}function s(n,t){return l(f(n,t))}function c(n,t){return i(n.name,t)??u(n.type,t)}function a(t){return[...n,...t]}function f(n,t){return a(t).find((t=>m(t)===n))}function p(n,t){const r=n.toLowerCase();return a(t).find((n=>l(n)===r))}function d(n,t){const r=n.toLowerCase();return a(t).find((n=>w(n).some((n=>r.endsWith(n)))))}function m(n){return n?.[0]}function l(n){return n?.[1].toLowerCase()}function w(n){return n?.[2].split(\",\").map((n=>n.toLowerCase()))??[]}function C(n){return n?.[3]}function F(n){return n.tables?.find((n=>\"assetMaps\"===n.role))}export{F as getAssetMapTable,c as getFileFormatId,e as getFilePickerAcceptType,i as getFilenameFormatId,C as getFormatDescription,w as getFormatExtensions,m as getFormatId,s as getFormatIdMimeType,l as getFormatMimeType,u as getMimeTypeFormatId,o as getSupportedExtensions,r as isFileEditFormat,t as isFileSupported};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Logger.js\";import{equals as r}from\"../../geometry/support/spatialReferenceUtils.js\";import{getMimeTypeFormatId as t,getFilenameFormatId as i}from\"./infoFor3D.js\";import{getEffectiveLayerCapabilities as s,getEffectiveEditingEnabled as a}from\"./layerUtils.js\";function o(e){return!(!(e&&\"object\"==typeof e&&\"loaded\"in e&&e.loaded&&s(e)?.operations?.supportsEditing&&\"type\"in e)||\"editingEnabled\"in e&&!a(e)||\"scene\"===e.type&&!n(e))}function n(s){const{associatedLayer:a}=s,o=a?.infoFor3D;if(!!!o)return!0;const{supportedFormats:n,queryFormats:l}=o,d=t(\"model/gltf-binary\",n)??i(\"glb\",n);if(!(null!=d&&l.includes(d)))return e.getLogger(\"esri.layers.support.editableLayers\").warnOnce(`SceneLayer (${s.title??\"Untitled layer\"}, ${s.id}) is not editable because it does not support GLB queries.`),!1;const c=s.spatialReference,p=a.spatialReference;if(!r(c,p))return e.getLogger(\"esri.layers.support.editableLayers\").warnOnce(`SceneLayer (${s.title??\"Untitled layer\"}, ${s.id}) is not editable because its spatial reference (wkid:${c.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${p.wkid}).`),!1;const f=a.sourceJSON.sourceSpatialReference;return!(null!=f&&!r(f,p))||(e.getLogger(\"esri.layers.support.editableLayers\").warnOnce(`SceneLayer (${s.title??\"Untitled layer\"}, ${s.id}) is not editable because the spatial reference of its associated FeatureLayer's service (wkid:${p.wkid}) is different from its source spatial reference (wkid:${f.wkid}).`),!1)}export{o as isEditableLayer};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(){const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function r(e){const r=new Float32Array(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function t(e,r,t,n,o,a,c,u,l,s,f,i,y,w,b,A){const F=new Float32Array(16);return F[0]=e,F[1]=r,F[2]=t,F[3]=n,F[4]=o,F[5]=a,F[6]=c,F[7]=u,F[8]=l,F[9]=s,F[10]=f,F[11]=i,F[12]=y,F[13]=w,F[14]=b,F[15]=A,F}function n(e,r){return new Float32Array(e,r,16)}const o=e(),a=Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:r,create:e,createView:n,fromValues:t},Symbol.toStringTag,{value:\"Module\"}));export{o as I,r as a,n as b,e as c,t as f,a as m};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{c as t}from\"./vec3f64.js\";import{g as a}from\"./common.js\";function n(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}function s(t,a,n,s,r,o,e,h,u,M,c,i,f,b,l,m,x){return t[0]=a,t[1]=n,t[2]=s,t[3]=r,t[4]=o,t[5]=e,t[6]=h,t[7]=u,t[8]=M,t[9]=c,t[10]=i,t[11]=f,t[12]=b,t[13]=l,t[14]=m,t[15]=x,t}function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function o(t,a){if(t===a){const n=a[1],s=a[2],r=a[3],o=a[6],e=a[7],h=a[11];t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=n,t[6]=a[9],t[7]=a[13],t[8]=s,t[9]=o,t[11]=a[14],t[12]=r,t[13]=e,t[14]=h}else t[0]=a[0],t[1]=a[4],t[2]=a[8],t[3]=a[12],t[4]=a[1],t[5]=a[5],t[6]=a[9],t[7]=a[13],t[8]=a[2],t[9]=a[6],t[10]=a[10],t[11]=a[14],t[12]=a[3],t[13]=a[7],t[14]=a[11],t[15]=a[15];return t}function e(t,a){return h(t,a)||r(t),t}function h(t,a){const n=a[0],s=a[1],r=a[2],o=a[3],e=a[4],h=a[5],u=a[6],M=a[7],c=a[8],i=a[9],f=a[10],b=a[11],l=a[12],m=a[13],x=a[14],q=a[15],d=n*h-s*e,g=n*u-r*e,p=n*M-o*e,y=s*u-r*h,R=s*M-o*h,S=r*M-o*u,v=c*m-i*l,T=c*x-f*l,I=c*q-b*l,O=i*x-f*m,j=i*q-b*m,P=f*q-b*x;let D=d*P-g*j+p*O+y*I-R*T+S*v;return D?(D=1/D,t[0]=(h*P-u*j+M*O)*D,t[1]=(r*j-s*P-o*O)*D,t[2]=(m*S-x*R+q*y)*D,t[3]=(f*R-i*S-b*y)*D,t[4]=(u*I-e*P-M*T)*D,t[5]=(n*P-r*I+o*T)*D,t[6]=(x*p-l*S-q*g)*D,t[7]=(c*S-f*p+b*g)*D,t[8]=(e*j-h*I+M*v)*D,t[9]=(s*I-n*j-o*v)*D,t[10]=(l*R-m*p+q*d)*D,t[11]=(i*p-c*R-b*d)*D,t[12]=(h*T-e*O-u*v)*D,t[13]=(n*O-s*T+r*v)*D,t[14]=(m*g-l*y-x*d)*D,t[15]=(c*y-i*g+f*d)*D,t):null}function u(t,a){const n=a[0],s=a[1],r=a[2],o=a[3],e=a[4],h=a[5],u=a[6],M=a[7],c=a[8],i=a[9],f=a[10],b=a[11],l=a[12],m=a[13],x=a[14],q=a[15];return t[0]=h*(f*q-b*x)-i*(u*q-M*x)+m*(u*b-M*f),t[1]=-(s*(f*q-b*x)-i*(r*q-o*x)+m*(r*b-o*f)),t[2]=s*(u*q-M*x)-h*(r*q-o*x)+m*(r*M-o*u),t[3]=-(s*(u*b-M*f)-h*(r*b-o*f)+i*(r*M-o*u)),t[4]=-(e*(f*q-b*x)-c*(u*q-M*x)+l*(u*b-M*f)),t[5]=n*(f*q-b*x)-c*(r*q-o*x)+l*(r*b-o*f),t[6]=-(n*(u*q-M*x)-e*(r*q-o*x)+l*(r*M-o*u)),t[7]=n*(u*b-M*f)-e*(r*b-o*f)+c*(r*M-o*u),t[8]=e*(i*q-b*m)-c*(h*q-M*m)+l*(h*b-M*i),t[9]=-(n*(i*q-b*m)-c*(s*q-o*m)+l*(s*b-o*i)),t[10]=n*(h*q-M*m)-e*(s*q-o*m)+l*(s*M-o*h),t[11]=-(n*(h*b-M*i)-e*(s*b-o*i)+c*(s*M-o*h)),t[12]=-(e*(i*x-f*m)-c*(h*x-u*m)+l*(h*f-u*i)),t[13]=n*(i*x-f*m)-c*(s*x-r*m)+l*(s*f-r*i),t[14]=-(n*(h*x-u*m)-e*(s*x-r*m)+l*(s*u-r*h)),t[15]=n*(h*f-u*i)-e*(s*f-r*i)+c*(s*u-r*h),t}function M(t){const a=t[0],n=t[1],s=t[2],r=t[3],o=t[4],e=t[5],h=t[6],u=t[7],M=t[8],c=t[9],i=t[10],f=t[11],b=t[12],l=t[13],m=t[14],x=t[15];return(a*e-n*o)*(i*x-f*m)-(a*h-s*o)*(c*x-f*l)+(a*u-r*o)*(c*m-i*l)+(n*h-s*e)*(M*x-f*b)-(n*u-r*e)*(M*m-i*b)+(s*u-r*h)*(M*l-c*b)}function c(t,a,n){const s=a[0],r=a[1],o=a[2],e=a[3],h=a[4],u=a[5],M=a[6],c=a[7],i=a[8],f=a[9],b=a[10],l=a[11],m=a[12],x=a[13],q=a[14],d=a[15];let g=n[0],p=n[1],y=n[2],R=n[3];return t[0]=g*s+p*h+y*i+R*m,t[1]=g*r+p*u+y*f+R*x,t[2]=g*o+p*M+y*b+R*q,t[3]=g*e+p*c+y*l+R*d,g=n[4],p=n[5],y=n[6],R=n[7],t[4]=g*s+p*h+y*i+R*m,t[5]=g*r+p*u+y*f+R*x,t[6]=g*o+p*M+y*b+R*q,t[7]=g*e+p*c+y*l+R*d,g=n[8],p=n[9],y=n[10],R=n[11],t[8]=g*s+p*h+y*i+R*m,t[9]=g*r+p*u+y*f+R*x,t[10]=g*o+p*M+y*b+R*q,t[11]=g*e+p*c+y*l+R*d,g=n[12],p=n[13],y=n[14],R=n[15],t[12]=g*s+p*h+y*i+R*m,t[13]=g*r+p*u+y*f+R*x,t[14]=g*o+p*M+y*b+R*q,t[15]=g*e+p*c+y*l+R*d,t}function i(t,a,n){const s=n[0],r=n[1],o=n[2];if(a===t)t[12]=a[0]*s+a[4]*r+a[8]*o+a[12],t[13]=a[1]*s+a[5]*r+a[9]*o+a[13],t[14]=a[2]*s+a[6]*r+a[10]*o+a[14],t[15]=a[3]*s+a[7]*r+a[11]*o+a[15];else{const n=a[0],e=a[1],h=a[2],u=a[3],M=a[4],c=a[5],i=a[6],f=a[7],b=a[8],l=a[9],m=a[10],x=a[11];t[0]=n,t[1]=e,t[2]=h,t[3]=u,t[4]=M,t[5]=c,t[6]=i,t[7]=f,t[8]=b,t[9]=l,t[10]=m,t[11]=x,t[12]=n*s+M*r+b*o+a[12],t[13]=e*s+c*r+l*o+a[13],t[14]=h*s+i*r+m*o+a[14],t[15]=u*s+f*r+x*o+a[15]}return t}function f(t,a,n){const s=n[0],r=n[1],o=n[2];return t[0]=a[0]*s,t[1]=a[1]*s,t[2]=a[2]*s,t[3]=a[3]*s,t[4]=a[4]*r,t[5]=a[5]*r,t[6]=a[6]*r,t[7]=a[7]*r,t[8]=a[8]*o,t[9]=a[9]*o,t[10]=a[10]*o,t[11]=a[11]*o,t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}function b(t,n,s,r){let o,e,h,u,M,c,i,f,b,l,m,x,q,d,g,p,y,R,S,v,T,I,O,j,P=r[0],D=r[1],A=r[2],_=Math.sqrt(P*P+D*D+A*A);return _0?(n[0]=2*(h*e+c*s+u*o-M*r)/i,n[1]=2*(u*e+c*r+M*s-h*o)/i,n[2]=2*(M*e+c*o+h*r-u*s)/i):(n[0]=2*(h*e+c*s+u*o-M*r),n[1]=2*(u*e+c*r+M*s-h*o),n[2]=2*(M*e+c*o+h*r-u*s)),S(t,a,n),t}const T=t();function I(t,a){return t[0]=a[12],t[1]=a[13],t[2]=a[14],t}function O(t,a){const n=a[0],s=a[1],r=a[2],o=a[4],e=a[5],h=a[6],u=a[8],M=a[9],c=a[10];return t[0]=Math.sqrt(n*n+s*s+r*r),t[1]=Math.sqrt(o*o+e*e+h*h),t[2]=Math.sqrt(u*u+M*M+c*c),t}function j(t,a){const n=a[0]+a[5]+a[10];let s=0;return n>0?(s=2*Math.sqrt(n+1),t[3]=.25*s,t[0]=(a[6]-a[9])/s,t[1]=(a[8]-a[2])/s,t[2]=(a[1]-a[4])/s):a[0]>a[5]&&a[0]>a[10]?(s=2*Math.sqrt(1+a[0]-a[5]-a[10]),t[3]=(a[6]-a[9])/s,t[0]=.25*s,t[1]=(a[1]+a[4])/s,t[2]=(a[8]+a[2])/s):a[5]>a[10]?(s=2*Math.sqrt(1+a[5]-a[0]-a[10]),t[3]=(a[8]-a[2])/s,t[0]=(a[1]+a[4])/s,t[1]=.25*s,t[2]=(a[6]+a[9])/s):(s=2*Math.sqrt(1+a[10]-a[0]-a[5]),t[3]=(a[1]-a[4])/s,t[0]=(a[8]+a[2])/s,t[1]=(a[6]+a[9])/s,t[2]=.25*s),t}function P(t,a,n,s){const r=a[0],o=a[1],e=a[2],h=a[3],u=r+r,M=o+o,c=e+e,i=r*u,f=r*M,b=r*c,l=o*M,m=o*c,x=e*c,q=h*u,d=h*M,g=h*c,p=s[0],y=s[1],R=s[2];return t[0]=(1-(l+x))*p,t[1]=(f+g)*p,t[2]=(b-d)*p,t[3]=0,t[4]=(f-g)*y,t[5]=(1-(i+x))*y,t[6]=(m+q)*y,t[7]=0,t[8]=(b+d)*R,t[9]=(m-q)*R,t[10]=(1-(i+l))*R,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function D(t,a,n,s,r){const o=a[0],e=a[1],h=a[2],u=a[3],M=o+o,c=e+e,i=h+h,f=o*M,b=o*c,l=o*i,m=e*c,x=e*i,q=h*i,d=u*M,g=u*c,p=u*i,y=s[0],R=s[1],S=s[2],v=r[0],T=r[1],I=r[2],O=(1-(m+q))*y,j=(b+p)*y,P=(l-g)*y,D=(b-p)*R,A=(1-(f+q))*R,_=(x+d)*R,w=(l+g)*S,F=(x-d)*S,Q=(1-(f+m))*S;return t[0]=O,t[1]=j,t[2]=P,t[3]=0,t[4]=D,t[5]=A,t[6]=_,t[7]=0,t[8]=w,t[9]=F,t[10]=Q,t[11]=0,t[12]=n[0]+v-(O*v+D*T+w*I),t[13]=n[1]+T-(j*v+A*T+F*I),t[14]=n[2]+I-(P*v+_*T+Q*I),t[15]=1,t}function A(t,a){const n=a[0],s=a[1],r=a[2],o=a[3],e=n+n,h=s+s,u=r+r,M=n*e,c=s*e,i=s*h,f=r*e,b=r*h,l=r*u,m=o*e,x=o*h,q=o*u;return t[0]=1-i-l,t[1]=c+q,t[2]=f-x,t[3]=0,t[4]=c-q,t[5]=1-M-l,t[6]=b+m,t[7]=0,t[8]=f+x,t[9]=b-m,t[10]=1-M-i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _(t,a,n,s,r,o,e){const h=1/(n-a),u=1/(r-s),M=1/(o-e);return t[0]=2*o*h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+a)*h,t[9]=(r+s)*u,t[10]=(e+o)*M,t[11]=-1,t[12]=0,t[13]=0,t[14]=e*o*2*M,t[15]=0,t}function w(t,a,n,s,r){const o=1/Math.tan(a/2);let e;return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(e=1/(s-r),t[10]=(r+s)*e,t[14]=2*r*s*e):(t[10]=-1,t[14]=-2*s),t}function F(t,a,n,s){const r=Math.tan(a.upDegrees*Math.PI/180),o=Math.tan(a.downDegrees*Math.PI/180),e=Math.tan(a.leftDegrees*Math.PI/180),h=Math.tan(a.rightDegrees*Math.PI/180),u=2/(e+h),M=2/(r+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=M,t[6]=0,t[7]=0,t[8]=-(e-h)*u*.5,t[9]=(r-o)*M*.5,t[10]=s/(n-s),t[11]=-1,t[12]=0,t[13]=0,t[14]=s*n/(n-s),t[15]=0,t}function Q(t,a,n,s,r,o,e){const h=1/(a-n),u=1/(s-r),M=1/(o-e);return t[0]=-2*h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*M,t[11]=0,t[12]=(a+n)*h,t[13]=(r+s)*u,t[14]=(e+o)*M,t[15]=1,t}function k(t,n,s,o){const e=n[0],h=n[1],u=n[2];let M=e-s[0],c=h-s[1],i=u-s[2];const f=a();if(Math.abs(M)0&&(b=1/Math.sqrt(b),c*=b,i*=b,f*=b);let l=u*f-M*i,m=M*c-h*f,x=h*i-u*c;return b=l*l+m*m+x*x,b>0&&(b=1/Math.sqrt(b),l*=b,m*=b,x*=b),t[0]=l,t[1]=m,t[2]=x,t[3]=0,t[4]=i*x-f*m,t[5]=f*l-c*x,t[6]=c*m-i*l,t[7]=0,t[8]=c,t[9]=i,t[10]=f,t[11]=0,t[12]=r,t[13]=o,t[14]=e,t[15]=1,t}function E(t){return\"mat4(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\", \"+t[6]+\", \"+t[7]+\", \"+t[8]+\", \"+t[9]+\", \"+t[10]+\", \"+t[11]+\", \"+t[12]+\", \"+t[13]+\", \"+t[14]+\", \"+t[15]+\")\"}function N(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)}function V(t,a,n){return t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t[3]=a[3]+n[3],t[4]=a[4]+n[4],t[5]=a[5]+n[5],t[6]=a[6]+n[6],t[7]=a[7]+n[7],t[8]=a[8]+n[8],t[9]=a[9]+n[9],t[10]=a[10]+n[10],t[11]=a[11]+n[11],t[12]=a[12]+n[12],t[13]=a[13]+n[13],t[14]=a[14]+n[14],t[15]=a[15]+n[15],t}function X(t,a,n){return t[0]=a[0]-n[0],t[1]=a[1]-n[1],t[2]=a[2]-n[2],t[3]=a[3]-n[3],t[4]=a[4]-n[4],t[5]=a[5]-n[5],t[6]=a[6]-n[6],t[7]=a[7]-n[7],t[8]=a[8]-n[8],t[9]=a[9]-n[9],t[10]=a[10]-n[10],t[11]=a[11]-n[11],t[12]=a[12]-n[12],t[13]=a[13]-n[13],t[14]=a[14]-n[14],t[15]=a[15]-n[15],t}function Y(t,a,n){return t[0]=a[0]*n,t[1]=a[1]*n,t[2]=a[2]*n,t[3]=a[3]*n,t[4]=a[4]*n,t[5]=a[5]*n,t[6]=a[6]*n,t[7]=a[7]*n,t[8]=a[8]*n,t[9]=a[9]*n,t[10]=a[10]*n,t[11]=a[11]*n,t[12]=a[12]*n,t[13]=a[13]*n,t[14]=a[14]*n,t[15]=a[15]*n,t}function Z(t,a,n,s){return t[0]=a[0]+n[0]*s,t[1]=a[1]+n[1]*s,t[2]=a[2]+n[2]*s,t[3]=a[3]+n[3]*s,t[4]=a[4]+n[4]*s,t[5]=a[5]+n[5]*s,t[6]=a[6]+n[6]*s,t[7]=a[7]+n[7]*s,t[8]=a[8]+n[8]*s,t[9]=a[9]+n[9]*s,t[10]=a[10]+n[10]*s,t[11]=a[11]+n[11]*s,t[12]=a[12]+n[12]*s,t[13]=a[13]+n[13]*s,t[14]=a[14]+n[14]*s,t[15]=a[15]+n[15]*s,t}function B(t,a){return t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]&&t[6]===a[6]&&t[7]===a[7]&&t[8]===a[8]&&t[9]===a[9]&&t[10]===a[10]&&t[11]===a[11]&&t[12]===a[12]&&t[13]===a[13]&&t[14]===a[14]&&t[15]===a[15]}function C(t,n){if(t===n)return!0;const s=t[0],r=t[1],o=t[2],e=t[3],h=t[4],u=t[5],M=t[6],c=t[7],i=t[8],f=t[9],b=t[10],l=t[11],m=t[12],x=t[13],q=t[14],d=t[15],g=n[0],p=n[1],y=n[2],R=n[3],S=n[4],v=n[5],T=n[6],I=n[7],O=n[8],j=n[9],P=n[10],D=n[11],A=n[12],_=n[13],w=n[14],F=n[15],Q=a();return Math.abs(s-g)<=Q*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(r-p)<=Q*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(o-y)<=Q*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(e-R)<=Q*Math.max(1,Math.abs(e),Math.abs(R))&&Math.abs(h-S)<=Q*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-v)<=Q*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(M-T)<=Q*Math.max(1,Math.abs(M),Math.abs(T))&&Math.abs(c-I)<=Q*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(i-O)<=Q*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(f-j)<=Q*Math.max(1,Math.abs(f),Math.abs(j))&&Math.abs(b-P)<=Q*Math.max(1,Math.abs(b),Math.abs(P))&&Math.abs(l-D)<=Q*Math.max(1,Math.abs(l),Math.abs(D))&&Math.abs(m-A)<=Q*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(x-_)<=Q*Math.max(1,Math.abs(x),Math.abs(_))&&Math.abs(q-w)<=Q*Math.max(1,Math.abs(q),Math.abs(w))&&Math.abs(d-F)<=Q*Math.max(1,Math.abs(d),Math.abs(F))}function G(t){const n=a(),s=t[0],r=t[1],o=t[2],e=t[4],h=t[5],u=t[6],M=t[8],c=t[9],i=t[10];return Math.abs(1-(s*s+e*e+M*M))<=n&&Math.abs(1-(r*r+h*h+c*c))<=n&&Math.abs(1-(o*o+u*u+i*i))<=n}function H(t){return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[8]&&0===t[9]&&1===t[10]}const J=c,K=X,L=Object.freeze(Object.defineProperty({__proto__:null,add:V,adjoint:u,copy:n,determinant:M,equals:C,exactEquals:B,frob:N,fromQuat:A,fromQuat2:v,fromRotation:g,fromRotationTranslation:S,fromRotationTranslationScale:P,fromRotationTranslationScaleOrigin:D,fromScaling:d,fromTranslation:q,fromXRotation:p,fromYRotation:y,fromZRotation:R,frustum:_,getRotation:j,getScaling:O,getTranslation:I,hasIdentityRotation:H,identity:r,invert:h,invertOrIdentity:e,isOrthoNormal:G,lookAt:k,mul:J,multiply:c,multiplyScalar:Y,multiplyScalarAndAdd:Z,ortho:Q,perspective:w,perspectiveFromFieldOfView:F,rotate:b,rotateX:l,rotateY:m,rotateZ:x,scale:f,set:s,str:E,sub:K,subtract:X,targetTo:z,translate:i,transpose:o},Symbol.toStringTag,{value:\"Module\"}));export{p as A,I as B,L as C,j as D,d as E,A as F,u as G,M as H,y as I,S as J,v as K,D as L,w as M,F as N,E as O,N as P,V as Q,X as R,Y as S,Z as T,J as U,K as V,C as a,f as b,g as c,q as d,B as e,P as f,r as g,n as h,h as i,R as j,b as k,O as l,c as m,m as n,x as o,e as p,_ as q,l as r,s,o as t,k as u,z as v,i as w,Q as x,H as y,G as z};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{s as t,t as n}from\"../../chunks/mat4.js\";const r=(r,s)=>{const o=t(r,s,0,0,0,0,s,0,0,0,0,s,0,0,0,0,1);return n(o,o)},s=(r,s)=>{const o=t(r,s,0,0,.5-.5*s,0,s,0,.5-.5*s,0,0,s,.5-.5*s,0,0,0,1);return n(o,o)},o=(r,s)=>{const o=1-s,c=t(r,.2126+.7874*o,.7152-.7152*o,.0722-.0722*o,0,.2126-.2126*o,.7152+.2848*o,.0722-.0722*o,0,.2126-.2126*o,.7152-.7152*o,.0722+.9278*o,0,0,0,0,1);return n(c,c)},c=(r,s)=>{const o=Math.sin(s*Math.PI/180),c=Math.cos(s*Math.PI/180),e=t(r,.213+.787*c-.213*o,.715-.715*c-.715*o,.072-.072*c+.928*o,0,.213-.213*c+.143*o,.715+.285*c+.14*o,.072-.072*c-.283*o,0,.213-.213*c-.787*o,.715-.715*c+.715*o,.072+.928*c+.072*o,0,0,0,0,1);return n(e,e)},e=(r,s)=>{const o=1-2*s,c=t(r,o,0,0,s,0,o,0,s,0,0,o,s,0,0,0,1);return n(c,c)},u=(r,s)=>{const o=t(r,.213+.787*s,.715-.715*s,.072-.072*s,0,.213-.213*s,.715+.285*s,.072-.072*s,0,.213-.213*s,.715-.715*s,.072+.928*s,0,0,0,0,1);return n(o,o)},a=(r,s)=>{const o=1-s,c=t(r,.393+.607*o,.769-.769*o,.189-.189*o,0,.349-.349*o,.686+.314*o,.168-.168*o,0,.272-.272*o,.534-.534*o,.131+.869*o,0,0,0,0,1);return n(c,c)};export{r as brightness,s as contrast,o as grayscale,e as invert,c as rotateHue,u as saturate,a as sepia};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getNamedColor as t}from\"../../colorUtils.js\";import{px2pt as s}from\"../../core/screenUtils.js\";import{c as r}from\"../../chunks/mat4f32.js\";import{sepia as o,saturate as e,invert as i,grayscale as a,contrast as h,brightness as n,rotateHue as u}from\"./colorMatrixFunctions.js\";class c{constructor(t,s,r){this.strength=t,this.radius=s,this.threshold=r,this.type=\"bloom\"}interpolate(t,s,r){this.strength=M(t.strength,s.strength,r),this.radius=M(t.radius,s.radius,r),this.threshold=M(t.threshold,s.threshold,r)}clone(){return new c(this.strength,this.radius,this.threshold)}toJSON(){return{type:\"bloom\",radius:y(this.radius),strength:this.strength,threshold:this.threshold}}}class l{constructor(t){this.radius=t,this.type=\"blur\"}interpolate(t,s,r){this.radius=Math.round(M(t.radius,s.radius,r))}clone(){return new l(this.radius)}toJSON(){return{type:\"blur\",radius:y(this.radius)}}}class p{constructor(t,s){this.type=t,this.amount=s,\"invert\"!==this.type&&\"grayscale\"!==this.type&&\"sepia\"!==this.type||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,s,r){this.amount=M(t.amount,s.amount,r),this._updateMatrix()}clone(){return new p(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const t=this._colorMatrix||r();switch(this.type){case\"brightness\":this._colorMatrix=n(t,this.amount);break;case\"contrast\":this._colorMatrix=h(t,this.amount);break;case\"grayscale\":this._colorMatrix=a(t,this.amount);break;case\"invert\":this._colorMatrix=i(t,this.amount);break;case\"saturate\":this._colorMatrix=e(t,this.amount);break;case\"sepia\":this._colorMatrix=o(t,this.amount)}}}class d{constructor(t,s,r,o){this.offsetX=t,this.offsetY=s,this.blurRadius=r,this.color=o,this.type=\"drop-shadow\"}interpolate(t,s,r){this.offsetX=M(t.offsetX,s.offsetX,r),this.offsetY=M(t.offsetY,s.offsetY,r),this.blurRadius=M(t.blurRadius,s.blurRadius,r),this.color[0]=Math.round(M(t.color[0],s.color[0],r)),this.color[1]=Math.round(M(t.color[1],s.color[1],r)),this.color[2]=Math.round(M(t.color[2],s.color[2],r)),this.color[3]=M(t.color[3],s.color[3],r)}clone(){return new d(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const t=[...this.color];return t[3]*=255,{type:\"drop-shadow\",xoffset:y(this.offsetX),yoffset:y(this.offsetY),blurRadius:y(this.blurRadius),color:t}}}class m{constructor(t){this.angle=t,this.type=\"hue-rotate\"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,s,r){this.angle=M(t.angle,s.angle,r),this._updateMatrix()}clone(){return new m(this.angle)}toJSON(){return{type:\"hue-rotate\",angle:this.angle}}_updateMatrix(){const t=this._colorMatrix||r();this._colorMatrix=u(t,this.angle)}}class f{constructor(t){this.amount=t,this.type=\"opacity\",this.amount=Math.min(this.amount,1)}interpolate(t,s,r){this.amount=M(t.amount,s.amount,r)}clone(){return new f(this.amount)}toJSON(){return{type:\"opacity\",amount:this.amount}}}function M(t,s,r){return t+(s-t)*r}function y(t){return Math.round(1e3*s(t))/1e3}function x(s){switch(s.type){case\"grayscale\":case\"sepia\":case\"invert\":return new p(s.type,0);case\"saturate\":case\"brightness\":case\"contrast\":return new p(s.type,1);case\"opacity\":return new f(1);case\"hue-rotate\":return new m(0);case\"blur\":return new l(0);case\"drop-shadow\":return new d(0,0,0,[...t(\"transparent\")]);case\"bloom\":return new c(0,0,1)}}export{c as BloomEffect,l as BlurEffect,p as ColorMatrixEffect,d as DropShadowEffect,m as HueRotateEffect,f as OpacityEffect,x as createEffectWithInitialValues};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{createEffectWithInitialValues as n}from\"./effects.js\";function t(n,t){const e=n.length>t.length?n:t;return(n.length>t.length?t:n).every(((n,t)=>n.type===e[t].type))}function e(t,e){const l=t.length>e.length?t:e,r=t.length>e.length?e:t;for(let g=r.length;gr.apiKey&&!t.classic||!r.apiKey&&(t.classic||t.is3d))).map((([e])=>`\"${e}\"`)).sort().join(\", \");return p.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${e}`),null}n&&(a=n[t]),a||(a=i?e.fromId(t):new e({style:{id:t}}),n&&(n[t]=a))}else a=c(e,t);return a?.destroyed&&(p.warn(\"The provided basemap is already destroyed\",{basemap:a}),a=null),a}function d(e){return\"Web Scene\"===e.portalItem?.type}function L(e){return!!e?.portalItem?.tags?.some((e=>\"beta\"===e.toLowerCase()))}function S(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}function v(e,r=null){const t=b(e);if(!t)return null;const n=t.clone();return r&&(n.baseLayers=T(n.baseLayers,r.baseLayers),n.referenceLayers=T(n.referenceLayers,r.referenceLayers)),n}let g;function h(e){if(g)return g(e);let r=null;const t=M(e),n=!t?.baseLayers.length;for(const a in f){const e=K(t,$(f[a]),{mustMatchReferences:n});if(\"equal\"===e){r=a;break}\"base-layers-equal\"===e&&(r=a)}return r}function I(e){g=e}function R(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return\"equal\"===K(M(e),M(r),{mustMatchReferences:!0})}function T(e,r){const n=new t;return e.forEach((e=>{const t=r.find((r=>\"scene\"!==r.type&&D(A(e),A(r))))||e;n.includes(t)?n.push(e):n.push(t)})),n}function w(e){return!!e?.baseLayers.concat(e.referenceLayers).some(j)}function j(e){if(x(e.url))return!0;if(\"vector-tile\"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(x(t?.sourceUrl))return!0}return!1}function U(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if(\"not-loaded\"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case\"not-loaded\":t.load();case\"loading\":return{spatialReference:null,updating:!0};case\"failed\":return{spatialReference:null,updating:!1}}const n=((\"supportedSpatialReferences\"in t?t.supportedSpatialReferences:null)||[\"tileInfo\"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),a=e.spatialReference;return a?{spatialReference:n.find((e=>a.equals(e)))??n[0]??null,updating:!1}:{spatialReference:n[0],updating:!1}}const q=/^(basemaps|ibasemaps).*-api\\.arcgis\\.com$/i;function x(e){if(!e)return!1;const r=new l(s(e));return!!r.authority&&q.test(r.authority)}function M(e){return e?!e.loaded&&e.resourceInfo?$(e.resourceInfo.data):{baseLayers:k(e.baseLayers),referenceLayers:k(e.referenceLayers)}:null}function k(e){return(t.isCollection(e)?e.toArray():e).map(A)}function A(e){return{type:e.type,effect:\"effect\"in e?e.effect:void 0,url:E(\"urlTemplate\"in e&&e.urlTemplate||e.url||\"styleUrl\"in e&&e.styleUrl||\"\"),minScale:\"minScale\"in e&&null!=e.minScale?e.minScale:0,maxScale:\"maxScale\"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:\"map-image\"!==e.type&&\"wms\"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:\"wmts\"===e.type?e.activeLayer?.id:void 0}}function C(e){return e.isReference||\"ArcGISSceneServiceLayer\"===e.layerType}function $(e){return e?{baseLayers:G((e.baseMapLayers??[]).filter((e=>!C(e)))),referenceLayers:G((e.baseMapLayers??[]).filter((e=>C(e))))}:null}function G(e){return e.map((e=>B(e)))}function B(e){let r;switch(e.layerType){case\"VectorTileLayer\":r=\"vector-tile\";break;case\"ArcGISTiledMapServiceLayer\":r=\"tile\";break;case\"ArcGISSceneServiceLayer\":r=\"scene\";break;default:r=\"unknown\"}return{type:r,effect:e.effect,url:E(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function K(e,r,t){if(null!=e!=(null!=r))return\"not-equal\";if(!e||!r)return\"equal\";if(!N(e.baseLayers,r.baseLayers))return\"not-equal\";return N(e.referenceLayers,r.referenceLayers)?\"equal\":t.mustMatchReferences?\"not-equal\":\"base-layers-equal\"}function N(e,r){if(e.length!==r.length)return!1;for(let t=0;t[t.tables,t.layers],getChildrenFunction:e=>{const t=[];return\"tables\"in e&&t.push(e.tables),\"layers\"in e&&t.push(e.layers),t},itemFilterFunction:e=>{const t=e.parent;return!!t&&\"tables\"in t&&t.tables.includes(e)}})}function n(e){for(const t of e.values())t?.destroy();e.clear()}export{t as createFlattenedTablesCollection,n as destroyMap};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../Ground.js\";import r from\"../core/Logger.js\";import{ensureType as o}from\"../core/accessorSupport/ensureType.js\";const i={\"world-elevation\":{id:\"worldElevation\",url:\"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer\",layerType:\"ArcGISTiledElevationServiceLayer\"},\"world-topobathymetry\":{id:\"worldTopoBathymetry\",url:\"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer\",layerType:\"ArcGISTiledElevationServiceLayer\"}};function t(t){let a=null;if(\"string\"==typeof t)if(t in i){const r=i[t];a=new e({resourceInfo:{data:{layers:[r]}}})}else r.getLogger(\"esri.support.groundUtils\").warn(`Unable to find ground definition for: ${t}. Try \"world-elevation\"`);else a=o(e,t);return a}export{t as ensureType,i as groundElevationLayers};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"../../config.js\";import t from\"../../core/Logger.js\";async function o(o){const a=\"portalItem\"in o?o:{portalItem:o},{fromItem:e}=await import(\"../../portal/support/portalLayers.js\");try{return await e(a)}catch(p){const o=a&&a.portalItem,e=o?.id||\"unset\",l=o&&o.portal&&o.portal.url||r.portalUrl;throw t.getLogger(\"esri.layers.support.fromPortalItem\").error(\"#fromPortalItem()\",\"Failed to create layer from portal item (portal: '\"+l+\"', id: '\"+e+\"')\",p),p}}export{o as fromPortalItem};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import e from\"../request.js\";import r from\"../core/Error.js\";import o from\"../core/Evented.js\";import{IdentifiableMixin as i}from\"../core/Identifiable.js\";import s from\"../core/Loadable.js\";import a from\"../core/Logger.js\";import{isAbortError as l}from\"../core/promiseUtils.js\";import{urlToObject as n}from\"../core/urlUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as y}from\"../core/accessorSupport/decorators/subclass.js\";import{fromPortalItem as d}from\"./support/fromPortalItem.js\";import c from\"../geometry/Extent.js\";import u from\"../geometry/SpatialReference.js\";let m=0,h=class extends(o.EventedMixin(i(s))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new c(-180,-90,180,90,u.WGS84),this.id=Date.now().toString(16)+\"-layer-\"+m++,this.legendEnabled=!0,this.listMode=\"show\",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=u.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const e=\"string\"==typeof t?{url:t}:t;return(await import(\"./support/arcgisLayers.js\")).fromUrl(e)}static fromPortalItem(t){return d(t)}initialize(){this.when().catch((t=>{l(t)||a.getLogger(this).error(\"#load()\",`Failed to load layer (title: '${this.title??\"no title\"}', id: '${this.id??\"no id\"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;\"layers\"in t&&t.layers.includes(e)?t.layers.remove(e):\"tables\"in t&&t.tables.includes(e)?t.tables.remove(e):\"baseLayers\"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):\"referenceLayers\"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set(\"parent\",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return n(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t){return(await e(t,{query:{f:\"json\"},responseType:\"json\"})).data}throw new r(\"layer:no-attribution-data\",\"Layer does not have attribution data\")}};t([p({type:String})],h.prototype,\"attributionDataUrl\",void 0),t([p({type:c})],h.prototype,\"fullExtent\",void 0),t([p({readOnly:!0})],h.prototype,\"hasAttributionData\",null),t([p({type:String,clonable:!1})],h.prototype,\"id\",void 0),t([p({type:Boolean,nonNullable:!0})],h.prototype,\"legendEnabled\",void 0),t([p({type:[\"show\",\"hide\",\"hide-children\"]})],h.prototype,\"listMode\",void 0),t([p({type:Number,range:{min:0,max:1},nonNullable:!0})],h.prototype,\"opacity\",void 0),t([p({clonable:!1})],h.prototype,\"parent\",void 0),t([p({readOnly:!0})],h.prototype,\"parsedUrl\",null),t([p({type:Boolean,readOnly:!0})],h.prototype,\"persistenceEnabled\",void 0),t([p({type:Boolean})],h.prototype,\"popupEnabled\",void 0),t([p({type:Boolean})],h.prototype,\"attributionVisible\",void 0),t([p({type:u})],h.prototype,\"spatialReference\",void 0),t([p({type:String})],h.prototype,\"title\",void 0),t([p({readOnly:!0,json:{read:!1}})],h.prototype,\"type\",void 0),t([p()],h.prototype,\"url\",void 0),t([p({type:Boolean,nonNullable:!0})],h.prototype,\"visible\",void 0),h=t([y(\"esri.layers.Layer\")],h);const b=h;export{b as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Collection.js\";import{referenceSetter as t}from\"../core/collectionUtils.js\";import s from\"../core/Logger.js\";import{isPromiseLike as o}from\"../core/promiseUtils.js\";import{property as a}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import n from\"../layers/Layer.js\";function l(e,r,t){let s,o;if(e)for(let a=0,i=e.length;a{let y=class extends d{constructor(...e){super(...e),this.layers=new r;const t=e=>{e.parent&&\"remove\"in e.parent&&e.parent.remove(e)},o=e=>{e.parent=this,this.layerAdded(e),\"elevation\"!==e.type&&\"base-elevation\"!==e.type||s.getLogger(this).error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as an operational layer and will therefore be ignored.`)},a=e=>{e.parent=null,this.layerRemoved(e)};this.addHandles([this.layers.on(\"before-add\",(e=>t(e.item))),this.layers.on(\"after-add\",(e=>o(e.item))),this.layers.on(\"after-remove\",(e=>a(e.item)))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set(\"layers\",t(e,this._get(\"layers\")))}add(e,r){const t=this.layers;if(r=t.getNextIndex(r),e instanceof n){const s=e;s.parent===this?this.reorder(s,r):t.add(s,r)}else o(e)?e.then((e=>{this.destroyed||this.add(e,r)})):s.getLogger(this).error(\"#add()\",\"The item being added is not a Layer or a Promise that resolves to a Layer.\")}addMany(e,r){const t=this.layers;let s=t.getNextIndex(r);e.slice().forEach((e=>{e.parent!==this?(t.add(e,s),s+=1):this.reorder(e,s)}))}findLayerById(e){return l(this.layers,\"id\",e)}findLayerByUid(e){return l(this.layers,\"uid\",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return e([a()],y.prototype,\"layers\",null),y=e([i(\"esri.support.LayersMixin\")],y),y};export{d as LayersMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import e from\"../core/Collection.js\";import{referenceSetter as r}from\"../core/collectionUtils.js\";import s from\"../core/Logger.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";function a(t,e,r){if(t)for(let s=0,o=t.length;s{let n=class extends l{constructor(...t){super(...t),this.tables=new e,this.addHandles([this.tables.on(\"after-add\",(t=>{const e=t.item;e.parent&&e.parent!==this&&\"tables\"in e.parent&&e.parent.tables.remove(e),e.parent=this,\"feature\"!==e.type&&s.getLogger(this).error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as a table and will therefore be ignored.`)})),this.tables.on(\"after-remove\",(t=>{t.item.parent=null}))])}destroy(){const t=this.tables.toArray();for(const e of t)e.destroy();this.tables.destroy()}set tables(t){this._set(\"tables\",r(t,this._get(\"tables\")))}findTableById(t){return a(this.tables,\"id\",t)}findTableByUid(t){return a(this.tables,\"uid\",t)}};return t([o()],n.prototype,\"tables\",null),n=t([i(\"esri.support.TablesMixin\")],n),n};export{l as TablesMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"./chunks/tslib.es6.js\";import e from\"./Basemap.js\";import r from\"./Ground.js\";import t from\"./core/Accessor.js\";import o from\"./core/CollectionFlattener.js\";import a from\"./core/Evented.js\";import{destroyMaybe as i}from\"./core/maybe.js\";import{property as p}from\"./core/accessorSupport/decorators/property.js\";import{cast as l}from\"./core/accessorSupport/decorators/cast.js\";import\"./core/arrayUtils.js\";import\"./core/has.js\";import{subclass as n}from\"./core/accessorSupport/decorators/subclass.js\";import{isEditableLayer as m}from\"./layers/support/editableLayers.js\";import{createCache as d,destroyCache as c,ensureType as u}from\"./support/basemapUtils.js\";import{createFlattenedTablesCollection as y}from\"./support/collectionUtils.js\";import{ensureType as h}from\"./support/groundUtils.js\";import{LayersMixin as b}from\"./support/LayersMixin.js\";import{TablesMixin as f}from\"./support/TablesMixin.js\";let j=class extends(f(b(a.EventedMixin(t)))){constructor(s){super(s),this.allLayers=new o({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:s=>\"layers\"in s?s.layers:null}),this.allTables=y(this),this.basemap=null,this.editableLayers=new o({getCollections:()=>[this.allLayers],itemFilterFunction:m}),this.ground=new r,this._basemapCache=d()}destroy(){c(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=i(this.basemap),i(this.ground),this._set(\"ground\",null)}castBasemap(s){return u(s,this._basemapCache)}castGround(s){const e=h(s);return e??this._get(\"ground\")}findLayerById(s){return this.allLayers.find((e=>e.id===s))}findTableById(s){return this.allTables.find((e=>e.id===s))}};s([p({readOnly:!0,dependsOn:[]})],j.prototype,\"allLayers\",void 0),s([p({readOnly:!0})],j.prototype,\"allTables\",void 0),s([p({type:e,json:{read:{source:\"baseMap\"},write:{target:\"baseMap\"}}})],j.prototype,\"basemap\",void 0),s([l(\"basemap\")],j.prototype,\"castBasemap\",null),s([p({readOnly:!0})],j.prototype,\"editableLayers\",void 0),s([p({type:r,nonNullable:!0})],j.prototype,\"ground\",void 0),s([l(\"ground\")],j.prototype,\"castGround\",null),j=s([n(\"esri.Map\")],j);const g=j;export{g as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clamp as n}from\"./mathUtils.js\";class i{constructor(n,i){this.min=n,this.max=i,this.range=i-n}ndiff(n,i=0){return Math.ceil((n-i)/this.range)*this.range+i}_normalize(n,i,t,o=0,r=!1){return(t-=o)i&&(t-=this.ndiff(t-i)),r&&t===i&&(t=n),t+o}normalize(n,i=0,t=!1){return this._normalize(this.min,this.max,n,i,t)}clamp(i,t=0){return n(i-t,this.min,this.max)+t}monotonic(n,i,t){return nn&&tt.normalize(l(o))))],u.prototype,\"heading\",void 0),o([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),p((o=>s(l(o),-180,180)))],u.prototype,\"tilt\",void 0),o([i({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],u.prototype,\"fov\",void 0),u=o([a(\"esri.Camera\")],u);const d=u;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"./chunks/tslib.es6.js\";import t from\"./Camera.js\";import{geometryTypes as e}from\"./geometry.js\";import{JSONSupport as o}from\"./core/JSONSupport.js\";import{property as s}from\"./core/accessorSupport/decorators/property.js\";import{cast as i}from\"./core/accessorSupport/decorators/cast.js\";import\"./core/arrayUtils.js\";import\"./core/has.js\";import{subclass as a}from\"./core/accessorSupport/decorators/subclass.js\";import{fromJSON as c}from\"./geometry/support/jsonUtils.js\";var p;let n=p=class extends o{constructor(r){super(r),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(r){return(r%=360)<0&&(r+=360),r}clone(){return new p({rotation:this.rotation,scale:this.scale,targetGeometry:null!=this.targetGeometry?this.targetGeometry.clone():null,camera:null!=this.camera?this.camera.clone():null})}};function m(){return{enabled:!this.camera}}r([s({type:Number,json:{write:!0,origins:{\"web-map\":{default:0,write:!0},\"web-scene\":{write:{overridePolicy:m}}}}})],n.prototype,\"rotation\",void 0),r([i(\"rotation\")],n.prototype,\"castRotation\",null),r([s({type:Number,json:{write:!0,origins:{\"web-map\":{default:0,write:!0},\"web-scene\":{write:{overridePolicy:m}}}}})],n.prototype,\"scale\",void 0),r([s({types:e,json:{read:c,write:!0,origins:{\"web-scene\":{read:c,write:{overridePolicy:m}}}}})],n.prototype,\"targetGeometry\",void 0),r([s({type:t,json:{write:!0}})],n.prototype,\"camera\",void 0),n=p=r([a(\"esri.Viewpoint\")],n);const l=n;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{trackAccess as t}from\"./accessorSupport/tracking.js\";import{SimpleObservable as e}from\"./accessorSupport/tracking/SimpleObservable.js\";class s{constructor(t=(t=>t.values().next().value)){this._peeker=t,this._observable=new e,this._items=new Set}get length(){return t(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let t;for(t of this._items);return t}peek(){if(0!==this.length)return this._peeker(this._items)}push(t){this.contains(t)||(this._items.add(t),this._observable.notify())}contains(e){return t(this._observable),this._items.has(e)}pop(){if(0===this.length)return;const t=this.peek();return this._items.delete(t),this._observable.notify(),t}popLast(){if(0===this.length)return;const t=this.last();return this._items.delete(t),this._observable.notify(),t}remove(t){this.contains(t)&&(this._items.delete(t),this._observable.notify())}filter(t){const e=this.length;return this._items.forEach((e=>{t(e)||this._items.delete(e)})),e!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){t(this._observable),yield*this._items}}export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n=new FinalizationRegistry((n=>{n.close()}));function e(e,i){n.register(e,i,i)}function i(e){n.unregister(e)}export{e as register,i as unregister};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst r={statsWorker:()=>import(\"../../smartMapping/statistics/support/statsWorker.js\"),geometryEngineWorker:()=>import(\"../../geometry/geometryEngineWorker.js\"),CSVSourceWorker:()=>import(\"../../layers/graphics/sources/support/CSVSourceWorker.js\"),EdgeProcessingWorker:()=>import(\"../../views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js\"),ElevationSamplerWorker:()=>import(\"../../geometry/support/meshUtils/ElevationSamplerWorker.js\"),FeatureServiceSnappingSourceWorker:()=>import(\"../../views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js\"),GeoJSONSourceWorker:()=>import(\"../../layers/graphics/sources/geojson/GeoJSONSourceWorker.js\"),LercWorker:()=>import(\"../../layers/support/LercWorker.js\"),MemorySourceWorker:()=>import(\"../../layers/graphics/sources/support/MemorySourceWorker.js\"),PBFDecoderWorker:()=>import(\"../../views/3d/support/PBFDecoderWorker.js\"),Pipeline:()=>import(\"../../views/2d/layers/features/Pipeline.js\"),PointCloudWorker:()=>import(\"../../views/3d/layers/PointCloudWorker.js\"),RasterWorker:()=>import(\"../../layers/support/RasterWorker.js\"),SceneLayerSnappingSourceWorker:()=>import(\"../../views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js\"),SceneLayerWorker:()=>import(\"../../views/3d/layers/SceneLayerWorker.js\"),WFSSourceWorker:()=>import(\"../../layers/graphics/sources/WFSSourceWorker.js\"),WorkerTileHandler:()=>import(\"../../views/2d/engine/vectorTiles/WorkerTileHandler.js\")};export{r as registry};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport has from\"../has.js\";var t;!function(t){t[t.HANDSHAKE=0]=\"HANDSHAKE\",t[t.OPEN=1]=\"OPEN\",t[t.OPENED=2]=\"OPENED\",t[t.RESPONSE=3]=\"RESPONSE\",t[t.INVOKE=4]=\"INVOKE\",t[t.ABORT=5]=\"ABORT\",t[t.CLOSE=6]=\"CLOSE\",t[t.OPEN_PORT=7]=\"OPEN_PORT\",t[t.ON=8]=\"ON\"}(t||(t={}));let e=0;function r(){return e++}function n(t){return t&&\"object\"==typeof t&&(\"result\"in t||\"transferList\"in t)}function s(t){return t?\"string\"==typeof t?JSON.stringify({name:\"message\",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function f(e,r,i,a){if(r.type===t.OPEN_PORT)return void e.postMessage(r,[r.port]);if(r.type!==t.INVOKE&&r.type!==t.RESPONSE)return void e.postMessage(r);let u;if(n(i)?(u=o(i.transferList),r.data=i.result):(u=o(a),r.data=i),u){if(has(\"ff\"))for(const n of u)if(\"byteLength\"in n&&n.byteLength>267386880){const n=\"Worker call with large ArrayBuffer would crash Firefox\";switch(r.type){case t.INVOKE:throw n;case t.RESPONSE:return void f(e,{type:t.RESPONSE,jobId:r.jobId,error:s(n)})}}e.postMessage(r,u)}else e.postMessage(r)}function i(t){if(!t)return null;const e=t.data;return e?\"string\"==typeof e?JSON.parse(e):e:null}function o(t){if(!t?.length)return null;if(has(\"esri-workers-arraybuffer-transfer\"))return t;const e=t.filter((t=>!a(t)));return e.length?e:null}function a(t){return t instanceof ArrayBuffer||\"ArrayBuffer\"===t?.constructor?.name}export{t as MessageType,n as isTranferableResult,r as newJobId,f as postMessage,i as receiveMessage,s as toInvokeError};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{fullVersion as e}from\"../../kernel.js\";import s from\"../Error.js\";import{on as t}from\"../events.js\";import{makeHandle as o}from\"../handleUtils.js\";import{removeMaybe as n}from\"../maybe.js\";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from\"../promiseUtils.js\";import{registry as c}from\"./registry.js\";import{newJobId as p,MessageType as _,receiveMessage as u,toInvokeError as d,postMessage as b}from\"./utils.js\";import{buildDate as m,commitHash as g}from\"../../support/revision.js\";const{CLOSE:f,ABORT:v,INVOKE:M,RESPONSE:k,OPEN_PORT:j,ON:y}=_,I=2;class J{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===_.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class w{static connect(e){const s=new MessageChannel;let t;t=\"function\"==typeof e?new e:\"default\"in e&&\"function\"==typeof e.default?new e.default:e;const o=new w(s.port1,{channel:s,client:t});return\"object\"==typeof t&&\"remoteClient\"in t&&(t.remoteClient=o),w.clients.set(o,t),s.port2}static loadWorker(e){const s=c[e];return s?s():Promise.resolve(null)}constructor(e,s,t){this._port=e,this._jobQueue=t,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new J((e=>this._onInvokeMessage(e))),this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,this._schedule=s.schedule,this._port.addEventListener(\"message\",this._onMessage),this._port.start()}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,o){const a=o?.signal,h=o?.transferList;if(!this._port)return Promise.reject(new s(\"worker:port-closed\",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=p();return new Promise(((s,o)=>{if(r(a))return this._processWork(),void o(i());const p=l(a,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),n(e.abortHandle),this._post({type:v,jobId:c}),o(i()))})),_={resolve:s,reject:o,abortHandle:p,debugInfo:e};this._outJobs.set(c,_),this._post({type:M,jobId:c,methodName:e,abortable:null!=a},t,h)}))}on(e,s){const t=new MessageChannel;function n(e){s(e.data)}return this._port.postMessage({type:_.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener(\"message\",n),t.port1.start(),o((()=>{t.port1.postMessage({type:_.CLOSE}),t.port1.close(),t.port1.removeEventListener(\"message\",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:j,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=I)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:s,data:t,invokeOptions:o,resolver:n}=e;this.invoke(s,t,o).then((e=>n.resolve(e))).catch((e=>n.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener(\"message\",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{n(e.abortHandle),e.reject(i(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const s=u(e);if(s)switch(s.type){case k:this._onResponseMessage(s);break;case M:this._invokeQueue.push(s);break;case v:this._onAbortMessage(s);break;case f:this._onCloseMessage();break;case j:this._onOpenPortMessage(s);break;case y:this._onOnMessage(s)}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t))}_onCloseMessage(){const e=this._client;this._close(),e&&\"destroy\"in e&&w.clients.get(this)===e&&e.destroy(),w.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o,abortable:n}=e,r=n?new AbortController:null,i=this._inJobs;let l,c=this._client,p=c[s];try{if(!p&&s&&s.includes(\".\")){const e=s.split(\".\");for(let s=0;s{i.has(t)&&(i.delete(t),this._post({type:k,jobId:t},e))}),(e=>{i.has(t)&&(i.delete(t),h(e)||this._post({type:k,jobId:t,error:d(e||{message:`Error encountered at method ${s}`})}))}))):this._post({type:k,jobId:t},l)}_onOpenPortMessage(e){new w(e.port,{client:this._client})}_onOnMessage(e){const{port:s}=e,o=this._client.on(e.eventType,(e=>{s.postMessage(e)})),n=t(e.port,\"message\",(e=>{const t=u(e);t?.type===_.CLOSE&&(n.remove(),o.remove(),s.close())}))}_onResponseMessage(e){const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const l=i.get(t);i.delete(t),this._processWork(),n(l.abortHandle),o?l.reject(s.fromJSON(JSON.parse(o))):l.resolve(r)}_post(e,s,t){return b(this._port,e,s,t)}}w.kernelInfo={buildDate:m,fullVersion:e,revision:g},w.clients=new Map;export{w as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{handlesGroup as e}from\"../handleUtils.js\";import t from\"../Logger.js\";import{isPromiseLike as s,createAbortError as i,createResolver as n,throwIfAborted as o}from\"../promiseUtils.js\";import r from\"../Queue.js\";import{unregister as l}from\"./connectionRegistry.js\";import h from\"./RemoteClient.js\";class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new r}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,t){return new Promise(((i,n)=>{let r=!0;const l=e=>{o(t.signal),r&&(r=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let o=0;o(this._clients[o]=new h(e,t,this._ongoingJobsQueue),l(i),this._clients[o])),(()=>(l(n),null))):(this._clients[o]=new h(r,t,this._ongoingJobsQueue),this._clientPromises[o]=Promise.resolve(this._clients[o]),l(i))}}))}broadcast(e,t,s){const i=new Array(this._clientPromises.length);for(let n=0;ni?.invoke(e,t,s)))}return i}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(i(`Worker closing, aborting job calling '${e.methodName}'`));for(const t of this._clientPromises)t.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,l(this)}invoke(e,s,i){let o;Array.isArray(i)?(t.getLogger(\"esri.core.workers.Connection\").warn(\"invoke()\",\"The transferList parameter is deprecated, use the options object instead\"),o={transferList:i}):o=i;const r=n();this._ongoingJobsQueue.push({methodName:e,data:s,invokeOptions:o,resolver:r});for(let t=0;te?.jobAdded()))}return r.promise}on(t,s){return Promise.all(this._clientPromises).then((()=>e(this._clients.map((e=>e.on(t,s))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let i=0;i{n&&(t[i]=n.openPort()),0==--s&&e(t)}))}}))}get test(){return{numClients:this._clients.length}}}export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../request.js\";import{getInterceptor as t}from\"../urlUtils.js\";const a={async request(a,s){const r=a.options,n=r.responseType;r.signal=s?.signal,r.responseType=\"native\"===n||\"native-request-init\"===n?\"native-request-init\":n&&[\"blob\",\"json\",\"text\"].includes(n)&&t(a.url)?.after?n:\"array-buffer\";const i=await e(a.url,r),o={data:i.data,httpStatus:i.httpStatus,ssl:i.ssl};switch(i.requestOptions?.responseType){case\"native-request-init\":return delete o.data.signal,o;case\"blob\":o.data=await o.data.arrayBuffer();break;case\"json\":o.data=(new TextEncoder).encode(JSON.stringify(o.data)).buffer;break;case\"text\":o.data=(new TextEncoder).encode(o.data).buffer}return{result:o,transferList:[o.data]}}};export{a as staticWorkerMessages};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../assets.js\";import\"../has.js\";import\"../urlUtils.js\";let s=null;const a={};function e(s){const e={async:s.async,isDebug:s.isDebug,locale:s.locale,baseUrl:s.baseUrl,has:{...s.has},map:{...s.map},packages:s.packages?.concat()||[],paths:{...s.paths}};return s.hasOwnProperty(\"async\")||(e.async=!0),s.hasOwnProperty(\"isDebug\")||(e.isDebug=!1),s.baseUrl||(e.baseUrl=a.baseUrl),e}export{s as defaultLoaderUrl,e as loaderConfig};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{nextTick as e}from\"../nextTick.js\";import s from\"./RemoteClient.js\";import{MessageType as r,receiveMessage as t}from\"./utils.js\";class n{constructor(){const e=document.createDocumentFragment();[\"addEventListener\",\"dispatchEvent\",\"removeEventListener\"].forEach((s=>{this[s]=(...r)=>e[s](...r)}))}}class a{constructor(){this._dispatcher=new n,this._workerPostMessage({type:r.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener(\"message\",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener(\"message\",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener(\"messageerror\",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener(\"messageerror\",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener(\"error\",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener(\"error\",e)}postMessage(s){e((()=>{this._workerMessageHandler(new MessageEvent(\"message\",{data:s}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,s,r){this._dispatcher.addEventListener(e,s,r)}removeEventListener(e,s,r){this._dispatcher.removeEventListener(e,s,r)}_workerPostMessage(s){e((()=>{this.dispatchEvent(new MessageEvent(\"message\",{data:s}))}))}async _workerMessageHandler(e){const n=t(e);if(n&&n.type===r.OPEN){const{modulePath:e,jobId:t}=n;let a=await s.loadWorker(e);a||(a=await import(/* @vite-ignore */ /* webpackIgnore: true */e));const o=s.connect(a);this._workerPostMessage({type:r.OPENED,jobId:t,data:o})}}}export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getAssetUrl as e}from\"../../assets.js\";import r from\"../../config.js\";import\"../../intl.js\";import{fullVersion as o}from\"../../kernel.js\";import has from\"../has.js\";import t from\"../Logger.js\";import{makeAbsolute as s}from\"../urlUtils.js\";import{loaderConfig as n}from\"./loaderConfig.js\";import{receiveMessage as i,MessageType as a}from\"./utils.js\";import l from\"./WorkerFallback.js\";import{getLocale as f}from\"../../intl/locale.js\";import{buildDate as c,commitHash as d}from\"../../support/revision.js\";const u=t.getLogger(\"esri.core.workers.workerFactory\"),{HANDSHAKE:m}=a,p='let globalId=0;const outgoing=new Map,configuration=JSON.parse(\"{CONFIGURATION}\");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error(\"Aborted\");return e.name=\"AbortError\",e}function receiveMessage(e){return e&&e.data?\"string\"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener(\"abort\",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\\\nModules version: ${r}\\\\nAssets version: ${n??s}\\\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}\"function\"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):\"System\"in self&&\"function\"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),\"function\"==typeof require&&\"function\"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener(\"message\",messageHandler),self.postMessage({type:0});';let g,k;const h=\"Failed to create Worker. Fallback to execute module in main thread\";async function w(){if(!has(\"esri-workers\"))return y(new l);if(!g&&!k)try{const e=p.split('\"{CONFIGURATION}\"').join(`'${b()}'`);g=URL.createObjectURL(new Blob([e],{type:\"text/javascript\"}))}catch(r){k=r||{}}let e;if(g)try{e=new Worker(g,{name:\"esri-worker-\"+v++})}catch(r){u.warn(h,k),e=new l}else u.warn(h,k),e=new l;return y(e)}async function y(e){return new Promise((r=>{function o(s){const n=i(s);n&&n.type===m&&(e.removeEventListener(\"message\",o),e.removeEventListener(\"error\",t),r(e))}function t(r){r.preventDefault(),e.removeEventListener(\"message\",o),e.removeEventListener(\"error\",t),u.warn(\"Failed to create Worker. Fallback to execute module in main thread\",r),(e=new l).addEventListener(\"message\",o),e.addEventListener(\"error\",t)}e.addEventListener(\"message\",o),e.addEventListener(\"error\",t)}))}function b(){let t;if(null!=r.default){const e={...r};delete e.default,t=JSON.parse(JSON.stringify(e))}else t=JSON.parse(JSON.stringify(r));t.assetsPath=s(t.assetsPath),t.defaultAssetsPath=t.defaultAssetsPath?s(t.defaultAssetsPath):void 0,t.request.interceptors=[],t.log.interceptors=[],t.locale=f(),t.has={\"esri-csp-restrictions\":has(\"esri-csp-restrictions\"),\"esri-2d-debug\":!1,\"esri-2d-update-debug\":has(\"esri-2d-update-debug\"),\"esri-2d-log-updating\":has(\"esri-2d-log-updating\"),\"featurelayer-pbf\":has(\"featurelayer-pbf\"),\"featurelayer-simplify-thresholds\":has(\"featurelayer-simplify-thresholds\"),\"featurelayer-simplify-payload-size-factors\":has(\"featurelayer-simplify-payload-size-factors\"),\"featurelayer-simplify-mobile-factor\":has(\"featurelayer-simplify-mobile-factor\"),\"esri-atomics\":has(\"esri-atomics\"),\"esri-shared-array-buffer\":has(\"esri-shared-array-buffer\"),\"esri-tiles-debug\":has(\"esri-tiles-debug\"),\"esri-workers-arraybuffer-transfer\":has(\"esri-workers-arraybuffer-transfer\"),\"feature-polyline-generalization-factor\":has(\"feature-polyline-generalization-factor\"),\"host-webworker\":1},t.workers.loaderUrl&&(t.workers.loaderUrl=s(t.workers.loaderUrl)),t.workers.workerPath?t.workers.workerPath=s(t.workers.workerPath):t.workers.workerPath=s(e(\"esri/core/workers/RemoteClient.js\")),t.workers.useDynamicImport=!1;const i=r.workers.loaderConfig,a=n({baseUrl:i?.baseUrl,locale:f(),has:{\"csp-restrictions\":1,\"dojo-test-sniff\":0,\"host-webworker\":1,...i?.has},map:{...i?.map},paths:{...i?.paths},packages:i?.packages||[]}),l={buildDate:c,fullVersion:o,revision:d};return JSON.stringify({esriConfig:t,loaderConfig:a,kernelInfo:l})}let v=0;export{w as createWorker};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../Error.js\";import t from\"../Logger.js\";import{removeMaybe as o}from\"../maybe.js\";import{onAbortOrThrow as s,isPromiseLike as r,isAbortError as n}from\"../promiseUtils.js\";import{staticWorkerMessages as a}from\"./staticWorkerMessages.js\";import{newJobId as i,receiveMessage as l,toInvokeError as d,postMessage as c,MessageType as h}from\"./utils.js\";import{createWorker as p}from\"./workerFactory.js\";const{ABORT:b,INVOKE:m,OPEN:_,OPENED:g,RESPONSE:u}=h;class j{static async create(e){const t=await p();return new j(t,e)}constructor(e,o){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=o,e.addEventListener(\"message\",this._onMessage.bind(this)),e.addEventListener(\"error\",(e=>{e.preventDefault(),t.getLogger(\"esri.core.workers.WorkerOwner\").error(e)}))}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:o}=t,r=i();return new Promise(((t,n)=>{const a={resolve:t,reject:n,abortHandle:s(o,(()=>{this._outJobs.delete(r),this._post({type:b,jobId:r})}))};this._outJobs.set(r,a),this._post({type:_,jobId:r,modulePath:e})}))}_onMessage(e){const t=l(e);if(t)switch(t.type){case g:this._onOpenedMessage(t);break;case u:this._onResponseMessage(t);break;case b:this._onAbortMessage(t);break;case m:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,o=e.jobId,s=t.get(o);s&&(s.controller&&s.controller.abort(),t.delete(o))}_onInvokeMessage(e){const{methodName:t,jobId:o,data:s,abortable:i}=e,l=i?new AbortController:null,c=this._inJobs,h=a[t];let p;try{if(\"function\"!=typeof h)throw new TypeError(`${t} is not a function`);p=h.call(null,s,{signal:l?l.signal:null})}catch(b){return void this._post({type:u,jobId:o,error:d(b)})}r(p)?(c.set(o,{controller:l,promise:p}),p.then((e=>{c.has(o)&&(c.delete(o),this._post({type:u,jobId:o},e))}),(e=>{c.has(o)&&(c.delete(o),e||(e={message:\"Error encountered at method\"+t}),n(e)||this._post({type:u,jobId:o,error:d(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:u,jobId:o},p)}_onOpenedMessage(e){const{jobId:t,data:s}=e,r=this._outJobs.get(t);r&&(this._outJobs.delete(t),o(r.abortHandle),r.resolve(s))}_onResponseMessage(t){const{jobId:s,error:r,data:n}=t,a=this._outJobs.get(s);a&&(this._outJobs.delete(s),o(a.abortHandle),r?a.reject(e.fromJSON(JSON.parse(r))):a.resolve(n))}_post(e,t,o){return c(this.worker,e,t,o)}}export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"../Error.js\";import has from\"../has.js\";import{throwIfAborted as t}from\"../promiseUtils.js\";import o from\"./Connection.js\";import{register as e}from\"./connectionRegistry.js\";import n from\"./RemoteClient.js\";import i from\"./WorkerOwner.js\";const s=has(\"host-browser\")?Math.min(navigator.hardwareConcurrency-1,has(\"workers-pool-size\")):0;let a=has(\"esri-mobile\")?Math.min(s,3):s;a||(a=has(\"safari\")&&has(\"mac\")?7:2);let c=0;const l=[];function m(){g()}function f(r,t){return u(r,{client:t})}async function u(r,t){const n=new o,{registryTarget:i,...s}=t;return await n.open(r,s),i&&e(i,n),n}async function p(o,e={}){if(\"string\"!=typeof o)throw new r(\"workers:undefined-module\",\"modulePath is missing\");let i=e.strategy||\"distributed\";if(has(\"host-webworker\")&&!has(\"esri-workers\")&&(i=\"local\"),\"local\"===i){let r=await n.loadWorker(o);r||(r=await import(/* @vite-ignore */ /* webpackIgnore: true */o)),t(e.signal);const i=e.client||r;return u([n.connect(r)],{...e,client:i})}if(await g(),t(e.signal),\"dedicated\"===i){const r=c++%a;return u([await l[r].open(o,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const r=Math.min(e.maxNumWorkers,a);if(rr.open(o,e))),e)}function w(){d&&(h.abort(),d=null);for(let r=0;r(l[t]=r,r)));r.push(o)}return d=Promise.all(r),d}export{o as Connection,n as RemoteClient,m as initialize,p as open,f as openWithPorts,w as terminate};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{earth as a,moon as f,mars as e}from\"./Ellipsoid.js\";const i=Math.PI/180,t=/(?:SPHEROID|ELLIPSOID)\\[([^\\]]+)]/i,r=a.radius,n=a.eccentricitySquared,s={a1:r*n,a2:r*n*r*n,a3:r*n*n/2,a4:r*n*r*n*2.5,a5:r*n+r*n*n/2,a6:1-n},d={4267:{a:6378206.4,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:a.radius,f:a.flattening},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:f.radius,f:f.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:e.radius,f:e.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:e.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};export{s as earthEllipsoidConstants,d as spheroids,i as toRadians,t as wktSpheroidRegex};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{rad2deg as n,clamp as C,deg2rad as l,asinClamped as E}from\"../../core/mathUtils.js\";import{getMetersPerUnitForSR as e}from\"../../core/unitUtils.js\";import{isSphericalECEF as S,WGS84ECEFSpatialReferenceLike as A,SphericalPCPFMarsLike as _,SphericalPCPFMoonLike as t}from\"../ellipsoidUtils.js\";import{earth as R,moon as u,mars as r}from\"../support/Ellipsoid.js\";import{earthEllipsoidConstants as P}from\"../support/geodesicConstants.js\";import{isWGS84 as O,isWebMercator as a,isPlateCarree as L,isMars as M,isMoon as N,equals as c}from\"../support/spatialReferenceUtils.js\";import{SupportedGCSWkids as s}from\"../support/SupportedGCSWkids.js\";var i;!function(n){n[n.UNKNOWN=0]=\"UNKNOWN\",n[n.SPHERICAL_ECEF=1]=\"SPHERICAL_ECEF\",n[n.WGS84=2]=\"WGS84\",n[n.WEB_MERCATOR=3]=\"WEB_MERCATOR\",n[n.WGS84_ECEF=4]=\"WGS84_ECEF\",n[n.CGCS2000=5]=\"CGCS2000\",n[n.WGS84_COMPARABLE_LON_LAT=6]=\"WGS84_COMPARABLE_LON_LAT\",n[n.SPHERICAL_MARS_PCPF=7]=\"SPHERICAL_MARS_PCPF\",n[n.GCSMARS2000=8]=\"GCSMARS2000\",n[n.SPHERICAL_MOON_PCPF=9]=\"SPHERICAL_MOON_PCPF\",n[n.GCSMOON2000=10]=\"GCSMOON2000\",n[n.LON_LAT=11]=\"LON_LAT\",n[n.PLATE_CARREE=12]=\"PLATE_CARREE\"}(i||(i={}));const o={[i.WGS84]:{[i.CGCS2000]:null,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:f,[i.WGS84_COMPARABLE_LON_LAT]:f,[i.SPHERICAL_ECEF]:z,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:h,[i.PLATE_CARREE]:K,[i.WGS84]:f,[i.WGS84_ECEF]:$},[i.CGCS2000]:{[i.CGCS2000]:f,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:f,[i.WGS84_COMPARABLE_LON_LAT]:f,[i.SPHERICAL_ECEF]:z,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:K,[i.WGS84]:null,[i.WGS84_ECEF]:$},[i.GCSMARS2000]:{[i.CGCS2000]:null,[i.GCSMARS2000]:f,[i.GCSMOON2000]:null,[i.LON_LAT]:f,[i.WGS84_COMPARABLE_LON_LAT]:null,[i.SPHERICAL_ECEF]:null,[i.SPHERICAL_MARS_PCPF]:v,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:null,[i.WGS84]:null,[i.WGS84_ECEF]:null},[i.GCSMOON2000]:{[i.CGCS2000]:null,[i.GCSMARS2000]:null,[i.GCSMOON2000]:f,[i.LON_LAT]:f,[i.WGS84_COMPARABLE_LON_LAT]:null,[i.SPHERICAL_ECEF]:null,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:x,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:null,[i.WGS84]:null,[i.WGS84_ECEF]:null},[i.WEB_MERCATOR]:{[i.CGCS2000]:null,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:I,[i.WGS84_COMPARABLE_LON_LAT]:I,[i.SPHERICAL_ECEF]:p,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:f,[i.PLATE_CARREE]:w,[i.WGS84]:I,[i.WGS84_ECEF]:H},[i.WGS84_ECEF]:{[i.CGCS2000]:nn,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:nn,[i.WGS84_COMPARABLE_LON_LAT]:nn,[i.SPHERICAL_ECEF]:Cn,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:ln,[i.PLATE_CARREE]:j,[i.WGS84]:nn,[i.WGS84_ECEF]:f},[i.SPHERICAL_ECEF]:{[i.CGCS2000]:V,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:V,[i.WGS84_COMPARABLE_LON_LAT]:V,[i.SPHERICAL_ECEF]:f,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:X,[i.PLATE_CARREE]:q,[i.WGS84]:V,[i.WGS84_ECEF]:Y},[i.SPHERICAL_MARS_PCPF]:{[i.CGCS2000]:null,[i.GCSMARS2000]:Q,[i.GCSMOON2000]:null,[i.LON_LAT]:Q,[i.WGS84_COMPARABLE_LON_LAT]:null,[i.SPHERICAL_ECEF]:null,[i.SPHERICAL_MARS_PCPF]:f,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:null,[i.WGS84]:null,[i.WGS84_ECEF]:null},[i.SPHERICAL_MOON_PCPF]:{[i.CGCS2000]:null,[i.GCSMARS2000]:null,[i.GCSMOON2000]:J,[i.LON_LAT]:J,[i.WGS84_COMPARABLE_LON_LAT]:null,[i.SPHERICAL_ECEF]:null,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:f,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:null,[i.WGS84]:null,[i.WGS84_ECEF]:null},[i.UNKNOWN]:{[i.CGCS2000]:null,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:null,[i.WGS84_COMPARABLE_LON_LAT]:null,[i.SPHERICAL_ECEF]:null,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:f,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:null,[i.WGS84]:null,[i.WGS84_ECEF]:null},[i.LON_LAT]:{[i.CGCS2000]:f,[i.GCSMARS2000]:f,[i.GCSMOON2000]:f,[i.LON_LAT]:f,[i.WGS84_COMPARABLE_LON_LAT]:f,[i.SPHERICAL_ECEF]:z,[i.SPHERICAL_MARS_PCPF]:v,[i.SPHERICAL_MOON_PCPF]:x,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:h,[i.PLATE_CARREE]:K,[i.WGS84]:f,[i.WGS84_ECEF]:$},[i.WGS84_COMPARABLE_LON_LAT]:{[i.CGCS2000]:null,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:f,[i.WGS84_COMPARABLE_LON_LAT]:f,[i.SPHERICAL_ECEF]:z,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:null,[i.PLATE_CARREE]:K,[i.WGS84]:f,[i.WGS84_ECEF]:$},[i.PLATE_CARREE]:{[i.CGCS2000]:m,[i.GCSMARS2000]:null,[i.GCSMOON2000]:null,[i.LON_LAT]:m,[i.WGS84_COMPARABLE_LON_LAT]:m,[i.SPHERICAL_ECEF]:g,[i.SPHERICAL_MARS_PCPF]:null,[i.SPHERICAL_MOON_PCPF]:null,[i.UNKNOWN]:null,[i.WEB_MERCATOR]:b,[i.PLATE_CARREE]:f,[i.WGS84]:m,[i.WGS84_ECEF]:k}};function G(n){const C=F(n,Sn);return o[C][i.WGS84_COMPARABLE_LON_LAT]}function W(n,C,l=en()){return null==n||null==C?null:En(n,C,l).projector}function T(n,C){switch(W(n,C,_n)){case f:return\"copy3\";case z:return\"wgs84ToSphericalECEF\";case h:return\"wgs84ToWebMercator\";case K:return\"wgs84ToPlateCarree\";case $:return\"wgs84ToWGS84ECEF\";case I:return\"webMercatorToWGS84\";case p:return\"webMercatorToSphericalECEF\";case H:return\"webMercatorToWGS84ECEF\";case w:return\"webMercatorToPlateCarree\";case nn:return\"wgs84ECEFToWGS84\";case Cn:return\"wgs84ECEFToSphericalECEF\";case ln:return\"wgs84ECEFToWebMercator\";case V:return\"sphericalECEFToWGS84\";case X:return\"sphericalECEFToWebMercator\";case Q:return\"sphericalMarsPCPFToMars2000\";case J:return\"sphericalMoonPCPFToMoon2000\";case Y:return\"sphericalECEFToWGS84ECEF\";case v:return\"mars2000ToSphericalPCPF\";case x:return\"moon2000ToSphericalPCPF\";default:return null}}function F(n,C){return n?C.spatialReference===n?C.spatialReferenceId:(C.spatialReference=n,\"metersPerUnit\"in C&&(C.metersPerUnit=e(n,1)),S(n)?C.spatialReferenceId=i.SPHERICAL_ECEF:O(n)?C.spatialReferenceId=i.WGS84:a(n)?C.spatialReferenceId=i.WEB_MERCATOR:L(n)?C.spatialReferenceId=i.PLATE_CARREE:n.wkt===A.wkt?C.spatialReferenceId=i.WGS84_ECEF:n.wkid===s.CGCS2000?C.spatialReferenceId=i.CGCS2000:n.wkt===_.wkt?C.spatialReferenceId=i.SPHERICAL_MARS_PCPF:n.wkt===t.wkt?C.spatialReferenceId=i.SPHERICAL_MOON_PCPF:M(n)?C.spatialReferenceId=i.GCSMARS2000:N(n)?C.spatialReferenceId=i.GCSMOON2000:C.spatialReferenceId=i.UNKNOWN):i.UNKNOWN}function f(n,C,l,E){n!==l&&(l[E++]=n[C++],l[E++]=n[C++],l[E]=n[C])}function I(n,C,l,E){l[E++]=Rn*(n[C++]/R.radius),l[E++]=Rn*(Math.PI/2-2*Math.atan(Math.exp(-n[C++]/R.radius))),l[E]=n[C]}function p(n,C,l,E){I(n,C,l,E),z(l,E,l,E)}function H(n,C,l,E){I(n,C,l,E),$(l,E,l,E)}function d(n,l,E,e,S){const A=.4999999*Math.PI,_=C(tn*n[l+1],-A,A),t=Math.sin(_);E[e++]=tn*n[l]*S.radius,E[e++]=S.halfSemiMajorAxis*Math.log((1+t)/(1-t)),E[e]=n[l+2]}function h(n,C,l,E){d(n,C,l,E,R)}const B=R.radius*Math.PI/180,U=180/(R.radius*Math.PI);function K(n,C,l,E){l[E]=n[C]*B,l[E+1]=n[C+1]*B,l[E+2]=n[C+2]}function m(n,C,l,E){l[E]=n[C]*U,l[E+1]=n[C+1]*U,l[E+2]=n[C+2]}function w(n,C,l,E){I(n,C,l,E),K(l,E,l,E)}function j(n,C,l,E){nn(n,C,l,E),K(l,E,l,E)}function q(n,C,l,E){V(n,C,l,E),K(l,E,l,E)}function g(n,C,l,E){m(n,C,l,E),z(l,E,l,E)}function b(n,C,l,E){m(n,C,l,E),h(l,E,l,E)}function k(n,C,l,E){m(n,C,l,E),$(l,E,l,E)}function y(n,C,l,E,e){const S=e+n[C+2],A=tn*n[C+1],_=tn*n[C],t=Math.cos(A);l[E++]=Math.cos(_)*t*S,l[E++]=Math.sin(_)*t*S,l[E]=Math.sin(A)*S}function x(n,C,l,E){y(n,C,l,E,u.radius)}function v(n,C,l,E){y(n,C,l,E,r.radius)}function z(n,C,l,E){y(n,C,l,E,R.radius)}function D(n,C,l,e,S){const A=n[C],_=n[C+1],t=n[C+2],R=Math.sqrt(A*A+_*_+t*t),u=E(t/(0===R?1:R)),r=Math.atan2(_,A);l[e++]=Rn*r,l[e++]=Rn*u,l[e]=R-S}function J(n,C,l,E){D(n,C,l,E,u.radius)}function Q(n,C,l,E){D(n,C,l,E,r.radius)}function V(n,C,l,E){D(n,C,l,E,R.radius)}function X(n,C,l,E){V(n,C,l,E),h(l,E,l,E)}function Y(n,C,l,E){V(n,C,l,E),$(l,E,l,E)}function Z(n,C,l,E,e){const S=tn*n[C],A=tn*n[C+1],_=n[C+2],t=Math.sin(A),R=Math.cos(A),u=e.radius/Math.sqrt(1-e.eccentricitySquared*t*t);l[E++]=(u+_)*R*Math.cos(S),l[E++]=(u+_)*R*Math.sin(S),l[E++]=(u*(1-e.eccentricitySquared)+_)*t}function $(n,C,l,E){Z(n,C,l,E,R)}function nn(n,C,l,E){const e=P,S=n[C],A=n[C+1],_=n[C+2];let t,u,r,O,a,L,M,N,c,s,i,o,G,W,T,F,f,I,p,H,d;t=Math.abs(_),u=S*S+A*A,r=Math.sqrt(u),O=u+_*_,a=Math.sqrt(O),H=Math.atan2(A,S),L=_*_/O,M=u/O,W=e.a2/a,T=e.a3-e.a4/a,M>.3?(N=t/a*(1+M*(e.a1+W+L*T)/a),p=Math.asin(N),s=N*N,c=Math.sqrt(1-s)):(c=r/a*(1-L*(e.a5-W-M*T)/a),p=Math.acos(c),s=1-c*c,N=Math.sqrt(s)),i=1-R.eccentricitySquared*s,o=R.radius/Math.sqrt(i),G=e.a6*o,W=r-o*c,T=t-G*N,f=c*W+N*T,F=c*T-N*W,I=F/(G/i+f),p+=I,d=f+F*I/2,_<0&&(p=-p),l[E++]=Rn*H,l[E++]=Rn*p,l[E]=d}function Cn(n,C,l,E){nn(n,C,l,E),z(l,E,l,E)}function ln(n,C,l,E){nn(n,C,l,E),h(l,E,l,E)}function En(n,C,l){if(null==n||null==C||l.source.spatialReference===n&&l.dest.spatialReference===C)return l;const E=F(n,l.source),e=F(C,l.dest);return E===i.UNKNOWN&&e===i.UNKNOWN?c(n,C)?l.projector=f:l.projector=null:l.projector=o[E][e],l}function en(){return{source:{spatialReference:null,spatialReferenceId:i.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:i.UNKNOWN,metersPerUnit:1},projector:f}}const Sn={spatialReference:null,spatialReferenceId:i.UNKNOWN},An={spatialReference:null,spatialReferenceId:i.UNKNOWN},_n=en(),tn=l(1),Rn=n(1);export{i as ProjectionID,F as classifySpatialReference,f as copy3,en as createEmptyProjectorCache,An as destClassificationCache,W as getProjector,T as getProjectorName,G as getWGS84ComparableLonLatProjector,U as invPlateCarreeScale,d as lonLatToWebMercatorComparable,En as populateProjectorCache,o as projectionTable,_n as projectorCache,Sn as sourceClassificationCache,D as sphericalPCPFtoLonLatElevation,h as wgs84ToWebMercator};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getProjector as r,projectorCache as t,copy3 as o}from\"./projectors.js\";function n(n,e,f,u,c,i,s=1){const l=r(e,c,t);if(null==l)return!1;if(l===o){if(n===u&&f===i)return!0;const r=f+3*s;for(let t=f,o=i;t=0;s--){const e=this.steps[s];t.steps.push(e.getInverse())}return t}getGTListEntry(){let t=\"\";for(const s of this.steps)t+=s.uid.toString()+\",\";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,e,i){this._cachedProjection[s.cacheKey(t,e)]=i}getCachedGeTransformation(t,e){let i=\"\";for(const s of this.steps)i+=s.uid.toString()+\",\";i!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=i);const n=this._cachedProjection[s.cacheKey(t,e)];return void 0===n?null:n}}export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getMetersPerVerticalUnitForSR as n}from\"../../core/unitUtils.js\";import{isSphericalPCPF as e}from\"../ellipsoidUtils.js\";import{equals as t}from\"./spatialReferenceUtils.js\";function o(o,f,u){if(null==f||null==u||u.vcsWkid||t(f,u)||e(f)||e(u))return null;const a=n(f)/n(u);if(1===a)return null;switch(o){case\"point\":case\"esriGeometryPoint\":return n=>r(n,a);case\"polyline\":case\"esriGeometryPolyline\":return n=>l(n,a);case\"polygon\":case\"esriGeometryPolygon\":return n=>i(n,a);case\"multipoint\":case\"esriGeometryMultipoint\":return n=>s(n,a);case\"extent\":case\"esriGeometryEnvelope\":return n=>c(n,a);default:return null}}function r(n,e){null!=n?.z&&(n.z*=e)}function i(n,e){if(n)for(const t of n.rings)for(const n of t)n.length>2&&(n[2]*=e)}function l(n,e){if(n)for(const t of n.paths)for(const n of t)n.length>2&&(n[2]*=e)}function s(n,e){if(n)for(const t of n.points)t.length>2&&(t[2]*=e)}function c(n,e){n&&null!=n.zmin&&null!=n.zmax&&(n.zmin*=e,n.zmax*=e)}export{o as getGeometryZScaler};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport n from\"../core/Error.js\";import{throwIfAborted as e,waitTick as r}from\"../core/promiseUtils.js\";import{trackAccess as t}from\"../core/accessorSupport/tracking.js\";import{SimpleObservable as l}from\"../core/accessorSupport/tracking/SimpleObservable.js\";import{c as o}from\"../chunks/vec3f64.js\";import{isSphericalECEF as i,isSphericalPCPF as u}from\"./ellipsoidUtils.js\";import s from\"./Extent.js\";import a from\"./Multipoint.js\";import{l as c,p as f,i as p}from\"../chunks/pe.js\";import m from\"./Point.js\";import h from\"./Polygon.js\";import g from\"./Polyline.js\";import R from\"./SpatialReference.js\";import{projectBuffer as j}from\"./projection/projectBuffer.js\";import{getProjector as y,projectorCache as d,getWGS84ComparableLonLatProjector as x}from\"./projection/projectors.js\";import{projectXYZToVector as w}from\"./projection/projectXYZToVector.js\";import z from\"./support/GeographicTransformation.js\";import{equals as M,isValid as Z}from\"./support/spatialReferenceUtils.js\";import{getGeometryZScaler as v}from\"./support/zscale.js\";let A=null,S=null,G=null,P={};const k=new l;function E(){return!!A&&p()}function T(){return!!E()||(t(k),_(),!1)}function _(n){return null==G&&(G=Promise.all([c(),import(\"../chunks/geometryEngineBase.js\").then((n=>n.g)),import(\"./geometryAdapters/hydrated.js\")])),G.then((([,r,{hydratedAdapter:t}])=>{e(n),S=t,A=r.default,A._enableProjection(f),k.notify()}))}function b(n,e,r=null,t=null){return Array.isArray(n)?0===n.length?[]:B(S,n,n[0].spatialReference,e,r,t):B(S,[n],n.spatialReference,e,r,t)[0]}function B(n,e,r,t,l=null,o=null){if(null==r||null==t)return e;if(D(r,t,l))return e.map((n=>H(n,r,t)));if(null==l&&i(r)){return e.map((n=>H(n,r,R.WGS84))).map((n=>q(n,t)))}if(null==l&&i(t)){return e.map((n=>q(n,R.WGS84))).map((n=>H(n,R.WGS84,t)))}if(null==l){const n=z.cacheKey(r,t);void 0!==P[n]?l=P[n]:(null==(l=K(r,t,void 0))&&(l=new z),P[n]=l)}if(null==A||null==n)throw new V;return null!=o?A._project(n,e,r,t,l,o):A._project(n,e,r,t,l)}function U(n,e){const r=W([n],e);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function W(n,e){if(!E())for(const r of n)if(null!=r&&!M(r.spatialReference,e)&&Z(r.spatialReference)&&Z(e)&&!D(r.spatialReference,e))return t(k),{pending:_(),geometries:null};return{pending:null,geometries:n.map((n=>null==n?null:M(n.spatialReference,e)?n:Z(n.spatialReference)&&Z(e)?q(n,e):null))}}function K(n,e,r=null){if(null==n||null==e)return null;if(null==A||null==S)throw new V;const t=A._getTransformation(S,n,e,r,r?.spatialReference);return null!==t?z.fromGE(t):null}function O(n,e,r=null){if(null==A||null==S)throw new V;const t=A._getTransformationBySuitability(S,n,e,r,r?.spatialReference);if(null!==t){const n=[];for(const e of t)n.push(z.fromGE(e));return n}return[]}class V extends n{constructor(){super(\"projection:not-loaded\",\"projection engine not fully loaded yet, please call load()\")}}function X(){A=null,S=null,G=null,P={}}const Y={get loadPromise(){return G}};function q(n,e){try{const r=b(n,e);if(null==r)return null;\"xmin\"in n&&\"xmin\"in r&&(r.zmin=n.zmin,r.zmax=n.zmax);const t=v(r.type,n.spatialReference,e);return null!=t&&t(r),r}catch(r){if(!(r instanceof V))throw r;return null}}async function C(n,e,r){const t=n.spatialReference;return null!=t&&null!=e&&await F(t,e,null,r),q(n,e)}function D(n,e,r){return!r&&(!!M(n,e)||Z(n)&&Z(e)&&!!y(n,e,d))}async function F(n,e,t,l){if(E())return r(l);if(Array.isArray(n)){for(const{source:r,dest:o,geographicTransformation:i}of n)if(!D(r,o,i))return _(l)}else if(!D(n,e,t))return _(l);return r(l)}function H(n,e,r){return n?\"x\"in n?J(n,e,new m,r,0):\"xmin\"in n?tn(n,e,new s,r,0):\"rings\"in n?en(n,e,new h,r,0):\"paths\"in n?$(n,e,new g,r,0):\"points\"in n?N(n,e,new a,r,0):null:null}function I(n,e,r=e.spatialReference,t=0){return null!=r&&null!=n.spatialReference&&null!=J(n,n.spatialReference,e,r,t)}function J(n,e,r,t,l){un[0]=n.x,un[1]=n.y;const o=n.z;return un[2]=void 0!==o?o:l,j(un,e,0,un,t,0,1)?(r.x=un[0],r.y=un[1],r.spatialReference=t,void 0!==o||u(t)?(r.z=un[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===n.m?(r.m=void 0,r.hasM=!1):(r.m=n.m,r.hasM=!0),r):null}function L(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=N(n,n.spatialReference,e,r,t)}function N(n,e,r,t,l){const{points:o,hasZ:i,hasM:s}=n,a=[],c=o.length,f=[];for(const u of o)f.push(u[0],u[1],i?u[2]:l);if(!j(f,e,0,f,t,0,c))return null;const p=i||u(t);for(let u=0;u=0;o--)e.unshift(new y({level:o,scale:t,resolution:t})),t*=2}return new w({dpi:96,lods:e,origin:new p(0,0,i),size:[s,s],spatialReference:i})}const n=h(i),a=e.origin?new p({x:e.origin.x,y:e.origin.y,spatialReference:i}):new p(n?{x:n.origin[0],y:n.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),u=96,d=1/(r(i)*39.37*u),g=[];if(o)for(let r=0;r{r.push(e.scale),t=e.scale>t?e.scale:t,o=e.scale=t.length-1)return t[t.length-1];const o=Math.floor(e),r=o+1;return t[o]/(t[o]/t[r])**(e-o)}scaleToZoom(e){const t=this.scales,o=t.length-1;let r=0;for(;re&&s=t?this.zoomToScale(Math.ceil(o)):this.zoomToScale(Math.floor(o))}tileAt(e,t,o,r){const s=this.lodAt(e);if(!s)return null;let i,l;if(\"number\"==typeof t)i=t,l=o;else if(d(t.spatialReference,this.spatialReference))i=t.x,l=t.y,r=o;else{const e=g(t,this.spatialReference);if(null==e)return null;i=e.x,l=e.y,r=o}const n=s.resolution*this.size[0],a=s.resolution*this.size[1];return r||(r=new v(null,0,0,0,u())),r.level=e,r.row=Math.floor((this.origin.y-l)/a+.001),r.col=Math.floor((i-this.origin.x)/n+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=w.ExtrapolateOptions.NONE){let o=this.lodAt(e.level);if(!o&&t===w.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.levelArray.isArray(e)?e:\"number\"==typeof e?[e,e]:[256,256]})],O.prototype,\"size\",void 0),e([l(\"size\",[\"rows\",\"cols\"])],O.prototype,\"readSize\",null),e([a(\"size\",{cols:{type:i},rows:{type:i}})],O.prototype,\"writeSize\",null),e([s({type:c,json:{write:!0}})],O.prototype,\"spatialReference\",void 0),O=w=e([n(\"esri.layers.support.TileInfo\")],O),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]=\"NONE\",t[t.POWER_OF_TWO=1]=\"POWER_OF_TWO\"}(O||(O={}));const j=O;export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import i from\"../core/ArrayPool.js\";import{watch as s,initial as a}from\"../core/reactiveUtils.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as r}from\"../core/accessorSupport/decorators/subclass.js\";const l={widthBreakpoint:{getValue(e){const i=e.viewSize[0],s=e.breakpoints,a=this.values;return i<=s.xsmall?a.xsmall:i<=s.small?a.small:i<=s.medium?a.medium:i<=s.large?a.large:a.xlarge},values:{xsmall:\"xsmall\",small:\"small\",medium:\"medium\",large:\"large\",xlarge:\"xlarge\"},valueToClassName:{xsmall:\"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge\",small:\"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge\",medium:\"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge\",large:\"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge\",xlarge:\"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large\"}},heightBreakpoint:{getValue(e){const i=e.viewSize[1],s=e.breakpoints,a=this.values;return i<=s.xsmall?a.xsmall:i<=s.small?a.small:i<=s.medium?a.medium:i<=s.large?a.large:a.xlarge},values:{xsmall:\"xsmall\",small:\"small\",medium:\"medium\",large:\"large\",xlarge:\"xlarge\"},valueToClassName:{xsmall:\"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge\",small:\"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge\",medium:\"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge\",large:\"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge\",xlarge:\"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large\"}},orientation:{getValue(e){const i=e.viewSize,s=i[0],a=i[1],t=this.values;return a>=s?t.portrait:t.landscape},values:{portrait:\"portrait\",landscape:\"landscape\"},valueToClassName:{portrait:\"esri-view-orientation-portrait\",landscape:\"esri-view-orientation-landscape\"}}},h={xsmall:544,small:768,medium:992,large:1200};function n(e){const i=e;return i&&i.xsmall{let g=class extends o{constructor(...e){super(...e),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=h}initialize(){this.addHandles(s((()=>[this.breakpoints,this.size]),(()=>this._updateClassNames()),a))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(e){if(e===this._get(\"breakpoints\"))return;const i=n(e);if(!i){const e=JSON.stringify(h,null,2);console.warn(\"provided breakpoints are not valid, using defaults:\"+e)}e=i?e:h,this._set(\"breakpoints\",{...e})}_updateClassNames(){if(!this.container)return;const e=i.acquire(),s=i.acquire();let a,t=!1;for(a in l){const i=this[a],r=l[a].getValue({viewSize:this.size,breakpoints:this.breakpoints});i!==r&&(t=!0,this[a]=r,m(a,i).forEach((e=>s.push(e))),m(a,r).forEach((i=>e.push(i))))}t&&(this._applyClassNameChanges(e,s),i.release(e),i.release(s))}_applyClassNameChanges(e,i){const s=this.container;s&&(i.forEach((e=>s.classList.remove(e))),e.forEach((e=>s.classList.add(e))))}_removeActiveClassNames(){const e=this.container;if(!e)return;let i;for(i in l)m(i,this[i]).forEach((i=>e.classList.remove(i)))}};return e([t()],g.prototype,\"breakpoints\",null),e([t()],g.prototype,\"orientation\",void 0),e([t()],g.prototype,\"widthBreakpoint\",void 0),e([t()],g.prototype,\"heightBreakpoint\",void 0),g=e([r(\"esri.views.BreakpointsOwner\")],g),g};export{o as BreakpointsOwner};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e){return\"string\"==typeof e?document.getElementById(e):e??null}function n(e){for(;e.hasChildNodes();)e.removeChild(e.firstChild)}function t(e,n){const t=n.parentNode;t&&(t.lastChild===n?t.appendChild(e):t.insertBefore(e,n.nextSibling))}function o(e,n){const t=n.parentNode;t&&t.insertBefore(e,n)}function i(e,n){for(;;){const t=e.firstChild;if(!t)break;n.appendChild(t)}}function r(e){e.parentNode&&e.parentNode.removeChild(e)}const l=\"function\"==typeof Element.prototype.closest?(e,n)=>e.closest(n):(e,n)=>{let t=e;do{if(t.matches(n))return t;t=t.parentElement}while(null!==t&&1===t.nodeType);return null};export{e as byId,l as closest,n as empty,t as insertAfter,o as insertBefore,r as remove,i as reparent};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"../../chunks/tslib.es6.js\";import e from\"../Accessor.js\";import{makeHandle as t}from\"../handleUtils.js\";import{watch as i,when as n,on as d,sync as a}from\"../reactiveUtils.js\";import{schedule as r}from\"../scheduling.js\";import{property as o}from\"../accessorSupport/decorators/property.js\";import{subclass as l}from\"../accessorSupport/decorators/subclass.js\";let h=class extends e{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(s,e,t={}){return this._installWatch(s,e,t,i)}addWhen(s,e,t={}){return this._installWatch(s,e,t,n)}addOnCollectionChange(s,e,{initial:i=!1,final:n=!1}={}){const r=++this._handleId;return this.addHandles([d(s,\"after-changes\",this._createSyncUpdatingCallback(),a),d(s,\"change\",e,{onListenerAdd:i?s=>e({added:s.toArray(),removed:[]}):void 0,onListenerRemove:n?s=>e({added:[],removed:s.toArray()}):void 0})],r),t((()=>this.removeHandles(r)))}addPromise(s){if(null==s)return s;const e=++this._handleId;this.addHandles(t((()=>{this._pendingPromises.delete(s)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set(\"updating\",!1))})),e),this._pendingPromises.add(s),this._set(\"updating\",!0);const i=()=>this.removeHandles(e);return s.then(i,i),s}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set(\"updating\",!1)}_installWatch(s,e,i={},n){const d=++this._handleId;i.sync||this._installSyncUpdatingWatch(s,d);const a=n(s,e,i);return this.addHandles(a,d),t((()=>this.removeHandles(d)))}_installSyncUpdatingWatch(s,e){const t=this._createSyncUpdatingCallback(),n=i(s,t,{sync:!0,equals:()=>!1});return this.addHandles(n,e),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const s=this._scheduleHandleId;this._get(\"updating\")||this._set(\"updating\",!0),this.addHandles(r((()=>{s===this._scheduleHandleId&&(this._set(\"updating\",this._pendingPromises.size>0),this.removeHandles(c))})),c)}}};s([o({readOnly:!0})],h.prototype,\"updating\",void 0),h=s([l(\"esri.core.support.UpdatingHandles\")],h);const c=-42;export{h as UpdatingHandles};\n","/*!\n * @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time)\n * Copyright (c) 2022 - Environmental Systems Research Institute, Inc.\n * Apache-2.0\n * \n * js-xss\n * Copyright (c) 2012-2018 Zongmin Lei(雷宗民) \n * http://ucdok.com\n * MIT License, see https://github.com/leizongmin/js-xss/blob/master/LICENSE for details\n */\n/**\n * Determine if the value is a plain object.\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n */\nvar isPlainObject = function (value) {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (Object.prototype.toString.call(value) !== \"[object Object]\") {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\n\nvar lib$1 = {exports: {}};\n\nvar _default$1 = {};\n\nvar lib = {exports: {}};\n\nvar _default = {};\n\n/**\n * cssfilter\n *\n * @author 老雷\n */\n\nfunction getDefaultWhiteList$1 () {\n // 白名单值说明:\n // true: 允许该属性\n // Function: function (val) { } 返回true表示允许该属性,其他值均表示不允许\n // RegExp: regexp.test(val) 返回true表示允许该属性,其他值均表示不允许\n // 除上面列出的值外均表示不允许\n var whiteList = {};\n\n whiteList['align-content'] = false; // default: auto\n whiteList['align-items'] = false; // default: auto\n whiteList['align-self'] = false; // default: auto\n whiteList['alignment-adjust'] = false; // default: auto\n whiteList['alignment-baseline'] = false; // default: baseline\n whiteList['all'] = false; // default: depending on individual properties\n whiteList['anchor-point'] = false; // default: none\n whiteList['animation'] = false; // default: depending on individual properties\n whiteList['animation-delay'] = false; // default: 0\n whiteList['animation-direction'] = false; // default: normal\n whiteList['animation-duration'] = false; // default: 0\n whiteList['animation-fill-mode'] = false; // default: none\n whiteList['animation-iteration-count'] = false; // default: 1\n whiteList['animation-name'] = false; // default: none\n whiteList['animation-play-state'] = false; // default: running\n whiteList['animation-timing-function'] = false; // default: ease\n whiteList['azimuth'] = false; // default: center\n whiteList['backface-visibility'] = false; // default: visible\n whiteList['background'] = true; // default: depending on individual properties\n whiteList['background-attachment'] = true; // default: scroll\n whiteList['background-clip'] = true; // default: border-box\n whiteList['background-color'] = true; // default: transparent\n whiteList['background-image'] = true; // default: none\n whiteList['background-origin'] = true; // default: padding-box\n whiteList['background-position'] = true; // default: 0% 0%\n whiteList['background-repeat'] = true; // default: repeat\n whiteList['background-size'] = true; // default: auto\n whiteList['baseline-shift'] = false; // default: baseline\n whiteList['binding'] = false; // default: none\n whiteList['bleed'] = false; // default: 6pt\n whiteList['bookmark-label'] = false; // default: content()\n whiteList['bookmark-level'] = false; // default: none\n whiteList['bookmark-state'] = false; // default: open\n whiteList['border'] = true; // default: depending on individual properties\n whiteList['border-bottom'] = true; // default: depending on individual properties\n whiteList['border-bottom-color'] = true; // default: current color\n whiteList['border-bottom-left-radius'] = true; // default: 0\n whiteList['border-bottom-right-radius'] = true; // default: 0\n whiteList['border-bottom-style'] = true; // default: none\n whiteList['border-bottom-width'] = true; // default: medium\n whiteList['border-collapse'] = true; // default: separate\n whiteList['border-color'] = true; // default: depending on individual properties\n whiteList['border-image'] = true; // default: none\n whiteList['border-image-outset'] = true; // default: 0\n whiteList['border-image-repeat'] = true; // default: stretch\n whiteList['border-image-slice'] = true; // default: 100%\n whiteList['border-image-source'] = true; // default: none\n whiteList['border-image-width'] = true; // default: 1\n whiteList['border-left'] = true; // default: depending on individual properties\n whiteList['border-left-color'] = true; // default: current color\n whiteList['border-left-style'] = true; // default: none\n whiteList['border-left-width'] = true; // default: medium\n whiteList['border-radius'] = true; // default: 0\n whiteList['border-right'] = true; // default: depending on individual properties\n whiteList['border-right-color'] = true; // default: current color\n whiteList['border-right-style'] = true; // default: none\n whiteList['border-right-width'] = true; // default: medium\n whiteList['border-spacing'] = true; // default: 0\n whiteList['border-style'] = true; // default: depending on individual properties\n whiteList['border-top'] = true; // default: depending on individual properties\n whiteList['border-top-color'] = true; // default: current color\n whiteList['border-top-left-radius'] = true; // default: 0\n whiteList['border-top-right-radius'] = true; // default: 0\n whiteList['border-top-style'] = true; // default: none\n whiteList['border-top-width'] = true; // default: medium\n whiteList['border-width'] = true; // default: depending on individual properties\n whiteList['bottom'] = false; // default: auto\n whiteList['box-decoration-break'] = true; // default: slice\n whiteList['box-shadow'] = true; // default: none\n whiteList['box-sizing'] = true; // default: content-box\n whiteList['box-snap'] = true; // default: none\n whiteList['box-suppress'] = true; // default: show\n whiteList['break-after'] = true; // default: auto\n whiteList['break-before'] = true; // default: auto\n whiteList['break-inside'] = true; // default: auto\n whiteList['caption-side'] = false; // default: top\n whiteList['chains'] = false; // default: none\n whiteList['clear'] = true; // default: none\n whiteList['clip'] = false; // default: auto\n whiteList['clip-path'] = false; // default: none\n whiteList['clip-rule'] = false; // default: nonzero\n whiteList['color'] = true; // default: implementation dependent\n whiteList['color-interpolation-filters'] = true; // default: auto\n whiteList['column-count'] = false; // default: auto\n whiteList['column-fill'] = false; // default: balance\n whiteList['column-gap'] = false; // default: normal\n whiteList['column-rule'] = false; // default: depending on individual properties\n whiteList['column-rule-color'] = false; // default: current color\n whiteList['column-rule-style'] = false; // default: medium\n whiteList['column-rule-width'] = false; // default: medium\n whiteList['column-span'] = false; // default: none\n whiteList['column-width'] = false; // default: auto\n whiteList['columns'] = false; // default: depending on individual properties\n whiteList['contain'] = false; // default: none\n whiteList['content'] = false; // default: normal\n whiteList['counter-increment'] = false; // default: none\n whiteList['counter-reset'] = false; // default: none\n whiteList['counter-set'] = false; // default: none\n whiteList['crop'] = false; // default: auto\n whiteList['cue'] = false; // default: depending on individual properties\n whiteList['cue-after'] = false; // default: none\n whiteList['cue-before'] = false; // default: none\n whiteList['cursor'] = false; // default: auto\n whiteList['direction'] = false; // default: ltr\n whiteList['display'] = true; // default: depending on individual properties\n whiteList['display-inside'] = true; // default: auto\n whiteList['display-list'] = true; // default: none\n whiteList['display-outside'] = true; // default: inline-level\n whiteList['dominant-baseline'] = false; // default: auto\n whiteList['elevation'] = false; // default: level\n whiteList['empty-cells'] = false; // default: show\n whiteList['filter'] = false; // default: none\n whiteList['flex'] = false; // default: depending on individual properties\n whiteList['flex-basis'] = false; // default: auto\n whiteList['flex-direction'] = false; // default: row\n whiteList['flex-flow'] = false; // default: depending on individual properties\n whiteList['flex-grow'] = false; // default: 0\n whiteList['flex-shrink'] = false; // default: 1\n whiteList['flex-wrap'] = false; // default: nowrap\n whiteList['float'] = false; // default: none\n whiteList['float-offset'] = false; // default: 0 0\n whiteList['flood-color'] = false; // default: black\n whiteList['flood-opacity'] = false; // default: 1\n whiteList['flow-from'] = false; // default: none\n whiteList['flow-into'] = false; // default: none\n whiteList['font'] = true; // default: depending on individual properties\n whiteList['font-family'] = true; // default: implementation dependent\n whiteList['font-feature-settings'] = true; // default: normal\n whiteList['font-kerning'] = true; // default: auto\n whiteList['font-language-override'] = true; // default: normal\n whiteList['font-size'] = true; // default: medium\n whiteList['font-size-adjust'] = true; // default: none\n whiteList['font-stretch'] = true; // default: normal\n whiteList['font-style'] = true; // default: normal\n whiteList['font-synthesis'] = true; // default: weight style\n whiteList['font-variant'] = true; // default: normal\n whiteList['font-variant-alternates'] = true; // default: normal\n whiteList['font-variant-caps'] = true; // default: normal\n whiteList['font-variant-east-asian'] = true; // default: normal\n whiteList['font-variant-ligatures'] = true; // default: normal\n whiteList['font-variant-numeric'] = true; // default: normal\n whiteList['font-variant-position'] = true; // default: normal\n whiteList['font-weight'] = true; // default: normal\n whiteList['grid'] = false; // default: depending on individual properties\n whiteList['grid-area'] = false; // default: depending on individual properties\n whiteList['grid-auto-columns'] = false; // default: auto\n whiteList['grid-auto-flow'] = false; // default: none\n whiteList['grid-auto-rows'] = false; // default: auto\n whiteList['grid-column'] = false; // default: depending on individual properties\n whiteList['grid-column-end'] = false; // default: auto\n whiteList['grid-column-start'] = false; // default: auto\n whiteList['grid-row'] = false; // default: depending on individual properties\n whiteList['grid-row-end'] = false; // default: auto\n whiteList['grid-row-start'] = false; // default: auto\n whiteList['grid-template'] = false; // default: depending on individual properties\n whiteList['grid-template-areas'] = false; // default: none\n whiteList['grid-template-columns'] = false; // default: none\n whiteList['grid-template-rows'] = false; // default: none\n whiteList['hanging-punctuation'] = false; // default: none\n whiteList['height'] = true; // default: auto\n whiteList['hyphens'] = false; // default: manual\n whiteList['icon'] = false; // default: auto\n whiteList['image-orientation'] = false; // default: auto\n whiteList['image-resolution'] = false; // default: normal\n whiteList['ime-mode'] = false; // default: auto\n whiteList['initial-letters'] = false; // default: normal\n whiteList['inline-box-align'] = false; // default: last\n whiteList['justify-content'] = false; // default: auto\n whiteList['justify-items'] = false; // default: auto\n whiteList['justify-self'] = false; // default: auto\n whiteList['left'] = false; // default: auto\n whiteList['letter-spacing'] = true; // default: normal\n whiteList['lighting-color'] = true; // default: white\n whiteList['line-box-contain'] = false; // default: block inline replaced\n whiteList['line-break'] = false; // default: auto\n whiteList['line-grid'] = false; // default: match-parent\n whiteList['line-height'] = false; // default: normal\n whiteList['line-snap'] = false; // default: none\n whiteList['line-stacking'] = false; // default: depending on individual properties\n whiteList['line-stacking-ruby'] = false; // default: exclude-ruby\n whiteList['line-stacking-shift'] = false; // default: consider-shifts\n whiteList['line-stacking-strategy'] = false; // default: inline-line-height\n whiteList['list-style'] = true; // default: depending on individual properties\n whiteList['list-style-image'] = true; // default: none\n whiteList['list-style-position'] = true; // default: outside\n whiteList['list-style-type'] = true; // default: disc\n whiteList['margin'] = true; // default: depending on individual properties\n whiteList['margin-bottom'] = true; // default: 0\n whiteList['margin-left'] = true; // default: 0\n whiteList['margin-right'] = true; // default: 0\n whiteList['margin-top'] = true; // default: 0\n whiteList['marker-offset'] = false; // default: auto\n whiteList['marker-side'] = false; // default: list-item\n whiteList['marks'] = false; // default: none\n whiteList['mask'] = false; // default: border-box\n whiteList['mask-box'] = false; // default: see individual properties\n whiteList['mask-box-outset'] = false; // default: 0\n whiteList['mask-box-repeat'] = false; // default: stretch\n whiteList['mask-box-slice'] = false; // default: 0 fill\n whiteList['mask-box-source'] = false; // default: none\n whiteList['mask-box-width'] = false; // default: auto\n whiteList['mask-clip'] = false; // default: border-box\n whiteList['mask-image'] = false; // default: none\n whiteList['mask-origin'] = false; // default: border-box\n whiteList['mask-position'] = false; // default: center\n whiteList['mask-repeat'] = false; // default: no-repeat\n whiteList['mask-size'] = false; // default: border-box\n whiteList['mask-source-type'] = false; // default: auto\n whiteList['mask-type'] = false; // default: luminance\n whiteList['max-height'] = true; // default: none\n whiteList['max-lines'] = false; // default: none\n whiteList['max-width'] = true; // default: none\n whiteList['min-height'] = true; // default: 0\n whiteList['min-width'] = true; // default: 0\n whiteList['move-to'] = false; // default: normal\n whiteList['nav-down'] = false; // default: auto\n whiteList['nav-index'] = false; // default: auto\n whiteList['nav-left'] = false; // default: auto\n whiteList['nav-right'] = false; // default: auto\n whiteList['nav-up'] = false; // default: auto\n whiteList['object-fit'] = false; // default: fill\n whiteList['object-position'] = false; // default: 50% 50%\n whiteList['opacity'] = false; // default: 1\n whiteList['order'] = false; // default: 0\n whiteList['orphans'] = false; // default: 2\n whiteList['outline'] = false; // default: depending on individual properties\n whiteList['outline-color'] = false; // default: invert\n whiteList['outline-offset'] = false; // default: 0\n whiteList['outline-style'] = false; // default: none\n whiteList['outline-width'] = false; // default: medium\n whiteList['overflow'] = false; // default: depending on individual properties\n whiteList['overflow-wrap'] = false; // default: normal\n whiteList['overflow-x'] = false; // default: visible\n whiteList['overflow-y'] = false; // default: visible\n whiteList['padding'] = true; // default: depending on individual properties\n whiteList['padding-bottom'] = true; // default: 0\n whiteList['padding-left'] = true; // default: 0\n whiteList['padding-right'] = true; // default: 0\n whiteList['padding-top'] = true; // default: 0\n whiteList['page'] = false; // default: auto\n whiteList['page-break-after'] = false; // default: auto\n whiteList['page-break-before'] = false; // default: auto\n whiteList['page-break-inside'] = false; // default: auto\n whiteList['page-policy'] = false; // default: start\n whiteList['pause'] = false; // default: implementation dependent\n whiteList['pause-after'] = false; // default: implementation dependent\n whiteList['pause-before'] = false; // default: implementation dependent\n whiteList['perspective'] = false; // default: none\n whiteList['perspective-origin'] = false; // default: 50% 50%\n whiteList['pitch'] = false; // default: medium\n whiteList['pitch-range'] = false; // default: 50\n whiteList['play-during'] = false; // default: auto\n whiteList['position'] = false; // default: static\n whiteList['presentation-level'] = false; // default: 0\n whiteList['quotes'] = false; // default: text\n whiteList['region-fragment'] = false; // default: auto\n whiteList['resize'] = false; // default: none\n whiteList['rest'] = false; // default: depending on individual properties\n whiteList['rest-after'] = false; // default: none\n whiteList['rest-before'] = false; // default: none\n whiteList['richness'] = false; // default: 50\n whiteList['right'] = false; // default: auto\n whiteList['rotation'] = false; // default: 0\n whiteList['rotation-point'] = false; // default: 50% 50%\n whiteList['ruby-align'] = false; // default: auto\n whiteList['ruby-merge'] = false; // default: separate\n whiteList['ruby-position'] = false; // default: before\n whiteList['shape-image-threshold'] = false; // default: 0.0\n whiteList['shape-outside'] = false; // default: none\n whiteList['shape-margin'] = false; // default: 0\n whiteList['size'] = false; // default: auto\n whiteList['speak'] = false; // default: auto\n whiteList['speak-as'] = false; // default: normal\n whiteList['speak-header'] = false; // default: once\n whiteList['speak-numeral'] = false; // default: continuous\n whiteList['speak-punctuation'] = false; // default: none\n whiteList['speech-rate'] = false; // default: medium\n whiteList['stress'] = false; // default: 50\n whiteList['string-set'] = false; // default: none\n whiteList['tab-size'] = false; // default: 8\n whiteList['table-layout'] = false; // default: auto\n whiteList['text-align'] = true; // default: start\n whiteList['text-align-last'] = true; // default: auto\n whiteList['text-combine-upright'] = true; // default: none\n whiteList['text-decoration'] = true; // default: none\n whiteList['text-decoration-color'] = true; // default: currentColor\n whiteList['text-decoration-line'] = true; // default: none\n whiteList['text-decoration-skip'] = true; // default: objects\n whiteList['text-decoration-style'] = true; // default: solid\n whiteList['text-emphasis'] = true; // default: depending on individual properties\n whiteList['text-emphasis-color'] = true; // default: currentColor\n whiteList['text-emphasis-position'] = true; // default: over right\n whiteList['text-emphasis-style'] = true; // default: none\n whiteList['text-height'] = true; // default: auto\n whiteList['text-indent'] = true; // default: 0\n whiteList['text-justify'] = true; // default: auto\n whiteList['text-orientation'] = true; // default: mixed\n whiteList['text-overflow'] = true; // default: clip\n whiteList['text-shadow'] = true; // default: none\n whiteList['text-space-collapse'] = true; // default: collapse\n whiteList['text-transform'] = true; // default: none\n whiteList['text-underline-position'] = true; // default: auto\n whiteList['text-wrap'] = true; // default: normal\n whiteList['top'] = false; // default: auto\n whiteList['transform'] = false; // default: none\n whiteList['transform-origin'] = false; // default: 50% 50% 0\n whiteList['transform-style'] = false; // default: flat\n whiteList['transition'] = false; // default: depending on individual properties\n whiteList['transition-delay'] = false; // default: 0s\n whiteList['transition-duration'] = false; // default: 0s\n whiteList['transition-property'] = false; // default: all\n whiteList['transition-timing-function'] = false; // default: ease\n whiteList['unicode-bidi'] = false; // default: normal\n whiteList['vertical-align'] = false; // default: baseline\n whiteList['visibility'] = false; // default: visible\n whiteList['voice-balance'] = false; // default: center\n whiteList['voice-duration'] = false; // default: auto\n whiteList['voice-family'] = false; // default: implementation dependent\n whiteList['voice-pitch'] = false; // default: medium\n whiteList['voice-range'] = false; // default: medium\n whiteList['voice-rate'] = false; // default: normal\n whiteList['voice-stress'] = false; // default: normal\n whiteList['voice-volume'] = false; // default: medium\n whiteList['volume'] = false; // default: medium\n whiteList['white-space'] = false; // default: normal\n whiteList['widows'] = false; // default: 2\n whiteList['width'] = true; // default: auto\n whiteList['will-change'] = false; // default: auto\n whiteList['word-break'] = true; // default: normal\n whiteList['word-spacing'] = true; // default: normal\n whiteList['word-wrap'] = true; // default: normal\n whiteList['wrap-flow'] = false; // default: auto\n whiteList['wrap-through'] = false; // default: wrap\n whiteList['writing-mode'] = false; // default: horizontal-tb\n whiteList['z-index'] = false; // default: auto\n\n return whiteList;\n}\n\n\n/**\n * 匹配到白名单上的一个属性时\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @return {String}\n */\nfunction onAttr (name, value, options) {\n // do nothing\n}\n\n/**\n * 匹配到不在白名单上的一个属性时\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @return {String}\n */\nfunction onIgnoreAttr (name, value, options) {\n // do nothing\n}\n\nvar REGEXP_URL_JAVASCRIPT = /javascript\\s*\\:/img;\n\n/**\n * 过滤属性值\n *\n * @param {String} name\n * @param {String} value\n * @return {String}\n */\nfunction safeAttrValue$1(name, value) {\n if (REGEXP_URL_JAVASCRIPT.test(value)) return '';\n return value;\n}\n\n\n_default.whiteList = getDefaultWhiteList$1();\n_default.getDefaultWhiteList = getDefaultWhiteList$1;\n_default.onAttr = onAttr;\n_default.onIgnoreAttr = onIgnoreAttr;\n_default.safeAttrValue = safeAttrValue$1;\n\nvar util$1 = {\n indexOf: function (arr, item) {\n var i, j;\n if (Array.prototype.indexOf) {\n return arr.indexOf(item);\n }\n for (i = 0, j = arr.length; i < j; i++) {\n if (arr[i] === item) {\n return i;\n }\n }\n return -1;\n },\n forEach: function (arr, fn, scope) {\n var i, j;\n if (Array.prototype.forEach) {\n return arr.forEach(fn, scope);\n }\n for (i = 0, j = arr.length; i < j; i++) {\n fn.call(scope, arr[i], i, arr);\n }\n },\n trim: function (str) {\n if (String.prototype.trim) {\n return str.trim();\n }\n return str.replace(/(^\\s*)|(\\s*$)/g, '');\n },\n trimRight: function (str) {\n if (String.prototype.trimRight) {\n return str.trimRight();\n }\n return str.replace(/(\\s*$)/g, '');\n }\n};\n\n/**\n * cssfilter\n *\n * @author 老雷\n */\n\nvar _$3 = util$1;\n\n\n/**\n * 解析style\n *\n * @param {String} css\n * @param {Function} onAttr 处理属性的函数\n * 参数格式: function (sourcePosition, position, name, value, source)\n * @return {String}\n */\nfunction parseStyle$1 (css, onAttr) {\n css = _$3.trimRight(css);\n if (css[css.length - 1] !== ';') css += ';';\n var cssLength = css.length;\n var isParenthesisOpen = false;\n var lastPos = 0;\n var i = 0;\n var retCSS = '';\n\n function addNewAttr () {\n // 如果没有正常的闭合圆括号,则直接忽略当前属性\n if (!isParenthesisOpen) {\n var source = _$3.trim(css.slice(lastPos, i));\n var j = source.indexOf(':');\n if (j !== -1) {\n var name = _$3.trim(source.slice(0, j));\n var value = _$3.trim(source.slice(j + 1));\n // 必须有属性名称\n if (name) {\n var ret = onAttr(lastPos, retCSS.length, name, value, source);\n if (ret) retCSS += ret + '; ';\n }\n }\n }\n lastPos = i + 1;\n }\n\n for (; i < cssLength; i++) {\n var c = css[i];\n if (c === '/' && css[i + 1] === '*') {\n // 备注开始\n var j = css.indexOf('*/', i + 2);\n // 如果没有正常的备注结束,则后面的部分全部跳过\n if (j === -1) break;\n // 直接将当前位置调到备注结尾,并且初始化状态\n i = j + 1;\n lastPos = i + 1;\n isParenthesisOpen = false;\n } else if (c === '(') {\n isParenthesisOpen = true;\n } else if (c === ')') {\n isParenthesisOpen = false;\n } else if (c === ';') {\n if (isParenthesisOpen) ; else {\n addNewAttr();\n }\n } else if (c === '\\n') {\n addNewAttr();\n }\n }\n\n return _$3.trim(retCSS);\n}\n\nvar parser$2 = parseStyle$1;\n\n/**\n * cssfilter\n *\n * @author 老雷\n */\n\nvar DEFAULT$1 = _default;\nvar parseStyle = parser$2;\n\n\n/**\n * 返回值是否为空\n *\n * @param {Object} obj\n * @return {Boolean}\n */\nfunction isNull$1 (obj) {\n return (obj === undefined || obj === null);\n}\n\n/**\n * 浅拷贝对象\n *\n * @param {Object} obj\n * @return {Object}\n */\nfunction shallowCopyObject$1 (obj) {\n var ret = {};\n for (var i in obj) {\n ret[i] = obj[i];\n }\n return ret;\n}\n\n/**\n * 创建CSS过滤器\n *\n * @param {Object} options\n * - {Object} whiteList\n * - {Function} onAttr\n * - {Function} onIgnoreAttr\n * - {Function} safeAttrValue\n */\nfunction FilterCSS$2 (options) {\n options = shallowCopyObject$1(options || {});\n options.whiteList = options.whiteList || DEFAULT$1.whiteList;\n options.onAttr = options.onAttr || DEFAULT$1.onAttr;\n options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT$1.onIgnoreAttr;\n options.safeAttrValue = options.safeAttrValue || DEFAULT$1.safeAttrValue;\n this.options = options;\n}\n\nFilterCSS$2.prototype.process = function (css) {\n // 兼容各种奇葩输入\n css = css || '';\n css = css.toString();\n if (!css) return '';\n\n var me = this;\n var options = me.options;\n var whiteList = options.whiteList;\n var onAttr = options.onAttr;\n var onIgnoreAttr = options.onIgnoreAttr;\n var safeAttrValue = options.safeAttrValue;\n\n var retCSS = parseStyle(css, function (sourcePosition, position, name, value, source) {\n\n var check = whiteList[name];\n var isWhite = false;\n if (check === true) isWhite = check;\n else if (typeof check === 'function') isWhite = check(value);\n else if (check instanceof RegExp) isWhite = check.test(value);\n if (isWhite !== true) isWhite = false;\n\n // 如果过滤后 value 为空则直接忽略\n value = safeAttrValue(name, value);\n if (!value) return;\n\n var opts = {\n position: position,\n sourcePosition: sourcePosition,\n source: source,\n isWhite: isWhite\n };\n\n if (isWhite) {\n\n var ret = onAttr(name, value, opts);\n if (isNull$1(ret)) {\n return name + ':' + value;\n } else {\n return ret;\n }\n\n } else {\n\n var ret = onIgnoreAttr(name, value, opts);\n if (!isNull$1(ret)) {\n return ret;\n }\n\n }\n });\n\n return retCSS;\n};\n\n\nvar css = FilterCSS$2;\n\n/**\n * cssfilter\n *\n * @author 老雷\n */\n\n(function (module, exports) {\n\tvar DEFAULT = _default;\n\tvar FilterCSS = css;\n\n\n\t/**\n\t * XSS过滤\n\t *\n\t * @param {String} css 要过滤的CSS代码\n\t * @param {Object} options 选项:whiteList, onAttr, onIgnoreAttr\n\t * @return {String}\n\t */\n\tfunction filterCSS (html, options) {\n\t var xss = new FilterCSS(options);\n\t return xss.process(html);\n\t}\n\n\n\t// 输出\n\texports = module.exports = filterCSS;\n\texports.FilterCSS = FilterCSS;\n\tfor (var i in DEFAULT) exports[i] = DEFAULT[i];\n} (lib, lib.exports));\n\nvar util = {\n indexOf: function (arr, item) {\n var i, j;\n if (Array.prototype.indexOf) {\n return arr.indexOf(item);\n }\n for (i = 0, j = arr.length; i < j; i++) {\n if (arr[i] === item) {\n return i;\n }\n }\n return -1;\n },\n forEach: function (arr, fn, scope) {\n var i, j;\n if (Array.prototype.forEach) {\n return arr.forEach(fn, scope);\n }\n for (i = 0, j = arr.length; i < j; i++) {\n fn.call(scope, arr[i], i, arr);\n }\n },\n trim: function (str) {\n if (String.prototype.trim) {\n return str.trim();\n }\n return str.replace(/(^\\s*)|(\\s*$)/g, \"\");\n },\n spaceIndex: function (str) {\n var reg = /\\s|\\n|\\t/;\n var match = reg.exec(str);\n return match ? match.index : -1;\n },\n};\n\n/**\n * default settings\n *\n * @author Zongmin Lei\n */\n\nvar FilterCSS$1 = lib.exports.FilterCSS;\nvar getDefaultCSSWhiteList = lib.exports.getDefaultWhiteList;\nvar _$2 = util;\n\nfunction getDefaultWhiteList() {\n return {\n a: [\"target\", \"href\", \"title\"],\n abbr: [\"title\"],\n address: [],\n area: [\"shape\", \"coords\", \"href\", \"alt\"],\n article: [],\n aside: [],\n audio: [\n \"autoplay\",\n \"controls\",\n \"crossorigin\",\n \"loop\",\n \"muted\",\n \"preload\",\n \"src\",\n ],\n b: [],\n bdi: [\"dir\"],\n bdo: [\"dir\"],\n big: [],\n blockquote: [\"cite\"],\n br: [],\n caption: [],\n center: [],\n cite: [],\n code: [],\n col: [\"align\", \"valign\", \"span\", \"width\"],\n colgroup: [\"align\", \"valign\", \"span\", \"width\"],\n dd: [],\n del: [\"datetime\"],\n details: [\"open\"],\n div: [],\n dl: [],\n dt: [],\n em: [],\n figcaption: [],\n figure: [],\n font: [\"color\", \"size\", \"face\"],\n footer: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n header: [],\n hr: [],\n i: [],\n img: [\"src\", \"alt\", \"title\", \"width\", \"height\"],\n ins: [\"datetime\"],\n li: [],\n mark: [],\n nav: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n section: [],\n small: [],\n span: [],\n sub: [],\n summary: [],\n sup: [],\n strong: [],\n strike: [],\n table: [\"width\", \"border\", \"align\", \"valign\"],\n tbody: [\"align\", \"valign\"],\n td: [\"width\", \"rowspan\", \"colspan\", \"align\", \"valign\"],\n tfoot: [\"align\", \"valign\"],\n th: [\"width\", \"rowspan\", \"colspan\", \"align\", \"valign\"],\n thead: [\"align\", \"valign\"],\n tr: [\"rowspan\", \"align\", \"valign\"],\n tt: [],\n u: [],\n ul: [],\n video: [\n \"autoplay\",\n \"controls\",\n \"crossorigin\",\n \"loop\",\n \"muted\",\n \"playsinline\",\n \"poster\",\n \"preload\",\n \"src\",\n \"height\",\n \"width\",\n ],\n };\n}\n\nvar defaultCSSFilter = new FilterCSS$1();\n\n/**\n * default onTag function\n *\n * @param {String} tag\n * @param {String} html\n * @param {Object} options\n * @return {String}\n */\nfunction onTag(tag, html, options) {\n // do nothing\n}\n\n/**\n * default onIgnoreTag function\n *\n * @param {String} tag\n * @param {String} html\n * @param {Object} options\n * @return {String}\n */\nfunction onIgnoreTag(tag, html, options) {\n // do nothing\n}\n\n/**\n * default onTagAttr function\n *\n * @param {String} tag\n * @param {String} name\n * @param {String} value\n * @return {String}\n */\nfunction onTagAttr(tag, name, value) {\n // do nothing\n}\n\n/**\n * default onIgnoreTagAttr function\n *\n * @param {String} tag\n * @param {String} name\n * @param {String} value\n * @return {String}\n */\nfunction onIgnoreTagAttr(tag, name, value) {\n // do nothing\n}\n\n/**\n * default escapeHtml function\n *\n * @param {String} html\n */\nfunction escapeHtml(html) {\n return html.replace(REGEXP_LT, \"<\").replace(REGEXP_GT, \">\");\n}\n\n/**\n * default safeAttrValue function\n *\n * @param {String} tag\n * @param {String} name\n * @param {String} value\n * @param {Object} cssFilter\n * @return {String}\n */\nfunction safeAttrValue(tag, name, value, cssFilter) {\n // unescape attribute value firstly\n value = friendlyAttrValue(value);\n\n if (name === \"href\" || name === \"src\") {\n // filter `href` and `src` attribute\n // only allow the value that starts with `http://` | `https://` | `mailto:` | `/` | `#`\n value = _$2.trim(value);\n if (value === \"#\") return \"#\";\n if (\n !(\n value.substr(0, 7) === \"http://\" ||\n value.substr(0, 8) === \"https://\" ||\n value.substr(0, 7) === \"mailto:\" ||\n value.substr(0, 4) === \"tel:\" ||\n value.substr(0, 11) === \"data:image/\" ||\n value.substr(0, 6) === \"ftp://\" ||\n value.substr(0, 2) === \"./\" ||\n value.substr(0, 3) === \"../\" ||\n value[0] === \"#\" ||\n value[0] === \"/\"\n )\n ) {\n return \"\";\n }\n } else if (name === \"background\") {\n // filter `background` attribute (maybe no use)\n // `javascript:`\n REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;\n if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {\n return \"\";\n }\n } else if (name === \"style\") {\n // `expression()`\n REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;\n if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {\n return \"\";\n }\n // `url()`\n REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;\n if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {\n REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;\n if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {\n return \"\";\n }\n }\n if (cssFilter !== false) {\n cssFilter = cssFilter || defaultCSSFilter;\n value = cssFilter.process(value);\n }\n }\n\n // escape `<>\"` before returns\n value = escapeAttrValue(value);\n return value;\n}\n\n// RegExp list\nvar REGEXP_LT = //g;\nvar REGEXP_QUOTE = /\"/g;\nvar REGEXP_QUOTE_2 = /"/g;\nvar REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;\nvar REGEXP_ATTR_VALUE_COLON = /:?/gim;\nvar REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;\n// var REGEXP_DEFAULT_ON_TAG_ATTR_3 = /\\/\\*|\\*\\//gm;\nvar REGEXP_DEFAULT_ON_TAG_ATTR_4 =\n /((j\\s*a\\s*v\\s*a|v\\s*b|l\\s*i\\s*v\\s*e)\\s*s\\s*c\\s*r\\s*i\\s*p\\s*t\\s*|m\\s*o\\s*c\\s*h\\s*a):/gi;\n// var REGEXP_DEFAULT_ON_TAG_ATTR_5 = /^[\\s\"'`]*(d\\s*a\\s*t\\s*a\\s*)\\:/gi;\n// var REGEXP_DEFAULT_ON_TAG_ATTR_6 = /^[\\s\"'`]*(d\\s*a\\s*t\\s*a\\s*)\\:\\s*image\\//gi;\nvar REGEXP_DEFAULT_ON_TAG_ATTR_7 =\n /e\\s*x\\s*p\\s*r\\s*e\\s*s\\s*s\\s*i\\s*o\\s*n\\s*\\(.*/gi;\nvar REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\\s*r\\s*l\\s*\\(.*/gi;\n\n/**\n * escape double quote\n *\n * @param {String} str\n * @return {String} str\n */\nfunction escapeQuote(str) {\n return str.replace(REGEXP_QUOTE, \""\");\n}\n\n/**\n * unescape double quote\n *\n * @param {String} str\n * @return {String} str\n */\nfunction unescapeQuote(str) {\n return str.replace(REGEXP_QUOTE_2, '\"');\n}\n\n/**\n * escape html entities\n *\n * @param {String} str\n * @return {String}\n */\nfunction escapeHtmlEntities(str) {\n return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {\n return code[0] === \"x\" || code[0] === \"X\"\n ? String.fromCharCode(parseInt(code.substr(1), 16))\n : String.fromCharCode(parseInt(code, 10));\n });\n}\n\n/**\n * escape html5 new danger entities\n *\n * @param {String} str\n * @return {String}\n */\nfunction escapeDangerHtml5Entities(str) {\n return str\n .replace(REGEXP_ATTR_VALUE_COLON, \":\")\n .replace(REGEXP_ATTR_VALUE_NEWLINE, \" \");\n}\n\n/**\n * clear nonprintable characters\n *\n * @param {String} str\n * @return {String}\n */\nfunction clearNonPrintableCharacter(str) {\n var str2 = \"\";\n for (var i = 0, len = str.length; i < len; i++) {\n str2 += str.charCodeAt(i) < 32 ? \" \" : str.charAt(i);\n }\n return _$2.trim(str2);\n}\n\n/**\n * get friendly attribute value\n *\n * @param {String} str\n * @return {String}\n */\nfunction friendlyAttrValue(str) {\n str = unescapeQuote(str);\n str = escapeHtmlEntities(str);\n str = escapeDangerHtml5Entities(str);\n str = clearNonPrintableCharacter(str);\n return str;\n}\n\n/**\n * unescape attribute value\n *\n * @param {String} str\n * @return {String}\n */\nfunction escapeAttrValue(str) {\n str = escapeQuote(str);\n str = escapeHtml(str);\n return str;\n}\n\n/**\n * `onIgnoreTag` function for removing all the tags that are not in whitelist\n */\nfunction onIgnoreTagStripAll() {\n return \"\";\n}\n\n/**\n * remove tag body\n * specify a `tags` list, if the tag is not in the `tags` list then process by the specify function (optional)\n *\n * @param {array} tags\n * @param {function} next\n */\nfunction StripTagBody(tags, next) {\n if (typeof next !== \"function\") {\n next = function () {};\n }\n\n var isRemoveAllTag = !Array.isArray(tags);\n function isRemoveTag(tag) {\n if (isRemoveAllTag) return true;\n return _$2.indexOf(tags, tag) !== -1;\n }\n\n var removeList = [];\n var posStart = false;\n\n return {\n onIgnoreTag: function (tag, html, options) {\n if (isRemoveTag(tag)) {\n if (options.isClosing) {\n var ret = \"[/removed]\";\n var end = options.position + ret.length;\n removeList.push([\n posStart !== false ? posStart : options.position,\n end,\n ]);\n posStart = false;\n return ret;\n } else {\n if (!posStart) {\n posStart = options.position;\n }\n return \"[removed]\";\n }\n } else {\n return next(tag, html, options);\n }\n },\n remove: function (html) {\n var rethtml = \"\";\n var lastPos = 0;\n _$2.forEach(removeList, function (pos) {\n rethtml += html.slice(lastPos, pos[0]);\n lastPos = pos[1];\n });\n rethtml += html.slice(lastPos);\n return rethtml;\n },\n };\n}\n\n/**\n * remove html comments\n *\n * @param {String} html\n * @return {String}\n */\nfunction stripCommentTag(html) {\n var retHtml = \"\";\n var lastPos = 0;\n while (lastPos < html.length) {\n var i = html.indexOf(\"\", i);\n if (j === -1) {\n break;\n }\n lastPos = j + 3;\n }\n return retHtml;\n}\n\n/**\n * remove invisible characters\n *\n * @param {String} html\n * @return {String}\n */\nfunction stripBlankChar(html) {\n var chars = html.split(\"\");\n chars = chars.filter(function (char) {\n var c = char.charCodeAt(0);\n if (c === 127) return false;\n if (c <= 31) {\n if (c === 10 || c === 13) return true;\n return false;\n }\n return true;\n });\n return chars.join(\"\");\n}\n\n_default$1.whiteList = getDefaultWhiteList();\n_default$1.getDefaultWhiteList = getDefaultWhiteList;\n_default$1.onTag = onTag;\n_default$1.onIgnoreTag = onIgnoreTag;\n_default$1.onTagAttr = onTagAttr;\n_default$1.onIgnoreTagAttr = onIgnoreTagAttr;\n_default$1.safeAttrValue = safeAttrValue;\n_default$1.escapeHtml = escapeHtml;\n_default$1.escapeQuote = escapeQuote;\n_default$1.unescapeQuote = unescapeQuote;\n_default$1.escapeHtmlEntities = escapeHtmlEntities;\n_default$1.escapeDangerHtml5Entities = escapeDangerHtml5Entities;\n_default$1.clearNonPrintableCharacter = clearNonPrintableCharacter;\n_default$1.friendlyAttrValue = friendlyAttrValue;\n_default$1.escapeAttrValue = escapeAttrValue;\n_default$1.onIgnoreTagStripAll = onIgnoreTagStripAll;\n_default$1.StripTagBody = StripTagBody;\n_default$1.stripCommentTag = stripCommentTag;\n_default$1.stripBlankChar = stripBlankChar;\n_default$1.cssFilter = defaultCSSFilter;\n_default$1.getDefaultCSSWhiteList = getDefaultCSSWhiteList;\n\nvar parser$1 = {};\n\n/**\n * Simple HTML Parser\n *\n * @author Zongmin Lei\n */\n\nvar _$1 = util;\n\n/**\n * get tag name\n *\n * @param {String} html e.g. ''\n * @return {String}\n */\nfunction getTagName(html) {\n var i = _$1.spaceIndex(html);\n var tagName;\n if (i === -1) {\n tagName = html.slice(1, -1);\n } else {\n tagName = html.slice(1, i + 1);\n }\n tagName = _$1.trim(tagName).toLowerCase();\n if (tagName.slice(0, 1) === \"/\") tagName = tagName.slice(1);\n if (tagName.slice(-1) === \"/\") tagName = tagName.slice(0, -1);\n return tagName;\n}\n\n/**\n * is close tag?\n *\n * @param {String} html 如:''\n * @return {Boolean}\n */\nfunction isClosing(html) {\n return html.slice(0, 2) === \"\") {\n rethtml += escapeHtml(html.slice(lastPos, tagStart));\n currentHtml = html.slice(tagStart, currentPos + 1);\n currentTagName = getTagName(currentHtml);\n rethtml += onTag(\n tagStart,\n rethtml.length,\n currentTagName,\n currentHtml,\n isClosing(currentHtml)\n );\n lastPos = currentPos + 1;\n tagStart = false;\n continue;\n }\n if (c === '\"' || c === \"'\") {\n var i = 1;\n var ic = html.charAt(currentPos - i);\n\n while (ic.trim() === \"\" || ic === \"=\") {\n if (ic === \"=\") {\n quoteStart = c;\n continue chariterator;\n }\n ic = html.charAt(currentPos - ++i);\n }\n }\n } else {\n if (c === quoteStart) {\n quoteStart = false;\n continue;\n }\n }\n }\n }\n if (lastPos < html.length) {\n rethtml += escapeHtml(html.substr(lastPos));\n }\n\n return rethtml;\n}\n\nvar REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9\\\\_:.-]/gim;\n\n/**\n * parse input attributes and returns processed attributes\n *\n * @param {String} html e.g. `href=\"#\" target=\"_blank\"`\n * @param {Function} onAttr e.g. `function (name, value)`\n * @return {String}\n */\nfunction parseAttr$1(html, onAttr) {\n\n var lastPos = 0;\n var lastMarkPos = 0;\n var retAttrs = [];\n var tmpName = false;\n var len = html.length;\n\n function addAttr(name, value) {\n name = _$1.trim(name);\n name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, \"\").toLowerCase();\n if (name.length < 1) return;\n var ret = onAttr(name, value || \"\");\n if (ret) retAttrs.push(ret);\n }\n\n // 逐个分析字符\n for (var i = 0; i < len; i++) {\n var c = html.charAt(i);\n var v, j;\n if (tmpName === false && c === \"=\") {\n tmpName = html.slice(lastPos, i);\n lastPos = i + 1;\n lastMarkPos = html.charAt(lastPos) === '\"' || html.charAt(lastPos) === \"'\" ? lastPos : findNextQuotationMark(html, i + 1);\n continue;\n }\n if (tmpName !== false) {\n if (\n i === lastMarkPos\n ) {\n j = html.indexOf(c, i + 1);\n if (j === -1) {\n break;\n } else {\n v = _$1.trim(html.slice(lastMarkPos + 1, j));\n addAttr(tmpName, v);\n tmpName = false;\n i = j;\n lastPos = i + 1;\n continue;\n }\n }\n }\n if (/\\s|\\n|\\t/.test(c)) {\n html = html.replace(/\\s|\\n|\\t/g, \" \");\n if (tmpName === false) {\n j = findNextEqual(html, i);\n if (j === -1) {\n v = _$1.trim(html.slice(lastPos, i));\n addAttr(v);\n tmpName = false;\n lastPos = i + 1;\n continue;\n } else {\n i = j - 1;\n continue;\n }\n } else {\n j = findBeforeEqual(html, i - 1);\n if (j === -1) {\n v = _$1.trim(html.slice(lastPos, i));\n v = stripQuoteWrap(v);\n addAttr(tmpName, v);\n tmpName = false;\n lastPos = i + 1;\n continue;\n } else {\n continue;\n }\n }\n }\n }\n\n if (lastPos < html.length) {\n if (tmpName === false) {\n addAttr(html.slice(lastPos));\n } else {\n addAttr(tmpName, stripQuoteWrap(_$1.trim(html.slice(lastPos))));\n }\n }\n\n return _$1.trim(retAttrs.join(\" \"));\n}\n\nfunction findNextEqual(str, i) {\n for (; i < str.length; i++) {\n var c = str[i];\n if (c === \" \") continue;\n if (c === \"=\") return i;\n return -1;\n }\n}\n\nfunction findNextQuotationMark(str, i) {\n for (; i < str.length; i++) {\n var c = str[i];\n if (c === \" \") continue;\n if (c === \"'\" || c === '\"') return i;\n return -1;\n }\n}\n\nfunction findBeforeEqual(str, i) {\n for (; i > 0; i--) {\n var c = str[i];\n if (c === \" \") continue;\n if (c === \"=\") return i;\n return -1;\n }\n}\n\nfunction isQuoteWrapString(text) {\n if (\n (text[0] === '\"' && text[text.length - 1] === '\"') ||\n (text[0] === \"'\" && text[text.length - 1] === \"'\")\n ) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction stripQuoteWrap(text) {\n if (isQuoteWrapString(text)) {\n return text.substr(1, text.length - 2);\n } else {\n return text;\n }\n}\n\nparser$1.parseTag = parseTag$1;\nparser$1.parseAttr = parseAttr$1;\n\n/**\n * filter xss\n *\n * @author Zongmin Lei\n */\n\nvar FilterCSS = lib.exports.FilterCSS;\nvar DEFAULT = _default$1;\nvar parser = parser$1;\nvar parseTag = parser.parseTag;\nvar parseAttr = parser.parseAttr;\nvar _ = util;\n\n/**\n * returns `true` if the input value is `undefined` or `null`\n *\n * @param {Object} obj\n * @return {Boolean}\n */\nfunction isNull(obj) {\n return obj === undefined || obj === null;\n}\n\n/**\n * get attributes for a tag\n *\n * @param {String} html\n * @return {Object}\n * - {String} html\n * - {Boolean} closing\n */\nfunction getAttrs(html) {\n var i = _.spaceIndex(html);\n if (i === -1) {\n return {\n html: \"\",\n closing: html[html.length - 2] === \"/\",\n };\n }\n html = _.trim(html.slice(i + 1, -1));\n var isClosing = html[html.length - 1] === \"/\";\n if (isClosing) html = _.trim(html.slice(0, -1));\n return {\n html: html,\n closing: isClosing,\n };\n}\n\n/**\n * shallow copy\n *\n * @param {Object} obj\n * @return {Object}\n */\nfunction shallowCopyObject(obj) {\n var ret = {};\n for (var i in obj) {\n ret[i] = obj[i];\n }\n return ret;\n}\n\nfunction keysToLowerCase(obj) {\n var ret = {};\n for (var i in obj) {\n if (Array.isArray(obj[i])) {\n ret[i.toLowerCase()] = obj[i].map(function (item) {\n return item.toLowerCase();\n });\n } else {\n ret[i.toLowerCase()] = obj[i];\n }\n }\n return ret;\n}\n\n/**\n * FilterXSS class\n *\n * @param {Object} options\n * whiteList (or allowList), onTag, onTagAttr, onIgnoreTag,\n * onIgnoreTagAttr, safeAttrValue, escapeHtml\n * stripIgnoreTagBody, allowCommentTag, stripBlankChar\n * css{whiteList, onAttr, onIgnoreAttr} `css=false` means don't use `cssfilter`\n */\nfunction FilterXSS(options) {\n options = shallowCopyObject(options || {});\n\n if (options.stripIgnoreTag) {\n if (options.onIgnoreTag) {\n console.error(\n 'Notes: cannot use these two options \"stripIgnoreTag\" and \"onIgnoreTag\" at the same time'\n );\n }\n options.onIgnoreTag = DEFAULT.onIgnoreTagStripAll;\n }\n if (options.whiteList || options.allowList) {\n options.whiteList = keysToLowerCase(options.whiteList || options.allowList);\n } else {\n options.whiteList = DEFAULT.whiteList;\n }\n\n options.onTag = options.onTag || DEFAULT.onTag;\n options.onTagAttr = options.onTagAttr || DEFAULT.onTagAttr;\n options.onIgnoreTag = options.onIgnoreTag || DEFAULT.onIgnoreTag;\n options.onIgnoreTagAttr = options.onIgnoreTagAttr || DEFAULT.onIgnoreTagAttr;\n options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;\n options.escapeHtml = options.escapeHtml || DEFAULT.escapeHtml;\n this.options = options;\n\n if (options.css === false) {\n this.cssFilter = false;\n } else {\n options.css = options.css || {};\n this.cssFilter = new FilterCSS(options.css);\n }\n}\n\n/**\n * start process and returns result\n *\n * @param {String} html\n * @return {String}\n */\nFilterXSS.prototype.process = function (html) {\n // compatible with the input\n html = html || \"\";\n html = html.toString();\n if (!html) return \"\";\n\n var me = this;\n var options = me.options;\n var whiteList = options.whiteList;\n var onTag = options.onTag;\n var onIgnoreTag = options.onIgnoreTag;\n var onTagAttr = options.onTagAttr;\n var onIgnoreTagAttr = options.onIgnoreTagAttr;\n var safeAttrValue = options.safeAttrValue;\n var escapeHtml = options.escapeHtml;\n var cssFilter = me.cssFilter;\n\n // remove invisible characters\n if (options.stripBlankChar) {\n html = DEFAULT.stripBlankChar(html);\n }\n\n // remove html comments\n if (!options.allowCommentTag) {\n html = DEFAULT.stripCommentTag(html);\n }\n\n // if enable stripIgnoreTagBody\n var stripIgnoreTagBody = false;\n if (options.stripIgnoreTagBody) {\n stripIgnoreTagBody = DEFAULT.StripTagBody(\n options.stripIgnoreTagBody,\n onIgnoreTag\n );\n onIgnoreTag = stripIgnoreTagBody.onIgnoreTag;\n }\n\n var retHtml = parseTag(\n html,\n function (sourcePosition, position, tag, html, isClosing) {\n var info = {\n sourcePosition: sourcePosition,\n position: position,\n isClosing: isClosing,\n isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag),\n };\n\n // call `onTag()`\n var ret = onTag(tag, html, info);\n if (!isNull(ret)) return ret;\n\n if (info.isWhite) {\n if (info.isClosing) {\n return \"\";\n }\n\n var attrs = getAttrs(html);\n var whiteAttrList = whiteList[tag];\n var attrsHtml = parseAttr(attrs.html, function (name, value) {\n // call `onTagAttr()`\n var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;\n var ret = onTagAttr(tag, name, value, isWhiteAttr);\n if (!isNull(ret)) return ret;\n\n if (isWhiteAttr) {\n // call `safeAttrValue()`\n value = safeAttrValue(tag, name, value, cssFilter);\n if (value) {\n return name + '=\"' + value + '\"';\n } else {\n return name;\n }\n } else {\n // call `onIgnoreTagAttr()`\n ret = onIgnoreTagAttr(tag, name, value, isWhiteAttr);\n if (!isNull(ret)) return ret;\n return;\n }\n });\n\n // build new tag html\n html = \"<\" + tag;\n if (attrsHtml) html += \" \" + attrsHtml;\n if (attrs.closing) html += \" /\";\n html += \">\";\n return html;\n } else {\n // call `onIgnoreTag()`\n ret = onIgnoreTag(tag, html, info);\n if (!isNull(ret)) return ret;\n return escapeHtml(html);\n }\n },\n escapeHtml\n );\n\n // if enable stripIgnoreTagBody\n if (stripIgnoreTagBody) {\n retHtml = stripIgnoreTagBody.remove(retHtml);\n }\n\n return retHtml;\n};\n\nvar xss = FilterXSS;\n\n/**\n * xss\n *\n * @author Zongmin Lei\n */\n\n(function (module, exports) {\n\tvar DEFAULT = _default$1;\n\tvar parser = parser$1;\n\tvar FilterXSS = xss;\n\n\t/**\n\t * filter xss function\n\t *\n\t * @param {String} html\n\t * @param {Object} options { whiteList, onTag, onTagAttr, onIgnoreTag, onIgnoreTagAttr, safeAttrValue, escapeHtml }\n\t * @return {String}\n\t */\n\tfunction filterXSS(html, options) {\n\t var xss = new FilterXSS(options);\n\t return xss.process(html);\n\t}\n\n\texports = module.exports = filterXSS;\n\texports.filterXSS = filterXSS;\n\texports.FilterXSS = FilterXSS;\n\n\t(function () {\n\t for (var i in DEFAULT) {\n\t exports[i] = DEFAULT[i];\n\t }\n\t for (var j in parser) {\n\t exports[j] = parser[j];\n\t }\n\t})();\n\n\t// using `xss` on the WebWorker, output `filterXSS` to the globals\n\tfunction isWorkerEnv() {\n\t return (\n\t typeof self !== \"undefined\" &&\n\t typeof DedicatedWorkerGlobalScope !== \"undefined\" &&\n\t self instanceof DedicatedWorkerGlobalScope\n\t );\n\t}\n\tif (isWorkerEnv()) {\n\t self.filterXSS = module.exports;\n\t}\n} (lib$1, lib$1.exports));\n\n/* Copyright (c) 2020 Environmental Systems Research Institute, Inc.\n * Apache-2.0\n *\n * js-xss\n * Copyright (c) 2012-2018 Zongmin Lei(雷宗民) \n * http://ucdok.com\n * The MIT License, see\n * https://github.com/leizongmin/js-xss/blob/master/LICENSE for details\n * */\n/**\n * The Sanitizer Class\n *\n * @export\n * @class Sanitizer\n */\nvar Sanitizer = /** @class */ (function () {\n function Sanitizer(filterOptions, extendDefaults) {\n var _this = this;\n // Supported HTML Spec: https://doc.arcgis.com/en/arcgis-online/reference/supported-html.htm\n this.arcgisWhiteList = {\n a: [\"href\", \"style\", \"target\"],\n abbr: [\"title\"],\n audio: [\"autoplay\", \"controls\", \"loop\", \"muted\", \"preload\"],\n b: [],\n br: [],\n dd: [\"style\"],\n div: [\"align\", \"style\"],\n dl: [\"style\"],\n dt: [\"style\"],\n em: [],\n figcaption: [\"style\"],\n figure: [\"style\"],\n font: [\"color\", \"face\", \"size\", \"style\"],\n h1: [\"style\"],\n h2: [\"style\"],\n h3: [\"style\"],\n h4: [\"style\"],\n h5: [\"style\"],\n h6: [\"style\"],\n hr: [],\n i: [],\n img: [\"alt\", \"border\", \"height\", \"src\", \"style\", \"width\"],\n li: [],\n ol: [],\n p: [\"style\"],\n source: [\"media\", \"src\", \"type\"],\n span: [\"style\"],\n strong: [],\n sub: [\"style\"],\n sup: [\"style\"],\n table: [\"border\", \"cellpadding\", \"cellspacing\", \"height\", \"style\", \"width\"],\n tbody: [],\n tr: [\"align\", \"height\", \"style\", \"valign\"],\n td: [\n \"align\",\n \"colspan\",\n \"height\",\n \"nowrap\",\n \"rowspan\",\n \"style\",\n \"valign\",\n \"width\",\n ],\n th: [\n \"align\",\n \"colspan\",\n \"height\",\n \"nowrap\",\n \"rowspan\",\n \"style\",\n \"valign\",\n \"width\",\n ],\n u: [],\n ul: [],\n video: [\n \"autoplay\",\n \"controls\",\n \"height\",\n \"loop\",\n \"muted\",\n \"poster\",\n \"preload\",\n \"width\",\n ],\n };\n this.allowedProtocols = [\n \"http\",\n \"https\",\n \"mailto\",\n \"iform\",\n \"tel\",\n \"flow\",\n \"lfmobile\",\n \"arcgis-navigator\",\n \"arcgis-appstudio-player\",\n \"arcgis-survey123\",\n \"arcgis-collector\",\n \"arcgis-workforce\",\n \"arcgis-explorer\",\n \"arcgis-trek2there\",\n \"arcgis-quickcapture\",\n \"mspbi\",\n \"comgooglemaps\",\n \"pdfefile\",\n \"pdfehttp\",\n \"pdfehttps\",\n \"boxapp\",\n \"boxemm\",\n \"awb\",\n \"awbs\",\n \"gropen\",\n \"radarscope\",\n ];\n this.arcgisFilterOptions = {\n allowCommentTag: true,\n safeAttrValue: function (tag, name, value, cssFilter) {\n // Take over safe attribute filtering for `a` `href`, `img` `src`,\n // and `source` `src` attributes, otherwise pass onto the\n // default `XSS.safeAttrValue` method.\n if ((tag === \"a\" && name === \"href\") ||\n ((tag === \"img\" || tag === \"source\") && name === \"src\")) {\n return _this.sanitizeUrl(value);\n }\n return lib$1.exports.safeAttrValue(tag, name, value, cssFilter);\n },\n };\n this._entityMap = {\n \"&\": \"8\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"/\": \"/\",\n };\n var xssFilterOptions;\n if (filterOptions && !extendDefaults) {\n // Override the defaults\n xssFilterOptions = filterOptions;\n }\n else if (filterOptions && extendDefaults) {\n // Extend the defaults\n xssFilterOptions = Object.create(this.arcgisFilterOptions);\n Object.keys(filterOptions).forEach(function (key) {\n if (key === \"whiteList\") {\n // Extend the whitelist by concatenating arrays\n xssFilterOptions.whiteList = _this._extendObjectOfArrays([\n _this.arcgisWhiteList,\n filterOptions.whiteList || {},\n ]);\n }\n else {\n xssFilterOptions[key] = filterOptions[key];\n }\n });\n }\n else {\n // Only use the defaults\n xssFilterOptions = Object.create(this.arcgisFilterOptions);\n xssFilterOptions.whiteList = this.arcgisWhiteList;\n }\n this.xssFilterOptions = xssFilterOptions;\n // Make this readable to tests\n this._xssFilter = new lib$1.exports.FilterXSS(xssFilterOptions);\n }\n /**\n * Sanitizes value to remove invalid HTML tags.\n *\n * Note: If the value passed does not contain a valid JSON data type (String,\n * Number, JSON Object, Array, Boolean, or null), the value will be nullified.\n *\n * @param {any} value The value to sanitize.\n * @returns {any} The sanitized value.\n * @memberof Sanitizer\n */\n Sanitizer.prototype.sanitize = function (value, options) {\n if (options === void 0) { options = {}; }\n switch (typeof value) {\n case \"number\":\n if (isNaN(value) || !isFinite(value)) {\n return null;\n }\n return value;\n case \"boolean\":\n return value;\n case \"string\":\n return this._xssFilter.process(value);\n case \"object\":\n return this._iterateOverObject(value, options);\n default:\n if (options.allowUndefined && typeof value === \"undefined\") {\n return;\n }\n return null;\n }\n };\n /**\n * Sanitizes a URL string following the allowed protocols and sanitization rules.\n *\n * @param {string} value The URL to sanitize.\n * @param {{ isProtocolRequired: boolean }} options Configuration options for URL checking.\n * @returns {string} The sanitized URL if it's valid, or an empty string if the URL is invalid.\n */\n Sanitizer.prototype.sanitizeUrl = function (value, options) {\n var _a = (options !== null && options !== void 0 ? options : {}).isProtocolRequired, isProtocolRequired = _a === void 0 ? true : _a;\n var protocol = this._trim(value.substring(0, value.indexOf(\":\")));\n var isRootUrl = value === '/';\n var isUrlFragment = /^#/.test(value);\n var isValidProtocol = protocol && this.allowedProtocols.indexOf(protocol.toLowerCase()) > -1;\n if (isRootUrl || isUrlFragment || isValidProtocol) {\n return lib$1.exports.escapeAttrValue(value);\n }\n if (!protocol && !isProtocolRequired) {\n return lib$1.exports.escapeAttrValue(\"https://\".concat(value));\n }\n return \"\";\n };\n /**\n * Sanitizes an HTML attribute value.\n *\n * @param {string} tag The tagname of the HTML element.\n * @param {string} attribute The attribute name of the HTML element.\n * @param {string} value The raw value to be used for the HTML attribute value.\n * @param {XSS.ICSSFilter} [cssFilter] The CSS filter to be used.\n * @returns {string} The sanitized attribute value.\n * @memberof Sanitizer\n */\n Sanitizer.prototype.sanitizeHTMLAttribute = function (tag, attribute, value, cssFilter) {\n // use the custom safeAttrValue function if provided\n if (typeof this.xssFilterOptions.safeAttrValue === \"function\") {\n return this.xssFilterOptions.safeAttrValue(tag, attribute, value, \n // @ts-expect-error safeAttrValue does handle undefined cssFilter\n cssFilter);\n }\n // otherwise use the default\n // @ts-ignore safeAttrValue does handle undefined cssFilter\n return lib$1.exports.safeAttrValue(tag, attribute, value, cssFilter);\n };\n /**\n * Checks if a value only contains valid HTML.\n *\n * @param {any} value The value to validate.\n * @returns {boolean}\n * @memberof Sanitizer\n */\n Sanitizer.prototype.validate = function (value, options) {\n if (options === void 0) { options = {}; }\n var sanitized = this.sanitize(value, options);\n return {\n isValid: value === sanitized,\n sanitized: sanitized,\n };\n };\n /**\n * Encodes the following characters, `& < > \\\" ' /` to their hexadecimal HTML entity code.\n * Example: \"·\" => \"8middot;\"\n *\n * @param {string} value The value to encode.\n * @returns {string} The encoded string value.\n * @memberof Sanitizer\n */\n Sanitizer.prototype.encodeHTML = function (value) {\n var _this = this;\n return String(value).replace(/[&<>\"'\\/]/g, function (s) {\n return _this._entityMap[s];\n });\n };\n /**\n * Encodes all non-alphanumeric ASCII characters to their hexadecimal HTML entity codes.\n * Example: \"alert(document.cookie)\" => \"alert(document.cookie)\"\n *\n * @param {string} value The value to encode.\n * @returns {string} The encoded string value.\n * @memberof Sanitizer\n */\n Sanitizer.prototype.encodeAttrValue = function (value) {\n var alphanumericRE = /^[a-zA-Z0-9]$/;\n return String(value).replace(/[\\x00-\\xFF]/g, function (c, idx) {\n return !alphanumericRE.test(c)\n ? \"&#x\".concat(Number(value.charCodeAt(idx)).toString(16), \";\")\n : c;\n });\n };\n /**\n * Extends an object of arrays by by concatenating arrays of the same object\n * keys. If the if the previous key's value is not an array, the next key's\n * value will replace the previous key. This method is used for extending the\n * whiteList in the XSS filter options.\n *\n * @private\n * @param {Array<{}>} objects An array of objects.\n * @returns {{}} The extended object.\n * @memberof Sanitizer\n */\n Sanitizer.prototype._extendObjectOfArrays = function (objects) {\n var finalObj = {};\n objects.forEach(function (obj) {\n Object.keys(obj).forEach(function (key) {\n if (Array.isArray(obj[key]) && Array.isArray(finalObj[key])) {\n finalObj[key] = finalObj[key].concat(obj[key]);\n }\n else {\n finalObj[key] = obj[key];\n }\n });\n });\n return finalObj;\n };\n /**\n * Iterate over a plain object or array to deeply sanitize each value.\n *\n * @private\n * @param {object} obj The object to iterate over.\n * @returns {(object | null)} The sanitized object.\n * @memberof Sanitizer\n */\n Sanitizer.prototype._iterateOverObject = function (obj, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n try {\n var hasChanged_1 = false;\n var changedObj = void 0;\n if (Array.isArray(obj)) {\n changedObj = obj.reduce(function (prev, value) {\n var validation = _this.validate(value, options);\n if (validation.isValid) {\n return prev.concat([value]);\n }\n else {\n hasChanged_1 = true;\n return prev.concat([validation.sanitized]);\n }\n }, []);\n }\n else if (!isPlainObject(obj)) {\n if (options.allowUndefined && typeof obj === \"undefined\") {\n return;\n }\n return null;\n }\n else {\n var keys = Object.keys(obj);\n changedObj = keys.reduce(function (prev, key) {\n var value = obj[key];\n var validation = _this.validate(value, options);\n if (validation.isValid) {\n prev[key] = value;\n }\n else {\n hasChanged_1 = true;\n prev[key] = validation.sanitized;\n }\n return prev;\n }, {});\n }\n if (hasChanged_1) {\n return changedObj;\n }\n return obj;\n }\n catch (err) {\n return null;\n }\n };\n /**\n * Trim whitespace from the start and ends of a string.\n * @param {string} val The string to trim.\n * @returns {string} The trimmed string.\n */\n Sanitizer.prototype._trim = function (val) {\n // @ts-ignore This is used by Jest,\n // but TypeScript errors since it assumes `trim` is always available.\n return String.prototype.trim\n ? val.trim()\n : val.replace(/(^\\s*)|(\\s*$)/g, \"\");\n };\n return Sanitizer;\n}());\n\nexport { Sanitizer, Sanitizer as default };\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n=new Map;function t(){n.clear()}function e(t){return n.get(t)}function c(t,e){n.set(t,e)}function o(t){n.delete(t)}export{t as clearVNodeCache,o as deleteVNodeCache,e as getVNodeCache,c as setVNodeCache};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"@esri/arcgis-html-sanitizer\";import t from\"../../core/ArrayPool.js\";import{handlesGroup as n,makeHandle as r}from\"../../core/handleUtils.js\";import\"../../core/has.js\";import i from\"../../core/Logger.js\";import{watch as o,syncAndInitial as s}from\"../../core/reactiveUtils.js\";import{clearVNodeCache as a}from\"./vnodeCache.js\";var c,l,d=function(e){if(\"WebkitTransition\"in e.style)c=\"webkitTransitionEnd\",l=\"webkitAnimationEnd\";else{if(!(\"transition\"in e.style))throw new Error(\"Your browser is not supported!\");c=\"transitionend\",l=\"animationend\"}},u=function(e){c||d(e)},p=function(e,t){return void 0===t&&(t=e+\"-active\"),function(n){u(n);var r=!1,i=function(o){r||(r=!0,n.removeEventListener(c,i),n.removeEventListener(l,i),n.classList.remove(e),n.classList.remove(t))};n.classList.add(e),n.addEventListener(c,i),n.addEventListener(l,i),requestAnimationFrame((function(){n.classList.add(t)}))}},f=function(e,t){return void 0===t&&(t=e+\"-active\"),function(n,r){u(n);var i=!1,o=function(e){i||(i=!0,n.removeEventListener(c,o),n.removeEventListener(l,o),r())};n.classList.add(e),n.addEventListener(c,o),n.addEventListener(l,o),requestAnimationFrame((function(){n.classList.add(t)}))}};const m=i.getLogger(\"esri.widgets.support.widgetUtils\");function g(e){const n=t.acquire();for(let t=0;t{const e=new Map,t=new ResizeObserver((t=>{a();for(const n of t)e.get(n.target)?.(n)})),i=(n,i,o)=>(e.has(n)&&m.error(\"Already observing element\",n),e.set(n,i),t.observe(n,o),r((()=>{t.unobserve(n),e.delete(n)})));return(e,t,a)=>{let c=null;return n([o((()=>\"function\"==typeof e?e():e),(e=>{c?.remove(),e&&(c=i(e,t,a))}),s),r((()=>c?.remove()))])}})();function v(e){const t=e?.closest(\"[dir]\");return null!==t&&t instanceof HTMLElement&&\"rtl\"===t.dir||\"rtl\"===document.dir}function w(e){return v(e)?\"rtl\":\"ltr\"}function L(e){const t=\"data-node-ref\";this[e.getAttribute(t)]=null}function b(e){const t=\"data-node-ref\";this[e.getAttribute(t)]=e}function y(e,t){return(\"enter\"===e?p:f)(t)}const E=[\"dd\",\"dl\",\"dt\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"sub\",\"sup\",...[\"animate\",\"animatetransform\",\"circle\",\"clippath\",\"defs\",\"ellipse\",\"g\",\"image\",\"line\",\"lineargradient\",\"marker\",\"mask\",\"path\",\"pattern\",\"polygon\",\"polyline\",\"radialgradient\",\"rect\",\"stop\",\"svg\",\"switch\",\"symbol\",\"text\",\"textpath\",\"tspan\",\"use\"]],A=E.reduce(((e,t)=>(e[t]=[],e)),{}),j=[\"align\",\"alink\",\"alt\",\"bgcolor\",\"border\",\"cellpadding\",\"cellspacing\",\"class\",\"color\",\"cols\",\"colspan\",\"coords\",\"d\",\"dir\",\"face\",\"height\",\"hspace\",\"ismap\",\"lang\",\"marginheight\",\"marginwidth\",\"multiple\",\"nohref\",\"noresize\",\"noshade\",\"nowrap\",\"ref\",\"rel\",\"rev\",\"rows\",\"rowspan\",\"scrolling\",\"shape\",\"span\",\"summary\",\"tabindex\",\"title\",\"usemap\",\"valign\",\"value\",\"vlink\",\"vspace\",\"width\"],k=new e({whiteList:A,onTagAttr:(e,t,n)=>{const r=`${t}=\"${n}\"`;if(j.includes(t))return r},stripIgnoreTag:!0,stripIgnoreTagBody:[\"script\",\"style\"]},!0);function T(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top+n.height,o=r.top+r.height,s=n.top,a=r.top;(i>o||s{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},s=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),l=e=>{if(\"string\"!=typeof e)throw new Error(\"Style values must be strings\")},p=(e,t,r)=>{if(\"\"!==t.vnodeSelector)for(let o=r;o{let i=e[t];if(\"\"===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let l=0;l{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},f=[],c=!1,u=e=>{(e.children||[]).forEach(u),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},m=()=>{c=!1,f.forEach(u),f.length=0},h=e=>{f.push(e),c||(c=!0,\"undefined\"!=typeof window&&\"requestIdleCallback\"in window?window.requestIdleCallback(m,{timeout:16}):setTimeout(m,16))},v=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents=\"none\";let o=()=>{t.parentNode&&(t.parentNode.removeChild(t),h(e))};return void r(t,o,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),h(e))},y=(t,i,n)=>{if(!i)return;let s=n.eventHandlerInterceptor,p=Object.keys(i),d=p.length;for(let a=0;a{if(t)for(let o of t)x(o,e,void 0,r)},w=(e,t,r)=>{b(e,t.children,r),t.text&&(e.textContent=t.text),y(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},x=(e,t,o,i)=>{let s,l=0,p=e.vnodeSelector,d=t.ownerDocument;if(\"\"===p)s=e.domNode=d.createTextNode(e.text),void 0!==o?t.insertBefore(s,o):t.appendChild(s);else{for(let a=0;a<=p.length;++a){let f=p.charAt(a);if(a===p.length||\".\"===f||\"#\"===f){let f=p.charAt(l-1),c=p.slice(l,a);\".\"===f?s.classList.add(c):\"#\"===f?s.id=c:(\"svg\"===c&&(i=n(i,{namespace:r})),void 0!==i.namespace?s=e.domNode=d.createElementNS(i.namespace,c):(s=e.domNode=e.domNode||d.createElement(c),\"input\"===c&&e.properties&&void 0!==e.properties.type&&s.setAttribute(\"type\",e.properties.type)),void 0!==o?t.insertBefore(s,o):s.parentNode!==t&&t.appendChild(s)),l=a+1}}w(s,e,i)}},k=(e,t,r)=>{t&&t.split(\" \").forEach((t=>{t&&e.classList.toggle(t,r)}))},A=(t,i,n,s)=>{if(!n)return;let p=!1,d=Object.keys(n),a=d.length;for(let f=0;f{if(r===o)return!1;o=o||i;let l,f=(r=r||i).length,c=o.length,u=0,m=0,h=!1;for(;m=0){for(l=u;lu)for(l=u;l{let i=e.domNode,s=!1;if(e===t)return!1;let l=!1;if(\"\"===t.vnodeSelector){if(t.text!==e.text){let e=i.ownerDocument.createTextNode(t.text);return i.parentNode.replaceChild(e,i),t.domNode=e,s=!0,s}t.domNode=i}else 0===t.vnodeSelector.lastIndexOf(\"svg\",0)&&(o=n(o,{namespace:r})),e.text!==t.text&&(l=!0,void 0===t.text?i.removeChild(i.firstChild):i.textContent=t.text),t.domNode=i,l=S(t,i,e.children,t.children,o)||l,l=A(i,e.properties,t.properties,o)||l,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[i,o,t.vnodeSelector,t.properties,t.children]);return l&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(i,t.properties,e.properties),s};let C=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error(\"The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)\");let o=e;e=r,N(o,r,t)},domNode:e.domNode});export{x as createDom,C as createProjection,n as extend,w as initPropertiesAndChildren};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{extend as e,createDom as r,createProjection as o,initPropertiesAndChildren as t}from\"./projection.js\";const p={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,r,o)=>{\"-\"===r.charAt(0)?e.style.setProperty(r,o):e.style[r]=o}};let d=r=>e(p,r),n={create:(e,t)=>(t=d(t),r(e,document.createElement(\"div\"),void 0,t),o(e,t)),append:(e,t,p)=>(p=d(p),r(t,e,void 0,p),o(t,p)),insertBefore:(e,t,p)=>(p=d(p),r(t,e.parentNode,e,p),o(t,p)),merge:(e,r,p)=>(p=d(p),r.domNode=e,t(e,r,p),o(r,p)),replace:(e,t,p)=>(p=d(p),r(t,e.parentNode,e,p),e.parentNode.removeChild(e),o(t,p))};export{d as applyDefaultProjectionOptions,n as dom};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{applyDefaultProjectionOptions as e,dom as r}from\"./dom.js\";let t,n=(e,r)=>{let t=[];for(;e&&e!==r;)t.push(e),e=e.parentNode;return t};t=Array.prototype.find?(e,r)=>e.find(r):(e,r)=>e.filter(r)[0];let o=(e,r)=>{let n=e;return r.forEach((e=>{n=n&&n.children?t(n.children,(r=>r.domNode===e)):void 0})),n},d=(e,r,t)=>{let d=function(d){t(\"domEvent\",d);let i=r(),p=n(d.currentTarget,i.domNode);p.reverse();let l,a=o(i.getLastRender(),p);return e.scheduleRender(),a&&(l=a.properties[`on${d.type}`].apply(a.properties.bind||this,arguments)),t(\"domEventProcessed\",d),l};return(e,r,t,n)=>d},i=t=>{let n,o,i=e(t),p=i.performanceLogger,l=!0,a=!1,s=[],c=[],u=(e,r,t)=>{let o,l=()=>o;i.eventHandlerInterceptor=d(n,l,p),o=e(r,t(),i),s.push(o),c.push(t)},f=()=>{if(o=void 0,l){l=!1,p(\"renderStart\",void 0);for(let e=0;e{o||a||(o=requestAnimationFrame(f))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),a=!0},resume:()=>{a=!1,l=!0,n.scheduleRender()},append:(e,t)=>{u(r.append,e,t)},insertBefore:(e,t)=>{u(r.insertBefore,e,t)},merge:(e,t)=>{u(r.merge,e,t)},replace:(e,t)=>{u(r.replace,e,t)},detach:e=>{for(let r=0;r0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement(\"div\");t.className=\"esri-overlay-surface\",this._set(\"surface\",t),this._hiddenSurface=document.createElement(\"div\"),this._hiddenSurface.setAttribute(\"style\",\"visibility: hidden;\"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange((()=>this.items),(t=>{for(const e of t.added){const t=()=>e.render();this._callbacks.set(e,t),this._projector.append(this.surface,t)}for(const e of t.removed){const t=this._projector.detach(this._callbacks.get(e));this.surface.removeChild(t.domNode),this._callbacks.delete(e)}}))}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach((t=>this._projector.detach(t))),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,o=this._hiddenProjector;let r;const s=()=>(r=t.render(),r);o.append(e,s),o.renderNow();const i={left:0,top:0,right:0,bottom:0};if(r?.domNode){const t=r.domNode.getBoundingClientRect();i.left=t.left,i.top=t.top,i.right=t.right,i.bottom=t.bottom}for(o.detach(s);e.firstChild;)e.removeChild(e.firstChild);return i}overlaps(t,e){const o=this.computeBoundingRect(t),r=this.computeBoundingRect(e);return Math.max(o.left,r.left)<=Math.min(o.right,r.right)&&Math.max(o.top,r.top)<=Math.min(o.bottom,r.bottom)}get hasVisibleItems(){return this.items.some((t=>t.visible))}async prepare(){await document.fonts.load(this._fontString()).catch((()=>{}))}renderCanvas(t,e){const o=!!e?.disableDecorations;if(!this.items.some((t=>t.visible&&!(o&&t.isDecoration))))return;const r=t.getContext(\"2d\");r.save(),r.font=this._fontString(),this.items.forEach((t=>{o&&t.isDecoration||(r.save(),t.renderCanvas(r),r.restore())})),r.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};t([r({readOnly:!0})],a.prototype,\"surface\",void 0),t([r({readOnly:!0})],a.prototype,\"items\",void 0),t([r({readOnly:!0})],a.prototype,\"needsRender\",null),t([r({readOnly:!0})],a.prototype,\"_watchUpdatingTracking\",void 0),t([r({readOnly:!0})],a.prototype,\"updating\",null),a=t([s(\"esri.views.overlay.ViewOverlay\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../intl.js\";import{byId as t,reparent as s,empty as i}from\"../core/domUtils.js\";import{on as r}from\"../core/events.js\";import has from\"../core/has.js\";import o from\"../core/Logger.js\";import{destroyMaybe as n,removeMaybe as a}from\"../core/maybe.js\";import{watch as h,initial as d,whenOnce as l}from\"../core/reactiveUtils.js\";import{addFrameTask as u}from\"../core/scheduling.js\";import{property as c}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import m from\"./overlay/ViewOverlay.js\";import{onLocaleChange as f}from\"../intl/locale.js\";import{fetchMessageBundle as y}from\"../intl/messages.js\";const g=[0,0];function _(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return g[0]=s.left+(t?.pageXOffset??0),g[1]=s.top+(t?.pageYOffset??0),g}function v(e){e&&(i(e),e.parentNode&&e.parentNode.removeChild(e))}function w(e){const t=document.createElement(\"div\");return e.appendChild(t),t}const C=16,H=750,j=512,O=2,z=i=>{let g=class extends i{constructor(...e){super(...e),this._freqInfo={freq:C,time:H},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([h((()=>this.cursor),(e=>{const{surface:t}=this;t&&t.setAttribute(\"data-cursor\",e)})),h((()=>this.navigating),(e=>{const{surface:t}=this;t&&t.setAttribute(\"data-navigating\",e.toString())}))])}initialize(){const e=has(\"mac\"),t=async()=>{e&&(await l((()=>this.ready)),this.messagesCommon=await y(\"esri/t9n/common\").catch((()=>{})))};t(),this.addHandles([h((()=>this.ui),((e,t)=>this._handleUIChange(e,t)),d),this.on(\"focus\",(()=>this.notifyChange(\"focused\"))),this.on(\"blur\",(()=>this.notifyChange(\"focused\"))),f(t)])}destroy(){this.destroyed||(this.ui=n(this.ui),this.container=null)}get container(){return this._get(\"container\")??null}set container(e){const i=this._get(\"container\"),r=t(e);if(r||\"string\"!=typeof e||o.getLogger(this).error(\"#container\",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove(\"esri-view\"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set(\"overlay\",null)),this.root&&(v(this.root),this._set(\"root\",null)),this.userContent&&(s(this.userContent,i),v(this.userContent),this._set(\"userContent\",null))),!r)return this._set(\"width\",0),this._set(\"height\",0),this._set(\"position\",null),this._set(\"suspended\",!0),this._set(\"surface\",null),void this._set(\"container\",null);r.classList.add(\"esri-view\");const n=document.createElement(\"div\");n.className=\"esri-view-user-storage\",s(r,n),r.appendChild(n),this._set(\"userContent\",n);const d=document.createElement(\"div\");d.className=\"esri-view-root\",r.insertBefore(d,r.firstChild),this._set(\"root\",d);const l=document.createElement(\"div\");l.className=\"esri-view-surface\",l.setAttribute(\"role\",\"application\"),l.tabIndex=0,d.appendChild(l),this._set(\"surface\",l);const c=new m;d.appendChild(c.surface),this._set(\"overlay\",c),this.addHandles(h((()=>c.needsRender),(e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=u({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=a(this._overlayRenderTaskHandle)}))),this.forceDOMReadyCycle(),this._set(\"container\",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_handleUIChange(e,t){this.removeHandles(\"ui\"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(h((()=>this.root),(t=>{e.container=t?w(t):null}),d),\"ui\")),this._set(\"ui\",e)}_stopMeasuring(){this.removeHandles(\"measuring\"),this._get(\"resizing\")&&this._set(\"resizing\",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=C,e.time=H,this.addHandles([r(window,\"resize\",(()=>{e.freq=C,e.time=H})),u({prepare:e=>{const t=this._measure(),s=this._freqInfo;if(s.time+=e.deltaTime,t&&(s.freq=C,this._get(\"resizing\")||this._set(\"resizing\",!0)),s.time=j&&this._get(\"resizing\")&&this._set(\"resizing\",!1)}})],\"measuring\"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set(\"suspended\",!0),!1;const i=this.width,r=this.height;return t===i&&s===r?(this.suspended&&this._set(\"suspended\",!1),!1):(this._set(\"width\",t),this._set(\"height\",s),this.suspended&&this._set(\"suspended\",!1),this.emit(\"resize\",{oldWidth:i,oldHeight:r,width:t,height:s}),!0)}_position(){const e=this.container,t=this.position,s=e&&_(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set(\"position\",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([c()],g.prototype,\"container\",null),e([c({readOnly:!0})],g.prototype,\"focused\",null),e([c({readOnly:!0})],g.prototype,\"height\",void 0),e([c()],g.prototype,\"messagesCommon\",void 0),e([c({type:m})],g.prototype,\"overlay\",void 0),e([c({readOnly:!0})],g.prototype,\"position\",void 0),e([c({readOnly:!0})],g.prototype,\"resizing\",void 0),e([c({readOnly:!0})],g.prototype,\"root\",void 0),e([c({value:null,readOnly:!0})],g.prototype,\"size\",null),e([c({readOnly:!0})],g.prototype,\"surface\",void 0),e([c({readOnly:!0})],g.prototype,\"suspended\",void 0),e([c()],g.prototype,\"ui\",void 0),e([c({readOnly:!0})],g.prototype,\"userContent\",void 0),e([c({readOnly:!0})],g.prototype,\"width\",void 0),e([c()],g.prototype,\"widthBreakpoint\",void 0),g=e([p(\"esri.views.DOMContainer\")],g),g};export{z as DOMContainer};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ReentrantObjectPool as e}from\"../../../core/ReentrantObjectPool.js\";import{afterDispatch as t,isValueInUse as r}from\"../../../core/accessorSupport/watch.js\";class o{constructor(r,o){this._owner=o,this._properties={},this._afterDispatchHandle=null;for(const t in r){const o=r[t],s=new e(o,void 0,void 0,2,2);this._properties[t]={pool:s,acquired:[]}}this._afterDispatchHandle=t((()=>this._release()))}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const t=this._properties[e];for(const e of t.acquired)r(e)||t.pool.release(e);t.pool.destroy(),t.pool=null,t.acquired=null}this._properties=null,this._owner=null}get(e){const t=this._owner._get(e),r=this._properties[e];let o=r.pool.acquire();for(r.acquired.push(o);o===t;)r.acquired.push(o),o=r.pool.acquire();return o}_release(){for(const e in this._properties){const t=this._properties[e];let o=0;for(const e of t.acquired)r(e)?t.acquired[o++]=e:t.pool.release(e);t.acquired.length=o}}}export{o as PropertiesPool};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{eventKey as r}from\"../../core/events.js\";import has from\"../../core/has.js\";const e=has(\"mac\")?\"Meta\":\"Ctrl\",t={8:\"Backspace\",9:\"Tab\",13:\"Enter\",27:\"Escape\",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\"};for(let n=48;n<58;n++)t[n]=String.fromCharCode(n);for(let n=1;n<25;n++)t[111+n]=`F${n}`;for(let n=65;n<91;n++)t[n]=[String.fromCharCode(n+32),String.fromCharCode(n)];function o(e){if(void 0!==e.key)return r(e);const o=t[e.keyCode];return Array.isArray(o)?e.shiftKey?o[1]:o[0]:o}function a(r){switch(r){case\"Ctrl\":case\"Alt\":case\"Shift\":case\"Meta\":case\"Primary\":return!0}return!1}export{o as eventKey,a as isSystemModifier,e as primaryKey};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass e{constructor(e,t=[]){this.eventType=e,this.keyModifiers=t}matches(e){if(e.type!==this.eventType)return!1;if(0===this.keyModifiers.length)return!0;const t=e.modifiers;for(const i of this.keyModifiers)if(!t.has(i))return!1;return!0}}export{e as EventMatch};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Logger.js\";import{EventMatch as t}from\"./EventMatch.js\";const n=e.getLogger(\"esri.views.input.InputHandler\");class i{constructor(e){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=e}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const e in this._incoming){const t=this._incoming[e];for(const e of t)this._incomingEventMatches.push(e.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map((e=>e.eventType))),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(e){this._manager?n.error(\"This InputHandler has already been registered with an InputManager\"):(e.setEventCallback((e=>this._handleEvent(e))),e.setUninstallCallback((()=>this._onUninstall())),this._manager=e)}onUninstall(){}registerIncoming(e,n,i){let a;\"function\"==typeof n?(i=n,a=[]):a=n||[];const o=\"string\"==typeof e?new t(e,a):e,h=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},r=e=>{const t=this._incoming[e.match.eventType];if(t){const n=t.indexOf(e);t.splice(n,1),h(),this._manager&&this._manager.updateDependencies()}},g=new s(o,i,{onPause:r,onRemove:r,onResume:e=>{const t=this._incoming[e.match.eventType];t&&!t.includes(e)&&(t.push(e),h(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[o.eventType];return c||(c=[],this._incoming[o.eventType]=c),c.push(g),h(),this._manager&&this._manager.updateDependencies(),g}registerOutgoing(e){if(this._outgoing[e])throw new Error(\"There is already a callback registered for this outgoing InputEvent: \"+e);const t=new a(e,{onEmit:(e,t,n,i)=>{this._manager?.emit(e.eventType,t,n,i)},onRemove:e=>{delete this._outgoing[e.eventType],this._manager?.updateDependencies()}});return this._outgoing[e]=t,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),t}startCapturingPointer(e){this._manager?.setPointerCapture(e,!0)}stopCapturingPointer(e){this._manager?.setPointerCapture(e,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):n.error(\"This InputHandler is not registered with an InputManager\")}_handleEvent(e){const t=this._incoming[e.type];if(t)for(const n of t)if(n.match.matches(e)&&(n.callback?.(e),e.shouldStopPropagation()))break}}class s{constructor(e,t,n){this.match=e,this._callback=t,this._handler=n}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}}class a{constructor(e,t){this.eventType=e,this._removed=!1,this._handler=t}emit(e,t,n){this._removed||this._handler.onEmit(this,e,t,n)}remove(){this._removed=!0,this._handler.onRemove(this)}}export{i as InputHandler};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{InputHandler as t}from\"../InputHandler.js\";class s extends t{constructor(t){super(!0),this._onChange=t,this._value=\"mouse\",this._x=null,this._y=null,this.registerIncoming(\"pointer-move\",(t=>{this._update(t.data)}))}_update(t){const s=\"touch\"===t.native.pointerType?\"touch\":\"mouse\",{x:e,y:i}=t;s===this._value&&this._x===e&&this._y===i||(this._value=s,this._x=e,this._y=i,this._onChange(s,e,i))}}export{s as LatestPointer};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{equalsShallow as t}from\"./lang.js\";import{trackAccess as e}from\"./accessorSupport/tracking.js\";import{SimpleObservable as s}from\"./accessorSupport/tracking/SimpleObservable.js\";class i{constructor(t,e){this._observable=new s,this._value=t,this._equalityFunction=e}get value(){return e(this._observable),this._value}set value(t){this._equalityFunction(t,this._value)||(this._value=t,this._observable.notify())}mutate(t){t(this._value),this._observable.notify()}}function r(e,s=t){return new i(e,s)}export{r as signal};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{signal as t}from\"../../../core/signal.js\";import{InputHandler as e}from\"../InputHandler.js\";class i extends e{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=t(!1),this._onPointerAdd=({data:t})=>{\"touch\"===t.pointerType&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{\"touch\"===t.pointerType&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming(\"pointer-down\",this._onPointerAdd),this.registerIncoming(\"pointer-up\",this._onPointerRemove),this.registerIncoming(\"pointer-capture-lost\",this._onPointerRemove),this.registerIncoming(\"pointer-cancel\",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}}export{i as MultiTouch};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../core/Accessor.js\";import r from\"../../core/Logger.js\";import i from\"../../core/Queue.js\";import{property as n}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{PropertiesPool as o}from\"../3d/support/PropertiesPool.js\";import{primaryKey as a,isSystemModifier as p}from\"./keys.js\";import{LatestPointer as h}from\"./handlers/LatestPointer.js\";import{MultiTouch as l}from\"./handlers/MultiTouch.js\";let d=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=a,this._latestPointerType=\"mouse\",this._propertiesPool=new o({latestPointerLocation:P},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some((e=>e.handler.hasPendingInputs))}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,i=_.INTERNAL){if(this._nameToGroup[e])return void r.getLogger(this).error(\"There is already an InputHandler group registered under the name `\"+e+\"`\");if(0===t.length)return void r.getLogger(this).error(\"Can't register a group of zero handlers\");const n={name:e,handlers:t.map((e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null})))};this._nameToGroup[e]=n;for(let r=n.handlers.length-1;r>=0;r--){const e=n.handlers[r];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,r,i,n,s)=>{this._emitInputEvent(e.priorityIndex+1,t,r,i,s,n)},setPointerCapture:(t,r)=>{this._setPointerCapture(n,e,t,r)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange(\"hasPendingInputs\")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach((e=>{e.removed=!0,e.uninstallCallback?.()})),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):r.getLogger(this).error(\"There is no InputHandler group registered under the name `\"+e+\"`\")}hasHandlers(e){return void 0!==this._nameToGroup[e]}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const e=this._handlers[r];e.priorityIndex=r,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const i=this._handlersPriority[r];i.priorityIndex=r;let n=i.handler.hasSideEffects;if(!n)for(const t of i.handler.outgoingEventTypes)if(e.has(t)){n=!0;break}if(n)for(const r of i.handler.incomingEventMatches){e.add(r.eventType);for(const e of r.keyModifiers)p(e)||t.add(e)}i.active=n}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add(\"pointer-capture-lost\"),this._keyModifiers.size>0&&(this._sourceEvents.add(\"key-down\"),this._sourceEvents.add(\"key-up\")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,r){this._latestPointerType=e;const i=this._get(\"latestPointerLocation\");if(null==i||i.x!==t||i.y!==r){const e=this._propertiesPool.get(\"latestPointerLocation\");e.x=t,e.y=r,this._set(\"latestPointerLocation\",e)}}_onEventReceived(e,t){if(\"pointer-capture-lost\"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const r=null!=this.test.timestamp?this.test.timestamp:t.native?t.native.timestamp:void 0,i=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,r,i)}_updateKeyModifiers(e,t){if(!t)return;let r=!1;const i=()=>{if(!r){const e=new Set;this._activeKeyModifiers.forEach((t=>{e.add(t)})),this._activeKeyModifiers=e,r=!0}},n=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(i(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(i(),this._activeKeyModifiers.delete(e))};if(\"key-down\"===e||\"key-up\"===e){const r=t.key;this._keyModifiers.has(r)&&n(r,\"key-down\"===e)}const s=t.native;n(\"Alt\",!(!s||!s.altKey)),n(\"Ctrl\",!(!s||!s.ctrlKey)),n(\"Shift\",!(!s||!s.shiftKey)),n(\"Meta\",!(!s||!s.metaKey)),n(\"Primary\",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new h(((e,t,r)=>this._setLatestPointer(e,t,r))),this._multiTouchHandler=new l,this.installHandlers(\"input-manager-logic\",[this._latestPointerHandler,this._multiTouchHandler],_.ALWAYS),this.recognizers.length>0&&this.installHandlers(\"default\",this.recognizers,_.INTERNAL)}_setPointerCapture(e,t,r,i){const n=e.name+\"-\"+t.priorityIndex,s=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,s),i?(s.add(n),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):s.has(n)&&(s.delete(n),0===s.size&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter((e=>!e.removed)),this.updateDependencies()}_emitInputEventFromSource(e,t,r,i){this._emitInputEvent(0,e,t,r,i)}_emitInputEvent(e,t,r,i,n,s){const o=void 0!==i?i:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=void 0!==n&&n,p={event:new u(t,r,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(p):this._doNewPropagation(p)}_doNewPropagation(e){this._currentPropagation={events:new i,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:r}=e.events.pop(),i=t.data?.eventId;if(!(null!=i&&this._stoppedPropagationEventIds.has(i)))for(e.currentHandler=this._handlersPriority[r];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=i&&this._stoppedPropagationEventIds.add(i);break}if(t.shouldPausePropagation((()=>this._continuePropagation())))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new i;t.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)t.push(r.events.pop());r.events=t,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(r.eventType!==e.eventType)continue;const t=r.keyModifiers.filter((t=>e.keyModifiers.includes(t)));if(t.length===r.keyModifiers.length!==(t.length===e.keyModifiers.length))return r.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const r of e){let e=0;for(;e=0;)e++;t.splice(e,0,r)}return t}get debug(){const e=e=>{const t=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=t};return{injectEvent:(t,r)=>{e((()=>{this._onEventReceived(t,r)}))},disablePointerCapture:e}}};e([n({readOnly:!0})],d.prototype,\"hasPendingInputs\",null),e([n({constructOnly:!0})],d.prototype,\"eventSource\",void 0),e([n({constructOnly:!0})],d.prototype,\"recognizers\",void 0),e([n()],d.prototype,\"_latestPointerType\",void 0),e([n()],d.prototype,\"latestPointerType\",null),e([n()],d.prototype,\"multiTouchActive\",null),e([n({readOnly:!0})],d.prototype,\"latestPointerLocation\",void 0),e([n()],d.prototype,\"_paused\",void 0),e([n({readOnly:!0})],d.prototype,\"updating\",null),d=e([s(\"esri.views.input.InputManager\")],d);class u{constructor(e,t,r,i,n){this.type=e,this.data=t,this.timestamp=r,this.modifiers=i,this.cancelable=n,this._propagationState=c.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=c.STOPPED}shouldStopPropagation(){return 0!=(this._propagationState&c.STOPPED)}async(e){this._propagationState|=c.PAUSED;const t=(e,t)=>{this._propagationState&=~c.PAUSED;const r=this._resumeCallback;if(this._resumeCallback=null,r&&r(),t)throw e;return e};return(\"function\"==typeof e?e():e).then((e=>t(e,!1)),(e=>t(e,!0)))}shouldPausePropagation(e){return!!(this._propagationState&c.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}var c;!function(e){e[e.NONE=0]=\"NONE\",e[e.STOPPED=1]=\"STOPPED\",e[e.PAUSED=2]=\"PAUSED\"}(c||(c={}));const _={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};class g{}const P=g;export{d as InputManager,_ as ViewEventPriorities};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{createTask as p}from\"../core/asyncUtils.js\";import{deprecated as t}from\"../core/deprecate.js\";import i from\"../core/Error.js\";import s from\"../core/Logger.js\";import{eachAlwaysValues as o,throwIfAborted as r}from\"../core/promiseUtils.js\";import{watch as a,initial as n,whenOnce as u}from\"../core/reactiveUtils.js\";import{property as l}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";import{ViewEventPriorities as h}from\"./input/InputManager.js\";function d(e){return null!=e&&\"open\"in e&&\"declaredClass\"in e}function y(e){return null!=e&&\"declaredClass\"in e&&\"dockOptions\"in e}const w=w=>{let m=class extends w{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([a((()=>[this.ui,this.popup]),(([e,p],t)=>{const i=\"popup\",s=\"manual\";if(t){const[e,p]=t;e&&d(p)&&(p.view=null,y(p)&&e.remove(p,i))}e&&d(p)&&(p.view=this,y(p)&&e.add(p,{key:i,position:s,internal:!0}))}),n),this.on(\"click\",(e=>{this.popup&&this.popupEnabled&&(\"mouse\"!==e.pointerType||0===e.button)&&(!d(this.popup)&&\"autoOpenEnabled\"in this.popup&&!1===this.popup.autoOpenEnabled||(d(this.popup)?this.popup.viewModel.handleViewClick(e):e.async((async()=>{await this.setupPopup(),d(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(e)}))))}),h.WIDGET)]),u((()=>this.ready&&this.popupEnabled&&!this.updating)).then((()=>{import(\"../widgets/Popup.js\")}))}destroy(){this.destroyed||this.closePopup()}async openPopup(e){if(d(this.popup))return this.popup.open(e);try{if(await this.setupPopup(),!this.popup)return void s.getLogger(this).error(new i(\"view:null-popup\",\"Popup is null and can't be opened\"));this.popup.open(e)}catch{}}closePopup(){this._popupSetupTask?.abort(),d(this.popup)&&this.popup.close()}async fetchPopupFeatures(e,p){await this.when();const{location:t,queryArea:i,layerViewsAndGraphics:s,clientOnlyGraphics:r}=await this._prepareFetchPopupFeatures(e,p),a=Promise.resolve(r),n=this._queryLayerPopupFeatures(i,s,p),u=n.map((e=>e.promise));return{location:t,clientOnlyGraphics:r,allGraphicsPromise:o([a,...u]).then((e=>Array.from(new Set(e.flat())))),promisesPerLayerView:n}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!d(this.popup))return this._popupSetupTask=p((async e=>{const{default:p}=await import(\"../widgets/Popup.js\");if(r(e),!this.popup||d(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new p(t)})),this._popupSetupTask.promise}_queryLayerPopupFeatures(e,p,t){return p.map((({layerView:p,graphics:i})=>{const s={clientGraphics:i,event:null!=t?t.event:void 0,signal:null!=t?t.signal:void 0,defaultPopupTemplateEnabled:null!=t&&!!t.defaultPopupTemplateEnabled},o=p.fetchPopupFeatures(e,s);return{layerView:p,promise:o}}))}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(null!=p&&p.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(e,p){const{clientGraphics:t,queryArea:i,location:s}=await this._popupHitTestGraphics(e,p),o=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:r,clientOnlyGraphics:a}=this._graphicsPerFetchPopupLayerView(t,o);return{clientOnlyGraphics:a,layerViewsAndGraphics:r,queryArea:i,location:s}}async _popupHitTestGraphics(e,p){const t=await this.popupHitTest(e),i=t.results,s=t.mapPoint,o=i.filter((e=>\"graphic\"===e.type&&this._isValidPopupGraphic(e.graphic,p))),r=o.length?o[0].mapPoint:null;return{clientGraphics:o.map((e=>e.graphic)),queryArea:s,location:s||r}}_getFetchPopupLayerViews(){const e=[];return this.allLayerViews.forEach((p=>{this._isValidPopupLayerView(p)&&e.push(p)})),null!=this.graphicsView&&this._isValidPopupLayerView(this.graphicsView)&&e.push(this.graphicsView),e.reverse()}_isValidPopupLayerView(e){return null!=e&&(!(\"layer\"in e)||!e.suspended)&&\"fetchPopupFeatures\"in e}_graphicsPerFetchPopupLayerView(e,p){const t=[],i=new Map,s=p.map((e=>{const p=[];return\"layer\"in e?i.set(e.layer,p):i.set(e.graphics,p),{layerView:e,graphics:p}}));for(const o of e){const e=i.get(o.layer)||i.get(o.sourceLayer)||null;e?e.push(o):t.push(o)}return{layerViewsAndGraphics:s,clientOnlyGraphics:t}}};return e([l({cast(e){return!e||d(e)||\"object\"==typeof e&&(e.open=e=>(t(s.getLogger(this),\"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created\",{replacement:\"Use view.openPopup() instead.\",version:\"4.27\"}),this.openPopup(e)),e.close=()=>(t(s.getLogger(this),\"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created\",{replacement:\"Use view.closePopup() instead.\",version:\"4.27\"}),this.closePopup())),e}})],m.prototype,\"popup\",void 0),e([l()],m.prototype,\"popupEnabled\",void 0),m=e([c(\"esri.views.PopupView\")],m),m};export{w as PopupView};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{resolveTimeZone as e}from\"../intl/date.js\";import{system as t}from\"../time/timeZoneUtils.js\";import{IANAZone as n,DateTime as s}from\"luxon\";const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function o(r,o,i,c=t){const u=new n(e(c)),a=s.fromJSDate(r,{zone:u}),l=\"decades\"===i||\"centuries\"===i?\"year\":T(i);return\"decades\"===i&&(o*=10),\"centuries\"===i&&(o*=100),a.plus({[l]:o}).toJSDate()}function i(e,t,n=\"milliseconds\"){const s=e.getTime(),r=m(t,n,\"milliseconds\");return new Date(s+r)}function c(r,o,i=t){const c=new n(e(i)),u=s.fromJSDate(r,{zone:c});if(\"decades\"===o||\"centuries\"===o){const e=u.startOf(\"year\"),{year:t}=e,n=t-t%(\"decades\"===o?10:100);return e.set({year:n}).toJSDate()}const a=T(o);return u.startOf(a).toJSDate()}function u(e,t,n=\"milliseconds\"){const s=new Date(m(t,n,\"milliseconds\"));return s.setUTCFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),s}function a(e,t=\"milliseconds\"){const n=m(e.getUTCHours(),\"hours\",\"milliseconds\"),s=m(e.getUTCMinutes(),\"minutes\",\"milliseconds\"),r=m(e.getUTCSeconds(),\"seconds\",\"milliseconds\");return m(n+s+r+e.getUTCMilliseconds(),\"milliseconds\",t)}function l(e,t){const n=new Date(e.getTime());return n.setUTCFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n}function d(e){const t=new Date(0);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t}function m(e,t,n){if(0===e)return 0;return e*r[t]/r[n]}function f(e){return e instanceof Date&&!isNaN(e.getTime())}function g(e,t){return e&&t?e.intersection(t):e||t}function T(e){switch(e){case\"milliseconds\":return\"millisecond\";case\"seconds\":return\"second\";case\"minutes\":return\"minute\";case\"hours\":return\"hour\";case\"days\":return\"day\";case\"weeks\":return\"week\";case\"months\":return\"month\";case\"years\":return\"year\"}}export{m as convertTime,f as isValidDate,u as makeUTCTime,g as mergeTimeExtents,r as millisecondsPerTimeUnit,o as offsetDate,i as offsetDateUTC,l as resetUTCDate,a as timeSinceUTCMidnight,c as truncateDate,d as truncateLocalTime};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"./chunks/tslib.es6.js\";import{JSONSupport as e}from\"./core/JSONSupport.js\";import{truncateDate as r,offsetDate as s}from\"./core/timeUtils.js\";import{property as n}from\"./core/accessorSupport/decorators/property.js\";import\"./core/accessorSupport/ensureType.js\";import\"./core/arrayUtils.js\";import\"./core/has.js\";import{reader as i}from\"./core/accessorSupport/decorators/reader.js\";import{subclass as l}from\"./core/accessorSupport/decorators/subclass.js\";import{writer as o}from\"./core/accessorSupport/decorators/writer.js\";import{system as a}from\"./time/timeZoneUtils.js\";var u;let m=u=class extends e{static get allTime(){return p}static get empty(){return d}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(u.allTime)}get isEmpty(){return this.equals(u.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new u({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,s=t.start?.getTime()??t.start,n=t.end?.getTime()??t.end;return e===s&&r===n}expandTo(t,e=a){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=r(n,t,e));let i=this.end;if(i){const n=r(i,t,e);i=i.getTime()===n.getTime()?n:s(n,1,t,e)}return new u({start:n,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return u.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=t.start?.getTime()??-1/0,n=t.end?.getTime()??1/0;let i,l;if(s>=e&&s<=r?i=s:e>=s&&e<=n&&(i=e),r>=s&&r<=n?l=r:n>=e&&n<=r&&(l=n),null!=i&&null!=l&&!isNaN(i)&&!isNaN(l)){const t=new u;return t.start=i===-1/0?null:new Date(i),t.end=l===1/0?null:new Date(l),t}return u.empty}offset(t,e,r=a){if(this.isEmpty||this.isAllTime)return this.clone();const n=new u,{start:i,end:l}=this;return null!=i&&(n.start=s(i,t,e,r)),null!=l&&(n.end=s(l,t,e,r)),n}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return p.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new u({start:e,end:r})}};t([n({type:Date,json:{write:{allowNull:!0}}})],m.prototype,\"end\",void 0),t([i(\"end\")],m.prototype,\"readEnd\",null),t([o(\"end\")],m.prototype,\"writeEnd\",null),t([n({readOnly:!0,json:{read:!1}})],m.prototype,\"isAllTime\",null),t([n({readOnly:!0,json:{read:!1}})],m.prototype,\"isEmpty\",null),t([n({type:Date,json:{write:{allowNull:!0}}})],m.prototype,\"start\",void 0),t([i(\"start\")],m.prototype,\"readStart\",null),t([o(\"start\")],m.prototype,\"writeStart\",null),m=u=t([l(\"esri.TimeExtent\")],m);const p=new m,d=new m({start:void 0,end:void 0}),c=m;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../Collection.js\";import{castForReferenceSetter as s,referenceSetter as o}from\"../collectionUtils.js\";import\"../has.js\";import\"../Logger.js\";import{property as r}from\"../accessorSupport/decorators/property.js\";import\"../accessorSupport/ensureType.js\";import\"../arrayUtils.js\";import{subclass as i}from\"../accessorSupport/decorators/subclass.js\";let n=class extends t{constructor(e){super(e),this.addHandles([this.on(\"before-add\",(e=>{null==e.item&&e.preventDefault()})),this.on(\"after-add\",(e=>this._own(e.item))),this.on(\"after-remove\",(e=>this._release(e.item)))])}get owner(){return this._get(\"owner\")}set owner(e){e!==this._get(\"owner\")&&(this._releaseAll(),this._set(\"owner\",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(t.ofType(this.itemType.Type))(e):new t(e)}};function l(e,t){return{type:e,cast:s,set(s){const r=o(s,this._get(t),e);r.owner=this,this._set(t,r)}}}e([r()],n.prototype,\"owner\",null),n=e([i(\"esri.core.support.OwningCollection\")],n);export{n as OwningCollection,l as owningCollectionProperty};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{removeUnordered as t}from\"../core/arrayUtils.js\";import{strict as r}from\"../core/jsonMap.js\";import{JSONSupport as o}from\"../core/JSONSupport.js\";import{unitFromRESTJSON as s,getVerticalUnitStringForSR as i}from\"../core/unitUtils.js\";import n from\"../core/Warning.js\";import{property as a}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/has.js\";import{reader as l}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as h}from\"../core/accessorSupport/decorators/writer.js\";var d;const p=r()({orthometric:\"gravity-related-height\",gravity_related_height:\"gravity-related-height\",ellipsoidal:\"ellipsoidal\"}),u=p.jsonValues.slice();t(u,\"orthometric\");const g=r()({meter:\"meters\",foot:\"feet\",\"us-foot\":\"us-feet\",\"clarke-foot\":\"clarke-feet\",\"clarke-yard\":\"clarke-yards\",\"clarke-link\":\"clarke-links\",\"sears-yard\":\"sears-yards\",\"sears-foot\":\"sears-feet\",\"sears-chain\":\"sears-chains\",\"benoit-1895-b-chain\":\"benoit-1895-b-chains\",\"indian-yard\":\"indian-yards\",\"indian-1937-yard\":\"indian-1937-yards\",\"gold-coast-foot\":\"gold-coast-feet\",\"sears-1922-truncated-chain\":\"sears-1922-truncated-chains\",\"50-kilometers\":\"50-kilometers\",\"150-kilometers\":\"150-kilometers\"});let m=d=class extends o{constructor(e){super(e),this.heightModel=\"gravity-related-height\",this.heightUnit=\"meters\",this.vertCRS=null}writeHeightModel(e,t,r){return p.write(e,t,r)}readHeightModel(e,t,r){const o=p.read(e);return o||(r?.messages&&r.messages.push(f(e,{context:r})),null)}readHeightUnit(e,t,r){const o=g.read(e);return o||(r?.messages&&r.messages.push(y(e,{context:r})),null)}readHeightUnitService(e,t,r){const o=s(e)||g.read(e);return o||(r?.messages&&r.messages.push(y(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new d({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=i(t);return new d({heightModel:e.heightModel,heightUnit:r,vertCRS:e.vertCRS})}write(e,t){return t={origin:\"web-scene\",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new d;return t.read(e,{origin:\"web-scene\"}),t}};function y(e,t){return new n(\"height-unit:unsupported\",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new n(\"height-model:unsupported\",`Height model of value '${e}' is not supported`,t)}e([a({type:p.apiValues,constructOnly:!0,json:{origins:{\"web-scene\":{type:u,default:\"ellipsoidal\"}}}})],m.prototype,\"heightModel\",void 0),e([h(\"web-scene\",\"heightModel\")],m.prototype,\"writeHeightModel\",null),e([l([\"web-scene\",\"service\"],\"heightModel\")],m.prototype,\"readHeightModel\",null),e([a({type:g.apiValues,constructOnly:!0,json:{origins:{\"web-scene\":{type:g.jsonValues,write:g.write}}}})],m.prototype,\"heightUnit\",void 0),e([l(\"web-scene\",\"heightUnit\")],m.prototype,\"readHeightUnit\",null),e([l(\"service\",\"heightUnit\")],m.prototype,\"readHeightUnitService\",null),e([a({type:String,constructOnly:!0,json:{origins:{\"web-scene\":{write:!0}}}})],m.prototype,\"vertCRS\",void 0),e([l(\"service\",\"vertCRS\",[\"vertCRS\",\"ellipsoid\",\"geoid\"])],m.prototype,\"readVertCRS\",null),m=d=e([c(\"esri.geometry.HeightModelInfo\")],m);const v=m;export{v as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Logger.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import\"../core/Error.js\";import{subclass as o}from\"../core/accessorSupport/decorators/subclass.js\";import{OwningCollection as s}from\"../core/support/OwningCollection.js\";let t=class extends s{constructor(e){super(e),this.addHandles(this.on(\"before-add\",(e=>{null!=e.item&&e.item.parent===this.owner&&(r.getLogger(this).warn(\"Analysis inside the collection must be unique. Not adding this element again.\"),e.preventDefault())})))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};t=e([o(\"esri.support.AnalysesCollection\")],t);export{t as AnalysesCollection};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import o from\"../Graphic.js\";import\"../core/Logger.js\";import{ensureType as e}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import\"../core/Error.js\";import{shared as s}from\"../core/accessorSupport/decorators/shared.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import{OwningCollection as p}from\"../core/support/OwningCollection.js\";let i=class extends p{_own(r){r.layer&&\"remove\"in r.layer&&r.layer!==this.owner&&r.layer.remove(r),r.layer=this.owner}_release(r){r.layer===this.owner&&(r.layer=null)}};r([s({Type:o,ensureType:e(o)})],i.prototype,\"itemType\",void 0),i=r([t(\"esri.support.GraphicsCollection\")],i);export{i as GraphicsCollection};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import s from\"../core/Accessor.js\";import r from\"../core/Collection.js\";import{watch as t,initial as o}from\"../core/reactiveUtils.js\";import{property as i}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as a}from\"../core/accessorSupport/decorators/subclass.js\";let n=class extends s{constructor(e){super(e),this.view=null,this.baseLayerViews=new r,this.referenceLayerViews=new r,this._loadingHandle=t((()=>this.view?.map?.basemap),(e=>{e&&e.load().catch((()=>{}))}),o)}destroy(){this._set(\"view\",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const e of this.baseLayerViews)e.destroy();this.baseLayerViews.length=0;for(const e of this.referenceLayerViews)e.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view&&this.view.suspended)return!1;const e=this.view?.map?.basemap;return!!e&&(!!e.loaded&&(this.baseLayerViews.some((e=>e.updating))||this.referenceLayerViews.some((e=>e.updating))))}};e([i({constructOnly:!0})],n.prototype,\"view\",void 0),e([i({readOnly:!0})],n.prototype,\"baseLayerViews\",void 0),e([i({readOnly:!0})],n.prototype,\"referenceLayerViews\",void 0),e([i({readOnly:!0})],n.prototype,\"suspended\",null),e([i({type:Boolean,readOnly:!0})],n.prototype,\"updating\",null),n=e([a(\"esri.views.BasemapView\")],n);export{n as BasemapView};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Accessor.js\";import i from\"../core/Error.js\";import t from\"../core/Logger.js\";import{someMap as s}from\"../core/MapUtils.js\";import{removeMaybe as a}from\"../core/maybe.js\";import{createResolver as o,createAbortError as l,isAbortError as n,onAbort as y,throwIfAborted as h}from\"../core/promiseUtils.js\";import{on as c,watch as p,syncAndInitial as w}from\"../core/reactiveUtils.js\";import{schedule as d}from\"../core/scheduling.js\";import{property as m}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as f}from\"../core/accessorSupport/decorators/subclass.js\";import{get as u}from\"../core/accessorSupport/get.js\";import{UpdatingHandles as _}from\"../core/support/UpdatingHandles.js\";import{destroyMap as g}from\"../support/collectionUtils.js\";function v(e){return\"tryRecycleWith\"in e}class V{constructor(e,r,t){this.layer=e,this.view=r,this.layerViewImporter=t,this._controller=new AbortController,this._deferred=o(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,y(this._controller.signal,(()=>{const r=new i(\"cancelled:layerview-create\",\"layerview creation cancelled\",{layer:e});this._deferred.reject(r)}))}tryRecycle(e){if(!this.done||!this.layerView||!v(this.layerView))return null;const r=this.layer.type,i=this._controller.signal;for(let t=0;t(h(this._controller.signal),s.emit(\"layerview-destroy\",{view:i,layerView:r}),i.emit(\"layerview-destroy\",{view:i,layerView:r}),s.emit(\"layerview-create\",{view:i,layerView:r}),i.emit(\"layerview-create\",{view:i,layerView:r}),r))),new Promise(((e,r)=>y(this._controller.signal,(()=>r(l())))))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:i}=this;r.emit(\"layerview-destroy\",{view:i,layerView:e}),i.emit(\"layerview-destroy\",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:t}=this;this._map=t.map;try{let o,l;if(await r.load({signal:e}),r.prefetchResources&&await r.prefetchResources({signal:e}),I(r))o=await r.createLayerView(t,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new i(\"layer:view-not-supported\",\"No layerview implementation was found\");const s=await this.layerViewImporter.importLayerView(r);h(e),o=\"default\"in s?new s.default({layer:r,view:t}):new s({layer:r,view:t})}const n=()=>{l=a(l),o.destroyed||o.destroy(),o.layer=null,o.parent=null,o.view=null,this.done=!0};l=y(e,n),h(e);try{await o.when()}catch(s){throw n(),s}const c=this._map?.allLayers?.includes(r);if(!c)return n(),void this._deferred.reject(new i(\"view:no-layerview-for-layer\",\"The layer has been removed from the map\",{layer:r}));this.layerView=o,r.emit(\"layerview-create\",{view:t,layerView:o}),t.emit(\"layerview-create\",{layer:r,layerView:o}),this.done=!0,this._deferred.resolve(o)}catch(s){r.emit(\"layerview-create-error\",{view:t,error:s}),t.emit(\"layerview-create-error\",{layer:r,error:s}),this.done=!0,this._deferred.reject(new i(\"layerview:create-error\",\"layerview creation failed\",{layer:r,error:s}))}}}let L=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new _,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=o(),this._workPromise.promise.catch((()=>{}))),this.removeHandles(\"reschedule\"),this.addHandles(d(this._doWork),\"reschedule\"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange(\"updating\");this.removeHandles(\"reschedule\"),this.removeHandles(\"collection-change\");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const a of e)if(a){r.add(a);const e=this._layerLayerViewInfoMap.get(a);e&&t?e.start():e||this._recyclingInfoMap.has(a)||i.push(a),\"layers\"in a&&a.layers&&s(a.layers)}};for(const o of this._rootCollectionNames)s(u(this,o));for(const[o,l]of this._layerLayerViewInfoMap)if(!r.has(o)){this._layerLayerViewInfoMap.delete(l.layer);const e=l.tryRecycle(i);e?(this.notifyChange(\"updating\"),this._recyclingInfoMap.set(l.layer,l),e.then((()=>{this.notifyChange(\"updating\"),this._recyclingInfoMap.delete(l.layer),this._layerLayerViewInfoMap.set(l.layer,l),this._reschedule()})).catch((()=>{this.notifyChange(\"updating\"),this._recyclingInfoMap.delete(l.layer),l.destroy(),this._reschedule()}))):l.destroy()}for(const[o,l]of this._recyclingInfoMap)r.has(o)||(this.notifyChange(\"updating\"),this._recyclingInfoMap.delete(l.layer),l.destroy());for(const o of i)this._createLayerView(o);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter((e=>!!e));r.forEach((e=>\"layers\"in e&&a.push(e.layers))),this.addHandles(a.map((e=>this._watchUpdatingTracking.addOnCollectionChange((()=>e),this._reschedule))),\"collection-change\"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([c((()=>this.view?.map?.allLayers),\"change\",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),p((()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]}),(()=>this._reschedule()),w)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),g(this._recyclingInfoMap),g(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(l()),this._workPromise=null)}get _layersToLayerViews(){const e=[[\"view.map.basemap.baseLayers\",\"view.basemapView.baseLayerViews\"],[\"view.map.layers\",\"view.layerViews\"],[\"view.map.basemap.referenceLayers\",\"view.basemapView.referenceLayerViews\"]];return this.supportsGround&&e.push([\"view.map.ground.layers\",\"view.groundView.layerViews\"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(g(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new i(\"view:no-layerview-for-layer\",\"No layerview has been found for the layer\",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(u(this,e),u(this,r),this.view);this.notifyChange(\"updating\"),this.notifyChange(\"updatingRemaining\")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let t=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e?.layerView)continue;const a=e.layerView;a.layer=s,a.parent=i,r.at(t)!==a&&r.splice(t,0,a),s.layers&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),t+=1}t{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new V(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{r&&(n(r)||\"cancelled:layerview-create\"===r.name)||t.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??\"no title\"}', id:'${e.id??\"no id\"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange(\"updating\"),this.notifyChange(\"updatingRemaining\")}};e([m()],L.prototype,\"_workPromise\",void 0),e([m({readOnly:!0})],L.prototype,\"_watchUpdatingTracking\",void 0),e([m({readOnly:!0})],L.prototype,\"_layersToLayerViews\",null),e([m({readOnly:!0})],L.prototype,\"_rootCollectionNames\",null),e([m()],L.prototype,\"layerViewImporter\",void 0),e([m()],L.prototype,\"supportsGround\",void 0),e([m({readOnly:!0})],L.prototype,\"updating\",null),e([m({readOnly:!0})],L.prototype,\"updatingRemaining\",null),e([m({constructOnly:!0})],L.prototype,\"view\",void 0),L=e([f(\"esri.views.LayerViewManager\")],L);const M=L;function I(e){return\"createLayerView\"in e&&null!=e.createLayerView}export{M as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import t from\"../core/Accessor.js\";import{createScreenPoint as r}from\"../core/screenUtils.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";let i=class extends t{constructor(o){super(o),this.factor=1.5,this.offset=r(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty(\"factor\"),this.commitProperty(\"offset\"),this.commitProperty(\"position\"),this.commitProperty(\"visible\"),this.commitProperty(\"size\"),this.commitProperty(\"maskUrl\"),this.commitProperty(\"maskEnabled\"),this.commitProperty(\"overlayUrl\"),this.commitProperty(\"overlayEnabled\"),(this._get(\"version\")||0)+1}};o([e({type:Number})],i.prototype,\"factor\",void 0),o([e({nonNullable:!0})],i.prototype,\"offset\",void 0),o([e()],i.prototype,\"position\",void 0),o([e({type:Number,range:{min:0}})],i.prototype,\"size\",void 0),o([e()],i.prototype,\"maskUrl\",void 0),o([e()],i.prototype,\"maskEnabled\",void 0),o([e()],i.prototype,\"overlayUrl\",void 0),o([e()],i.prototype,\"overlayEnabled\",void 0),o([e({readOnly:!0})],i.prototype,\"version\",null),o([e({type:Boolean})],i.prototype,\"visible\",void 0),i=o([s(\"esri.views.Magnifier\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import r from\"../Color.js\";import e from\"../core/Accessor.js\";import{ClonableMixin as s}from\"../core/Clonable.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";let p=class extends(s(e)){constructor(o){super(o),this.accentColor=new r([255,127,0]),this.textColor=new r([255,255,255])}};o([t({type:r,nonNullable:!0})],p.prototype,\"accentColor\",void 0),o([t({type:r,nonNullable:!0})],p.prototype,\"textColor\",void 0),p=o([c(\"esri.views.Theme\")],p);const l=p;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar t;!function(t){t[t.Left=0]=\"Left\",t[t.Middle=1]=\"Middle\",t[t.Right=2]=\"Right\"}(t||(t={}));export{t as MouseButton};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../core/has.js\";import{makeHandle as t}from\"../../core/handleUtils.js\";import{rad2deg as e}from\"../../core/mathUtils.js\";import{createScreenPoint as a}from\"../../core/screenUtils.js\";import{InputHandler as n}from\"./InputHandler.js\";import{ViewEventPriorities as r}from\"./InputManager.js\";export{MouseButton}from\"./IViewEvents.js\";const i=[\"click\",\"double-click\",\"immediate-click\",\"immediate-double-click\",\"hold\",\"drag\",\"key-down\",\"key-up\",\"pointer-down\",\"pointer-move\",\"pointer-up\",\"pointer-drag\",\"mouse-wheel\",\"pointer-enter\",\"pointer-leave\",\"gamepad\",\"focus\",\"blur\"],o={};function s(t){return!!o[t]}function p(t){for(const e of t)if(!s(e))return!1;return!0}i.forEach((t=>{o[t]=!0}));class c{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach((({handler:t,priority:e},a)=>this.inputManager?.installHandlers(a,[t],e)))}disconnect(){this.inputManager&&this._handlers.forEach(((t,e)=>this.inputManager?.uninstallHandlers(e))),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,a,n,i){const o=Array.isArray(e)?e:e.split(\",\");if(!p(o))return o.some(s)&&console.error(\"Error: registering input events and other events on the view at the same time is not supported.\"),null;let c,u;Array.isArray(a)?u=a:(c=a,u=[]),\"function\"==typeof n?c=n:i=n,i=null!=i?i:r.DEFAULT;const m=this._createUniqueGroupName(),d=new l(this.view,o,u,c);this._handlers.set(m,{handler:d,priority:i});for(const t of o){const e=this._handlerCounts.get(t)||0;this._handlerCounts.set(t,e+1)}return this.inputManager&&this.inputManager.installHandlers(m,[d],i),t((()=>this._removeHandler(m,o)))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const t of e){const e=this._handlerCounts.get(t);void 0===e?console.error(\"Trying to remove handler for event that has no handlers registered: \",t):1===e?this._handlerCounts.delete(t):this._handlerCounts.set(t,e-1)}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}}class l extends n{constructor(t,e,a,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const r of e)switch(r){case\"click\":this.registerIncoming(\"click\",a,(t=>n(this._wrapClick(t))));break;case\"double-click\":this.registerIncoming(\"double-click\",a,(t=>n(this._wrapDoubleClick(t))));break;case\"immediate-click\":this.registerIncoming(\"immediate-click\",a,(t=>n(this._wrapImmediateClick(t))));break;case\"immediate-double-click\":this.registerIncoming(\"immediate-double-click\",a,(t=>n(this._wrapImmediateDoubleClick(t))));break;case\"hold\":this.registerIncoming(\"hold\",a,(t=>n(this._wrapHold(t))));break;case\"drag\":this.registerIncoming(\"drag\",a,(t=>{const e=this._wrapDrag(t);e&&n(e)}));break;case\"key-down\":this.registerIncoming(\"key-down\",a,(t=>n(this._wrapKeyDown(t))));break;case\"key-up\":this.registerIncoming(\"key-up\",a,(t=>n(this._wrapKeyUp(t))));break;case\"pointer-down\":this.registerIncoming(\"pointer-down\",a,(t=>n(this._wrapPointer(t,\"pointer-down\"))));break;case\"pointer-move\":this.registerIncoming(\"pointer-move\",a,(t=>n(this._wrapPointer(t,\"pointer-move\"))));break;case\"pointer-up\":this.registerIncoming(\"pointer-up\",a,(t=>n(this._wrapPointer(t,\"pointer-up\"))));break;case\"pointer-drag\":this.registerIncoming(\"pointer-drag\",a,(t=>n(this._wrapPointerDrag(t))));break;case\"mouse-wheel\":this.registerIncoming(\"mouse-wheel\",a,(t=>n(this._wrapMouseWheel(t))));break;case\"pointer-enter\":this.registerIncoming(\"pointer-enter\",a,(t=>n(this._wrapPointer(t,\"pointer-enter\"))));break;case\"pointer-leave\":this.registerIncoming(\"pointer-leave\",a,(t=>n(this._wrapPointer(t,\"pointer-leave\"))));break;case\"gamepad\":this.registerIncoming(\"gamepad\",a,(t=>{n(this._wrapGamepad(t))}));break;case\"focus\":this.registerIncoming(\"focus\",a,(t=>{n(this._wrapFocus(t))}));break;case\"blur\":this.registerIncoming(\"blur\",a,(t=>{n(this._wrapBlur(t))}))}}_wrapFocus(t){return{type:\"focus\",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapBlur(t){return{type:\"blur\",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapClick(t){const{pointerType:e,button:n,buttons:r,x:i,y:o,native:s,eventId:p}=t.data,{cancelable:c,timestamp:l}=t;return{type:\"click\",pointerType:e,button:n,buttons:r,x:i,y:o,native:s,timestamp:l,screenPoint:a(i,o),mapPoint:this._getMapPoint(i,o),eventId:p,cancelable:c,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapDoubleClick(t){const{pointerType:e,button:a,buttons:n,x:r,y:i,native:o,eventId:s}=t.data,{cancelable:p,timestamp:c}=t;return{type:\"double-click\",pointerType:e,button:a,buttons:n,x:r,y:i,native:o,timestamp:c,mapPoint:this._getMapPoint(r,i),eventId:s,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapImmediateClick(t){const{pointerType:e,button:a,buttons:n,x:r,y:i,native:o,eventId:s}=t.data,p=o.pointerId,{cancelable:c,timestamp:l}=t;return{type:\"immediate-click\",pointerId:p,pointerType:e,button:a,buttons:n,x:r,y:i,native:o,timestamp:l,mapPoint:this._getMapPoint(r,i),eventId:s,cancelable:c,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapImmediateDoubleClick(t){const{pointerType:e,button:a,buttons:n,x:r,y:i,native:o,eventId:s}=t.data,p=o.pointerId,{cancelable:c,timestamp:l}=t;return{type:\"immediate-double-click\",pointerId:p,pointerType:e,button:a,buttons:n,x:r,y:i,native:o,timestamp:l,mapPoint:this._getMapPoint(r,i),eventId:s,cancelable:c,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapHold(t){const{pointerType:e,button:a,buttons:n,x:r,y:i,native:o}=t.data,{cancelable:s,timestamp:p}=t;return{type:\"hold\",pointerType:e,button:a,buttons:n,x:r,y:i,native:o,timestamp:p,mapPoint:this._getMapPoint(r,i),cancelable:s,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_getMapPoint(t,e){return this.view.toMap(a(t,e),{exclude:[]})}_wrapDrag(t){const a=t.data,{x:n,y:r}=a.center,{action:i,pointerType:o,button:s}=a;if(\"start\"===i&&(this._latestDragStart=a),!this._latestDragStart)return;const p=a.pointer.native,c=a.buttons,{cancelable:l,timestamp:u}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return\"end\"===i&&(this._latestDragStart=void 0),{type:\"drag\",action:i,x:n,y:r,origin:m,pointerType:o,button:s,buttons:c,radius:a.radius,angle:e(a.angle),native:p,timestamp:u,cancelable:l,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapKeyDown(t){const{key:e,repeat:a,native:n}=t.data,{cancelable:r,timestamp:i}=t;return{type:\"key-down\",key:e,repeat:a,native:n,timestamp:i,cancelable:r,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapKeyUp(t){const{key:e,native:a}=t.data,{cancelable:n,timestamp:r}=t;return{type:\"key-up\",key:e,native:a,timestamp:r,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapPointer(t,e){const{x:a,y:n,button:r,buttons:i,native:o,eventId:s}=t.data,p=o.pointerId,c=o.pointerType,{cancelable:l,timestamp:u}=t;return{type:e,x:a,y:n,pointerId:p,pointerType:c,button:r,buttons:i,native:o,timestamp:u,eventId:s,cancelable:l,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapPointerDrag(t){const{x:e,y:a,buttons:n,native:r,eventId:i}=t.data.currentEvent,{button:o}=t.data.startEvent,s=t.data.startEvent.native.pointerId,p=t.data.startEvent.native.pointerType,c=t.data.action,l={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:u,timestamp:m}=t;return{type:\"pointer-drag\",x:e,y:a,pointerId:s,pointerType:p,button:o,buttons:n,action:c,origin:l,native:r,timestamp:m,eventId:i,cancelable:u,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapMouseWheel(t){const{cancelable:e,data:a,timestamp:n}=t,{x:r,y:i,deltaY:o,native:s}=a;return{type:\"mouse-wheel\",x:r,y:i,deltaY:o,native:s,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}_wrapGamepad(t){const{action:e,state:a,device:n}=t.data,{cancelable:r,timestamp:i}=t,{buttons:o,axes:s}=a;return{type:\"gamepad\",device:n,timestamp:i,action:e,buttons:o,axes:s,cancelable:r,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}}export{c as ViewEvents,i as eventTypes};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar o,t,u;!function(o){o[o.USER=0]=\"USER\",o[o.MANAGER=1]=\"MANAGER\"}(o||(o={})),function(o){o[o.None=0]=\"None\",o[o.Unfocused=1]=\"Unfocused\",o[o.Focused=2]=\"Focused\",o[o.Unselected=4]=\"Unselected\",o[o.Selected=8]=\"Selected\",o[o.All=15]=\"All\"}(t||(t={})),function(o){o[o.None=0]=\"None\",o[o.Custom1=16]=\"Custom1\",o[o.Custom2=32]=\"Custom2\",o[o.Custom3=64]=\"Custom3\",o[o.Custom4=128]=\"Custom4\",o[o.Custom5=256]=\"Custom5\",o[o.Custom6=512]=\"Custom6\",o[o.Custom7=1024]=\"Custom7\",o[o.Custom8=2048]=\"Custom8\",o[o.Custom9=4096]=\"Custom9\",o[o.Custom10=8192]=\"Custom10\",o[o.Custom11=16384]=\"Custom11\",o[o.Custom12=32768]=\"Custom12\",o[o.All=65520]=\"All\"}(u||(u={}));export{o as EditableFlag,u as ManipulatorStateCustomFlags,t as ManipulatorStateFlags};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Logger.js\";import{EditableFlag as t}from\"./interfaces.js\";function o(t){return[t.on(\"before-add\",(o=>{const i=o.item;if(null==i||t.includes(i))return e.getLogger(\"esri.views.interactive.interactiveToolUtils\").warn(\"Tool is either already in the list of tools or tool is `null`. Not adding tool.\"),void o.preventDefault();i.onAdd()})),t.on(\"after-remove\",(e=>{const t=e.item;t.active&&(t.view.activeTool=null),t.destroy()}))]}function i(e){return e.visible&&null!=e.getEditableFlag&&e.getEditableFlag(t.USER)&&e.getEditableFlag(t.MANAGER)}export{i as areToolManipulatorsEditable,o as getToolCollectionHandles};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../core/has.js\";import{createScreenPoint as e,createScreenPointArray as t}from\"../../core/screenUtils.js\";function n(t){return e(t.x,t.y)}function c(e){return t(e.x,e.y)}function i(t,n){const c=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return c?e(n.clientX-c.left,n.clientY-c.top):e(0,0)}function r(e,t){return t instanceof Event?i(e,t):n(t)}function o(e){if(e instanceof Event)return!0;if(\"object\"==typeof e&&\"type\"in e){switch(e.type){case\"click\":case\"double-click\":case\"pointer-down\":case\"pointer-drag\":case\"pointer-enter\":case\"pointer-leave\":case\"pointer-up\":case\"pointer-move\":case\"immediate-click\":case\"immediate-double-click\":case\"hold\":case\"drag\":case\"mouse-wheel\":return!0;default:return!1}}return!1}export{c as createScreenPointArrayFromEvent,n as createScreenPointFromEvent,i as createScreenPointFromNativeEvent,r as createScreenPointFromSupportedEvent,o as isSupportedScreenPointEvent};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{find as t}from\"../../core/iteratorUtils.js\";import{someMap as e}from\"../../core/MapUtils.js\";import{clamp as o}from\"../../core/mathUtils.js\";import{createScreenPoint as r}from\"../../core/screenUtils.js\";import{areToolManipulatorsEditable as i}from\"./interactiveToolUtils.js\";import{createScreenPointFromEvent as a}from\"../support/screenUtils.js\";class n{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const r=()=>t.stopPropagation();switch(t.type){case\"pointer-move\":s(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case\"drag\":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(r(),\"end\"===t.action&&(this._stopDrag=!1));break;case\"pointer-down\":{if(!l(t))break;const o=a(t),i=this._intersect(o,t.pointerType,e.forEachTool);if(null==i)break;const n=i.manipulator,s=i.tool;null==n||null==s||!n.interactive||n.grabbable&&n.grabbableForEvent(t)||!n.grabbing||n.dragging||this._ungrabManipulatorBeforeDragging(n,t,e),null!=n&&null!=s&&n.interactive&&n.grabbable&&n.grabbableForEvent(t)&&!n.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:n,tool:s,start:o,pointerType:t.pointerType}),1===this._grabbedManipulators.size&&null==e.activeTool&&(this._revertToNullActiveTool=!0,e.setActiveTool(i.tool)),n.grabbing=!0,n.events.emit(\"grab-changed\",{action:\"start\",pointerType:t.pointerType,screenPoint:o}),r());break}case\"pointer-up\":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case\"pointer-drag\":{if(!l(t))break;const i=this._grabbedManipulators.get(t.pointerId),n=i?.manipulator,s=i?.tool;if(null==n||null==s)break;const p=a(t);p.x=o(p.x,0,e.view.width),p.y=o(p.y,0,e.view.height);const u=i.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case\"start\":case\"update\":\"update\"!==t.action&&1!==this._grabbedManipulators.size||(n.dragging=!0,c?n.events.emit(\"drag\",{action:\"update\",start:u,screenPoint:p}):n.events.emit(\"drag\",{action:\"start\",start:u,screenPoint:p,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:s,manipulator:n,start:u}));break;case\"end\":n.dragging=!1,c&&n.events.emit(\"drag\",{action:\"end\",start:u,screenPoint:p}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}r();break}case\"immediate-click\":{const o=a(t),i=this._intersect(o,t.pointerType,e.forEachTool);if(p(t)||e.forEachTool((t=>{if((null==i||i.tool!==t||t.automaticManipulatorSelection)&&t.manipulators){let e=!1;t.manipulators.forEach((({manipulator:t})=>{t.selected&&(t.selected=!1,e=!0)})),e&&t.onManipulatorSelectionChanged&&t.onManipulatorSelectionChanged()}})),null==i)break;const{manipulator:n,tool:s}=i;if(!n.interactive)break;n.selectable&&s.automaticManipulatorSelection&&(n.selected=!n.selected,s.onManipulatorSelectionChanged&&s.onManipulatorSelectionChanged());const l=t.native.shiftKey;n.events.emit(\"immediate-click\",{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:l,stopPropagation:r}),u(n,r);break}case\"click\":{const o=a(t),i=this._intersect(o,t.pointerType,e.forEachTool),n=i?.manipulator;if(null==n||!n.interactive)break;const s=t.native.shiftKey;n.events.emit(t.type,{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:s}),r();break}case\"double-click\":{const o=a(t),i=this._intersect(o,t.pointerType,e.forEachTool),n=null!=i?i.manipulator:null;if(null==n||!n.interactive)break;const s=t.native.shiftKey;n.events.emit(\"double-click\",{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:s,stopPropagation:r}),u(n,r);break}case\"immediate-double-click\":{const o=a(t),i=this._intersect(o,t.pointerType,e.forEachTool),n=null!=i?i.manipulator:null;if(null==n||!n.interactive)break;const s=t.native.shiftKey;n.events.emit(\"immediate-double-click\",{screenPoint:o,button:t.button,pointerType:t.pointerType,shiftKey:s,stopPropagation:r}),u(n,r);break}}this._onFocusChange(e.forEachTool)}_ungrabManipulatorBeforeDragging(t,e,o){t.grabbing=!1,t.events.emit(\"grab-changed\",{action:\"end\",pointerType:e.pointerType,screenPoint:a(e)}),this._grabbedManipulators.forEach((({manipulator:e},o)=>{e===t&&this._grabbedManipulators.delete(o)})),this._afterManipulatorUngrab(o.setActiveTool)}_handlePointerEnd(t,e){const o=this._grabbedManipulators.get(t.pointerId)?.manipulator;null!=o&&o.grabbing&&(o.grabbing=!1,o.events.emit(\"grab-changed\",{action:\"end\",pointerType:t.pointerType,screenPoint:a(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorUngrab(e.setActiveTool))}_cursorFromMap(t){let o=null;return e(t,(({manipulator:t})=>!(null==t||!t.interactive)&&(t.grabbing&&t.grabCursor?(o=t.grabCursor,!0):!!t.cursor&&(o=t.cursor,!0)))),o}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||\"grabbing\":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||\"pointer\":this._cursor=null}_updateFocusedManipulatorTools(e){const o=new Set,r=new Set;this._grabbedManipulators.forEach((({tool:t})=>{o.add(t)})),this._hoveredManipulators.forEach((({tool:t})=>{r.add(t)})),e((e=>{e.hasGrabbedManipulators=o.has(e),e.hasHoveredManipulators=r.has(e);const i=this._grabbedManipulators.values(),a=t(i,(({tool:t})=>t===e));e.firstGrabbedManipulator=null!=a?a.manipulator:null}))}clearPointers(t,{forEachTool:e,setActiveTool:o},r=!0,i){const a=(e,o)=>e===t&&(null==i||i===o);this._grabbedManipulators.forEach((({tool:t,manipulator:e,pointerType:o},r)=>{a(t,e)&&(this._grabbedManipulators.delete(r),e.grabbing=!1,e.events.emit(\"grab-changed\",{action:\"end\",screenPoint:null,pointerType:o}))})),this._draggedManipulators.forEach((({tool:t,manipulator:e},o)=>{a(t,e)&&(this._draggedManipulators.delete(o),e.dragging=!1,e.events.emit(\"drag\",{action:\"cancel\"}))})),r&&this._hoveredManipulators.forEach((({tool:t,manipulator:e},o)=>{a(t,e)&&(this._hoveredManipulators.delete(o),e.hovering=!1)})),this._afterManipulatorUngrab(o),this._onFocusChange(e)}_intersect(t,e,o){let r=null;return o((o=>{if(null==o.manipulators||!i(o))return!1;const a=o.manipulators.intersect(t,e);return null!=a&&(r={tool:o,manipulator:a},!0)})),r}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach(((e,o)=>{this._updateHoveredStateForPointerAtScreenPosition(r(e.x,e.y),o,e.pointerType,t)}))}handleHoverEvent(t,e){\"pointer-up\"!==t.type&&\"immediate-click\"!==t.type&&\"pointer-move\"!==t.type||!s(t.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(a(t),t.pointerId,t.pointerType,e)}_updateHoveredStateForPointerAtScreenPosition(t,e,o,r){let i=this._intersect(t,o,r);const a=this._hoveredManipulators.get(e)?.manipulator;null==i||i.manipulator.interactive||(i=null),null!=i&&a===i.manipulator||(null!=a&&(a.hovering=!1),null!=i?(i.manipulator.hovering=!0,this._hoveredManipulators.set(e,i)):this._hoveredManipulators.delete(e),this._onFocusChange(r))}_afterManipulatorUngrab(t){0===this._grabbedManipulators.size&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}}function s(t){return\"mouse\"===t}function l(t){return\"mouse\"!==t.pointerType||0===t.button}function p(t){return!!t.native.shiftKey}function u(t,e){t?.consumesClicks&&e()}export{n as ToolViewManagerManipulatorState};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import e from\"../core/Accessor.js\";import{clock as o}from\"../core/clock.js\";import i from\"../core/Collection.js\";import\"../core/has.js\";import a from\"../core/Logger.js\";import{removeMaybe as r}from\"../core/maybe.js\";import{watch as s}from\"../core/reactiveUtils.js\";import{property as n}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import{UpdatingHandles as c}from\"../core/support/UpdatingHandles.js\";import{ViewEventPriorities as h}from\"./input/InputManager.js\";import{eventTypes as u}from\"./input/ViewEvents.js\";import{getToolCollectionHandles as p,areToolManipulatorsEditable as m}from\"./interactive/interactiveToolUtils.js\";import{EditableFlag as d}from\"./interactive/interfaces.js\";import{ToolViewManagerManipulatorState as v}from\"./interactive/ToolViewManagerManipulatorState.js\";const _=\"attached\",g=\"tools\",T=1e3;let f=class extends e{constructor(t){super(t),this._updatingHandles=new c,this._clock=o,this._manipulatorState=new v,this.tools=new i,this.cursor=null,this._interacting=!1,this._interactingTimeout=T,this._interactingTimeoutHandle=null,this._forEachTool=t=>{for(const e of this.tools.items)if(t(e))return}}initialize(){this.addHandles([this.view.on(u,(t=>{this._handleInputEvent(t)}),h.TOOL),...p(this.tools),this.tools.on(\"before-add\",(({item:t})=>{this._updateToolEditableFlag(t)})),this.tools.on(\"before-remove\",(({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()})),this.tools.on(\"change\",(()=>{this._refreshToolWatchers()}))])}destroy(){this.activeTool=null,this.tools.drain((t=>t.destroy())),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(null!=t&&!this.view.ready)return void a.getLogger(this).error(\"Cannot set active tool while view is not ready.\");if(t===this.activeTool)return;const e=this.activeTool;this._set(\"activeTool\",t),null!=e&&e.deactivate(),null!=t&&t.activate(),this._removeIncompleteTools(t);for(const o of this.tools){this._updateToolEditableFlag(o);const t=m(o);null!=this.activeTool&&t||this._manipulatorState.clearPointers(o,this._manipulatorStateEventArgs,!t)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some((t=>t.updating))}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=r(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout((()=>this._interacting=!1),this._interactingTimeout)}attach(){\"3d\"===this.view.type?this.addHandles([s((()=>{const{state:t}=this.view;return\"camera\"in t&&t.camera}),(()=>this._forEachManipulator((t=>t.onViewChange())))),this.view.elevationProvider?.on(\"elevation-change\",(t=>this._forEachManipulator((e=>e.onElevationChange(t)))))],_):this.addHandles(s((()=>this.view.extent),(()=>this._forEachManipulator((t=>t.onViewChange())))))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(_),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool((e=>{e.manipulators&&e.manipulators.forEach((({manipulator:o})=>t(o,e)))}))}_handleInputEvent(t){let e=!1;const o={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};null!=this.activeTool?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(o):this._forEachTool((t=>{!e&&t.visible&&t.handleInputEvent(o)})),!e&&\"key-down\"===t.type&&\"Escape\"===t.key&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(o,this._manipulatorStateEventArgs),e||null==this.activeTool||this.activeTool.handleInputEventAfter(o),this._manipulatorState.handleHoverEvent(o,this._forEachTool),this._updateCursor(),\"pointer-move\"===t.type&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(g),this._forEachTool((t=>{if(t instanceof e){const e=s((()=>[t.cursor,t.visible,t.editable]),(()=>{m(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}));this.addHandles(e,g)}t.manipulators&&this.addHandles([t.manipulators.on(\"after-remove\",(e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)})),t.manipulators.on(\"change\",(()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}))],g)})),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(d.MANAGER,null==this.activeTool||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;null==t&&this._forEachTool((e=>!(null==e.cursor||!e.visible)&&(t=e.cursor,!0))),this._get(\"cursor\")!==t&&this._set(\"cursor\",t)}_removeIncompleteTools(t){this.tools.filter((e=>(null==t||e!==t)&&!e.created&&e.removeIncompleteOnCancel)).forEach((t=>{this.tools.remove(t)}))}get test(){const t=this;return{setClock:t=>this._clock=t,set interactingTimeoutEnabled(e){t._interactingTimeout=e?T:0},get interactingTimeoutEnabled(){return 0!==t._interactingTimeout}}}};t([n({constructOnly:!0,nonNullable:!0})],f.prototype,\"view\",void 0),t([n({value:null})],f.prototype,\"activeTool\",null),t([n({readOnly:!0,type:i})],f.prototype,\"tools\",void 0),t([n({readOnly:!0})],f.prototype,\"cursor\",void 0),t([n({readOnly:!0})],f.prototype,\"updating\",null),t([n()],f.prototype,\"_interacting\",void 0),t([n({readOnly:!0})],f.prototype,\"interacting\",null),f=t([l(\"esri.views.ToolViewManager\")],f);export{f as ToolViewManager,T as interactingTimeout};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import t from\"../../../core/Accessor.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as r}from\"../../../core/accessorSupport/decorators/subclass.js\";let n=class extends t{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType=\"unknown\",\"standard\"===e.mapping?this._detectedDeviceType=\"standard\":o.test(e.id)?this._detectedDeviceType=\"spacemouse\":this._detectedDeviceType=\"unknown\",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return null!=this.nativeIndex&&this.nativeIndexn=e))),await s,e(r)}async function p(e,s,a,m){if(!e)return null;const l=e.spatialReference;return r()||t(l,s)?o(e,s):n?n.projectGeometry(e,s,a,m):(await Promise.race([c(m),i(m)]),p(e,s,a,m))}export{p as projectWithEngineOrService};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../core/Accessor.js\";import{createTask as n}from\"../../core/asyncUtils.js\";import{abortMaybe as a}from\"../../core/maybe.js\";import{isAborted as s,isAbortError as i}from\"../../core/promiseUtils.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as l}from\"../../core/accessorSupport/decorators/subclass.js\";import{supportsHeightModelInfo as o,deriveHeightModelInfoFromLayer as p}from\"../../geometry/support/heightModelInfoUtils.js\";import{ViewingMode as u}from\"../ViewingMode.js\";import{projectWithEngineOrService as c}from\"./projectionUtils.js\";let d=class extends t{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set(\"map\",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return null!=this.userSpatialReference?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return null==this.userSpatialReference||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),t=[];return null!=this.priorityCollection&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get(\"_spatialReferenceTask\")??{updating:!1};const{layers:e,updating:t}=this._allLayers;let n=null;for(const s of e){const e=this._getSupportedSpatialReferences(s);if(e.length>0){const t=this._narrowDownSpatialReferenceCandidates(n,e);null!=t&&(n=t)}if(null!=n&&1===n.length)break}if(t&&(null==n||1!==n.length))return{updating:!0};const a=this._pickSpatialReferenceCandidate(n);return{spatialReference:null!=a?a.spatialReference:null,viewingMode:null!=a?a.viewingMode:null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get(\"_tileInfoTask\")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:t}=this._collectLayers([{parent:this.map?.()?.basemap,layers:this.map?.()?.basemap?.baseLayers},{layers:this.map?.()?.layers}]);if(e&&e.length>0&&\"tileInfo\"in e[0]){const t=e[0].tileInfo;return{tileInfo:t&&t.spatialReference.equals(this.spatialReference)?t:null,updating:!1}}return{updating:t}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get(\"_heightModelInfoTask\")?.heightModelInfo)return this._get(\"_heightModelInfoTask\")??{updating:!1};const{layers:e,updating:t}=this._allLayers;for(const n of e)if(o(n)){const e=p(n);if(e)return{heightModelInfo:e,vcsWkid:n.spatialReference?.vcsWkid,latestVcsWkid:n.spatialReference?.latestVcsWkid,updating:!1}}return{updating:t}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get(\"_extentCandidatesTask\")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,t=e.updating,n=[];for(const a of e.layers){const e=\"fullExtents\"in a&&a.fullExtents||(null!=a.fullExtent?[a.fullExtent]:[]),t=this.requiresExtentInSpatialReference?null:e[0],s=e.find((e=>e.spatialReference.equals(this.spatialReference)))??t;if(s)return{candidates:[{extent:s,layer:a}],updating:!1};if(this._getSupportedSpatialReferences(a).length>0)for(const i of e)n.push({extent:i,layer:a})}return{candidates:n,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(null==e||0===e.length)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(e),r=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&r.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:null!=this._projectExtentTask.task&&!this._projectExtentTask.task.finished}:(null!=this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:r.clone(),task:n((async e=>{try{const t=await c(i.extent,r,\"portalItem\"in i.layer?i.layer.portalItem:void 0,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch(t){if(s(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}}))},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(null==e)return t;const n=[],a=(e,t)=>null!=e?null!=t?e===t&&e:e:t;for(const s of e)for(const e of t){if(!s.spatialReference.equals(e.spatialReference))continue;const t=a(s.viewingMode,e.viewingMode);if(!1!==t){n.push({spatialReference:s.spatialReference,viewingMode:t});break}}return n.length>0?n:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return null==e||e.length<1?null!=t?{spatialReference:t,viewingMode:null}:null:(null!=t&&e.length>1&&e.some((({spatialReference:e})=>e.equals(t)))&&(e=e.filter((({spatialReference:e})=>e.equals(t)))),e.length>1&&e.some((({viewingMode:e})=>e!==u.Local))&&(e=e.filter((({viewingMode:e})=>e!==u.Local))),e[0])}_getSupportedSpatialReferences(e){const t=\"supportedSpatialReferences\"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return[];const n=[];for(const a of t){const t=this.getSpatialReferenceSupport({spatialReference:a,layer:e});if(null!=t){const e=null!=t.constraints?t.constraints:[{spatialReference:a,viewingMode:null}];for(const{spatialReference:t,viewingMode:a}of e)this.requiresExtentInSpatialReference&&null!=this.userSpatialReference&&!t.equals(this.userSpatialReference)||n.push({spatialReference:t,viewingMode:a})}}return n}_pickExtentCandidate(e){const t=this.spatialReference;return e.find((({extent:e})=>t.equals(e.spatialReference)))||e[0]}_collectLayers(e){if(\"loaded\"!==this._loadMaybe(this.map?.()))return{layers:[],updating:!0};const t=new f;for(const n of e)if(this._collectCollection(n,t),t.preloading===this.sourcePreloadCount)break;return{layers:t.layers,updating:t.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case\"loading\":return t.updating=!0,void++t.preloading;case\"failed\":return}for(const n of e.layers){switch(this._loadMaybe(n)){case\"failed\":continue;case\"loading\":t.updating=!0,++t.preloading;break;case\"loaded\":t.updating||t.layers.push(n),\"layers\"in n&&this._collectCollection({layers:n.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&\"loadStatus\"in e&&null!=e.loadStatus?\"not-loaded\"===e.loadStatus?(e.load().catch((e=>{i(e)||console.log(e)})),\"loading\"):e.loadStatus:\"loaded\"}};e([r()],d.prototype,\"required\",void 0),e([r({constructOnly:!0})],d.prototype,\"map\",void 0),e([r({constructOnly:!0})],d.prototype,\"getSpatialReferenceSupport\",void 0),e([r()],d.prototype,\"defaultSpatialReference\",void 0),e([r()],d.prototype,\"userSpatialReference\",void 0),e([r()],d.prototype,\"sourcePreloadCount\",void 0),e([r()],d.prototype,\"priorityCollection\",void 0),e([r()],d.prototype,\"requiresExtentInSpatialReference\",void 0),e([r()],d.prototype,\"suspended\",void 0),e([r({readOnly:!0})],d.prototype,\"ready\",null),e([r({readOnly:!0})],d.prototype,\"heightModelInfoReady\",null),e([r({readOnly:!0})],d.prototype,\"spatialReference\",null),e([r({readOnly:!0})],d.prototype,\"extent\",null),e([r({readOnly:!0})],d.prototype,\"heightModelInfo\",null),e([r({readOnly:!0})],d.prototype,\"vcsWkid\",null),e([r({readOnly:!0})],d.prototype,\"latestVcsWkid\",null),e([r({readOnly:!0})],d.prototype,\"viewingMode\",null),e([r({readOnly:!0})],d.prototype,\"tileInfo\",null),e([r({readOnly:!0})],d.prototype,\"mapCollections\",null),e([r({readOnly:!0})],d.prototype,\"_allLayers\",null),e([r({readOnly:!0})],d.prototype,\"_spatialReferenceTask\",null),e([r({readOnly:!0})],d.prototype,\"_tileInfoTask\",null),e([r({readOnly:!0})],d.prototype,\"_heightModelInfoTask\",null),e([r({readOnly:!0})],d.prototype,\"_extentCandidatesTask\",null),e([r()],d.prototype,\"_extentTask\",null),e([r()],d.prototype,\"_projectExtentTask\",void 0),d=e([l(\"esri.views.support.DefaultsFromMap\")],d);class f{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}}export{d as DefaultsFromMap};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../Map.js\";import i from\"../TimeExtent.js\";import r from\"../core/Accessor.js\";import{createTask as a}from\"../core/asyncUtils.js\";import s from\"../core/Collection.js\";import o from\"../core/CollectionFlattener.js\";import n from\"../core/Error.js\";import l from\"../core/Evented.js\";import p from\"../core/Handles.js\";import{makeHandle as d}from\"../core/handleUtils.js\";import h from\"../core/Loadable.js\";import y from\"../core/Logger.js\";import{destroyMaybe as c,abortMaybe as u}from\"../core/maybe.js\";import{EsriPromiseMixin as m}from\"../core/Promise.js\";import{after as g}from\"../core/promiseUtils.js\";import{watch as f,whenOnce as w,when as v,sync as V}from\"../core/reactiveUtils.js\";import{property as M}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as R}from\"../core/accessorSupport/decorators/subclass.js\";import{owningCollectionProperty as _}from\"../core/support/OwningCollection.js\";import{UpdatingHandles as S}from\"../core/support/UpdatingHandles.js\";import j from\"../geometry/Extent.js\";import F from\"../geometry/HeightModelInfo.js\";import L from\"../geometry/SpatialReference.js\";import{equals as O}from\"../geometry/support/spatialReferenceUtils.js\";import{AnalysesCollection as T}from\"../support/AnalysesCollection.js\";import{GraphicsCollection as b}from\"../support/GraphicsCollection.js\";import{system as C,unknown as E}from\"../time/timeZoneUtils.js\";import{BasemapView as x}from\"./BasemapView.js\";import k from\"./LayerViewManager.js\";import Z from\"./Magnifier.js\";import I from\"./Theme.js\";import{ToolViewManager as D}from\"./ToolViewManager.js\";import H from\"./input/Input.js\";import{ViewEvents as U}from\"./input/ViewEvents.js\";import P from\"./navigation/Navigation.js\";import{DefaultsFromMap as q}from\"./support/DefaultsFromMap.js\";var A;let z=A=class extends(l.EventedMixin(m(r))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new p,this.updatingHandles=new S,this.allLayerViews=new o({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:N}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new b,this.analyses=new T,this.typeSpecificPreconditionsReady=!0,this.layerViews=new s,this.magnifier=new Z,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new H,this.navigation=new P,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.persistableViewModels=new s,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(f((()=>this.preconditionsReady),(e=>{e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,A.views.add(this)):(this._lockedSpatialReference=null,A.views.remove(this)),this.notifyChange(\"spatialReference\"),!e&&this.ready?(this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach())}),V))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then((()=>(this._isValid=!0,w((()=>this.ready)))))),this.basemapView=new x({view:this}),this.layerViewManager=new k({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new D({view:this}),this._setupSpatialReferenceLogger(),this.addHandles([f((()=>this.initialExtentRequired),(e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e}),{sync:!0,initial:!0}),f((()=>this.ready),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)}),{sync:!0}),f((()=>this._userSpatialReference),(e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)}),{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([f((()=>this.defaultsFromMap?.ready),(t=>{const i=this.map?.allLayers.length>0;if(t&&!this.spatialReference&&i){if(null!=e)return;const t=d((()=>e=u(e)));e=a((async t=>{try{await g(this.spatialReferenceWarningDelay,null,t)}catch{return}finally{e=null}y.getLogger(this).warn(\"#spatialReference\",\"no spatial reference could be derived from the currently added map layers\")})),this.addHandles(t,\"spatial-reference-logger-task\")}else this.removeHandles(\"spatial-reference-logger-task\")}),{sync:!0})])}destroy(){this.destroyed||(A.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(\"navigation\",null)),this.graphics=c(this.graphics),this.analyses=c(this.analyses),this.defaultsFromMap.destroy(),this._set(\"defaultsFromMap\",null),c(this.analysisViewManager),this.toolViewManager=c(this.toolViewManager),this.layerViewManager=c(this.layerViewManager),this.basemapView=c(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach((e=>e.destroy())),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=c(this.map),this.updatingHandles.destroy())}_startup(){this._set(\"ready\",!0)}_teardown(){this._set(\"ready\",!1)}whenReady(){return Promise.resolve(this)}toMap(){return y.getLogger(this).error(\"#toMap()\",\"Not implemented on this instance of View\"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get(\"animation\")}set animation(e){this._set(\"animation\",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new q({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get(\"extent\")}set extent(e){this._set(\"extent\",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h.isLoadable(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get(\"map\")&&(e?.destroyed&&(y.getLogger(this).warn(\"#map\",\"The provided map is already destroyed\",{map:e}),e=null),h.isLoadable(e)&&e.load().catch((()=>{})),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(\"map\",e))}get spatialReference(){let e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.defaultsFromMap?.required?.heightModelInfo&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!O(e,this._get(\"spatialReference\"));this._set(\"_userSpatialReference\",e),t&&(this._set(\"spatialReference\",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??C}set timeZone(e){const t=new Set([\"etc/utc\",\"etc/gmt\",\"gmt\"]),i=new Set(Intl.supportedValuesOf(\"timeZone\").map((e=>e.toLowerCase())));this._userTimeZone=e,e===C||e===E||t.has(e.toLowerCase())||i.has(e.toLowerCase())||y.getLogger(this).warn(\"#timeZone\",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??\"default\"}set cursor(e){this._cursor=e,this.notifyChange(\"cursor\")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new I}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&\"heightModelInfo\"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}importLayerView(e){throw new n(\"importLayerView() not implemented\")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport({spatialReference:e})}when(e,t){return this.isResolved()&&!this.ready&&y.getLogger(this).warn(\"#when()\",\"Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.\"),super.when(e,t)}forceReadyCycle(){this.ready&&(v((()=>this.destroyed||!1===this.preconditionsReady),(()=>this._readyCycleForced=!1),{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};z.views=new s,e([M()],z.prototype,\"_userSpatialReference\",void 0),e([M()],z.prototype,\"activeTool\",null),e([M({readOnly:!0})],z.prototype,\"allLayerViews\",void 0),e([M()],z.prototype,\"groundView\",void 0),e([M()],z.prototype,\"animation\",null),e([M()],z.prototype,\"basemapView\",void 0),e([M()],z.prototype,\"center\",null),e([M({readOnly:!0})],z.prototype,\"_defaultsFromMapSettings\",null),e([M()],z.prototype,\"defaultsFromMap\",null),e([M()],z.prototype,\"fatalError\",void 0),e([M({type:j})],z.prototype,\"extent\",null),e([M(_(b,\"graphics\"))],z.prototype,\"graphics\",void 0),e([M(_(T,\"analyses\"))],z.prototype,\"analyses\",void 0),e([M({readOnly:!0,type:F})],z.prototype,\"heightModelInfo\",null),e([M({readOnly:!0})],z.prototype,\"interacting\",null),e([M({readOnly:!0})],z.prototype,\"navigating\",null),e([M({readOnly:!0,dependsOn:[\"fatalError\",\"_isValid\",\"_readyCycleForced\",\"map\",\"map.loaded?\",\"width\",\"height\",\"spatialReference\",\"_lockedSpatialReference\",\"defaultsFromMap.ready\",\"typeSpecificPreconditionsReady\"]})],z.prototype,\"preconditionsReady\",null),e([M({readOnly:!0})],z.prototype,\"typeSpecificPreconditionsReady\",void 0),e([M({type:s,readOnly:!0})],z.prototype,\"layerViews\",void 0),e([M()],z.prototype,\"resolution\",null),e([M({type:Z})],z.prototype,\"magnifier\",void 0),e([M({value:null,type:t})],z.prototype,\"map\",null),e([M()],z.prototype,\"padding\",void 0),e([M({readOnly:!0})],z.prototype,\"ready\",void 0),e([M({type:L})],z.prototype,\"spatialReference\",null),e([M()],z.prototype,\"spatialReferenceWarningDelay\",void 0),e([M()],z.prototype,\"stationary\",null),e([M({readOnly:!0})],z.prototype,\"supportsGround\",void 0),e([M({type:i})],z.prototype,\"timeExtent\",void 0),e([M({type:String,nonNullable:!0})],z.prototype,\"timeZone\",null),e([M()],z.prototype,\"tools\",null),e([M()],z.prototype,\"toolViewManager\",void 0),e([M({readOnly:!0})],z.prototype,\"type\",void 0),e([M({type:Number})],z.prototype,\"scale\",void 0),e([M({readOnly:!0})],z.prototype,\"updating\",void 0),e([M({readOnly:!0})],z.prototype,\"initialExtentRequired\",void 0),e([M({readOnly:!0})],z.prototype,\"initialExtent\",null),e([M()],z.prototype,\"cursor\",null),e([M({readOnly:!0})],z.prototype,\"input\",void 0),e([M({type:P,nonNullable:!0})],z.prototype,\"navigation\",void 0),e([M()],z.prototype,\"layerViewManager\",void 0),e([M()],z.prototype,\"analysisViewManager\",void 0),e([M()],z.prototype,\"width\",void 0),e([M()],z.prototype,\"height\",void 0),e([M({readOnly:!0})],z.prototype,\"resizing\",void 0),e([M({value:null,readOnly:!0})],z.prototype,\"size\",null),e([M({readOnly:!0})],z.prototype,\"suspended\",void 0),e([M({readOnly:!0})],z.prototype,\"viewEvents\",void 0),e([M({readOnly:!0})],z.prototype,\"persistableViewModels\",void 0),e([M()],z.prototype,\"_isValid\",void 0),e([M()],z.prototype,\"_readyCycleForced\",void 0),e([M()],z.prototype,\"_lockedSpatialReference\",void 0),e([M()],z.prototype,\"_userTimeZone\",void 0),e([M()],z.prototype,\"_lockedTimeZone\",void 0),e([M({type:I})],z.prototype,\"theme\",void 0),e([M({readOnly:!0,type:I})],z.prototype,\"effectiveTheme\",null),z=A=e([R(\"esri.views.View\")],z);const W=z;function N(e){return e.layerViews}export{W as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import s from\"../core/Error.js\";import{EsriPromise as e}from\"../core/Promise.js\";import{createResolver as r,isPromiseLike as o}from\"../core/promiseUtils.js\";import{property as i}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";let n=class extends e{constructor(t){super(t),this.state=\"running\",this.target=null,this._resolver=null}initialize(){this._resolver=r(),this.addResolvingPromise(this._resolver.promise)}get done(){return\"finished\"===this.state||\"stopped\"===this.state}stop(){\"stopped\"!==this.state&&\"finished\"!==this.state&&(this._set(\"state\",\"stopped\"),this._resolver?.reject(new s(\"ViewAnimation stopped\")))}finish(){\"stopped\"!==this.state&&\"finished\"!==this.state&&(this._set(\"state\",\"finished\"),this._resolver?.resolve())}update(t,s){s||(s=o(t)?\"waiting-for-target\":\"running\"),this._set(\"target\",t),this._set(\"state\",s)}};t([i({readOnly:!0})],n.prototype,\"done\",null),t([i({readOnly:!0,type:String})],n.prototype,\"state\",void 0),t([i()],n.prototype,\"target\",void 0),n=t([p(\"esri.views.ViewAnimation\")],n),function(t){t.State={RUNNING:\"running\",STOPPED:\"stopped\",FINISHED:\"finished\",WAITING_FOR_TARGET:\"waiting-for-target\"}}(n||(n={}));const a=n;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e,n,t,r){const u=3*e,i=3*(t-e)-u,a=1-u-i,o=3*n,s=3*(r-n)-o,f=1-o-s;function c(e){return((a*e+i)*e+u)*e}function l(e){return((f*e+s)*e+o)*e}function b(e){return(3*a*e+2*i)*e+u}function p(e,n){let t,r,u,i,a,o;for(u=e,o=0;o<8;o++){if(i=c(u)-e,Math.abs(i)r)return r;for(;ti?t=u:r=u,u=.5*(r-t)+t}return u}return function(e,n=1e-6){return l(p(e,n))}}const n=/^cubic-bezier\\((.*)\\)/,t={};function r(r){let u=t[r]||null;if(!u){const t=n.exec(r);if(t){const n=t[1].split(\",\").map((e=>parseFloat(e.trim())));4!==n.length||n.some((e=>isNaN(e)))||(u=e.apply(e,n))}}return u}t.ease=e(.25,.1,.25,1),t.linear=e(0,0,1,1),t.easeIn=t[\"ease-in\"]=e(.42,0,1,1),t.easeOut=t[\"ease-out\"]=e(0,0,.58,1),t.easeInOut=t[\"ease-in-out\"]=e(.42,0,.58,1);export{t as easingFunctions,r as parse,e as unitBezier};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as t}from\"./common.js\";function a(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t}function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function s(t,a,n,s,r,u,o){return t[0]=a,t[1]=n,t[2]=s,t[3]=r,t[4]=u,t[5]=o,t}function r(t,a){const n=a[0],s=a[1],r=a[2],u=a[3],o=a[4],e=a[5];let c=n*u-s*r;return c?(c=1/c,t[0]=u*c,t[1]=-s*c,t[2]=-r*c,t[3]=n*c,t[4]=(r*e-u*o)*c,t[5]=(s*o-n*e)*c,t):null}function u(t){return t[0]*t[3]-t[1]*t[2]}function o(t,a,n){const s=a[0],r=a[1],u=a[2],o=a[3],e=a[4],c=a[5],i=n[0],h=n[1],M=n[2],f=n[3],b=n[4],l=n[5];return t[0]=s*i+u*h,t[1]=r*i+o*h,t[2]=s*M+u*f,t[3]=r*M+o*f,t[4]=s*b+u*l+e,t[5]=r*b+o*l+c,t}function e(t,a,n){const s=a[0],r=a[1],u=a[2],o=a[3],e=a[4],c=a[5],i=Math.sin(n),h=Math.cos(n);return t[0]=s*h+u*i,t[1]=r*h+o*i,t[2]=s*-i+u*h,t[3]=r*-i+o*h,t[4]=e,t[5]=c,t}function c(t,a,n){const s=a[0],r=a[1],u=a[2],o=a[3],e=a[4],c=a[5],i=n[0],h=n[1];return t[0]=s*i,t[1]=r*i,t[2]=u*h,t[3]=o*h,t[4]=e,t[5]=c,t}function i(t,a,n){const s=a[0],r=a[1],u=a[2],o=a[3],e=a[4],c=a[5],i=n[0],h=n[1];return t[0]=s,t[1]=r,t[2]=u,t[3]=o,t[4]=s*i+u*h+e,t[5]=r*i+o*h+c,t}function h(t,a){const n=Math.sin(a),s=Math.cos(a);return t[0]=s,t[1]=n,t[2]=-n,t[3]=s,t[4]=0,t[5]=0,t}function M(t,a){return t[0]=a[0],t[1]=0,t[2]=0,t[3]=a[1],t[4]=0,t[5]=0,t}function f(t,a){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=a[0],t[5]=a[1],t}function b(t){return\"mat2d(\"+t[0]+\", \"+t[1]+\", \"+t[2]+\", \"+t[3]+\", \"+t[4]+\", \"+t[5]+\")\"}function l(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)}function m(t,a,n){return t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t[3]=a[3]+n[3],t[4]=a[4]+n[4],t[5]=a[5]+n[5],t}function d(t,a,n){return t[0]=a[0]-n[0],t[1]=a[1]-n[1],t[2]=a[2]-n[2],t[3]=a[3]-n[3],t[4]=a[4]-n[4],t[5]=a[5]-n[5],t}function p(t,a,n){return t[0]=a[0]*n,t[1]=a[1]*n,t[2]=a[2]*n,t[3]=a[3]*n,t[4]=a[4]*n,t[5]=a[5]*n,t}function x(t,a,n,s){return t[0]=a[0]+n[0]*s,t[1]=a[1]+n[1]*s,t[2]=a[2]+n[2]*s,t[3]=a[3]+n[3]*s,t[4]=a[4]+n[4]*s,t[5]=a[5]+n[5]*s,t}function y(t,a){return t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]&&t[3]===a[3]&&t[4]===a[4]&&t[5]===a[5]}function g(a,n){const s=a[0],r=a[1],u=a[2],o=a[3],e=a[4],c=a[5],i=n[0],h=n[1],M=n[2],f=n[3],b=n[4],l=n[5],m=t();return Math.abs(s-i)<=m*Math.max(1,Math.abs(s),Math.abs(i))&&Math.abs(r-h)<=m*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(u-M)<=m*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(o-f)<=m*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(e-b)<=m*Math.max(1,Math.abs(e),Math.abs(b))&&Math.abs(c-l)<=m*Math.max(1,Math.abs(c),Math.abs(l))}const S=o,j=d,q=Object.freeze(Object.defineProperty({__proto__:null,add:m,copy:a,determinant:u,equals:g,exactEquals:y,frob:l,fromRotation:h,fromScaling:M,fromTranslation:f,identity:n,invert:r,mul:S,multiply:o,multiplyScalar:p,multiplyScalarAndAdd:x,rotate:e,scale:c,set:s,str:b,sub:j,subtract:d,translate:i},Symbol.toStringTag,{value:\"Module\"}));export{f as a,h as b,n as c,s as d,q as e,M as f,a as g,u as h,r as i,b as j,l as k,m as l,o as m,d as n,p as o,x as p,y as q,e as r,c as s,i as t,g as u,S as v,j as w};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(){return[1,0,0,1,0,0]}function r(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function t(e,r,t,n,o,a){return[e,r,t,n,o,a]}function n(e,r){return new Float64Array(e,r,6)}const o=Object.freeze(Object.defineProperty({__proto__:null,clone:r,create:e,createView:n,fromValues:t},Symbol.toStringTag,{value:\"Module\"}));export{r as a,n as b,e as c,t as f,o as m};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{R as t,g as n}from\"./common.js\";function a(t,n){return t[0]=n[0],t[1]=n[1],t}function r(t,n,a){return t[0]=n,t[1]=a,t}function s(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t}function o(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t}function u(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t}function e(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t}function c(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t}function i(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t}function f(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t}function M(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t}function h(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t}function l(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t}function d(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t}function m(t,n){const a=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(a*a+r*r)}function b(t,n){const a=n[0]-t[0],r=n[1]-t[1];return a*a+r*r}function q(t){const n=t[0],a=t[1];return Math.sqrt(n*n+a*a)}function p(t){const n=t[0],a=t[1];return n*n+a*a}function g(t,n){return t[0]=-n[0],t[1]=-n[1],t}function x(t,n){return t[0]=1/n[0],t[1]=1/n[1],t}function v(t,n){const a=n[0],r=n[1];let s=a*a+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=n[0]*s,t[1]=n[1]*s),t}function j(t,n){return t[0]*n[0]+t[1]*n[1]}function y(t,n,a){const r=n[0]*a[1]-n[1]*a[0];return t[0]=t[1]=0,t[2]=r,t}function A(t,n,a,r){const s=n[0],o=n[1];return t[0]=s+r*(a[0]-s),t[1]=o+r*(a[1]-o),t}function P(n,a){a=a||1;const r=2*t()*Math.PI;return n[0]=Math.cos(r)*a,n[1]=Math.sin(r)*a,n}function _(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[2]*s,t[1]=a[1]*r+a[3]*s,t}function z(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[2]*s+a[4],t[1]=a[1]*r+a[3]*s+a[5],t}function D(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[3]*s+a[6],t[1]=a[1]*r+a[4]*s+a[7],t}function I(t,n,a){const r=n[0],s=n[1];return t[0]=a[0]*r+a[4]*s+a[12],t[1]=a[1]*r+a[5]*s+a[13],t}function L(t,n,a,r){const s=n[0]-a[0],o=n[1]-a[1],u=Math.sin(r),e=Math.cos(r);return t[0]=s*e-o*u+a[0],t[1]=s*u+o*e+a[1],t}function O(t,n){const a=t[0],r=t[1],s=n[0],o=n[1];let u=a*a+r*r;u>0&&(u=1/Math.sqrt(u));let e=s*s+o*o;e>0&&(e=1/Math.sqrt(e));const c=(a*s+r*o)*u*e;return c>1?0:c<-1?Math.PI:Math.acos(c)}function S(t){return\"vec2(\"+t[0]+\", \"+t[1]+\")\"}function E(t,n){return t[0]===n[0]&&t[1]===n[1]}function k(t,a){const r=t[0],s=t[1],o=a[0],u=a[1],e=n();return Math.abs(r-o)<=e*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=e*Math.max(1,Math.abs(s),Math.abs(u))}function w(t,n,a,r,s){let o=n[0]-a[0],u=n[1]-a[1];const e=(r[0]*o+r[1]*u)*(s-1);return o=r[0]*e,u=r[1]*e,t[0]=n[0]+o,t[1]=n[1]+u,t}const B=q,C=o,F=u,G=e,H=m,J=b,K=p,N=Object.freeze(Object.defineProperty({__proto__:null,add:s,angle:O,ceil:c,copy:a,cross:y,dist:H,distance:m,div:G,divide:e,dot:j,equals:k,exactEquals:E,floor:i,inverse:x,len:B,length:q,lerp:A,max:M,min:f,mul:F,multiply:u,negate:g,normalize:v,projectAndScale:w,random:P,rotate:L,round:h,scale:l,scaleAndAdd:d,set:r,sqrDist:J,sqrLen:K,squaredDistance:b,squaredLength:p,str:S,sub:C,subtract:o,transformMat2:_,transformMat2d:z,transformMat3:D,transformMat4:I},Symbol.toStringTag,{value:\"Module\"}));export{M as A,u as B,e as C,c as D,i as E,h as F,x as G,P as H,D as I,I as J,S as K,B as L,F as M,G as N,J as O,K as P,l as a,C as b,o as c,m as d,v as e,y as f,j as g,q as h,s as i,a as j,b as k,A as l,E as m,g as n,k as o,H as p,_ as q,L as r,r as s,z as t,w as u,p as v,d as w,O as x,N as y,f as z};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(){return[0,0]}function t(n){return[n[0],n[1]]}function r(n,t){return[n,t]}function e(t,r=n()){const e=Math.min(2,t.length);for(let n=0;n{const t=r(e);return t.spatialReference=u,t}))}}export{i as cut};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getJsonType as e,getGeometryType as t}from\"../../geometry/support/jsonUtils.js\";function r(t){return{geometryType:e(t[0]),geometries:t.map((e=>e.toJSON()))}}function o(e,r,o){const n=t(r);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=o,t}))}export{o as decodeGeometries,r as encodeGeometries};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"../../request.js\";import{urlToObject as t}from\"../../core/urlUtils.js\";import{getJsonType as e}from\"../../geometry/support/jsonUtils.js\";import{srToRESTValue as s}from\"../../geometry/support/spatialReferenceUtils.js\";import{encodeGeometries as o,decodeGeometries as i}from\"./utils.js\";async function m(m,p,f){const n=\"string\"==typeof m?t(m):m,a=p[0].spatialReference,u=e(p[0]),l={...f,query:{...n.query,f:\"json\",sr:s(a),geometries:JSON.stringify(o(p))}},{data:y}=await r(n.path+\"/simplify\",l);return i(y.geometries,u,a)}export{m as simplify};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../config.js\";import e from\"../../core/Error.js\";import n from\"../../core/Logger.js\";import s from\"../Polygon.js\";import o from\"../Polyline.js\";import{getGeometryParts as r,cutParams as i,offsetMagnitude as l,updatePolyGeometry as c}from\"./normalizeUtilsCommon.js\";import{getInfo as f}from\"./spatialReferenceUtils.js\";import{geographicToWebMercator as u,webMercatorToGeographic as a}from\"./webMercatorUtils.js\";import{cut as p}from\"../../rest/geometryService/cut.js\";import{simplify as h}from\"../../rest/geometryService/simplify.js\";const m=n.getLogger(\"esri.geometry.support.normalizeUtils\");function g(t){return\"polygon\"===t.type}function y(t){return\"polygon\"===t[0].type}function x(t){return\"polyline\"===t[0].type}function d(t){const e=[];let n=0,s=0;for(let o=0;o1){for(let l=1;l<=a-1;l++){const e=l*n,s=u*e+o,i=f*e+r;t.push([s,i])}const e=(c+Math.floor(a-1)*n)/2,s=u*e+o,i=f*e+r;t.push([s,i])}t.push([i,l])}}return g(t)?new s({rings:l,spatialReference:t.spatialReference}):new o({paths:l,spatialReference:t.spatialReference})}function w(t,e,n){if(e){const e=M(t,1e6);t=a(e,!0)}return n&&(t=c(t,n)),t}function j(t,e,n){if(Array.isArray(t)){const s=t[0];if(s>e){const n=l(s,e);t[0]=s+n*(-2*e)}else if(se){const n=l(s,e);t=t.clone().offset(n*(-2*e),0)}else if(s{if(n[0]<180)return!0;{let n=0;for(let t=0;tn?s:n}n=Number(n.toFixed(9));const s=-360*l(n,180);for(let o=0;oj(t,d,M))),A.push(e)}else if(\"extent\"===t.type){const e=t.clone()._normalize(!1,!1,y);A.push(e.rings?new s(e):e)}else if(t.extent){const e=t.extent,n=l(e.xmin,M)*(2*d);let s=0===n?t.clone():c(t.clone(),n);e.offset(n,0),e.intersects(P)&&e.xmax!==d?(U=e.xmax>U?e.xmax:U,s=w(s,x),z.push(s),A.push(\"cut\")):e.intersects(L)&&e.xmin!==M?(U=e.xmax*(2*d)>U?e.xmax*(2*d):U,s=w(s,x,360),z.push(s),A.push(\"cut\")):A.push(s)}else A.push(t.clone());else A.push(t);else A.push(t);let S=l(U,d),k=-90;const C=S,I=new o;for(;S>0;){const t=360*S-180;I.addPath([[t,k],[t,-1*k]]),k*=-1,S--}if(z.length>0&&C>0){const t=b(z,await p(a,z,I,r)),n=[],s=[];for(let r=0;r1&&o.rings.length>=i.rings.length?(n.push(o),s.push(\"simplify\")):s.push(x?u(o):o)}}if(!n.length)return s;const o=await h(a,n,r),i=[];for(let e=0;er||co)return e;switch(t.type){case\"polygon\":if(!(t.rings.length>1))return e;l=d(t.rings);break;case\"polyline\":if(!(t.paths.length>1))return e;l=d(t.paths);break;case\"multipoint\":l=t.points}const a=e.clone();for(let f=0;fr?l=Math.ceil(Math.abs(e-r)/i):er?c=Math.ceil(Math.abs(t-r)/i):tr?u-=i:as)for(;t>s;)t-=o}return t}export{P as getClosestDenormalizedXToReference,v as getDenormalizedExtent,R as normalizeCentralMeridian,L as normalizeMapX,M as straightLineDensify};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../Viewpoint.js\";import e from\"../../core/Collection.js\";import{getMetersPerUnitForSR as n}from\"../../core/unitUtils.js\";import{t as r}from\"../../chunks/common.js\";import{f as o,r as a,t as i,a as c,s,b as u,i as f}from\"../../chunks/mat2d.js\";import{c as l}from\"../../chunks/mat2df64.js\";import{a as m,s as y,b as p,n as g,c as x,e as h,f as b,g as w,h as d,i as j,t as G,j as R}from\"../../chunks/vec2.js\";import{f as k,a as A}from\"../../chunks/vec2f64.js\";import S from\"../../geometry/Extent.js\";import v from\"../../geometry/Geometry.js\";import M from\"../../geometry/Point.js\";import{isLoaded as z,canProjectWithoutEngine as F,load as N,project as I}from\"../../geometry/projection.js\";import V from\"../../geometry/SpatialReference.js\";import{getClosestDenormalizedXToReference as q,getDenormalizedExtent as C}from\"../../geometry/support/normalizeUtils.js\";import{equals as L,isValid as P,getInfo as E}from\"../../geometry/support/spatialReferenceUtils.js\";const U=96,O=39.37,Q=180/Math.PI;function T(t){return t.wkid?t:t.spatialReference||V.WGS84}function B(t,e){return e.type?y(t,e.x,e.y):R(t,e)}function D(t){return n(t)}function W(t,e){const n=Math.max(1,e[0]),r=Math.max(1,e[1]);return Math.max(t.width/n,t.height/r)*it(t.spatialReference)}async function H(t,n,r,o){let a,i;if(!t)return null;if(Array.isArray(t)&&!t.length)return null;if(e.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&\"object\"==typeof t[0]){const e=t.every((t=>\"attributes\"in t)),a=t.some((t=>!t.geometry));let i=t;if(e&&a&&n&&n.allLayerViews){const e=new Map;for(const n of t){const t=n.layer,r=e.get(t)||[],o=n.attributes[t.objectIdField];null!=o&&r.push(o),e.set(t,r)}const r=[];e.forEach(((t,e)=>{const o=n.allLayerViews.find((t=>t.layer.id===e.id));if(o&&\"queryFeatures\"in o){const n=e.createQuery();n.objectIds=t,n.returnGeometry=!0,r.push(o.queryFeatures(n))}}));const o=await Promise.all(r),a=[];for(const t of o)if(t&&t.features&&t.features.length)for(const e of t.features)null!=e.geometry&&a.push(e.geometry);i=a}for(const t of i)o=await H(t,n,r,o);return o}if(Array.isArray(t)&&2===t.length&&\"number\"==typeof t[0]&&\"number\"==typeof t[1])a=new M(t);else if(t instanceof v)a=t;else if(\"geometry\"in t)if(t.geometry)a=t.geometry;else if(t.layer){const e=t.layer,r=n.allLayerViews.find((t=>t.layer.id===e.id));if(r&&\"queryFeatures\"in r){const n=e.createQuery();n.objectIds=[t.attributes[e.objectIdField]],n.returnGeometry=!0;const o=await r.queryFeatures(n);a=o?.features?.[0]?.geometry}}if(null==a)return null;switch(a.type){case\"point\":i=new S({xmin:a.x,ymin:a.y,xmax:a.x,ymax:a.y,spatialReference:a.spatialReference});break;case\"extent\":case\"multipoint\":case\"polygon\":case\"polyline\":i=C(a);break;default:i=a.extent}if(!i)return null;z()||F(i.spatialReference,r)||await N();const c=I(i,r);return c?o=o?o.union(c):c:null}function J(t){if(t&&(!Array.isArray(t)||\"number\"!=typeof t[0])&&(\"object\"==typeof t||Array.isArray(t)&&\"object\"==typeof t[0])){if(\"layer\"in t&&null!=t.layer?.minScale&&null!=t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every((t=>\"layer\"in t))){let e=0,n=0;for(const r of t){const t=r.layer;t?.minScale&&t.maxScale&&(e=t.minScalen?t.maxScale:n)}return e&&n?{min:e,max:n}:null}}}function K(t,e){return L(T(t),e)?t:I(t,e)}async function X(e,n){if(!e||!n)return new t({targetGeometry:new M,scale:0,rotation:0});let r=n.spatialReference;const{constraints:o,padding:a,viewpoint:i,size:c}=n,s=[a?c[0]-a.left-a.right:c[0],a?c[1]-a.top-a.bottom:c[1]];let u=null;e instanceof t?u=e:e.viewpoint?u=e.viewpoint:e.target&&\"esri.Viewpoint\"===e.target.declaredClass&&(u=e.target);let f=null;u?.targetGeometry?f=u.targetGeometry:e instanceof S?f=e:(e||e&&(\"center\"in e||\"extent\"in e||\"target\"in e))&&(f=await H(e.center,n,r)||await H(e.extent,n,r)||await H(e.target,n,r)||await H(e,n,r)),!f&&i?.targetGeometry?f=i.targetGeometry:!f&&n.extent&&(f=n.extent),r||(r=T(n.spatialReference||n.extent||f)),z()||L(f.spatialReference,r)||F(f.spatialReference,r)||await N();const l=K(\"center\"in f?f.center:f,r);!1!==n.pickClosestTarget&&\"point\"===l.type&&\"point\"===i.targetGeometry?.type&&(l.x=q(l.x,i.targetGeometry.x,l.spatialReference));let m=0;if(null!=u?.targetGeometry&&\"point\"===u.targetGeometry.type)m=u.scale;else if(\"scale\"in e&&e.scale)m=e.scale;else if(\"zoom\"in e&&-1!==e.zoom&&o&&o.effectiveLODs)m=o.zoomToScale(e.zoom);else if(Array.isArray(f)||\"point\"===f.type||\"extent\"===f.type&&0===f.width&&0===f.height){const t=K(n.extent,r);m=null!=t?W(t,s):n.extent?W(n.extent,s):i.scale}else m=W(K(f.extent,r),s);const y=J(e.target??e);y&&(y.min&&y.minm&&(m=y.max));let p=0;u?p=u.rotation:e.hasOwnProperty(\"rotation\")?p=e.rotation:i&&(p=i.rotation);let g=new t({targetGeometry:l,scale:m,rotation:p});return o&&(g=o.fit(g),o.constrainByGeometry(g),o.rotationEnabled||(g.rotation=i.rotation)),g}function Y(t,e){const n=t.targetGeometry,r=e.targetGeometry;return n.x=r.x,n.y=r.y,n.spatialReference=r.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function Z(t,e,n){return n?y(t,.5*(e[0]-n.right+n.left),.5*(e[1]-n.bottom+n.top)):m(t,e,.5)}const $=function(){const t=A();return function(e,n,r){const o=n.targetGeometry;B(t,o);const a=.5*rt(n);return e.xmin=t[0]-a*r[0],e.ymin=t[1]-a*r[1],e.xmax=t[0]+a*r[0],e.ymax=t[1]+a*r[1],e.spatialReference=o.spatialReference,e}}();function _(t,e,n,r,o){return gt(t,e,n.center),t.scale=W(n,r),o?.constraints?.constrain(t),t}function tt(t,e,n,r){return ut(t,e,n,r),f(t,t)}const et=function(){const t=A();return function(e,n,r){return p(e,ct(e,n),Z(t,n,r))}}(),nt=function(){const t=l(),e=A();return function(n,r,c,s){const u=rt(r),f=at(r);return y(e,u,u),o(t,e),a(t,t,f),i(t,t,et(e,c,s)),i(t,t,[0,s.top-s.bottom]),y(n,t[4],t[5])}}();function rt(t){return t.scale*ot(t.targetGeometry)}function ot(t){return null!=t&&P(t.spatialReference)?1/(D(t.spatialReference)*O*U):1}function at(t){return r(t.rotation)||0}function it(t){return P(t)?D(t)*O*U:1}function ct(t,e){return m(t,e,.5)}const st=function(){const t=A(),e=A(),n=A();return function(r,o,u,f,l,p){return g(t,o),m(e,u,.5*p),y(n,1/f*p,-1/f*p),c(r,e),l&&a(r,r,l),s(r,r,n),i(r,r,t),r}}(),ut=function(){const t=A();return function(e,n,r,o){const a=rt(n),i=at(n);return B(t,n.targetGeometry),st(e,t,r,a,i,o)}}(),ft=function(){const t=A();return function(e,n,r,o){const a=rt(n);return B(t,n.targetGeometry),st(e,t,r,a,0,o)}}();function lt(t){const e=E(t);return e?e.valid[1]-e.valid[0]:0}function mt(t,e){return Math.round(lt(t)/e)}const yt=function(){const t=A(),e=A(),n=[0,0,0];return function(r,o,a){x(t,r,o),h(t,t),x(e,r,a),h(e,e),b(n,t,e);let i=Math.acos(w(t,e)/(d(t)*d(e)))*Q;return n[2]<0&&(i=-i),isNaN(i)&&(i=0),i}}(),pt=function(){const t=A();return function(e,n,r,o){const a=e.targetGeometry;return Y(e,n),nt(t,n,r,o),a.x+=t[0],a.y+=t[1],e}}(),gt=function(t,e,n){Y(t,e);const r=t.targetGeometry;return r.x=n.x,r.y=n.y,r.spatialReference=n.spatialReference,t},xt=function(){const t=A();return function(e,n,r,o,a){a||(a=\"center\"),p(t,r,o),m(t,t,.5);const i=t[0],c=t[1];switch(a){case\"center\":y(t,0,0);break;case\"left\":y(t,-i,0);break;case\"top\":y(t,0,c);break;case\"right\":y(t,i,0);break;case\"bottom\":y(t,0,-c);break;case\"top-left\":y(t,-i,c);break;case\"bottom-left\":y(t,-i,-c);break;case\"top-right\":y(t,i,c);break;case\"bottom-right\":y(t,i,-c)}return At(e,n,t),e}}();function ht(t,e,n){return Y(t,e),t.rotation+=n,t}function bt(t,e,n){return Y(t,e),t.rotation=n,t}const wt=function(){const t=A();return function(e,n,r,o,a){return Y(e,n),isNaN(r)||0===r||(Rt(t,o,n,a),e.scale=n.scale*r,kt(t,t,e,a),At(e,e,y(t,t[0]-o[0],o[1]-t[1]))),e}}();function dt(t,e,n){return Y(t,e),t.scale=n,t}const jt=function(){const t=A();return function(e,n,r,o,a,i){return Y(e,n),isNaN(r)||0===r||(Rt(t,a,n,i),e.scale=n.scale*r,e.rotation+=o,kt(t,t,e,i),At(e,e,y(t,t[0]-a[0],a[1]-t[1]))),e}}(),Gt=function(){const t=A(),e=A();return function(n,r,o,a,i,c,s){return et(e,c,s),j(t,i,e),a?jt(n,r,o,a,t,c):wt(n,r,o,t,c)}}(),Rt=function(){const t=l();return function(e,n,r,o){return G(e,n,tt(t,r,o,1))}}(),kt=function(){const t=l();return function(e,n,r,o){return G(e,n,ut(t,r,o,1))}}(),At=function(){const t=A(),e=l();return function(n,r,o){Y(n,r);const a=rt(r),i=n.targetGeometry;return u(e,at(r)),s(e,e,k(a,a)),G(t,o,e),i.x+=t[0],i.y+=t[1],n}}();export{pt as addPadding,yt as angleBetween,gt as centerAt,Y as copy,X as create,W as extentToScale,Z as getAnchor,$ as getExtent,st as getMatrix,nt as getPaddingMapTranslation,et as getPaddingScreenTranslation,rt as getResolution,it as getResolutionToScaleFactor,ut as getTransform,ft as getTransformNoRotation,mt as getWorldScreenWidth,lt as getWorldWidth,Gt as padAndScaleAndRotateBy,xt as resize,ht as rotateBy,bt as rotateTo,jt as scaleAndRotateBy,dt as scaleTo,_ as setExtent,Rt as toMap,kt as toScreen,At as translateBy};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import i from\"../../Viewpoint.js\";import s from\"../../core/Accessor.js\";import{removeMaybe as e}from\"../../core/maybe.js\";import{addFrameTask as o}from\"../../core/scheduling.js\";import{property as n}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as a}from\"../../core/accessorSupport/decorators/subclass.js\";import r from\"../ViewAnimation.js\";import{easingFunctions as h,parse as p}from\"./unitBezier.js\";import{copy as c}from\"./viewpointUtils.js\";import m from\"../../geometry/Point.js\";class u{constructor(t,i,s,e){const o=t.targetGeometry,n=i.targetGeometry;e?\"string\"==typeof e&&(e=p(e)||h.ease):e=h.ease,this.easing=e,this.duration=s,this.sCenterX=o.x,this.sCenterY=o.y,this.sScale=t.scale,this.sRotation=t.rotation,this.tCenterX=n.x,this.tCenterY=n.y,this.tScale=i.scale,this.tRotation=i.rotation,this.dCenterX=this.tCenterX-this.sCenterX,this.dCenterY=this.tCenterY-this.sCenterY,this.dScale=this.tScale-this.sScale,this.dRotation=this.tRotation-this.sRotation,this.dRotation>180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(t,i){const s=this.easing(i);let e,o,n,a;i>=1?(e=this.tCenterX,o=this.tCenterY,n=this.tRotation,a=this.tScale):(e=this.sCenterX+s*this.dCenterX,o=this.sCenterY+s*this.dCenterY,n=this.sRotation+s*this.dRotation,a=this.sScale+s*this.dScale),t.targetGeometry.x=e,t.targetGeometry.y=o,t.scale=a,t.rotation=n}}let d=class extends s{constructor(t){super(t),this.updateFunction=null,this.animation=null,this.duration=200,this.transition=null,this.easing=h.ease,this.view=null,this.viewpoint=new i({targetGeometry:new m,scale:0,rotation:0}),this._updateTask=o({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=e(this._updateTask)}animate(t,i,s){this.stop();const e=this.viewpoint;c(e,i),this.transition=new u(this.viewpoint,t.target,s?.duration||this.duration,s?.easing||this.easing);const o=()=>{this.animation===t&&this._updateTask&&(\"finished\"===t.state&&(this.transition?.applyRatio(this.viewpoint,1),this.view?.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(o,o),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinous(t,i){this.stop(),this.updateFunction=i,this.viewpoint=t;const s=new r({target:t.clone()}),e=()=>{this.animation===s&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return s.when(e,e),this._startTime=performance.now(),this._updateTask.resume(),this.animation=s,s}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const i=this.animation;if(i&&i.state!==r.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime);else{const t=this.transition,i=(performance.now()-this._startTime)/t.duration,s=i>=1;t.applyRatio(this.viewpoint,i),s&&this.animation?.finish()}this.view?.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};t([n()],d.prototype,\"animation\",void 0),t([n()],d.prototype,\"duration\",void 0),t([n()],d.prototype,\"transition\",void 0),t([n()],d.prototype,\"easing\",void 0),t([n()],d.prototype,\"view\",void 0),t([n()],d.prototype,\"viewpoint\",void 0),d=t([a(\"esri.views.2d.AnimationManager\")],d);const l=d;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{watch as t}from\"../../core/reactiveUtils.js\";import{addFrameTask as e}from\"../../core/scheduling.js\";class a{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:t,graphicsView:e,labelManager:a,state:{id:s}}=this.view;t.forEach(this._updateLayerView,this),null!=a&&(a.lastUpdateId!==s&&(a.viewChange(),a.lastUpdateId=s),a.updateRequested&&a.processUpdate(this._updateParameters)),null!=e&&(e.lastUpdateId!==s&&(e.viewChange(),e.lastUpdateId=s),e.updateRequested&&e.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle?.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const a=this.view;this.stationary=a.stationary,this._updateParameters={state:a.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:a.renderingOptions},this._stationaryHandle=t((()=>a.stationary),(t=>{this.stationary=t,this.requestFrame()})),this._frameTaskHandle=e(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,a=t.lastUpdateId;null!=a&&(this.stationary||t.moving)||(t.moving=!0,t.moveStart()),a!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),\"layerViews\"in t&&t.layerViews?.forEach(this._updateLayerView,this)}}export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import e from\"../../core/Error.js\";import i from\"../../core/Logger.js\";import{throwIfAborted as r}from\"../../core/promiseUtils.js\";import{whenOnce as s}from\"../../core/reactiveUtils.js\";import{property as n}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as a}from\"../../core/accessorSupport/decorators/subclass.js\";import c from\"../ViewAnimation.js\";import{create as m}from\"./viewpointUtils.js\";let p=class extends o{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,o){if(!t)return void i.getLogger(this).error(\"#goTo()\",\"target cannot be null or undefined\");this.view.animation&&(this.view.animation=null);const e=this._createAnimation();await s((()=>this.view.ready),o);const r={animate:!0,...o},{extent:n,spatialReference:a,size:c,viewpoint:p,constraints:l,padding:h,allLayerViews:w}=this.view,g=m(t,{extent:n,spatialReference:a,size:c,viewpoint:p,constraints:l,padding:h,allLayerViews:w,pickClosestTarget:o?.pickClosestTarget??!0});return e?.update(g),this._gotoTask={},r.animate?this._gotoAnimated(g,r):this._gotoImmediate(g,r)}_gotoImmediate(t,o){const i=this._gotoTask,s=this.view.animation,n=t.then((t=>{if(r(o),i!==this._gotoTask)throw new e(\"view:goto-interrupted\",\"Goto was interrupted\");this.view.viewpoint=s.target=t,s.finish()}));return this._cancellableGoTo(i,s,n)}_gotoAnimated(t,o){const i=this._gotoTask,s=this.view.animation;if(!s)return Promise.resolve();const n=t.then((t=>{if(r(o),i!==this._gotoTask)throw new e(\"view:goto-interrupted\",\"Goto was interrupted\");return s.update(t),this.view.animationManager.animate(s,this.view.viewpoint,o),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,n)}_createAnimation(){return this.view.animation&&!this.view.animation.done||(this.view.animation=new c),this.view.animation}_cancellableGoTo(t,o,e){const i=()=>t===this._gotoTask;return e.finally((()=>{i()&&(o.done||o.stop(),this.view.animation=null)}))}};t([n({constructOnly:!0})],p.prototype,\"view\",void 0),p=t([a(\"esri.views.2d.GoToManager\")],p);export{p as GoToManager};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";function r(){return Promise.all([import(\"./webglDeps.js\"),import(\"./mapViewDeps.js\")])}const a=()=>r().then((()=>import(\"./layers/TileLayerView2D.js\"))),t=()=>r().then((()=>import(\"./layers/FeatureLayerView2D.js\"))),s={\"base-dynamic\":()=>r().then((()=>import(\"./layers/BaseDynamicLayerView2D.js\"))),\"base-tile\":a,\"bing-maps\":a,csv:t,\"geo-rss\":()=>r().then((()=>import(\"./layers/GeoRSSLayerView2D.js\"))),feature:t,geojson:t,graphics:()=>r().then((()=>import(\"./layers/GraphicsLayerView2D.js\"))),group:()=>r().then((()=>import(\"./layers/GroupLayerView2D.js\"))),imagery:()=>r().then((()=>import(\"./layers/ImageryLayerView2D.js\"))),\"imagery-tile\":()=>r().then((()=>import(\"./layers/ImageryTileLayerView2D.js\"))),kml:()=>r().then((()=>import(\"./layers/KMLLayerView2D.js\"))),\"knowledge-graph\":()=>r().then((()=>import(\"./layers/KnowledgeGraphLayerView2D.js\"))),\"link-chart\":()=>r().then((()=>import(\"./layers/KnowledgeGraphLayerView2D.js\"))),\"knowledge-graph-sublayer\":t,\"map-image\":()=>r().then((()=>import(\"./layers/MapImageLayerView2D.js\"))),\"map-notes\":()=>r().then((()=>import(\"./layers/MapNotesLayerView2D.js\"))),media:()=>r().then((()=>import(\"./layers/MediaLayerView2D.js\"))),\"ogc-feature\":()=>r().then((()=>import(\"./layers/OGCFeatureLayerView2D.js\"))),\"open-street-map\":a,\"oriented-imagery\":t,route:()=>r().then((()=>import(\"./layers/RouteLayerView2D.js\"))),stream:()=>r().then((()=>import(\"./layers/StreamLayerView2D.js\"))),\"subtype-group\":()=>r().then((()=>import(\"./layers/SubtypeGroupLayerView2D.js\"))),tile:a,\"vector-tile\":()=>r().then((()=>import(\"./layers/VectorTileLayerView2D.js\"))),video:()=>r().then((()=>import(\"./layers/VideoLayerView2D.js\"))),wcs:()=>r().then((()=>import(\"./layers/ImageryTileLayerView2D.js\"))),\"web-tile\":a,wfs:t,wms:()=>r().then((()=>import(\"./layers/WMSLayerView2D.js\"))),wmts:()=>r().then((()=>import(\"./layers/WMTSLayerView2D.js\"))),\"line-of-sight\":null,\"base-elevation\":null,\"building-scene\":null,dimension:null,elevation:null,\"integrated-mesh\":null,\"point-cloud\":null,voxel:null,scene:null,unknown:null,unsupported:null};function i(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(\".\")+1):\"Unknown\",t=a.replaceAll(/([a-z])([A-Z])/g,\"$1-$2\").toLowerCase();return new e(`${t}:view-not-supported`,`${a} is not supported in 2D`)}const l={hasLayerViewModule:e=>null!=s[e.type],importLayerView:e=>{const r=s[e.type];if(null==r)throw i(e);return r(e)}};export{l as layerView2DImporter};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../geometry.js\";import{d as t}from\"../../chunks/vec2.js\";import{projectPointOnLine as e}from\"./coordsUtils.js\";import n from\"../Point.js\";function o(o,m){const{spatialReference:r}=m,i=[m.x,m.y];let s=Number.POSITIVE_INFINITY,x=0,c=0;const a=[0,0],f=\"extent\"===o.type?[[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]]]:o.rings;for(const n of f)for(let o=0;oe.clone())),t.sort(((e,t)=>t.scale-e.scale)),t.forEach(((e,t)=>e.level=t));for(const f of t)!l&&o>0&&o>=f.scale&&(c=f.level,l=!0),!n&&s>0&&s>=f.scale&&(r=e?e.level:-1,n=!0),e=f;-1===i&&(i=0===o?0:c),-1===a&&(a=0===s?t.length-1:r),i=Math.max(i,0),i=Math.min(i,t.length-1),a=Math.max(a,0),a=Math.min(a,t.length-1),i>a&&([i,a]=[a,i]),o=t[i].scale,s=t[a].scale,t.splice(0,i),t.splice(a-i+1,t.length),t.forEach(((e,t)=>{this._lodByScale[e.scale]=e,this._scales[t]=e.scale})),this._set(\"effectiveLODs\",t),this._set(\"effectiveMinZoom\",i),this._set(\"effectiveMaxZoom\",a),this._set(\"effectiveMinScale\",o),this._set(\"effectiveMaxScale\",s)}constrain(e,t){if(t&&e.scale===t.scale)return e;const o=this.effectiveMinScale,s=this.effectiveMaxScale,i=e.targetGeometry,a=t&&t.targetGeometry,c=0!==s&&e.scaleo;if(c||r){const c=r?o:s;if(t&&a){const o=(c-t.scale)/(e.scale-t.scale);i.x=a.x+(i.x-a.x)*o,i.y=a.y+(i.y-a.y)*o}e.scale=c}return this.snapToZoom&&this.effectiveLODs&&(e.scale=this._getClosestScale(e.scale)),e}fit(e){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(e,null);const t=this.scaleToZoom(e.scale),o=Math.abs(t-Math.floor(t));return e.scale=this.zoomToScale(o>.99?Math.round(t):Math.floor(t)),e}zoomToScale(e){if(!this.effectiveLODs)return 0;e-=this.effectiveMinZoom,e=Math.max(0,e);const t=this._scales;if(e<=0)return t[0];if(e>=t.length)return t[t.length-1];const o=Math.round(e-.5),s=Math.round(e);return t[s]+(s-e)*(t[o]-t[s])}scaleToZoom(e){if(!this.effectiveLODs)return-1;const t=this._scales;let o,s;if(e>=t[0])return this.effectiveMinZoom;if(e<=t[t.length-1])return this.effectiveMaxZoom;for(let i=0;ie&&sMath.abs(o-e)<=Math.abs(t-e)?o:t),this._scales[0])),this._lodByScale[e].scale}};e([s({readOnly:!0})],c.prototype,\"effectiveLODs\",void 0),e([s({readOnly:!0})],c.prototype,\"effectiveMinZoom\",void 0),e([s({readOnly:!0})],c.prototype,\"effectiveMaxZoom\",void 0),e([s({readOnly:!0})],c.prototype,\"effectiveMinScale\",void 0),e([s({readOnly:!0})],c.prototype,\"effectiveMaxScale\",void 0),e([s()],c.prototype,\"lods\",void 0),e([s()],c.prototype,\"minZoom\",void 0),e([s()],c.prototype,\"maxZoom\",void 0),e([s()],c.prototype,\"minScale\",void 0),e([s()],c.prototype,\"maxScale\",void 0),e([s()],c.prototype,\"snapToZoom\",void 0),c=a=e([i(\"esri.views.2d.constraints.ZoomConstraint\")],c);const r=c;export{r as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import t from\"../../core/Accessor.js\";import e from\"../../core/Collection.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"../../layers/support/LOD.js\";import{GeometryConstraint as n}from\"./constraints/GeometryConstraint.js\";import a from\"./constraints/RotationConstraint.js\";import m from\"./constraints/ZoomConstraint.js\";import c from\"../../geometry/Extent.js\";import l from\"../../geometry/Polygon.js\";const p={base:null,key:\"type\",typeMap:{extent:c,polygon:l}};let y=class extends t{constructor(o){super(o),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new e}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(o){o?this._set(\"geometry\",o):this._set(\"geometry\",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const o=this._get(\"_geometry\");return o&&this.geometry===o.geometry&&this.view?.constraintsInfo.spatialReference===o.spatialReference?o:new n({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new a({rotationEnabled:this.rotationEnabled})}get _zoom(){const o=this._get(\"_zoom\"),t=this.lods||this.view?.constraintsInfo.lods,e=this.minZoom,r=this.maxZoom,s=this.minScale,i=this.maxScale,n=this.snapToZoom;return o&&o.lods===t&&o.minZoom===e&&o.maxZoom===r&&o.minScale===s&&o.maxScale===i&&o.snapToZoom===n?o:new m({lods:t,minZoom:e,maxZoom:r,minScale:s,maxScale:i,snapToZoom:n})}canZoomInTo(o){const t=this.effectiveMaxScale;return 0===t||o>=t}canZoomOutTo(o){const t=this.effectiveMinScale;return 0===t||o<=t}constrain(o,t){return this._zoom.constrain(o,t),this._rotation.constrain(o,t),this._geometry.constrain(o,t),this.customConstraints.forEach((e=>e.constrain(o,t))),o}constrainByGeometry(o){return this._geometry.constrain(o),this.customConstraints.forEach((t=>t.applyPanConstraint?.(o))),o}fit(o){return this._zoom.fit(o)}zoomToScale(o){return this._zoom.zoomToScale(o)}scaleToZoom(o){return this._zoom.scaleToZoom(o)}snapScale(o){return this._zoom.snapToClosestScale(o)}snapToNextScale(o){return this._zoom.snapToNextScale(o)}snapToPreviousScale(o){return this._zoom.snapToPreviousScale(o)}};o([r({readOnly:!0})],y.prototype,\"effectiveLODs\",null),o([r({readOnly:!0})],y.prototype,\"effectiveMinScale\",null),o([r({readOnly:!0})],y.prototype,\"effectiveMaxScale\",null),o([r({readOnly:!0})],y.prototype,\"effectiveMinZoom\",null),o([r({readOnly:!0})],y.prototype,\"effectiveMaxZoom\",null),o([r({types:p,value:null})],y.prototype,\"geometry\",null),o([r({type:[i]})],y.prototype,\"lods\",void 0),o([r()],y.prototype,\"minScale\",void 0),o([r()],y.prototype,\"maxScale\",void 0),o([r()],y.prototype,\"minZoom\",void 0),o([r()],y.prototype,\"maxZoom\",void 0),o([r()],y.prototype,\"rotationEnabled\",void 0),o([r()],y.prototype,\"snapToZoom\",void 0),o([r({type:e})],y.prototype,\"customConstraints\",void 0),o([r()],y.prototype,\"view\",void 0),o([r({readOnly:!0})],y.prototype,\"version\",null),o([r({type:n,readOnly:!0})],y.prototype,\"_geometry\",null),o([r({type:a})],y.prototype,\"_rotation\",null),o([r({readOnly:!0,type:m})],y.prototype,\"_zoom\",null),y=o([s(\"esri.views.2d.MapViewConstraints\")],y);const f=y;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../core/ObjectPool.js\";class e{static getId(t,e,l,s){return\"object\"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${s}`}constructor(t,e,l,s){this.set(t,e,l,s)}get key(){return this}get id(){return this.toString()}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,s){this.set(t,e,l,s)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,s){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if(\"object\"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if(\"string\"==typeof t){const[e,l,s,o]=t.split(\"/\");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(s),this.world=parseFloat(o)}else this.level=+t,this.row=+e,this.col=+l,this.world=+s||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const t=this.level+1,l=this.row<<1,s=this.col<<1,o=this.world;return[new e(t,l,s,o),new e(t,l,s+1,o),new e(t,l+1,s,o),new e(t,l+1,s+1,o)]}compareRowMajor(t){return this.rowt.row?1:this.colt.col?1:0}}e.pool=new t(e,null,null,25,50);export{e as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getInfo as t}from\"../../../geometry/support/spatialReferenceUtils.js\";import r from\"./TileKey.js\";function o(t,r){return[t,r]}function i(t,r,o){return t[0]=r,t[1]=o,t}function e(t,r,o,i,e){return t[0]=r,t[1]=o,t[2]=i,t[3]=e,t}const s=new r(\"0/0/0/0\");class n{static create(r,e,s=null){const l=t(r.spatialReference),h=e.origin||o(r.origin.x,r.origin.y),a=o(r.size[0]*e.resolution,r.size[1]*e.resolution),u=o(-1/0,-1/0),m=o(1/0,1/0),g=o(1/0,1/0);null!=s&&(i(u,Math.max(0,Math.floor((s.xmin-h[0])/a[0])),Math.max(0,Math.floor((h[1]-s.ymax)/a[1]))),i(m,Math.max(0,Math.floor((s.xmax-h[0])/a[0])),Math.max(0,Math.floor((h[1]-s.ymin)/a[1]))),i(g,m[0]-u[0]+1,m[1]-u[1]+1));const{cols:w,rows:c}=e;let d,f,F,z;return!s&&w&&c&&(i(u,w[0],c[0]),i(m,w[1],c[1]),i(g,w[1]-w[0]+1,c[1]-c[0]+1)),r.isWrappable?(d=o(Math.ceil(Math.round((l.valid[1]-l.valid[0])/e.resolution)/r.size[0]),g[1]),f=o(Math.floor((l.origin[0]-h[0])/a[0]),u[1]),F=o(d[0]+f[0]-1,m[1]),z=!0):(f=u,F=m,d=g,z=!1),new n(e.level,e.resolution,e.scale,h,u,m,g,a,f,F,d,z)}constructor(t,r,o,i,e,s,n,l,h,a,u,m){this.level=t,this.resolution=r,this.scale=o,this.origin=i,this.first=e,this.last=s,this.size=n,this.norm=l,this.worldStart=h,this.worldEnd=a,this.worldSize=u,this.wrap=m}normalizeCol(t){if(!this.wrap)return t;const r=this.worldSize[0];return t<0?r-1-Math.abs((t+1)%r):t%r}denormalizeCol(t,r){return this.wrap?this.worldSize[0]*r+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){return this.origin[0]+t*this.norm[0]}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,r,o=!1){s.set(r);const i=o?s.col:this.denormalizeCol(s.col,s.world),n=s.row;return e(t,this.getXForColumn(i),this.getYForRow(n+1),this.getXForColumn(i+1),this.getYForRow(n)),t}getTileCoords(t,r,o=!1){s.set(r);const e=o?s.col:this.denormalizeCol(s.col,s.world);return Array.isArray(t)?i(t,this.getXForColumn(e),this.getYForRow(s.row)):(t.x=this.getXForColumn(e),t.y=this.getYForRow(s.row)),t}}export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport o from\"../../../core/ObjectPool.js\";class l{constructor(){this.spans=[]}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}l.pool=new o(l);export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass o{constructor(o,s,t){this.row=o,this.colFrom=s,this.colTo=t}}export{o as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getInfo as e}from\"../../../geometry/support/spatialReferenceUtils.js\";import t from\"./LODInfo.js\";import o from\"./TileCoverage.js\";import l from\"./TileKey.js\";import s from\"./TileSpan.js\";const i=new l(\"0/0/0/0\");class n{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[o,l]=e,[s,i]=t,r=s-o,a=i-l,h=0!==a?r/a:0,c=(Math.ceil(l)-l)*h,f=(Math.floor(l)-l)*h;return new n(o,Math.floor(l),Math.ceil(i),h,r<0?c:f,r<0?f:c,r<0?s:o,r<0?o:s)}constructor(e,t,o,l,s,i,n,r){this.x=e,this.ymin=t,this.ymax=o,this.invM=l,this.leftAdjust=s,this.rightAdjust=i,this.leftBound=n,this.rightBound=r}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const r=[[0,0],[0,0],[0,0],[0,0]],a=1e-6;class h{constructor(e,o=null,l=e.lods[0].level,s=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=o,this.scales=[],this._infoByScale={},this._infoByLevel={};const i=e.lods.filter((e=>e.level>=l&&e.level<=s));this.minScale=i[0].scale,this.maxScale=i[i.length-1].scale;const n=this._lodInfos=i.map((l=>t.create(e,l,o)));i.forEach(((e,t)=>{this._infoByLevel[e.level]=n[t],this._infoByScale[e.scale]=n[t],this.scales[t]=e.scale}),this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel[\"number\"==typeof e?e:e.level]}getTileBounds(e,t,o=!1){i.set(t);const l=this._infoByLevel[i.level];return l?l.getTileBounds(e,i,o):e}getTileCoords(e,t,o=!1){i.set(t);const l=this._infoByLevel[i.level];return l?l.getTileCoords(e,i,o):e}getTileCoverage(e,t=192,l=!0,i=\"closest\"){if(!l&&(e.scale>this.minScale||e.scale100)return null;let p=[];for(f=g;f=0;e--){const t=p[e];u=Math.min(u,t.getLeftCol()),m=Math.max(m,t.getRightCol())}if(u=Math.floor(u),m=Math.floor(m),f>=a.first[1]&&f<=a.last[1])if(c)if(a.size[0]a.last[0]||m=0;e--){const t=p[e];t.ymax>=f?t.incrRow():p.splice(e,1)}}return h}getTileParentId(e){i.set(e);const t=this._infoByLevel[i.level],o=this._lodInfos.indexOf(t)-1;return o<0?null:(this._getTileIdAtLOD(i,this._lodInfos[o],i),i.id)}getTileResolution(e){const t=this._infoByLevel[\"object\"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){i.set(t);const o=this._infoByLevel[i.level],l=e.lodInfo;if(l.resolution>o.resolution){this._getTileIdAtLOD(i,l,i);const t=l.denormalizeCol(i.col,i.world);for(const o of e.spans)if(o.row===i.row&&o.colFrom<=t&&o.colTo>=t)return!0}if(l.resolution(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e)),[1/0,-1/0,1/0,-1/0]),a=o.denormalizeCol(i.col,i.world),h=l.getColumnForX(o.getXForColumn(a)),c=l.getRowForY(o.getYForRow(i.row)),f=l.getColumnForX(o.getXForColumn(a+1))-1,u=l.getRowForY(o.getYForRow(i.row+1))-1;return!(h>r||fs||ue.row===i.row&&e.colFrom<=s&&e.colTo>=s))}normalizeBounds(t,o,l){if(t[0]=o[0],t[1]=o[1],t[2]=o[2],t[3]=o[3],this._wrap){const o=e(this.tileInfo.spatialReference),s=-l*(o.valid[1]-o.valid[0]);t[0]+=s,t[2]+=s}return t}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let o=1;ot[o]+a)return this._infoByScale[t[o-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce(((t,o)=>Math.abs(o-e)=0;o--)if(e0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach(((e,r)=>t.call(s,e,r,this)),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{removeMaybe as e}from\"../../core/maybe.js\";import{onAbort as s,onAbortOrThrow as t,createResolver as r,isPromiseLike as i,createAbortError as h}from\"../../core/promiseUtils.js\";import o from\"../../core/Queue.js\";import c from\"../../core/ReactiveMap.js\";import{schedule as n}from\"../../core/scheduling.js\";import{signal as u}from\"../../core/signal.js\";class l{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class _{constructor(e){this._schedule=null,this._task=null,this._deferreds=new c,this._controllers=new c,this._processingItems=new c,this._pausedSignal=u(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new o(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=e(this._schedule),this._task=e(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((s=>e.push(s))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((s,t)=>e(t)))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,i){const o=this.get(e);if(o)return o;const c=new AbortController;let n=null;i&&(n=s(i,(()=>c.abort())));const u=()=>{const s=this._processingItems.get(e);s&&s.controller.abort(),l(),a.reject(h())},l=()=>{_.remove(),null!=n&&n.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},_=t(c.signal,u),a=r();return this._deferreds.set(e,a),this._controllers.set(e,c),a.promise.then(l,l),this._queue.push(e),this._scheduleNext(),a.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach((s=>e.push(s))),this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(r,e)),(e=>this._processError(r,e)))):this._processResult(r,s)}get test(){return{update:e=>this.runTask(e)}}}export{_ as QueueProcessor};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import t from\"../../../core/Accessor.js\";import{destroyMaybe as s}from\"../../../core/maybe.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as o}from\"../../../core/accessorSupport/decorators/subclass.js\";import{d as i}from\"../../../chunks/vec2.js\";import{QueueProcessor as n}from\"../../support/QueueProcessor.js\";function c(e,t){return e.length=0,t.forEach((t=>e.push(t))),e}const u=new Set,a=[],h=new Map,l=[0,0];let p=class extends t{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy=\"scale-first\",this.tileInfoView=null}initialize(){const{concurrency:e,process:t,strategy:s}=this;this._queue=new n({concurrency:e,process:(e,s)=>{const r=this._keyToItem.get(e);return t(r,{signal:s})},peeker:\"scale-first\"===s?e=>this._peekByScaleFirst(e):e=>this._peekByCenterFirst(e)})}destroy(){this.clear(),this._queue=s(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(e){const t=\"string\"==typeof e?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear()}has(e){return\"string\"==typeof e?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=\"string\"==typeof e?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const s=this._queue.push(t),r=()=>{this._keyToItem.delete(t)};return this._keyToItem.set(t,e),s.then(r,r),s}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;e.forEach((e=>{const t=this._keyToItem.get(e),o=this.tileInfoView.getTileScale(t.key);h.has(o)||(h.set(o,[]),s=Math.max(o,s),r=Math.min(o,r)),h.get(o).push(t.key),u.add(o)}));let o=this.state.scale;h.has(o)||(c(a,u),a.sort(((e,t)=>e-t)),o=a.reduce(((e,t)=>Math.abs(t-o){const s=n.denormalizeCol(e.col,e.world),r=n.denormalizeCol(t.col,t.world);return Math.sqrt((l-s)*(l-s)+(p-e.row)*(p-e.row))-Math.sqrt((l-r)*(l-r)+(p-t.row)*(p-t.row))})),u.clear(),h.clear(),i[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,s=this.state.center;let r,o=Number.POSITIVE_INFINITY;return e.forEach((e=>{const n=this._keyToItem.get(e);t.getTileCoords(l,n.key);const c=i(l,s);cthis.maxSize&&s>=0;)s!==e&&(r=this._pruneAroundCenterTile(r,t,i,s)),s--;r>this.maxSize&&(r=this._pruneAroundCenterTile(r,t,i,e))}_pruneAroundCenterTile(t,i,r,s){const l=this._tileKeysPerLevel[s];if(!l||0===l.length)return t;const{size:n,origin:h}=this._tileInfoView.tileInfo,o=r*n[0],_=r*n[1],d=[0,0],u=[0,0];for(l.sort(((t,r)=>(d[0]=h.x+o*(t.col+.5),d[1]=h.y-_*(t.row+.5),u[0]=h.x+o*(r.col+.5),u[1]=h.y-_*(r.row+.5),e(d,i)-e(u,i))));l.length>0;){const e=l.pop();if(this._removeTile(e.id),--t===this.maxSize)break}return t}_removeTile(e){const t=this._tilePerId.get(e);this._removedFunc&&t&&this._removedFunc(t),i(this._tilePerId,e)}}function i(e,t){e.delete(t)}export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{create as e,contains as i}from\"../../../geometry/support/aaBoundingRect.js\";import t from\"./TileCache.js\";import s from\"./TileCoverage.js\";import l from\"./TileKey.js\";const o=new l(0,0,0,0),h=new Map,a=[],c=[];class r{constructor(e){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy=\"keep\",this.coveragePolicy=\"closest\",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,null!=e.resampling&&(this.resampling=e.resampling),e.cachePolicy&&(this.cachePolicy=e.cachePolicy),e.coveragePolicy&&(this.coveragePolicy=e.coveragePolicy),null!=e.buffer&&(this.buffer=e.buffer),e.cacheSize&&(this._tileCache=new t(e.cacheSize,this.tileInfoView,(e=>{this.releaseTile(e)})))}destroy(){this.tileIndex.clear()}update(e){const{resampling:i,tileIndex:t}=this,{scale:l,center:r,resolution:n}=e.state,{minScale:f,maxScale:d}=this.tileInfoView,u=!e.stationary&&l>this._previousScale;if(this._previousScale=l,!i&&(l>f||le.visible=!0));let v=0,m=0;if(y.length>0)for(const{row:s,colFrom:a,colTo:c}of y)for(let e=a;e<=c;e++){v++;const i=o.set(I,s,g.normalizeCol(e),g.getWorldForColumn(e)).id;let l=t.get(i);if(l)l.isReady?(h.set(i,l),m++):u||this._addParentTile(i,h);else{if(this._tileCache?.has(i)){if(l=this._tileCache.pop(i),this.tileIndex.set(i,l),l.isReady){h.set(i,l),m++;continue}}else l=this.acquireTile(o),this.tileIndex.set(i,l);u||this._addParentTile(i,h)}}const T=m===v;for(const[s,_]of t){if(h.has(s))continue;o.set(s);const e=this.tileInfoView.intersects(p,o),i=\"purge\"===this.cachePolicy?o.level!==I:o.level>I;!e||!u&&T?!i&&e||a.push(_):_.isReady?i&&\"purge\"===this.cachePolicy&&this._hasReadyAncestor(o,I)?a.push(_):c.push(_):i&&a.push(_)}for(const s of c)s.isReady&&h.set(s.key.id,s);for(const s of a)this._tileCache?this._tileCache.add(s):this.releaseTile(s),t.delete(s.key.id);for(const s of h.values())this.tiles.push(s);for(const s of t.values())h.has(s.key.id)||(s.visible=!1);this._tileCache?.prune(I,r,n),s.pool.release(p),c.length=0,a.length=0,h.clear()}clear(){const{tileIndex:e}=this;for(const i of e.values())this.releaseTile(i);e.clear()}refresh(e){for(const i of this.tileIndex.values())this.tiles.includes(i)?e(i):a.push(i);for(const i of a)this.releaseTile(i),this.tileIndex.delete(i.key.id);this._tileCache?.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=e)}_addParentTile(e,i){let t=e,s=null;for(;t=this.tileInfoView.getTileParentId(t),t;)if(this.tileIndex.has(t)){if(s=this.tileIndex.get(t),s?.isReady){i.has(s.key.id)||i.set(s.key.id,s);break}}else if(this._tileCache?.has(t)&&(s=this._tileCache.pop(t),this.tileIndex.set(t,s),s?.isReady)){i.has(s.key.id)||i.set(s.key.id,s);break}}_hasReadyAncestor(t,s){const l=e();this.tileInfoView.getTileBounds(l,t,!0);for(const o of this.tileIndex.values())if(o.isReady&&o.key.level>=s&&o.key.level=2}function r(n){return Array.isArray(n)&&n.length>=2}function t(t){return n(t)||r(t)}export{t as isVec2,n as isVec2f32,r as isVec2f64};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import s from\"../../Viewpoint.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import{t as r}from\"../../chunks/common.js\";import{a as n,r as a,t as p,i as h}from\"../../chunks/mat2d.js\";import{c}from\"../../chunks/mat2df32.js\";import{c as m}from\"../../chunks/mat2df64.js\";import{s as l,g as f,h as u,r as v,m as w}from\"../../chunks/mat3.js\";import{c as d}from\"../../chunks/mat3f32.js\";import{j,t as y}from\"../../chunks/vec2.js\";import{f as R}from\"../../chunks/vec2f32.js\";import{a as x}from\"../../chunks/vec2f64.js\";import{isVec2 as _}from\"../../core/libs/gl-matrix-2/types/vec2.js\";import{getClosestDenormalizedXToReference as z}from\"../../geometry/support/normalizeUtils.js\";import{copy as g,getMatrix as S,getResolution as k,getExtent as M,getTransform as N,getTransformNoRotation as T,getWorldScreenWidth as D}from\"./viewpointUtils.js\";import V from\"../../geometry/Extent.js\";import b from\"../../geometry/Point.js\";var U;const G=[0,0];let O=U=class extends e{constructor(t){super(t),this._viewpoint2D={center:x(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new V,this.id=0,this.inverseTransform=m(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=m(),this.transformNoRotation=m(),this.displayMat3=d(),this.displayViewMat3=d(),this.viewMat3=d(),this.viewMat2d=c(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set(\"pixelRatio\",t),this._update()}set size(t){this._set(\"size\",t),this._update()}set viewpoint(t){if(t){const s=this._viewpoint2D,e=t.targetGeometry;s.center[0]=e.x,s.center[1]=e.y,s.rotation=t.rotation,s.scale=t.scale,s.spatialReference=e.spatialReference}this._update()}copy(t){const s=this.size,e=this.viewpoint;return e&&s?(this.viewpoint=g(e,t.viewpoint),this._set(\"size\",j(s,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set(\"size\",[t.size[0],t.size[1]])),this._set(\"pixelRatio\",t.pixelRatio),this}clone(){return new U({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,s,e){return _(s)?y(t,s,this.inverseTransform):(G[0]=s,G[1]=e,y(t,G,this.inverseTransform))}toScreen(t,s,e){return _(s)?y(t,s,this.transform):(G[0]=s,G[1]=e,y(t,G,this.transform))}toScreenNoRotation(t,s,e){return _(s)?y(t,s,this.transformNoRotation):(G[0]=s,G[1]=e,y(t,G,this.transformNoRotation))}toScreenClosest(t,s,e){_(s)?(G[0]=s[0],G[1]=s[1]):(G[0]=s,G[1]=e);const[i]=G,{center:o,extent:r,spatialReference:n,transform:a}=this;return(ir.xmax)&&(G[0]=z(i,o[0],n)),y(t,G,a)}getScreenTransform(t,s){const{center:e}=this._viewpoint2D,i=this._get(\"pixelRatio\")||1,o=this._get(\"size\");return S(t,e,o,s,0,i),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:o}=this._viewpoint2D,c=this._get(\"pixelRatio\")||1,m=this._get(\"size\"),d=new s({targetGeometry:new b(t[0],t[1],e),scale:i,rotation:o});if(this._set(\"viewpoint\",d),!m||!e||!i)return;this.resolution=k(d),this.rotation=o,this.scale=i,this.spatialReference=e,j(this.center,t);const y=0!==m[0]?2/m[0]:0,x=0!==m[1]?-2/m[1]:0;l(this.displayMat3,y,0,0,0,x,0,-1,1,1);const _=f(this.viewMat3),z=R(m[0]/2,m[1]/2),g=R(-m[0]/2,-m[1]/2),S=r(o);u(_,_,z),v(_,_,S),u(_,_,g),w(this.displayViewMat3,this.displayMat3,_);const V=n(this.viewMat2d,z);return a(V,V,S),p(V,V,g),M(this.extent,d,m),N(this.transform,d,m,c),h(this.inverseTransform,this.transform),T(this.transformNoRotation,d,m,c),this.worldScreenWidth=D(this.spatialReference,this.resolution),this._set(\"id\",this.id+1),this}};t([i({readOnly:!0})],O.prototype,\"id\",void 0),t([i({value:1,json:{write:!0}})],O.prototype,\"pixelRatio\",null),t([i({json:{write:!0}})],O.prototype,\"size\",null),t([i()],O.prototype,\"spatialReference\",void 0),t([i({type:s,json:{write:!0}})],O.prototype,\"viewpoint\",null),O=U=t([o(\"esri.views.2d.ViewState\")],O);const W=O;export{W as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import e from\"../../core/Accessor.js\";import{watch as i,sync as o}from\"../../core/reactiveUtils.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import{s as p,c as a,j as n}from\"../../chunks/vec2.js\";import{a as d}from\"../../chunks/vec2f64.js\";import{addPadding as c}from\"./viewpointUtils.js\";import h from\"./ViewState.js\";var l,m;let w=l=class extends e{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new l({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};t([s()],w.prototype,\"left\",void 0),t([s()],w.prototype,\"top\",void 0),t([s()],w.prototype,\"right\",void 0),t([s()],w.prototype,\"bottom\",void 0),w=l=t([r(\"esri.views.2d.PaddedViewState.Padding\")],w);let u=m=class extends h{constructor(...t){super(...t),this.paddedViewState=new h,this._updateContent=(()=>{const t=d();return()=>{const e=this._get(\"size\"),i=this._get(\"padding\");if(!e||!i)return;const o=this.paddedViewState;p(t,i.left+i.right,i.top+i.bottom),a(t,e,t),n(o.size,t);const s=o.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(i((()=>[this.size,this.padding]),(()=>this._updateContent()),o)),this.padding=new w,this.size=[0,0]}set padding(t){this._set(\"padding\",t||new w)}set viewpoint(t){if(t){const e=t.clone();this.paddedViewState.viewpoint=t,c(e,t,this._get(\"size\"),this._get(\"padding\"));const i=this._viewpoint2D,o=e.targetGeometry;i.center[0]=o.x,i.center[1]=o.y,i.rotation=e.rotation,i.scale=e.scale,i.spatialReference=o.spatialReference,this._update()}}clone(){return new m({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};t([s()],u.prototype,\"paddedViewState\",void 0),t([s({type:w})],u.prototype,\"padding\",null),t([s()],u.prototype,\"viewpoint\",null),u=m=t([r(\"esri.views.2d.PaddedViewState\")],u);const f=u;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import e from\"../../Viewpoint.js\";import i from\"../../core/Accessor.js\";import s from\"../../core/Error.js\";import has from\"../../core/has.js\";import r from\"../../core/Logger.js\";import{watch as o,sync as n}from\"../../core/reactiveUtils.js\";import{createScreenPoint as a}from\"../../core/screenUtils.js\";import c from\"../../core/Warning.js\";import{property as p}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import{subclass as h}from\"../../core/accessorSupport/decorators/subclass.js\";import{i as l}from\"../../chunks/pe.js\";import d from\"../../geometry/Point.js\";import{project as v}from\"../../geometry/projection.js\";import{equals as m}from\"../../geometry/support/spatialReferenceUtils.js\";import u from\"./PaddedViewState.js\";import{centerAt as g,setExtent as w,rotateTo as f,scaleTo as y,copy as _,extentToScale as j,angleBetween as x,resize as S}from\"./viewpointUtils.js\";import R from\"../../geometry/Extent.js\";let z=class extends i{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign=\"center\",this.addHandles([o((()=>this.constraints?.version),(t=>{this.constraints&&t&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))}),n)])}get center(){if(!this.ready)return this._get(\"center\");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty(\"id\"),new d({x:t[0],y:t[1],spatialReference:e})}set center(t){if(null==t)return;if(!this.ready)return void this._set(\"center\",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(o){return void r.getLogger(this).error(new s(\"mapview:invalid-center\",\"could not project the value in the view's spatial reference\",{input:t,error:o}))}const i=this.viewpoint;g(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty(\"id\"),this.state.paddedViewState.extent.clone()):this._get(\"extent\")}set extent(t){if(null==t)return;if(!t.width||!t.height)return void r.getLogger(this).error(new s(\"mapview:invalid-extent\",\"invalid extent size\"));if(!this.ready)return this._set(\"extent\",t),this._set(\"center\",void 0),this._set(\"viewpoint\",void 0),this._set(\"scale\",void 0),void this._set(\"zoom\",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(o){return void r.getLogger(this).error(new s(\"mapview:invalid-extent\",\"could not project the value in the view's spatial reference\",{error:o}))}const i=this.viewpoint;w(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get(\"padding\")}set padding(t){this.ready?(this.state.padding=t,this._set(\"padding\",this.state.padding)):this._set(\"padding\",t)}get resolution(){return this.ready?(this.state.commitProperty(\"id\"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty(\"id\"),this.state.rotation):this._get(\"rotation\")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set(\"rotation\",t);const e=this.viewpoint;f(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty(\"id\"),this.state.scale):this._get(\"scale\")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set(\"scale\",t),this._set(\"zoom\",void 0);const e=this._get(\"extent\");return void(e&&(this._set(\"extent\",void 0),this._set(\"center\",e.center)))}const e=this.viewpoint;y(e,e,t),this.viewpoint=e}get viewpoint(){if(!this.ready)return this._get(\"viewpoint\");return this.state.paddedViewState.viewpoint.clone()}set viewpoint(t){if(null==t)return;if(!this.ready)return this._set(\"viewpoint\",t),this._set(\"extent\",void 0),this._set(\"center\",void 0),this._set(\"zoom\",void 0),void this._set(\"scale\",void 0);let i,o;try{i=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?o=new s(\"mapview:invalid-viewpoint\",`invalid scale value of ${t.scale}`):null==t.targetGeometry&&(o=new s(\"mapview:invalid-viewpoint\",\"geometry not defined\"))}catch(a){o=new s(\"mapview:invalid-viewpoint\",\"could not project the value in the view's spatial reference\",{error:a})}if(o)return void r.getLogger(this).error(o);this._scaleBeforeChangingSpatialReference=null;const n=new e({targetGeometry:new d,scale:0,rotation:0});_(n,i),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set(\"viewpoint\",n)}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get(\"zoom\")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set(\"zoom\",t),this._set(\"scale\",void 0);const e=this._get(\"extent\");return void(e&&(this._set(\"extent\",void 0),this._set(\"center\",e.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set(\"zoom\",-1);const i=this.viewpoint;y(i,i,e),this.viewpoint=i,this._set(\"zoom\",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,s=this._get(\"center\"),r=this._get(\"extent\"),o=this._get(\"scale\"),n=this._get(\"rotation\"),a=this._get(\"viewpoint\"),c=this._get(\"zoom\"),p=null!=c&&null!=i&&i.zoomToScale(c)||void 0;let h,l,d;const v=a?.rotation,m=a?.targetGeometry;\"extent\"===m?.type?h=m:\"point\"===m?.type&&(l=m,d=a?.scale);const u=r??h;return{center:s??l??u?.center,rotation:n??v,scale:(o??p??d??(u&&j(u,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,s){const o=t.targetGeometry;try{this._project(t,i)}catch(n){r.getLogger(this).warn(new c(\"mapview:startup-projection-error\",\"projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.\",{center:o.toJSON(),spatialReference:i,error:n})),t.targetGeometry=s||new d({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set(\"state\",new u({padding:this.padding,size:e,viewpoint:t})),this._set(\"ready\",!0)}teardown(){this._set(\"ready\",!1);const{center:[t,e],spatialReference:i,rotation:s,scale:r}=this.state.paddedViewState,o=new d({x:t,y:e,spatialReference:i});this._set(\"viewpoint\",null),this._set(\"extent\",null),this._set(\"center\",o),this._set(\"zoom\",-1),this._set(\"rotation\",s),this._set(\"scale\",r),this._set(\"state\",null)}changeSpatialReference(t){const i=this.state.paddedViewState.clone();if(null==this._scaleBeforeChangingSpatialReference)this._scaleBeforeChangingSpatialReference=i.scale;else{const t=i.viewpoint.clone();t.scale=this._scaleBeforeChangingSpatialReference,i.viewpoint=t}const s=i.clone(),[o,n]=i.center;let a=null;try{a=this._project(new d({x:o,y:n,spatialReference:i.spatialReference}),t)}catch(h){l()||r.getLogger(this).warn(new c(\"mapview:spatial-reference-change\",\"could not project the view's center to the new spatial reference\",{center:a?.toJSON(),spatialReference:t,error:h}))}a||(a=new d({x:0,y:0,spatialReference:t}));const p=g(new e({targetGeometry:new d,scale:0,rotation:0}),i.viewpoint,a);s.viewpoint=p;try{const e=20,r=[i.size[0]/2,i.size[1]/2],o=[r[0]+e,r[1]],n=i.toMap([0,0],o),{x:a,y:c}=this._project(new d({x:n[0],y:n[1],spatialReference:i.spatialReference}),t);n[0]=a,n[1]=c,s.toScreen(n,n);const h=x(r,n,o),l=Math.hypot(n[0]-r[0],n[1]-r[1])/e;!Number.isFinite(l)||Math.abs(l)>4?(p.rotation=0,p.targetGeometry=new d({x:0,y:0,spatialReference:t})):(p.scale*=l,p.scale>has(\"mapview-srswitch-adjust-rotation-scale-threshold\")?p.rotation=0:p.rotation+=Number.isFinite(h)?h:0)}catch{}this._get(\"constraints\")?.constrain(p,void 0),this._get(\"state\").viewpoint=p}resize(t,e){if(!this.ready)return;const i=this.state;let s=this.state.paddedViewState.viewpoint;const r=this.state.paddedViewState.size.concat();i.size=[t,e],S(s,s,r,this.state.paddedViewState.size,this.resizeAlign),s=this.constraints?.constrain(s,void 0)??s,this.state.viewpoint=s}toMap(t){if(!this.ready)return null;const e=[0,0],[i,s]=this.state.toMap(e,[t.x,t.y]),r=this.state.spatialReference;return new d({x:i,y:s,spatialReference:r})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),s=[i.x,i.y];return!1===e?.pickClosestTarget?this.state.toScreen(s,s):this.state.toScreenClosest(s,s),a(s[0],s[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem)return t;if(m(e,i.spatialReference))return t;const r=v(i,e);if(!r)throw new s(\"mapview:projection-not-possible\",\"projecting input geometry to target spatial reference returned a null value\",{geometry:i,spatialReference:e});return V(t)?(t.targetGeometry=r,t):r}};function V(t){return\"esri.Viewpoint\"===t?.declaredClass}t([p({type:d})],z.prototype,\"center\",null),t([p()],z.prototype,\"constraints\",void 0),t([p({type:R})],z.prototype,\"extent\",null),t([p({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],z.prototype,\"padding\",null),t([p()],z.prototype,\"ready\",void 0),t([p()],z.prototype,\"resizeAlign\",void 0),t([p({readOnly:!0})],z.prototype,\"resolution\",null),t([p({type:Number})],z.prototype,\"rotation\",null),t([p({type:Number})],z.prototype,\"scale\",null),t([p({readOnly:!0})],z.prototype,\"state\",void 0),t([p({type:e})],z.prototype,\"viewpoint\",null),t([p()],z.prototype,\"zoom\",null),z=t([h(\"esri.views.2d.ViewStateManager\")],z);export{z as ViewStateManager};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction t(t,r){switch(r){case\"primary\":return\"touch\"===t.pointerType||0===t.button;case\"secondary\":return\"touch\"!==t.pointerType&&2===t.button;case\"tertiary\":return\"touch\"!==t.pointerType&&1===t.button}}function r(t,r){if(\"touch\"===t.pointerType)return!1;switch(r){case\"primary\":return 0===t.button;case\"secondary\":return 2===t.button;case\"tertiary\":return 1===t.button}}export{r as eventMatchesMousePointerAction,t as eventMatchesPointerAction};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{InputHandler as t}from\"../../../input/InputHandler.js\";import{eventMatchesPointerAction as i}from\"../../../input/handlers/support.js\";class a extends t{constructor(t,i){super(!0),this._view=t,this.registerIncoming(\"double-click\",i,(t=>this._handleDoubleClick(t,i)))}_handleDoubleClick(t,a){i(t.data,\"primary\")&&(t.stopPropagation(),a?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}}export{a as DoubleClickZoom};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../../../core/has.js\";import{InputHandler as t}from\"../../../input/InputHandler.js\";class e extends t{constructor(t,e,a){super(!0),this.view=t,this.pointerType=e,this.registerIncoming(\"double-tap-drag\",a,(t=>this._handleDoubleTapDrag(t)))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:a}=e;if(a!==this.pointerType)return;t.stopPropagation();const{action:s,delta:i}=e,{view:r}=this,{mapViewNavigation:n}=r;switch(s){case\"begin\":{const{scale:t}=r;this._startScale=t,this._currentScale=t,this._previousDelta=i,n.begin();break}case\"update\":{if(this._previousDelta.y===i.y)return;this._previousDelta=i;const t=1.015**i.y,e=this._startScale*t,a=e/this._currentScale;n.setViewpointImmediate(a),this._currentScale=e;break}case\"end\":{const{constraints:t}=r,{effectiveLODs:e,snapToZoom:a}=t;if(!a||!e)return void n.end();const s=t.snapScale(this._currentScale),o=(i.y>0?Math.max(s,t.snapToPreviousScale(this._startScale)):Math.min(s,t.snapToNextScale(this._startScale)))/this._currentScale;n.zoom(o);break}}}}export{e as DoubleTapDragZoom};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass t{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const s=t.data,i=s.pointers.size;switch(s.action){case\"start\":this._currentCount=i,this._emitStart(t);break;case\"added\":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case\"update\":this._emitUpdate(t);break;case\"removed\":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case\"end\":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}}export{t as DragEventSeparator};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{DragEventSeparator as t}from\"../../../input/DragEventSeparator.js\";import{InputHandler as i}from\"../../../input/InputHandler.js\";import{eventMatchesPointerAction as a}from\"../../../input/handlers/support.js\";class n extends i{constructor(t,i,a){super(!0),this.view=t,this.pointerAction=i,this.registerIncoming(\"drag\",a,(t=>this._handleDrag(t))),this.registerIncoming(\"pointer-down\",(()=>this.stopMomentumNavigation()))}onInstall(i){super.onInstall(i),this._dragEventSeparator=new t({start:(t,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(t,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(t,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(t,i)=>1===t&&a(i.data,this.pointerAction)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}}export{n as DragPan};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{DragEventSeparator as t}from\"../../../input/DragEventSeparator.js\";import{InputHandler as a}from\"../../../input/InputHandler.js\";import{eventMatchesPointerAction as i}from\"../../../input/handlers/support.js\";class o extends a{constructor(a,o,r){super(!0),this._view=a,this.pointerAction=o;const e=this._view.mapViewNavigation;this._dragEventSeparator=new t({start:(t,a)=>{e.rotate.begin(this._view,a.data),a.stopPropagation()},update:(t,a)=>{e.rotate.update(this._view,a.data),a.stopPropagation()},end:(t,a)=>{e.rotate.end(),a.stopPropagation()},condition:(t,a)=>1===t&&i(a.data,this.pointerAction)}),this.registerIncoming(\"drag\",r,(t=>this._dragEventSeparator.handle(t)))}}export{o as DragRotate};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{i as t}from\"../../chunks/vec3.js\";function n(t){let n=t*t;return t<0&&(n*=-1),n}function a(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function i(a,i,o){const s=o,e=a.state,r=a.device,l=\"forward-down\"===i.tiltDirection?1:-1,c=1;return\"standard\"===r.deviceType?(s.translation[0]=n(e.axes[0]),s.translation[1]=n(e.axes[1]),s.translation[2]=n(e.buttons[7])-n(e.buttons[6]),s.heading=n(e.axes[2]),s.tilt=n(e.axes[3])):\"spacemouse\"===r.deviceType&&(s.translation[0]=1.2*n(e.axes[0]),s.translation[1]=1.2*n(e.axes[1]),s.translation[2]=2*-n(e.axes[2]),s.heading=1.2*n(e.axes[5]),s.tilt=1.2*n(e.axes[3])),s.tilt*=l,t(s.translation,s.translation,c),s}function o(t,n){const a=n;return a.translation[0]=t[1]-t[0],a.translation[1]=t[3]-t[2],a.translation[2]=t[4]-t[5],a.heading=t[7]-t[6],a.tilt=t[8]-t[9],a.zoom=t[10]-t[11],a}function s(t){return 0===t.translation[0]&&0===t.translation[1]&&0===t.translation[2]&&0===t.heading&&0===t.tilt&&0===t.zoom}export{i as extractTransformation,o as extractTransformationKeyboard,s as isZeroTransformation,a as resetTransformation};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../../core/Handles.js\";import{watch as i,initial as e}from\"../../../../core/reactiveUtils.js\";import{addFrameTask as a}from\"../../../../core/scheduling.js\";import{translateBy as s,scaleAndRotateBy as n}from\"../../viewpointUtils.js\";import{InputHandler as r}from\"../../../input/InputHandler.js\";import{resetTransformation as o,extractTransformation as h,isZeroTransformation as l}from\"../../../navigation/gamepadAndKeyboardUtils.js\";class d extends r{constructor(i){super(!0),this._view=i,this._frameTask=null,this._watchHandles=new t,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming(\"gamepad\",(t=>this._handleGamePadEvent(t))),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([i((()=>this._view.navigation.gamepad?.enabled),(t=>{t?(this._handle.resume(),this._frameTask||(this._frameTask=a({update:t=>this._frameUpdate(t.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))}),e)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const i=this._view.navigation.gamepad.device;i&&t.data.device!==i||this._currentDevice&&this._currentDevice!==t.data.device||(\"end\"===t.data.action?(this._currentDevice=null,o(this._transformation)):(this._currentDevice=t.data.device,h(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const i=this._transformation;if(l(i))return;const e=this._view.viewpoint.clone(),a=this._view.navigation.gamepad.velocityFactor,r=_*a*t;s(e,e,[i.translation[0]*r,-i.translation[1]*r]);const o=1+i.translation[2]*c*t,h=this._view.constraints.rotationEnabled?-i.heading*m*t:0,d=this._view.size,v=[d[0]/2,d[1]];n(e,e,o,h,v,d);const p=this._view.constraints.constrain(e,this._view.viewpoint);this._view.viewpoint=p}}const m=.06,_=.7,c=6e-4;export{d as GamepadNavigation};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e){const i=()=>e(\"visible\"===document.visibilityState);return document.addEventListener(\"visibilitychange\",i),{remove:()=>document.addEventListener(\"visibilitychange\",i)}}export{e as onVisibilityChange};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{InputHandler as i}from\"../../../input/InputHandler.js\";import{onVisibilityChange as t}from\"../../../input/VisibilityChange.js\";class e extends i{constructor(i,e,s){super(!0),this.view=i,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=i=>{const t=this._keyMap[i.data.key];if(i.modifiers.has(\"Meta\")||i.modifiers.has(\"Ctrl\"))return void this._stopMovement();if(null==t)return;i.stopPropagation(),i.preventDefault();const e=\"key-down\"===i.type;if(this._pressedKeys[e?\"add\":\"delete\"](t),e){if(this._direction===t)return;this._direction=t,this._isSticky=!1,this._setTimeout((()=>{this._isSticky&&this._handlePopKey()}))}else{const i=void 0===this._timeout,t=this._pressedKeys.size>0;i||t?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),null==this._direction&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:\"left\",[e.right]:\"right\",[e.up]:\"up\",[e.down]:\"down\"},this.registerIncoming(\"key-down\",s,this._handleKey),this.registerIncoming(\"key-up\",s,this._handleKey),this.registerIncoming(\"blur\",s,this._stopMovement),this._visibilityHandle=t((i=>i?null:this._stopMovement()))}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(i){const t=null!=this._currentDirection;if(null!=i){if(t||this.view.mapViewNavigation.begin(),this._currentDirection!==i)switch(i){case\"left\":this.view.mapViewNavigation.continousPanLeft();break;case\"right\":this.view.mapViewNavigation.continousPanRight();break;case\"up\":this.view.mapViewNavigation.continousPanUp();break;case\"down\":this.view.mapViewNavigation.continousPanDown()}}else t&&this.view.mapViewNavigation.stop();this._currentDirection=i}_setTimeout(i){clearTimeout(this._timeout),this._timeout=void 0===i?void 0:setTimeout((()=>{this._timeout=void 0,i()}),this._stickyKeyDuration)}}export{e as KeyPan};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{InputHandler as e}from\"../../../input/InputHandler.js\";import{onVisibilityChange as i}from\"../../../input/VisibilityChange.js\";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyToDirection={[t.clockwiseOption1]:\"clockwise\",[t.clockwiseOption2]:\"clockwise\",[t.counterClockwiseOption1]:\"counterClockwise\",[t.counterClockwiseOption2]:\"counterClockwise\",[t.resetOption1]:\"reset\",[t.resetOption2]:\"reset\"},this.registerIncoming(\"key-down\",s,(e=>this._handleKeyDown(e))),this.registerIncoming(\"key-up\",s,(e=>this._handleKeyUp(e))),this.registerIncoming(\"blur\",s,(()=>this._handleStop())),this._visibilityHandle=i((e=>e?null:this._handleStop()))}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has(\"Shift\")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[e.data.key];if(this._pressed=null!=s,this._pressed){if(e.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case\"clockwise\":this.view.mapViewNavigation.continousRotateClockwise();break;case\"counterClockwise\":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case\"reset\":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{t as KeyRotate};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../../../core/has.js\";import{InputHandler as o}from\"../../../input/InputHandler.js\";var t;!function(o){o[o.IN=0]=\"IN\",o[o.OUT=1]=\"OUT\"}(t||(t={}));class e extends o{constructor(o,e,i){super(!0),this.view=o,this.keys=e,this._keysToZoomAction={},this.registerIncoming(\"key-down\",i,(o=>this._handleKeyDown(o))),e.zoomIn.forEach((o=>this._keysToZoomAction[o]=t.IN)),e.zoomOut.forEach((o=>this._keysToZoomAction[o]=t.OUT))}_handleKeyDown(o){this._handleKey(o)}_handleKey(o){const e=o.modifiers;if(e.size>0&&!e.has(\"Shift\"))return;const{key:i}=o.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let r=null;switch(n){case t.IN:r=s.zoomIn();break;case t.OUT:r=s.zoomOut();break;default:return}s.begin(),r.then((()=>s.end())),o.stopPropagation()}}export{e as KeyZoom};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{InputHandler as e}from\"../../../input/InputHandler.js\";const t=.6;class o extends e{constructor(e,t){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming(\"mouse-wheel\",t,(e=>this._handleMouseWheel(e)))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled)return;if(e.preventDefault(),e.stopPropagation(),!this._canZoom)return;const o=this._view.mapViewNavigation,{x:n,y:i,deltaY:s}=e.data,a=1/t**(1/60*s),h=o.zoom(a,[n,i]);h&&(this._canZoom=!1,h.catch((()=>{})).then((()=>{this._canZoom=!0,o.end()})))}}export{o as MouseWheelZoom};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{DragEventSeparator as t}from\"../../../input/DragEventSeparator.js\";import{InputHandler as i}from\"../../../input/InputHandler.js\";class a extends i{constructor(i){super(!0),this.view=i,this.registerIncoming(\"drag\",(t=>this._handleDrag(t))),this.registerIncoming(\"pointer-down\",(()=>this._stopMomentumNavigation()));const a=this.view.mapViewNavigation;this._dragEventSeparator=new t({start:(t,i)=>{a.pinch.begin(this.view,i.data),i.stopPropagation()},update:(t,i)=>{a.pinch.update(this.view,i.data),i.stopPropagation()},end:(t,i)=>{a.pinch.end(this.view),i.stopPropagation()},condition:t=>t>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}}export{a as PinchRotateAndZoom};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction t(t){const n=t.native;return n?{buttons:n.buttons.map((t=>t.pressed?t.value||1:0)),axes:n.axes.map((n=>s(n,t.axisThreshold)))}:{buttons:[],axes:[]}}function n(t,n){if(t.axes.length!==n.axes.length)return!1;if(t.buttons.length!==n.buttons.length)return!1;for(let e=0;e{this._connectGamepad(e.gamepad)},this._onDisconnectGamepad=e=>{const t=e.gamepad,i=t.index,n=this._inputDevices[i];n&&(this._emitGamepadEvent(t,s(n),!1),this._inputDevices.splice(i,1),this._latestUpdate.splice(i,1),this._input.gamepad.devices.remove(n),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i=\"getGamepads\"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(this._forEachGamepad((e=>this._connectGamepad(e))),window.addEventListener(\"gamepadconnected\",this._onConnectGamepad),window.addEventListener(\"gamepaddisconnected\",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener(\"gamepadconnected\",this._onConnectGamepad),window.removeEventListener(\"gamepaddisconnected\",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const s=new t(e);\"unknown\"!==s.deviceType&&(this._inputDevices[e.index]=s,this._input.gamepad.devices.add(s)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){null==this._frameTask&&(this._frameTask=e({update:()=>this._readGamepadState()}))}_stopPolling(){null!=this._frameTask&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),t=this._element.contains(document.activeElement),a=\"document\"===this._input.gamepad.enabledFocusMode&&!e||\"view\"===this._input.gamepad.enabledFocusMode&&!t;this._forEachGamepad((e=>{const t=this._inputDevices[e.index];if(!t)return;const d=this._latestUpdate[e.index],o=s(t),r=a||i(o);if(d){if(d.timestamp===e.timestamp)return;if(!d.active&&r)return;if(n(d.state,o))return}this._emitGamepadEvent(e,o,!r)}))}_forEachGamepad(e){const t=window.navigator.getGamepads();for(let s=0;s{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute(\"tabindex\")||e.setAttribute(\"tabindex\",\"0\"),this._eventHandlers={\"key-down\":this._handleKey,\"key-up\":this._handleKey,\"pointer-down\":this._handlePointer,\"pointer-move\":this._handlePointerPreventDefault,\"pointer-up\":this._handlePointerPreventDefault,\"pointer-enter\":this._handlePointer,\"pointer-leave\":this._handlePointer,\"pointer-cancel\":this._handlePointer,\"mouse-wheel\":this._handleMouseWheel,\"pointer-capture-lost\":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener(\"keydown\",this._preventAltKeyDefault),this._gamepadSource=new n(e,this._input),this._gamepadSource.onEvent=e=>this._callback(\"gamepad\",e)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach((e=>{this._releasePointerCaptureSafe(e)})),this._gamepadSource=e(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener(\"keydown\",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const t in this._active)if(!e||!e.has(t)){const e=this._active[t];this._element.removeEventListener(u[t],e),delete this._active[t]}e&&e.forEach((e=>{if(!this._active[e]&&u[e]){const t=(this._eventHandlers[e]||this._handleDefault).bind(this,e);this._element.addEventListener(u[e],t),this._active[e]=t}})),this._gamepadSource.hasEventListeners=e?.has(\"gamepad\")??!1}setPointerCapture(e,t){t?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?l.touchNone:l.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?l.touchPan:l.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener(\"touchmove\",this._preventMultiTouchPanning):this._element.removeEventListener(\"touchmove\",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(l.touchNone),this._element.classList.remove(l.touchPan),this._element.removeEventListener(\"touchmove\",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch(t){}}_updateNormalizedPointerLikeEvent(e,t){const n=i(this._element,e);return c.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),t.x=n.x,t.y=n.y,t}_handleKey(e,n){const i=t(n);i&&\"key-up\"===e&&this._keyDownState.delete(i);const o={native:n,key:i,repeat:!!i&&this._keyDownState.has(i)};i&&\"key-down\"===e&&this._keyDownState.add(o.key),this._callback(e,o)}_handlePointer(e,t){const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,t){const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault(),this._callback(e,n)}_handleMouseWheel(e,t){let n=t.deltaY;switch(t.deltaMode){case 0:o&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}o?n*=.7:a||r?n*=.6:s&&(n*=1.375);const i=100,h=Math.abs(n);if(h>i){const e=.02;n=n/h*200/(1+Math.exp(-e*(h-i)))}const l=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:n});this._callback(e,l)}_handlePointerCaptureLost(e,t){this._activePointerCaptures.delete(t.pointerId),this._handleDefault(e,t)}_handleDefault(e,t){const n={native:t};t.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){\"Alt\"===e.key&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}}c.test={disableSubpixelCoordinates:!1};const u={\"key-down\":\"keydown\",\"key-up\":\"keyup\",\"pointer-down\":\"pointerdown\",\"pointer-up\":\"pointerup\",\"pointer-move\":\"pointermove\",\"mouse-wheel\":\"wheel\",\"pointer-capture-got\":\"gotpointercapture\",\"pointer-capture-lost\":\"lostpointercapture\",\"context-menu\":\"contextmenu\",\"pointer-enter\":\"pointerenter\",\"pointer-leave\":\"pointerleave\",\"pointer-cancel\":\"pointercancel\",focus:\"focus\",blur:\"blur\"};export{c as BrowserEventSource};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{InputHandler as t}from\"../InputHandler.js\";class e extends t{constructor(){super(!0),this.registerIncoming(\"context-menu\",(t=>{t.data.native.preventDefault()}))}}export{e as PreventContextMenu};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{createScreenPoint as e}from\"../../../core/screenUtils.js\";const t={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function n(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function r(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function o(t,n){if(n?(n.radius=0,n.center.x=0,n.center.y=0):n={radius:0,center:e()},0===t.length)return n;if(1===t.length)return n.center.x=t[0].x,n.center.y=t[0].y,n;if(2===t.length){const[e,r]=t,[o,u]=[r.x-e.x,r.y-e.y];return n.radius=Math.sqrt(o*o+u*u)/2,n.center.x=(e.x+r.x)/2,n.center.y=(e.y+r.y)/2,n}let r=0,o=0;for(let e=0;ee.x-r)),c=t.map((e=>e.y-o));let i=0,a=0,l=0,m=0,s=0,x=0,y=0;for(let e=0;ethis._dragStart(t,e),update:(t,e)=>this._dragUpdate(e),end:(t,e)=>this._dragEnd(e)}),this.registerIncoming(\"drag\",(t=>this._dragEventSeparator.handle(t))),this.registerIncoming(\"pointer-down\",(t=>this._handlePointerDown(t))),this.registerIncoming(\"pointer-up\",(()=>this._handlePointerUp()))}onUninstall(){this._pointerState.forEach((t=>{t.doubleTapTimeout=a(t.doubleTapTimeout)}))}get hasPendingInputs(){return e(this._pointerState,(t=>null!=t.doubleTapTimeout))}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=a(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_createDoubleTapDragData(t,e,a){const{button:i,buttons:o,pointer:r,pointers:s,pointerType:n,timestamp:u}=a;return{action:t,delta:e,button:i,buttons:o,pointer:r,pointers:s,pointerType:n,timestamp:u}}_dragStart(t,e){if(!this._doubleTapDragReady||1!==t)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:a,modifiers:o}=e,{center:r}=a;this._dragStartCenter=r;const s=this._createDoubleTapDragData(\"begin\",i(0,0),a);this._doubleTapDrag.emit(s,void 0,o),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:a}=t,{center:o}=e,r=i(o.x-this._dragStartCenter.x,o.y-this._dragStartCenter.y),s=this._createDoubleTapDragData(\"update\",r,e);this._doubleTapDrag.emit(s,void 0,a),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:a}=t,{center:o}=e,r=i(o.x-this._dragStartCenter.x,o.y-this._dragStartCenter.y),s=this._createDoubleTapDragData(\"end\",r,e);this._doubleTapDrag.emit(s,void 0,a),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,a=n(e),i=this._pointerState.get(a),{pointerType:o}=e.native;if(i){const r=\"touch\"===o?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(a),u(i.event.data,e)>r?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:a}=e.native,i=n(e),o=\"touch\"===a?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,r=this._clock.setTimeout((()=>this._clearPointerDown(i)),o);this._pointerState.set(i,{event:t,doubleTapTimeout:r}),this.refreshHasPendingInputs()}}export{p as DoubleTapDrag};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{createScreenPoint as t}from\"../../../core/screenUtils.js\";import{Milliseconds as e}from\"../../../core/time.js\";import{InputHandler as i}from\"../InputHandler.js\";import{fitCircleLSQ as n}from\"./support.js\";class s extends i{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing(\"drag\"),this.registerIncoming(\"pointer-drag\",this._handlePointerDrag.bind(this)),this.registerIncoming(\"pointer-up\",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming(\"pointer-capture-lost\",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming(\"pointer-cancel\",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:o(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=a(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=h(n,r(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&null==t.x&&null==t.y)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=a(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=a(this._activePointerMap);this._activePointerMap.forEach((i=>{i.initialAngle=h(i,e)-t,i.lastAngle=h(i,e)-t}))}_emitEvent(t,e,i){const n=a(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const i=t.data.native.pointerId,n=e(t.timestamp);this._activePointerMap.get(i)&&(1===this._activePointerMap.size?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent(\"end\",t.data,n),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent(\"removed\",t.data,e(t.timestamp))))}_handlePointerDrag(t){const i=t.data,n=i.currentEvent,s=e(t.timestamp);switch(i.action){case\"start\":case\"update\":this._isDragging?this._activePointerMap.has(n.native.pointerId)?(this._updatePointer(n),!this._isCurrentDragSuppressed&&this._emitEvent(\"update\",n,s)):(this._addPointer(n),this._emitEvent(\"added\",n,s),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(n),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent(\"start\",n,s))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&\"touch\"===this._pointerType&&1===this._activePointerMap.size}}function r(e){const i=[];return e.forEach((e=>{i.push(t(e.event.x,e.event.y))})),n(i)}function a(t){const e=r(t);let i=0;return t.forEach((t=>{let n=h(t,e),s=n-t.lastAngle;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;n=t.lastAngle+s,t.lastAngle=n;const r=n-t.initialAngle;i+=r})),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function o(t){const e=new Map;return t.forEach(((t,i)=>e.set(i,t.event))),e}function h(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var p;!function(t){t[t.Left=0]=\"Left\",t[t.Middle=1]=\"Middle\",t[t.Right=2]=\"Right\",t[t.Back=3]=\"Back\",t[t.Forward=4]=\"Forward\",t[t.Undefined=-1]=\"Undefined\"}(p||(p={}));export{p as Button,s as Drag};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clock as t}from\"../../../core/clock.js\";import{InputHandler as e}from\"../InputHandler.js\";import{DefaultParameters as i,getPointerId as o,manhattanDistance as a}from\"./support.js\";class m extends e{constructor(e=i.maximumDoubleClickDelay,o=i.maximumDoubleClickDistance,a=i.maximumDoubleTouchDelay,m=i.maximumDoubleTouchDistance,n=t){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=o,this._maximumDoubleTouchDelay=a,this._maximumDoubleTouchDistance=m,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing(\"immediate-double-click\"),this.registerIncoming(\"pointer-down\",this._handlePointerDown.bind(this)),this.registerIncoming(\"pointer-up\",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach((t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()})),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=o(e);if(!this._pointerState.has(i)){const t={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,t),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=o(e),m=this._pointerState.get(i);if(m&&m.downButton===e.native.button){const i=m.immediateDoubleClick,o=\"touch\"===t.data.native.pointerType?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;i?(i.timeoutHandle.remove(),a(i,t.data)>o?this._startImmediateDoubleClick(t,m):(this._immediateDoubleClick.emit(t.data,void 0,i.modifiers),this._removeState(e))):a(m,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,m)}}_startImmediateDoubleClick(t,e){const i=\"touch\"===t.data.native.pointerType?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout((()=>this._removeState(t.data)),i)}}_removeState(t){const e=o(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}}export{m as ImmediateDoubleClick};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clock as t}from\"../../../core/clock.js\";import{removeMaybe as e}from\"../../../core/maybe.js\";import{InputHandler as i}from\"../InputHandler.js\";import{DefaultParameters as n,euclideanDistance as o}from\"./support.js\";class r extends i{constructor(e=n.maximumClickDelay,i=n.movementUntilMouseDrag,o=n.movementUntilPenDrag,r=n.movementUntilTouchDrag,s=n.holdDelay,a=t){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=o,this._movementUntilTouchDrag=r,this._holdDelay=s,this._clock=a,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing(\"pointer-drag\"),this._immediateClick=this.registerOutgoing(\"immediate-click\"),this._pointerHold=this.registerOutgoing(\"hold\"),this.registerIncoming(\"pointer-down\",this._handlePointerDown.bind(this)),this.registerIncoming(\"pointer-up\",(t=>{this._handlePointerLoss(t,\"pointer-up\")})),this.registerIncoming(\"pointer-capture-lost\",(t=>{this._handlePointerLoss(t,\"pointer-capture-lost\")})),this.registerIncoming(\"pointer-cancel\",(t=>{this._handlePointerLoss(t,\"pointer-cancel\")})),this._moveHandle=this.registerIncoming(\"pointer-move\",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach((t=>{t.holdTimeout=e(t.holdTimeout)})),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;0===this._pointerState.size&&(n=this._clock.setTimeout((()=>{const e=this._pointerState.get(i);if(e){if(!e.isDragging){const i=e.previousEvent;this._pointerHold.emit(i,void 0,t.modifiers),e.holdEmitted=!0}e.holdTimeout=null}}),this._holdDelay));const o={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,o),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_createPointerDragData(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);if(n){if(n.isDragging)this._pointerDrag.emit(this._createPointerDragData(\"update\",n,e),void 0,n.modifiers);else{o(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t)}n.previousEvent=e}}_getDragThreshold(t){switch(t){case\"touch\":return this._movementUntilTouchDrag;case\"pen\":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach((n=>{null!=n.holdTimeout&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData(\"start\",n,e)):this._pointerDrag.emit(this._createPointerDragData(\"start\",n,n.previousEvent),t.timestamp))}))}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,o=this._pointerState.get(n);if(o){if(null!=o.holdTimeout&&(o.holdTimeout.remove(),o.holdTimeout=null),o.isDragging)this._pointerDrag.emit(this._createPointerDragData(\"end\",o,\"pointer-up\"===e?i:o.previousEvent),void 0,o.modifiers);else if(\"pointer-up\"===e&&o.downButton===i.native.button){t.timestamp-o.startTimestamp<=this._maximumClickDelay&&!o.holdEmitted&&this._immediateClick.emit(i)}this._pointerState.delete(n),this.stopCapturingPointer(i.native),0===this._pointerState.size&&this._moveHandle.pause()}}}export{r as PointerClickHoldAndDrag};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clock as e}from\"../../../core/clock.js\";import{someMap as t}from\"../../../core/MapUtils.js\";import{removeMaybe as i}from\"../../../core/maybe.js\";import{InputHandler as o}from\"../InputHandler.js\";import{DefaultParameters as n,manhattanDistance as s,getPointerId as l}from\"./support.js\";class r extends o{constructor(t=n.maximumDoubleClickDelay,i=n.maximumDoubleClickDistance,o=n.maximumDoubleTouchDelay,s=n.maximumDoubleTouchDistance,l=e){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=o,this._maximumDoubleTouchDistance=s,this._clock=l,this._pointerState=new Map,this._click=this.registerOutgoing(\"click\"),this._doubleClick=this.registerOutgoing(\"double-click\"),this.registerIncoming(\"immediate-click\",this._handleImmediateClick.bind(this)),this.registerIncoming(\"pointer-down\",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach((e=>e.doubleClickTimer=i(e.doubleClickTimer)))}get hasPendingInputs(){return t(this._pointerState,(e=>null!=e.doubleClickTimer))}_clearDoubleClickTimer(e,t){const o=this._pointerState.get(e);o&&(o.doubleClickTimer=i(o.doubleClickTimer),t&&this._click.emit(o.event.data,void 0,o.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const t=this._pointerState.get(e);1===t.pointerDownCount&&this._click.emit(t.event.data,void 0,t.event.modifiers),t.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:t,pointerType:i,button:o}=e.native;return\"mouse\"===i?`${t}:${o}`:`${i}`}_handleImmediateClick(e){const t=e.data,{pointerType:i}=t.native,o=this._getPointerId(t);if(!this._pointerState.has(o))return void this._startClick(e);const n=this._pointerState.get(o),{data:l,modifiers:r}=n.event,c=\"touch\"===i?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s(l,t)>c?(this._clearDoubleClickTimer(o,!0),this._startClick(e)):(this._clearDoubleClickTimer(o,!1),2===n.pointerDownCount&&this._doubleClick.emit(l,void 0,r))}_handlePointerDown(e){const t=l(e.data),i=this._pointerState.get(t);i&&(i.pointerDownCount+=1)}_startClick(e){const{data:t}=e,{native:{pointerType:i}}=t,o=l(t),n=\"touch\"===i?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,s=this._clock.setTimeout((()=>this._doubleClickTimeoutExceeded(o)),n),r=1;this._pointerState.set(o,{event:e,doubleClickTimer:s,pointerDownCount:r}),this.refreshHasPendingInputs()}}export{r as SingleAndDoubleClick};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import t from\"../../../core/Accessor.js\";import{destroyMaybe as o}from\"../../../core/maybe.js\";import{when as r,watch as i,initial as n}from\"../../../core/reactiveUtils.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as a}from\"../../../core/accessorSupport/decorators/subclass.js\";import{DoubleClickZoom as p}from\"./handlers/DoubleClickZoom.js\";import{DoubleTapDragZoom as c}from\"./handlers/DoubleTapDragZoom.js\";import{DragPan as m}from\"./handlers/DragPan.js\";import{DragRotate as u}from\"./handlers/DragRotate.js\";import{GamepadNavigation as l}from\"./handlers/GamepadNavigation.js\";import{KeyPan as h}from\"./handlers/KeyPan.js\";import{KeyRotate as w}from\"./handlers/KeyRotate.js\";import{KeyZoom as d}from\"./handlers/KeyZoom.js\";import{MouseWheelZoom as v}from\"./handlers/MouseWheelZoom.js\";import{PinchRotateAndZoom as g}from\"./handlers/PinchAction.js\";import{BrowserEventSource as f}from\"../../input/BrowserEventSource.js\";import{InputManager as j,ViewEventPriorities as y}from\"../../input/InputManager.js\";import{PreventContextMenu as _}from\"../../input/handlers/PreventContextMenu.js\";import{DoubleTapDrag as A}from\"../../input/recognizers/DoubleTapDrag.js\";import{Drag as D}from\"../../input/recognizers/Drag.js\";import{ImmediateDoubleClick as M}from\"../../input/recognizers/ImmediateDoubleClick.js\";import{PointerClickHoldAndDrag as P}from\"../../input/recognizers/PointerClickHoldAndDrag.js\";import{SingleAndDoubleClick as T}from\"../../input/recognizers/SingleAndDoubleClick.js\";const b={counter:\"Ctrl\",pan:{left:\"ArrowLeft\",right:\"ArrowRight\",up:\"ArrowUp\",down:\"ArrowDown\"},zoom:{zoomIn:[\"=\",\"+\"],zoomOut:[\"-\",\"_\"]},rotate:{clockwiseOption1:\"a\",clockwiseOption2:\"A\",counterClockwiseOption1:\"d\",counterClockwiseOption2:\"D\",resetOption1:\"n\",resetOption2:\"N\"}};let z=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r((()=>!e()),(()=>this._disconnect())),r(e,(()=>this._connect()))])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new f(e,this.view.input),o=[new M,new P,new T,new D(this.view.navigation),new A],r=new j({eventSource:t,recognizers:o});r.installHandlers(\"prevent-context-menu\",[new _],y.INTERNAL),r.installHandlers(\"navigation\",[new g(this.view),new l(this.view),new v(this.view),new p(this.view),new p(this.view,[b.counter]),new m(this.view,\"primary\"),new h(this.view,b.pan),new d(this.view,b.zoom),new w(this.view,b.rotate),new u(this.view,\"secondary\"),new c(this.view,\"touch\")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,i((()=>this.view?.navigation?.browserTouchPanEnabled),(e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)}),n)}get test(){return{inputManager:this._inputManager}}};e([s()],z.prototype,\"view\",void 0),e([s()],z.prototype,\"latestPointerType\",null),e([s()],z.prototype,\"latestPointerLocation\",null),e([s()],z.prototype,\"multiTouchActive\",null),z=e([a(\"esri.views.2d.input.MapViewInputManager\")],z);const k=z;export{k as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar e=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}export{e as c,o as g};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as o}from\"./_commonjsHelpers.js\";var r,t,n,a={exports:{}};a.exports,r=a,t=function(){function o(o,t,a,f,e){r(o,t,a||0,f||o.length-1,e||n)}function r(o,n,a,f,e){for(;f>a;){if(f-a>600){var s=f-a+1,i=n-a+1,h=Math.log(s),p=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*p*(s-p)/s)*(i-s/2<0?-1:1);r(o,n,Math.max(a,Math.floor(n-i*p/s+c)),Math.min(f,Math.floor(n+(s-i)*p/s+c)),e)}var u=o[n],x=a,M=f;for(t(o,a,n),e(o[f],u)>0&&t(o,a,f);x0;)M--}0===e(o[a],u)?t(o,a,M):t(o,++M,f),M<=n&&(a=M+1),n<=M&&(f=M-1)}}function t(o,r,t){var n=o[r];o[r]=o[t],o[t]=n}function n(o,r){return or?1:0}return o},void 0!==(n=t())&&(r.exports=n);const f=o(a.exports);export{f as q};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{q as t}from\"./quickselect.js\";function i(t,n){if(!(this instanceof i))return new i(t,n);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(\"function\"==typeof n?this.toBBox=n:this._initFormat(n)),this.clear()}function n(t,i,n){if(!n)return i.indexOf(t);for(var h=0;h=t.minX&&i.maxY>=t.minY}function x(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,h,a,r){for(var e,o=[n,h];o.length;)(h=o.pop())-(n=o.pop())<=a||(e=n+Math.ceil((h-n)/a/2)*a,t(i,e,n,h,r),o.push(n,e,e,h))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,n=[],h=this.toBBox;if(!f(t,i))return n;for(var a,r,e,o,s=[];i;){for(a=0,r=i.children.length;a=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(a,e,i)},_split:function(t,i){var n=t[i],a=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,a);var e=this._chooseSplitIndex(n,r,a),o=x(n.children.splice(e,n.children.length-e));o.height=n.height,o.leaf=n.leaf,h(n,this.toBBox),h(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},_splitRoot:function(t,i){this.data=x([t,i]),this.data.height=t.height+1,this.data.leaf=!1,h(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,n){var h,r,e,o,l,m,u,f;for(m=u=1/0,h=i;h<=n-i;h++)o=c(r=a(t,0,h,this.toBBox),e=a(t,h,n,this.toBBox)),l=s(r)+s(e),o=i;e--)o=t.children[e],r(c,t.leaf?s(o):o),u+=l(c);return u},_adjustParentBBoxes:function(t,i,n){for(var h=n;h>=0;h--)r(i[h],t)},_condense:function(t){for(var i,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():h(t[n],this.toBBox)},_initFormat:function(t){var i=[\"return a\",\" - b\",\";\"];this.compareMinX=new Function(\"a\",\"b\",i.join(t[0])),this.compareMinY=new Function(\"a\",\"b\",i.join(t[1])),this.toBBox=new Function(\"a\",\"return {minX: a\"+t[0]+\", minY: a\"+t[1]+\", maxX: a\"+t[2]+\", maxY: a\"+t[3]+\"};\")}};export{i as r};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONMap as o}from\"../../core/jsonMap.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{clone as r}from\"../../core/lang.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"../../geometry/Extent.js\";var n;const c=new o({upperLeft:\"upper-left\",lowerLeft:\"lower-left\"});let m=n=class extends t{constructor(e){super(e),this.extent=null,this.mode=\"view\",this.originPosition=\"upper-left\",this.tolerance=1}clone(){return new n(r({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([i({type:p,json:{write:{overridePolicy(){return{enabled:\"view\"===this.mode}}}}})],m.prototype,\"extent\",void 0),e([i({type:[\"view\",\"edit\"],json:{write:!0}})],m.prototype,\"mode\",void 0),e([i({type:String,json:{read:c.read,write:c.write}})],m.prototype,\"originPosition\",void 0),e([i({type:Number,json:{write:{overridePolicy(){return{enabled:\"view\"===this.mode}}}}})],m.prototype,\"tolerance\",void 0),m=n=e([s(\"esri.rest.support.QuantizationParameters\")],m);const a=m;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../../../core/ArrayPool.js\";import e from\"../../../../../geometry/Extent.js\";import{create as i}from\"../../../../../geometry/support/aaBoundingRect.js\";import s from\"../../../../../rest/support/QuantizationParameters.js\";import o from\"../../../tiling/TileKey.js\";class n{constructor(t,e){this.key=new o(0,0,0,0),this.bounds=i(),this.objectIds=new Set,this.key.set(e);const s=t.getLODInfoAt(this.key);this.tileInfoView=t,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return e.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:\"upperLeft\",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),i=t.acquire();for(let t=0;t({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[\".bounds[0]\",\".bounds[1]\",\".bounds[2]\",\".bounds[3]\"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const i of e.added)if(!this.has(i)){const e=new s(this.tileScheme,i);this._tiles.set(i,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach((e=>this.tiles.push(e))),(t.added.length||t.removed.length)&&this.emit(\"update\",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:o,lodInfo:d}=t,{level:l}=d;if(o.length>0)for(const{row:i,colFrom:a,colTo:m}of o)for(let e=a;e<=m;e++){const t=r.set(l,i,d.normalizeCol(e),d.getWorldForColumn(e)).id;if(n.add(t),!this.has(t)){const e=new s(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),h.added.push(e)}}for(let s=this.tiles.length-1;s>=0;s--){const e=this.tiles[s];n.has(e.id)||(this._tiles.delete(e.id),this.tiles.splice(s,1),this._index.remove(e),h.removed.push(e))}(h.added.length||h.removed.length)&&this.emit(\"update\",h),i.pool.release(t),n.clear(),h.added.length=0,h.removed.length=0}}export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../../chunks/tslib.es6.js\";import r from\"../../../Color.js\";import t from\"../../../core/Accessor.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as p}from\"../../../core/accessorSupport/decorators/subclass.js\";let i=class extends t{constructor(){super(...arguments),this.color=new r([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25}equals(o){return this.color.equals(o.color)&&(this.haloColor||this.color).equals(o.haloColor||o.color)&&this.haloOpacity===o.haloOpacity&&this.fillOpacity===o.fillOpacity}};o([s({type:r})],i.prototype,\"color\",void 0),o([s({type:r})],i.prototype,\"haloColor\",void 0),o([s()],i.prototype,\"haloOpacity\",void 0),o([s()],i.prototype,\"fillOpacity\",void 0),i=o([p(\"esri.views.2d.support.HighlightOptions\")],i);const c=i;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../Graphic.js\";import{isSome as r}from\"../../../core/arrayUtils.js\";import{isIterable as t}from\"../../../core/iteratorUtils.js\";import{isSupportedScreenPointEvent as a,createScreenPointFromSupportedEvent as i}from\"../../support/screenUtils.js\";async function l(e,t,l){const p=a(t)?i(e,t):t;if(!e.ready||isNaN(p.x)||isNaN(p.y))return{screenPoint:p,results:[]};let d=new Set;const f=new Set;let u=!1,y=null,h=null;l?.include?n(l.include,s(e,(e=>{d.add(e),c(e,(e=>f.add(e)))}),((e,r)=>{f.add(e),d.add(r)}),(e=>{y||(y=new Set),y.add(e)}),(e=>d.add(e)),(()=>u=!0))):(u=!0,d=new Set(e.allLayerViews),d.forEach((e=>{c(e,(e=>f.add(e)))}))),l?.exclude&&n(l.exclude,s(e,(e=>{d.delete(e),c(e,(e=>f.delete(e)))}),(e=>f.delete(e)),(e=>{h||(h=new Set),h.add(e)})));const g=e.allLayerViews.filter((e=>!e.suspended&&d.has(e))).reverse(),w=e.toMap(p);let m=[...u?e.graphicsView.hitTest(w).map((e=>({type:\"graphic\",graphic:e,layer:null,mapPoint:w}))):[],...await Promise.all(g.map((e=>e.hitTest(w,p))).toArray())].filter(r).flat().filter(r);return m=m.filter((e=>\"graphic\"!==e.type||\"subtype-group\"!==e.layer?.type||f.has(e.graphic.layer))),y&&(m=m.filter((e=>!(\"graphic\"in e)||!e.graphic||y?.has(o(e.graphic))))),h&&(m=m.filter((e=>!(\"graphic\"in e)||!e.graphic||!h?.has(o(e.graphic))))),{screenPoint:p,results:m}}function s(r,t,a,i,l,s){return n=>{if(n instanceof e){if(n.layer===r)s?.();else{const e=r.allLayerViews.find((e=>e.layer===n.layer));e&&l?.(e)}i(o(n))}else if(\"subtype-sublayer\"===n.type){const e=r.allLayerViews.find((e=>e.layer===n.parent));e&&a(n,e)}else{const e=r.allLayerViews.find((e=>e.layer===n));e&&t(e)}}}function n(e,r){if(e)if(t(e))for(const a of e)if(t(a))for(const e of a)r(e);else r(a);else r(e)}function o(e){const r=e.getObjectId();return r?`${e.layer?.uid??e.sourceLayer?.uid??\"MapView\"}/${r}`:`\"MapView/${e.uid}`}function c({layer:e},r){\"subtype-group\"===e.type&&e.sublayers.forEach((e=>{r(e)}))}export{l as hitTest};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../request.js\";import e from\"./Error.js\";import{isAbortError as r}from\"./promiseUtils.js\";import{dataComponents as a}from\"./urlUtils.js\";import{base64ToArrayBuffer as n}from\"../support/base64Utils.js\";let i=null,o=!0;function s(t,e,r){if(!t||!e)throw new Error(\"Cannot construct image data without dimensions\");if(o)try{return new ImageData(t,e)}catch(a){o=!1}return m(t,e,r)}function c(t,e,r,a){if(!e||!r)throw new Error(\"Cannot construct image data without dimensions\");if(o)try{return new ImageData(t,e,r)}catch(i){o=!1}const n=m(e,r,a);return n.data.set(t,0),n}function f(){return i||(i=document.createElement(\"canvas\"),i.width=1,i.height=1),i}function m(t,e,r){return r||(r=f()),r.getContext(\"2d\").createImageData(t,e)}async function u(a,n){const i=window.URL.createObjectURL(a);try{const{data:e}=await t(i,{...n,responseType:\"image\"});return e}catch(o){if(!r(o))throw new e(\"invalid-image\",`Could not fetch requested image at ${i}`);throw o}finally{window.URL.revokeObjectURL(i)}}async function p(t,e){const{arrayBuffer:r,mediaType:a}=await d(t,e),n=\"image/png\"===a;if(\"image/gif\"===a){const{isAnimatedGIF:t,parseGif:a}=await import(\"./image/gif.js\");if(t(r))return a(r,e)}if(n){const{isAnimatedPNG:t,parseApng:a}=await import(\"./image/apng.js\");if(t(r))return a(r,e)}return u(new Blob([r],{type:a}),e)}async function d(e,r){const i=a(e);if(i?.isBase64)return{arrayBuffer:n(i.data),mediaType:i.mediaType};const o=await t(e,{responseType:\"array-buffer\",...r});return{arrayBuffer:o.data,mediaType:o.getHeader(\"Content-Type\")}}export{s as createEmptyImageData,p as getImageData,c as wrapImageData};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../core/has.js\";import{clamp as t}from\"../../core/mathUtils.js\";export{createEmptyImageData}from\"../../core/imageUtils.js\";const h=2048,i=1.5,e=8;function o(h,i){const{format:e,quality:o,rotation:n,disableDecorations:a}=h||{},r=b(h,i.padding),l=p(h,{width:i.width-r.left-r.right,height:i.height-r.top-r.bottom}),{width:g,height:f}=m(h,l),d=j(e),u=R[d];return{format:d,quality:t(null!=o?o:u,0,100),area:l,width:g,height:f,rotation:n,disableDecorations:!!a,ignoreBackground:!!h?.ignoreBackground,ignorePadding:!!h?.ignorePadding}}function n(t,h){const i=o(t,h),e=i.area,n=i.width/e.width,a=b(i,h.padding),r=a.left+a.right,l=a.top+a.bottom,g=h.width-r,f=h.height-l,d=Math.floor(g*n+r),u=Math.floor(f*n+l),c=t?.layers??[],s=i.ignoreBackground,w=i.ignorePadding;return{framebufferWidth:d,framebufferHeight:u,region:{x:Math.floor(e.x*n)+a.left,y:Math.floor(e.y*n)+a.top,width:i.width,height:i.height},format:i.format,quality:i.quality,rotation:i.rotation,pixelRatio:n,layers:c,disableDecorations:i.disableDecorations,ignoreBackground:s,ignorePadding:w,objectAndLayerIdColor:!1}}function a(t,h,i){const{ctx:e,canvas:o}=l(t,i),n=e.getImageData(0,0,t.width,t.height),a=u(o,h);return g(o),{dataUrl:a,data:n}}function r(t,h){const{ctx:i,canvas:e}=l(t,h),o=i.getImageData(0,0,t.width,t.height);return g(e),o}function l(t,h){const i=f();h.premultipliedAlpha&&q(t),i.width=t.width,i.height=t.height;const e=i.getContext(\"2d\",{willReadFrequently:!0});return e.putImageData(t,0,0),h.flipY&&D(e),{ctx:e,canvas:i}}function g(t){t.width=0,t.height=0}function f(){return null==d&&(d=document.createElement(\"canvas\")),d}let d=null;function u(t,h){const i=v[h.format],e=h.quality/100;return t.toDataURL(i,e)}function c(h,i){const e=j(h),o=R[e];return{format:e,quality:t(null!=i?i:o,0,100)}}function s(t,h){return h/Math.max(t[0],t[1])}function w(t,h,i,e=0,o=0,n=t.width-e,a=t.height-o,r=!1){const{data:l}=t,{width:g,height:f,data:d}=h,u=n/g,c=a/f,s=Math.ceil(u/2),w=Math.ceil(c/2),M=t.width;for(let m=0;m=1)continue;let u=2*h*h*h-3*h*h+1;const c=4*(e+d+(o+r)*M);b+=u*l[c+3],a+=u,!i&&l[c+3]<255&&(u=u*l[c+3]/255),p+=u*l[c],x+=u*l[c+1],y+=u*l[c+2],n+=u}}d[h]=p/n,d[h+1]=x/n,d[h+2]=y/n,d[h+3]=b/a}return h}function M(t,o,n){if(!o)return t;const{framebufferWidth:a,framebufferHeight:r,pixelRatio:l,region:g}=t,f=b(t,n),d=f.left+f.right,u=f.top+f.bottom,c=a-d,s=r-u,w=Math.min(e,Math.min((h-d)/c,(h-u)/s));return wn){const t=Math.floor(o.width/a),h=o.height-t;return{x:o.x,y:Math.floor(o.y+h/2),width:o.width,height:t}}const r=Math.floor(o.height*a),l=o.width-r;return{x:Math.floor(o.x+l/2),y:o.y,width:r,height:o.height}}function y(t,h){if(null==h?.width||null==h.height)return t;const i=h.width/h.height,e=t.width/t.height;if(e===i)return t;if(e0){const i=255/t;h[e]=h[e]*i,h[e+1]=h[e+1]*i,h[e+2]=h[e+2]*i}}}const v={png:\"image/png\",jpg:\"image/jpeg\",jpeg:\"image/jpeg\"},I=98,P=\"png\",R={png:100,jpg:I,jpeg:I},k={top:0,right:0,bottom:0,left:0};export{o as completeUserSettings,a as encode,r as encodeData,c as getFormatAndQuality,s as getMaximumResolutionScale,w as resampleHermite,M as screenshotSuperSampleSettings,u as toDataUrl,n as toRenderSettings};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getFormatAndQuality as t,encode as i,encodeData as h,getMaximumResolutionScale as n}from\"../../support/screenshotUtils.js\";const e={flipY:!0,premultipliedAlpha:!0};async function o(h,n){const o=await a(h,n),{format:r,quality:l}=t(n?.format,n?.quality);return i(o,{format:r,quality:l,rotation:0,disableDecorations:!1},e)}async function r(t,i){const n=await a(t,i);return h(n,e)}function a(t,i){const h=d(i||{},u(t.stage,t.size),t.size,t.padding),n=l(i,t.allLayerViews);return t.stage.takeScreenshot(h,n,t.backgroundColor,i?.rotation)}function l(t={},i){if(!t.layers)return;const h=[];return t.layers.forEach((t=>{const n=i.find((i=>i.layer.id===t.id));n?.container&&h.push(n.container)})),h}function u(t,i){return Math.min(4,n(i,Math.min(4096,t.context.parameters.maxTextureSize)))}function d(t,i,h,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let e=null;null!=t.width&&null!=t.height?e=[t.width,t.height]:null==t.width&&null!=t.height?e=[t.height,t.height]:null!=t.width&&null==t.height?e=[t.width,t.width]:null==t.width&&null==t.height&&(e=null);const o=h[0]-(n.left+n.right),r=h[1]-(n.top+n.bottom);let a,l,u=t.area||{x:0,y:0,width:o,height:r};if(e){const t=o/r,i=e[0]/e[1];if(i>t){const t=u.width/i;u={x:u.x,y:Math.round(u.y+(u.height-t)/2),width:u.width,height:Math.round(t)}}else{const t=u.height*i;u={x:Math.round(u.x+(u.width-t)/2),y:u.y,width:Math.round(t),height:u.height}}}else e=[u.width,u.height];return e[0]>u.width?(a=Math.min(e[0]/u.width,i),l=e[0]/u.width/a):(a=1,l=e[0]/u.width),{cropArea:{x:Math.round((u.x+n.left)*a),y:Math.round((u.y+n.top)*a),width:Math.round(u.width*a),height:Math.round(u.height*a)},outputScale:l,resolutionScale:a}}export{d as createScreenshotRegion,r as takeRawScreenshot,o as takeScreenshot};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../../chunks/tslib.es6.js\";import t from\"../../../core/Accessor.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as e}from\"../../../core/accessorSupport/decorators/subclass.js\";const o=160;let i=class extends t{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),null==this._timer&&(this._timer=setInterval((()=>{performance.now()-this._timestamp>=o&&this.clear()}),o))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([s()],i.prototype,\"_timer\",void 0),r([s()],i.prototype,\"stationary\",null),i=r([e(\"esri.views.2d.support.StationaryManager\")],i);export{i as StationaryManager};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst s=s=>s.includes(\"Brush\");class e{constructor(){this._names=new Map}begin(e){this._names.has(e)||(this._names.set(e,!1),s(e)&&this.record(\"Esri.FirstDraw\"),performance.mark(`Esri.${e}.Start`))}end(s){this._names.has(s)&&!this._names.get(s)&&(this._names.set(s,!0),performance.mark(`Esri.${s}.End`))}record(s){this._names.has(s)||(this._names.set(s,!0),performance.mark(`Esri.${s}`))}}export{e as Timeline};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport has from\"../../core/has.js\";var n;function r(r,t,o={}){const e=t===n.WEBGL1?\"webgl\":\"webgl2\",c=r.getContext(e,o);return c||null}function t(n,t,e={}){const c=o(n);for(const o of c){const n=r(t,o,e);if(n)return n}return null}function o(r){if(\"3d\"===r)return[n.WEBGL2];const t=has(\"esri-force-webgl\");return t===n.WEBGL1||t===n.WEBGL2?[t]:has(\"mac\")&&has(\"chrome\")?[n.WEBGL1,n.WEBGL2]:[n.WEBGL2,n.WEBGL1]}!function(n){n[n.WEBGL1=1]=\"WEBGL1\",n[n.WEBGL2=2]=\"WEBGL2\"}(n||(n={}));export{n as ContextType,r as createContext,t as createContextForView,o as getContextTypes};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getContextTypes as t,ContextType as e,createContext as r}from\"./contextUtils.js\";let s,o;function n(e){const r=t(e);for(;r.length>1;){const t=l(r.shift());if(t.available)return t}return l(r.shift())}function l(t){switch(t){case e.WEBGL1:return a();case e.WEBGL2:return u()}}function a(){return s||(s=E()),s}function u(){return o||(o=_()),o}class i{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}class f extends i{constructor(){super(...arguments),this.type=e.WEBGL1}}class p extends i{constructor(){super(...arguments),this.type=e.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}}function c(t,s){if(t===e.WEBGL1&&\"undefined\"==typeof WebGLRenderingContext||t===e.WEBGL2&&\"undefined\"==typeof WebGL2RenderingContext)return null;const o=document.createElement(\"canvas\");if(!o)return null;let n=r(o,t,{failIfMajorPerformanceCaveat:!0});if(null==n&&(n=r(o,t),null!=n&&(s.majorPerformanceCaveat=!0)),null==n)return n;if(t===e.WEBGL1){const t=n.getParameter(n.VERSION),e=t?.match(/^WebGL\\s+([\\d.]*)/);if(e){const t=parseFloat(e[1]);s.available=t>=.94}}else s.available=!0;s.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE),s.supportsVertexShaderSamplers=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const l=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT);return l&&(s.supportsHighPrecisionFragment=l.precision>0),n}function E(){const t=new f,r=c(e.WEBGL1,t);return null==r||(t.supportsElementIndexUint=null!==r.getExtension(\"OES_element_index_uint\"),t.supportsStandardDerivatives=null!==r.getExtension(\"OES_standard_derivatives\"),t.supportsInstancedArrays=null!==r.getExtension(\"ANGLE_instanced_arrays\"),t.supportsTextureFloat=null!==r.getExtension(\"OES_texture_float\"),t.supportsTextureHalfFloat=null!==r.getExtension(\"OES_texture_half_float\"),t.supportsColorBufferFloat=null!==r.getExtension(\"WEBGL_color_buffer_float\"),t.supportsColorBufferFloatBlend=null!==r.getExtension(\"EXT_float_blend\"),t.supportsColorBufferHalfFloat=null!==r.getExtension(\"EXT_color_buffer_half_float\")),t}function _(){const t=new p,r=c(e.WEBGL2,t);return null==r||(t.supportsColorBufferFloat=null!==r.getExtension(\"EXT_color_buffer_float\"),t.supportsColorBufferFloatBlend=null!==r.getExtension(\"EXT_float_blend\"),t.supportsColorBufferHalfFloat=t.supportsColorBufferFloat||null!==r.getExtension(\"EXT_color_buffer_half_float\")),t}export{a as getWebGL1Capabilities,u as getWebGL2Capabilities,n as getWebGLCapabilities,l as getWebGLVersionCapabilities};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import{getWebGLCapabilities as r}from\"../webgl/capabilities.js\";import{ContextType as t}from\"../webgl/contextUtils.js\";function i(i){const s=r(i);if(!s.available)return new e(\"webgl:required\",\"3d\"===i?\"WebGL2 is required but not supported.\":\"WebGL is required but not supported.\",(new Error).stack);if(\"3d\"===i&&s.majorPerformanceCaveat)return new e(\"webgl:major-performance-caveat-detected\",\"Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist.\");if(!s.supportsHighPrecisionFragment)return new e(\"webgl:high-precision-fragment-required\",\"WebGL support for high precision fragment shaders is required but not supported.\");if(!s.supportsVertexShaderSamplers)return new e(\"webgl:vertex-shader-samplers-required\",\"WebGL support for vertex shader samplers is required but not supported.\");if(s.type===t.WEBGL1){if(!s.supportsElementIndexUint)return new e(\"webgl:element-index-uint-required\",\"WebGL support for uint vertex indices is required but not supported.\");if(!s.supportsStandardDerivatives)return new e(\"webgl:standard-derivatives-required\",\"WebGL support for standard derivatives is required but not supported.\");if(!s.supportsInstancedArrays)return new e(\"webgl:instanced-arrays-required\",\"WebGL support for instanced rendering is required but not supported.\")}return null}export{i as check};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import{byId as e}from\"../../core/domUtils.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import{cast as r}from\"../../core/accessorSupport/decorators/cast.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";function n(t){return t&&\"nodeType\"in t}function d(t){return t&&\"function\"==typeof t.render}const c={component:\"esri-component\"};let p=class extends o{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get(\"id\")??this.widget?.id??this.node?.id}set id(t){this._set(\"id\",t)}set node(t){const o=this._get(\"node\");t!==o&&(t&&t.classList.add(c.component),o&&o.classList.remove(c.component),this._set(\"node\",t))}castNode(t){return this.widget?.destroy(),t?\"string\"==typeof t||n(t)?(this._set(\"widget\",null),e(t)):(d(t)&&!t.domNode&&(t.domNode=document.createElement(\"div\")),this._set(\"widget\",t),t.domNode):(this._set(\"widget\",null),null)}};t([s()],p.prototype,\"id\",null),t([s()],p.prototype,\"node\",null),t([r(\"node\")],p.prototype,\"castNode\",null),t([s({readOnly:!0})],p.prototype,\"widget\",void 0),p=t([i(\"esri.views.ui.Component\")],p);const l=p;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst t=\"calcite-mode-\";function e(){return getComputedStyle(document.body).getPropertyValue(\"--esri-calcite-mode-name\").replaceAll(/\\s|'|\"/g,\"\")}function r(){return e().startsWith(\"dark\")}function c(){return`${t}${r()?\"dark\":\"light\"}`}function n(t){o(t),t.classList.add(c())}function o(e){Array.from(e.classList).forEach((r=>{r.startsWith(t)&&e.classList.remove(r)}))}export{c as getCalciteThemeClass,r as isDarkTheme,n as setCalciteThemeClass};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import\"../../intl.js\";import{isSome as o}from\"../../core/arrayUtils.js\";import{empty as n,insertBefore as i}from\"../../core/domUtils.js\";import e from\"../../core/Evented.js\";import{watch as r,initial as s}from\"../../core/reactiveUtils.js\";import{property as a}from\"../../core/accessorSupport/decorators/property.js\";import{cast as p}from\"../../core/accessorSupport/decorators/cast.js\";import\"../../core/has.js\";import{subclass as d}from\"../../core/accessorSupport/decorators/subclass.js\";import{setCalciteThemeClass as c}from\"../../support/themeUtils.js\";import l from\"./Component.js\";import{isRTL as h}from\"../../widgets/support/widgetUtils.js\";import{getLocale as m,onLocaleChange as u}from\"../../intl/locale.js\";const f={left:0,top:0,bottom:0,right:0},_={bottom:30,top:15,right:15,left:15},g=\"esri-ui\",y={ui:g,corner:`${g}-corner`,innerContainer:`${g}-inner-container`,manualContainer:`${g}-manual-container`,cornerContainer:`${g}-corner-container`,topLeft:`${g}-top-left`,topRight:`${g}-top-right`,bottomLeft:`${g}-bottom-left`,bottomRight:`${g}-bottom-right`};function C(t){return t&&!t._started&&\"function\"==typeof t.postMixInProperties&&\"function\"==typeof t.buildRendering&&\"function\"==typeof t.postCreate&&\"function\"==typeof t.startup}function v(t){return 0===t?\"0\":`${t}px`}function b(t){const o=\"object\"==typeof t&&null!==t&&Object.getPrototypeOf(t);return(null===o||o===Object.prototype)&&(\"component\"in t||\"index\"in t||\"position\"in t)?t:null}function w(t,{top:o,bottom:n,left:i,right:e}){t.style.top=o,t.style.bottom=n,t.style.left=i,t.style.right=e}let P=class extends e.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=m(),this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&w(t,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&w(t,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([r((()=>[this.view?.padding,this.container]),this._applyViewPadding,s),r((()=>this.padding),this._applyUIPadding,s),r((()=>[this.container,this._locale]),(([t,o])=>{t&&t.setAttribute(\"lang\",o)}),s),u((t=>{this._locale=t}))])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const o=this._get(\"container\");t!==o&&(t&&(t.classList.add(y.ui),c(t),this._attachContainers(t)),o&&(o.classList.remove(y.ui),w(o,{top:\"\",bottom:\"\",left:\"\",right:\"\"}),n(o)),this._set(\"container\",t))}get height(){const t=this.view?.height??0;if(0===t)return t;const o=this._getViewPadding(),{top:n,bottom:i}=o;return Math.max(t-n-i,0)}get padding(){return this._get(\"padding\")}set padding(t){this._overrideIfSome(\"padding\",t)}castPadding(t){return\"number\"==typeof t?{bottom:t,top:t,right:t,left:t}:{..._,...t}}get width(){const t=this.view?.width??0;if(0===t)return t;const o=this._getViewPadding(),{left:n,right:i}=o;return Math.max(t-n-i,0)}add(t,o){let n,i,e;if(Array.isArray(t))return void t.forEach((t=>this.add(t,o)));const r=b(t);r&&({index:n,position:o,component:t,key:i}=r),o&&\"object\"==typeof o&&({index:n,key:i,position:o,internal:e}=o),!t||o&&!this._isValidPosition(o)||this._add(t,o,n,i,e)}remove(t,o){if(!t)return;if(Array.isArray(t))return t.map((t=>this.remove(t,o)));const n=this._find(t);if(n){if(this._componentMap.has(n)&&this._componentMap.get(n)?.key!==o)return;const t=this._components.indexOf(n),i=n.node.parentNode;return i?.removeChild(n.node),this._componentMap.delete(n),this._components.splice(t,1)[0]}}empty(t,o={removeInternal:!1}){if(Array.isArray(t)){for(const n of t)this.empty(n,o);return}const n=this._positionNameToContainerLookup[t??\"manual\"],i=Array.prototype.slice.call(n.children).map((t=>this._findByNode(t))).filter((t=>{if(null==t)return!1;return!(this._componentMap.get(t)?.internal??!1)||o.removeInternal}));for(const e of i)this.remove(e)}move(t,o){if(Array.isArray(t)&&t.forEach((t=>this.move(t,o))),!t)return;let n;const i=b(t)||b(o);if(i&&(n=i.index,o=i.position,t=i.component||t),o&&!this._isValidPosition(o))return;const e=this.remove(t);e&&this.add(e,{position:o,index:n})}find(t){if(!t)return null;const o=this._findById(t);return o&&(o.widget||o.node)}getComponents(t,o={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap((t=>this._getComponentsAtPosition(t,o))):this._getComponentsAtPosition(t,o):this._components.filter((t=>o.includeInternal||!this._componentMap.get(t)?.internal)).map((({widget:t,node:o})=>t??o))}getPosition(t){for(const o in this._positionNameToContainerLookup){if(this._positionNameToContainerLookup[o].contains(t))return o}return null}_add(t,o,n,i,e){t instanceof l||(t=new l({node:t})),this._place({component:t,position:o,index:n}),this._components.push(t),this._componentMap.set(t,{key:i,internal:e})}_find(t){return t?t instanceof l?this._findByComponent(t):\"string\"==typeof t?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??f}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement(\"div\");t.classList.add(y.innerContainer,y.cornerContainer);const o=document.createElement(\"div\");o.classList.add(y.innerContainer,y.manualContainer);const n=document.createElement(\"div\");n.classList.add(y.topLeft,y.corner),t.appendChild(n);const i=document.createElement(\"div\");i.classList.add(y.topRight,y.corner),t.appendChild(i);const e=document.createElement(\"div\");e.classList.add(y.bottomLeft,y.corner),t.appendChild(e);const r=document.createElement(\"div\");r.classList.add(y.bottomRight,y.corner),t.appendChild(r),this._innerContainer=t,this._manualContainer=o;const s=h();this._cornerNameToContainerLookup={\"top-left\":n,\"top-right\":i,\"bottom-left\":e,\"bottom-right\":r,\"top-leading\":s?i:n,\"top-trailing\":s?n:i,\"bottom-leading\":s?r:e,\"bottom-trailing\":s?e:r},this._positionNameToContainerLookup={manual:o,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const o=t.position??\"manual\",{component:n,index:e}=t,r=this._positionNameToContainerLookup[o],s=null!=e&&e>-1;if(C(n.widget)&&n.widget.startup(),!s)return void r.appendChild(n.node);const a=Array.from(r.children);if(0===e)return void(r.firstChild?i(n.node,r.firstChild):r.appendChild(n.node));e>=a.length?r.appendChild(n.node):i(n.node,a[e])}_toPixelPosition(t){return{top:v(t.top),left:v(t.left),right:v(t.right),bottom:v(t.bottom)}}_findByComponent(t){return this._components.find((o=>o===t))??null}_findById(t){return this._components.find((({id:o})=>o===t))??null}_findByNode(t){return this._components.find((({node:o})=>o===t))??null}_getComponentsAtPosition(t,n){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map((t=>this._findByNode(t))).filter(o).filter((t=>n.includeInternal||!this._componentMap.get(t)?.internal)).map((({widget:t,node:o})=>t??o))}};t([a()],P.prototype,\"_locale\",void 0),t([a()],P.prototype,\"container\",null),t([a()],P.prototype,\"height\",null),t([a({value:_})],P.prototype,\"padding\",null),t([p(\"padding\")],P.prototype,\"castPadding\",null),t([a()],P.prototype,\"view\",void 0),t([a()],P.prototype,\"width\",null),P=t([d(\"esri.views.ui.UI\")],P);const L=P;export{L as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst t=\"randomUUID\"in crypto;function n(){if(t)return crypto.randomUUID();const n=crypto.getRandomValues(new Uint16Array(8));n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;const r=t=>n[t].toString(16).padStart(4,\"0\");return r(0)+r(1)+\"-\"+r(2)+\"-\"+r(3)+\"-\"+r(4)+\"-\"+r(5)+r(6)+r(7)}function r(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}export{r as generateBracedUUID,o as generateLowercaseBracedUUID,n as generateUUID};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e={handleInterceptedEvent:(e,p,t,n)=>(e.scheduleRender(),p.properties[`on${n.type}`].apply(p.properties.bind||t,[n]))};export{e as defaultAdvancedProjectorOptions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,r,t)=>{\"-\"===r.charAt(0)?e.style.setProperty(r,t):e.style[r]=t}},r=r=>({...e,...r});export{r as applyDefaultProjectionOptions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{dom as e}from\"../maquette/dom.js\";import\"../maquette/projector.js\";import{defaultAdvancedProjectorOptions as t}from\"./advanced-projector-options.js\";import{applyDefaultProjectionOptions as r}from\"./utils.js\";const o=(e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r},n=(e,t)=>e.find(t),d=(e,t,r=!1)=>{let o=e;return t.forEach(((e,d)=>{const s=o?.children?n(o.children,(t=>t.domNode===e)):void 0;r&&!s&&d!==t.length-1||(o=s)})),o},s=n=>{let s;const i={...t,...n},c=r(i),a=c.performanceLogger;let m,p=!0,l=!1;const f=[],u=[],h=(e,t,r)=>{let n;c.eventHandlerInterceptor=(e,t,r,c)=>function(e){let t;a(\"domEvent\",e);const r=o(e.currentTarget,n.domNode),c=r.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase===Event.CAPTURING_PHASE||!c)r.reverse(),t=d(n.getLastRender(),r);else{const r=e.composedPath(),o=r.slice(r.indexOf(e.currentTarget),r.indexOf(n.domNode)).reverse();t=d(n.getLastRender(),o,!0)}let m;return t&&(m=i.handleInterceptedEvent(s,t,this,e)),a(\"domEventProcessed\",e),m},i.postProcessProjectionOptions?.(c);const m=r();n=e(t,m,c),c.eventHandlerInterceptor=void 0,f.push(n),u.push(r),i.afterFirstVNodeRendered&&i.afterFirstVNodeRendered(n,m)};let v=()=>{if(m=void 0,p){p=!1,a(\"renderStart\",void 0);for(let e=0;e{m||l||(m=requestAnimationFrame(v))},stop:()=>{m&&(cancelAnimationFrame(m),m=void 0),l=!0},resume:()=>{l=!1,p=!0,s.scheduleRender()},append:(t,r)=>{h(e.append,t,r)},insertBefore:(t,r)=>{h(e.insertBefore,t,r)},merge:(t,r)=>{h(e.merge,t,r)},replace:(t,r)=>{h(e.replace,t,r)},detach:e=>{for(let t=0;t {\n const assetUrl = new URL(path, plt.$resourcesUrl$);\n return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;\n};\nconst setAssetPath = (path) => (plt.$resourcesUrl$ = path);\nconst createTime = (fnName, tagName = '') => {\n if (BUILD.profile && performance.mark) {\n const key = `st:${fnName}:${tagName}:${i++}`;\n // Start\n performance.mark(key);\n // End\n return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);\n }\n else {\n return () => {\n return;\n };\n }\n};\nconst uniqueTime = (key, measureText) => {\n if (BUILD.profile && performance.mark) {\n if (performance.getEntriesByName(key, 'mark').length === 0) {\n performance.mark(key);\n }\n return () => {\n if (performance.getEntriesByName(measureText, 'measure').length === 0) {\n performance.measure(measureText, key);\n }\n };\n }\n else {\n return () => {\n return;\n };\n }\n};\nconst inspect = (ref) => {\n const hostRef = getHostRef(ref);\n if (!hostRef) {\n return undefined;\n }\n const flags = hostRef.$flags$;\n const hostElement = hostRef.$hostElement$;\n return {\n renderCount: hostRef.$renderCount$,\n flags: {\n hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),\n hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),\n isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),\n isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),\n isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),\n hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),\n hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),\n isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),\n isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),\n needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),\n },\n instanceValues: hostRef.$instanceValues$,\n ancestorComponent: hostRef.$ancestorComponent$,\n hostElement,\n lazyInstance: hostRef.$lazyInstance$,\n vnode: hostRef.$vnode$,\n modeName: hostRef.$modeName$,\n onReadyPromise: hostRef.$onReadyPromise$,\n onReadyResolve: hostRef.$onReadyResolve$,\n onInstancePromise: hostRef.$onInstancePromise$,\n onInstanceResolve: hostRef.$onInstanceResolve$,\n onRenderResolve: hostRef.$onRenderResolve$,\n queuedListeners: hostRef.$queuedListeners$,\n rmListeners: hostRef.$rmListeners$,\n ['s-id']: hostElement['s-id'],\n ['s-cr']: hostElement['s-cr'],\n ['s-lr']: hostElement['s-lr'],\n ['s-p']: hostElement['s-p'],\n ['s-rc']: hostElement['s-rc'],\n ['s-sc']: hostElement['s-sc'],\n };\n};\nconst installDevTools = () => {\n if (BUILD.devTools) {\n const stencil = (win.stencil = win.stencil || {});\n const originalInspect = stencil.inspect;\n stencil.inspect = (ref) => {\n let result = inspect(ref);\n if (!result && typeof originalInspect === 'function') {\n result = originalInspect(ref);\n }\n return result;\n };\n }\n};\nconst CONTENT_REF_ID = 'r';\nconst ORG_LOCATION_ID = 'o';\nconst SLOT_NODE_ID = 's';\nconst TEXT_NODE_ID = 't';\nconst HYDRATE_ID = 's-id';\nconst HYDRATED_STYLE_ID = 'sty-id';\nconst HYDRATE_CHILD_ID = 'c-id';\nconst HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';\nconst XLINK_NS = 'http://www.w3.org/1999/xlink';\n/**\n * Default style mode id\n */\n/**\n * Reusable empty obj/array\n * Don't add values to these!!\n */\nconst EMPTY_OBJ = {};\n/**\n * Namespaces\n */\nconst SVG_NS = 'http://www.w3.org/2000/svg';\nconst HTML_NS = 'http://www.w3.org/1999/xhtml';\nconst isDef = (v) => v != null;\nconst isComplexType = (o) => {\n // https://jsperf.com/typeof-fn-object/5\n o = typeof o;\n return o === 'object' || o === 'function';\n};\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n/**\n * Production h() function based on Preact by\n * Jason Miller (@developit)\n * Licensed under the MIT License\n * https://github.com/developit/preact/blob/master/LICENSE\n *\n * Modified for Stencil's compiler and vdom\n */\n// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;\n// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;\nconst h = (nodeName, vnodeData, ...children) => {\n let child = null;\n let key = null;\n let slotName = null;\n let simple = false;\n let lastSimple = false;\n const vNodeChildren = [];\n const walk = (c) => {\n for (let i = 0; i < c.length; i++) {\n child = c[i];\n if (Array.isArray(child)) {\n walk(child);\n }\n else if (child != null && typeof child !== 'boolean') {\n if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {\n child = String(child);\n }\n else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {\n consoleDevError(`vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects.`);\n }\n if (simple && lastSimple) {\n // If the previous child was simple (string), we merge both\n vNodeChildren[vNodeChildren.length - 1].$text$ += child;\n }\n else {\n // Append a new vNode, if it's text, we create a text vNode\n vNodeChildren.push(simple ? newVNode(null, child) : child);\n }\n lastSimple = simple;\n }\n }\n };\n walk(children);\n if (vnodeData) {\n if (BUILD.isDev && nodeName === 'input') {\n validateInputProperties(vnodeData);\n }\n // normalize class / classname attributes\n if (BUILD.vdomKey && vnodeData.key) {\n key = vnodeData.key;\n }\n if (BUILD.slotRelocation && vnodeData.name) {\n slotName = vnodeData.name;\n }\n if (BUILD.vdomClass) {\n const classData = vnodeData.className || vnodeData.class;\n if (classData) {\n vnodeData.class =\n typeof classData !== 'object'\n ? classData\n : Object.keys(classData)\n .filter((k) => classData[k])\n .join(' ');\n }\n }\n }\n if (BUILD.isDev && vNodeChildren.some(isHost)) {\n consoleDevError(`The must be the single root component. Make sure:\n- You are NOT using hostData() and in the same component.\n- is used once, and it's the single root component of the render() function.`);\n }\n if (BUILD.vdomFunctional && typeof nodeName === 'function') {\n // nodeName is a functional component\n return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);\n }\n const vnode = newVNode(nodeName, null);\n vnode.$attrs$ = vnodeData;\n if (vNodeChildren.length > 0) {\n vnode.$children$ = vNodeChildren;\n }\n if (BUILD.vdomKey) {\n vnode.$key$ = key;\n }\n if (BUILD.slotRelocation) {\n vnode.$name$ = slotName;\n }\n return vnode;\n};\n/**\n * A utility function for creating a virtual DOM node from a tag and some\n * possible text content.\n *\n * @param tag the tag for this element\n * @param text possible text content for the node\n * @returns a newly-minted virtual DOM node\n */\nconst newVNode = (tag, text) => {\n const vnode = {\n $flags$: 0,\n $tag$: tag,\n $text$: text,\n $elm$: null,\n $children$: null,\n };\n if (BUILD.vdomAttribute) {\n vnode.$attrs$ = null;\n }\n if (BUILD.vdomKey) {\n vnode.$key$ = null;\n }\n if (BUILD.slotRelocation) {\n vnode.$name$ = null;\n }\n return vnode;\n};\nconst Host = {};\n/**\n * Check whether a given node is a Host node or not\n *\n * @param node the virtual DOM node to check\n * @returns whether it's a Host node or not\n */\nconst isHost = (node) => node && node.$tag$ === Host;\n/**\n * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.\n *\n * Note that these functions convert from {@link d.VNode} to\n * {@link d.ChildNode} to give functional component developers a friendly\n * interface.\n */\nconst vdomFnUtils = {\n forEach: (children, cb) => children.map(convertToPublic).forEach(cb),\n map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),\n};\n/**\n * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a\n * friendlier public interface (hence, 'convertToPublic').\n *\n * @param node the virtual DOM node to convert\n * @returns a converted child node\n */\nconst convertToPublic = (node) => ({\n vattrs: node.$attrs$,\n vchildren: node.$children$,\n vkey: node.$key$,\n vname: node.$name$,\n vtag: node.$tag$,\n vtext: node.$text$,\n});\n/**\n * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in\n * order to use the resulting object in the virtual DOM. The initial object was\n * likely created as part of presenting a public API, so converting it back\n * involved making it 'private' again (hence, `convertToPrivate`).\n *\n * @param node the child node to convert\n * @returns a converted virtual DOM node\n */\nconst convertToPrivate = (node) => {\n if (typeof node.vtag === 'function') {\n const vnodeData = Object.assign({}, node.vattrs);\n if (node.vkey) {\n vnodeData.key = node.vkey;\n }\n if (node.vname) {\n vnodeData.name = node.vname;\n }\n return h(node.vtag, vnodeData, ...(node.vchildren || []));\n }\n const vnode = newVNode(node.vtag, node.vtext);\n vnode.$attrs$ = node.vattrs;\n vnode.$children$ = node.vchildren;\n vnode.$key$ = node.vkey;\n vnode.$name$ = node.vname;\n return vnode;\n};\n/**\n * Validates the ordering of attributes on an input element\n *\n * @param inputElm the element to validate\n */\nconst validateInputProperties = (inputElm) => {\n const props = Object.keys(inputElm);\n const value = props.indexOf('value');\n if (value === -1) {\n return;\n }\n const typeIndex = props.indexOf('type');\n const minIndex = props.indexOf('min');\n const maxIndex = props.indexOf('max');\n const stepIndex = props.indexOf('step');\n if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {\n consoleDevWarn(`The \"value\" prop of should be set after \"min\", \"max\", \"type\" and \"step\"`);\n }\n};\nconst initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {\n const endHydrate = createTime('hydrateClient', tagName);\n const shadowRoot = hostElm.shadowRoot;\n const childRenderNodes = [];\n const slotNodes = [];\n const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;\n const vnode = (hostRef.$vnode$ = newVNode(tagName, null));\n if (!plt.$orgLocNodes$) {\n initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));\n }\n hostElm[HYDRATE_ID] = hostId;\n hostElm.removeAttribute(HYDRATE_ID);\n clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);\n childRenderNodes.map((c) => {\n const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;\n const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);\n const node = c.$elm$;\n if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {\n orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);\n }\n if (!shadowRoot) {\n node['s-hn'] = tagName;\n if (orgLocationNode) {\n node['s-ol'] = orgLocationNode;\n node['s-ol']['s-nr'] = node;\n }\n }\n plt.$orgLocNodes$.delete(orgLocationId);\n });\n if (BUILD.shadowDom && shadowRoot) {\n shadowRootNodes.map((shadowRootNode) => {\n if (shadowRootNode) {\n shadowRoot.appendChild(shadowRootNode);\n }\n });\n }\n endHydrate();\n};\nconst clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {\n let childNodeType;\n let childIdSplt;\n let childVNode;\n let i;\n if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {\n childNodeType = node.getAttribute(HYDRATE_CHILD_ID);\n if (childNodeType) {\n // got the node data from the element's attribute\n // `${hostId}.${nodeId}.${depth}.${index}`\n childIdSplt = childNodeType.split('.');\n if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {\n childVNode = {\n $flags$: 0,\n $hostId$: childIdSplt[0],\n $nodeId$: childIdSplt[1],\n $depth$: childIdSplt[2],\n $index$: childIdSplt[3],\n $tag$: node.tagName.toLowerCase(),\n $elm$: node,\n $attrs$: null,\n $children$: null,\n $key$: null,\n $name$: null,\n $text$: null,\n };\n childRenderNodes.push(childVNode);\n node.removeAttribute(HYDRATE_CHILD_ID);\n // this is a new child vnode\n // so ensure its parent vnode has the vchildren array\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n // add our child vnode to a specific index of the vnode's children\n parentVNode.$children$[childVNode.$index$] = childVNode;\n // this is now the new parent vnode for all the next child checks\n parentVNode = childVNode;\n if (shadowRootNodes && childVNode.$depth$ === '0') {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n }\n // recursively drill down, end to start so we can remove nodes\n for (i = node.childNodes.length - 1; i >= 0; i--) {\n clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);\n }\n if (node.shadowRoot) {\n // keep drilling down through the shadow root nodes\n for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {\n clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);\n }\n }\n }\n else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {\n // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`\n childIdSplt = node.nodeValue.split('.');\n if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {\n // comment node for either the host id or a 0 host id\n childNodeType = childIdSplt[0];\n childVNode = {\n $flags$: 0,\n $hostId$: childIdSplt[1],\n $nodeId$: childIdSplt[2],\n $depth$: childIdSplt[3],\n $index$: childIdSplt[4],\n $elm$: node,\n $attrs$: null,\n $children$: null,\n $key$: null,\n $name$: null,\n $tag$: null,\n $text$: null,\n };\n if (childNodeType === TEXT_NODE_ID) {\n childVNode.$elm$ = node.nextSibling;\n if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {\n childVNode.$text$ = childVNode.$elm$.textContent;\n childRenderNodes.push(childVNode);\n // remove the text comment since it's no longer needed\n node.remove();\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n parentVNode.$children$[childVNode.$index$] = childVNode;\n if (shadowRootNodes && childVNode.$depth$ === '0') {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n }\n else if (childVNode.$hostId$ === hostId) {\n // this comment node is specifcally for this host id\n if (childNodeType === SLOT_NODE_ID) {\n // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;\n childVNode.$tag$ = 'slot';\n if (childIdSplt[5]) {\n node['s-sn'] = childVNode.$name$ = childIdSplt[5];\n }\n else {\n node['s-sn'] = '';\n }\n node['s-sr'] = true;\n if (BUILD.shadowDom && shadowRootNodes) {\n // browser support shadowRoot and this is a shadow dom component\n // create an actual slot element\n childVNode.$elm$ = doc.createElement(childVNode.$tag$);\n if (childVNode.$name$) {\n // add the slot name attribute\n childVNode.$elm$.setAttribute('name', childVNode.$name$);\n }\n // insert the new slot element before the slot comment\n node.parentNode.insertBefore(childVNode.$elm$, node);\n // remove the slot comment since it's not needed for shadow\n node.remove();\n if (childVNode.$depth$ === '0') {\n shadowRootNodes[childVNode.$index$] = childVNode.$elm$;\n }\n }\n slotNodes.push(childVNode);\n if (!parentVNode.$children$) {\n parentVNode.$children$ = [];\n }\n parentVNode.$children$[childVNode.$index$] = childVNode;\n }\n else if (childNodeType === CONTENT_REF_ID) {\n // `${CONTENT_REF_ID}.${hostId}`;\n if (BUILD.shadowDom && shadowRootNodes) {\n // remove the content ref comment since it's not needed for shadow\n node.remove();\n }\n else if (BUILD.slotRelocation) {\n hostElm['s-cr'] = node;\n node['s-cn'] = true;\n }\n }\n }\n }\n }\n else if (parentVNode && parentVNode.$tag$ === 'style') {\n const vnode = newVNode(null, node.textContent);\n vnode.$elm$ = node;\n vnode.$index$ = '0';\n parentVNode.$children$ = [vnode];\n }\n};\nconst initializeDocumentHydrate = (node, orgLocNodes) => {\n if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {\n let i = 0;\n for (; i < node.childNodes.length; i++) {\n initializeDocumentHydrate(node.childNodes[i], orgLocNodes);\n }\n if (node.shadowRoot) {\n for (i = 0; i < node.shadowRoot.childNodes.length; i++) {\n initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);\n }\n }\n }\n else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {\n const childIdSplt = node.nodeValue.split('.');\n if (childIdSplt[0] === ORG_LOCATION_ID) {\n orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);\n node.nodeValue = '';\n // useful to know if the original location is\n // the root light-dom of a shadow dom component\n node['s-en'] = childIdSplt[3];\n }\n }\n};\n// Private\nconst computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);\n// Public\nconst setMode = (handler) => modeResolutionChain.push(handler);\nconst getMode = (ref) => getHostRef(ref).$modeName$;\n/**\n * Parse a new property value for a given property type.\n *\n * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,\n * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:\n * 1. `any`, the type given to `propValue` in the function signature\n * 2. the type stored from `propType`.\n *\n * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.\n *\n * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to\n * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is\n * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.\n * ```tsx\n * \n * ```\n *\n * HTML prop values on the other hand, will always a string\n *\n * @param propValue the new value to coerce to some type\n * @param propType the type of the prop, expressed as a binary number\n * @returns the parsed/coerced value\n */\nconst parsePropertyValue = (propValue, propType) => {\n // ensure this value is of the correct prop type\n if (propValue != null && !isComplexType(propValue)) {\n if (BUILD.propBoolean && propType & 4 /* MEMBER_FLAGS.Boolean */) {\n // per the HTML spec, any string value means it is a boolean true value\n // but we'll cheat here and say that the string \"false\" is the boolean false\n return propValue === 'false' ? false : propValue === '' || !!propValue;\n }\n if (BUILD.propNumber && propType & 2 /* MEMBER_FLAGS.Number */) {\n // force it to be a number\n return parseFloat(propValue);\n }\n if (BUILD.propString && propType & 1 /* MEMBER_FLAGS.String */) {\n // could have been passed as a number or boolean\n // but we still want it as a string\n return String(propValue);\n }\n // redundant return here for better minification\n return propValue;\n }\n // not sure exactly what type we want\n // so no need to change to a different type\n return propValue;\n};\nconst getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);\nconst createEvent = (ref, name, flags) => {\n const elm = getElement(ref);\n return {\n emit: (detail) => {\n if (BUILD.isDev && !elm.isConnected) {\n consoleDevWarn(`The \"${name}\" event was emitted, but the dispatcher node is no longer connected to the dom.`);\n }\n return emitEvent(elm, name, {\n bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),\n composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),\n cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),\n detail,\n });\n },\n };\n};\n/**\n * Helper function to create & dispatch a custom Event on a provided target\n * @param elm the target of the Event\n * @param name the name to give the custom Event\n * @param opts options for configuring a custom Event\n * @returns the custom Event\n */\nconst emitEvent = (elm, name, opts) => {\n const ev = plt.ce(name, opts);\n elm.dispatchEvent(ev);\n return ev;\n};\nconst rootAppliedStyles = /*@__PURE__*/ new WeakMap();\nconst registerStyle = (scopeId, cssText, allowCS) => {\n let style = styles.get(scopeId);\n if (supportsConstructableStylesheets && allowCS) {\n style = (style || new CSSStyleSheet());\n if (typeof style === 'string') {\n style = cssText;\n }\n else {\n style.replaceSync(cssText);\n }\n }\n else {\n style = cssText;\n }\n styles.set(scopeId, style);\n};\nconst addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {\n var _a;\n let scopeId = getScopeId(cmpMeta, mode);\n const style = styles.get(scopeId);\n if (!BUILD.attachStyles) {\n return scopeId;\n }\n // if an element is NOT connected then getRootNode() will return the wrong root node\n // so the fallback is to always use the document for the root node in those cases\n styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;\n if (style) {\n if (typeof style === 'string') {\n styleContainerNode = styleContainerNode.head || styleContainerNode;\n let appliedStyles = rootAppliedStyles.get(styleContainerNode);\n let styleElm;\n if (!appliedStyles) {\n rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));\n }\n if (!appliedStyles.has(scopeId)) {\n if (BUILD.hydrateClientSide &&\n styleContainerNode.host &&\n (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}=\"${scopeId}\"]`))) {\n // This is only happening on native shadow-dom, do not needs CSS var shim\n styleElm.innerHTML = style;\n }\n else {\n if (BUILD.cssVarShim && plt.$cssShim$) {\n styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* CMP_FLAGS.needsScopedEncapsulation */));\n const newScopeId = styleElm['s-sc'];\n if (newScopeId) {\n scopeId = newScopeId;\n // we don't want to add this styleID to the appliedStyles Set\n // since the cssVarShim might need to apply several different\n // stylesheets for the same component\n appliedStyles = null;\n }\n }\n else {\n styleElm = doc.createElement('style');\n styleElm.innerHTML = style;\n }\n // Apply CSP nonce to the style tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n styleElm.setAttribute('nonce', nonce);\n }\n if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {\n styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);\n }\n styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));\n }\n if (appliedStyles) {\n appliedStyles.add(scopeId);\n }\n }\n }\n else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {\n styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];\n }\n }\n return scopeId;\n};\nconst attachStyles = (hostRef) => {\n const cmpMeta = hostRef.$cmpMeta$;\n const elm = hostRef.$hostElement$;\n const flags = cmpMeta.$flags$;\n const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);\n const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$, elm);\n if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {\n // only required when we're NOT using native shadow dom (slot)\n // or this browser doesn't support native shadow dom\n // and this host element was NOT created with SSR\n // let's pick out the inner content for slot projection\n // create a node to represent where the original\n // content was first placed, which is useful later on\n // DOM WRITE!!\n elm['s-sc'] = scopeId;\n elm.classList.add(scopeId + '-h');\n if (BUILD.scoped && flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {\n elm.classList.add(scopeId + '-s');\n }\n }\n endAttachStyles();\n};\nconst getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* CMP_FLAGS.hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);\nconst convertScopedToShadow = (css) => css.replace(/\\/\\*!@([^\\/]+)\\*\\/[^\\{]+\\{/g, '$1{');\n/**\n * Production setAccessor() function based on Preact by\n * Jason Miller (@developit)\n * Licensed under the MIT License\n * https://github.com/developit/preact/blob/master/LICENSE\n *\n * Modified for Stencil's compiler and vdom\n */\nconst setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {\n if (oldValue !== newValue) {\n let isProp = isMemberInElement(elm, memberName);\n let ln = memberName.toLowerCase();\n if (BUILD.vdomClass && memberName === 'class') {\n const classList = elm.classList;\n const oldClasses = parseClassList(oldValue);\n const newClasses = parseClassList(newValue);\n classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));\n classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));\n }\n else if (BUILD.vdomStyle && memberName === 'style') {\n // update style attribute, css properties and values\n if (BUILD.updatable) {\n for (const prop in oldValue) {\n if (!newValue || newValue[prop] == null) {\n if (!BUILD.hydrateServerSide && prop.includes('-')) {\n elm.style.removeProperty(prop);\n }\n else {\n elm.style[prop] = '';\n }\n }\n }\n }\n for (const prop in newValue) {\n if (!oldValue || newValue[prop] !== oldValue[prop]) {\n if (!BUILD.hydrateServerSide && prop.includes('-')) {\n elm.style.setProperty(prop, newValue[prop]);\n }\n else {\n elm.style[prop] = newValue[prop];\n }\n }\n }\n }\n else if (BUILD.vdomKey && memberName === 'key')\n ;\n else if (BUILD.vdomRef && memberName === 'ref') {\n // minifier will clean this up\n if (newValue) {\n newValue(elm);\n }\n }\n else if (BUILD.vdomListener &&\n (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&\n memberName[0] === 'o' &&\n memberName[1] === 'n') {\n // Event Handlers\n // so if the member name starts with \"on\" and the 3rd characters is\n // a capital letter, and it's not already a member on the element,\n // then we're assuming it's an event listener\n if (memberName[2] === '-') {\n // on- prefixed events\n // allows to be explicit about the dom event to listen without any magic\n // under the hood:\n // // listens for \"click\"\n // // listens for \"Click\"\n // // listens for \"ionChange\"\n // // listens for \"EVENTS\"\n memberName = memberName.slice(3);\n }\n else if (isMemberInElement(win, ln)) {\n // standard event\n // the JSX attribute could have been \"onMouseOver\" and the\n // member name \"onmouseover\" is on the window's prototype\n // so let's add the listener \"mouseover\", which is all lowercased\n memberName = ln.slice(2);\n }\n else {\n // custom event\n // the JSX attribute could have been \"onMyCustomEvent\"\n // so let's trim off the \"on\" prefix and lowercase the first character\n // and add the listener \"myCustomEvent\"\n // except for the first character, we keep the event name case\n memberName = ln[2] + memberName.slice(3);\n }\n if (oldValue) {\n plt.rel(elm, memberName, oldValue, false);\n }\n if (newValue) {\n plt.ael(elm, memberName, newValue, false);\n }\n }\n else if (BUILD.vdomPropOrAttr) {\n // Set property if it exists and it's not a SVG\n const isComplex = isComplexType(newValue);\n if ((isProp || (isComplex && newValue !== null)) && !isSvg) {\n try {\n if (!elm.tagName.includes('-')) {\n const n = newValue == null ? '' : newValue;\n // Workaround for Safari, moving the caret when re-assigning the same valued\n if (memberName === 'list') {\n isProp = false;\n }\n else if (oldValue == null || elm[memberName] != n) {\n elm[memberName] = n;\n }\n }\n else {\n elm[memberName] = newValue;\n }\n }\n catch (e) { }\n }\n /**\n * Need to manually update attribute if:\n * - memberName is not an attribute\n * - if we are rendering the host element in order to reflect attribute\n * - if it's a SVG, since properties might not work in \n * - if the newValue is null/undefined or 'false'.\n */\n let xlink = false;\n if (BUILD.vdomXlink) {\n if (ln !== (ln = ln.replace(/^xlink\\:?/, ''))) {\n memberName = ln;\n xlink = true;\n }\n }\n if (newValue == null || newValue === false) {\n if (newValue !== false || elm.getAttribute(memberName) === '') {\n if (BUILD.vdomXlink && xlink) {\n elm.removeAttributeNS(XLINK_NS, memberName);\n }\n else {\n elm.removeAttribute(memberName);\n }\n }\n }\n else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {\n newValue = newValue === true ? '' : newValue;\n if (BUILD.vdomXlink && xlink) {\n elm.setAttributeNS(XLINK_NS, memberName, newValue);\n }\n else {\n elm.setAttribute(memberName, newValue);\n }\n }\n }\n }\n};\nconst parseClassListRegex = /\\s/;\nconst parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));\nconst updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {\n // if the element passed in is a shadow root, which is a document fragment\n // then we want to be adding attrs/props to the shadow root's \"host\" element\n // if it's not a shadow root, then we add attrs/props to the same element\n const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host\n ? newVnode.$elm$.host\n : newVnode.$elm$;\n const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;\n const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;\n if (BUILD.updatable) {\n // remove attributes no longer present on the vnode by setting them to undefined\n for (memberName in oldVnodeAttrs) {\n if (!(memberName in newVnodeAttrs)) {\n setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);\n }\n }\n }\n // add new & update changed attributes\n for (memberName in newVnodeAttrs) {\n setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);\n }\n};\n/**\n * Create a DOM Node corresponding to one of the children of a given VNode.\n *\n * @param oldParentVNode the parent VNode from the previous render\n * @param newParentVNode the parent VNode from the current render\n * @param childIndex the index of the VNode, in the _new_ parent node's\n * children, for which we will create a new DOM node\n * @param parentElm the parent DOM node which our new node will be a child of\n * @returns the newly created node\n */\nconst createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {\n // tslint:disable-next-line: prefer-const\n const newVNode = newParentVNode.$children$[childIndex];\n let i = 0;\n let elm;\n let childNode;\n let oldVNode;\n if (BUILD.slotRelocation && !useNativeShadowDom) {\n // remember for later we need to check to relocate nodes\n checkSlotRelocate = true;\n if (newVNode.$tag$ === 'slot') {\n if (scopeId) {\n // scoped css needs to add its scoped id to the parent element\n parentElm.classList.add(scopeId + '-s');\n }\n newVNode.$flags$ |= newVNode.$children$\n ? // slot element has fallback content\n 2 /* VNODE_FLAGS.isSlotFallback */\n : // slot element does not have fallback content\n 1 /* VNODE_FLAGS.isSlotReference */;\n }\n }\n if (BUILD.isDev && newVNode.$elm$) {\n consoleDevError(`The JSX ${newVNode.$text$ !== null ? `\"${newVNode.$text$}\" text` : `\"${newVNode.$tag$}\" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);\n }\n if (BUILD.vdomText && newVNode.$text$ !== null) {\n // create text node\n elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);\n }\n else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {\n // create a slot reference node\n elm = newVNode.$elm$ =\n BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');\n }\n else {\n if (BUILD.svg && !isSvgMode) {\n isSvgMode = newVNode.$tag$ === 'svg';\n }\n // create element\n elm = newVNode.$elm$ = (BUILD.svg\n ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */\n ? 'slot-fb'\n : newVNode.$tag$)\n : doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */\n ? 'slot-fb'\n : newVNode.$tag$));\n if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {\n isSvgMode = false;\n }\n // add css classes, attrs, props, listeners, etc.\n if (BUILD.vdomAttribute) {\n updateElement(null, newVNode, isSvgMode);\n }\n if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {\n // if there is a scopeId and this is the initial render\n // then let's add the scopeId as a css class\n elm.classList.add((elm['s-si'] = scopeId));\n }\n if (newVNode.$children$) {\n for (i = 0; i < newVNode.$children$.length; ++i) {\n // create the node\n childNode = createElm(oldParentVNode, newVNode, i, elm);\n // return node could have been null\n if (childNode) {\n // append our new node\n elm.appendChild(childNode);\n }\n }\n }\n if (BUILD.svg) {\n if (newVNode.$tag$ === 'svg') {\n // Only reset the SVG context when we're exiting element\n isSvgMode = false;\n }\n else if (elm.tagName === 'foreignObject') {\n // Reenter SVG context when we're exiting element\n isSvgMode = true;\n }\n }\n }\n if (BUILD.slotRelocation) {\n elm['s-hn'] = hostTagName;\n if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {\n // remember the content reference comment\n elm['s-sr'] = true;\n // remember the content reference comment\n elm['s-cr'] = contentRef;\n // remember the slot name, or empty string for default slot\n elm['s-sn'] = newVNode.$name$ || '';\n // check if we've got an old vnode for this slot\n oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];\n if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {\n // we've got an old slot vnode and the wrapper is being replaced\n // so let's move the old slot content back to it's original location\n putBackInOriginalLocation(oldParentVNode.$elm$, false);\n }\n }\n }\n return elm;\n};\nconst putBackInOriginalLocation = (parentElm, recursive) => {\n plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;\n const oldSlotChildNodes = parentElm.childNodes;\n for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {\n const childNode = oldSlotChildNodes[i];\n if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {\n // // this child node in the old element is from another component\n // // remove this node from the old slot's parent\n // childNode.remove();\n // and relocate it back to it's original location\n parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));\n // remove the old original location comment entirely\n // later on the patch function will know what to do\n // and move this to the correct spot in need be\n childNode['s-ol'].remove();\n childNode['s-ol'] = undefined;\n checkSlotRelocate = true;\n }\n if (recursive) {\n putBackInOriginalLocation(childNode, recursive);\n }\n }\n plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;\n};\n/**\n * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and\n * add them to the DOM in the appropriate place.\n *\n * @param parentElm the DOM node which should be used as a parent for the new\n * DOM nodes\n * @param before a child of the `parentElm` which the new children should be\n * inserted before (optional)\n * @param parentVNode the parent virtual DOM node\n * @param vnodes the new child virtual DOM nodes to produce DOM nodes for\n * @param startIdx the index in the child virtual DOM nodes at which to start\n * creating DOM nodes (inclusive)\n * @param endIdx the index in the child virtual DOM nodes at which to stop\n * creating DOM nodes (inclusive)\n */\nconst addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {\n let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);\n let childNode;\n if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {\n containerElm = containerElm.shadowRoot;\n }\n for (; startIdx <= endIdx; ++startIdx) {\n if (vnodes[startIdx]) {\n childNode = createElm(null, parentVNode, startIdx, parentElm);\n if (childNode) {\n vnodes[startIdx].$elm$ = childNode;\n containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);\n }\n }\n }\n};\n/**\n * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.\n * This can be used to, for instance, clean up after a list of children which\n * should no longer be shown.\n *\n * This function also handles some of Stencil's slot relocation logic.\n *\n * @param vnodes a list of virtual DOM nodes to remove\n * @param startIdx the index at which to start removing nodes (inclusive)\n * @param endIdx the index at which to stop removing nodes (inclusive)\n * @param vnode a VNode\n * @param elm an element\n */\nconst removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {\n for (; startIdx <= endIdx; ++startIdx) {\n if ((vnode = vnodes[startIdx])) {\n elm = vnode.$elm$;\n callNodeRefs(vnode);\n if (BUILD.slotRelocation) {\n // we're removing this element\n // so it's possible we need to show slot fallback content now\n checkSlotFallbackVisibility = true;\n if (elm['s-ol']) {\n // remove the original location comment\n elm['s-ol'].remove();\n }\n else {\n // it's possible that child nodes of the node\n // that's being removed are slot nodes\n putBackInOriginalLocation(elm, true);\n }\n }\n // remove the vnode's element from the dom\n elm.remove();\n }\n }\n};\n/**\n * Reconcile the children of a new VNode with the children of an old VNode by\n * traversing the two collections of children, identifying nodes that are\n * conserved or changed, calling out to `patch` to make any necessary\n * updates to the DOM, and rearranging DOM nodes as needed.\n *\n * The algorithm for reconciling children works by analyzing two 'windows' onto\n * the two arrays of children (`oldCh` and `newCh`). We keep track of the\n * 'windows' by storing start and end indices and references to the\n * corresponding array entries. Initially the two 'windows' are basically equal\n * to the entire array, but we progressively narrow the windows until there are\n * no children left to update by doing the following:\n *\n * 1. Skip any `null` entries at the beginning or end of the two arrays, so\n * that if we have an initial array like the following we'll end up dealing\n * only with a window bounded by the highlighted elements:\n *\n * [null, null, VNode1 , ... , VNode2, null, null]\n * ^^^^^^ ^^^^^^\n *\n * 2. Check to see if the elements at the head and tail positions are equal\n * across the windows. This will basically detect elements which haven't\n * been added, removed, or changed position, i.e. if you had the following\n * VNode elements (represented as HTML):\n *\n * oldVNode: `

HEY

`\n * newVNode: `

THERE

`\n *\n * Then when comparing the children of the `
` tag we check the equality\n * of the VNodes corresponding to the `

` tags and, since they are the\n * same tag in the same position, we'd be able to avoid completely\n * re-rendering the subtree under them with a new DOM element and would just\n * call out to `patch` to handle reconciling their children and so on.\n *\n * 3. Check, for both windows, to see if the element at the beginning of the\n * window corresponds to the element at the end of the other window. This is\n * a heuristic which will let us identify _some_ situations in which\n * elements have changed position, for instance it _should_ detect that the\n * children nodes themselves have not changed but merely moved in the\n * following example:\n *\n * oldVNode: `

`\n * newVNode: `
`\n *\n * If we find cases like this then we also need to move the concrete DOM\n * elements corresponding to the moved children to write the re-order to the\n * DOM.\n *\n * 4. Finally, if VNodes have the `key` attribute set on them we check for any\n * nodes in the old children which have the same key as the first element in\n * our window on the new children. If we find such a node we handle calling\n * out to `patch`, moving relevant DOM nodes, and so on, in accordance with\n * what we find.\n *\n * Finally, once we've narrowed our 'windows' to the point that either of them\n * collapse (i.e. they have length 0) we then handle any remaining VNode\n * insertion or deletion that needs to happen to get a DOM state that correctly\n * reflects the new child VNodes. If, for instance, after our window on the old\n * children has collapsed we still have more nodes on the new children that\n * we haven't dealt with yet then we need to add them, or if the new children\n * collapse but we still have unhandled _old_ children then we need to make\n * sure the corresponding DOM nodes are removed.\n *\n * @param parentElm the node into which the parent VNode is rendered\n * @param oldCh the old children of the parent node\n * @param newVNode the new VNode which will replace the parent\n * @param newCh the new children of the parent node\n */\nconst updateChildren = (parentElm, oldCh, newVNode, newCh) => {\n let oldStartIdx = 0;\n let newStartIdx = 0;\n let idxInOld = 0;\n let i = 0;\n let oldEndIdx = oldCh.length - 1;\n let oldStartVnode = oldCh[0];\n let oldEndVnode = oldCh[oldEndIdx];\n let newEndIdx = newCh.length - 1;\n let newStartVnode = newCh[0];\n let newEndVnode = newCh[newEndIdx];\n let node;\n let elmToMove;\n while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {\n if (oldStartVnode == null) {\n // VNode might have been moved left\n oldStartVnode = oldCh[++oldStartIdx];\n }\n else if (oldEndVnode == null) {\n oldEndVnode = oldCh[--oldEndIdx];\n }\n else if (newStartVnode == null) {\n newStartVnode = newCh[++newStartIdx];\n }\n else if (newEndVnode == null) {\n newEndVnode = newCh[--newEndIdx];\n }\n else if (isSameVnode(oldStartVnode, newStartVnode)) {\n // if the start nodes are the same then we should patch the new VNode\n // onto the old one, and increment our `newStartIdx` and `oldStartIdx`\n // indices to reflect that. We don't need to move any DOM Nodes around\n // since things are matched up in order.\n patch(oldStartVnode, newStartVnode);\n oldStartVnode = oldCh[++oldStartIdx];\n newStartVnode = newCh[++newStartIdx];\n }\n else if (isSameVnode(oldEndVnode, newEndVnode)) {\n // likewise, if the end nodes are the same we patch new onto old and\n // decrement our end indices, and also likewise in this case we don't\n // need to move any DOM Nodes.\n patch(oldEndVnode, newEndVnode);\n oldEndVnode = oldCh[--oldEndIdx];\n newEndVnode = newCh[--newEndIdx];\n }\n else if (isSameVnode(oldStartVnode, newEndVnode)) {\n // case: \"Vnode moved right\"\n //\n // We've found that the last node in our window on the new children is\n // the same VNode as the _first_ node in our window on the old children\n // we're dealing with now. Visually, this is the layout of these two\n // nodes:\n //\n // newCh: [..., newStartVnode , ... , newEndVnode , ...]\n // ^^^^^^^^^^^\n // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]\n // ^^^^^^^^^^^^^\n //\n // In this situation we need to patch `newEndVnode` onto `oldStartVnode`\n // and move the DOM element for `oldStartVnode`.\n if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {\n putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);\n }\n patch(oldStartVnode, newEndVnode);\n // We need to move the element for `oldStartVnode` into a position which\n // will be appropriate for `newEndVnode`. For this we can use\n // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a\n // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for\n // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:\n //\n // \n // \n // \n // \n // \n // \n // ```\n // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback\n // will be called with `newValue = \"some-value\"` and will set the shadowed property (this.someAttribute = \"another-value\")\n // to the value that was set inline i.e. \"some-value\" from above example. When\n // the connectedCallback attempts to unshadow it will use \"some-value\" as the initial value rather than \"another-value\"\n //\n // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed\n // by connectedCallback as this attributeChangedCallback will not fire.\n //\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n //\n // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to\n // properties here given that this goes against best practices outlined here\n // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy\n if (this.hasOwnProperty(propName)) {\n newValue = this[propName];\n delete this[propName];\n }\n else if (prototype.hasOwnProperty(propName) &&\n typeof this[propName] === 'number' &&\n this[propName] == newValue) {\n // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native\n // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in\n // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.\n return;\n }\n this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;\n });\n };\n // create an array of attributes to observe\n // and also create a map of html attribute name to js property name\n Cstr.observedAttributes = members\n .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes\n .map(([propName, m]) => {\n const attrName = m[1] || propName;\n attrNameToPropName.set(attrName, propName);\n if (BUILD.reflect && m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {\n cmpMeta.$attrsToReflect$.push([propName, attrName]);\n }\n return attrName;\n });\n }\n }\n return Cstr;\n};\nconst initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {\n // initializeComponent\n if ((BUILD.lazyLoad || BUILD.hydrateServerSide || BUILD.style) &&\n (hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {\n if (BUILD.lazyLoad || BUILD.hydrateClientSide) {\n // we haven't initialized this element yet\n hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;\n // lazy loaded components\n // request the component's implementation to be\n // wired up with the host element\n Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);\n if (Cstr.then) {\n // Await creates a micro-task avoid if possible\n const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);\n Cstr = await Cstr;\n endLoad();\n }\n if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {\n throw new Error(`Constructor for \"${cmpMeta.$tagName$}#${hostRef.$modeName$}\" was not found`);\n }\n if (BUILD.member && !Cstr.isProxied) {\n // we've never proxied this Constructor before\n // let's add the getters/setters to its prototype before\n // the first time we create an instance of the implementation\n if (BUILD.watchCallback) {\n cmpMeta.$watchers$ = Cstr.watchers;\n }\n proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);\n Cstr.isProxied = true;\n }\n const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);\n // ok, time to construct the instance\n // but let's keep track of when we start and stop\n // so that the getters/setters don't incorrectly step on data\n if (BUILD.member) {\n hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;\n }\n // construct the lazy-loaded component implementation\n // passing the hostRef is very important during\n // construction in order to directly wire together the\n // host element and the lazy-loaded instance\n try {\n new Cstr(hostRef);\n }\n catch (e) {\n consoleError(e);\n }\n if (BUILD.member) {\n hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;\n }\n if (BUILD.watchCallback) {\n hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;\n }\n endNewInstance();\n fireConnectedCallback(hostRef.$lazyInstance$);\n }\n else {\n // sync constructor component\n Cstr = elm.constructor;\n hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;\n // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,\n // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_\n // Stencil has completed instantiating the component.\n customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));\n }\n if (BUILD.style && Cstr.style) {\n // this component has styles but we haven't registered them yet\n let style = Cstr.style;\n if (BUILD.mode && typeof style !== 'string') {\n style = style[(hostRef.$modeName$ = computeMode(elm))];\n if (BUILD.hydrateServerSide && hostRef.$modeName$) {\n elm.setAttribute('s-mode', hostRef.$modeName$);\n }\n }\n const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);\n if (!styles.has(scopeId)) {\n const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);\n if (!BUILD.hydrateServerSide &&\n BUILD.shadowDom &&\n BUILD.shadowDomShim &&\n cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {\n style = await import('./shadow-css.js').then((m) => m.scopeCss(style, scopeId, false));\n }\n registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));\n endRegisterStyles();\n }\n }\n }\n // we've successfully created a lazy instance\n const ancestorComponent = hostRef.$ancestorComponent$;\n const schedule = () => scheduleUpdate(hostRef, true);\n if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {\n // this is the initial load and this component it has an ancestor component\n // but the ancestor component has NOT fired its will update lifecycle yet\n // so let's just cool our jets and wait for the ancestor to continue first\n // this will get fired off when the ancestor component\n // finally gets around to rendering its lazy self\n // fire off the initial update\n ancestorComponent['s-rc'].push(schedule);\n }\n else {\n schedule();\n }\n};\nconst fireConnectedCallback = (instance) => {\n if (BUILD.lazyLoad && BUILD.connectedCallback) {\n safeCall(instance, 'connectedCallback');\n }\n};\nconst connectedCallback = (elm) => {\n if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {\n const hostRef = getHostRef(elm);\n const cmpMeta = hostRef.$cmpMeta$;\n const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);\n if (BUILD.hostListenerTargetParent) {\n // only run if we have listeners being attached to a parent\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);\n }\n if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {\n // first time this component has connected\n hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;\n let hostId;\n if (BUILD.hydrateClientSide) {\n hostId = elm.getAttribute(HYDRATE_ID);\n if (hostId) {\n if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {\n const scopeId = BUILD.mode\n ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))\n : addStyle(elm.shadowRoot, cmpMeta);\n elm.classList.remove(scopeId + '-h', scopeId + '-s');\n }\n initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);\n }\n }\n if (BUILD.slotRelocation && !hostId) {\n // initUpdate\n // if the slot polyfill is required we'll need to put some nodes\n // in here to act as original content anchors as we move nodes around\n // host element has been connected to the DOM\n if (BUILD.hydrateServerSide ||\n ((BUILD.slot || BUILD.shadowDom) &&\n cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {\n setContentReference(elm);\n }\n }\n if (BUILD.asyncLoading) {\n // find the first ancestor component (if there is one) and register\n // this component as one of the actively loading child components for its ancestor\n let ancestorComponent = elm;\n while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {\n // climb up the ancestors looking for the first\n // component that hasn't finished its lifecycle update yet\n if ((BUILD.hydrateClientSide &&\n ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&\n ancestorComponent.hasAttribute('s-id') &&\n ancestorComponent['s-p']) ||\n ancestorComponent['s-p']) {\n // we found this components first ancestor component\n // keep a reference to this component's ancestor component\n attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));\n break;\n }\n }\n }\n // Lazy properties\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {\n Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {\n if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {\n const value = elm[memberName];\n delete elm[memberName];\n elm[memberName] = value;\n }\n });\n }\n if (BUILD.initializeNextTick) {\n // connectedCallback, taskQueue, initialLoad\n // angular sets attribute AFTER connectCallback\n // https://github.com/angular/angular/issues/18909\n // https://github.com/angular/angular/issues/19940\n nextTick(() => initializeComponent(elm, hostRef, cmpMeta));\n }\n else {\n initializeComponent(elm, hostRef, cmpMeta);\n }\n }\n else {\n // not the first time this has connected\n // reattach any event listeners to the host\n // since they would have been removed when disconnected\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);\n // fire off connectedCallback() on component instance\n fireConnectedCallback(hostRef.$lazyInstance$);\n }\n endConnected();\n }\n};\nconst setContentReference = (elm) => {\n // only required when we're NOT using native shadow dom (slot)\n // or this browser doesn't support native shadow dom\n // and this host element was NOT created with SSR\n // let's pick out the inner content for slot projection\n // create a node to represent where the original\n // content was first placed, which is useful later on\n const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));\n contentRefElm['s-cn'] = true;\n elm.insertBefore(contentRefElm, elm.firstChild);\n};\nconst disconnectedCallback = (elm) => {\n if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {\n const hostRef = getHostRef(elm);\n const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;\n if (BUILD.hostListener) {\n if (hostRef.$rmListeners$) {\n hostRef.$rmListeners$.map((rmListener) => rmListener());\n hostRef.$rmListeners$ = undefined;\n }\n }\n // clear CSS var-shim tracking\n if (BUILD.cssVarShim && plt.$cssShim$) {\n plt.$cssShim$.removeHost(elm);\n }\n if (BUILD.lazyLoad && BUILD.disconnectedCallback) {\n safeCall(instance, 'disconnectedCallback');\n }\n if (BUILD.cmpDidUnload) {\n safeCall(instance, 'componentDidUnload');\n }\n }\n};\nconst defineCustomElement = (Cstr, compactMeta) => {\n customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));\n};\nconst proxyCustomElement = (Cstr, compactMeta) => {\n const cmpMeta = {\n $flags$: compactMeta[0],\n $tagName$: compactMeta[1],\n };\n if (BUILD.member) {\n cmpMeta.$members$ = compactMeta[2];\n }\n if (BUILD.hostListener) {\n cmpMeta.$listeners$ = compactMeta[3];\n }\n if (BUILD.watchCallback) {\n cmpMeta.$watchers$ = Cstr.$watchers$;\n }\n if (BUILD.reflect) {\n cmpMeta.$attrsToReflect$ = [];\n }\n if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {\n cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;\n }\n const originalConnectedCallback = Cstr.prototype.connectedCallback;\n const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;\n Object.assign(Cstr.prototype, {\n __registerHost() {\n registerHost(this, cmpMeta);\n },\n connectedCallback() {\n connectedCallback(this);\n if (BUILD.connectedCallback && originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n },\n disconnectedCallback() {\n disconnectedCallback(this);\n if (BUILD.disconnectedCallback && originalDisconnectedCallback) {\n originalDisconnectedCallback.call(this);\n }\n },\n __attachShadow() {\n if (supportsShadow) {\n if (BUILD.shadowDelegatesFocus) {\n this.attachShadow({\n mode: 'open',\n delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),\n });\n }\n else {\n this.attachShadow({ mode: 'open' });\n }\n }\n else {\n this.shadowRoot = this;\n }\n },\n });\n Cstr.is = cmpMeta.$tagName$;\n return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);\n};\nconst forceModeUpdate = (elm) => {\n if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {\n const mode = computeMode(elm);\n const hostRef = getHostRef(elm);\n if (hostRef.$modeName$ !== mode) {\n const cmpMeta = hostRef.$cmpMeta$;\n const oldScopeId = elm['s-sc'];\n const scopeId = getScopeId(cmpMeta, mode);\n const style = elm.constructor.style[mode];\n const flags = cmpMeta.$flags$;\n if (style) {\n if (!styles.has(scopeId)) {\n registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));\n }\n hostRef.$modeName$ = mode;\n elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');\n attachStyles(hostRef);\n forceUpdate(elm);\n }\n }\n }\n};\nconst patchCloneNode = (HostElementPrototype) => {\n const orgCloneNode = HostElementPrototype.cloneNode;\n HostElementPrototype.cloneNode = function (deep) {\n const srcNode = this;\n const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;\n const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);\n if (BUILD.slot && !isShadowDom && deep) {\n let i = 0;\n let slotted, nonStencilNode;\n const stencilPrivates = [\n 's-id',\n 's-cr',\n 's-lr',\n 's-rc',\n 's-sc',\n 's-p',\n 's-cn',\n 's-sr',\n 's-sn',\n 's-hn',\n 's-ol',\n 's-nr',\n 's-si',\n ];\n for (; i < srcNode.childNodes.length; i++) {\n slotted = srcNode.childNodes[i]['s-nr'];\n nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);\n if (slotted) {\n if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {\n clonedNode.__appendChild(slotted.cloneNode(true));\n }\n else {\n clonedNode.appendChild(slotted.cloneNode(true));\n }\n }\n if (nonStencilNode) {\n clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nconst patchSlotAppendChild = (HostElementPrototype) => {\n HostElementPrototype.__appendChild = HostElementPrototype.appendChild;\n HostElementPrototype.appendChild = function (newChild) {\n const slotName = (newChild['s-sn'] = getSlotName(newChild));\n const slotNode = getHostSlotNode(this.childNodes, slotName);\n if (slotNode) {\n const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);\n const appendAfter = slotChildNodes[slotChildNodes.length - 1];\n return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);\n }\n return this.__appendChild(newChild);\n };\n};\n/**\n * Patches the text content of an unnamed slotted node inside a scoped component\n * @param hostElementPrototype the `Element` to be patched\n * @param cmpMeta component runtime metadata used to determine if the component should be patched or not\n */\nconst patchTextContent = (hostElementPrototype, cmpMeta) => {\n if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {\n const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');\n Object.defineProperty(hostElementPrototype, '__textContent', descriptor);\n Object.defineProperty(hostElementPrototype, 'textContent', {\n get() {\n var _a;\n // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is\n // the empty string\n const slotNode = getHostSlotNode(this.childNodes, '');\n // when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how\n // nodes were reordered during the vdom render. first try to get the text content from the sibling.\n if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {\n return slotNode.nextSibling.textContent;\n }\n else if (slotNode) {\n return slotNode.textContent;\n }\n else {\n // fallback to the original implementation\n return this.__textContent;\n }\n },\n set(value) {\n var _a;\n // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is\n // the empty string\n const slotNode = getHostSlotNode(this.childNodes, '');\n // when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,\n // depending on how nodes were reordered during the vdom render. first try to set the text content on the\n // sibling.\n if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {\n slotNode.nextSibling.textContent = value;\n }\n else if (slotNode) {\n slotNode.textContent = value;\n }\n else {\n // we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM\n // loaded, we could have missed it. check for a content reference element on the scoped component and insert\n // it there\n this.__textContent = value;\n const contentRefElm = this['s-cr'];\n if (contentRefElm) {\n this.insertBefore(contentRefElm, this.firstChild);\n }\n }\n },\n });\n }\n};\nconst patchChildSlotNodes = (elm, cmpMeta) => {\n class FakeNodeList extends Array {\n item(n) {\n return this[n];\n }\n }\n if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {\n const childNodesFn = elm.__lookupGetter__('childNodes');\n Object.defineProperty(elm, 'children', {\n get() {\n return this.childNodes.map((n) => n.nodeType === 1);\n },\n });\n Object.defineProperty(elm, 'childElementCount', {\n get() {\n return elm.children.length;\n },\n });\n Object.defineProperty(elm, 'childNodes', {\n get() {\n const childNodes = childNodesFn.call(this);\n if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&\n getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {\n const result = new FakeNodeList();\n for (let i = 0; i < childNodes.length; i++) {\n const slot = childNodes[i]['s-nr'];\n if (slot) {\n result.push(slot);\n }\n }\n return result;\n }\n return FakeNodeList.from(childNodes);\n },\n });\n }\n};\nconst getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';\n/**\n * Recursively searches a series of child nodes for a slot with the provided name.\n * @param childNodes the nodes to search for a slot with a specific name.\n * @param slotName the name of the slot to match on.\n * @returns a reference to the slot node that matches the provided name, `null` otherwise\n */\nconst getHostSlotNode = (childNodes, slotName) => {\n let i = 0;\n let childNode;\n for (; i < childNodes.length; i++) {\n childNode = childNodes[i];\n if (childNode['s-sr'] && childNode['s-sn'] === slotName) {\n return childNode;\n }\n childNode = getHostSlotNode(childNode.childNodes, slotName);\n if (childNode) {\n return childNode;\n }\n }\n return null;\n};\nconst getHostSlotChildNodes = (n, slotName) => {\n const childNodes = [n];\n while ((n = n.nextSibling) && n['s-sn'] === slotName) {\n childNodes.push(n);\n }\n return childNodes;\n};\nconst hmrStart = (elm, cmpMeta, hmrVersionId) => {\n // ¯\\_(ツ)_/¯\n const hostRef = getHostRef(elm);\n // reset state flags to only have been connected\n hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;\n // TODO\n // detatch any event listeners that may have been added\n // because we're not passing an exact event name it'll\n // remove all of this element's event, which is good\n // create a callback for when this component finishes hmr\n elm['s-hmr-load'] = () => {\n // finished hmr for this element\n delete elm['s-hmr-load'];\n };\n // re-initialize the component\n initializeComponent(elm, hostRef, cmpMeta, hmrVersionId);\n};\nconst bootstrapLazy = (lazyBundles, options = {}) => {\n var _a;\n if (BUILD.profile && performance.mark) {\n performance.mark('st:app:start');\n }\n installDevTools();\n const endBootstrap = createTime('bootstrapLazy');\n const cmpTags = [];\n const exclude = options.exclude || [];\n const customElements = win.customElements;\n const head = doc.head;\n const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');\n const visibilityStyle = /*@__PURE__*/ doc.createElement('style');\n const deferredConnectedCallbacks = [];\n const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);\n let appLoadFallback;\n let isBootstrapping = true;\n let i = 0;\n Object.assign(plt, options);\n plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;\n if (BUILD.asyncQueue) {\n if (options.syncQueue) {\n plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;\n }\n }\n if (BUILD.hydrateClientSide) {\n // If the app is already hydrated there is not point to disable the\n // async queue. This will improve the first input delay\n plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;\n }\n if (BUILD.hydrateClientSide && BUILD.shadowDom) {\n for (; i < styles.length; i++) {\n registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);\n }\n }\n lazyBundles.map((lazyBundle) => {\n lazyBundle[1].map((compactMeta) => {\n const cmpMeta = {\n $flags$: compactMeta[0],\n $tagName$: compactMeta[1],\n $members$: compactMeta[2],\n $listeners$: compactMeta[3],\n };\n if (BUILD.member) {\n cmpMeta.$members$ = compactMeta[2];\n }\n if (BUILD.hostListener) {\n cmpMeta.$listeners$ = compactMeta[3];\n }\n if (BUILD.reflect) {\n cmpMeta.$attrsToReflect$ = [];\n }\n if (BUILD.watchCallback) {\n cmpMeta.$watchers$ = {};\n }\n if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {\n cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;\n }\n const tagName = BUILD.transformTagName && options.transformTagName\n ? options.transformTagName(cmpMeta.$tagName$)\n : cmpMeta.$tagName$;\n const HostElement = class extends HTMLElement {\n // StencilLazyHost\n constructor(self) {\n // @ts-ignore\n super(self);\n self = this;\n registerHost(self, cmpMeta);\n if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {\n // this component is using shadow dom\n // and this browser supports shadow dom\n // add the read-only property \"shadowRoot\" to the host element\n // adding the shadow root build conditionals to minimize runtime\n if (supportsShadow) {\n if (BUILD.shadowDelegatesFocus) {\n self.attachShadow({\n mode: 'open',\n delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),\n });\n }\n else {\n self.attachShadow({ mode: 'open' });\n }\n }\n else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {\n self.shadowRoot = self;\n }\n }\n if (BUILD.slotChildNodesFix) {\n patchChildSlotNodes(self, cmpMeta);\n }\n }\n connectedCallback() {\n if (appLoadFallback) {\n clearTimeout(appLoadFallback);\n appLoadFallback = null;\n }\n if (isBootstrapping) {\n // connectedCallback will be processed once all components have been registered\n deferredConnectedCallbacks.push(this);\n }\n else {\n plt.jmp(() => connectedCallback(this));\n }\n }\n disconnectedCallback() {\n plt.jmp(() => disconnectedCallback(this));\n }\n componentOnReady() {\n return getHostRef(this).$onReadyPromise$;\n }\n };\n if (BUILD.cloneNodeFix) {\n patchCloneNode(HostElement.prototype);\n }\n if (BUILD.appendChildSlotFix) {\n patchSlotAppendChild(HostElement.prototype);\n }\n if (BUILD.hotModuleReplacement) {\n HostElement.prototype['s-hmr'] = function (hmrVersionId) {\n hmrStart(this, cmpMeta, hmrVersionId);\n };\n }\n if (BUILD.scopedSlotTextContentFix) {\n patchTextContent(HostElement.prototype, cmpMeta);\n }\n cmpMeta.$lazyBundleId$ = lazyBundle[0];\n if (!exclude.includes(tagName) && !customElements.get(tagName)) {\n cmpTags.push(tagName);\n customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));\n }\n });\n });\n if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {\n visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;\n visibilityStyle.setAttribute('data-styles', '');\n // Apply CSP nonce to the style tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n visibilityStyle.setAttribute('nonce', nonce);\n }\n head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);\n }\n // Process deferred connectedCallbacks now all components have been registered\n isBootstrapping = false;\n if (deferredConnectedCallbacks.length) {\n deferredConnectedCallbacks.map((host) => host.connectedCallback());\n }\n else {\n if (BUILD.profile) {\n plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));\n }\n else {\n plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));\n }\n }\n // Fallback appLoad event\n endBootstrap();\n};\nconst getConnect = (_ref, tagName) => {\n const componentOnReady = () => {\n let elm = doc.querySelector(tagName);\n if (!elm) {\n elm = doc.createElement(tagName);\n doc.body.appendChild(elm);\n }\n return typeof elm.componentOnReady === 'function' ? elm.componentOnReady() : Promise.resolve(elm);\n };\n const create = (...args) => {\n return componentOnReady().then((el) => el.create(...args));\n };\n return {\n create,\n componentOnReady,\n };\n};\nconst getContext = (_elm, context) => {\n if (context in Context) {\n return Context[context];\n }\n else if (context === 'window') {\n return win;\n }\n else if (context === 'document') {\n return doc;\n }\n else if (context === 'isServer' || context === 'isPrerender') {\n return BUILD.hydrateServerSide ? true : false;\n }\n else if (context === 'isClient') {\n return BUILD.hydrateServerSide ? false : true;\n }\n else if (context === 'resourcesUrl' || context === 'publicPath') {\n return getAssetPath('.');\n }\n else if (context === 'queue') {\n return {\n write: writeTask,\n read: readTask,\n tick: {\n then(cb) {\n return nextTick(cb);\n },\n },\n };\n }\n return undefined;\n};\nconst Fragment = (_, children) => children;\nconst addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {\n if (BUILD.hostListener && listeners) {\n // this is called immediately within the element's constructor\n // initialize our event listeners on the host element\n // we do this now so that we can listen to events that may\n // have fired even before the instance is ready\n if (BUILD.hostListenerTargetParent) {\n // this component may have event listeners that should be attached to the parent\n if (attachParentListeners) {\n // this is being ran from within the connectedCallback\n // which is important so that we know the host element actually has a parent element\n // filter out the listeners to only have the ones that ARE being attached to the parent\n listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);\n }\n else {\n // this is being ran from within the component constructor\n // everything BUT the parent element listeners should be attached at this time\n // filter out the listeners that are NOT being attached to the parent\n listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));\n }\n }\n listeners.map(([flags, name, method]) => {\n const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;\n const handler = hostListenerProxy(hostRef, method);\n const opts = hostListenerOpts(flags);\n plt.ael(target, name, handler, opts);\n (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));\n });\n }\n};\nconst hostListenerProxy = (hostRef, methodName) => (ev) => {\n try {\n if (BUILD.lazyLoad) {\n if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {\n // instance is ready, let's call it's member method for this event\n hostRef.$lazyInstance$[methodName](ev);\n }\n else {\n (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);\n }\n }\n else {\n hostRef.$hostElement$[methodName](ev);\n }\n }\n catch (e) {\n consoleError(e);\n }\n};\nconst getHostListenerTarget = (elm, flags) => {\n if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)\n return doc;\n if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)\n return win;\n if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)\n return doc.body;\n if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)\n return elm.parentElement;\n return elm;\n};\n// prettier-ignore\nconst hostListenerOpts = (flags) => supportsListenerOptions\n ? ({\n passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,\n capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,\n })\n : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;\n/**\n * Assigns the given value to the nonce property on the runtime platform object.\n * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.\n * @param nonce The value to be assigned to the platform nonce property.\n * @returns void\n */\nconst setNonce = (nonce) => (plt.$nonce$ = nonce);\nconst setPlatformOptions = (opts) => Object.assign(plt, opts);\nconst insertVdomAnnotations = (doc, staticComponents) => {\n if (doc != null) {\n const docData = {\n hostIds: 0,\n rootLevelIds: 0,\n staticComponents: new Set(staticComponents),\n };\n const orgLocationNodes = [];\n parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);\n orgLocationNodes.forEach((orgLocationNode) => {\n if (orgLocationNode != null) {\n const nodeRef = orgLocationNode['s-nr'];\n let hostId = nodeRef['s-host-id'];\n let nodeId = nodeRef['s-node-id'];\n let childId = `${hostId}.${nodeId}`;\n if (hostId == null) {\n hostId = 0;\n docData.rootLevelIds++;\n nodeId = docData.rootLevelIds;\n childId = `${hostId}.${nodeId}`;\n if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {\n nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);\n }\n else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {\n if (hostId === 0) {\n const textContent = nodeRef.nodeValue.trim();\n if (textContent === '') {\n // useless whitespace node at the document root\n orgLocationNode.remove();\n return;\n }\n }\n const commentBeforeTextNode = doc.createComment(childId);\n commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;\n nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);\n }\n }\n let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;\n const orgLocationParentNode = orgLocationNode.parentElement;\n if (orgLocationParentNode) {\n if (orgLocationParentNode['s-en'] === '') {\n // ending with a \".\" means that the parent element\n // of this node's original location is a SHADOW dom element\n // and this node is apart of the root level light dom\n orgLocationNodeId += `.`;\n }\n else if (orgLocationParentNode['s-en'] === 'c') {\n // ending with a \".c\" means that the parent element\n // of this node's original location is a SCOPED element\n // and this node is apart of the root level light dom\n orgLocationNodeId += `.c`;\n }\n }\n orgLocationNode.nodeValue = orgLocationNodeId;\n }\n });\n }\n};\nconst parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {\n if (node == null) {\n return;\n }\n if (node['s-nr'] != null) {\n orgLocationNodes.push(node);\n }\n if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {\n node.childNodes.forEach((childNode) => {\n const hostRef = getHostRef(childNode);\n if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {\n const cmpData = {\n nodeIds: 0,\n };\n insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);\n }\n parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);\n });\n }\n};\nconst insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {\n if (vnode != null) {\n const hostId = ++docData.hostIds;\n hostElm.setAttribute(HYDRATE_ID, hostId);\n if (hostElm['s-cr'] != null) {\n hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;\n }\n if (vnode.$children$ != null) {\n const depth = 0;\n vnode.$children$.forEach((vnodeChild, index) => {\n insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);\n });\n }\n if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute('c-id')) {\n const parent = hostElm.parentElement;\n if (parent && parent.childNodes) {\n const parentChildNodes = Array.from(parent.childNodes);\n const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);\n if (comment) {\n const index = parentChildNodes.indexOf(hostElm) - 1;\n vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);\n }\n }\n }\n }\n};\nconst insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {\n const childElm = vnodeChild.$elm$;\n if (childElm == null) {\n return;\n }\n const nodeId = cmpData.nodeIds++;\n const childId = `${hostId}.${nodeId}.${depth}.${index}`;\n childElm['s-host-id'] = hostId;\n childElm['s-node-id'] = nodeId;\n if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {\n childElm.setAttribute(HYDRATE_CHILD_ID, childId);\n }\n else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {\n const parentNode = childElm.parentNode;\n const nodeName = parentNode.nodeName;\n if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {\n const textNodeId = `${TEXT_NODE_ID}.${childId}`;\n const commentBeforeTextNode = doc.createComment(textNodeId);\n parentNode.insertBefore(commentBeforeTextNode, childElm);\n }\n }\n else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {\n if (childElm['s-sr']) {\n const slotName = childElm['s-sn'] || '';\n const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;\n childElm.nodeValue = slotNodeId;\n }\n }\n if (vnodeChild.$children$ != null) {\n const childDepth = depth + 1;\n vnodeChild.$children$.forEach((vnode, index) => {\n insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);\n });\n }\n};\nconst hostRefs = /*@__PURE__*/ new WeakMap();\nconst getHostRef = (ref) => hostRefs.get(ref);\nconst registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);\nconst registerHost = (elm, cmpMeta) => {\n const hostRef = {\n $flags$: 0,\n $hostElement$: elm,\n $cmpMeta$: cmpMeta,\n $instanceValues$: new Map(),\n };\n if (BUILD.isDev) {\n hostRef.$renderCount$ = 0;\n }\n if (BUILD.method && BUILD.lazyLoad) {\n hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));\n }\n if (BUILD.asyncLoading) {\n hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));\n elm['s-p'] = [];\n elm['s-rc'] = [];\n }\n addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);\n return hostRefs.set(elm, hostRef);\n};\nconst isMemberInElement = (elm, memberName) => memberName in elm;\nconst consoleError = (e, el) => (customError || console.error)(e, el);\nconst STENCIL_DEV_MODE = BUILD.isTesting\n ? ['STENCIL:'] // E2E testing\n : [\n '%cstencil',\n 'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',\n ];\nconst consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);\nconst consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);\nconst consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);\nconst setErrorHandler = (handler) => (customError = handler);\nconst cmpModules = /*@__PURE__*/ new Map();\nconst loadModule = (cmpMeta, hostRef, hmrVersionId) => {\n // loadModuleImport\n const exportName = cmpMeta.$tagName$.replace(/-/g, '_');\n const bundleId = cmpMeta.$lazyBundleId$;\n if (BUILD.isDev && typeof bundleId !== 'string') {\n consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode \"${hostRef.$modeName$}\", but it does not exist.`);\n return undefined;\n }\n const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;\n if (module) {\n return module[exportName];\n }\n /*!__STENCIL_STATIC_IMPORT_SWITCH__*/\n return import(\n /* @vite-ignore */\n /* webpackInclude: /\\.entry\\.js$/ */\n /* webpackExclude: /\\.system\\.entry\\.js$/ */\n /* webpackMode: \"lazy\" */\n `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {\n if (!BUILD.hotModuleReplacement) {\n cmpModules.set(bundleId, importedModule);\n }\n return importedModule[exportName];\n }, consoleError);\n};\nconst styles = /*@__PURE__*/ new Map();\nconst modeResolutionChain = [];\nconst win = typeof window !== 'undefined' ? window : {};\nconst CSS = BUILD.cssVarShim ? win.CSS : null;\nconst doc = win.document || { head: {} };\nconst H = (win.HTMLElement || class {\n});\nconst plt = {\n $flags$: 0,\n $resourcesUrl$: '',\n jmp: (h) => h(),\n raf: (h) => requestAnimationFrame(h),\n ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),\n rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),\n ce: (eventName, opts) => new CustomEvent(eventName, opts),\n};\nconst setPlatformHelpers = (helpers) => {\n Object.assign(plt, helpers);\n};\nconst supportsShadow = BUILD.shadowDomShim && BUILD.shadowDom\n ? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()\n : true;\nconst supportsListenerOptions = /*@__PURE__*/ (() => {\n let supportsListenerOptions = false;\n try {\n doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {\n get() {\n supportsListenerOptions = true;\n },\n }));\n }\n catch (e) { }\n return supportsListenerOptions;\n})();\nconst promiseResolve = (v) => Promise.resolve(v);\nconst supportsConstructableStylesheets = BUILD.constructableCSS\n ? /*@__PURE__*/ (() => {\n try {\n new CSSStyleSheet();\n return typeof new CSSStyleSheet().replaceSync === 'function';\n }\n catch (e) { }\n return false;\n })()\n : false;\nconst queueDomReads = [];\nconst queueDomWrites = [];\nconst queueDomWritesLow = [];\nconst queueTask = (queue, write) => (cb) => {\n queue.push(cb);\n if (!queuePending) {\n queuePending = true;\n if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {\n nextTick(flush);\n }\n else {\n plt.raf(flush);\n }\n }\n};\nconst consume = (queue) => {\n for (let i = 0; i < queue.length; i++) {\n try {\n queue[i](performance.now());\n }\n catch (e) {\n consoleError(e);\n }\n }\n queue.length = 0;\n};\nconst consumeTimeout = (queue, timeout) => {\n let i = 0;\n let ts = 0;\n while (i < queue.length && (ts = performance.now()) < timeout) {\n try {\n queue[i++](ts);\n }\n catch (e) {\n consoleError(e);\n }\n }\n if (i === queue.length) {\n queue.length = 0;\n }\n else if (i !== 0) {\n queue.splice(0, i);\n }\n};\nconst flush = () => {\n if (BUILD.asyncQueue) {\n queueCongestion++;\n }\n // always force a bunch of medium callbacks to run, but still have\n // a throttle on how many can run in a certain time\n // DOM READS!!!\n consume(queueDomReads);\n // DOM WRITES!!!\n if (BUILD.asyncQueue) {\n const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */\n ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))\n : Infinity;\n consumeTimeout(queueDomWrites, timeout);\n consumeTimeout(queueDomWritesLow, timeout);\n if (queueDomWrites.length > 0) {\n queueDomWritesLow.push(...queueDomWrites);\n queueDomWrites.length = 0;\n }\n if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {\n // still more to do yet, but we've run out of time\n // let's let this thing cool off and try again in the next tick\n plt.raf(flush);\n }\n else {\n queueCongestion = 0;\n }\n }\n else {\n consume(queueDomWrites);\n if ((queuePending = queueDomReads.length > 0)) {\n // still more to do yet, but we've run out of time\n // let's let this thing cool off and try again in the next tick\n plt.raf(flush);\n }\n }\n};\nconst nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);\nconst readTask = /*@__PURE__*/ queueTask(queueDomReads, false);\nconst writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);\nexport { BUILD, Env, NAMESPACE } from '@stencil/core/internal/app-data';\nexport { Build, CSS, Context, Fragment, H, H as HTMLElement, Host, STENCIL_DEV_MODE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nfunction gen(counts) {\n return counts\n .map((count) => {\n let out = \"\";\n for (let i = 0; i < count; i++) {\n out += (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\n }\n return out;\n })\n .join(\"-\");\n}\nconst guid = () => gen([2, 1, 1, 1, 3]);\n\nexport { guid as g };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { g as guid } from './guid.js';\n\nconst autoMode = \"calcite-mode-auto\";\nconst darkMode = \"calcite-mode-dark\";\nconst lightMode = \"calcite-mode-light\";\nconst CSS_UTILITY = {\n autoMode,\n darkMode,\n lightMode,\n rtl: \"calcite--rtl\",\n calciteAnimate: \"calcite-animate\",\n calciteAnimateIn: \"calcite-animate__in\",\n calciteAnimateInUp: \"calcite-animate__in-up\",\n calciteAnimateInDown: \"calcite-animate__in-down\",\n calciteAnimateInRight: \"calcite-animate__in-right\",\n calciteAnimateInLeft: \"calcite-animate__in-left\",\n calciteAnimateInScale: \"calcite-animate__in-scale\",\n};\n\n/*!\n* tabbable 6.2.0\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\n// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\n// CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes\n// the entire query to fail, resulting in no nodes found, which will break a lot\n// of things... so we have to rely on JS to identify nodes inside an inert container\nvar candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable=\"false\"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode$1 = !NoElement && Element.prototype.getRootNode ? function (element) {\n var _element$getRootNode;\n return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);\n} : function (element) {\n return element === null || element === void 0 ? void 0 : element.ownerDocument;\n};\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Element} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nvar isInert = function isInert(node, lookUp) {\n var _node$getAttribute;\n if (lookUp === void 0) {\n lookUp = true;\n }\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');\n var inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`\n // so it likely would not support `:is([inert] *)` either...\n var result = inert || lookUp && node && isInert(node.parentNode); // recursive\n\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nvar isContentEditable = function isContentEditable(node) {\n var _node$getAttribute2;\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert, all its children are inert\n if (isInert(el)) {\n return [];\n }\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nvar hasTabIndex = function hasTabIndex(node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nvar getTabIndex = function getTabIndex(node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (node.tabIndex < 0) {\n // in Chrome,
,
\n )}\n \n );\n}\n\nexport default Admin2Chart;\n","import React from 'react';\n\n// Styles\nimport './SidebarTitle.scss';\n\nfunction SidebarTitle({ title }: { title: string }) {\n return

{title}

;\n}\n\nexport default SidebarTitle;\n","import React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FormControl, FormControlLabel, Radio, RadioGroup } from '@mui/material';\n\n// Store\nimport { $adminSelected, setAdminSelected } from '../../../store/slices/sidebarMapFiltersSlice';\nimport { $mapLayersUpdating } from '../../../store/slices/mapSlice';\n\n// Configs\nimport { SIDEBAR_MAP_ADMIN_FILTERS } from '../../../configs/map.configs';\nimport { RADIO_BUTTON_STYLE } from '../../../configs/muiStyling.config';\nimport { SidebarMapFiltersType } from '../../../configs/types';\n\nfunction SidebarMapAdmins() {\n const dispatch = useDispatch();\n const adminSelected = useSelector($adminSelected);\n const mapLayersUpdating = useSelector($mapLayersUpdating);\n\n const handleSidebarMapAdminFilters = (event: any) => {\n const adminSelected = event.target.value;\n dispatch(setAdminSelected(adminSelected));\n };\n\n return (\n
\n
\n \n \n {SIDEBAR_MAP_ADMIN_FILTERS.map((admin: SidebarMapFiltersType) => {\n const { label, value, tooltip } = admin;\n\n return (\n }\n disabled={mapLayersUpdating}\n />\n );\n })}\n \n \n
\n
\n );\n}\n\nexport default SidebarMapAdmins;\n","import React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\n// Store\nimport {\n $rendererClassificationMethod,\n RendererClassificationMethodType,\n setRendererClassificationMethod,\n} from '../../store/slices/sidebarMapFiltersSlice';\n\n// Configs\nimport {\n RENDERER_CLASSIFICATION_METHODS,\n RendererClassificationMethodsType,\n} from '../../configs/mapRendererClassificationMethods.configs';\n\nconst SELECT_TITLE = 'Classification Method';\n\nfunction RendererClassificationMethodsDropdown() {\n const dispatch = useDispatch();\n const rendererClassificationMethod = useSelector($rendererClassificationMethod);\n\n function handleRendererClassificationMethods(event: any) {\n const { value } = event.target;\n dispatch(setRendererClassificationMethod(value as RendererClassificationMethodType));\n }\n\n return (\n \n {SELECT_TITLE}\n \n {RENDERER_CLASSIFICATION_METHODS.map((step: RendererClassificationMethodsType) => {\n const { value, label } = step;\n\n return (\n \n {label}\n \n );\n })}\n \n \n );\n}\n\nexport default RendererClassificationMethodsDropdown;\n","import React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\n// Store\nimport { $colorRangeSteps, setColorRangeSteps } from '../../store/slices/sidebarMapFiltersSlice';\n\n// Configs\nimport { COLOR_RANGE_STEPS_DROPDOWN } from '../../configs/mapColor.configs';\n\n// Styles\nimport './ColorRangeStepsDropdown.scss';\n\nconst SELECT_TITLE = 'Color Range Steps';\n\nfunction ColorRangeStepsDropdown() {\n const dispatch = useDispatch();\n const colorRangeSteps = useSelector($colorRangeSteps);\n\n function handleColorRangeStepsDropdown(event: any) {\n const { value } = event.target;\n dispatch(setColorRangeSteps(Number(value)));\n }\n\n return (\n
\n \n {SELECT_TITLE}\n \n {COLOR_RANGE_STEPS_DROPDOWN.map((step: number) => {\n return (\n \n {step}\n \n );\n })}\n \n \n
\n );\n}\n\nexport default ColorRangeStepsDropdown;\n","import React from 'react';\nimport _range from 'lodash/range';\n\n// Styles\nimport './ColorRange.scss';\n\nfunction ColorRange({\n set,\n colorRange,\n colorRangeSteps,\n}: {\n set: number;\n colorRange: string[];\n colorRangeSteps: number;\n}) {\n const rangeList = _range(colorRangeSteps + 1);\n\n return (\n <>\n {rangeList &&\n colorRange.map((color: string, index: number) => {\n if (colorRangeSteps > index) {\n return (\n \n );\n }\n })}\n \n );\n}\n\nexport default ColorRange;\n","import React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material';\n\n// Components\nimport ColorRange from '../ColorRange/ColorRange';\n\n// Store\nimport {\n $colorRangeIndexSelected,\n $colorRangeSteps,\n setColorRangeIndexSelected,\n setColorRangeSelected,\n} from '../../store/slices/sidebarMapFiltersSlice';\n\n// Configs\nimport { COLOR_RANGES } from '../../configs/mapColor.configs';\n\n// Styles\nimport './ColorBreaksDropdown.scss';\n\nconst SELECT_TITLE = 'Color Breaks';\n\nfunction ColorBreaksDropdown() {\n const dispatch = useDispatch();\n const colorRangeSteps = useSelector($colorRangeSteps);\n const colorRangeIndexSelected = useSelector($colorRangeIndexSelected);\n\n const handleColorBreaksDropdown = (event: any) => {\n const { value } = event.target;\n dispatch(setColorRangeIndexSelected(value));\n dispatch(setColorRangeSelected(COLOR_RANGES[value].slice(0, colorRangeSteps)));\n };\n\n return (\n
\n \n {SELECT_TITLE}\n \n {COLOR_RANGES.map((colorRange: any, index: number) => {\n return (\n \n \n \n );\n })}\n \n \n
\n );\n}\n\nexport default ColorBreaksDropdown;\n","import React from 'react';\nimport { useSelector } from 'react-redux';\n\n// Components\nimport RendererClassificationMethodsDropdown from '../../RendererClassificationMethods/RendererClassificationMethodsDropdown';\nimport ColorRangeStepsDropdown from '../../ColorRangeSteps/ColorRangeStepsDropdown';\nimport ColorBreaksDropdown from '../../ColorBreaksDropdown/ColorBreaksDropdown';\nimport SidebarMapDisableContainer from '../SidebarMapDisableContainer/SidebarMapDisableContainer';\n\n// Store\nimport { $adminSelected } from '../../../store/slices/sidebarMapFiltersSlice';\n\n// Configs\nimport { ADMIN__5X5km } from '../../../configs/map.configs';\n\n// Styles\nimport './SidebarMapFiltersBreaks.scss';\n\nfunction SidebarMapFiltersBreaks() {\n const adminSelected = useSelector($adminSelected);\n\n return (\n
\n {adminSelected === ADMIN__5X5km && }\n\n
\n

Breaks:

\n
\n \n \n
\n \n
\n
\n );\n}\n\nexport default SidebarMapFiltersBreaks;\n","import React from 'react';\n\n// Components\nimport SidebarTitle from '../SidebarTitle/SidebarTitle';\n\n// Styles\nimport './SidebarMapLegend.scss';\n\nfunction SidebarMapLegend({ mapLegendRef }: { mapLegendRef: React.MutableRefObject }) {\n return (\n
\n \n
\n
\n );\n}\n\nexport default SidebarMapLegend;\n","import React from 'react';\n\n// Styles\nimport './SidebarMapFiltersDivider.scss';\n\nfunction SidebarMapFiltersDivider() {\n return
;\n}\n\nexport default SidebarMapFiltersDivider;\n","import React from 'react';\nimport { useSelector } from 'react-redux';\n\n// Store\nimport { $surveySelected } from '../../store/slices/admin2EstimatesSlice';\n\n// Styles\nimport './Admin2MapNote.scss';\n\nfunction Admin2MapNote() {\n const surveySelected = useSelector($surveySelected);\n\n return (\n <>\n {surveySelected?.ADM0 === 'Mali' && (\n
\n

\n The Kidal region was excluded from the modeling work due to an unusually high number of clusters with\n missing GPS coordinates\n

\n
\n )}\n \n );\n}\n\nexport default Admin2MapNote;\n","import axios from 'axios';\nimport * as query from '@arcgis/core/rest/query';\n\n// Configs\nimport { ADMIN_2_VECTOR_DATA } from '../configs/api.configs';\n\n/**\n * Get the max record count for the admin 2 vector data\n * @param {string} url - The url to the admin 2 vector data\n * @returns {Promise} - The max record count\n */\nconst getMaxRecordCount = async (url: string) => {\n const results = await axios({\n method: 'GET',\n url: url,\n params: {\n f: 'json',\n },\n }).catch((error) => {\n console.error(error);\n });\n\n return results?.data?.maxRecordCount;\n};\n\n/**\n * Get the admin 2 vector data\n * @param {[]} features - The features\n * @param {number} maxRecordCount - The max record count\n */\nexport const getMapServerAdmin2Data: any = async (features: [] = [], maxRecordCount: number | undefined) => {\n if (!maxRecordCount) {\n maxRecordCount = await getMaxRecordCount(ADMIN_2_VECTOR_DATA);\n }\n\n const outFieldsList = [\n 'adm2_name',\n 'adm1_name',\n 'adm0_name',\n 'region_id',\n 'year',\n 'value',\n 'width_ci',\n 'lower_ci',\n 'upper_ci',\n 'pop_estimate',\n 'DHS_CountryCode',\n 'IndicatorID',\n ];\n const queryParams = {\n where: '1=1',\n // outFields: ['*'],\n outFields: [outFieldsList.join()],\n start: features.length,\n num: maxRecordCount,\n };\n\n try {\n const results: __esri.FeatureSet | void = await query.executeQueryJSON(ADMIN_2_VECTOR_DATA, queryParams);\n\n const resultsJSON = results?.toJSON();\n const featuresAll = [...features, ...resultsJSON.features];\n if (results?.exceededTransferLimit === true) {\n return await getMapServerAdmin2Data(featuresAll, maxRecordCount);\n } else {\n return featuresAll;\n }\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseUniq = require('./_baseUniq');\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n}\n\nmodule.exports = uniqWith;\n","import _isEqual from 'lodash/isEqual';\nimport _uniqWithin from 'lodash/uniqWith';\n\n/**\n * Handle survey dropdown list items\n * @param {string} ADM0 - Country name\n * @param {number} year - Survey year\n * @param {string} SurveyType - Survey type\n * @returns {string} - Survey dropdown label value\n */\nexport function getSurveyDropdownLabelValue(ADM0: string, year: number, SurveyType: string): string {\n return `${ADM0} ${SurveyType} ${year}`;\n}\n\n/**\n * Handle survey dropdown list items\n * @param {Object[]} surveyList - List of surveys\n */\nexport function getSurveysListUniq(surveyList: any) {\n return _uniqWithin(surveyList, _isEqual);\n}\n","export const DOWNLOAD_PACKAGE_FROM_S3 = 'https://dhs-sites.s3.amazonaws.com/SDR/admin2/';\n","import React, { useEffect, useRef } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport _orderBy from 'lodash/orderBy';\n\n// Components\nimport SidebarTitle from './SidebarTitle/SidebarTitle';\nimport SidebarMapAdmins from './SidebarMapAdmins/SidebarMapAdmins';\nimport SidebarMapFiltersField from './SidebarMapFiltersType/SidebarMapFiltersField';\nimport SidebarMapFiltersBreaks from './SidebarMapFiltersBreaks/SidebarMapFiltersBreaks';\nimport SidebarMapLegend from './SidebarMapLegend/SidebarMapLegend';\nimport SidebarMapFiltersDivider from './SidebarMapFiltersDivider/SidebarMapFiltersDivider';\nimport Admin2MapNote from '../Admin2MapNote/Admin2MapNote';\n\n// Controllers\nimport mapController from '../../controllers/MapControllers';\n\n// Store\nimport {\n $adminSelected,\n $colorRangeIndexSelected,\n $colorRangeSteps,\n $fieldSelected,\n $rendererClassificationMethod,\n} from '../../store/slices/sidebarMapFiltersSlice';\nimport {\n $indicatorSelected,\n $indicatorsObject,\n $levelSelected,\n $surveySelected,\n LEVEL_ALL,\n setAllSurveys,\n setSurveyList,\n setSurveySelected,\n} from '../../store/slices/admin2EstimatesSlice';\nimport { $mapViewReady } from '../../store/slices/mapSlice';\n\n// Services\nimport { getMapServerAdmin2Data } from '../../services/getMapServerAdmin2Data.service';\nimport { getAdmin2FeaturesData, fetchAdmin2FeaturesWithGeometries } from '../../services/getGeometries.service';\nimport {\n getAllSurveysRasterServicesData,\n AllSurveysRasterServicesObjectType,\n} from '../../services/getSurveyRasterData.service';\n\n// Utils\nimport { getFeatureLayerID, reorderAdminBoundariesLayerToTop } from '../../utils/map.utils';\nimport { handleAdmin1ClientSideFeaturesLayerUpdates } from '../../utils/admin1Map.utils';\nimport { updatePopupTemplateForFieldSelected } from '../../utils/popup.utils';\nimport { getSurveyDropdownLabelValue, getSurveysListUniq } from '../../utils/survey.utils';\n\n// Configs\nimport { ADMIN1_REGION_ID_FIELD, ADMIN__5X5km, ADMIN__Admin1, ADMIN__Admin2 } from '../../configs/map.configs';\nimport {\n ATTRIBUTE_FIELD_ADMIN_0_NAME,\n ATTRIBUTE_FIELD_ADMIN_1_NAME,\n ATTRIBUTE_FIELD_ADMIN_2_NAME,\n ATTRIBUTE_FIELD_COUNTRY_CODE,\n ATTRIBUTE_FIELD_FOR_ESTIMATES,\n ATTRIBUTE_FIELD_FOR_POPULATION,\n ATTRIBUTE_FILED_FOR_UNCERTAINTY,\n} from '../../configs/attributeFields.configs';\nimport { DOWNLOAD_PACKAGE_FROM_S3 } from '../../configs/s3.configs';\n\n// Styles\nimport './Admin2Map.scss';\n\nfunction Admin2Map() {\n const dispatch = useDispatch();\n const mapViewRef = useRef(null);\n const mapLegendRef = useRef(null);\n const surveySelected = useSelector($surveySelected);\n const levelSelected = useSelector($levelSelected);\n const indicatorsObject = useSelector($indicatorsObject);\n const indicatorSelected = useSelector($indicatorSelected);\n\n const mapViewReady = useSelector($mapViewReady);\n const fieldSelected = useSelector($fieldSelected);\n const adminSelected = useSelector($adminSelected);\n const colorRangeSteps = useSelector($colorRangeSteps);\n const colorRangeIndexSelected = useSelector($colorRangeIndexSelected);\n const rendererClassificationMethod = useSelector($rendererClassificationMethod);\n\n useEffect(() => {\n mapController.initializeMap(mapViewRef, mapLegendRef);\n }, [mapViewRef, mapLegendRef]);\n\n useEffect(() => {\n mapController.updateAdminRenderer(mapLegendRef, adminSelected);\n }, [rendererClassificationMethod, colorRangeSteps, colorRangeIndexSelected]);\n\n useEffect(() => {\n getMapServerAdmin2Data().then((features: any) => {\n const surveyList: any = [];\n\n const featuresFilteredList = features?.filter((feature: any) => {\n const { SurveyType = 'DHS', year } = feature?.attributes;\n const admin0 = feature?.attributes[ATTRIBUTE_FIELD_ADMIN_0_NAME];\n const admin1 = feature?.attributes[ATTRIBUTE_FIELD_ADMIN_1_NAME];\n const admin2 = feature?.attributes[ATTRIBUTE_FIELD_ADMIN_2_NAME];\n const dhsCountryCode = feature?.attributes[ATTRIBUTE_FIELD_COUNTRY_CODE];\n\n feature.attributes['DHSCC'] = dhsCountryCode;\n feature.attributes['SurveyType'] = SurveyType;\n feature.attributes[ATTRIBUTE_FIELD_FOR_ESTIMATES] = feature?.attributes['value'] || -1;\n feature.attributes[ATTRIBUTE_FIELD_FOR_POPULATION] = feature?.attributes['pop_estimate'] || -1;\n feature.attributes[ATTRIBUTE_FILED_FOR_UNCERTAINTY] = feature?.attributes['width_ci'] || -1;\n\n if (admin0 && admin1 && admin2) {\n const surveyDropdownLabelValue = getSurveyDropdownLabelValue(admin0, year, SurveyType);\n\n const surveyItem = {\n ADM0: admin0,\n DHSCC: dhsCountryCode,\n SurveyType,\n year,\n value: surveyDropdownLabelValue,\n };\n\n surveyList.push(surveyItem);\n return admin0 && admin1 && admin2;\n }\n });\n\n dispatch(setAllSurveys(featuresFilteredList || []));\n const surveysListUniq = getSurveysListUniq(surveyList);\n\n getAllSurveysRasterServicesData().then((allSurveysRasterServicesObject: AllSurveysRasterServicesObjectType) => {\n const surveysListUniqWithRasterServices = surveysListUniq\n .map((survey: any) => {\n const countryCode = survey['DHSCC'];\n const surveyType = survey['SurveyType'];\n const surveyYear = survey['year'];\n const surveyRasterService = allSurveysRasterServicesObject[countryCode];\n\n const newSurvey = {\n ...survey,\n rasterServiceURL: surveyRasterService?.url,\n downloadPackageFromS3Link: `${DOWNLOAD_PACKAGE_FROM_S3}${countryCode}${surveyType}${surveyYear}_adm2.zip`,\n };\n\n return newSurvey;\n })\n .filter((survey: any) => {\n return Boolean(survey.rasterServiceURL);\n });\n\n const surveysListUniqWithRasterServicesOrdered = _orderBy(surveysListUniqWithRasterServices, ['DHSCC']);\n dispatch(setSurveyList(surveysListUniqWithRasterServicesOrdered));\n dispatch(setSurveySelected(surveysListUniqWithRasterServicesOrdered[0]));\n });\n });\n }, []);\n\n useEffect(() => {\n if (levelSelected) {\n mapController.handleAdmin1Update(adminSelected, levelSelected);\n\n if (mapController?.admin2ClientSideFeaturesLayer && adminSelected === ADMIN__Admin2) {\n const countryCode = surveySelected?.DHSCC;\n const SurveyType = surveySelected?.SurveyType;\n\n if (countryCode && SurveyType) {\n getAdmin2FeaturesData(countryCode, SurveyType).then((admin2FeaturesData) => {\n const indicatorID = indicatorSelected?.value;\n mapController.updateAdmin2Graphic(admin2FeaturesData, indicatorID, surveySelected).then(() => {\n reorderAdminBoundariesLayerToTop();\n });\n });\n }\n }\n }\n }, [levelSelected, adminSelected]);\n\n useEffect(() => {\n mapController.handlePopupMarkerGraphicsLayer(adminSelected);\n mapController.handleAdmin1ClientSideFeaturesLayerVisibility(adminSelected);\n mapController.handleAdmin2ClientSideFeaturesLayerVisibility(adminSelected);\n mapController.handleCountryMapImageLayerVisibility(adminSelected, indicatorSelected, surveySelected, fieldSelected);\n mapController.handleAdmin2ReferenceLayerVisibility(adminSelected);\n }, [adminSelected]);\n\n useEffect(() => {\n if (import.meta.env.MODE === 'development') {\n console.log('indicatorSelected', indicatorSelected);\n }\n\n if (adminSelected === ADMIN__Admin1) {\n handleAdmin1ClientSideFeaturesLayerUpdates(surveySelected, indicatorsObject, indicatorSelected, adminSelected);\n }\n\n if (adminSelected === ADMIN__Admin2) {\n const countryCode = surveySelected?.DHSCC;\n const SurveyType = surveySelected?.SurveyType;\n const countryName = surveySelected?.ADM0;\n const indicatorID = indicatorSelected?.value;\n\n if (countryCode && SurveyType) {\n getAdmin2FeaturesData(countryCode, SurveyType).then((admin2FeaturesData) => {\n if (import.meta.env.MODE === 'development') {\n console.log('admin2FeaturesData:', admin2FeaturesData);\n }\n\n const admin2ClientSideFeaturesLayerID = getFeatureLayerID();\n if (mapController?.admin2ClientSideFeaturesLayer?.id !== admin2ClientSideFeaturesLayerID && countryName) {\n fetchAdmin2FeaturesWithGeometries(countryName).then((admin2FeaturesWithGeometries) => {\n if (import.meta.env.MODE === 'development') {\n console.log(admin2FeaturesWithGeometries);\n }\n\n mapController\n .setAdmin2Graphic(admin2FeaturesData, admin2FeaturesWithGeometries, indicatorID, surveySelected)\n .then(() => {\n mapController.updateAdmin2Graphic(admin2FeaturesData, indicatorID, surveySelected).then(() => {\n reorderAdminBoundariesLayerToTop();\n });\n });\n });\n } else {\n if (import.meta.env.MODE === 'development') {\n console.log('Update admin level 2');\n }\n\n mapController.updateAdmin2Graphic(admin2FeaturesData, indicatorID, surveySelected, true).then(() => {\n reorderAdminBoundariesLayerToTop();\n });\n }\n });\n }\n }\n\n if (adminSelected === ADMIN__5X5km) {\n const countryName = surveySelected?.ADM0;\n mapController.handleCountryMapImageLayerVisibility(\n adminSelected,\n indicatorSelected,\n surveySelected,\n fieldSelected\n );\n\n // Add admin 2 reference layer if needed or adjust visiblity\n if (countryName && !mapController.admin2ReferenceFeatureLayer) {\n mapController.addAdmin2ReferenceFeatureLayer(countryName);\n } else {\n mapController.handleAdmin2ReferenceLayerVisibility(adminSelected);\n }\n }\n }, [surveySelected, indicatorSelected, adminSelected, fieldSelected]);\n\n // Close popup when selections are changed to avoid it lingering with old data\n useEffect(() => {\n if (mapController?.mapView?.popup.visible) {\n mapController?.mapView?.popup.close();\n }\n }, [surveySelected, levelSelected, indicatorSelected, adminSelected, fieldSelected]);\n\n // Update popup when field is changed to update the popup content\n useEffect(() => {\n const updateLayers = [mapController.admin1ClientSideFeaturesLayer, mapController.admin2ClientSideFeaturesLayer];\n\n updateLayers.forEach((layer) => {\n if (layer) {\n updatePopupTemplateForFieldSelected(layer);\n }\n });\n }, [fieldSelected]);\n\n useEffect(() => {\n if (adminSelected === ADMIN__Admin2 || adminSelected === ADMIN__5X5km) {\n handleAdmin1ClientSideFeaturesLayerUpdates(surveySelected, indicatorsObject, indicatorSelected, adminSelected);\n }\n }, [surveySelected?.value]); // Value example - \"Ethiopia DHS 2016\"\n\n return (\n
\n \n\n
\n
\n \n
\n
\n
\n );\n}\n\nexport default Admin2Map;\n","import React from 'react';\nimport { useSelector } from 'react-redux';\n\n// Components\nimport Admin2Tools from '../Admin2Tools/Admin2Tools';\nimport Admin2Filters from '../Admin2Filters/Admin2Filters';\nimport Admin2Table from '../Admin2Table/Admin2Table';\nimport Admin2Chart from '../Admin2Chart/Admin2Chart';\nimport Admin2Map from '../Admin2Map/Admin2Map';\n\n// Store\nimport { $indicatorSelected } from '../../store/slices/admin2EstimatesSlice';\nimport { $toolSelected } from '../../store/slices/admin2ToolsSlice';\n\n// Configs\nimport { TOOLS_OPTIONS_OBJECT } from '../../configs/tools.configs';\n\n// Styles\nimport './App.scss';\n\nconst App = () => {\n const indicatorSelected = useSelector($indicatorSelected);\n\n const toolSelected = useSelector($toolSelected);\n\n return (\n
\n \n\n \n\n
\n
\n

{indicatorSelected?.label}

\n
\n
\n\n
\n
\n \n
\n\n {toolSelected === TOOLS_OPTIONS_OBJECT.table.label && (\n
\n \n
\n )}\n\n {toolSelected === TOOLS_OPTIONS_OBJECT.chart.label && (\n
\n \n
\n )}\n
\n
\n );\n};\n\nexport default App;\n","import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { ThemeProvider } from '@mui/material';\nimport { Provider } from 'react-redux';\n\n// Components\nimport App from './components/App/App';\n\n// Store\nimport store from './store/store';\n\n// Configs\nimport { muiTheme } from './configs/muiStyling.config';\n\nconst container = document.getElementById('admin-2-estimates-component');\nconst root = createRoot(container!); // createRoot(container!) if you use TypeScript\nroot.render(\n \n \n \n \n \n);\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../Error.js\";function e(e,s){let a=s.responseType;a?\"array-buffer\"!==a&&\"blob\"!==a&&\"json\"!==a&&\"native\"!==a&&\"native-request-init\"!==a&&\"text\"!==a&&(a=\"text\"):a=\"json\",s.responseType=a;const r=s.signal;return delete s.signal,globalThis.invokeStaticMessage(\"request\",{url:e,options:s},{signal:r}).then((async n=>{let o,i,l,u,c;if(n.data)if(n.data instanceof ArrayBuffer){if(!(\"json\"!==a&&\"text\"!==a&&\"blob\"!==a||(o=new Blob([n.data]),\"json\"!==a&&\"text\"!==a||(u=await o.text(),\"json\"!==a)))){try{i=JSON.parse(u||null)}catch(p){const a={...p,url:e,requestOptions:s};throw new t(\"request:server\",p.message,a)}if(i.error){const a={...i.error,url:e,requestOptions:s};throw new t(\"request:server\",i.error.message,a)}}}else\"native\"===a&&(n.data.signal=r,l=await fetch(n.data.url,n.data),n.httpStatus=l.status);switch(a){case\"blob\":c=o;break;case\"json\":c=i;break;case\"native\":c=l;break;case\"text\":c=u;break;default:c=n.data}return{data:c,httpStatus:n.httpStatus,requestOptions:s,ssl:n.ssl,url:e}}))}export{e as execute};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as s}from\"../chunks/tslib.es6.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as t}from\"../core/accessorSupport/decorators/subclass.js\";import{substitute as r}from\"../intl/substitute.js\";import o from\"../widgets/Widget.js\";import{storeNode as i}from\"../widgets/support/widgetUtils.js\";import{messageBundle as n}from\"../widgets/support/decorators/messageBundle.js\";import{tsx as u}from\"../widgets/support/jsxFactory.js\";const p=\"esri-identity-form\",a={base:p,group:`${p}__group`,label:`${p}__label`,footer:`${p}__footer`,esriInput:\"esri-input\",esriButton:\"esri-button\",esriButtonSecondary:\"esri-button--secondary\"},l=\"ArcGIS Online\";let d=class extends o{constructor(s,e){super(s,e),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:s,server:e,resource:t,signingIn:o,oAuthPrompt:n,messages:p}=this,d=u(\"div\",{class:a.group},r(n?p.oAuthInfo:p.info,{server:e&&/\\.arcgis\\.com/i.test(e)?l:e,resource:`(${t||p.lblItem})`})),c=n?null:u(\"div\",{class:a.group,key:\"username\"},u(\"label\",{class:a.label},p.lblUser,u(\"input\",{afterCreate:i,autocomplete:\"off\",bind:this,class:a.esriInput,\"data-node-ref\":\"_usernameInputNode\",required:!0,spellcheck:!1,type:\"text\",value:\"\"}))),m=n?null:u(\"div\",{class:a.group,key:\"password\"},u(\"label\",{class:a.label},p.lblPwd,u(\"input\",{afterCreate:i,bind:this,class:a.esriInput,\"data-node-ref\":\"_passwordInputNode\",required:!0,type:\"password\",value:\"\"}))),h=u(\"div\",{class:this.classes(a.group,a.footer)},u(\"input\",{class:a.esriButton,disabled:!!o,type:\"submit\",value:o?p.lblSigning:p.lblOk}),u(\"input\",{bind:this,class:this.classes(a.esriButton,a.esriButtonSecondary),onclick:this._cancel,type:\"button\",value:p.lblCancel})),b=s?u(\"div\",null,s.details?.httpStatus?p.invalidUser:p.noAuthService):null;return u(\"form\",{bind:this,class:a.base,onsubmit:this._submit},d,b,c,m,h)}_cancel(){this._set(\"signingIn\",!1),this._usernameInputNode&&(this._usernameInputNode.value=\"\"),this._passwordInputNode&&(this._passwordInputNode.value=\"\"),this.emit(\"cancel\")}_submit(s){s.preventDefault(),this._set(\"signingIn\",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit(\"submit\",e)}};s([e(),n(\"esri/identity/t9n/identity\")],d.prototype,\"messages\",void 0),s([e()],d.prototype,\"signingIn\",void 0),s([e()],d.prototype,\"server\",void 0),s([e()],d.prototype,\"resource\",void 0),s([e()],d.prototype,\"error\",void 0),s([e()],d.prototype,\"oAuthPrompt\",void 0),d=s([t(\"esri.identity.IdentityForm\")],d);const c=d;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nexport{accessibleHandler}from\"./decorators/accessibleHandler.js\";export{messageBundle}from\"./decorators/messageBundle.js\";export{vmEvent}from\"./decorators/vmEvent.js\";export{tsx,tsxFragment}from\"./jsxFactory.js\";export{additionalAllowedTags,classes,cssTransition,discardNode,getDir,isActivationKey,isRTL,keepMenuItemWithinView,onResize,renderingSanitizer,safeAttrs,storeNode}from\"./widgetUtils.js\";export{getCalciteThemeClass,isDarkTheme,setCalciteThemeClass}from\"../../support/themeUtils.js\";function e(e){return e&&\"function\"==typeof e.render}function t(e){return e&&\"function\"==typeof e.postMixInProperties&&\"function\"==typeof e.buildRendering&&\"function\"==typeof e.postCreate&&\"function\"==typeof e.startup}export{t as hasDomNode,e as isWidget};\n","/*!\n* tabbable 6.2.0\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\n// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\n// CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes\n// the entire query to fail, resulting in no nodes found, which will break a lot\n// of things... so we have to rely on JS to identify nodes inside an inert container\nvar candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable=\"false\"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n var _element$getRootNode;\n return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);\n} : function (element) {\n return element === null || element === void 0 ? void 0 : element.ownerDocument;\n};\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Element} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nvar isInert = function isInert(node, lookUp) {\n var _node$getAttribute;\n if (lookUp === void 0) {\n lookUp = true;\n }\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');\n var inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`\n // so it likely would not support `:is([inert] *)` either...\n var result = inert || lookUp && node && isInert(node.parentNode); // recursive\n\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nvar isContentEditable = function isContentEditable(node) {\n var _node$getAttribute2;\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert, all its children are inert\n if (isInert(el)) {\n return [];\n }\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nvar hasTabIndex = function hasTabIndex(node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nvar getTabIndex = function getTabIndex(node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (node.tabIndex < 0) {\n // in Chrome,
,
\n * );\n * }\n *\n * @param component\n * @param attributeFilter\n */\nfunction watchGlobalAttributes(component, attributeFilter) {\n const { el } = component;\n const observerOptions = { attributeFilter };\n elementToComponentAndObserverOptionsMap.set(el, [component, observerOptions]);\n updateGlobalAttributes(component, attributeFilter, true);\n if (!mutationObserver) {\n mutationObserver = createObserver(\"mutation\", processMutations);\n }\n mutationObserver.observe(el, observerOptions);\n}\n/**\n * Helper remove listening for changes to inherited attributes.\n *\n * @param component\n */\nfunction unwatchGlobalAttributes(component) {\n elementToComponentAndObserverOptionsMap.delete(component.el);\n // we explicitly process queued mutations and disconnect and reconnect\n // the observer until MutationObserver gets an `unobserve` method\n // see https://github.com/whatwg/dom/issues/126\n processMutations(mutationObserver.takeRecords());\n mutationObserver.disconnect();\n for (const [element, [, observerOptions]] of elementToComponentAndObserverOptionsMap.entries()) {\n mutationObserver.observe(element, observerOptions);\n }\n}\n\nexport { unwatchGlobalAttributes as u, watchGlobalAttributes as w };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { getAssetPath, proxyCustomElement, HTMLElement, h, Host, Build } from '@stencil/core/internal/client/index.js';\nimport { b as getElementDir, t as toAriaBoolean } from './dom.js';\nimport { c as createObserver } from './observers.js';\n\nconst CSS = {\n icon: \"icon\",\n flipRtl: \"flip-rtl\",\n};\n\n/**\n * Icon data cache.\n * Exported for testing purposes.\n *\n * @private\n */\nconst iconCache = {};\n/**\n * Icon request cache.\n * Exported for testing purposes.\n *\n * @private\n */\nconst requestCache = {};\nconst scaleToPx = {\n s: 16,\n m: 24,\n l: 32,\n};\nasync function fetchIcon({ icon, scale }) {\n const size = scaleToPx[scale];\n const name = normalizeIconName(icon);\n const filled = name.charAt(name.length - 1) === \"F\";\n const iconName = filled ? name.substring(0, name.length - 1) : name;\n const id = `${iconName}${size}${filled ? \"F\" : \"\"}`;\n if (iconCache[id]) {\n return iconCache[id];\n }\n if (!requestCache[id]) {\n requestCache[id] = fetch(getAssetPath(`./assets/icon/${id}.json`))\n .then((resp) => resp.json())\n .catch(() => {\n console.error(`\"${id}\" is not a valid calcite-ui-icon name`);\n return \"\";\n });\n }\n const path = await requestCache[id];\n iconCache[id] = path;\n return path;\n}\n/**\n * Normalize the icon name to match the path data module exports.\n * Exported for testing purposes.\n *\n * @param name – an icon name that can be either kebab or camel-cased\n * @private\n */\nfunction normalizeIconName(name) {\n const numberLeadingName = !isNaN(Number(name.charAt(0)));\n const parts = name.split(\"-\");\n const kebabCased = parts.length > 0;\n if (kebabCased) {\n const firstNonDigitInPartPattern = /[a-z]/i;\n name = parts\n .map((part, partIndex) => {\n return part.replace(firstNonDigitInPartPattern, function replacer(match, offset) {\n const isFirstCharInName = partIndex === 0 && offset === 0;\n if (isFirstCharInName) {\n return match;\n }\n return match.toUpperCase();\n });\n })\n .join(\"\");\n }\n return numberLeadingName ? `i${name}` : name;\n}\n\nconst iconCss = \":host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Icon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.icon = null;\n this.flipRtl = false;\n this.scale = \"m\";\n this.textLabel = undefined;\n this.pathData = undefined;\n this.visible = false;\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n this.waitUntilVisible(() => {\n this.visible = true;\n this.loadIconPathData();\n });\n }\n disconnectedCallback() {\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = null;\n }\n async componentWillLoad() {\n this.loadIconPathData();\n }\n render() {\n const { el, flipRtl, pathData, scale, textLabel } = this;\n const dir = getElementDir(el);\n const size = scaleToPx[scale];\n const semantic = !!textLabel;\n const paths = [].concat(pathData || \"\");\n return (h(Host, { \"aria-hidden\": toAriaBoolean(!semantic), \"aria-label\": semantic ? textLabel : null, role: semantic ? \"img\" : null }, h(\"svg\", { \"aria-hidden\": \"true\", class: {\n [CSS.flipRtl]: dir === \"rtl\" && flipRtl,\n svg: true,\n }, fill: \"currentColor\", height: \"100%\", viewBox: `0 0 ${size} ${size}`, width: \"100%\", xmlns: \"http://www.w3.org/2000/svg\" }, paths.map((path) => typeof path === \"string\" ? (h(\"path\", { d: path })) : (h(\"path\", { d: path.d, opacity: \"opacity\" in path ? path.opacity : 1 }))))));\n }\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n async loadIconPathData() {\n const { icon, scale, visible } = this;\n if (!Build.isBrowser || !icon || !visible) {\n return;\n }\n const pathData = await fetchIcon({ icon, scale });\n // While the fetchIcon method is awaiting response, the icon requested can change. This check is to verify the response received belongs to the current icon.\n if (icon !== this.icon) {\n return;\n }\n this.pathData = pathData;\n }\n waitUntilVisible(callback) {\n this.intersectionObserver = createObserver(\"intersection\", (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n callback();\n }\n });\n }, { rootMargin: \"50px\" });\n if (!this.intersectionObserver) {\n callback();\n return;\n }\n this.intersectionObserver.observe(this.el);\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"icon\": [\"loadIconPathData\"],\n \"scale\": [\"loadIconPathData\"]\n }; }\n static get style() { return iconCss; }\n}, [1, \"calcite-icon\", {\n \"icon\": [513],\n \"flipRtl\": [516, \"flip-rtl\"],\n \"scale\": [513],\n \"textLabel\": [1, \"text-label\"],\n \"pathData\": [32],\n \"visible\": [32]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-icon\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Icon);\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Icon as I, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client/index.js';\nimport { g as guid } from './guid.js';\n\nconst loaderCss = \"@charset \\\"UTF-8\\\";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-ui-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem)}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--2);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-ui-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);line-height:0.25;transform:scale(1, 1)}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}@supports (display: grid){.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}}:host([type=determinate]){animation:none;stroke:var(--calcite-ui-border-3)}:host([type=determinate]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-ui-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-ui-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-ui-brand)}33%{stroke:var(--calcite-ui-brand-press)}66%{stroke:var(--calcite-ui-brand-hover)}100%{stroke:var(--calcite-ui-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Loader = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.inline = false;\n this.label = undefined;\n this.scale = \"m\";\n this.type = undefined;\n this.value = 0;\n this.text = \"\";\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n render() {\n const { el, inline, label, scale, text, type, value } = this;\n const id = el.id || guid();\n const radiusRatio = 0.45;\n const size = inline ? this.getInlineSize(scale) : this.getSize(scale);\n const radius = size * radiusRatio;\n const viewbox = `0 0 ${size} ${size}`;\n const isDeterminate = type === \"determinate\";\n const circumference = 2 * radius * Math.PI;\n const progress = (value / 100) * circumference;\n const remaining = circumference - progress;\n const valueNow = Math.floor(value);\n const hostAttributes = {\n \"aria-valuenow\": valueNow,\n \"aria-valuemin\": 0,\n \"aria-valuemax\": 100,\n complete: valueNow === 100,\n };\n const svgAttributes = { r: radius, cx: size / 2, cy: size / 2 };\n const determinateStyle = { \"stroke-dasharray\": `${progress} ${remaining}` };\n return (h(Host, { \"aria-label\": label, id: id, role: \"progressbar\", ...(isDeterminate ? hostAttributes : {}) }, h(\"div\", { class: \"loader__svgs\" }, h(\"svg\", { \"aria-hidden\": \"true\", class: \"loader__svg loader__svg--1\", viewBox: viewbox }, h(\"circle\", { ...svgAttributes })), h(\"svg\", { \"aria-hidden\": \"true\", class: \"loader__svg loader__svg--2\", viewBox: viewbox }, h(\"circle\", { ...svgAttributes })), h(\"svg\", { \"aria-hidden\": \"true\", class: \"loader__svg loader__svg--3\", viewBox: viewbox, ...(isDeterminate ? { style: determinateStyle } : {}) }, h(\"circle\", { ...svgAttributes }))), text && h(\"div\", { class: \"loader__text\" }, text), isDeterminate && h(\"div\", { class: \"loader__percentage\" }, value)));\n }\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n /**\n * Return the proper sizes based on the scale property\n *\n * @param scale\n */\n getSize(scale) {\n return {\n s: 32,\n m: 56,\n l: 80,\n }[scale];\n }\n getInlineSize(scale) {\n return {\n s: 12,\n m: 16,\n l: 20,\n }[scale];\n }\n get el() { return this; }\n static get style() { return loaderCss; }\n}, [1, \"calcite-loader\", {\n \"inline\": [516],\n \"label\": [1],\n \"scale\": [513],\n \"type\": [513],\n \"value\": [2],\n \"text\": [1]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-loader\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-loader\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Loader);\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Loader as L, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, Build, h } from '@stencil/core/internal/client/index.js';\nimport { s as submitForm, r as resetForm, f as findAssociatedForm } from './form.js';\nimport { c as connectInteractive, d as disconnectInteractive, u as updateHostInteraction } from './interactive.js';\nimport { c as connectLabel, d as disconnectLabel, g as getLabelText } from './label2.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { c as createObserver } from './observers.js';\nimport { g as getIconScale } from './component.js';\nimport { c as connectMessages, d as disconnectMessages, s as setUpMessages, u as updateMessages } from './t9n.js';\nimport { w as watchGlobalAttributes, u as unwatchGlobalAttributes } from './globalAttributes.js';\nimport { d as defineCustomElement$2 } from './icon.js';\nimport { d as defineCustomElement$1 } from './loader.js';\n\nconst CSS = {\n buttonLoader: \"calcite-button--loader\",\n content: \"content\",\n contentSlotted: \"content--slotted\",\n icon: \"icon\",\n iconStart: \"icon--start\",\n iconEnd: \"icon--end\",\n loadingIn: \"loading-in\",\n loadingOut: \"loading-out\",\n iconStartEmpty: \"icon-start-empty\",\n iconEndEmpty: \"icon-end-empty\",\n buttonPadding: \"button-padding\",\n buttonPaddingShrunk: \"button-padding--shrunk\",\n};\n\nconst buttonCss = \":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([loading]:not([disabled])) *,:host([disabled]) *,:host([loading]:not([disabled])) ::slotted(*),:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n 2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([loading]:not([disabled])) button,:host([loading]:not([disabled])) a{opacity:var(--calcite-ui-opacity-disabled)}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px;transition:inline-size var(--calcite-internal-animation-timing-slow) ease-in-out, opacity var(--calcite-internal-animation-timing-slow) ease-in-out, transform var(--calcite-internal-animation-timing-slow) ease-in-out}.calcite-button--loader calcite-loader.loading-in{animation-name:loader-in;animation-duration:var(--calcite-internal-animation-timing-slow)}.calcite-button--loader calcite-loader.loading-out{animation-name:loader-out;animation-duration:var(--calcite-internal-animation-timing-slow)}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-ui-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-ui-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-ui-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-ui-danger);color:var(--calcite-ui-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-ui-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-ui-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-ui-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-ui-foreground-3);color:var(--calcite-ui-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-ui-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-ui-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-ui-text-inverse);background-color:var(--calcite-ui-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-ui-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-ui-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-ui-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-ui-brand-hover);color:var(--calcite-ui-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-brand);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-ui-brand-press);color:var(--calcite-ui-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-ui-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-ui-danger);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-ui-danger-hover);color:var(--calcite-ui-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-ui-danger);color:var(--calcite-ui-danger);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-ui-danger-press);color:var(--calcite-ui-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-ui-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-ui-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-ui-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-ui-inverse);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-ui-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-ui-brand);background-color:transparent;color:var(--calcite-ui-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-ui-brand-hover);color:var(--calcite-ui-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-brand);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-ui-brand-press);color:var(--calcite-ui-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-ui-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-ui-danger);background-color:transparent;color:var(--calcite-ui-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-ui-danger-hover);color:var(--calcite-ui-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-ui-danger);color:var(--calcite-ui-danger);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-ui-danger-press);color:var(--calcite-ui-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-ui-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-ui-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-ui-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-ui-inverse);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-ui-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-button-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-button-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-ui-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-ui-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-ui-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-ui-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-ui-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-ui-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-ui-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-ui-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-ui-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-ui-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-ui-text-3);border-block-start-color:var(--calcite-ui-border-input);border-block-end-color:var(--calcite-ui-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-ui-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-ui-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Button = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n /** watches for changing text content */\n this.mutationObserver = createObserver(\"mutation\", () => this.updateHasContent());\n this.resizeObserver = createObserver(\"resize\", () => this.setTooltipText());\n // act on a requested or nearby form based on type\n this.handleClick = () => {\n const { type } = this;\n if (this.href) {\n return;\n }\n // this.type refers to type attribute, not child element type\n if (type === \"submit\") {\n submitForm(this);\n }\n else if (type === \"reset\") {\n resetForm(this);\n }\n };\n this.setTooltipText = () => {\n const { contentEl } = this;\n if (contentEl) {\n this.tooltipText = contentEl.offsetWidth < contentEl.scrollWidth ? this.el.innerText : null;\n }\n };\n this.setChildEl = (el) => {\n this.childEl = el;\n if (el) {\n this.resizeObserver?.observe(el);\n }\n };\n this.alignment = \"center\";\n this.appearance = \"solid\";\n this.label = undefined;\n this.kind = \"brand\";\n this.disabled = false;\n this.form = undefined;\n this.href = undefined;\n this.iconEnd = undefined;\n this.iconFlipRtl = undefined;\n this.iconStart = undefined;\n this.loading = false;\n this.name = undefined;\n this.rel = undefined;\n this.round = false;\n this.scale = \"m\";\n this.splitChild = false;\n this.target = undefined;\n this.type = \"button\";\n this.width = \"auto\";\n this.messages = undefined;\n this.messageOverrides = undefined;\n this.hasContent = false;\n this.hasLoader = false;\n this.effectiveLocale = \"\";\n this.defaultMessages = undefined;\n this.tooltipText = undefined;\n this.globalAttributes = {\n ariaExpanded: undefined,\n };\n }\n loadingChanged(newValue, oldValue) {\n if (!!newValue && !oldValue) {\n this.hasLoader = true;\n }\n if (!newValue && !!oldValue) {\n window.setTimeout(() => {\n this.hasLoader = false;\n }, 300);\n }\n }\n onMessagesChange() {\n /** referred in t9n util */\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n async connectedCallback() {\n connectInteractive(this);\n connectLocalized(this);\n connectMessages(this);\n watchGlobalAttributes(this, [\"aria-expanded\"]);\n this.hasLoader = this.loading;\n this.setupTextContentObserver();\n connectLabel(this);\n this.formEl = findAssociatedForm(this);\n }\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n disconnectInteractive(this);\n disconnectLabel(this);\n disconnectLocalized(this);\n disconnectMessages(this);\n this.resizeObserver?.disconnect();\n this.formEl = null;\n unwatchGlobalAttributes(this);\n }\n async componentWillLoad() {\n setUpLoadableComponent(this);\n if (Build.isBrowser) {\n this.updateHasContent();\n await setUpMessages(this);\n }\n }\n componentDidLoad() {\n setComponentLoaded(this);\n this.setTooltipText();\n }\n componentDidRender() {\n updateHostInteraction(this);\n }\n render() {\n const childElType = this.href ? \"a\" : \"button\";\n const Tag = childElType;\n const loaderNode = this.hasLoader ? (h(\"div\", { class: CSS.buttonLoader }, h(\"calcite-loader\", { class: this.loading ? CSS.loadingIn : CSS.loadingOut, inline: true, label: this.messages.loading, scale: this.scale === \"l\" ? \"m\" : \"s\" }))) : null;\n const noStartEndIcons = !this.iconStart && !this.iconEnd;\n const iconStartEl = (h(\"calcite-icon\", { class: { [CSS.icon]: true, [CSS.iconStart]: true }, flipRtl: this.iconFlipRtl === \"start\" || this.iconFlipRtl === \"both\", icon: this.iconStart, scale: getIconScale(this.scale) }));\n const iconEndEl = (h(\"calcite-icon\", { class: { [CSS.icon]: true, [CSS.iconEnd]: true }, flipRtl: this.iconFlipRtl === \"end\" || this.iconFlipRtl === \"both\", icon: this.iconEnd, scale: getIconScale(this.scale) }));\n const contentEl = (h(\"span\", { class: CSS.content, ref: (el) => (this.contentEl = el) }, h(\"slot\", null)));\n return (h(Tag, { \"aria-label\": !this.loading ? getLabelText(this) : this.messages.loading, \"aria-live\": \"polite\", class: {\n [CSS.buttonPadding]: noStartEndIcons,\n [CSS.buttonPaddingShrunk]: !noStartEndIcons,\n [CSS.contentSlotted]: this.hasContent,\n [CSS.iconStartEmpty]: !this.iconStart,\n [CSS.iconEndEmpty]: !this.iconEnd,\n }, disabled: this.disabled || this.loading, href: childElType === \"a\" && this.href, name: childElType === \"button\" && this.name, onClick: this.handleClick, rel: childElType === \"a\" && this.rel, tabIndex: this.disabled || this.loading ? -1 : null, target: childElType === \"a\" && this.target, title: this.tooltipText, type: childElType === \"button\" && this.type, ...this.globalAttributes,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: this.setChildEl }, loaderNode, this.iconStart ? iconStartEl : null, this.hasContent ? contentEl : null, this.iconEnd ? iconEndEl : null));\n }\n //--------------------------------------------------------------------------\n //\n // Public Methods\n //\n //--------------------------------------------------------------------------\n /** Sets focus on the component. */\n async setFocus() {\n await componentFocusable(this);\n this.childEl?.focus();\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n updateHasContent() {\n const slottedContent = this.el.textContent.trim().length > 0 || this.el.childNodes.length > 0;\n this.hasContent =\n this.el.childNodes.length === 1 && this.el.childNodes[0]?.nodeName === \"#text\"\n ? this.el.textContent?.trim().length > 0\n : slottedContent;\n }\n setupTextContentObserver() {\n this.mutationObserver?.observe(this.el, { childList: true, subtree: true });\n }\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n onLabelClick() {\n this.handleClick();\n this.setFocus();\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"loading\": [\"loadingChanged\"],\n \"messageOverrides\": [\"onMessagesChange\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return buttonCss; }\n}, [1, \"calcite-button\", {\n \"alignment\": [513],\n \"appearance\": [513],\n \"label\": [1],\n \"kind\": [513],\n \"disabled\": [516],\n \"form\": [513],\n \"href\": [513],\n \"iconEnd\": [513, \"icon-end\"],\n \"iconFlipRtl\": [513, \"icon-flip-rtl\"],\n \"iconStart\": [513, \"icon-start\"],\n \"loading\": [516],\n \"name\": [513],\n \"rel\": [513],\n \"round\": [516],\n \"scale\": [513],\n \"splitChild\": [520, \"split-child\"],\n \"target\": [513],\n \"type\": [513],\n \"width\": [513],\n \"messages\": [1040],\n \"messageOverrides\": [1040],\n \"hasContent\": [32],\n \"hasLoader\": [32],\n \"effectiveLocale\": [32],\n \"defaultMessages\": [32],\n \"tooltipText\": [32],\n \"globalAttributes\": [32],\n \"setFocus\": [64]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-button\", \"calcite-icon\", \"calcite-loader\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-button\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Button);\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n case \"calcite-loader\":\n if (!customElements.get(tagName)) {\n defineCustomElement$1();\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Button as B, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { B as Button, d as defineCustomElement$1 } from './button.js';\n\nconst CalciteButton = Button;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteButton, defineCustomElement };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { I as Icon, d as defineCustomElement$1 } from './icon.js';\n\nconst CalciteIcon = Icon;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteIcon, defineCustomElement };\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{urlToObject as t}from\"../../core/urlUtils.js\";import r from\"../Portal.js\";function e(e){return{origin:\"portal-item\",url:t(e.itemUrl),portal:e.portal||r.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){const o=t(e.itemUrl);return{origin:\"portal-item\",messages:[],writtenProperties:[],url:o,portal:e.portal||r.getDefault(),portalItem:e,verifyItemRelativeUrls:o?{rootPath:o.path,writtenUrls:[]}:null,blockedRelativeUrls:[]}}function l(e){return{origin:\"web-map\",url:t(e.itemUrl),portal:e.portal||r.getDefault(),portalItem:e,readResourcePaths:[]}}function a(e,o){const l=t(e.itemUrl);return{origin:\"web-map\",messages:[],writtenProperties:[],url:l,portal:e.portal||r.getDefault(),portalItem:e,initiator:o,verifyItemRelativeUrls:l?{rootPath:l.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}}export{l as createForGroupLayerItemRead,a as createForGroupLayerItemWrite,e as createForItemRead,o as createForItemWrite};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import{parse as t}from\"../../layers/support/arcgisLayerUrl.js\";import{fetchFeatureService as r}from\"../../layers/support/fetchService.js\";import{LayerLoadContext as a}from\"../../layers/support/LayerLoadContext.js\";import{populateGroupLayer as n}from\"../../layers/support/layersCreator.js\";import{layerLookupMap as o}from\"../../layers/support/lazyLayerLoader.js\";import s from\"../Portal.js\";import{createForItemRead as l,createForGroupLayerItemRead as i}from\"./jsonContext.js\";import{preprocessFSItemData as p,getSubtypeGroupLayerIds as u,getOrientedImageryLayerIds as c,populateSceneServiceItemData as y,getNumLayersAndTables as f,createSublayerData as d,getFirstLayerOrTableId as m}from\"./loadUtils.js\";import{hasTypeKeyword as h}from\"./portalItemUtils.js\";import{loadStyleRenderer as w}from\"../../renderers/support/styleUtils.js\";import{fetchArcGISServiceJSON as b}from\"../../support/requestPresets.js\";async function g(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),I(e),L(e,t)}function I(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e(\"portal:invalid-layer-item-type\",\"Invalid layer item type '${type}', expected '${expectedType}'\",{type:r?.type,expectedType:t.supportedTypes.join(\", \")})}async function L(e,t){const r=e.instance,n=r.portalItem;if(!n)return;const{url:o,title:s}=n,i=l(n);if(\"group\"===r.type)return S(r,i,e);o&&r.read({url:o},i);const p=new a,u=await F(e,p,t);return u&&r.read(u,i),r.resourceReferences={portalItem:n,paths:i.readResourcePaths??[]},\"subtype-group\"!==r.type&&r.read({title:s},i),w(r,i)}async function S(t,r,a){const n=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=n;if(\"Group Layer\"===s){if(!h(n,\"Map\"))throw new e(\"portal:invalid-layer-item-typekeyword\",\"'Group Layer' item without 'Map' type keyword is not supported\");return T(t)}return t.read({title:o},r),j(t,a)}async function T(e){const t=e.portalItem,r=await t.fetchData(\"json\");if(!r)return;const a=i(t);e.read(r,a),await n(e,r,{context:a}),e.resourceReferences={portalItem:t,paths:a.readResourcePaths??[]}}async function j(t,r){let n;const{portalItem:o}=t;if(!o)return;const s=o.type,l=r.layerModuleTypeMap;switch(s){case\"Feature Service\":case\"Feature Collection\":n=l.FeatureLayer;break;case\"Stream Service\":n=l.StreamLayer;break;case\"Scene Service\":n=l.SceneLayer;break;default:throw new e(\"portal:unsupported-item-type-as-group\",`The item type '${s}' is not supported as a 'IGroupLayer'`)}const i=new a;let[d,m]=await Promise.all([n(),F(r,i)]),h=()=>d;if(\"Feature Service\"===s){m=o.url?await p(m,o.url,i):{};const e=u(m),r=c(m),a=[];if(e.length||r?.length){e.length&&a.push(\"SubtypeGroupLayer\"),r?.length&&a.push(\"OrientedImageryLayer\");const t=[];for(const e of a){const r=l[e];t.push(r())}const n=await Promise.all(t),o=new Map;a.forEach(((e,t)=>{o.set(e,n[t])})),h=e=>e.layerType?o.get(e.layerType)??d:d}const n=await E(o.url);return await M(t,h,m,n)}return\"Scene Service\"===s&&o.url&&(m=await y(o,m,i)),f(m)>0?await M(t,h,m):await v(t,h)}async function v(e,t){const{portalItem:r}=e;if(!r?.url)return;const a=await b(r.url);a&&M(e,t,{layers:a.layers?.map(d),tables:a.tables?.map(d)})}async function M(e,t,r,a){let n=r.layers||[];const s=r.tables||[];if(\"Feature Collection\"===e.portalItem?.type?(n.forEach(((e,t)=>{e.id=t,\"Table\"===e?.layerDefinition?.type&&s.push(e)})),n=n.filter((e=>\"Table\"!==e?.layerDefinition?.type))):(n.reverse(),s.reverse()),n.forEach((n=>{const o=a?.(n);if(o||!a){const a=x(e,t(n),r,n,o);e.add(a)}})),s.length){const t=await o.FeatureLayer();s.forEach((n=>{const o=a?.(n);if(o||!a){const a=x(e,t,r,n,o);e.tables.add(a)}}))}}function x(e,t,r,a,n){const o=e.portalItem,l={portalItem:o.clone(),layerId:a.id};null!=a.url&&(l.url=a.url);const i=new t(l);if(\"sourceJSON\"in i&&(i.sourceJSON=n),\"subtype-group\"!==i.type&&(i.sublayerTitleMode=\"service-name\"),\"Feature Collection\"===o.type){const e={origin:\"portal-item\",portal:o.portal||s.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function F(e,t,r){if(!1===e.supportsData)return;const a=e.instance,n=a.portalItem;if(!n)return;let o=null;try{o=await n.fetchData(\"json\",r)}catch(s){}if(D(a)){let e=null;const r=await P(n,o,t);if((o?.layers||o?.tables)&&r>0){if(null==a.layerId){const e=u(o);a.layerId=\"subtype-group\"===a.type?e?.[0]:m(o)}e=C(o,a),e&&null!=o.showLegend&&(e.showLegend=o.showLegend)}return r>1&&\"sublayerTitleMode\"in a&&\"service-name\"!==a.sublayerTitleMode&&(a.sublayerTitleMode=\"item-title-and-service-name\"),e}return o}async function P(e,r,a){if(r?.layers&&r?.tables)return f(r);const n=t(e.url);if(!n)return 1;const o=await a.fetchServiceMetadata(n.url.path).catch((()=>null));return(r?.layers?.length??o?.layers?.length??0)+(r?.tables?.length??o?.tables?.length??0)}function C(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&k(a,t)?a:null}function D(e){return\"stream\"!==e.type&&\"layerId\"in e}function k(e,t){return!(\"feature\"===t.type&&\"layerType\"in e&&\"SubtypeGroupLayer\"===e.layerType||\"subtype-group\"===t.type&&!(\"layerType\"in e))}async function E(e){const{layersJSON:t}=await r(e);if(!t)return null;const a=[...t.layers,...t.tables];return e=>a.find((t=>t.id===e.id))}export{g as load};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import\"../../core/has.js\";import{wrapImageData as e}from\"../../core/imageUtils.js\";import{JSONSupport as a}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import{ensureClass as s}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import{reader as n}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../../core/accessorSupport/decorators/writer.js\";import{t as l,w as c}from\"../../chunks/persistableUrlUtils.js\";var p;const h=new WeakMap;let d=0,u=p=class extends a{constructor(t){super(t),this.wrap=\"repeat\"}get url(){return this._get(\"url\")||null}set url(t){this._set(\"url\",t),t&&this._set(\"data\",null)}get data(){return this._get(\"data\")||null}set data(t){this._set(\"data\",t),t&&this._set(\"url\",null)}writeData(t,e,a,r){if(t instanceof HTMLImageElement){const s={type:\"image-element\",src:l(t.src,r),crossOrigin:t.crossOrigin};e[a]=s}else if(t instanceof HTMLCanvasElement){const r=t.getContext(\"2d\").getImageData(0,0,t.width,t.height),s={type:\"canvas-element\",imageData:this._encodeImageData(r)};e[a]=s}else if(t instanceof HTMLVideoElement){const s={type:\"video-element\",src:l(t.src,r),autoplay:t.autoplay,loop:t.loop,muted:t.muted,crossOrigin:t.crossOrigin,preload:t.preload};e[a]=s}else if(t instanceof ImageData){const r={type:\"image-data\",imageData:this._encodeImageData(t)};e[a]=r}}readData(t){switch(t.type){case\"image-element\":{const e=new Image;return e.src=t.src,e.crossOrigin=t.crossOrigin,e}case\"canvas-element\":{const e=this._decodeImageData(t.imageData),a=document.createElement(\"canvas\");return a.width=e.width,a.height=e.height,a.getContext(\"2d\").putImageData(e,0,0),a}case\"image-data\":return this._decodeImageData(t.imageData);case\"video-element\":{const e=document.createElement(\"video\");return e.src=t.src,e.crossOrigin=t.crossOrigin,e.autoplay=t.autoplay,e.loop=t.loop,e.muted=t.muted,e.preload=t.preload,e}default:return}}get transparent(){const t=this.data,e=this.url;if(t instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(t.getContext(\"2d\").getImageData(0,0,t.width,t.height));if(t instanceof ImageData)return this._imageDataContainsTransparent(t);if(e){const t=e.substr(e.length-4,4).toLowerCase(),a=e.substr(0,15).toLocaleLowerCase();if(\".png\"===t||\"data:image/png;\"===a)return!0}return!1}set transparent(t){this._overrideIfSome(\"transparent\",t)}get contentHash(){const t=\"string\"==typeof this.wrap?this.wrap:\"object\"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:\"\",e=(e=\"\")=>`d:${e},t:${this.transparent},w:${t}`;return null!=this.url?e(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(h.has(this.data)||h.set(this.data,++d),e(h.get(this.data))):e()}get memoryUsage(){let t=0;if(t+=null!=this.url?this.url.length:0,null!=this.data){const e=this.data;\"data\"in e?t+=e.data.byteLength:e instanceof HTMLImageElement?t+=e.naturalWidth*e.naturalHeight*3:e instanceof HTMLCanvasElement&&(t+=e.width*e.height*3)}return t}clone(){const t={url:this.url,data:this.data,wrap:this._cloneWrap()};return new p(t)}cloneWithDeduplication(t){const e=t.get(this);if(e)return e;const a=this.clone();return t.set(this,a),a}_cloneWrap(){return\"string\"==typeof this.wrap?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(t){let e=\"\";for(let a=0;a`'${t.name}'`));return e.error(`Failed to set property, expected one of ${n}, but got ${t.constructor.name}`),new o([])}}function y(t,o,r){o[r]=m(t)}function m(t){const o=new Array(t.length);for(let r=0;r=1),h(3===o.size||4===o.size);const{data:c,size:l,indices:m}=o;h(m.length%this._numIndexPerPrimitive==0),h(m.length>=i.length*this._numIndexPerPrimitive);const d=i.length;let u=l*m[this._numIndexPerPrimitive*i[0]];a.clear(),a.push(u);const f=s(c[u],c[u+1],c[u+2]),x=r(f);for(let t=0;t0&&++m;if(m<2)return;const d=new Array(8);for(let t=0;t<8;++t)d[t]=h[t]>0?new Uint32Array(h[t]):void 0;for(let t=0;t<8;++t)h[t]=0;for(let t=0;t0&&v>0&&S>0){const t=o(b,j);return t*t/o(b,b)}const d=a(g(p,i,M.get()),n),w=a(g(c,u,M.get()),n),x=a(g(s,f,M.get()),n);return Math.min(d,w,x)}function v(t,n,e){const r=1e-5,{direction:o,origin:s}=n,{p0:i,p1:u,p2:f}=t,a=u[0]-i[0],g=u[1]-i[1],m=u[2]-i[2],j=f[0]-i[0],h=f[1]-i[1],k=f[2]-i[2],b=o[1]*k-h*o[2],l=o[2]*j-k*o[0],v=o[0]*h-j*o[1],S=a*b+g*l+m*v;if(S>-r&&S1)return!1;const V=M*m-g*x,q=x*a-m*w,y=w*g-a*M,z=d*(o[0]*V+o[1]*q+o[2]*y);if(z<0||O+z>1)return!1;if(e){p(e,o,d*(j*V+h*q+k*y)),c(e,s,e)}return!0}function S(t,n,e){const r=n[0]-t[0],o=n[1]-t[1],p=e[0]-t[0],c=e[1]-t[1];return.5*Math.abs(r*c-o*p)}function d(t){return S(t.p0,t.p1,t.p2)}function w(t,n,o){return e(O,n,t),e(V,o,t),s(r(O,O,V))/2}const M=new t(f),x=new t((()=>j())),O=u(),V=u();export{d as area2d,S as areaPoints2d,w as areaPoints3d,k as copy,j as create,l as distance2,b as fromValues,v as intersectRay,h as wrap};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{s as t,g as n,i as e,r as s}from\"../../../../chunks/vec3.js\";import{c as r}from\"../../../../chunks/vec3f64.js\";import{areaPoints3d as o}from\"../../../../geometry/support/triangle.js\";function c(s,r){if(!s)return!1;const{size:c,data:i,indices:f}=s;t(r,0,0,0),t(m,0,0,0);let d=0,g=0;for(let p=0;p1&&e(s,s,1/f),f>0}function f(r,o,c){if(!r)return!1;t(c,0,0,0),t(m,0,0,0);let i=0,f=0;const{size:l,data:d,indices:g}=r,p=g.length-1,h=p+(o?2:0);for(let t=0;t0?(n(c,c,e(a,a,j)),i+=j):0===i&&(n(m,m,a),f++)}return 0!==i?(e(c,c,1/i),!0):0!==f&&(e(c,m,1/f),!0)}const a=r(),u=r(),l=r(),m=r();export{f as computeAttachmentOriginLines,i as computeAttachmentOriginPoints,c as computeAttachmentOriginTriangles};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{generateUID as o}from\"../../../../core/uid.js\";class r{constructor(r){this.channel=r,this.id=o()}}export{r as Object3DStateID};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{c as t}from\"../../../../../chunks/vec3f64.js\";import{encodeDoubleArray as e}from\"../../../../webgl/doublePrecisionUtils.js\";function n(t,e){return null==t&&(t=[]),t.push(e),t}function r(t,e){if(null==t)return null;const n=t.filter((t=>t!==e));return 0===n.length?null:n}function s(t,n,r,s,u){l[0]=t.get(n,0),l[1]=t.get(n,1),l[2]=t.get(n,2),e(l,o,3),r.set(u,0,o[0]),s.set(u,0,o[1]),r.set(u,1,o[2]),s.set(u,1,o[3]),r.set(u,2,o[4]),s.set(u,2,o[5])}const l=t(),o=new Float32Array(6);export{n as addObject3DStateID,s as encodeDoubleVec3,r as removeObject3DStateID};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{I as t,b as i}from\"../../../../chunks/mat4f64.js\";import{e}from\"../../../../chunks/vec3.js\";import{compactIndices as n,getContinuousIndexArray as s}from\"../../../../geometry/support/Indices.js\";import{cloneAttributeData as r}from\"./AttributeArray.js\";import{Object3DState as o}from\"./basicInterfaces.js\";import{BoundingInfo as h}from\"./BoundingInfo.js\";import{ContentObject as a}from\"./ContentObject.js\";import{ContentObjectType as u}from\"./ContentObjectType.js\";import{computeAttachmentOriginTriangles as g,computeAttachmentOriginLines as c,computeAttachmentOriginPoints as m}from\"./geometryDataUtils.js\";import{Object3DStateID as l}from\"./Object3DStateID.js\";import{assert as d}from\"./Util.js\";import{VertexAttribute as f}from\"./VertexAttribute.js\";import{addObject3DStateID as b,removeObject3DStateID as p}from\"../materials/renderers/utils.js\";class I extends a{constructor(t,i,e=null,s=u.Mesh,r=null,o=-1){super(),this.material=t,this.mapPositions=e,this.type=s,this.objectAndLayerIdColor=r,this.edgeIndicesLength=o,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[h,a]of i)this._attributes.set(h,{...a,indices:n(a.indices)}),h===f.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(h).indices.length:this.edgeIndicesLength)}instantiate(t={}){const i=new I(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((t,e)=>{t.exclusive=!1,i._attributes.set(e,t)})),i._boundingInfo=this._boundingInfo,i.transformation=t.transformation||this.transformation,i}get attributes(){return this._attributes}getMutableAttribute(t){let i=this._attributes.get(t);return i&&!i.exclusive&&(i={...i,exclusive:!0,data:r(i.data)},this._attributes.set(t,i)),i}setAttributeData(t,i){const e=this._attributes.get(t);e&&this._attributes.set(t,{...e,exclusive:!0,data:i})}get indexCount(){const t=this._attributes.values().next().value.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===u.Mesh?this._computeAttachmentOriginTriangles(t):this.type===u.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&e(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const i=this.attributes.get(f.POSITION);return g(i,t)}_computeAttachmentOriginLines(t){const i=this.attributes.get(f.POSITION);return c(i,_(this.material.parameters,i),t)}_computeAttachmentOriginPoints(t){const i=this.attributes.get(f.POSITION);return m(i,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(f.POSITION);if(!t||0===t.indices.length)return null;const i=this.type===u.Mesh?3:1;d(t.indices.length%i==0,\"Indexing error: \"+t.indices.length+\" not divisible by \"+i);const e=s(t.indices.length/i);return new h(e,i,t)}get transformation(){return this._transformation??t}set transformation(e){this._transformation=e&&e!==t?i(e):null}addHighlight(){const t=new l(o.Highlight);return this.highlights=b(this.highlights,t),t}removeHighlight(t){this.highlights=p(this.highlights,t)}}function _(t,i){return!(!(\"isClosed\"in t)||!t.isClosed)&&i.indices.length>2}export{I as Geometry};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../../../geometry.js\";import{deg2rad as t}from\"../../../../core/mathUtils.js\";import{getMetersPerUnitForSR as e,getMetersPerVerticalUnitForSR as r}from\"../../../../core/unitUtils.js\";import{e as o}from\"../../../../chunks/earcut.js\";import{s as i}from\"../../../../chunks/vec3.js\";import{Axis as n}from\"../../../../geometry/support/Axis.js\";import{getZeroIndexArray as a}from\"../../../../geometry/support/Indices.js\";import{create as s,fromManyPoints as u,normal as c}from\"../../../../geometry/support/plane.js\";import{Attribute as m}from\"../../webgl-engine/lib/Attribute.js\";import{ContentObjectType as p}from\"../../webgl-engine/lib/ContentObjectType.js\";import{Geometry as l}from\"../../webgl-engine/lib/Geometry.js\";import{VertexAttribute as b}from\"../../webgl-engine/lib/VertexAttribute.js\";import f from\"../../../../geometry/Extent.js\";import g from\"../../../../geometry/Polygon.js\";function h(t,o,n,a){const s=(t=>!Array.isArray(t[0]))(o)?(t,e)=>o[3*t+e]:(t,e)=>o[t][e],c=a?e(a)/r(a):1;return u(t,((t,e)=>i(t,s(e,0)*c,s(e,1)*c,s(e,2))),n)}function j(e,r,o){const i=h(y,e,r,o)?c(y):[0,0,1];return Math.abs(i[2])>Math.cos(t(80))?n.Z:Math.abs(i[1])>Math.abs(i[0])?n.Y:n.X}const y=s();function w(t,e,r){const i=j(t,(e.length>0?e[0]:t.length/3)-1,r);if(i!==n.Z){t=t.slice();for(let e=0;en-l)),a=i(n(h,g,3));s.push({position:h,faces:a}),c+=h.length,f+=a.length}const a=h(s,c,f),p=Array.isArray(a.position)?l(a.position,3,{originalIndices:a.faces}):l(a.position.buffer,6,{originalIndices:a.faces});return a.position=r(new Float64Array(p.buffer)),a.faces=p.indices,a}function h(n,t,e){if(1===n.length)return n[0];const o=s(t),r=new Array(e);let l=0,c=0,f=0;for(const s of n){for(let n=0;n=0;s--){const d=n[s],A=e===u.CCW_IS_HOLE&&p(d,t,o);if(A&&1!==r)i[f++]=d;else{let n=d.length;for(let t=0;t0&&(c[g++]={index:y,count:d.length}),y=A?a(d,d.length-1,-1,m,y,d.length,t):a(d,0,1,m,y,d.length,t);for(let o=0;o0&&(c[g++]={index:y,count:n.length}),y=a(n,0,1,m,y,n.length,t)}f=0,e.count>0&&(l[h++]=e)}}for(let s=0;s0&&(c[g++]={index:y,count:n.length}),y=a(n,0,1,m,y,n.length,t)}return l.length=h,c.length=g,{position:m,polygons:l,outlines:c}}function a(n,t,e,o,r,s,i){r*=3;for(let l=0;la.dispose()),(()=>a.dispose()));const{vertexAttributes:f,components:p}=await c;e.vertexAttributes=f,e.components=p}function u(e){const t=i(e.url);return s=>{const r=a(s,t,t),o=r?r.replace(/^ *\\.\\//,\"\"):null;return(o?e.files.get(o):null)??s}}async function m(t,s){if(Array.isArray(t)){if(!t.length)throw new e(\"mesh-load-external:missing-assets\",\"There must be at least one file to load\");return t[0]instanceof File?h(t):w(t,s)}return p(t)}async function f(e,t){const{parts:r,assetMimeType:o,assetName:n}=e;if(1===r.length)return new T(r[0].partUrl);const i=await e.toBlob(t);return s(t),T.fromBlob(i,v(n,o))}function p(e){return T.fromBlob(e,v(e.name,e.type))}function h(e){return j(e.map((e=>({name:e.name,mimeType:e.type,source:p(e)}))))}async function w(e,t){const i=await r(e.map((async e=>{const r=await f(e);return s(t),{name:e.assetName,mimeType:e.assetMimeType,source:r}})));if(o(t))throw i.forEach((e=>e.source.dispose())),n();return j(i)}const y=/^model\\/gltf\\+json$/,d=/^model\\/gltf-binary$/,g=/\\.gltf$/i,b=/\\.glb$/i;function j(t){const s=new Map;let r,o=null;for(const{name:e,mimeType:n,source:i}of t)null===o&&(y.test(n)||g.test(e)?(o=i.url,r=\"gltf\"):(d.test(n)||b.test(e))&&(o=i.url,r=\"glb\")),s.set(e,i.url),i.files.forEach(((e,t)=>s.set(t,e)));if(null==o)throw new e(\"mesh-load-external:missing-files\",\"Missing files to load external mesh source\");return new T(o,(()=>t.forEach((({source:e})=>e.dispose()))),s,r)}class T{constructor(e,t=(()=>{}),s=new Map,r){this.url=e,this.dispose=t,this.files=s,this.type=r}static fromBlob(e,t){const s=URL.createObjectURL(e);return new T(s,(()=>URL.revokeObjectURL(s)),void 0,t)}}function v(e,t){return y.test(t)||g.test(e)?\"gltf\":d.test(t)||g.test(e)?\"glb\":void 0}export{c as loadExternal};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../request.js\";import{equals as r}from\"../../../core/arrayUtils.js\";import{throwIfAborted as e}from\"../../../core/promiseUtils.js\";import{getFileFormatId as s,getMimeTypeFormatId as n,getFilenameFormatId as a}from\"../../../layers/support/infoFor3D.js\";class i{constructor(t,r,e){this.assetName=t,this.assetMimeType=r,this.parts=e}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&r(this.parts,t.parts,((t,r)=>t.equals(r)))}isOnService(t){return this.parts.every((r=>r.isOnService(t)))}makeHash(){let t=\"\";for(const r of this.parts)t+=r.partHash;return t}async toBlob(t){const{parts:r}=this;if(1===r.length)return r[0].toBlob(t);const s=await Promise.all(r.map((r=>r.toBlob(t))));return e(t),new Blob(s)}}class o{constructor(t,r){this.partUrl=t,this.partHash=r}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(r){const{data:s}=await t(this.partUrl,{responseType:\"blob\"});return e(r),s}}function u(t){return p(t?.source)}function c(t){if(!Array.isArray(t))return!1;return t.every((t=>t instanceof i))}const f=/^(model\\/gltf\\+json)|(model\\/gltf-binary)$/,l=/\\.(gltf|glb)/i;function p(t){if(!t)return!1;if(Array.isArray(t)){return t.some(m)}return m(t)}function m(t){if(t instanceof File){const{type:r,name:e}=t;return f.test(r)||l.test(e)}return f.test(t.assetMimeType)||l.test(t.assetName)}function h(t,r){if(!t)return!1;const{source:e}=t;return g(e,r)}function y(t,r){if(t===r)return!0;const{source:e}=t,{source:s}=r;if(e===s)return!0;if(c(e)&&c(s)){if(e.length!==s.length)return!1;const t=(t,r)=>t.assetNamer.assetName?1:0,r=[...e].sort(t),n=[...s].sort(t);for(let e=0;e0&&e.every((t=>b(t,r)))}return b(t,r)}function b(t,r){return t instanceof i&&t.isOnService(r)}function N(t,r){return t instanceof File?s(t,r):n(t.assetMimeType,r)??a(t.assetName,r)}function A(t){return Array.isArray(t)?t:[t]}function v(t){return!!t.original}export{i as ServiceAsset,o as ServiceAssetPart,N as assetFormatId,b as assetIsOnService,h as externalIsOnService,A as externalSourceToMultiPart,y as externalSourcesAreEqual,m as isDisplayAsset,u as isDisplayExternal,p as isDisplaySource,v as isOriginalExternal,g as sourceIsOnService};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import{Clonable as r}from\"../../../core/Clonable.js\";import t from\"../../../core/Collection.js\";import{on as o}from\"../../../core/reactiveUtils.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as i}from\"../../../core/accessorSupport/decorators/subclass.js\";import{isDisplayExternal as l,externalSourcesAreEqual as c,externalIsOnService as p}from\"./External.js\";let a=class extends r{constructor(){super(),this.externalSources=new t,this._explicitDisplaySource=null,this.addHandles(o((()=>this.externalSources),\"after-remove\",(({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)}),{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!l(e))throw new Error(\"Cannot use this source for display: it is not in a supported format.\");this._explicitDisplaySource=e,e&&this.externalSources.every((r=>!c(r,e)))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter((r=>p(r,e)))}get _implicitDisplaySource(){return this.externalSources.find(l)}};e([s()],a.prototype,\"externalSources\",void 0),e([s()],a.prototype,\"displaySource\",null),e([s()],a.prototype,\"_implicitDisplaySource\",null),e([s()],a.prototype,\"_explicitDisplaySource\",void 0),a=e([i(\"esri.geometry.support.meshUtils.Metadata\")],a);export{a as Metadata};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{f as t}from\"../../../chunks/mat3.js\";import{a as e}from\"../../../chunks/mat3f64.js\";import{a as n}from\"../../../chunks/mat4f64.js\";import{g as r,t as o}from\"../../../chunks/vec3.js\";import{c as i}from\"../../../chunks/vec3f64.js\";import{getSphericalPCPF as s}from\"../../spatialReferenceEllipsoidUtils.js\";import{computeTranslationToOriginAndRotation as l}from\"../../projection/computeTranslationToOriginAndRotation.js\";import{validateGeographicFlag as a,isGeographicMesh as u}from\"./geographicUtils.js\";import{projectToPCPF as f,projectNormalToPCPF as c,projectTangentToPCPF as m,projectFromPCPF as p,projectNormalFromPCPF as g,projectTangentFromPCPF as h}from\"./projection.js\";const j=\"esri.geometry.support.meshUtils.offset\";function v(t,e,n){if(!t.vertexAttributes?.position)return;const{vertexSpace:r}=t;if(r.isRelative)a(r,j,n),x(r,e);else{u(t.spatialReference,n)?A(t,e):b(t,e)}}function x(t,e){const n=t.origin;t.origin=r(i(),n,e)}function A(e,n){const r=e.spatialReference,i=e.vertexAttributes.position,a=e.vertexAttributes.normal,u=e.vertexAttributes.tangent,j=new Float64Array(i.length),v=null!=a?new Float32Array(a.length):null,x=null!=u?new Float32Array(u.length):null,A=e.extent.center,b=y;l(r,[A.x,A.y,A.z],R,s(r)),t(d,R),o(b,n,d),f(i,r,j),null!=a&&null!=v&&c(a,i,j,r,v),null!=u&&null!=x&&m(u,i,j,r,x),k(j,b),p(j,i,r),null!=a&&null!=v&&g(v,i,j,r,a),null!=u&&null!=x&&h(x,i,j,r,u),e.vertexAttributesChanged()}function b(t,e){k(t.vertexAttributes.position,e),t.vertexAttributesChanged()}function k(t,e){if(t)for(let n=0;n=a&&o=e-1,w=2===p||4===p,m=t?n-1:n;for(let v=0;v<=m;v++){const g=v/m*2*Math.PI,A=t?0:.5;M[0]=A*Math.sin(g),M[1]=A*-Math.cos(g),M[2]=p<=2?.5:-.5;for(let t=0;t<3;t++)o[l++]=M[t],s[c++]=r?2===t?p<=1?1:-1:0:2===t?0:M[t]/A;a[f++]=(v+(t?.5:0))/n,a[f++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,w||0===p||v===n||(p!==e&&(i[u++]=h,i[u++]=h+1,i[u++]=h-n),1!==p&&(i[u++]=h,i[u++]=h-n,i[u++]=h-n-1)),h++}}return{position:o,normal:s,uv:a,faces:i}}function u(t,e){const n=\"number\"==typeof e?e:null!=e?e.width:1,r=\"number\"==typeof e?e:null!=e?e.height:1;switch(t){case\"up\":case\"down\":return{width:n,depth:r};case\"north\":case\"south\":return{width:n,height:r};case\"east\":case\"west\":return{depth:n,height:r}}}function h(t){const e=v.facingAxisOrderSwap[t],n=v.position,r=v.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let a=0;for(let i=0;i<4;i++){const t=a;for(let i=0;i<3;i++){const l=e[i],c=Math.abs(l)-1,f=l>=0?1:-1;o[a]=n[t+c]*f,s[a]=r[t+c]*f,a++}}return{position:o,normal:s,uv:new Float32Array(v.uv),faces:new Uint32Array(v.faces),isPlane:!0}}const p=1,w=2,m=3,v={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[m,p,w],west:[-m,-p,w],north:[-p,m,w],south:[p,-m,w],up:[p,w,m],down:[p,-w,-m]}};function g(t,e,n){t.isPlane||A(t),x(t,n?.size);const{vertexAttributes:r,vertexSpace:i,transform:l}=a(t,e,n);return{vertexAttributes:new s({...r,uv:t.uv}),vertexSpace:i,transform:l,components:[new o({faces:t.faces,material:n?.material||null})],spatialReference:e.spatialReference}}function A(t){for(let e=0;e{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new n,r=e.getData?.(t).then((t=>new File([t],e.filename)));r&&a.push(r)})),Promise.all(a)}export{t as extractZipFile,e as extractZipFiles};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../core/Error.js\";import r from\"../core/Loadable.js\";import s from\"../core/Logger.js\";import{EsriPromiseMixin as o}from\"../core/Promise.js\";import{whenOrAbort as n}from\"../core/promiseUtils.js\";import{watch as i}from\"../core/reactiveUtils.js\";import{property as a}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";import{c as p}from\"../chunks/vec3f64.js\";import m from\"./Extent.js\";import l from\"./Geometry.js\";import h from\"./Point.js\";import u from\"./Polygon.js\";import{composeAxes as f,create as d}from\"./support/axisAngleDegrees.js\";import g from\"./support/MeshComponent.js\";import{MeshNotLoadedError as x,ComponentNotFoundError as y,InvalidLocationError as w,InvalidPolygonError as v,NoLayerError as j,NoModelError as S,MultipleModelsError as b}from\"./support/meshErrors.js\";import F from\"./support/MeshGeoreferencedRelativeVertexSpace.js\";import A from\"./support/MeshGeoreferencedVertexSpace.js\";import R from\"./support/MeshLocalVertexSpace.js\";import L from\"./support/MeshTransform.js\";import{MeshVertexAttributes as U}from\"./support/MeshVertexAttributes.js\";import{triangulate as M}from\"./support/triangulationUtils.js\";import{getProjectedExtent as E,getExtentFromPositions as P}from\"./support/meshUtils/bounds.js\";import{centerAt as C}from\"./support/meshUtils/centerAt.js\";import{project as _}from\"./support/meshUtils/georeference.js\";import{loadExternal as z}from\"./support/meshUtils/loadExternal.js\";import{Metadata as G}from\"./support/meshUtils/Metadata.js\";import{offset as O}from\"./support/meshUtils/offset.js\";import{convertUnitGeometry as T,createUnitSizeBox as V,extractSingleFaceOfBox as D,createUnitSizeSphere as W,createUnitSizeCylinder as B,convertPlaneSizeParameter as k,createUnitSizePlane as N}from\"./support/meshUtils/primitives.js\";import{rotate as Z}from\"./support/meshUtils/rotate.js\";import{scale as H}from\"./support/meshUtils/scale.js\";import{isFileEditFormat as I,isFileSupported as K}from\"../layers/support/infoFor3D.js\";import{extractZipFiles as q}from\"../support/zipUtils.js\";var J;const Q=\"esri.geometry.Mesh\",X={base:null,key:\"type\",defaultKeyValue:\"georeferenced\",typeMap:{georeferenced:A,\"georeferenced-relative\":F,local:R}};let Y=J=class extends(r.LoadableMixin(o(l))){constructor(e){super(e),this.components=null,this.vertexSpace=new A,this.transform=null,this.metadata=new G,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new U,this.type=\"mesh\"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus=\"loaded\"),this.when((()=>{this.addHandles(i((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:r,vertexSpace:s}=this,o=r.position;if(0===o.length||e&&0===e.length)return new m({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if(\"local\"===s.type){const{_untransformedExtent:e,transform:r}=this;return E(e,r,s,t)}if(\"georeferenced-relative\"===s.type){const{transform:e}=this,r=_({positions:o,transform:e,vertexSpace:s,inSpatialReference:t,outSpatialReference:t});return P(r,t)}return P(o,t)}get _untransformedExtent(){return P(this.vertexAttributes.position,this.spatialReference)}get anchor(){const{vertexSpace:e}=this;if(e.isRelative)return e.getOriginPoint(this.spatialReference);const{center:t,zmin:r}=this._transformedExtent;return new h({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get origin(){const{vertexSpace:e}=this;return e.isRelative?e.getOriginPoint(this.spatialReference):this._transformedExtent.center}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){if(!this.loaded)return s.getLogger(this).error(\"addComponent()\",(new x).message);this.components||(this.components=[]),this.components.push(g.from(e)),this.notifyChange(\"components\")}removeComponent(e){if(!this.loaded)return s.getLogger(this).error(\"removeComponent()\",(new x).message);if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange(\"components\")}s.getLogger(this).error(\"removeComponent()\",(new y).message)}rotate(e,t,r,s){return f(e,t,r,ee),Z(this,ee,s),this}offset(e,t,r,o){return this.loaded?($[0]=e,$[1]=t,$[2]=r,O(this,$,o),this):(s.getLogger(this).error(\"offset()\",(new x).message),this)}scale(e,t){return this.loaded?(H(this,e,t),this):(s.getLogger(this).error(\"scale()\",(new x).message),this)}centerAt(e,t){return this.loaded?(C(this,e,t),this):(s.getLogger(this).error(\"centerAt()\",(new x).message),this)}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(z(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneWithVertexSpace(this.vertexSpace.clone())}cloneWithVertexSpace(e){let t=null;if(this.components){const e=new Map,r=new Map;t=this.components.map((t=>t.cloneWithDeduplication(e,r)))}const r={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:e,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new J(r)}cloneShallow(){return new J({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange(\"vertexAttributes\")}async toBinaryGLTF(e){const t=import(\"./support/meshUtils/exporters/gltf/gltfexport.js\"),r=this.load(),s=await Promise.all([t,r]),{toBinaryGLTF:o}=s[0];return o(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,null!=this.components)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}static createBox(e,t){if(!(e instanceof h))return s.getLogger(Q).error(\".createBox()\",(new w).message),null;const r=new J(T(V(),e,t));return t?.imageFace&&\"all\"!==t.imageFace?D(r,t.imageFace):r}static createSphere(e,t){return e instanceof h?new J(T(W(t?.densificationFactor||0),e,t)):(s.getLogger(Q).error(\".createSphere()\",(new w).message),null)}static createCylinder(e,t){return e instanceof h?new J(T(B(t?.densificationFactor||0),e,t)):(s.getLogger(Q).error(\".createCylinder()\",(new w).message),null)}static createPlane(e,t){if(!(e instanceof h))return s.getLogger(Q).error(\".createPlane()\",(new w).message),null;const r=t?.facing??\"up\",o=k(r,t?.size);return new J(T(N(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof u))return s.getLogger(Q).error(\".createFromPolygon()\",(new v).message),null;const r=M(e);return new J({vertexAttributes:new U({position:r.position}),components:[new g({faces:r.faces,shading:\"flat\",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new A})}static async createFromGLTF(e,t,r){if(!(e instanceof h)){const e=new w;throw s.getLogger(Q).error(\".createfromGLTF()\",e.message),e}const{loadGLTFMesh:o}=await n(import(\"./support/meshUtils/loadGLTFMesh.js\"),r);return new J(await o(e,t,r))}static async createFromFiles(e,t,r){const o=e=>s.getLogger(Q).error(\".createFromFiles()\",e.message);if(!(e instanceof h)){const e=new w;throw o(e),e}const n=r?.layer;if(!n){const e=new j;throw o(e),e}const i=await J.extractAndFilterFiles(t,n),a=i.reduce(((e,t)=>I(n.infoFor3D,t)?e+1:e),0);if(0===a){const e=new S;throw o(e),e}if(a>1){const e=new b;throw o(e),e}const c=J.createWithExternalSource(e,i),[p]=await n.uploadAssets([c],r);return p}static async extractAndFilterFiles(e,t){const r=t?.infoFor3D;if(!r)return e;return(await q(e)).filter((e=>K(r,e)))}static createWithExternalSource(e,t,r){const s=r?.extent??null,{x:o,y:n,z:i,spatialReference:a}=e,c=r?.transform?.clone()??new L,p=r?.vertexSpace??new R({origin:[o,n,i??0]}),m={source:t,extent:s},l=new G;return l.externalSources.push(m),new J({metadata:l,transform:c,vertexSpace:p,spatialReference:a})}static createIncomplete(e,r){const{x:s,y:o,z:n,spatialReference:i}=e,a=r?.transform?.clone()??new L,c=r?.vertexSpace??new R({origin:[s,o,n??0]}),p=new J({transform:a,vertexSpace:c,spatialReference:i});return p.addResolvingPromise(Promise.reject(new t(\"mesh-incomplete\",\"Mesh resources are not complete\"))),p}};e([a({type:[g],json:{write:!0}})],Y.prototype,\"components\",void 0),e([a({nonNullable:!0,types:X,constructOnly:!0,json:{write:!0}})],Y.prototype,\"vertexSpace\",void 0),e([a({type:L,json:{write:!0}})],Y.prototype,\"transform\",void 0),e([a({constructOnly:!0})],Y.prototype,\"metadata\",void 0),e([a()],Y.prototype,\"hasExtent\",null),e([a()],Y.prototype,\"_transformedExtent\",null),e([a()],Y.prototype,\"_untransformedExtent\",null),e([a()],Y.prototype,\"anchor\",null),e([a()],Y.prototype,\"origin\",null),e([a({readOnly:!0,json:{read:!1}})],Y.prototype,\"extent\",null),e([a({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Y.prototype,\"hasZ\",void 0),e([a({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Y.prototype,\"hasM\",void 0),e([a({type:U,nonNullable:!0,json:{write:!0}})],Y.prototype,\"vertexAttributes\",void 0),Y=J=e([c(Q)],Y);const $=p(),ee=d(),te=Y;export{te as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../Graphic.js\";import t from\"../../core/Logger.js\";import{getOrCreateMapValue as r}from\"../../core/MapUtils.js\";import{f as o}from\"../../chunks/vec3f64.js\";import n from\"../../geometry/Extent.js\";import s from\"../../geometry/Mesh.js\";import i from\"../../geometry/Point.js\";import a from\"../../geometry/SpatialReference.js\";import u from\"../../geometry/support/MeshGeoreferencedRelativeVertexSpace.js\";import c from\"../../geometry/support/MeshLocalVertexSpace.js\";import f from\"../../geometry/support/MeshTransform.js\";import{ServiceAssetPart as m,ServiceAsset as p}from\"../../geometry/support/meshUtils/External.js\";import{getFormatIdMimeType as l}from\"../../layers/support/infoFor3D.js\";import g from\"./FeatureSet.js\";const h=()=>t.getLogger(\"esri.rest.support.meshFeatureSet\");function y(t,r,o){const n=o.features;o.features=[],delete o.geometryType;const s=g.fromJSON(o);if(s.geometryType=\"mesh\",!o.assetMaps)return s;const i=M(r,o.assetMaps),u=t.sourceSpatialReference??a.WGS84,c=o.globalIdFieldName,{outFields:f}=t,m=null!=f&&f.length>0?E(f.includes(\"*\")?null:new Set(f)):()=>({});for(const a of n){const t=S(a,c,u,r,i);null!=t&&s.features.push(new e({geometry:t,attributes:m(a)}))}return s}function E(e){return({attributes:t})=>{if(!t)return{};if(!e)return t;for(const r in t)e.has(r)||delete t[r];return t}}function S(e,t,r,o,i){const a=e.attributes[t],f=i.get(a);if(null==f)return h().error(\"mesh-feature-set:asset-not-found\",\"Service returned a feature which was not found in the asset map\",e),null;if(!e.geometry)return h().error(\"mesh-feature-set:no-geometry\",\"Service returned a feature without geometry\",e),null;const{originPoint:m,originVector:p}=d(e,r,o),l=n.fromJSON(e.geometry);l.spatialReference=r;const g=j(e.attributes,o),y=f.projectVertices?new u({origin:p}):new c({origin:p}),E=T(f);return E?s.createWithExternalSource(m,E,{extent:l,transform:g,vertexSpace:y}):s.createIncomplete(m,{extent:l,transform:g,vertexSpace:y})}function d({attributes:e},t,{transformFieldRoles:r}){const n=e[r.originX],s=e[r.originY],a=e[r.originZ];return{originPoint:new i({x:n,y:s,z:a,spatialReference:t}),originVector:o(n,s,a)}}function j(e,{transformFieldRoles:t}){return new f({translation:[e[t.translationX],-e[t.translationZ],e[t.translationY]],rotationAxis:[e[t.rotationX],-e[t.rotationZ],e[t.rotationY]],rotationAngle:e[t.rotationDeg],scale:[e[t.scaleX],e[t.scaleZ],e[t.scaleY]]})}var w;function M(e,t){const o=new Map;for(const n of t){const t=n.parentGlobalId;if(null==t)continue;const s=n.assetName,i=n.assetType,a=n.assetHash,u=n.assetURL,c=n.conversionStatus,f=n.seqNo,m=l(i,e.supportedFormats);if(!m){h().error(\"mesh-feature-set:unknown-format\",`Service returned an asset of type ${i}, but it does not list it as a supported type`);continue}const p=r(o,t,(()=>({projectVertices:P(n.flags).projectVertices,files:new Map})));r(p.files,s,(()=>({name:s,type:i,mimeType:m,status:D(c),parts:[]}))).parts[f]={hash:a,url:u}}return o}function T(e){const t=Array.from(e.files.values()),r=new Array;for(const o of t){if(o.status!==w.COMPLETED)return null;const e=new Array;for(const t of o.parts){if(!t)return null;e.push(new m(t.url,t.hash))}r.push(new p(o.name,o.mimeType,e))}return r}function D(e){switch(e){case\"COMPLETED\":case\"SUBMITTED\":return w.COMPLETED;case\"INPROGRESS\":return w.PENDING;default:return w.FAILED}}function P(e){return{projectVertices:e.includes(\"PROJECT_VERTICES\")}}!function(e){e[e.FAILED=0]=\"FAILED\",e[e.PENDING=1]=\"PENDING\",e[e.COMPLETED=2]=\"COMPLETED\"}(w||(w={}));export{M as assetMapFromAssetMapsJSON,S as extractMesh,y as meshFeatureSetFromJSON};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport s from\"../../../request.js\";import r from\"../../../core/Error.js\";import{parseUrl as t,asValidOptions as o,encode as i}from\"../../utils.js\";async function e(e,n,m,u){if(!n)throw new r(\"post:missing-guid\",\"guid for version is missing\");const a=t(e),c=m.toJSON(),d=o(a.query,{query:i({...c,f:\"json\"}),...u,method:\"post\"});n.startsWith(\"{\")&&(n=n.slice(1,-1));const f=`${a.path}/versions/${n}/deleteForwardEdits`,{data:p}=await s(f,d);return p.success}export{e as deleteForwardEdits};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../../../core/JSONSupport.js\";import{property as s}from\"../../../../core/accessorSupport/decorators/property.js\";import{ensureClass as t}from\"../../../../core/accessorSupport/ensureType.js\";import\"../../../../core/arrayUtils.js\";import\"../../../../core/has.js\";import{subclass as e}from\"../../../../core/accessorSupport/decorators/subclass.js\";var p;let i=p=class extends o{static from(r){return t(p,r)}constructor(r){super(r),this.sessionId=void 0,this.moment=null}};r([s({type:String,json:{write:!0}})],i.prototype,\"sessionId\",void 0),r([s({type:Date,json:{type:Number,write:{writer:(r,o)=>{o.moment=r?r.getTime():null}}}})],i.prototype,\"moment\",void 0),i=p=r([e(\"esri.rest.versionManagement.gdbVersion.support.PostParameters\")],i);const m=i;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../Graphic.js\";import t from\"../../core/Collection.js\";import a from\"../../core/Error.js\";import{clone as r}from\"../../core/lang.js\";import s from\"../../core/Logger.js\";import{createResolver as o}from\"../../core/promiseUtils.js\";import{dataComponents as i}from\"../../core/urlUtils.js\";import{generateBracedUUID as n}from\"../../core/uuid.js\";import{normalizeCentralMeridian as d}from\"../../geometry/support/normalizeUtils.js\";import{isEditBusLayer as l,emitApplyEditsEvent as u}from\"../mixins/EditBusLayer.js\";import{isValidFieldValue as p}from\"../support/fieldUtils.js\";import{getMimeTypeFormatId as c,getFilenameFormatId as h}from\"../support/infoFor3D.js\";import{getEffectiveEditingEnabled as m,getEffectiveLayerCapabilities as f}from\"../support/layerUtils.js\";function y(e){return null!=e?.applyEdits}function g(e){return\"object\"==typeof e&&null!=e&&\"objectId\"in e&&!!e.objectId}function b(e){return e.every(g)}function w(e){return\"object\"==typeof e&&null!=e&&\"globalId\"in e&&!!e.globalId}function F(e){return e.every(w)}async function A(e,t,a,s={}){let i;const n=\"gdbVersion\"in e?e.gdbVersion:null,d=s.gdbVersion??n;if(l(e)&&e.url)i=u(e.url,e.layerId,d,\"original-and-current-features\"===s.returnServiceEditsOption);else{i=o(),i.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit(\"edits\",t)}));const t={result:i.promise};e.emit(\"apply-edits\",t)}try{const{results:o,edits:n}=await v(e,t,a,s),d=e=>e.filter((e=>!e.error)).map(r),l={edits:n,addedFeatures:d(o.addFeatureResults),updatedFeatures:d(o.updateFeatureResults),deletedFeatures:d(o.deleteFeatureResults),addedAttachments:d(o.addAttachmentResults),updatedAttachments:d(o.updateAttachmentResults),deletedAttachments:d(o.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:o.editMoment?new Date(o.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return o.editedFeatureResults?.length&&(l.editedFeatures=o.editedFeatureResults),i.resolve(l),o}catch(p){throw i.reject(p),p}}async function v(e,t,r,s){if(await e.load(),!y(t))throw new a(`${e.type}-layer:no-editing-support`,\"Layer source does not support applyEdits capability\",{layer:e});if(!m(e))throw new a(`${e.type}-layer:editing-disabled`,\"Editing is disabled for layer\",{layer:e});const{edits:o,options:i}=await I(e,r,s);return o.addFeatures?.length||o.updateFeatures?.length||o.deleteFeatures?.length||o.addAttachments?.length||o.updateAttachments?.length||o.deleteAttachments?.length?{edits:o,results:await t.applyEdits(o,i)}:{edits:o,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function I(e,t,r){const o=f(e),i=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(T(t,o,r,!!i,!!n,`${e.type}-layer`),!o.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,\"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'\");if(!o.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,\"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'\");const l={...r};if(null!=l.rollbackOnFailureEnabled||o.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||\"original-and-current-features\"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&s.getLogger(\"esri.layers.graphics.editingSupport\").warn(`${e.type}-layer:invalid-parameter`,\"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true.\"),l.rollbackOnFailureEnabled=!0),!o.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,\"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'\");if(l.returnServiceEditsInSourceSR&&\"original-and-current-features\"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,\"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'\");const u=B(t,o,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter((e=>\"big-integer\"===e.type||\"oid\"===e.type&&(e.length||0)>=8));if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,\"Layer does not specify a global id field.\");u.addFeatures.forEach((e=>U(e,t)))}u.addFeatures.forEach((t=>S(t,e,p,c))),u.updateFeatures.forEach((t=>j(t,e,p,c))),u.deleteFeatures.forEach((t=>R(t,e,p,c))),u.addAttachments.forEach((t=>O(t,e))),u.updateAttachments.forEach((t=>O(t,e))),d&&await G(u,e);return{edits:await L(u),options:l}}function $(e,t,r,s){if(r){if(\"attributes\"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!(\"attributes\"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,\"`'globalId' of the feature should be passed when 'globalIdUsed' is true\")}if(s.length&&\"attributes\"in e)for(const o of s){const r=e.attributes[o.name];if(void 0!==r&&!p(o,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${o.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if(\"geometry\"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,\"Layer does not support z values while feature has z values.\");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,\"Layer does not support m values while feature has m values.\")}}function E(e,t){if(\"geometry\"in e&&\"mesh\"===e.geometry?.type&&null!=t.infoFor3D){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new a(`${t.type}-layer:georeferenced-mesh-unsupported`,\"Uploading georeferenced meshes to a layer is not supported.\")}}function S(e,t,a,r){$(e,t,a,r),E(e,t)}function R(e,t,a,r){$(e,t,a,r)}function j(e,t,r,s){$(e,t,r,s),E(e,t);const o=f(t);if(\"geometry\"in e&&null!=e.geometry&&!o?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,\"Layer does not support geometry updates.\")}function O(e,t){const{feature:r,attachment:s}=e;if(!r||\"attributes\"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,\"Attachment should have reference to a feature with 'globalId'\");if(!(\"attributes\"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,\"Attachment should have reference to 'globalId' of the parent feature\");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,\"Attachment should have 'globalId'\");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,\"Attachment should have 'data' or 'uploadId'\");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,\"'name' is required when attachment is specified as Base64 encoded string using 'data'\");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,\"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'\");if(\"string\"==typeof s.data){const e=i(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,\"Attachment 'data' should be a Blob, File or Base64 encoded string\")}}function U(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=n())}async function L(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),s=await d(r),o=t.length,i=a.length;return s.slice(0,o).forEach(((e,a)=>t[a].geometry=e)),s.slice(o,o+i).forEach(((e,t)=>a[t].geometry=e)),e}function k(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function B(e,t,r){const s=k(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,\"Layer does not support adding features.\");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,\"Layer does not support updating features.\");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,\"Layer does not support deleting features.\");return s.addFeatures=s.addFeatures.map(D),s.updateFeatures=s.updateFeatures.map(D),s.addAssetFeatures=[],s}function T(e,t,r,s,o,i){if(!e||!s&&!o)throw new a(`${i}:missing-parameters`,\"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required\");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new a(`${i}:invalid-parameter`,\"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'\");if(!t.editing.supportsGlobalId&&o)throw new a(`${i}:invalid-parameter`,\"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'\");if(!r?.globalIdUsed&&o)throw new a(`${i}:invalid-parameter`,\"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true\")}function D(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function G(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,s=c(\"model/gltf-binary\",r.supportedFormats)??h(\"glb\",r.supportedFormats);if(!(!!s&&r.editFormats.includes(s)))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,\"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.\");e.addAssetFeatures??=[];const{addAssetFeatures:o}=e;for(const a of e.addFeatures??[])V(a)&&o.push(a);for(const a of e.updateFeatures??[])V(a)&&o.push(a)}function V(e){return\"mesh\"===e?.geometry?.type}function M(e,t,r,s){if(!y(t))throw new a(`${e.type}-layer:no-editing-support`,\"Layer source does not support applyEdits capability\",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,\"Layer source does not support uploadAssets capability\",{layer:e});return t.uploadAssets(r,s)}export{A as applyEdits,T as checkEditingCapabilities,F as isFeatureIdentifierArrayWithGlobalId,b as isFeatureIdentifierArrayWithObjectId,w as isFeatureIdentifierWithGlobalId,g as isFeatureIdentifierWithObjectId,k as normalizeCollections,B as normalizeEdits,L as normalizeGeometries,D as shallowCloneFeature,M as uploadAssets};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction i(i){return i&&\"getAtOrigin\"in i&&\"originOf\"in i}export{i as isMultiOriginJSONMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{isMultiOriginJSONMixin as r}from\"../multiOriginJSONSupportUtils.js\";function i(i){i?.writtenProperties&&i.writtenProperties.forEach((({target:i,propName:t,newOrigin:e})=>{r(i)&&e&&i.originOf(t)!==e&&i.updateOrigin(t,e)}))}export{i as updateOrigins};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport o from\"../config.js\";import r from\"../core/Error.js\";import{supportsApiKey as p}from\"../support/apiKeyUtils.js\";function i(i){if(o.apiKey&&p(i.portal.url))throw new r(\"save-api-key-utils:api-key-not-supported\",`Saving is not supported on ${i.portal.url} when using an api key`)}export{i as validateSaveAPIKey};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import{updateOrigins as t}from\"../../core/accessorSupport/originUtils.js\";import r from\"../../portal/Portal.js\";import o from\"../../portal/PortalItem.js\";import{createForItemWrite as a}from\"../../portal/support/jsonContext.js\";import{addTypeKeyword as i,TypeKeyword as n}from\"../../portal/support/portalItemUtils.js\";import{validateSaveAPIKey as s}from\"../../webdoc/saveAPIKeyUtils.js\";function l(t,r,o){const a=o(t);if(!a.isValid)throw new e(`${r}:invalid-parameters`,a.errorMessage,{layer:t})}async function p(e){const{layer:t,errorNamePrefix:r,validateLayer:o}=e;await t.load(),l(t,r,o)}function m(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function c(t){const{item:r,itemType:o,errorNamePrefix:a,layer:i,validateItem:n}=t;if(s(r),r.type!==o)throw new e(`${a}:portal-item-wrong-type`,`Portal item type should be \"${o}\"`,{item:r,layer:i});if(n){const t=n(r);if(!t.isValid)throw new e(`${a}:invalid-parameters`,t.errorMessage,{layer:i})}}function d(t){const{layer:r,errorNamePrefix:o}=t,{portalItem:a}=r;if(!a)throw new e(`${o}:portal-item-not-set`,m(r,\"requires the portalItem property to be set\"));if(!a.loaded)throw new e(`${o}:portal-item-not-loaded`,m(r,\"cannot be saved to a portal item that does not exist or is inaccessible\"));c({...t,item:a})}function u(e){const{newItem:t,itemType:a}=e;let i=o.from(t);return i.id&&(i=i.clone(),i.id=null),i.type??=a,i.portal??=r.getDefault(),c({...e,item:i}),i}function f(t,r){let o=(t.messages??[]).filter((({type:e})=>\"error\"===e)).map((({name:t,message:r,details:o})=>new e(t,r,o)));if(t.blockedRelativeUrls&&(o=o.concat(t.blockedRelativeUrls.map((t=>new e(\"url:unsupported\",`Relative url '${t}' is not supported`))))),r?.ignoreUnsupported&&(o=o.filter((({name:e})=>\"layer:unsupported\"!==e&&\"symbol:unsupported\"!==e&&\"symbol-layer:unsupported\"!==e&&\"property:unsupported\"!==e&&\"url:unsupported\"!==e))),o.length>0)throw new e(\"layer-write:unsupported\",\"Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information\",{errors:o})}async function y(e,t,r){\"beforeSave\"in e&&\"function\"==typeof e.beforeSave&&await e.beforeSave();const o=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),f(t,r),o}function w(e){i(e,n.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function v(e,t,r){const o=e.portal;await o.signIn(),await(o.user?.addItem({item:e,data:t,folder:r?.folder}))}async function I(e,r){const{layer:o,createItemData:i,createJSONContext:n,saveResources:s}=e;await p(e),d(e);const l=o.portalItem,m=n?n(l):a(l),c=await y(o,m,r),u=await i({layer:o,layerJSON:c},l);return w(l),await l.update({data:u}),t(m),await(s?.(l,m)),l}async function b(e,r){const{layer:o,createItemData:i,createJSONContext:n,setItemProperties:s,saveResources:l}=e;await p(e);const m=u(e),c=n?n(m):a(m),d=await y(o,c,r),f=await i({layer:o,layerJSON:d},m);return await s(o,m),w(m),await v(m,f,r),o.portalItem=m,t(c),await(l?.(m,c)),m}export{v as addItem,m as createErrorMessage,d as ensureItemConfig,l as ensureLayerConfig,y as getLayerJSON,u as getPortalItem,I as save,b as saveAs,w as setCommonItemProperties};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{difference as e,isSome as a}from\"../../core/arrayUtils.js\";import r from\"../../core/Error.js\";import{updateOrigins as t}from\"../../core/accessorSupport/originUtils.js\";import{save as o,getLayerJSON as s,setCommonItemProperties as n,saveAs as l,getPortalItem as i,addItem as c,ensureLayerConfig as u,ensureItemConfig as p,createErrorMessage as y}from\"./utils.js\";import{parse as m}from\"../support/arcgisLayerUrl.js\";import{fetchFeatureService as f}from\"../support/fetchService.js\";import{isLayerWithFeatureLayerSource as d}from\"../support/layerUtils.js\";import{layerLookupMap as h}from\"../support/lazyLayerLoader.js\";import{createForItemWrite as w}from\"../../portal/support/jsonContext.js\";import{getWGS84ExtentForItem as v,removeTypeKeyword as I,TypeKeyword as T,toggleTypeKeword as S,addTypeKeyword as b}from\"../../portal/support/portalItemUtils.js\";const L=\"Feature Service\",P=\"feature-layer-utils\",E=`${P}-save`,$=`${P}-save-as`,A=`${P}-saveall`,N=`${P}-saveall-as`;function g(e){return{isValid:d(e)&&(\"feature\"!==e.type||!e.dynamicDataSource),errorMessage:\"Feature layer should be a layer or table in a map or feature service\"}}function x(e){const a=[],r=[];for(const{layer:t,layerJSON:o}of e)t.isTable?r.push(o):a.push(o);return{layers:a,tables:r}}function j(e){return x([e])}async function O(e,a){return/\\/\\d+\\/?$/.test(e.url)?j(a[0]):U(a,e)}async function U(e,a){if(!a)return e.reverse(),x(e);const{layer:{url:r,customParameters:t,apiKey:o}}=e[0];let s=await a.fetchData(\"json\");null!=s?.layers&&null!=s?.tables||(s=await F(s,{url:r??\"\",customParameters:t,apiKey:o},e.map((e=>e.layer.layerId))));for(const n of e)K(n.layer,n.layerJSON,s);return s}async function F(e,a,r){e||={},e.layers||=[],e.tables||=[];const{url:t,customParameters:o,apiKey:s}=a,{serviceJSON:n,layersJSON:l}=await f(t,{customParameters:o,apiKey:s}),i=J(e.layers,n.layers,r),c=J(e.tables,n.tables,r);e.layers=i.itemResources,e.tables=c.itemResources;const u=[...i.added,...c.added],p=l?[...l.layers,...l.tables]:[];return await M(e,u,t,p),e}function J(a,r,t){const o=e(a,r,((e,a)=>e.id===a.id));a=a.filter((e=>!o.removed.some((a=>a.id===e.id))));const s=o.added;return s.forEach((({id:e})=>{a.push({id:e})})),{itemResources:a,added:s.filter((({id:e})=>!t.includes(e)))}}async function M(e,a,r,t){const o=await R(a),s=a.map((({id:e,type:a})=>new(o.get(a))({url:r,layerId:e,sourceJSON:t.find((({id:a})=>a===e))})));await Promise.allSettled(s.map((e=>e.load()))),s.forEach((a=>{const{layerId:r,loaded:t,defaultPopupTemplate:o}=a;if(!t||null==o)return;const s={id:r,popupInfo:o.toJSON()};\"ArcGISFeatureLayer\"!==a.operationalLayerType&&(s.layerType=a.operationalLayerType),K(a,s,e)}))}async function R(e){const a=[];e.forEach((({type:e})=>{const r=D(e),t=h[r];a.push(t())}));const r=await Promise.all(a),t=new Map;return e.forEach((({type:e},a)=>{t.set(e,r[a])})),t}function D(e){let a;switch(e){case\"Feature Layer\":case\"Table\":a=\"FeatureLayer\";break;case\"Oriented Imagery Layer\":a=\"OrientedImageryLayer\"}return a}function K(e,a,r){e.isTable?Y(r.tables,a):Y(r.layers,a)}function Y(e,a){const r=e.findIndex((({id:e})=>e===a.id));-1===r?e.push(a):e[r]=a}function _(e,a){if(!e.length)throw new r(`${a}:missing-parameters`,\"'layers' array should contain at least one feature layer\")}function z(e,a){const t=e.map((e=>e.portalItem.id));if(new Set(t).size>1)throw new r(`${a}:invalid-parameters`,\"All layers in the 'layers' array should be loaded from the same portal item\")}function G(e,a){const t=e.map((e=>e.layerId));if(new Set(t).size!==t.length)throw new r(`${a}:invalid-parameters`,\"'layers' array should contain only one instance each of layer or table in a feature service\")}async function B(e){_(e,A),await Promise.all(e.map((e=>e.load())));for(const a of e)u(a,A,g),p({layer:a,itemType:L,errorNamePrefix:A});z(e,A),G(e,A)}async function k(e,a){const{url:r,layerId:t,title:o,fullExtent:s,isTable:n}=e,l=m(r);a.url=\"FeatureServer\"===l?.serverType?r:`${r}/${t}`,a.title||=o,a.extent=null,n||null==s||(a.extent=await v(s)),I(a,T.METADATA),I(a,T.MULTI_LAYER),b(a,T.SINGLE_LAYER),n&&b(a,T.TABLE)}function C(e,a){for(const n of e){const t=n.parsedUrl.path,o=m(t),s=o?.url.path;if(!s)throw new r(`${a}:invalid-parameters`,y(n,`has unsupported url pattern: ${t}`),{layer:n});const l=o?.serverType;if(\"FeatureServer\"!==l&&\"MapServer\"!==l)throw new r(`${a}:invalid-parameters`,y(n,`has unsupported server type: ${l}`),{layer:n});if(\"MapServer\"===l&&e.length>1)throw new r(`${a}:invalid-parameters`,\"Only one layer or table in a map service can be saved\")}const t=m(e[0].parsedUrl.path),o=t?.url.path,s=e.every((e=>{const a=m(e.parsedUrl.path);return a?.url.path===o}));if(!s)throw new r(`${a}:invalid-parameters`,\"'layers' array should only contain layers or tables that belong to the same feature service\")}async function V(e){_(e,N),await Promise.all(e.map((e=>e.load())));for(const a of e)u(a,N,g);C(e,N),G(e,N)}async function q(e,r){let t=0,o=0;for(const{isTable:a}of r)a?o++:t++;const s=r[0].parsedUrl.path,l=m(s);if(e.url=\"FeatureServer\"===l?.serverType?l.url.path:s,e.title||=l.title,e.extent=null,t>0){const t=r.map((e=>e.fullExtent)).filter(a).reduce(((e,a)=>e.clone().union(a)));t&&(e.extent=await v(t))}I(e,T.METADATA),S(e,T.MULTI_LAYER,r.length>1),S(e,T.SINGLE_LAYER,1===r.length),S(e,T.TABLE,o>0&&0===t),n(e)}async function H(e,a){return o({layer:e,itemType:L,validateLayer:g,createItemData:(e,a)=>O(a,[e]),errorNamePrefix:E},a)}async function Q(e,a){await B(e);const r=e[0].portalItem,o=w(r),l=await Promise.all(e.map((e=>s(e,o,a)))),i=await O(r,e.map(((e,a)=>({layer:e,layerJSON:l[a]}))));return n(r),await r.update({data:i}),await Promise.all(e.slice(1).map((e=>e.portalItem.reload()))),t(o),r.clone()}async function W(e,a,r){return l({layer:e,itemType:L,validateLayer:g,createItemData:(e,a)=>Promise.resolve(j(e)),errorNamePrefix:$,newItem:a,setItemProperties:k},r)}async function X(e,a,r){await V(e);const o=i({itemType:L,errorNamePrefix:N,newItem:a}),n=w(o),l=await Promise.all(e.map((e=>s(e,n,r)))),u=await U(e.map(((e,a)=>({layer:e,layerJSON:l[a]}))));await q(o,e),await c(o,u,r);for(const t of e)t.portalItem=o.clone();return t(n),o}export{H as save,Q as saveAll,X as saveAllAs,W as saveAs};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{d as e}from\"../../chunks/mat4.js\";import{a as t}from\"../../chunks/mat4f64.js\";import r from\"./MeshGeoreferencedRelativeVertexSpace.js\";import{t as o}from\"../../chunks/vec32.js\";function n(t){const{vertexSpace:n}=t;if(n.isRelative)return t.clone();const{anchor:i}=t,c=i.clone(),a=e(s,[-c.x,-c.y,-c.z]),m=new r({origin:[c.x,c.y,c.z]}),p=t.cloneWithVertexSpace(m),{position:u}=p.vertexAttributes;return p.vertexAttributes.position=o(new Float64Array(u.length),u,a),p.vertexAttributesChanged(),p}const s=t();export{n as toRelativeVertexSpace};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../Graphic.js\";import t from\"../../core/Error.js\";import a from\"../../core/Logger.js\";import{getMetersPerCartesianUnitForSR as r}from\"../../core/unitUtils.js\";import{parseData as s}from\"../../core/urlUtils.js\";import{initializeProjection as o,project as n}from\"../../geometry/projection.js\";import{fromJSON as l}from\"../../geometry/support/jsonUtils.js\";import{isFeatureIdentifierArrayWithGlobalId as i,isFeatureIdentifierArrayWithObjectId as d}from\"./editingSupport.js\";async function u(e,t,a){const{geometry:s}=t,l={...t.attributes};if(null!=a&&\"mesh\"===s?.type){const{transformFieldRoles:t}=a,{origin:i,spatialReference:d,transform:u}=s,c=e.spatialReference;await o(d,c);const p=n(i,c);if(l[t.originX]=p.x,l[t.originY]=p.y,l[t.originZ]=p.z??0,null!=u){const{translation:e,scale:a,rotation:o}=u,{vertexSpace:n}=s,i=n.isGeoreferenced?1:r(d)/r(c);l[t.translationX]=e[0]*i,l[t.translationY]=e[2]*i,l[t.translationZ]=-e[1]*i,l[t.scaleX]=a[0],l[t.scaleY]=a[2],l[t.scaleZ]=a[1],l[t.rotationX]=o[0],l[t.rotationY]=o[2],l[t.rotationZ]=-o[1],l[t.rotationDeg]=o[3]}return{attributes:l}}return null==s?{attributes:l}:\"mesh\"===s.type||\"extent\"===s.type?null:{geometry:s.toJSON(),attributes:l}}async function c(e,t){const a=await Promise.all((t.addAttachments??[]).map((t=>p(e,t)))),r=await Promise.all((t.updateAttachments??[]).map((t=>p(e,t)))),s=t.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function p(e,t){const{feature:a,attachment:r}=t,{globalId:o,name:n,contentType:l,data:i,uploadId:d}=r,u={globalId:o};if(a&&(\"attributes\"in a?u.parentGlobalId=a.attributes?.[e.globalIdField]:a.globalId&&(u.parentGlobalId=a.globalId)),d)u.uploadId=d;else if(i){const e=await s(i);e&&(u.contentType=e.mediaType,u.data=e.data),i instanceof File&&(u.name=i.name)}return n&&(u.name=n),l&&(u.contentType=l),u}function m(e,t,a){if(!t||0===t.length)return[];if(a&&i(t))return t.map((e=>e.globalId));if(d(t))return t.map((e=>e.objectId));const r=a?e.globalIdField:e.objectIdField;return r?t.map((e=>e.getAttribute(r))):[]}function f(e){const t=e?.assetMaps;if(t){for(const e of t.addResults)e.success||a.getLogger(\"esri.layers.graphics.sources.support.sourceUtils\").error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(const e of t.updateResults)e.success||a.getLogger(\"esri.layers.graphics.sources.support.sourceUtils\").error(`Failed to map asset to feature with globalId ${e.globalId}.`)}const r=e?.attachments,s={addFeatureResults:e?.addResults?.map(g)??[],updateFeatureResults:e?.updateResults?.map(g)??[],deleteFeatureResults:e?.deleteResults?.map(g)??[],addAttachmentResults:r?.addResults?r.addResults.map(g):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(g):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(g):[]};return e?.editMoment&&(s.editMoment=e.editMoment),s}function g(e){const a=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:a?new t(\"feature-layer-source:edit-failure\",a.description,{code:a.code}):null}}function b(t,a){return new e({attributes:t.attributes,geometry:l({...t.geometry,spatialReference:a})})}function R(e,t){return{adds:e?.adds?.map((e=>b(e,t)))||[],updates:e?.updates?.map((e=>({original:b(e[0],t),current:b(e[1],t)})))||[],deletes:e?.deletes?.map((e=>b(e,t)))||[],spatialReference:t}}function I(e){const t=e.details.raw,a=+t.code,r=+t.extendedCode;return 500===a&&(-2147217144===r||-2147467261===r)}export{R as createEditedFeatures,g as createFeatureEditResult,c as getAttachmentEditsJSON,m as getFeatureIds,u as getFeatureJSON,I as isProtectedOrPrivateVersionError,f as unpackEditResultData};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import{id as t}from\"../../../kernel.js\";import s from\"../../../request.js\";import r from\"../../../TimeExtent.js\";import{isSome as a}from\"../../../core/arrayUtils.js\";import i from\"../../../core/Error.js\";import has from\"../../../core/has.js\";import{JSONMap as o}from\"../../../core/jsonMap.js\";import n from\"../../../core/Loadable.js\";import u from\"../../../core/Logger.js\";import{setDeepValue as l}from\"../../../core/object.js\";import{debounce as c,after as d,throwIfAbortError as p}from\"../../../core/promiseUtils.js\";import{join as y}from\"../../../core/urlUtils.js\";import{generateBracedUUID as h}from\"../../../core/uuid.js\";import{property as m}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import{subclass as f}from\"../../../core/accessorSupport/decorators/subclass.js\";import g from\"../../../geometry/Extent.js\";import{toRelativeVertexSpace as S}from\"../../../geometry/support/meshVertexSpaceUtils.js\";import{isOriginalExternal as w}from\"../../../geometry/support/meshUtils/External.js\";import{createFeatureEditResult as q,getFeatureJSON as E,getFeatureIds as R,getAttachmentEditsJSON as O,isProtectedOrPrivateVersionError as b,unpackEditResultData as A,createEditedFeatures as F}from\"../applyEditsUtils.js\";import{createDrawingInfo as _}from\"./support/clientSideDefaults.js\";import x from\"./support/QueryTask.js\";import{isHostedAgolService as j}from\"../../support/arcgisLayerUrl.js\";import{ensureLayerCredential as I}from\"../../support/featureLayerUtils.js\";import{getAssetMapTable as v}from\"../../support/infoFor3D.js\";import{executeQueryJSON as T}from\"../../../rest/query/executeQueryJSON.js\";import{unapplyEditsZUnitScaling as N}from\"../../../rest/query/operations/editsZScale.js\";import M from\"../../../rest/support/Query.js\";import{isSafeToEditVersion as U,isVersionInEditSession as J,currentSessionId as k}from\"../../../versionManagement/support/versionManagementUtils.js\";import C from\"../../../geometry/SpatialReference.js\";const L=new o({originalAndCurrentFeatures:\"original-and-current-features\",none:\"none\"}),Q=new Set([\"Feature Layer\",\"Oriented Imagery Layer\",\"Table\"]),D=new o({Started:\"published\",Publishing:\"publishing\",Stopped:\"unavailable\"});let P=class extends n{constructor(){super(...arguments),this.type=\"feature-layer\",this.refresh=c((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,s=this._fetchService(t,{...e}).then((()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e))).then((()=>this._ensureLatestMetadata(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:s,infoFor3D:r,gdbVersion:a,spatialReference:i,fieldsIndex:o}=this.layer,n=has(\"featurelayer-pbf\")&&e?.query.supportsFormatPBF&&null==r,u=e?.operations?.supportsQueryAttachments??!1;return new x({url:t.path,pbfSupported:n,fieldsIndex:o,infoFor3D:r,dynamicDataSource:s,gdbVersion:a,sourceSpatialReference:i,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const{layer:r}=this;await I(r,\"editing\");const a=e.attributes[r.objectIdField],i=r.parsedUrl.path+\"/\"+a+\"/addAttachment\",o=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(t,o.query);try{const e=await s(i,{body:n});return q(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,r){await this.load();const{layer:a}=this;await I(a,\"editing\");const i=e.attributes[a.objectIdField],o=a.parsedUrl.path+\"/\"+i+\"/updateAttachment\",n=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(r,n.query);try{const e=await s(o,{body:u});return q(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,r){await this.load();const{layer:i}=this;await I(i,\"editing\");const o=i.infoFor3D,n=null!=o,u=n||(r?.globalIdUsed??!1),l=n?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map((e=>E(this.layer,e,o)))??[],d=(await Promise.all(c)).filter(a),p=e.updateFeatures?.map((e=>E(this.layer,e,o)))??[],y=(await Promise.all(p)).filter(a),h=R(this.layer,e.deleteFeatures,u);N(d,y,i.spatialReference);const m=await O(this.layer,e),f=i.capabilities.editing.supportsAsyncApplyEdits&&n,g=r?.gdbVersion||i.gdbVersion,S={gdbVersion:g,rollbackOnFailure:r?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:r?.returnEditMoment,usePreviousEditMoment:r?.usePreviousEditMoment,async:f};await U(this.layer.url,g,!0);const w=J(this.layer.url,g||null);r?.returnServiceEditsOption?(S.edits=JSON.stringify([{id:i.layerId,adds:d,updates:y,deletes:h,attachments:m,assetMaps:l}]),S.returnServiceEditsOption=L.toJSON(r?.returnServiceEditsOption),S.returnServiceEditsInSourceSR=r?.returnServiceEditsInSourceSR):(S.adds=d.length?JSON.stringify(d):null,S.updates=y.length?JSON.stringify(y):null,S.deletes=h.length?u?JSON.stringify(h):h.join(\",\"):null,S.attachments=m&&JSON.stringify(m),S.assetMaps=null!=l?JSON.stringify(l):void 0);const q=this._getLayerRequestOptions({method:\"post\",query:S});w&&(q.authMode=\"immediate\",q.query.returnEditMoment=!0,q.query.sessionId=k);const A=r?.returnServiceEditsOption?i.url:i.parsedUrl.path;let F;try{F=f?await this._asyncApplyEdits(A+\"/applyEdits\",q):await s(A+\"/applyEdits\",q)}catch(_){if(!b(_))throw _;q.authMode=\"immediate\",F=f?await this._asyncApplyEdits(A+\"/applyEdits\",q):await s(A+\"/applyEdits\",q)}if(!i.capabilities.operations?.supportsEditing&&i.effectiveCapabilities?.operations?.supportsEditing){const e=t?.findCredential(i.url);await(e?.refreshToken())}return this._createEditsResult(F)}async deleteAttachments(e,t){await this.load();const{layer:r}=this;await I(r,\"editing\");const a=e.attributes[r.objectIdField],i=r.parsedUrl.path+\"/\"+a+\"/deleteAttachments\";try{return(await s(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(\",\")},method:\"post\"}))).data.deleteAttachmentResults.map(q)}catch(o){throw this._createAttachmentErrorResult(a,o)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:a,url:i}=this.layer,{data:o}=await s(`${i}/${a}`,t),{id:n,extent:u,fullExtent:l,timeExtent:c}=o,d=u||l;return{id:n,fullExtent:d&&g.fromJSON(d),timeExtent:c&&r.fromJSON({start:c[0],end:c[1]})}}))}async queryAttachments(e,t={}){await this.load();const s=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,s)}async queryFeatures(e,t){await this.load();const s=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});return e.outStatistics?.length&&s.features.length&&s.features.forEach((t=>{const s=t.attributes;e.outStatistics?.forEach((({outStatisticFieldName:e})=>{if(e){const t=e.toLowerCase();t&&t in s&&e!==t&&(s[e]=s[t],delete s[t])}}))})),s}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!j(this.layer.url))return\"unavailable\";const e=y(this.layer.url,\"status\"),t=await s(e,{query:{f:\"json\"}});return D.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:s}=await import(\"./support/uploadAssets.js\");return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await s(e,t)).data.statusUrl;for(;;){const e=(await s(r,{query:{f:\"json\"},responseType:\"json\"})).data;switch(e.status){case\"Completed\":return s(e.resultUrl,{query:{f:\"json\"},responseType:\"json\"});case\"CompletedWithErrors\":throw new i(\"async-applyEdits-failed\",\"asynchronous applyEdits call failed.\");case\"Failed ImportChanges\":case\"InProgress\":case\"Pending\":case\"ExportAttachments\":case\"ExportChanges\":case\"ExportingData\":case\"ExportingSnapshot\":case\"ImportAttachments\":case\"ProvisioningReplica\":case\"UnRegisteringReplica\":break;default:throw new i(\"async-applyEdits-failed\",\"asynchronous applyEdits call failed (undefined response status)\")}await d(V)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const r={};has(\"featurelayer-advanced-symbols\")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());const{data:a}=await s(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=a}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const r=e.type;if(!Q.has(r))throw new i(\"feature-layer-source:unsupported-type\",`Source type \"${r}\" is not supported`)}async _patchServiceJSON(e,t){if(\"Table\"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=_(e.geometryType).renderer;l(\"drawingInfo.renderer\",t,e)}if(\"esriGeometryMultiPatch\"===e.geometryType&&e.infoFor3D&&(e.geometryType=\"mesh\"),null==e.extent)try{const{data:r}=await s(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(r){p(r)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;const s=await this._filterRedundantAssetMaps(t);if(!t?.length)return null;const r=new Array,a=new Map;for(const i of s){const{geometry:e}=i,{vertexSpace:t}=e;if(t.isRelative)r.push(e);else{const t=S(e);a.set(t,e),i.geometry=t,r.push(t)}}await this.uploadAssets(r);for(const[i,o]of a)o.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(s),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,s=this.layer.globalIdField,r=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,o=i.getExternalSourcesOnService(r),n=a.getAttribute(s);if(0===o.length){u.getLogger(this).error(`Skipping feature ${n}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=o.find(w)??o[0],{vertexSpace:c}=e,d=c.isGeoreferenced?[\"PROJECT_VERTICES\"]:[];for(const s of l)1===s.parts.length?t.push({globalId:h(),parentGlobalId:n,assetName:s.assetName,assetHash:s.parts[0].partHash,flags:d}):u.getLogger(this).error(`Skipping asset ${s.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:s}=this.layer,r=[];let a=null;if(Array.isArray(t))for(const o of t)r.push({id:o.id,editedFeatures:o.editedFeatures}),o.id===s&&(a={addResults:o.addResults??[],updateResults:o.updateResults??[],deleteResults:o.deleteResults??[],attachments:o.attachments,editMoment:o.editMoment});else a=t;const i=A(a);if(r.length>0){i.editedFeatureResults=[];for(const e of r){const{editedFeatures:t}=e,s=t?.spatialReference?new C(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:F(t,s)})}}return i}_createAttachmentErrorResult(e,t){const s=t.details.messages?.[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i(\"feature-layer-source:attachment-failure\",s,{code:r})}}_getFormDataForAttachment(e,t){const s=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(s)for(const r in t){const e=t[r];null!=e&&(s.set?s.set(r,e):s.append(r,e))}return s}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:s,dynamicDataSource:r}=this.layer;return{...e,query:{gdbVersion:s,layer:r?JSON.stringify({source:r}):void 0,...t.query,f:\"json\",...this._createRequestQueryOptions(e)},responseType:\"json\"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:s,infoFor3D:r,parsedUrl:i}=t;if(null==r||null==s)return e;const o=v(r);if(null==o)return e;const n=y(i.path,`../${o.id}`),u=new Array,l=new Array;for(const a of e)a.geometry.metadata.getExternalSourcesOnService(i).length>0?l.push(a):u.push(a);const c=l.map((e=>e.getAttribute(s))).filter(a);if(0===c.length)return e;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:p}}=r,h=new M;h.where=`${d} IN (${c.map((e=>`'${e}'`))})`,h.outFields=[p,d],h.returnGeometry=!1;const m=await T(n,h),{features:f}=m;return 0===f.length?e:[...u,...l.filter((e=>{const t=e.getAttribute(s);if(!t)return!0;const{metadata:r}=e.geometry,a=f.filter((e=>e.getAttribute(d)===t));if(0===a.length)return!0;const o=a.map((e=>e.getAttribute(p)));return r.getExternalSourcesOnService(i).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>o.every((t=>e!==t))))}))]}};e([m()],P.prototype,\"type\",void 0),e([m({constructOnly:!0})],P.prototype,\"layer\",void 0),e([m({readOnly:!0})],P.prototype,\"queryTask\",null),P=e([f(\"esri.layers.graphics.sources.FeatureLayerSource\")],P);const V=1e3,$=P;export{$ as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../request.js\";import r from\"../../core/Error.js\";import{LRUCache as o}from\"../../core/LRUCache.js\";import{c as t}from\"../../chunks/vec3f64.js\";import{size as i,create as s}from\"../../geometry/support/aaBoundingBox.js\";import{objectSymbolLayerPrimitiveBoundingBox as n}from\"./symbolLayerUtils3D.js\";let c=u();function u(){return new o(50)}function a(){c=u()}async function m(e,o){if(e.resource?.href)return l(e.resource.href).then((e=>[e.width,e.height]));if(e.resource?.primitive)return null!=o?[o,o]:[256,256];throw new r(\"symbol3d:invalid-symbol-layer\",\"symbol layers of type Icon must have either an href or a primitive resource\")}function l(r){return e(r,{responseType:\"image\"}).then((e=>e.data))}async function f(e,o=null){if(!e.isPrimitive){const o=e.resource.href;if(!o)throw new r(\"symbol:invalid-resource\",\"The symbol does not have a valid resource\");const s=c.get(o);if(void 0!==s)return s;const{fetch:n}=await import(\"../../views/3d/layers/graphics/objectResourceUtils.js\"),u=await n(o,{disableTextures:!0}),a=i(u.referenceBoundingBox,t());return c.put(o,a),a}if(!e.resource?.primitive)throw new r(\"symbol:invalid-resource\",\"The symbol does not have a valid resource\");const u=s(n(e.resource.primitive));if(null!=o)for(let r=0;r{const e=r(t.data,h);return h?.node?(h.node.appendChild(e),h.node):e})):n(e).then((t=>t?i(t,h):null))}function r(t,n){const h=!/\\\\.svg$/i.test(t.src)&&n&&n.disableUpsampling,r=Math.max(t.width,t.height);let s=null!=n?.maxSize?e(n.maxSize):i.maxSize;h&&(s=Math.min(r,s));const o=\"number\"==typeof n?.size?n?.size:null,m=Math.min(s,null!=o?e(o):r);if(m!==r){const e=0!==t.width&&0!==t.height?t.width/t.height:1;e>=1?(t.width=m,t.height=m/e):(t.width=m*e,t.height=m)}return t}export{h as previewWebStyleSymbol};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../Color.js\";import{getColorLuminance as t}from\"../../core/colorUtils.js\";import a from\"../../core/Error.js\";import{loadFont as n}from\"../../core/fontUtils.js\";import{pt2px as l,px2pt as o}from\"../../core/screenUtils.js\";import{getFill as i,getStroke as s,getPatternUrlWithColor as r}from\"./gfxUtils.js\";import{SymbolSizeDefaults as c,shapes as u,adjustColorBrightness as h}from\"./previewUtils.js\";import{renderSymbol as m}from\"./renderUtils.js\";import{backgroundPadding as p}from\"./textUtils.js\";const d=\"picture-fill\",f=\"picture-marker\",y=\"simple-fill\",g=\"simple-line\",w=\"simple-marker\",v=\"text\",b=\"Aa\",k=c.size,x=c.maxSize,z=c.maxOutlineSize,L=c.lineWidth,M=225,j=document.createElement(\"canvas\");function C(e,t){const a=j.getContext(\"2d\"),n=[];return t&&(t.weight&&n.push(t.weight),t.size&&n.push(t.size+\"px\"),t.family&&n.push(t.family)),a.font=n.join(\" \"),a.measureText(e).width}const S=7.2/2.54,F=72/2.54;function U(e){if(0===e.length)return 0;if(e.length>2){const t=o(1),a=parseFloat(e);switch(e.slice(-2)){case\"px\":return a;case\"pt\":return a*t;case\"in\":return 72*a*t;case\"pc\":return 12*a*t;case\"mm\":return a*S*t;case\"cm\":return a*F*t}}return parseFloat(e)}function E(e){const t=e?.size;return{width:null!=t&&\"object\"==typeof t&&\"width\"in t?l(t.width):null,height:null!=t&&\"object\"==typeof t&&\"height\"in t?l(t.height):null}}async function Z(e,t){const a=t.fill,n=e.color;if(\"pattern\"===a?.type&&n&&e.type!==d){const e=await r(a.src,n.toCss(!0));a.src=e,t.fill=a}}async function q(e,t,a,l){if(!(\"font\"in e)||!e.font||\"text\"!==t.shape.type)return;try{await n(e.font)}catch{}const{width:o}=E(l),i=/[\\uE600-\\uE6FF]/.test(t.shape.text);null!=o||i||(a[0]=C(t.shape.text,{weight:t.font?.weight,size:t.font?.size,family:t.font?.family}))}function D(e,t,a,n,o){if(null!=e.haloColor&&null!=e.haloSize){o.masking??=a.map((()=>[]));const i=l(e.haloSize);n[0]+=i,n[1]+=i,a.unshift([{...t,fill:null,stroke:{color:e.haloColor,width:2*i,join:\"round\",cap:\"round\"}}]),o.masking.unshift([{shape:{type:\"rect\",x:0,y:0,width:n[0]+2*p,height:n[1]+2*p},fill:[255,255,255],stroke:null},{...t,fill:[0,0,0,0],stroke:null}])}null==e.backgroundColor&&null==e.borderLineColor||(n[0]+=2*p,n[1]+=2*p,a.unshift([{shape:{type:\"rect\",x:0,y:0,width:n[0],height:n[1]},fill:e.backgroundColor,stroke:{color:e.borderLineColor,width:l(e.borderLineSize)}}]),o.masking?.unshift([]))}function O(e,t){return e>t?\"dark\":\"light\"}function T(e,t){const a=\"number\"==typeof t?.size?t?.size:null,n=null!=a?l(a):null,o=null!=t?.maxSize?l(t.maxSize):null,r=null!=t?.rotation?t.rotation:\"angle\"in e?e.angle:null,c=i(e);let h=s(e);\"dark\"!==P(e,245)||t?.ignoreWhiteSymbols||(h={width:.75,...h,color:\"#bdc3c7\"});const m={shape:null,fill:c,stroke:h,offset:[0,0]};h?.width&&(h.width=Math.min(h.width,z));const p=h?.width||0;let M=null!=t?.size&&(null==t?.scale||t?.scale),j=0,S=0,F=!1;switch(e.type){case w:{const a=e.style,{width:i,height:s}=E(t),c=i===s&&null!=i?i:null!=n?n:Math.min(l(e.size),o||x);switch(j=c,S=c,a){case\"circle\":m.shape={type:\"circle\",cx:0,cy:0,r:.5*c},M||(j+=p,S+=p);break;case\"cross\":m.shape={type:\"path\",path:[{command:\"M\",values:[0,.5*S]},{command:\"L\",values:[j,.5*S]},{command:\"M\",values:[.5*j,0]},{command:\"L\",values:[.5*j,S]}]};break;case\"diamond\":m.shape={type:\"path\",path:[{command:\"M\",values:[0,.5*S]},{command:\"L\",values:[.5*j,0]},{command:\"L\",values:[j,.5*S]},{command:\"L\",values:[.5*j,S]},{command:\"Z\",values:[]}]},M||(j+=p,S+=p);break;case\"square\":m.shape={type:\"path\",path:[{command:\"M\",values:[0,0]},{command:\"L\",values:[j,0]},{command:\"L\",values:[j,S]},{command:\"L\",values:[0,S]},{command:\"Z\",values:[]}]},M||(j+=p,S+=p),r&&(F=!0);break;case\"triangle\":m.shape={type:\"path\",path:[{command:\"M\",values:[.5*j,0]},{command:\"L\",values:[j,S]},{command:\"L\",values:[0,S]},{command:\"Z\",values:[]}]},M||(j+=p,S+=p),r&&(F=!0);break;case\"x\":m.shape={type:\"path\",path:[{command:\"M\",values:[0,0]},{command:\"L\",values:[j,S]},{command:\"M\",values:[j,0]},{command:\"L\",values:[0,S]}]},r&&(F=!0);break;case\"path\":m.shape={type:\"path\",path:e.path||\"\"},M||(j+=p,S+=p),r&&(F=!0),M=!0}break}case g:{const{width:e,height:a}=E(t),l=null!=a?a:null!=n?n:p,o=null!=e?e:L;h&&(h.width=l),j=o,S=l;const i=m?.stroke?.cap||\"butt\",s=\"round\"===i;M=!0,m.stroke&&(m.stroke.cap=\"butt\"===i?\"square\":i),m.shape={type:\"path\",path:[{command:\"M\",values:[s?l/2:0,S/2]},{command:\"L\",values:[s?j-l/2:j,S/2]}]};break}case d:case y:{const e=\"object\"==typeof t?.symbolConfig&&!!t?.symbolConfig?.isSquareFill,{width:a,height:l}=E(t);j=!e&&a!==l||null==a?null!=n?n:k:a,S=!e&&a!==l||null==l?j:l,M||(j+=p,S+=p),M=!0,m.shape=e?{type:\"path\",path:[{command:\"M\",values:[0,0]},{command:\"L\",values:[j,0]},{command:\"L\",values:[j,S]},{command:\"L\",values:[0,S]},{command:\"L\",values:[0,0]},{command:\"Z\",values:[]}]}:u.fill[0];break}case f:{const a=Math.min(l(e.width),o||x),i=Math.min(l(e.height),o||x),{width:s,height:c}=E(t),u=s===c&&null!=s?s:null!=n?n:Math.max(a,i),h=a/i;j=h<=1?Math.ceil(u*h):u,S=h<=1?u:Math.ceil(u/h),m.shape={type:\"image\",x:-Math.round(j/2),y:-Math.round(S/2),width:j,height:S,src:e.url||\"\"},r&&(F=!0);break}case v:{const a=e,i=t?.overrideText||a.text||b,s=a.font,{width:r,height:c}=E(t),u=null!=c?c:null!=n?n:Math.min(l(s.size),o||x),h=C(i,{weight:s.weight,size:u,family:s.family}),p=/[\\uE600-\\uE6FF]/.test(i);j=r??(p?u:h),S=u;let d=.25*U((s?u:0).toString());p&&(d+=5),m.shape={type:\"text\",text:i,x:a.xoffset||0,y:a.yoffset||d,align:\"middle\",alignBaseline:a.verticalAlignment,decoration:s&&s.decoration,rotated:a.rotated,kerning:a.kerning},m.font=s&&{size:u,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:m,size:[j,S],renderOptions:{node:t?.node,scale:M,opacity:t?.opacity,rotation:r,useRotationSize:F,effectView:t?.effectView,ariaLabel:t?.ariaLabel}}}async function A(e,t){const{shapeDescriptor:n,size:l,renderOptions:o}=T(e,t);if(!n.shape)throw new a(\"symbolPreview: renderPreviewHTML2D\",\"symbol not supported.\");await Z(e,n),await q(e,n,l,t);const i=[[n]];if(\"object\"==typeof t?.symbolConfig&&t?.symbolConfig?.applyColorModulation){const e=.6*l[0];i.unshift([{...n,offset:[-e,0],fill:h(n.fill,-.3)}]),i.push([{...n,offset:[e,0],fill:h(n.fill,.3)}]),l[0]+=2*e,o.scale=!1}return\"text\"===e.type&&D(e,n,i,l,o),m(i,l,o)}function P(a,n=M){const l=i(a),o=s(a),r=!l||\"type\"in l?null:new e(l),c=o?.color?new e(o?.color):null,u=r?O(t(r),n):null,h=c?O(t(c),n):null;return h?u?u===h?u:n>=M?\"light\":\"dark\":h:u}export{P as getContrastingBackgroundTheme,T as getRenderSymbolParameters,A as previewSymbol2D};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../Color.js\";import t from\"../../request.js\";import{throwIfAborted as a}from\"../../core/promiseUtils.js\";import{pt2px as i}from\"../../core/screenUtils.js\";import{CIMAnalyzer as r,analyzeCIMResource as o}from\"./cimAnalyzer.js\";import s from\"./CIMResourceManager.js\";import{Transformation as n,CanvasDrawHelper as l}from\"./CIMSymbolDrawHelper.js\";import{OverrideHelper as c,CIMSymbolHelper as h}from\"./CIMSymbolHelper.js\";import m from\"./Rasterizer.js\";import g from\"./TextRasterizer.js\";import{mapCIMSymbolToGeometryType as u,createLabelOverrideFunction as f,evaluateValueOrFunction as d,colorToArray as y}from\"./utils.js\";import{scaleCIMMarker as p}from\"../support/cimSymbolUtils.js\";import{Symbol3DAnchorPosition2D as w}from\"../support/Symbol3DAnchorPosition2D.js\";const C=e=>e?.scaleFactor?e.scaleFactor:1,_=96/72;class M{constructor(e,t){this._spatialReference=e,this._avoidSDF=t,this._resourceCache=new Map,this._lazyImageDataCanvas=null,this._pictureMarkerCache=new Map,this._textRasterizer=new g,this._cimResourceManager=new s,this._rasterizer=new m(this._cimResourceManager)}get _imageDataCanvas(){return this._lazyImageDataCanvas??=document.createElement(\"canvas\"),this._lazyImageDataCanvas}get _imageDataContext(){return this._imageDataCanvas.getContext(\"2d\",{willReadFrequently:!0})}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(e,t,a,i,r,o,s,m,g){if(!e)return null;const{data:f}=e;if(!f||\"CIMSymbolReference\"!==f.type||!f.symbol)return null;const{symbol:d}=f;o||(o=u(d));const y=await c.resolveSymbolOverrides(f,t,this._spatialReference,r,o,s,m),p=this._imageDataCanvas,w=this._cimResourceManager,C=[];h.fetchResources(y,w,C),h.fetchFonts(y,w,C),C.length>0&&await Promise.all(C);const{width:M,height:b}=a,I=z(o,M,b,i),x=h.getEnvelope(y,I,w);if(!x)return null;const R=(window.devicePixelRatio||1)*_;let v=1,D=0,P=0;switch(d.type){case\"CIMPointSymbol\":case\"CIMTextSymbol\":{let e=1;x.width>M&&(e=M/x.width);let t=1;x.height>b&&(t=b/x.height),\"preview\"===i&&(x.widthb)&&(v=b/x.height),P=x.y+x.height/2;const e=x.x*v+M/2,t=(x.x+x.width)*v+M/2,{paths:a}=I;a[0][0][0]-=e/v,a[0][2][0]-=(t-M)/v}break;case\"CIMPolygonSymbol\":{D=x.x+x.width/2,P=x.y+x.height/2;const e=x.x*v+M/2,t=(x.x+x.width)*v+M/2,a=x.y*v+b/2,i=(x.y+x.height)*v+b/2,{rings:r}=I;e<0&&(r[0][0][0]-=e,r[0][3][0]-=e,r[0][4][0]-=e),a<0&&(r[0][0][1]+=a,r[0][1][1]+=a,r[0][4][1]+=a),t>M&&(r[0][1][0]-=t-M,r[0][2][0]-=t-M),i>b&&(r[0][2][1]+=i-b,r[0][3][1]+=i-b)}}p.width=M*R,p.height=b*R;const S=1;p.width+=2*S,p.height+=2*S;const k=this._imageDataContext,A=n.createIdentity();A.translate(-D,-P),A.scale(v*R,-v*R),A.translate(M*R/2+S,b*R/2+S),k.clearRect(0,0,p.width,p.height);return new l(k,w,A,!0).drawSymbol(y,I),k.getImageData(0,0,p.width,p.height)}async analyzeCIMSymbol3D(e,t,i,o,s){const n=[],l=t?{geometryType:o,spatialReference:this._spatialReference,fields:t}:null,c=[];h.fetchFonts(e.data.symbol,this._cimResourceManager,c),await Promise.all(c);const m=new r(this._cimResourceManager,l);let g;await m.analyzeSymbolReference(e.data,this._avoidSDF,n),a(s);for(const a of n)\"CIMPictureMarker\"!==a.cim.type&&\"CIMPictureFill\"!==a.cim.type&&\"CIMPictureStroke\"!==a.cim.type||(g||(g=[]),g.push(this._fetchPictureMarkerResource(a,s))),i&&\"text\"===a.type&&\"string\"==typeof a.text&&a.text.includes(\"[\")&&(a.text=f(i,a.text,a.cim.textCase));return g&&await Promise.all(g),n}rasterizeCIMSymbol3D(e,t,a,i,r,o){const s=[];for(const n of e){i&&\"function\"==typeof i.scaleFactor&&(i.scaleFactor=i.scaleFactor(t,r,o));const e=this._getRasterizedResource(n,t,a,i,r,o);if(!e)continue;let l=0,c=e.anchorX||0,h=e.anchorY||0,m=!1,g=0,u=0;if(\"esriGeometryPoint\"===a){const e=C(i);if(g=d(n.offsetX,t,r,o)*e||0,u=d(n.offsetY,t,r,o)*e||0,\"marker\"===n.type)l=d(n.rotation,t,r,o)||0,m=n.rotateClockwise??!1;else if(\"text\"===n.type){if(l=d(n.angle,t,r,o)||0,void 0!==n.horizontalAlignment)switch(n.horizontalAlignment){case\"left\":c=-.5;break;case\"right\":c=.5;break;default:c=0}if(void 0!==n.verticalAlignment)switch(n.verticalAlignment){case\"top\":h=.5;break;case\"bottom\":h=-.5;break;case\"baseline\":h=-.25;break;default:h=0}}}null!=e&&s.push({angle:l,rotateClockWise:m,anchorX:c,anchorY:h,offsetX:g,offsetY:u,rasterizedResource:e})}return this.getSymbolImage(s)}getSymbolImage(e){const t=document.createElement(\"canvas\"),a=t.getContext(\"2d\");let r=0,o=0,s=0,n=0;const l=[];for(let g=0;gs?_:s,n=M>n?M:n;const z=a.createImageData(c.size[0],c.size[1]);z.data.set(new Uint8ClampedArray(c.image.buffer));const b={offsetX:m,offsetY:u,rotateClockwise:y,angle:p,rasterizedImage:z,anchorX:f,anchorY:d};l.push(b)}t.width=s-r,t.height=n-o;const c=-r,h=n;for(let g=0;g1?i(t):i(t)/o:r.width,n=t?o>1?i(t)*o:i(t):r.height;return{image:this._imageTo32Array(r,s,n,a),width:s,height:n}}}function z(e,t,a,i){const r=1,o=-t/2+r,s=t/2-r,n=a/2-r,l=-a/2+r;switch(e){case\"esriGeometryPoint\":return{x:0,y:0};case\"esriGeometryPolyline\":return{paths:[[[o,0],[0,0],[s,0]]]};default:return\"legend\"===i?{rings:[[[o,n],[s,0],[s,l],[o,l],[o,n]]]}:{rings:[[[o,n],[s,n],[s,l],[o,l],[o,n]]]}}}function b(e,t,a,i){let r,s;if(\"function\"==typeof e.materialHash){r=(0,e.materialHash)(t,a,i),s=o(e.cim,e.materialOverrides)}else r=e.materialHash,s=e.cim;return{analyzedCIM:s,hash:r}}export{M as CIMSymbolRasterizer};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{px2pt as e,pt2px as t}from\"../../core/screenUtils.js\";import{OverrideHelper as i,CIMSymbolHelper as l}from\"../cim/CIMSymbolHelper.js\";import{CIMSymbolRasterizer as n}from\"../cim/CIMSymbolRasterizer.js\";import{mapCIMSymbolToGeometryType as a}from\"../cim/utils.js\";import{SymbolSizeDefaults as r}from\"./previewUtils.js\";import{renderSymbol as o}from\"./renderUtils.js\";const s=new n(null,!0),c=e(r.size),m=e(r.maxSize),u=e(r.lineWidth),f=1;async function h(e,t,i){const l=t?.size;let n=null!=l&&\"object\"==typeof l&&\"width\"in l?l.width:l,a=null!=l&&\"object\"==typeof l&&\"height\"in l?l.height:l;if(null==n||null==a)if(\"esriGeometryPolygon\"===i)n=c,a=c;else{const l=await y(e,t,i);l&&(n=l.width,a=l.height),\"esriGeometryPolyline\"===i&&(n=u),n=null!=n&&isFinite(n)?Math.min(n,m):c,a=null!=a&&isFinite(a)?Math.max(Math.min(a,m),f):c}return\"legend\"===t.style&&\"esriGeometryPolyline\"===i&&(n=u),{width:n,height:a}}async function y(e,t,n){const{feature:a,fieldMap:r,viewParams:o}=t.cimOptions||t,c=await i.resolveSymbolOverrides(e.data,a,null,r,n,null,o);if(!c)return null;(e=e.clone()).data={type:\"CIMSymbolReference\",symbol:c},e.data.primitiveOverrides=void 0;const m=[];return l.fetchResources(c,s.resourceManager,m),l.fetchFonts(c,s.resourceManager,m),m.length>0&&await Promise.all(m),l.getEnvelope(c,null,s.resourceManager)}async function p(e,i={}){const{node:l,opacity:n,symbolConfig:r}=i,c=null!=r&&\"object\"==typeof r&&\"isSquareFill\"in r&&r.isSquareFill,m=i.cimOptions||i,u=m.geometryType||a(e?.data?.symbol),f=await h(e,i,u),{feature:y,fieldMap:p}=m,d=c||\"esriGeometryPolygon\"!==u?\"preview\":\"legend\",g=await s.rasterizeCIMSymbolAsync(e,y,f,d,p,u,null,m.viewParams,m.allowScalingUp);if(!g)return null;const{width:w,height:b}=g,M=document.createElement(\"canvas\");M.width=w,M.height=b;M.getContext(\"2d\").putImageData(g,0,0);const v=t(f.width),j=t(f.height),S=new Image(v,j);S.src=M.toDataURL(),S.ariaLabel=i.ariaLabel??null,S.alt=i.ariaLabel??\"\",null!=n&&(S.style.opacity=`${n}`);let C=S;if(null!=i.effectView){const e={shape:{type:\"image\",x:0,y:0,width:v,height:j,src:S.src},fill:null,stroke:null,offset:[0,0]};C=o([[e]],[v,j],{effectView:i.effectView,ariaLabel:i.ariaLabel})}return l&&C&&l.appendChild(C),C}export{p as previewCIMSymbol};\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { L as Loader, d as defineCustomElement$1 } from './loader.js';\n\nconst CalciteLoader = Loader;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteLoader, defineCustomElement };\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../geometry.js\";import{open as n}from\"../core/workers/workers.js\";import t from\"./Point.js\";import{fromJSON as e}from\"./support/jsonUtils.js\";function r(n){return Array.isArray(n)?n[0]?.spatialReference:n?.spatialReference}function a(n){return n?Array.isArray(n)?n.map(a):n.toJSON?n.toJSON():n:n}function i(n){return Array.isArray(n)?n.map((n=>e(n))):e(n)}function o(n,t){let e;return Array.isArray(n)?e=n:(e=[],e.push(n),null!=t&&e.push(t)),e}let c;async function u(){return c||(c=n(\"geometryEngineWorker\",{strategy:\"distributed\"})),c}async function s(n,t){return(await u()).invoke(\"executeGEOperation\",{operation:n,parameters:a(t)})}async function f(n,t){const e=await u();return Promise.all(e.broadcast(\"executeGEOperation\",{operation:n,parameters:a(t)}))}function l(n){return s(\"extendedSpatialReferenceInfo\",[n])}async function y(n,t){return i(await s(\"clip\",[r(n),n,t]))}async function w(n,t){return i(await s(\"cut\",[r(n),n,t]))}function p(n,t){return s(\"contains\",[r(n),n,t])}function m(n,t){return s(\"crosses\",[r(n),n,t])}function d(n,t,e){return s(\"distance\",[r(n),n,t,e])}function g(n,t){return s(\"equals\",[r(n),n,t])}function h(n,t){return s(\"intersects\",[r(n),n,t])}function S(n,t){return s(\"touches\",[r(n),n,t])}function x(n,t){return s(\"within\",[r(n),n,t])}function A(n,t){return s(\"disjoint\",[r(n),n,t])}function O(n,t){return s(\"overlaps\",[r(n),n,t])}function R(n,t,e){return s(\"relate\",[r(n),n,t,e])}function J(n){return s(\"isSimple\",[r(n),n])}async function N(n){return i(await s(\"simplify\",[r(n),n]))}async function j(n,t=!1){return i(await s(\"convexHull\",[r(n),n,t]))}async function E(n,t){return i(await s(\"difference\",[r(n),n,t]))}async function k(n,t){return i(await s(\"symmetricDifference\",[r(n),n,t]))}async function D(n,t){return i(await s(\"intersect\",[r(n),n,t]))}async function b(n,t=null){const e=o(n,t);return i(await s(\"union\",[r(e),e]))}async function v(n,t,e,a,o,c){return i(await s(\"offset\",[r(n),n,t,e,a,o,c]))}async function L(n,t,e,a=!1){const o=[r(n),n,t,e,a];return i(await s(\"buffer\",o))}async function P(n,t,e,a,o,c){const u=[r(n),n,t,e,a,o,c];return i(await s(\"geodesicBuffer\",u))}async function T(n,e,a=!0){const i=await s(\"nearestCoordinate\",[r(n),n,e,a]);return{...i,coordinate:t.fromJSON(i.coordinate)}}async function V(n,e){const a=await s(\"nearestVertex\",[r(n),n,e]);return{...a,coordinate:t.fromJSON(a.coordinate)}}async function z(n,e,a,i){return(await s(\"nearestVertices\",[r(n),n,e,a,i])).map((n=>({...n,coordinate:t.fromJSON(n.coordinate)})))}function G(n){return\"xmin\"in n?n.center:\"x\"in n?n:n.extent?.center}async function H(n,t,e){if(null==n)throw new Z;const r=n.spatialReference;if(null==(e=e??G(n)))throw new Z;const a=n.constructor.fromJSON(await s(\"rotate\",[r,n,t,e]));return a.spatialReference=r,a}async function I(n,t){if(null==n)throw new Z;const e=n.spatialReference;if(null==(t=t??G(n)))throw new Z;const r=n.constructor.fromJSON(await s(\"flipHorizontal\",[e,n,t]));return r.spatialReference=e,r}async function q(n,t){if(null==n)throw new Z;const e=n.spatialReference;if(null==(t=t??G(n)))throw new Z;const r=n.constructor.fromJSON(await s(\"flipVertical\",[e,n,t]));return r.spatialReference=e,r}async function B(n,t,e,a){return i(await s(\"generalize\",[r(n),n,t,e,a]))}async function C(n,t,e){return i(await s(\"densify\",[r(n),n,t,e]))}async function U(n,t,e,a=0){return i(await s(\"geodesicDensify\",[r(n),n,t,e,a]))}function W(n,t){return s(\"planarArea\",[r(n),n,t])}function F(n,t){return s(\"planarLength\",[r(n),n,t])}function K(n,t,e){return s(\"geodesicArea\",[r(n),n,t,e])}function M(n,t,e){return s(\"geodesicLength\",[r(n),n,t,e])}async function Q(n,t){return i(await s(\"intersectLinesToPoints\",[r(n),n,t]))}async function X(n,t){await f(\"changeDefaultSpatialReferenceTolerance\",[n,t])}async function Y(n){await f(\"clearDefaultSpatialReferenceTolerance\",[n])}class Z extends Error{constructor(){super(\"Illegal Argument Exception\")}}export{L as buffer,X as changeDefaultSpatialReferenceTolerance,Y as clearDefaultSpatialReferenceTolerance,y as clip,p as contains,j as convexHull,m as crosses,w as cut,C as densify,E as difference,A as disjoint,d as distance,g as equals,l as extendedSpatialReferenceInfo,I as flipHorizontal,q as flipVertical,B as generalize,K as geodesicArea,P as geodesicBuffer,U as geodesicDensify,M as geodesicLength,D as intersect,Q as intersectLinesToPoints,h as intersects,J as isSimple,T as nearestCoordinate,V as nearestVertex,z as nearestVertices,v as offset,O as overlaps,W as planarArea,F as planarLength,R as relate,H as rotate,N as simplify,k as symmetricDifference,S as touches,b as union,x as within};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from\"../portal/Portal.js\";function l(l,t){if(null===l)return t;return new r({url:l.field(\"url\")})}export{l as getPortal};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{id as e}from\"../../kernel.js\";import r from\"../../request.js\";async function n(n,t,s){const u=e?.findCredential(n.restUrl);if(!u)return null;if(\"loaded\"===n.loadStatus&&\"\"===t&&n.user?.sourceJSON&&!1===s)return n.user.sourceJSON;const o={responseType:\"json\",query:{f:\"json\"}};if(s&&(o.query.returnUserLicenseTypeExtensions=!0),\"\"===t){const e=await r(n.restUrl+\"/community/self\",o);if(e.data){const r=e.data;if(r?.username)return r}return null}const i=await r(n.restUrl+\"/community/users/\"+t,o);if(i.data){const e=i.data;return e.error?null:e}return null}async function t(e,r,t){const s=await n(e,r,!0);return s?.userLicenseTypeExtensions?.includes(t)??!1}export{t as hasUserTypeExtension,n as lookupUser};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{version as n}from\"../../kernel.js\";import t from\"../ArcadePortal.js\";import e from\"../Dictionary.js\";import{ArcadeExecutionError as r,ExecutionErrorCodes as i}from\"../executionError.js\";import{cloneGeometry as a,convertSquareUnitsToCode as o,convertLinearUnitsToCode as l}from\"../kernel.js\";import{F as s,E as u,k as c,n as f,m as d,j as m,o as w,q as h,A as y,u as p,H as g,G as v,J as P,K as I,g as A,h as F,L as R}from\"../../chunks/languageUtils.js\";import{getPortal as j}from\"../portalUtils.js\";import{centroidPolyline as x,centroidMultiPoint as N,getMetersPerVerticalUnitForSR as b,segmentLength3d as S}from\"./centroid.js\";import{getMetersPerUnitForSR as O}from\"../../core/unitUtils.js\";import D from\"../../geometry/Extent.js\";import k from\"../../geometry/Geometry.js\";import{disjoint as J,intersects as M,touches as Z,crosses as C,within as E,contains as L,overlaps as U,equals as z,relate as T,intersect as q,union as W,difference as G,symmetricDifference as H,clip as K,cut as V,planarArea as B,geodesicArea as Q,planarLength as X,geodesicLength as Y,distance as $,densify as _,geodesicDensify as nn,generalize as tn,buffer as en,geodesicBuffer as rn,offset as an,rotate as on,simplify as ln,isSimple as sn,convexHull as un,nearestCoordinate as cn,nearestVertex as fn}from\"../../geometry/geometryEngineAsync.js\";import dn from\"../../geometry/Multipoint.js\";import mn from\"../../geometry/Point.js\";import wn from\"../../geometry/Polygon.js\";import hn from\"../../geometry/Polyline.js\";import{fromJSON as yn}from\"../../geometry/support/jsonUtils.js\";import pn from\"../../portal/Portal.js\";import{lookupUser as gn}from\"../../portal/support/utils.js\";function vn(t){return 0===n.indexOf(\"4.\")?wn.fromExtent(t):new wn({spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}function Pn(n,t,e){if(u(n,2,2,t,e),n[0]instanceof k&&n[1]instanceof k);else if(n[0]instanceof k&&null===n[1]);else if(n[1]instanceof k&&null===n[0]);else if(null!==n[0]||null!==n[1])throw new r(t,i.InvalidParameter,e)}async function In(n,t){if(\"polygon\"!==n.type&&\"polyline\"!==n.type&&\"extent\"!==n.type)return 0;let e=1;if(n.spatialReference.vcsWkid||n.spatialReference.latestVcsWkid){e=b(n.spatialReference)/O(n.spatialReference)}let r=0;if(\"polyline\"===n.type)for(const a of n.paths)for(let n=1;n(Pn(i=s(i),t,e),null===i[0]||null===i[1]||J(i[0],i[1]))))},n.functions.intersects=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null!==i[0]&&null!==i[1]&&M(i[0],i[1]))))},n.functions.touches=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null!==i[0]&&null!==i[1]&&Z(i[0],i[1]))))},n.functions.crosses=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null!==i[0]&&null!==i[1]&&C(i[0],i[1]))))},n.functions.within=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null!==i[0]&&null!==i[1]&&E(i[0],i[1]))))},n.functions.contains=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null!==i[0]&&null!==i[1]&&L(i[0],i[1]))))},n.functions.overlaps=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null!==i[0]&&null!==i[1]&&U(i[0],i[1]))))},n.functions.equals=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(u(i,2,2,t,e),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?z(i[0],i[1]):(c(i[0])&&c(i[1])||!!(f(i[0])&&f(i[1])||d(i[0])&&d(i[1])))&&i[0].equals(i[1])))))},n.functions.relate=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,3,3,t,e),o[0]instanceof k&&o[1]instanceof k)return T(o[0],o[1],m(o[2]));if(o[0]instanceof k&&null===o[1])return!1;if(o[1]instanceof k&&null===o[0])return!1;if(null===o[0]&&null===o[1])return!1;throw new r(t,i.InvalidParameter,e)}))},n.functions.intersection=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null===i[0]||null===i[1]?null:q(i[0],i[1]))))},n.functions.union=function(t,e){return n.standardFunctionAsync(t,e,((n,o,l)=>{const u=[];if(0===(l=s(l)).length)throw new r(t,i.WrongNumberOfParameters,e);if(1===l.length)if(w(l[0])){const n=s(l[0]);for(let a=0;a(Pn(i=s(i),t,e),null!==i[0]&&null===i[1]?a(i[0]):null===i[0]?null:G(i[0],i[1]))))},n.functions.symmetricdifference=function(t,e){return n.standardFunctionAsync(t,e,((n,r,i)=>(Pn(i=s(i),t,e),null===i[0]&&null===i[1]?null:null===i[0]?a(i[1]):null===i[1]?a(i[0]):H(i[0],i[1]))))},n.functions.clip=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,2,2,t,e),!(o[1]instanceof D)&&null!==o[1])throw new r(t,i.InvalidParameter,e);if(null===o[0])return null;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return null===o[1]?null:K(o[0],o[1])}))},n.functions.cut=function(t,e){return n.standardFunctionAsync(t,e,((n,o,l)=>{if(l=s(l),u(l,2,2,t,e),!(l[1]instanceof hn)&&null!==l[1])throw new r(t,i.InvalidParameter,e);if(null===l[0])return[];if(!(l[0]instanceof k))throw new r(t,i.InvalidParameter,e);return null===l[1]?[a(l[0])]:V(l[0],l[1])}))},n.functions.area=function(t,e){return n.standardFunctionAsync(t,e,(async(n,a,l)=>{if(u(l,1,2,t,e),null===(l=s(l))[0])return 0;if(p(l[0])){const n=await l[0].sumArea(o(g(l[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new r(t,i.Cancelled,e);return n}if(w(l[0])||h(l[0])){const n=v(l[0],t.spatialReference);return null===n?0:B(n,o(g(l[1],-1)))}if(!(l[0]instanceof k))throw new r(t,i.InvalidParameter,e);return B(l[0],o(g(l[1],-1)))}))},n.functions.areageodetic=function(t,e){return n.standardFunctionAsync(t,e,(async(n,a,l)=>{if(u(l,1,2,t,e),null===(l=s(l))[0])return 0;if(p(l[0])){const n=await l[0].sumArea(o(g(l[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new r(t,i.Cancelled,e);return n}if(w(l[0])||h(l[0])){const n=v(l[0],t.spatialReference);return null===n?0:Q(n,o(g(l[1],-1)))}if(!(l[0]instanceof k))throw new r(t,i.InvalidParameter,e);return Q(l[0],o(g(l[1],-1)))}))},n.functions.length=function(t,e){return n.standardFunctionAsync(t,e,(async(n,a,o)=>{if(u(o,1,2,t,e),null===(o=s(o))[0])return 0;if(p(o[0])){const n=await o[0].sumLength(l(g(o[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new r(t,i.Cancelled,e);return n}if(w(o[0])||h(o[0])){const n=P(o[0],t.spatialReference);return null===n?0:X(n,l(g(o[1],-1)))}if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return X(o[0],l(g(o[1],-1)))}))},n.functions.length3d=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(u(o,1,2,t,e),null===(o=s(o))[0])return 0;if(w(o[0])||h(o[0])){const n=P(o[0],t.spatialReference);return null===n?0:!0===n.hasZ?In(n,l(g(o[1],-1))):X(n,l(g(o[1],-1)))}if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return!0===o[0].hasZ?In(o[0],l(g(o[1],-1))):X(o[0],l(g(o[1],-1)))}))},n.functions.lengthgeodetic=function(t,e){return n.standardFunctionAsync(t,e,(async(n,a,o)=>{if(u(o,1,2,t,e),null===(o=s(o))[0])return 0;if(p(o[0])){const n=await o[0].sumLength(l(g(o[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new r(t,i.Cancelled,e);return n}if(w(o[0])||h(o[0])){const n=P(o[0],t.spatialReference);return null===n?0:Y(n,l(g(o[1],-1)))}if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return Y(o[0],l(g(o[1],-1)))}))},n.functions.distance=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{o=s(o),u(o,2,3,t,e);let c=o[0];(w(o[0])||h(o[0]))&&(c=I(o[0],t.spatialReference));let f=o[1];if((w(o[1])||h(o[1]))&&(f=I(o[1],t.spatialReference)),!(c instanceof k))throw new r(t,i.InvalidParameter,e);if(!(f instanceof k))throw new r(t,i.InvalidParameter,e);return $(c,f,l(g(o[2],-1)))}))},n.functions.distancegeodetic=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{o=s(o),u(o,2,3,t,e);const c=o[0],f=o[1];if(!(c instanceof mn))throw new r(t,i.InvalidParameter,e);if(!(f instanceof mn))throw new r(t,i.InvalidParameter,e);const d=new hn({paths:[],spatialReference:c.spatialReference});return d.addPath([c,f]),Y(d,l(g(o[2],-1)))}))},n.functions.densify=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,2,3,t,e),null===o[0])return null;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);const c=A(o[1]);if(isNaN(c))throw new r(t,i.InvalidParameter,e);if(c<=0)throw new r(t,i.InvalidParameter,e);return o[0]instanceof wn||o[0]instanceof hn?_(o[0],c,l(g(o[2],-1))):o[0]instanceof D?_(vn(o[0]),c,l(g(o[2],-1))):o[0]}))},n.functions.densifygeodetic=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,2,3,t,e),null===o[0])return null;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);const c=A(o[1]);if(isNaN(c))throw new r(t,i.InvalidParameter,e);if(c<=0)throw new r(t,i.InvalidParameter,e);return o[0]instanceof wn||o[0]instanceof hn?nn(o[0],c,l(g(o[2],-1))):o[0]instanceof D?nn(vn(o[0]),c,l(g(o[2],-1))):o[0]}))},n.functions.generalize=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,2,4,t,e),null===o[0])return null;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);const c=A(o[1]);if(isNaN(c))throw new r(t,i.InvalidParameter,e);return tn(o[0],c,F(g(o[2],!0)),l(g(o[3],-1)))}))},n.functions.buffer=function(t,e){return n.standardFunctionAsync(t,e,((n,o,c)=>{if(c=s(c),u(c,2,3,t,e),null===c[0])return null;if(!(c[0]instanceof k))throw new r(t,i.InvalidParameter,e);const f=A(c[1]);if(isNaN(f))throw new r(t,i.InvalidParameter,e);return 0===f?a(c[0]):en(c[0],f,l(g(c[2],-1)))}))},n.functions.buffergeodetic=function(t,e){return n.standardFunctionAsync(t,e,((n,o,c)=>{if(c=s(c),u(c,2,3,t,e),null===c[0])return null;if(!(c[0]instanceof k))throw new r(t,i.InvalidParameter,e);const f=A(c[1]);if(isNaN(f))throw new r(t,i.InvalidParameter,e);return 0===f?a(c[0]):rn(c[0],f,l(g(c[2],-1)))}))},n.functions.offset=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,2,6,t,e),null===o[0])return null;if(!(o[0]instanceof wn||o[0]instanceof hn))throw new r(t,i.InvalidParameter,e);const c=A(o[1]);if(isNaN(c))throw new r(t,i.InvalidParameter,e);const f=A(g(o[4],10));if(isNaN(f))throw new r(t,i.InvalidParameter,e);const d=A(g(o[5],0));if(isNaN(d))throw new r(t,i.InvalidParameter,e);return an(o[0],c,l(g(o[2],-1)),m(g(o[3],\"round\")).toLowerCase(),f,d)}))},n.functions.rotate=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{o=s(o),u(o,2,3,t,e);let l=o[0];if(null===l)return null;if(!(l instanceof k))throw new r(t,i.InvalidParameter,e);l instanceof D&&(l=wn.fromExtent(l));const c=A(o[1]);if(isNaN(c))throw new r(t,i.InvalidParameter,e);const f=g(o[2],null);if(null===f)return on(l,c);if(f instanceof mn)return on(l,c,f);throw new r(t,i.InvalidParameter,e)}))},n.functions.centroid=function(t,e){return n.standardFunctionAsync(t,e,((n,o,l)=>{if(l=s(l),u(l,1,1,t,e),null===l[0])return null;let c=l[0];if((w(l[0])||h(l[0]))&&(c=I(l[0],t.spatialReference)),null===c)return null;if(!(c instanceof k))throw new r(t,i.InvalidParameter,e);return c instanceof mn?y(a(l[0]),t.spatialReference):c instanceof wn?c.centroid:c instanceof hn?x(c):c instanceof dn?N(c):c instanceof D?c.center:null}))},n.functions.multiparttosinglepart=function(t,e){return n.standardFunctionAsync(t,e,(async(n,o,l)=>{l=s(l),u(l,1,1,t,e);const c=[];if(null===l[0])return null;if(!(l[0]instanceof k))throw new r(t,i.InvalidParameter,e);if(l[0]instanceof mn)return[y(a(l[0]),t.spatialReference)];if(l[0]instanceof D)return[y(a(l[0]),t.spatialReference)];const f=await ln(l[0]);if(f instanceof wn){const n=[],t=[];for(let e=0;e{if(o=s(o),u(o,1,1,t,e),null===o[0])return!0;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return sn(o[0])}))},n.functions.simplify=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,1,1,t,e),null===o[0])return null;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return ln(o[0])}))},n.functions.convexhull=function(t,e){return n.standardFunctionAsync(t,e,((n,a,o)=>{if(o=s(o),u(o,1,1,t,e),null===o[0])return null;if(!(o[0]instanceof k))throw new r(t,i.InvalidParameter,e);return un(o[0])}))},n.functions.getuser=function(a,o){return n.standardFunctionAsync(a,o,(async(n,l,s)=>{u(s,0,2,a,o);let c=g(s[1],\"\"),f=!0===c;if(c=!0===c||!1===c?\"\":m(c),0===s.length||s[0]instanceof t){let n=null;n=a.services?.portal?a.services.portal:pn.getDefault(),s.length>0&&(n=j(s[0],n));const t=await gn(n,c,f);if(t){const n=JSON.parse(JSON.stringify(t));for(const t of[\"lastLogin\",\"created\",\"modified\"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return e.convertObjectToArcadeDictionary(n,R(a))}return null}let d=null;if(p(s[0])&&(d=s[0]),d){if(f=!1,c)return null;await d.load();const n=await d.getOwningSystemUrl();if(!n){if(!c){const n=await d.getIdentityUser();return n?e.convertObjectToArcadeDictionary({username:n},R(a)):null}return null}let r=null;r=a.services?.portal?a.services.portal:pn.getDefault(),r=j(new t(n),r);const i=await gn(r,c,f);if(i){const n=JSON.parse(JSON.stringify(i));for(const t of[\"lastLogin\",\"created\",\"modified\"])void 0!==n[t]&&null!==n[t]&&(n[t]=new Date(n[t]));return e.convertObjectToArcadeDictionary(n,R(a))}return null}throw new r(a,i.InvalidParameter,o)}))}),n.functions.nearestcoordinate=function(t,a){return n.standardFunctionAsync(t,a,(async(n,o,l)=>{if(l=s(l),u(l,2,2,t,a),!(l[0]instanceof k||null===l[0]))throw new r(t,i.InvalidParameter,a);if(!(l[1]instanceof mn||null===l[1]))throw new r(t,i.InvalidParameter,a);if(null===l[0]||null===l[1])return null;const c=await cn(l[0],l[1]);return null===c?null:e.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance},R(t),!1,!0)}))},n.functions.nearestvertex=function(t,a){return n.standardFunctionAsync(t,a,(async(n,o,l)=>{if(l=s(l),u(l,2,2,t,a),!(l[0]instanceof k||null===l[0]))throw new r(t,i.InvalidParameter,a);if(!(l[1]instanceof mn||null===l[1]))throw new r(t,i.InvalidParameter,a);if(null===l[0]||null===l[1])return null;const c=await fn(l[0],l[1]);return null===c?null:e.convertObjectToArcadeDictionary({coordinate:c.coordinate,distance:c.distance},R(t),!1,!0)}))}}export{An as registerFunctions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ArcadeModule as e}from\"./ArcadeModule.js\";import{ArcadeModuleLoader as t}from\"./ArcadeModuleLoader.js\";import n from\"./Dictionary.js\";import{ArcadeExecutionError as r,ExecutionErrorCodes as o,ensureArcadeExecutionError as a}from\"./executionError.js\";import i from\"./Feature.js\";import{NativeFunction as l,ArcadeFunction as s,ScopeMarshalledFunction as c,wrapModuleScopedResponse as u}from\"./FunctionWrapper.js\";import{E as f,a as p,C as w,z as d,x as h,y as m,i as g,c as y,R as v,o as b,q as S,r as x,u as I,b as F,g as C,I as R,j as A,B as M,D as j,A as L}from\"../chunks/languageUtils.js\";import{addFunctionDeclaration as k}from\"./treeAnalysis.js\";import{A as E}from\"../chunks/array.js\";import{registerFunctions as N}from\"./functions/date.js\";import{registerFunctions as O}from\"./functions/geomasync.js\";import{registerFunctions as B,geometryMember as P}from\"./functions/geometry.js\";import{registerFunctions as K}from\"./functions/maths.js\";import{registerFunctions as D}from\"./functions/stats.js\";import{registerFunctions as G}from\"./functions/string.js\";import Z from\"../geometry/Geometry.js\";import U from\"../geometry/SpatialReference.js\";function q(e){return e&&\"function\"==typeof e.then}const T=100;async function W(e,t){const n=[];for(let r=0;r{const n={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(n.depthCounter.depth>64)throw new r(e,o.MaximumCallDepth,null);return Pe(this.definition,n,t,null)}}call(e,t){return Y(e,t,((n,a,i)=>{const l={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(l.depthCounter.depth>64)throw new r(e,o.MaximumCallDepth,t);return Pe(this.definition,l,i,t)}))}marshalledCall(e,t,n,r){return r(e,t,(async(o,a,i)=>{const l={spatialReference:e.spatialReference,globalScope:n.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{}};return i=i.map((t=>!g(t)||t instanceof c?t:u(t,e,r))),u(await Pe(this.definition,l,i,t),n,r)}))}}class z extends e{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await H(this.executingContext,t.node),t.valueset=!0),g(t.value)&&!(t.value instanceof c)){const e=new c;e.fn=t.value,e.parameterEvaluator=Y,e.context=this.executingContext,t.value=e}return t.value}setGlobal(e,t){if(g(t))throw new r(null,o.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return void 0===this.executingContext.exports[e]&&(e=e.toLowerCase()),void 0!==this.executingContext.exports[e]}async loadModule(e){let n=e.spatialReference;null==n&&(n=new U({wkid:102100})),this.moduleScope=Ge({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:n,services:e.services,libraryResolver:new t(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:void 0===e.abortSignal||null===e.abortSignal?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console??Ze,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function Y(e,t,n){if(!0===t.preparsed){const r=n(e,null,t.arguments);return q(r),r}const r=n(e,t,await W(e,t));return q(r),r}async function H(e,t,n){if(t.breakpoint&&!0!==n){const n=t.breakpoint();return await n,H(e,t,!0)}try{switch(t?.type){case\"VariableDeclarator\":return await xe(e,t);case\"ImportDeclaration\":return await ve(e,t);case\"ExportNamedDeclaration\":return await be(e,t);case\"VariableDeclaration\":return await Se(e,t,0);case\"BlockStatement\":case\"Program\":return await he(e,t);case\"FunctionDeclaration\":return await ye(e,t);case\"ReturnStatement\":return await ge(e,t);case\"IfStatement\":return await de(e,t);case\"ExpressionStatement\":return await we(e,t);case\"UpdateExpression\":return await ue(e,t);case\"AssignmentExpression\":return await pe(e,t);case\"ForStatement\":return await ne(e,t);case\"WhileStatement\":return await X(e,t);case\"ForInStatement\":return await ce(e,t);case\"BreakStatement\":return m;case\"EmptyStatement\":return h;case\"ContinueStatement\":return d;case\"TemplateElement\":return await Le(e,t);case\"TemplateLiteral\":return await Ee(e,t);case\"Identifier\":return await Me(e,t);case\"MemberExpression\":return await Ie(e,t);case\"Literal\":return t.value;case\"CallExpression\":return await je(e,t);case\"UnaryExpression\":return await Fe(e,t);case\"BinaryExpression\":return await Re(e,t);case\"LogicalExpression\":return await Ae(e,t);case\"ArrayExpression\":return await Ce(e,t);case\"ObjectExpression\":return await J(e,t);case\"Property\":return await Q(e,t);default:throw new r(e,o.Unrecognized,t)}}catch(i){throw a(e,t,i)}}async function J(e,t){const a=[];for(let n=0;n{try{!0===n.testResult?++a>T?(a=0,setTimeout((()=>{te(e,t,n,r,o,a)}),0)):te(e,t,n,r,o,a):n.lastAction instanceof v?r(n.lastAction):r(h)}catch(i){o(i)}}),(e=>{o(e)}))}catch(i){o(i)}}function ne(e,t){try{return null!==t.init?H(e,t.init).then((()=>new Promise(((n,r)=>{te(e,t,{testResult:!0,lastAction:h},(e=>{n(e)}),(e=>{r(e)}),0)})))):new Promise(((n,r)=>{te(e,t,{testResult:!0,lastAction:h},(e=>{n(e)}),(e=>{r(e)}),0)}))}catch(n){return Promise.reject(n)}}function re(e,t,n,r,o,a,i,l,s,c){try{if(r<=a)return void l(h);o.value=\"k\"===i?n[a]:a,H(e,t.body).then((u=>{try{u instanceof v?l(u):u===m?l(h):++c>T?(c=0,setTimeout((()=>{re(e,t,n,r,o,a+1,i,l,s,c)}),0)):re(e,t,n,r,o,a+1,i,l,s,c)}catch(f){s(f)}}),(e=>{s(e)}))}catch(u){s(u)}}function oe(e,t,n,r,o,a,i,l,s){try{if(n.length()<=o)return void i(h);r.value=\"k\"===a?n.get(o):o,H(e,t.body).then((c=>{c instanceof v?i(c):c===m?i(h):++s>T?(s=0,setTimeout((()=>{oe(e,t,n,r,o+1,a,i,l,s)}),0)):oe(e,t,n,r,o+1,a,i,l,s)}),(e=>{l(e)}))}catch(c){l(c)}}function ae(e,t,n,r,o,a){try{if(void 0===a&&(a=\"i\"),0===n.length)return void r.resolve(h);re(e,t,n,n.length,o,0,a,(e=>{r.resolve(e)}),(e=>{r.reject(e)}),0)}catch(i){r.reject(i)}}function ie(e,t,n,r,o,a){try{if(void 0===a&&(a=\"i\"),0===n.length)return void r.resolve(h);oe(e,t,n,o,0,a,(e=>{r.resolve(e)}),(e=>{r.reject(e)}),0)}catch(i){r.reject(i)}}function le(e,t,n,r,o){try{ae(e,t,n.keys(),r,o,\"k\")}catch(a){r.reject(a)}}function se(e,t,n,r,o,a,l,s){try{e.next().then((c=>{try{if(null===c)a(h);else{const u=i.createFromGraphicLikeObject(c.geometry,c.attributes,r,t.timeZone);u._underlyingGraphic=c,o.value=u;H(t,n.body).then((i=>{try{i===m?a(h):i instanceof v?a(i):++s>T?(s=0,setTimeout((()=>{se(e,t,n,r,o,a,l,s)}),0)):se(e,t,n,r,o,a,l,s)}catch(c){l(c)}}),(e=>{l(e)}))}}catch(u){l(u)}}),(e=>{l(e)}))}catch(c){l(c)}}async function ce(e,t){return new Promise(((a,i)=>{H(e,t.right).then((l=>{try{let s=null;s=\"VariableDeclaration\"===t.left.type?H(e,t.left):Promise.resolve(),s.then((()=>{try{let s=\"\";if(\"VariableDeclaration\"===t.left.type){const e=t.left.declarations[0].id;\"Identifier\"===e.type&&(s=e.name)}else\"Identifier\"===t.left.type&&(s=t.left.name);if(!s)throw new r(e,o.InvalidIdentifier,t);s=s.toLowerCase();let c=null;if(null!=e.localScope&&void 0!==e.localScope[s]&&(c=e.localScope[s]),null===c&&void 0!==e.globalScope[s]&&(c=e.globalScope[s]),null===c)return void i(new r(e,o.InvalidIdentifier,t));b(l)||y(l)?ae(e,t,l,{reject:i,resolve:a},c):S(l)?ie(e,t,l,{reject:i,resolve:a},c):l instanceof n||x(l)?le(e,t,l,{reject:i,resolve:a},c):I(l)?se(l.iterator(e.abortSignal),e,t,l,c,(e=>{a(e)}),(e=>{i(e)}),0):ae(e,t,[],{reject:i,resolve:a},c)}catch(s){i(s)}}),i)}catch(s){i(s)}}),i)}))}async function ue(e,t){const a=t.argument;if(\"MemberExpression\"===a.type){const i={t:null},l=await H(e,a.object);let s=null;i.t=l,!0===a.computed?s=await H(e,a.property):\"Identifier\"===a.property.type&&(s=a.property.name);const c=i.t;let u;if(b(c)){if(!F(s))throw new r(e,o.ArrayAccessorMustBeNumber,t);if(s<0&&(s=c.length+s),s<0||s>=c.length)throw new r(e,o.OutOfBounds,t);u=C(c[s]),c[s]=\"++\"===t.operator?u+1:u-1}else if(c instanceof n){if(!1===y(s))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==c.hasField(s))throw new r(e,o.FieldNotFound,t,{key:s});u=C(c.field(s)),c.setField(s,\"++\"===t.operator?u+1:u-1)}else if(c instanceof z){if(!1===y(s))throw new r(e,o.ModuleAccessorMustBeString,t);if(!0!==c.hasGlobal(s))throw new r(e,o.ModuleExportNotFound,t);u=C(await c.global(s)),c.setGlobal(s,\"++\"===t.operator?u+1:u-1)}else{if(!x(c))throw S(c)?new r(e,o.Immutable,t):new r(e,o.InvalidParameter,t);if(!1===y(s))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==c.hasField(s))throw new r(e,o.FieldNotFound,t,{key:s});u=C(c.field(s)),c.setField(s,\"++\"===t.operator?u+1:u-1)}return!1===t.prefix?u:\"++\"===t.operator?u+1:u-1}const i=\"Identifier\"===t.argument.type?t.argument.name.toLowerCase():\"\";if(!i)throw new r(e,o.InvalidIdentifier,t);let l;if(null!=e.localScope&&void 0!==e.localScope[i])return l=C(e.localScope[i].value),e.localScope[i]={value:\"++\"===t.operator?l+1:l-1,valueset:!0,node:t},!1===t.prefix?l:\"++\"===t.operator?l+1:l-1;if(void 0!==e.globalScope[i])return l=C(e.globalScope[i].value),e.globalScope[i]={value:\"++\"===t.operator?l+1:l-1,valueset:!0,node:t},!1===t.prefix?l:\"++\"===t.operator?l+1:l-1;throw new r(e,o.InvalidIdentifier,t)}function fe(e,t,n,a,i){switch(t){case\"=\":return e===h?null:e;case\"/=\":return C(n)/C(e);case\"*=\":return C(n)*C(e);case\"-=\":return C(n)-C(e);case\"+=\":return y(n)||y(e)?A(n)+A(e):C(n)+C(e);case\"%=\":return C(n)%C(e);default:throw new r(i,o.UnsupportedOperator,a)}}async function pe(e,t){const a=t.left;if(\"MemberExpression\"===a.type){const i=await H(e,a.object);let l=null;if(!0===a.computed)l=await H(e,a.property);else{if(\"Identifier\"!==a.property.type)throw new r(e,o.InvalidIdentifier,t);l=a.property.name}const s=await H(e,t.right);if(b(i)){if(!F(l))throw new r(e,o.ArrayAccessorMustBeNumber,t);if(l<0&&(l=i.length+l),l<0||l>i.length)throw new r(e,o.OutOfBounds,t);if(l===i.length){if(\"=\"!==t.operator)throw new r(e,o.OutOfBounds,t);i[l]=fe(s,t.operator,i[l],t,e)}else i[l]=fe(s,t.operator,i[l],t,e)}else if(i instanceof n){if(!1===y(l))throw new r(e,o.KeyAccessorMustBeString,t);if(!0===i.hasField(l))i.setField(l,fe(s,t.operator,i.field(l),t,e));else{if(\"=\"!==t.operator)throw new r(e,o.FieldNotFound,t,{key:l});i.setField(l,fe(s,t.operator,null,t,e))}}else if(i instanceof z){if(!1===y(l))throw new r(e,o.KeyAccessorMustBeString,t);if(!0!==i.hasGlobal(l))throw new r(e,o.ModuleExportNotFound,t);i.setGlobal(l,fe(s,t.operator,await i.global(l),t,e))}else{if(!x(i))throw S(i)?new r(e,o.Immutable,t):new r(e,o.InvalidParameter,t);if(!1===y(l))throw new r(e,o.KeyAccessorMustBeString,t);if(!0===i.hasField(l))i.setField(l,fe(s,t.operator,i.field(l),t,e));else{if(\"=\"!==t.operator)throw new r(e,o.FieldNotFound,t,{key:l});i.setField(l,fe(s,t.operator,null,t,e))}}return h}const i=a.name.toLowerCase();if(null!=e.localScope&&void 0!==e.localScope[i]){const n=await H(e,t.right);return e.localScope[i]={value:fe(n,t.operator,e.localScope[i].value,t,e),valueset:!0,node:t.right},h}if(void 0!==e.globalScope[i]){const n=await H(e,t.right);return e.globalScope[i]={value:fe(n,t.operator,e.globalScope[i].value,t,e),valueset:!0,node:t.right},h}throw new r(e,o.InvalidIdentifier,t)}async function we(e,t){if(\"AssignmentExpression\"===t.expression.type)return H(e,t.expression);if(\"CallExpression\"===t.expression.type){const n=await H(e,t.expression);return n===h?h:new R(n)}const n=await H(e,t.expression);return n===h?h:new R(n)}async function de(e,t){const n=await H(e,t.test);if(!0===n)return H(e,t.consequent);if(!1===n)return null!==t.alternate?H(e,t.alternate):h;throw new r(e,o.BooleanConditionRequired,t)}async function he(e,t){return me(e,t,0)}async function me(e,t,n){if(n>=t.body.length)return h;const r=await H(e,t.body[n]);return r instanceof v||r===m||r===d||n===t.body.length-1?r:me(e,t,n+1)}async function ge(e,t){if(null===t.argument)return new v(h);const n=await H(e,t.argument);return new v(n)}async function ye(e,t){const n=t.id.name.toLowerCase();return e.globalScope[n]={valueset:!0,node:null,value:new _(t,e)},h}async function ve(e,t){const n=t.specifiers[0].local.name.toLowerCase(),r=e.libraryResolver.loadLibrary(n);let o=null;return e.libraryResolver._moduleSingletons?.has(r.uri)?o=e.libraryResolver._moduleSingletons.get(r.uri):(o=new z(r),await o.loadModule(e),e.libraryResolver._moduleSingletons?.set(r.uri,o)),e.globalScope[n]={value:o,valueset:!0,node:t},h}async function be(e,t){if(await H(e,t.declaration),\"FunctionDeclaration\"===t.declaration.type)e.exports[t.declaration.id.name.toLowerCase()]=\"function\";else if(\"VariableDeclaration\"===t.declaration.type)for(const n of t.declaration.declarations)e.exports[n.id.name.toLowerCase()]=\"variable\";return h}async function Se(e,t,n){return n>=t.declarations.length?h:(await H(e,t.declarations[n]),n===t.declarations.length-1||await Se(e,t,n+1),h)}async function xe(e,t){let n=null;if(n=null===t.init?null:await H(e,t.init),null!==e.localScope){if(n===h&&(n=null),\"Identifier\"!==t.id.type)throw new r(e,o.InvalidIdentifier,t);const a=t.id.name.toLowerCase();return null!=e.localScope&&(e.localScope[a]={value:n,valueset:!0,node:t.init}),h}if(\"Identifier\"!==t.id.type)throw new r(e,o.InvalidIdentifier,t);const a=t.id.name.toLowerCase();return n===h&&(n=null),e.globalScope[a]={value:n,valueset:!0,node:t.init},h}async function Ie(e,t){const a=await H(e,t.object);if(null===a)throw new r(e,o.MemberOfNull,t);if(!1===t.computed){if(\"Identifier\"===t.property.type){if(a instanceof n||x(a))return a.field(t.property.name);if(a instanceof Z)return P(a,t.property.name,e,t);if(a instanceof z){if(!a.hasGlobal(t.property.name))throw new r(e,o.InvalidIdentifier,t);return a.global(t.property.name)}throw new r(e,o.InvalidMemberAccessKey,t)}throw new r(e,o.InvalidMemberAccessKey,t)}let i=await H(e,t.property);if(a instanceof n||x(a)){if(y(i))return a.field(i);throw new r(e,o.InvalidMemberAccessKey,t)}if(a instanceof z){if(y(i))return a.global(i);throw new r(e,o.InvalidMemberAccessKey,t)}if(a instanceof Z){if(y(i))return P(a,i,e,t);throw new r(e,o.InvalidMemberAccessKey,t)}if(b(a)){if(F(i)&&isFinite(i)&&Math.floor(i)===i){if(i<0&&(i=a.length+i),i>=a.length||i<0)throw new r(e,o.OutOfBounds,t);return a[i]}throw new r(e,o.InvalidMemberAccessKey,t)}if(S(a)){if(F(i)&&isFinite(i)&&Math.floor(i)===i){if(i<0&&(i=a.length()+i),i>=a.length()||i<0)throw new r(e,o.OutOfBounds,t);return a.get(i)}throw new r(e,o.InvalidMemberAccessKey,t)}if(y(a)){if(F(i)&&isFinite(i)&&Math.floor(i)===i){if(i<0&&(i=a.length+i),i>=a.length||i<0)throw new r(e,o.OutOfBounds,t);return a[i]}throw new r(e,o.InvalidMemberAccessKey,t)}throw new r(e,o.InvalidMemberAccessKey,t)}async function Fe(e,t){const n=await H(e,t.argument);if(p(n)){if(\"!\"===t.operator)return!n;if(\"-\"===t.operator)return-1*C(n);if(\"+\"===t.operator)return 1*C(n);if(\"~\"===t.operator)return~C(n);throw new r(e,o.UnsupportedUnaryOperator,t)}if(\"-\"===t.operator)return-1*C(n);if(\"+\"===t.operator)return 1*C(n);if(\"~\"===t.operator)return~C(n);throw new r(e,o.UnsupportedUnaryOperator,t)}async function Ce(e,t){const n=[];for(let r=0;r>\":case\">>>\":case\"^\":case\"&\":return j(C(a),C(i),t.operator);case\"==\":return w(a,i);case\"!=\":return!w(a,i);case\"<\":case\">\":case\"<=\":case\">=\":return M(a,i,t.operator);case\"+\":return y(a)||y(i)?A(a)+A(i):C(a)+C(i);case\"-\":return C(a)-C(i);case\"*\":return C(a)*C(i);case\"/\":return C(a)/C(i);case\"%\":return C(a)%C(i);default:throw new r(e,o.UnsupportedOperator,t)}}async function Ae(e,t){const n=await H(e,t.left);let a=null;if(!p(n))throw new r(e,o.LogicalExpressionOnlyBoolean,t);switch(t.operator){case\"||\":if(!0===n)return n;if(a=await H(e,t.right),p(a))return a;throw new r(e,o.LogicExpressionOrAnd,t);case\"&&\":if(!1===n)return n;if(a=await H(e,t.right),p(a))return a;throw new r(e,o.LogicExpressionOrAnd,t);default:throw new r(e,o.LogicExpressionOrAnd,t)}}async function Me(e,t){const n=t.name.toLowerCase();if(null!=e.localScope&&void 0!==e.localScope[n]){const t=e.localScope[n];if(!0===t.valueset)return t.value;if(null!==t.d)return t.d;t.d=H(e,t.node);const r=await t.d;return t.value=r,t.valueset=!0,r}if(void 0!==e.globalScope[n]){const t=e.globalScope[n];if(!0===t.valueset)return t.value;if(null!==t.d)return t.d;t.d=H(e,t.node);const r=await t.d;return t.value=r,t.valueset=!0,r}throw new r(e,o.InvalidIdentifier,t)}async function je(e,t){if(\"MemberExpression\"===t.callee.type){const n=await H(e,t.callee.object);if(!(n instanceof z))throw new r(e,o.FunctionNotFound,t);const a=!1===t.callee.computed?t.callee.property.name:await H(e,t.callee.property);if(!n.hasGlobal(a))throw new r(e,o.FunctionNotFound,t);const i=await n.global(a);if(!g(i))throw new r(e,o.CallNonFunction,t);return i.call(e,t)}if(\"Identifier\"!==t.callee.type)throw new r(e,o.FunctionNotFound,t);if(null!=e.localScope&&void 0!==e.localScope[t.callee.name.toLowerCase()]){const n=e.localScope[t.callee.name.toLowerCase()];if(g(n.value))return n.value.call(e,t);throw new r(e,o.CallNonFunction,t)}if(void 0!==e.globalScope[t.callee.name.toLowerCase()]){const n=e.globalScope[t.callee.name.toLowerCase()];if(g(n.value))return n.value.call(e,t);throw new r(e,o.CallNonFunction,t)}throw new r(e,o.FunctionNotFound,t)}async function Le(e,t){return t.value?t.value.cooked:\"\"}function ke(e,t,n){if(g(e))throw new r(t,o.NoFunctionInTemplateLiteral,n);return e}async function Ee(e,t){const n=[];for(let a=0;at.createFromGraphicLikeObject(e.geometry,e.attributes,this._parent,s)))}nextBatch(t){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((e=>this.nextBatch(t)),(e=>this.nextBatch(t)));const e={returnpromise:null,hasset:!1},s=[];return e.returnpromise=new Promise(((n,a)=>{this._parent._getSet(this._progress).then((r=>{const i=r._known;let h=i.length-1;if(\"GETPAGES\"===i[i.length-1]&&(h-=1),this._lastId+t>h&&i.length>0&&\"GETPAGES\"===i[i.length-1])return void this._parent._expandPagedSet(r,this._parent._maxQueryRate(),0,0,this._progress).then((s=>{e.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(t).then(n,a)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,a(t)}));const _=r._candidates;if(h>=this._lastId+t||0===_.length){for(let e=0;e=i.length)break;s[e]=i[t]}return this._lastId+=s.length,0===s.length&&(e.hasset=!0,this._parent._mainSetInUse=null,n([])),void this._parent._getFeatureBatch(s,this._progress).then((t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,a(t)}))}this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then((()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(t).then(n,a)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,a(t)}))}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,a(t)}))})),!1===e.hasset&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}next(){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((t=>this.next()),(t=>this.next()));const t={returnpromise:null,hasset:!1};return t.returnpromise=new Promise(((e,s)=>{this._parent._getSet(this._progress).then((n=>{const a=n._known;if(this._lastId(t.hasset=!0,this._parent._mainSetInUse=null,this.next()))).then(e,s):(this._lastId+=1,this._parent._getFeature(n,a[this._lastId],this._progress).then((s=>{t.hasset=!0,this._parent._mainSetInUse=null,e(s)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)})));else{n._candidates.length>0?this._parent._refineSetBlock(n,this._parent._maxProcessingRate(),this._progress).then((()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.next().then(e,s)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)})):(t.hasset=!0,this._parent._mainSetInUse=null,e(null))}}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,s(e)}))})),!1===t.hasset&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}async count(){if(-1!==this._parent._totalCount)return this._parent._totalCount;const t=await this._parent._getSet(this._progress),e=await this._refineAllSets(t);return this._parent._totalCount=e._known.length,this._parent._totalCount}async _refineAllSets(t){if(t._known.length>0&&\"GETPAGES\"===t._known[t._known.length-1])return await this._parent._expandPagedSet(t,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(t);if(t._candidates.length>0){if(\"GETPAGES\"===t._known[t._candidates.length-1])return await this._parent._expandPagedSet(t,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(t);const e=await this._parent._refineSetBlock(t,this._parent._maxProcessingRate(),this._progress);return e._candidates.length>0?this._refineAllSets(e):e}return t}}export{e as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nclass t{constructor(t,s,e,i){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=t,this._known=s,this._ordered=e,this.pagesDefinition=i}}export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ArcadeDate as e}from\"../../ArcadeDate.js\";import{SqlError as r,SqlErrorCodes as t}from\"./errorsupport.js\";import{FeatureServiceDatabaseType as a,isDate as s,isLuxonDate as n,isArcadeTime as c,isArcadeDate as o,isArcadeDateOnly as i}from\"./shared.js\";import{TimeOnly as l}from\"../../../core/sql/TimeOnly.js\";import{WhereClause as u}from\"../../../core/sql/WhereClause.js\";import{DateTime as d}from\"luxon\";function f(e,r){return h(e?.parseTree,r,e?.parameters)}function p(e,r,t){return h(e,r,t)}function m(e,r,t,s){return u.create(h(e.parseTree,a.Standardised,e.parameters,r,t),s,e.timeZone)}function g(e,r,t=\"AND\"){return u.create(\"((\"+f(e,a.Standardised)+\")\"+t+\"(\"+f(r,a.Standardised)+\"))\",e.fieldsIndex,e.timeZone)}function h(e,l,u,d=null,f=null){let p,m,g,I;switch(e.type){case\"interval\":return F(h(e.value,l,u,d,f),e.qualifier,e.op);case\"case-expression\":{let r=\" CASE \";\"simple\"===e.format&&(r+=h(e.operand,l,u,d,f));for(let t=0;t\":case\"<\":case\">\":case\">=\":case\"<=\":case\"=\":case\"*\":case\"-\":case\"+\":case\"/\":return\" (\"+h(e.left,l,u,d,f)+\" \"+e.operator+\" \"+h(e.right,l,u,d,f)+\") \";case\"||\":return\" (\"+h(e.left,l,u,d,f)+\" \"+(l===a.SqlServer?\"+\":e.operator)+\" \"+h(e.right,l,u,d,f)+\") \"}throw new r(t.UnsupportedOperator,{operator:e.operator});case\"null\":return\"null\";case\"boolean\":return!0===e.value?\"1\":\"0\";case\"string\":return\"'\"+e.value.toString().replaceAll(\"'\",\"''\")+\"'\";case\"timestamp\":return`timestamp '${e.value}'`;case\"date\":return`date '${e.value}'`;case\"time\":return`time '${e.value}'`;case\"number\":return e.value.toString();case\"current-time\":return L(\"date\"===e.mode,l);case\"column-reference\":return d?d.toLowerCase()===e.column.toLowerCase()?\"(\"+f+\")\":!0===e.delimited?`\"${e.column.split('\"').join('\"\"')}\"`:e.column:e.column;case\"data-type\":return e.value;case\"function\":{const r=h(e.args,l,u,d,f);return y(e.name,r,l)}}throw new r(t.UnsupportedSyntax,{node:e.type})}function y(e,s,n){switch(e.toLowerCase().trim()){case\"cos\":case\"sin\":case\"tan\":case\"cosh\":case\"tanh\":case\"sinh\":case\"acos\":case\"asin\":case\"atan\":case\"floor\":case\"log10\":case\"log\":case\"abs\":if(1!==s.length)throw new r(t.InvalidFunctionParameters,{function:e.toLowerCase().trim()});return`${e.toUpperCase().trim()}(${s[0]})`;case\"ceiling\":case\"ceil\":if(1!==s.length)throw new r(t.InvalidFunctionParameters,{function:\"ceiling\"});switch(n){case a.Standardised:case a.StandardisedNoInterval:}return\"CEILING(\"+s[0]+\")\";case\"mod\":case\"power\":case\"nullif\":if(2!==s.length)throw new r(t.InvalidFunctionParameters,{function:e.toLowerCase().trim()});return`${e.toUpperCase().trim()}(${s[0]},${s[1]})`;case\"round\":if(2===s.length)return\"ROUND(\"+s[0]+\",\"+s[1]+\")\";if(1===s.length)return\"ROUND(\"+s[0]+\")\";throw new r(t.InvalidFunctionParameters,{function:\"round\"});case\"truncate\":if(s.length<1||s.length>2)throw new r(t.InvalidFunctionParameters,{function:\"truncate\"});return n===a.SqlServer?\"ROUND(\"+s[0]+(1===s.length?\"0\":\",\"+s[1])+\",1)\":\"TRUNCATE(\"+s[0]+(1===s.length?\")\":\",\"+s[1]+\")\");case\"char_length\":case\"len\":if(1!==s.length)throw new r(t.InvalidFunctionParameters,{function:\"char_length\"});switch(n){case a.SqlServer:return\"LEN(\"+s[0]+\")\";case a.Oracle:return\"LENGTH(\"+s[0]+\")\";default:return\"CHAR_LENGTH(\"+s[0]+\")\"}case\"coalesce\":case\"concat\":{if(s.length<1)throw new r(t.InvalidFunctionParameters,{function:e.toLowerCase()});let a=e.toUpperCase().trim()+\"(\";for(let e=0;e\":case\"<\":case\">\":case\">=\":case\"<=\":case\"=\":return\"boolean\";case\"IS\":case\"ISNOT\":if(\"null\"!==a.right.type)throw new r(t.UnsupportedIsRhs);return\"boolean\";case\"*\":case\"-\":case\"+\":case\"/\":return b([A(e,a.left,n,l),A(e,a.right,n,l)]);case\"||\":return\"string\";default:throw new r(t.UnsupportedOperator,{operator:a.operator})}case\"null\":return\"\";case\"boolean\":return\"boolean\";case\"string\":return\"string\";case\"number\":return null===a.value?\"\":a.value%1==0?\"integer\":\"double\";case\"date\":return\"date\";case\"timestamp\":return a.withtimezone?\"timestamp-offset\":\"date\";case\"time\":return\"time-only\";case\"current-time\":return\"date\";case\"column-reference\":{const r=e[a.column.toLowerCase()];return void 0===r?\"\":r}case\"function\":switch(a.name.toLowerCase()){case\"cast\":switch(a.args?.value[1]?.value.type??\"\"){case\"integer\":case\"smallint\":return\"integer\";case\"real\":case\"float\":return\"double\";case\"date\":case\"timestamp\":return!0===a.args?.value[1]?.value?.withtimezone?\"timestamp-offset\":\"date\";case\"time\":return\"time-only\";case\"varchar\":return\"string\";default:return\"\"}case\"position\":case\"extract\":case\"char_length\":case\"mod\":return\"integer\";case\"round\":if(u=A(e,a.args,n,l),u instanceof Array){if(u.length<=0)return\"double\";u=u[0]}return u;case\"sign\":return\"integer\";case\"ceiling\":case\"floor\":case\"abs\":return u=A(e,a.args,n,l),u instanceof Array&&(u=b(u)),\"integer\"===u||\"double\"===u?u:\"double\";case\"area\":case\"length\":case\"log\":case\"log10\":case\"sin\":case\"cos\":case\"tan\":case\"asin\":case\"acos\":case\"atan\":case\"cosh\":case\"sinh\":case\"tanh\":case\"power\":return\"double\";case\"substring\":case\"trim\":case\"concat\":case\"lower\":case\"upper\":return\"string\";case\"truncate\":return\"double\";case\"nullif\":case\"coalesce\":return u=A(e,a.args,n,l),u instanceof Array?u.length>0?u[0]:\"\":u}return\"\"}throw new r(t.UnsupportedSyntax,{node:a.type})}const N={boolean:1,string:2,integer:3,double:4,date:5};function b(e){if(e){let r=\"\";for(const t of e)\"\"!==t&&(r=\"\"===r||N[r]=n&&-1!==n)return c}return c}function w(t){switch(t.toLowerCase()){case\"distinct\":return\"distinct\";case\"avg\":case\"mean\":return\"avg\";case\"min\":return\"min\";case\"sum\":return\"sum\";case\"max\":return\"max\";case\"stdev\":case\"stddev\":return\"stddev\";case\"var\":case\"variance\":return\"var\";case\"count\":return\"count\"}return\"\"}function d(t,n,e=1e3){switch(t.toLowerCase()){case\"distinct\":return p(n,e);case\"avg\":case\"mean\":return f(n);case\"min\":return Math.min.apply(Math,n);case\"sum\":return g(n);case\"max\":return Math.max.apply(Math,n);case\"stdev\":case\"stddev\":return Math.sqrt(h(n));case\"var\":case\"variance\":return h(n);case\"count\":return n.length}return 0}async function v(t,n,e){const r=await O(t,n,e,!0);return 0===r.length?null:Math.min.apply(Math,r)}async function y(t,n,e){const r=await O(t,n,e,!0);return 0===r.length?null:Math.max.apply(Math,r)}async function M(t,n,e){let r=\"\";n&&!c(n)&&(r=s(n,t.fields));const a=await O(t,n,e,!0);if(0===a.length)return null;const i=f(a);return null===i?i:\"integer\"===r?u(i):i}async function x(t,n,e){const r=await O(t,n,e,!0);return 0===r.length?null:m(r)}async function T(t,n,e){const r=await O(t,n,e,!0);return 0===r.length?null:Math.sqrt(m(r))}async function k(t,n,e){const r=await O(t,n,e,!0);return 0===r.length?null:g(r)}async function q(t,n){return t.iterator(n).count()}async function O(e,r,a,c=!1){const s=e.iterator(a),u=[],f={ticker:0};let h=await s.next();for(;null!==h;){if(f.ticker++,a.aborted)throw new t(n.Cancelled);f.ticker%100==0&&(f.ticker=0,await new Promise((t=>{setTimeout(t,0)})));const e=r?.calculateValue(h);null===e?!1===c&&(u[u.length]=e):u[u.length]=e instanceof i||e instanceof l?e.toNumber():e instanceof o?e.toMilliseconds():e,h=await s.next()}return u}async function S(e,r,a=1e3,c=null){const s=e.iterator(c),u=[],f={},h={ticker:0};let m=await s.next();for(;null!==m;){if(h.ticker++,c&&c.aborted)throw new t(n.Cancelled);h.ticker%100==0&&(h.ticker=0,await new Promise((t=>{setTimeout(t,0)})));const e=r?.calculateValue(m);let g=e;if(e instanceof i?g=\"!!DATEONLY!!-\"+e.toString():e instanceof o?g=\"!!TSOFFSETONLY!!-\"+e.toString():e instanceof l?g=\"!!TIMEONLY!!-\"+e.toString():e instanceof Date&&(g=\"!!DATE!!-\"+e.toString()),null!=e&&void 0===f[g]&&(u.push(e),f[g]=1),u.length>=a&&-1!==a)return u;m=await s.next()}return u}export{d as calculateStat,q as count,w as decodeStatType,S as distinct,y as max,M as mean,v as min,T as stdev,k as sum,x as variance};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"./cache.js\";import{FeatureSetError as t,FeatureSetErrorCodes as s}from\"./errorsupport.js\";import n from\"./FeatureSetIterator.js\";import i from\"./IdSet.js\";import{FeatureServiceDatabaseType as a,layerGeometryEsriConstants as r,IdState as l,convertSquareUnitsToCode as u,convertLinearUnitsToCode as h,esriFieldToJson as o,layerGeometryEsriRestConstants as c}from\"./shared.js\";import{max as d,min as _,sum as f,variance as p,stdev as m,mean as g,distinct as y,count as F}from\"./stats.js\";import{isPromiseLike as T}from\"../../../core/promiseUtils.js\";import{WhereClause as I}from\"../../../core/sql/WhereClause.js\";import{union as b,geodesicArea as w,planarArea as S,geodesicLength as D,planarLength as P}from\"../../../geometry/geometryEngineAsync.js\";import k from\"../../../geometry/SpatialReference.js\";import C from\"../../../layers/support/FieldsIndex.js\";class x{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=a.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass=\"esri.arcade.featureset.support.FeatureSet\",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType=\"\",this.objectIdField=\"\",this.globalIdField=\"\",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),e?.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return void 0===t?this[e]:(void 0!==this[e]&&(this[e]=t),this)}end(){return null!==this._parent&&!0===this._parent._transparent?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return!0===this._parent?.loaded?(this._initialiseFeatureSet(),this):(await(this._parent?.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField=\"\",this.objectIdField=\"\",this.globalIdField=\"\",this.spatialReference=new k({wkid:4326}),this.geometryType=r.point)}getField(e,t){let s;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some((t=>(t&&t.name.toLowerCase()===e&&(s=t),!!s)))),s}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=C.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(null!=e&&e.aborted)throw new t(s.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,s,n,i){return null!==this._parent&&this._parent._canDoAggregates(e,t,s,n,i)}async _getAggregatePagesDataSourceDefinition(e,n,i,a,r,l,u){if(null===this._parent)throw new t(s.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,n,i,a,r,l,u)}async _getAgregagtePhysicalPage(e,n,i){if(null===this._parent)throw new t(s.NeverReach);return this._parent._getAgregagtePhysicalPage(e,n,i)}async databaseType(){if(this._databaseType===a.NotEvaluated){if(null!==e.applicationCache){const t=e.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==t)return t}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==e.applicationCache&&e.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(t){throw null!==e.applicationCache&&e.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),t}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:a.SqlServer,testwhere:\"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0\"},{thetype:a.Oracle,testwhere:\"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0\"},{thetype:a.StandardisedNoInterval,testwhere:\"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0\"}];for(const t of e){if(!0===await this._runDatabaseProbe(t.testwhere))return t.thetype}return a.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return\"MUSTBESET\"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new t(s.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(void 0!==this._featureCache[e])return this._featureCache[e]}_isInFeatureSet(e){return l.Unknown}_getSet(e){throw new t(s.NotImplemented)}async _getFeature(e,n,i){if(this._checkCancelled(i),void 0!==this._featureFromCache(n))return this._featureFromCache(n);if(await this._getFeatures(e,n,this._maxProcessingRate(),i),this._checkCancelled(i),void 0!==this._featureFromCache(n))return this._featureFromCache(n);throw new t(s.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const s=new i([],e,!1,null),n=[];await this._getFeatures(s,-1,e.length,t),this._checkCancelled(t);for(const i of e)void 0!==this._featureFromCache(i)&&n.push(this._featureFromCache(i));return n}async _getFeatures(e,t,s,n){return\"success\"}_getFilteredSet(e,n,i,a,r){throw new t(s.NotImplemented)}async _refineSetBlock(e,t,s){if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate()))return await this._expandPagedSet(e,this._maxQueryRate(),0,0,s),this._refineSetBlock(e,t,s);this._checkCancelled(s);const n=e._candidates.length;this._refineKnowns(e,t);let i=n-e._candidates.length;if(0===e._candidates.length)return e;if(i>=t)return e;if(await this._refineIfParentKnown(e,t-i,s),this._checkCancelled(s),this._refineKnowns(e,t-i),i=n-e._candidates.length,i0){const n=t-i,a=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(a,a.length>n?n:e._candidates.length,s),this._checkCancelled(s),this._refineKnowns(e,t-i),e}return e}_fetchAndRefineFeatures(e,t,s){return null}_prepareFetchAndRefineSet(e){const t=[];for(let s=0;s=t)break}null!==n&&i.push(n);for(let a=i.length-1;a>=0;a--)e._candidates.splice(i[a].start,i[a].end-i[a].start+1)}_refineIfParentKnown(e,t,s){const n=new i([],[],e._ordered,null);return n._candidates=e._candidates.slice(0),this._parent._refineSetBlock(n,t,s)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(null===e.pagesDefinition)return!1;let s=0;for(let n=e._lastFetchedIndex;n=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(null===e.pagesDefinition)return!1;let s=0;for(let n=0;n=t)break}return!1}async _expandPagedSet(e,n,i,a,r){if(null===this._parent)throw new t(s.NotImplemented);return this._parent._expandPagedSet(e,n,i,a,r)}async _expandPagedSetFeatureSet(e,t,s,n,i){if(e._known.length>0&&\"GETPAGES\"===e._known[e._known.length-1]&&(n=1),0===n&&e._candidates.length>0&&\"GETPAGES\"===e._candidates[e._candidates.length-1]&&(n=2),0===n)return\"finished\";const a=await this._getPage(e,n,i);return s+ae.pagesDefinition.resultOffset||!0===e.pagesDefinition.internal.fullyResolved){n.length=n.length-1;let t=0;for(let i=0;i=e.pagesDefinition.internal.set.length);i++)n[n.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+i],t++;e.pagesDefinition.resultOffset+=t;let s=!1;return!0===e.pagesDefinition.internal.fullyResolved&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(s=!0),!1===s&&n.push(\"GETPAGES\"),t}return await this._getPhysicalPage(e,t,s),this._getPage(e,t,s)}_getPhysicalPage(e,t,s){return null}_clonePageDefinition(e){return null===this._parent?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,s,n){await this._ensureLoaded();let i=await this._stat(e,t,\"\",null,null,s,n);return!1===i.calculated&&(i=await this._manualStat(e,t,s,n)),i.result}async _manualStat(e,t,s,n){let i=null;switch(e.toLowerCase()){case\"count\":return i=await F(this,n),{calculated:!0,result:i};case\"distinct\":return i=await y(this,t,s,n),{calculated:!0,result:i};case\"avg\":case\"mean\":return i=await g(this,t,n),{calculated:!0,result:i};case\"stdev\":return i=await m(this,t,n),{calculated:!0,result:i};case\"variance\":return i=await p(this,t,n),{calculated:!0,result:i};case\"sum\":return i=await f(this,t,n),{calculated:!0,result:i};case\"min\":return i=await _(this,t,n),{calculated:!0,result:i};case\"max\":return i=await d(this,t,n),{calculated:!0,result:i};default:return{calculated:!0,result:0}}}async _stat(e,t,s,n,i,a,r){const l=await this._parent._stat(e,t,s,n,i,a,r);return!1===l.calculated?null===i&&\"\"===s&&null===n?this._manualStat(e,t,a,r):{calculated:!1}:l}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),s=[];return new Promise(((e,n)=>{this._unionShapeInBatches(s,t,e,n)}))}_unionAllGeom(e){return new Promise(((t,s)=>{const n=this.iterator(this._defaultTracker(e)),i=[];this._unionShapeInBatches(i,n,t,s)}))}_unionShapeInBatches(e,t,s,n){t.next().then((i=>{try{null!==i&&null!==i.geometry&&e.push(i.geometry),e.length>30||null===i&&e.length>1?b(e).then((a=>{try{null===i?s(a):(e=[a],this._unionShapeInBatches(e,t,s,n))}catch(r){n(r)}}),n):null===i?1===e.length?s(e[0]):s(null):this._unionShapeInBatches(e,t,s,n)}catch(a){n(a)}}),n)}iterator(e){return new n(this,e)}intersection(e,t=!1){return x._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,s=!0){return x._featuresetFunctions.difference.bind(this)(e,t,s)}symmetricDifference(e,t=!1,s=!0){return x._featuresetFunctions.symmetricDifference.bind(this)(e,t,s)}morphShape(e,t,s=\"unknown\",n=null){return x._featuresetFunctions.morphShape.bind(this)(e,t,s,n)}morphShapeAndAttributes(e,t,s=\"unknown\"){return x._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,s)}union(e,t=!1){return x._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return x._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return x._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return x._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return x._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return x._featuresetFunctions.relate.bind(this)(e,t)}within(e){return x._featuresetFunctions.within.bind(this)(e)}touches(e){return x._featuresetFunctions.touches.bind(this)(e)}top(e){return x._featuresetFunctions.top.bind(this)(e)}crosses(e){return x._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,s,n=!0){return x._featuresetFunctions.buffer.bind(this)(e,t,s,n)}filter(e,t=null){return x._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return x._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return x._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return x._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,s){return new Promise(((n,i)=>{this._reduceImpl(this.iterator(this._defaultTracker(s)),e,t,0,n,i,0)}))}_reduceImpl(e,t,s,n,i,a,r){try{if(++r>1e3)return void setTimeout((()=>{r=0,this._reduceImpl(e,t,s,n,i,a,r)}));e.next().then((l=>{try{if(null===l)i(s);else{const u=t(s,l,n,this);T(u)?u.then((s=>{this._reduceImpl(e,t,s,n+1,i,a,r)}),a):this._reduceImpl(e,t,u,n+1,i,a,r)}}catch(u){a(u)}}),a)}catch(l){a(l)}}removeField(e){return x._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,s=null){return x._featuresetFunctions.addField.bind(this)(e,t,s)}sumArea(e,t=!1,s){const n=u(e);return this.reduce(((e,s)=>null===s.geometry?0:t?w(s.geometry,n).then((t=>e+t)):S(s.geometry,n).then((t=>e+t))),0,s)}sumLength(e,t=!1,s){const n=h(e);return this.reduce(((e,s)=>null===s.geometry?0:t?D(s.geometry,n).then((t=>e+t)):P(s.geometry,n).then((t=>e+t))),0,s)}_substituteVars(e,t){if(null!==t){const s={};for(const e in t)s[e.toLowerCase()]=t[e];e.parameters=s}}async distinct(e,t=1e3,s=null,n){await this.load();const i=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(i,s),this.calculateStatistic(\"distinct\",i,t,this._defaultTracker(n))}async min(e,t=null,s){await this.load();const n=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(n,t),this.calculateStatistic(\"min\",n,-1,this._defaultTracker(s))}async max(e,t=null,s){await this.load();const n=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(n,t),this.calculateStatistic(\"max\",n,-1,this._defaultTracker(s))}async avg(e,t=null,s){await this.load();const n=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(n,t),this.calculateStatistic(\"avg\",n,-1,this._defaultTracker(s))}async sum(e,t=null,s){await this.load();const n=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(n,t),this.calculateStatistic(\"sum\",n,-1,this._defaultTracker(s))}async stdev(e,t=null,s){await this.load();const n=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(n,t),this.calculateStatistic(\"stdev\",n,-1,this._defaultTracker(s))}async variance(e,t=null,s){await this.load();const n=I.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(n,t),this.calculateStatistic(\"variance\",n,-1,this._defaultTracker(s))}async count(e){return await this.load(),this.calculateStatistic(\"count\",I.create(\"1\",this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise(((s,n)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,s,n,0)}))}_forEachImpl(e,t,s,n,i,a){try{if(++a>1e3)return void setTimeout((()=>{a=0,this._forEachImpl(e,t,s,n,i,a)}),0);e.next().then((r=>{try{if(null===r)n(s);else{const l=t(r);null==l?this._forEachImpl(e,t,s,n,i,a):T(l)?l.then((()=>{try{this._forEachImpl(e,t,s,n,i,a)}catch(r){i(r)}}),i):this._forEachImpl(e,t,s,n,i,a)}}catch(l){i(l)}}),i)}catch(r){i(r)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let s=0;s{const n={geometry:s.geometry?.toJSON(),attributes:{}};for(const t in s.attributes)n.attributes[t]=s.attributes[t];return t.featureSet.features.push(n),1}),0,e).then((()=>t))}castToText(e=!1){return\"object, FeatureSet\"}queryAttachments(e,t,s,n,i){return this._parent.queryAttachments(e,t,s,n,i)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map((e=>({name:e.name,code:e.id}))):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:\"\"}schema(){const e=[];for(const t of this.fields)e.push(o(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===c[this.geometryType]?\"esriGeometryNull\":c[this.geometryType],fields:e}}async convertToText(e,t){if(\"schema\"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if(\"featureset\"===e){await this._ensureLoaded();const e=[];await this.reduce(((t,s)=>{const n={geometry:s.geometry?s.geometry.toJSON():null,attributes:s.attributes};return null!==n.geometry&&n.geometry.spatialReference&&delete n.geometry.spatialReference,e.push(n),1}),0,t);const s=this.schema();return s.features=e,s.spatialReference=this.spatialReference.toJSON(),JSON.stringify(s)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return null!==this._parent?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return\"keeptype\"===e?.featureset?this:\"none\"===e?.featureset?null:{type:\"FeatureSet\"}}async castAsJsonAsync(e=null,t=null){if(\"keeptype\"===t?.featureset)return this;if(\"schema\"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(\"none\"===t?.featureset)return null;await this._ensureLoaded();const s=[];await this.reduce(((e,n)=>{const i={geometry:n.geometry?!0===t?.keepGeometryType?n.geometry:n.geometry.toJSON():null,attributes:n.attributes};return null!==i.geometry&&i.geometry.spatialReference&&!0!==t?.keepGeometryType&&delete i.geometry.spatialReference,s.push(i),1}),0,e);const n=this.schema();return n.features=s,n.spatialReference=!0===t?.keepGeometryType?this.spatialReference:this.spatialReference?.toJSON(),n}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return\"unknown\";const e=this.dateFieldsTimeZone??\"UTC\";return\"\"===e?\"UTC\":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await(this._parent?.getFeatureSetInfo())??null}}x._featuresetFunctions={};export{x as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{FeatureSetError as e,FeatureSetErrorCodes as t}from\"../support/errorsupport.js\";import s from\"../support/FeatureSet.js\";import i from\"../support/IdSet.js\";import{layerGeometryEsriConstants as r,IdState as n}from\"../support/shared.js\";import{combine as a}from\"../support/sqlUtils.js\";import{isPromiseLike as l}from\"../../../core/promiseUtils.js\";import{WhereClause as h}from\"../../../core/sql/WhereClause.js\";import u from\"../../../geometry/SpatialReference.js\";class c extends s{constructor(e){super(e),this.declaredClass=\"esri.arcade.featureset.actions.AttributeFilter\",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof h?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField=\"\",this.objectIdField=\"\",this.globalIdField=\"\",this.spatialReference=new u({wkid:4326}),this.geometryType=r.point)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet(\"\",null,this._whereclause,null,e);return this._checkCancelled(e),null!==this._whereClauseFunction?this._wset=new i(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new i(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return t===n.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?n.Unknown:t)}_getFeature(e,t,s){return this._parent._getFeature(e,t,s)}_getFeatures(e,t,s,i){return this._parent._getFeatures(e,t,s,i)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(null!==this._whereClauseFunction){const t=this._whereClauseFunction(e);return l(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,s){const r=new i([],e,!1,null),a=Math.min(t,e.length);if(await(this._parent?._getFeatures(r,-1,a,s)),this._checkCancelled(s),null==this._whereClauseFunction){for(let t=0;t\":case\"=\":if(\"column-reference\"===e.left.type&&\"string\"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return\" (\"+i+\" \"+e.operator+\" \"+this.lkp[e.right.value.toString()].toString()+\") \"}else if(\"column-reference\"===e.right.type&&\"string\"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return\" (\"+this.lkp[e.right.value.toString()].toString()+\" \"+e.operator+\" \"+i+\") \";return\" (\"+this.evaluateNodeToWhereClause(e.left,t,a,b.BADNESS,l)+\" \"+e.operator+\" \"+this.evaluateNodeToWhereClause(e.right,t,a,b.BADNESS,l)+\") \";case\"<\":case\">\":case\">=\":case\"<=\":case\"*\":case\"-\":case\"+\":case\"/\":case\"||\":return\" (\"+this.evaluateNodeToWhereClause(e.left,t,a,b.BADNESS,l)+\" \"+e.operator+\" \"+this.evaluateNodeToWhereClause(e.right,t,a,b.BADNESS,l)+\") \"}case\"null\":return\"null\";case\"boolean\":return!0===e.value?\"1\":\"0\";case\"string\":return\"'\"+e.value.toString().replaceAll(\"'\",\"''\")+\"'\";case\"timestamp\":return`timestamp '${e.value}'`;case\"date\":return`date '${e.value}'`;case\"time\":return`time '${e.value}'`;case\"number\":return e.value.toString();case\"current-time\":return m(\"date\"===e.mode,t);case\"column-reference\":return a&&a.toLowerCase()===e.column.toLowerCase()?\"(\"+i+\")\":e.column;case\"data-type\":return e.value;case\"function\":{const r=this.evaluateNodeToWhereClause(e.args,t,a,b.BADNESS,l);return S(e.name,r,t)}}throw new r(s.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof x?this.reverseLkp[x.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}b.BADNESS=\"_!!!_BAD_LKP_!!!!\";class B extends D{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:N(e,this.field.name,_(this._sql,h.Standardised),t.getFieldsIndex())}}extractValue(e){return x.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class L extends l{static findField(e,t){for(const r of e)if(r.name.toLowerCase()===t.toString().toLowerCase())return r;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass=\"esri.arcade.featureset.actions.Adapted\",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new y({wkid:4326}),this.objectIdField=\"\",this.globalIdField=\"\",this.geometryType=g.point,this.typeIdField=\"\",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();let t=null;return t=this._extraFilter?await this._getFilteredSet(\"\",null,null,null,e):await(this._parent?._getSet(e)),this._checkCancelled(e),A(t),this._wset=new n(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(r,s,a,i){const l=[];-1!==s&&void 0===this._featureCache[s]&&l.push(s);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(r,o))return await this._expandPagedSet(r,o,0,0,i),this._getFeatures(r,s,a,i);let h=0;for(let e=r._lastFetchedIndex;e=o)));e++);if(0===l.length)return\"success\";r=new n([],l,r._ordered,null);const u=Math.min(l.length,a);await(this._parent?._getFeatures(r,-1,u,i)),this._checkCancelled(i);const c=[];for(let e=0;e0&&(s=s.replaceFields(e))}null!==r?null!==this._extraFilter&&(r=W(this._extraFilter,r)):r=this._extraFilter,await this._ensureLoaded();const h=await this._parent._getFilteredSet(e,t,r,s,a);let u;return this._checkCancelled(a),u=!0===i?new n(h._candidates.slice(0).concat(h._known.slice(0)),[],!0===o&&h._ordered,this._clonePageDefinition(h.pagesDefinition)):new n(h._candidates.slice(0),h._known.slice(0),!0===o&&h._ordered,this._clonePageDefinition(h.pagesDefinition)),u}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const r of this.adaptedFields)if(!0===E(e,r.field.name)){const s=r.rewriteSql(e,this);if(!0!==s.rewritten){t.cannot=!0,t.where=null;break}t.where=s.where}return t}async _stat(e,t,r,s,a,i,l){let n=!1,o=this._reformulateWithoutAdaptions(t);if(n=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(a),n=n||o.cannot,null!==(a=o.where)?null!==this._extraFilter&&(a=W(this._extraFilter,a)):a=this._extraFilter,!0===n)return null===a&&\"\"===r&&null===s?this._manualStat(e,t,i,l):{calculated:!1};const h=await this._parent._stat(e,t,r,s,a,i,l);return!1===h.calculated?null===a&&\"\"===r&&null===s?this._manualStat(e,t,i,l):{calculated:!1}:h}async _canDoAggregates(e,t,r,s,a){if(null===this._parent)return!1;for(let n=0;n{for(let i=0;i0?(await e(this._refineSetBlock(t,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(t,r,n,s)):r}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,r,n){return this._parent._getFeatures(e,t,r,n)}_featureFromCache(e){if(void 0===this._featureCache[e]){const t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new t(r.NeverReach)}async _getFilteredSet(e,t,r,n,i){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,r,null===n?this._orderbyclause:n,i);this._checkCancelled(i);const o=new s(a._candidates.slice(0),a._known.slice(0),a._ordered,this._clonePageDefinition(a.pagesDefinition));let u=!0;if(a._candidates.length>0&&(u=!1),!1===o._ordered){let e=await this.manualOrderSet(o,i);return!1===u&&(null===t&&null===r||(e=new s(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)))),e}return o}static registerAction(){n._featuresetFunctions.orderBy=function(e){return\"\"===e?this:new a({parentfeatureset:this,orderbyclause:new i(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{SqlError as e,SqlErrorCodes as t}from\"./errorsupport.js\";import{FeatureServiceDatabaseType as r}from\"./shared.js\";import{toWhereClauseFromTree as n}from\"./sqlUtils.js\";import{WhereClause as i}from\"../../../core/sql/WhereClause.js\";function s(s){if(\"function\"===s.parseTree.type){if(0===s.parseTree.args.value.length)return{name:s.parseTree.name,expr:null};if(s.parseTree.args.value.length>1)throw new e(t.MissingStatisticParameters);const a=i.create(n(s.parseTree.args.value[0],r.Standardised,s.parameters),s.fieldsIndex,s.timeZone);return{name:s.parseTree.name,expr:a}}return null}class a{constructor(){this.field=\"\",this.tofieldname=\"\",this.typeofstat=\"MIN\",this.workingexpr=null}clone(){const e=new a;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(r,n,o,l){const p=new a;p.field=r;const f=i.create(n,o,l),u=s(f);if(null===u)throw new e(t.UnsupportedSqlFunction,{function:\"\"});const c=u.name.toUpperCase().trim();if(\"MIN\"===c){if(p.typeofstat=\"MIN\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:\"min\"})}else if(\"MAX\"===c){if(p.typeofstat=\"MAX\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:\"max\"})}else if(\"COUNT\"===c)p.typeofstat=\"COUNT\",p.workingexpr=u.expr;else if(\"STDEV\"===c){if(p.typeofstat=\"STDDEV\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:\"stdev\"})}else if(\"SUM\"===c){if(p.typeofstat=\"SUM\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:\"sum\"})}else if(\"MEAN\"===c){if(p.typeofstat=\"AVG\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:c})}else if(\"AVG\"===c){if(p.typeofstat=\"AVG\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:\"avg\"})}else{if(\"VAR\"!==c)throw new e(t.UnsupportedSqlFunction,{function:c});if(p.typeofstat=\"VAR\",p.workingexpr=u.expr,null===f)throw new e(t.InvalidFunctionParameters,{function:\"var\"})}return p}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case\"MIN\":return\"min\";case\"MAX\":return\"max\";case\"SUM\":return\"sum\";case\"COUNT\":default:return\"count\";case\"VAR\":return\"var\";case\"STDDEV\":return\"stddev\";case\"AVG\":return\"avg\"}}}export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../Graphic.js\";import{a1 as t}from\"../../../chunks/languageUtils.js\";import{SqlExpressionAdapted as i,OriginalField as s,AdaptedFeatureSet as n}from\"./Adapted.js\";import r from\"./AttributeFilter.js\";import a from\"./OrderBy.js\";import{FeatureSetError as o,FeatureSetErrorCodes as l}from\"../support/errorsupport.js\";import d from\"../support/FeatureSet.js\";import u from\"../support/IdSet.js\";import f from\"../support/OrderbyClause.js\";import{IdState as c,layerGeometryEsriConstants as p,FeatureServiceDatabaseType as h}from\"../support/shared.js\";import{isSingleField as g,toWhereClause as _,predictType as m,scanForField as y,reformulateWithoutField as b}from\"../support/sqlUtils.js\";import{calculateStat as w}from\"../support/stats.js\";import F from\"../support/StatsField.js\";import{createMD5Hash as I,outputTypes as S}from\"../../../core/MD5.js\";import{DateOnly as x}from\"../../../core/sql/DateOnly.js\";import{SqlTimeStampOffset as D}from\"../../../core/sql/SqlTimestampOffset.js\";import{TimeOnly as k}from\"../../../core/sql/TimeOnly.js\";import{WhereClause as j}from\"../../../core/sql/WhereClause.js\";import A from\"../../../geometry/SpatialReference.js\";import C from\"../../../layers/support/Field.js\";import T from\"../../../layers/support/FieldsIndex.js\";function G(e){if(!e)return\"COUNT\";switch(e.toLowerCase()){case\"max\":return\"MAX\";case\"var\":case\"variance\":return\"VAR\";case\"avg\":case\"average\":case\"mean\":return\"AVG\";case\"min\":return\"MIN\";case\"sum\":return\"SUM\";case\"stdev\":case\"stddev\":return\"STDDEV\";case\"count\":return\"COUNT\"}return\"COUNT\"}class O extends d{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField=\"ROW__ID\",this._internalObjectIdField=\"ROW__ID\",this._adaptedFields=[],this.declaredClass=\"esri.arcade.featureset.actions.Aggregate\",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(null===this._wset){const t=await this._getFilteredSet(\"\",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return c.InFeatureSet}_nextUniqueName(e){for(;1===e[\"T\"+this._uniqueIds.toString()];)this._uniqueIds++;const t=\"T\"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,n=1;const r=this._parent?this._parent.getFieldsIndex():new T([]);for(this.objectIdField=\"ROW__ID\",this.globalIdField=\"\";!1===t;){let e=!1;for(let t=0;t0)for(const i of this._parent.fields)this._adaptedFields.push(new s(i));for(let i=0;i0&&(c=new n({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===d.nowhereclause)l=new u([\"GETPAGES\"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:\"manual\",iterator:null,set:[],subfeatureset:new a({parentfeatureset:c,orderbyclause:new f(this.phsyicalgroupbyfields.join(\",\")+\",\"+this._parent.objectIdField+\" ASC\")})}});else{let e=c;if(null!==i){let t=null;i&&(t=this._reformulateWhereClauseWithoutGroupByFields(i)),e=new r({parentfeatureset:e,whereclause:t})}l=new u([\"GETPAGES\"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:\"manual\",iterator:null,set:[],subfeatureset:new a({parentfeatureset:e,orderbyclause:new f(this.phsyicalgroupbyfields.join(\",\")+\",\"+this._parent.objectIdField+\" ASC\")})}})}return l}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=b(e,t.tofieldname,_(t.workingexpr,h.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=b(e,t.tofieldname,_(t.expression,h.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery))return await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i);this._checkCancelled(i);const s=e._candidates.length;this._refineKnowns(e,t);e._candidates.length;return e._candidates.length,e}_expandPagedSet(e,t,i,s,n){return this._expandPagedSetFeatureSet(e,t,i,s,n)}async _getPhysicalPage(t,i,s){if(!0===t.pagesDefinition.aggregatefeaturesetpagedefinition)return this._sequentialGetPhysicalItem(t,t.pagesDefinition.resultRecordCount,s,[]);const n=await this._getAgregagtePhysicalPage(t,i,s);for(const r of n){const t={geometry:r.geometry,attributes:{}},i={};for(const e in r.attributes)i[e.toLowerCase()]=r.attributes[e];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=i[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=i[e.field.toLowerCase()];this._featureCache[t.attributes[this.objectIdField]]=new e(t)}return n.length}_sequentialGetPhysicalItem(e,t,i,s){return new Promise(((n,r)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),!0===e.pagesDefinition.internal.fullyResolved||0===t?n(s.length):this._nextAggregateItem(e,t,i,s,(r=>{null===r?n(s.length):(t-=1,n(this._sequentialGetPhysicalItem(e,t,i,s)))}),r)}))}_nextAggregateItem(e,i,s,n,r,a){try{t(e.pagesDefinition.internal.iterator.next()).then((t=>{if(null===t)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);n.push(t),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(t.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,r(null)}else e.pagesDefinition.internal.fullyResolved=!0,r(null);else{const o=this._generateAggregateHash(t);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[t],id:o};else{if(o!==e.pagesDefinition.internal.workingItem.id){const s=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return n.push(s),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(s.attributes[this.objectIdField]),i-=1,e.pagesDefinition.internal.workingItem={features:[t],id:o},void r(s)}e.pagesDefinition.internal.workingItem.features.push(t)}this._nextAggregateItem(e,i,s,n,r,a)}}),a)}catch(o){a(o)}}_calculateFieldStat(e,t,i){const s=[];for(let n=0;nthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(t){return t._known.length>0&&\"GETPAGES\"===t._known[t._known.length-1]?t._known.length-1:t._known.length}_isInFeatureSet(t){const e=this._parent._isInFeatureSet(t);if(e===i.NotInFeatureSet)return e;const n=this._idstates[t];return n===i.InFeatureSet||n===i.NotInFeatureSet?n:e===i.InFeatureSet&&void 0===n?this._countedinthis._topnum&&(s=this._topnum),this._countedin>=this._topnum&&n.pagesDefinition.internal.set.length<=n.pagesDefinition.resultOffset){let t=n._known.length;return t>0&&\"GETPAGES\"===n._known[t-1]&&(n._known.length=t-1),t=n._candidates.length,t>0&&\"GETPAGES\"===n._candidates[t-1]&&(n._candidates.length=t-1),\"success\"}const r=await this._parent._expandPagedSet(n,s,i,a,o);return this._setKnownLength(n)>this._topnum&&(n._known.length=this._topnum),this._setKnownLength(n)>=this._topnum&&(n._candidates.length=0),r}async _getFeatures(t,e,n,i){const a=[],o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(t,o))return await this._expandPagedSet(t,o,0,0,i),this._getFeatures(t,e,n,i);-1!==e&&void 0===this._featureCache[e]&&a.push(e);let r=0;for(let s=t._lastFetchedIndex;so)));s++);if(0===a.length)return\"success\";const _=new s([],a,!1,null),h=Math.min(a.length,n);await this._parent._getFeatures(_,-1,h,i);for(let s=0;s=this._topnum)break}else if(r===i.NotInFeatureSet)null===s?s={start:o,end:o}:s.end===o-1?s.end=o:(a.push(s),s={start:o,end:o}),n+=1;else if(r===i.Unknown)break;if(n>=e)break}null!==s&&a.push(s);for(let i=a.length-1;i>=0;i--)t._candidates.splice(a[i].start,a[i].end-a[i].start+1);this._setKnownLength(t)>this._topnum&&(t._known=t._known.slice(0,this._topnum)),this._setKnownLength(t)>=this._topnum&&(t._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){n._featuresetFunctions.top=function(t){return new a({parentfeatureset:this,topnum:t})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../PopupTemplate.js\";import r from\"../../renderers/ClassBreaksRenderer.js\";import\"../../renderers/DictionaryRenderer.js\";import\"../../renderers/DotDensityRenderer.js\";import\"../../renderers/HeatmapRenderer.js\";import\"../../renderers/PieChartRenderer.js\";import i from\"../../renderers/Renderer.js\";import o from\"../../renderers/SimpleRenderer.js\";import n from\"../../renderers/UniqueValueRenderer.js\";import\"../../renderers/support/jsonUtils.js\";import s from\"../../core/Logger.js\";import{ClonableMixin as l}from\"../../core/Clonable.js\";import\"../../core/has.js\";import a from\"../../core/Error.js\";import{IdentifiableMixin as p}from\"../../core/Identifiable.js\";import{clone as d}from\"../../core/lang.js\";import u from\"../../core/Loadable.js\";import{MultiOriginJSONMixin as y}from\"../../core/MultiOriginJSONSupport.js\";import{setDeepValue as c}from\"../../core/object.js\";import{sqlAnd as m}from\"../../core/sql.js\";import{property as f}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{reader as b}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as h}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as g}from\"../../core/accessorSupport/decorators/writer.js\";import{OriginId as v}from\"../../core/accessorSupport/PropertyOrigin.js\";import{createTypeReader as j}from\"../../core/accessorSupport/extensions/serializableProperty/reader.js\";import w from\"../../form/FormTemplate.js\";import{labelsVisible as O,legendEnabled as S,minScale as I,maxScale as F,popupEnabled as T}from\"./commonProperties.js\";import{createQuery as E}from\"./featureLayerUtils.js\";import C from\"./FeatureTemplate.js\";import{defineFieldProperties as A}from\"./fieldProperties.js\";import{fixRendererFields as x}from\"./fieldUtils.js\";import R from\"./LabelClass.js\";import{reader as P}from\"./labelingInfo.js\";import D from\"../../rest/support/Query.js\";import{createPopupTemplate as L}from\"../../support/popupUtils.js\";import{defaultPolygonSymbol2D as q,defaultPolylineSymbol2D as U,defaultPointSymbol2D as V}from\"../../symbols/support/defaults.js\";const G=[\"charts\",\"editingEnabled\",\"formTemplate\",\"labelsVisible\",\"labelingInfo\",\"legendEnabled\",\"minScale\",\"maxScale\",\"opacity\",\"popupEnabled\",\"popupTemplate\",\"renderer\",\"subtypeCode\",\"templates\",\"title\",\"visible\"],N={key:\"type\",base:i,errorContext:\"renderer\",typeMap:{simple:o,\"unique-value\":n,\"class-breaks\":r}},$=A(),k=j({types:N});let M=0;function _(e){const t=e.json.write;return\"object\"==typeof t?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function B(e){return new o({symbol:H(e)})}function H(e){switch(e){case\"point\":case\"multipoint\":return V.clone();case\"polyline\":return U.clone();case\"polygon\":case\"multipatch\":return q.clone();default:return null}}function Q(e,t){return!!t&&(\"unique-value\"===e?.type&&\"string\"==typeof e.field&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression)}function z(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function J(e,t){let r=null;switch(t.geometryType){case\"esriGeometryPoint\":case\"esriGeometryMultipoint\":r=\"point\";break;case\"esriGeometryPolyline\":r=\"line\";break;case\"esriGeometryPolygon\":case\"esriGeometryMultiPatch\":r=\"polygon\";break;default:t.type,r=null}const i={},o=z(e,t);if(null!=o){const{defaultValues:e}=o;for(const t in e)i[t]=e[t]}return i[t.subtypeField]=e,new C({name:\"New Feature\",drawingTool:r,prototype:{attributes:i}})}const K=\"esri.layers.support.SubtypeSublayer\";let W=class extends(y(l(p(u)))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${M++}`,this.type=\"subtype-sublayer\",this.labelsVisible=!0,this.labelingInfo=null,this.layerType=\"ArcGISFeatureLayer\",this.legendEnabled=!0,this.listMode=\"show\",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:i,parent:o}=this;let n;if(i){n=[];let e=0;i.forEach((({name:t,alias:r,editable:i,visible:s})=>{if(!s)return;const l=o?.fields?.find((e=>e.name===t));if(!l)return;const a={name:t};let p=!1;r!==l.alias&&(a.alias=r,p=!0),i!==l.editable&&(a.editable=i,p=!0),n.push(a),p&&e++})),0===e&&n.length===i.length&&(n=null)}else n=d(e);n?.length&&c(r,n,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,i=e?.fields;if(!e||!i?.length)return null;const{subtypes:o,subtypeField:n}=e,s=o?.find((e=>e.code===r)),l=s?.defaultValues,a=s?.domains,p=[];for(const d of i){const e=d.clone(),{name:i}=e,o=t?.find((e=>e.name===i));if(e.visible=!t||!!o,o){const{alias:t,editable:r}=o;t&&(e.alias=t),!1===r&&(e.editable=!1)}const s=l?.[i]??null;e.defaultValue=i===n?r:s;const u=a?.[i]??null;e.domain=i===n?null:u?\"inherited\"===u.type?e.domain:u.clone():null,p.push(e)}return p}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||s.getLogger(K).error(Y(\"objectIdField\")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){x(e,this.fieldsIndex),this._override(\"renderer\",e)}get renderer(){if(this._isOverridden(\"renderer\"))return this._get(\"renderer\");const{parent:e}=this;return e&&!e.isTable&&\"mesh\"!==e.geometryType?B(e.geometryType):null}readRendererFromService(e,t,r){if(\"Table\"===t.type)return null;const i=t.drawingInfo?.renderer,n=k(i,t,r);let s;const{subtypeCode:l}=this;if(null!=l&&Q(n,t.subtypeField)){const e=n.uniqueValueInfos?.find((({value:e})=>(e=\"number\"==typeof e?String(e):e)===String(l)));e&&(s=new o({symbol:e.symbol}))}else\"simple\"!==n?.type||n.visualVariables?.length||(s=n);return s}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;if(!i)return;const o=i.visualVariables?.some((e=>\"rotationInfo\"!==e.type));return o?void 0:k(i,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference}readTemplatesFromService(e,t){return[J(this.subtypeCode,t)]}readTitleFromService(e,t){const r=z(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw Y(\"addAttachment\");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a(\"subtype-sublayer:addAttachment\",\"The feature provided does not belong to this SubtypeSublayer\");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:i}=this;if(!i)throw Y(\"updateAttachment\");if(e.getAttribute(i.subtypeField)!==this.subtypeCode)throw new a(\"subtype-sublayer:updateAttachment\",\"The feature provided does not belong to this SubtypeSublayer\");return i.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw Y(\"deleteAttachments\");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a(\"subtype-sublayer:deleteAttachments\",\"The feature provided does not belong to this SubtypeSublayer\");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw Y(\"applyEdits\");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:i,title:o}=this;if(r){const{displayField:e,editFieldsInfo:n,objectIdField:s}=r;t={displayField:e,editFieldsInfo:n,fields:i,objectIdField:s,title:o}}return L(t,e)}createQuery(){if(!this.parent)throw Y(\"createQuery\");const e=E(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=m(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}hasUserOverrides(){return G.some((e=>this.originIdOf(e)===v.USER))}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw Y(\"queryAttachments\");const i=e.clone();return i.where=X(i.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw Y(\"queryFeatures\");const i=D.from(e)??r.createQuery();return null!=e&&(i.where=X(i.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(i,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"capabilities\",null),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"effectiveCapabilities\",null),e([f({json:{write:{ignoreOrigin:!0}}})],W.prototype,\"charts\",void 0),e([f({type:Boolean,nonNullable:!0,json:{name:\"enableEditing\",write:{ignoreOrigin:!0}}})],W.prototype,\"editingEnabled\",void 0),e([f({type:Boolean,readOnly:!0})],W.prototype,\"effectiveEditingEnabled\",null),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"elevationInfo\",null),e([f({json:{name:\"layerDefinition.fieldOverrides\",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],W.prototype,\"fieldOverrides\",void 0),e([g(\"fieldOverrides\")],W.prototype,\"writeFieldOverrides\",null),e([f({...$.fields,readOnly:!0,json:{read:!1}})],W.prototype,\"fields\",null),e([f($.fieldsIndex)],W.prototype,\"fieldsIndex\",void 0),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"floorInfo\",null),e([f({type:w,json:{name:\"formInfo\",write:{ignoreOrigin:!0}}})],W.prototype,\"formTemplate\",void 0),e([f({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],W.prototype,\"id\",void 0),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"geometryType\",null),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"type\",void 0),e([f(_(d(O)))],W.prototype,\"labelsVisible\",void 0),e([f({type:[R],json:{name:\"layerDefinition.drawingInfo.labelingInfo\",origins:{service:{read:!1}},read:{reader:P},write:{ignoreOrigin:!0}}})],W.prototype,\"labelingInfo\",void 0),e([f({type:[\"ArcGISFeatureLayer\"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],W.prototype,\"layerType\",void 0),e([f(_(d(S)))],W.prototype,\"legendEnabled\",void 0),e([f({type:[\"show\",\"hide\"]})],W.prototype,\"listMode\",void 0),e([f((()=>{const e=d(I);return e.json.origins.service.read=!1,_(e)})())],W.prototype,\"minScale\",void 0),e([f((()=>{const e=d(F);return e.json.origins.service.read=!1,_(e)})())],W.prototype,\"maxScale\",void 0),e([f({readOnly:!0})],W.prototype,\"effectiveScaleRange\",null),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"objectIdField\",null),e([f({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],W.prototype,\"opacity\",void 0),e([f({clonable:!1})],W.prototype,\"parent\",void 0),e([f(_(d(T)))],W.prototype,\"popupEnabled\",void 0),e([f({type:t,json:{name:\"popupInfo\",write:{ignoreOrigin:!0}}})],W.prototype,\"popupTemplate\",void 0),e([f({readOnly:!0})],W.prototype,\"defaultPopupTemplate\",null),e([f({types:N,json:{write:{target:\"layerDefinition.drawingInfo.renderer\",ignoreOrigin:!0}}})],W.prototype,\"renderer\",null),e([b(\"service\",\"renderer\",[\"drawingInfo.renderer\",\"subtypeField\",\"type\"])],W.prototype,\"readRendererFromService\",null),e([b(\"renderer\",[\"layerDefinition.drawingInfo.renderer\"])],W.prototype,\"readRenderer\",null),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"spatialReference\",null),e([f({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],W.prototype,\"subtypeCode\",void 0),e([f({type:[C],json:{name:\"layerDefinition.templates\",write:{ignoreOrigin:!0}}})],W.prototype,\"templates\",void 0),e([b(\"service\",\"templates\",[\"geometryType\",\"subtypeField\",\"subtypes\",\"type\"])],W.prototype,\"readTemplatesFromService\",null),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],W.prototype,\"title\",void 0),e([b(\"service\",\"title\",[\"subtypes\"])],W.prototype,\"readTitleFromService\",null),e([f({readOnly:!0,json:{read:!1}})],W.prototype,\"url\",null),e([f({readOnly:!0})],W.prototype,\"userHasUpdateItemPrivileges\",null),e([f({type:Boolean,nonNullable:!0,json:{name:\"visibility\",write:{ignoreOrigin:!0}}})],W.prototype,\"visible\",void 0),W=e([h(K)],W);const X=(e,t,r)=>{const i=new RegExp(`${t}\\\\s*=\\\\s*\\\\d+`),o=`${t}=${r}`,n=e??\"\";return i.test(n)?n.replace(i,o):m(o,n)},Y=e=>new a(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),Z=W;export{Z as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{ClonableMixin as r}from\"../core/Clonable.js\";import t from\"../core/Collection.js\";import s from\"../core/Error.js\";import{loadAll as i}from\"../core/loadAll.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{debounce as a,throwIfAbortError as n,whenOrAbort as u}from\"../core/promiseUtils.js\";import{watch as l,sync as p}from\"../core/reactiveUtils.js\";import{sqlAnd as y}from\"../core/sql.js\";import{urlToObject as d,join as c}from\"../core/urlUtils.js\";import{property as h}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as m}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as f}from\"../core/accessorSupport/decorators/subclass.js\";import{OriginId as b,nameToId as g}from\"../core/accessorSupport/PropertyOrigin.js\";import j from\"./Layer.js\";import{APIKeyMixin as S}from\"./mixins/APIKeyMixin.js\";import{ArcGISService as w}from\"./mixins/ArcGISService.js\";import{BlendLayer as v}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as L}from\"./mixins/CustomParametersMixin.js\";import{EditBusLayer as F}from\"./mixins/EditBusLayer.js\";import{FeatureLayerBase as _}from\"./mixins/FeatureLayerBase.js\";import{OperationalLayer as x}from\"./mixins/OperationalLayer.js\";import{PortalLayer as C}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as E}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as I}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as P}from\"./mixins/TemporalLayer.js\";import{titleFromUrlAndName as O}from\"./support/arcgisLayerUrl.js\";import{id as A}from\"./support/commonProperties.js\";import{ensureLayerCredential as T,computeEffectiveEditingEnabled as U,addAttachment as G,updateAttachment as q,applyEdits as $,createQuery as M,deleteAttachments as R,fetchRecomputedExtents as V,queryAttachments as k,queryObjectIds as N,queryFeatureCount as Q,queryExtent as D,queryRelatedFeatures as H,queryRelatedFeaturesCount as B,hasDataChanged as J}from\"./support/featureLayerUtils.js\";import{defineFieldProperties as z}from\"./support/fieldProperties.js\";import{fixTimeInfoFields as K}from\"./support/fieldUtils.js\";import Z from\"./support/SubtypeSublayer.js\";import W from\"./support/TimeInfo.js\";import{serviceSupportsSpatialReference as X}from\"./support/versionUtils.js\";import Y from\"../rest/support/Query.js\";import{SaveOperationType as ee}from\"../webdoc/interfaces.js\";const re=\"SubtypeGroupLayer\",te=\"esri.layers.SubtypeGroupLayer\";function se(e,r){return new s(\"layer:unsupported\",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${r}`,{layer:e})}const ie=z();let oe=class extends(_(F(v(P(I(E(w(x(C(o(L(S(r(j)))))))))))))){constructor(...e){super(...e),this._sublayersCollectionChanged=!1,this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(t.ofType(Z)),this.timeInfo=null,this.title=\"Layer\",this.type=\"subtype-group\",this._debouncedSaveOperations=a((async(e,r,t)=>{const{save:s,saveAs:i}=await import(\"./save/featureLayerUtils.js\");switch(e){case ee.SAVE:return s(this,r);case ee.SAVE_AS:return i(this,t,r)}})),this.addHandles(l((()=>this.sublayers),((e,r)=>this._handleSublayersChange(e,r)),p))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,r){return\"string\"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null,t=this.loadFromPortal({supportedTypes:[\"Feature Service\"]},e).catch(n).then((async()=>{if(!this.url)throw new s(\"subtype-grouplayer:missing-url-or-source\",\"SubtypeGroupLayer must be created with either a url or a portal item\");if(null==this.layerId)throw new s(\"subtype-grouplayer:missing-layerid\",\"layerId is required for a SubtypeGroupLayer created with url\");return this._initLayerProperties(await this.createGraphicsSource(r))})).then((()=>T(this,\"load\",e)));return this.addResolvingPromise(t),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty(\"definitionExpression\"),this.commitProperty(\"timeExtent\"),this.commitProperty(\"timeOffset\"),this.commitProperty(\"geometryType\"),this.commitProperty(\"gdbVersion\"),this.commitProperty(\"historicMoment\"),this.commitProperty(\"returnZ\"),this.commitProperty(\"capabilities\"),this.commitProperty(\"returnM\"),(this._get(\"createQueryVersion\")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return U(this)}get parsedUrl(){const e=d(this.url);return null!=e&&null!=this.layerId&&(e.path=c(e.path,this.layerId.toString())),e}set source(e){this._get(\"source\")!==e&&this._set(\"source\",e)}readTitleFromService(e,{name:r}){return this.url?O(this.url,r):r}async addAttachment(e,r){return G(this,e,r,re)}async updateAttachment(e,r,t){return q(this,e,r,t,re)}async applyEdits(e,r){return $(this,e,r)}on(e,r){return super.on(e,r)}async createGraphicsSource(e){const{default:r}=await u(import(\"./graphics/sources/FeatureLayerSource.js\"),e);return new r({layer:this}).load({signal:e})}createQuery(){const e=M(this),r=this.sublayers.map((e=>e.subtypeCode));return e.where=y(`${this.subtypeField} IN (${r.join(\",\")})`,this.definitionExpression),e}async deleteAttachments(e,r){return R(this,e,r,re)}async fetchRecomputedExtents(e){return V(this,e,re)}findSublayerForFeature(e){const r=this.fieldsIndex.get(this.subtypeField),t=e.attributes[r.name];return this.findSublayerForSubtypeCode(t)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,r){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return i(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,r){return k(this,e,r,re)}async queryFeatures(e,r){const t=await this.load(),s=Y.from(e)??t.createQuery(),i=s.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),s.outFields=i);const o=await t.source.queryFeatures(s,r);if(o?.features)for(const a of o.features)a.layer=a.sourceLayer=this.findSublayerForFeature(a);return o}async queryObjectIds(e,r){return N(this,e,r,re)}async queryFeatureCount(e,r){return Q(this,e,r,re)}async queryExtent(e,r){return D(this,e,r,re)}async queryRelatedFeatures(e,r){return H(this,e,r,re)}async queryRelatedFeaturesCount(e,r){return B(this,e,r,re)}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,r){return this._debouncedSaveOperations(ee.SAVE_AS,r,e)}write(e,r){const{origin:t,layerContainerType:i,messages:o}=r;if(this.isTable){if(\"web-scene\"===t||\"web-map\"===t&&\"tables\"!==i)return o?.push(se(this,\"using a table source cannot be written to web scenes and web maps\")),null}else if(this.loaded&&\"web-map\"===t&&\"tables\"===i)return o?.push(se(this,\"using a non-table source cannot be written to tables in web maps\")),null;return this.sublayers?.length?super.write(e,r):(o?.push(new s(\"web-document-write:invalid-property\",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&X(this,e)}_getLayerDomain(e){const r=this.fieldsIndex.get(e);return r?r.domain:null}async _initLayerProperties(e){this._set(\"source\",e);const{sourceJSON:r}=e;if(r&&(this.sourceJSON=r,this.read(r,{origin:\"service\",url:this.parsedUrl})),this.isTable)throw new s(\"subtype-grouplayer:unsupported-source\",\"SubtypeGroupLayer cannot be created using a layer with table source\");if(!this.subtypes?.length)throw new s(\"subtype-grouplayer:missing-subtypes\",\"SubtypeGroupLayer must be created using a layer with subtypes\");this._verifyFields(),K(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return J(this)}_verifyFields(){const e=this.parsedUrl?.path??\"undefined\";this.objectIdField||console.log(\"SubtypeGroupLayer: 'objectIdField' property is not defined (url: \"+e+\")\"),this.isTable||-1!==e.search(/\\/FeatureServer\\//i)||this.fields?.some((e=>\"geometry\"===e.type))||console.log(\"SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: \"+e+\")\")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null})),this.removeHandles(\"sublayers-owner\"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this._sublayersCollectionChanged=!1,this.addHandles([e.on(\"after-add\",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on(\"after-remove\",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})),e.on(\"after-changes\",(()=>{this._sublayersCollectionChanged=!0}))],\"sublayers-owner\"))}};e([h({readOnly:!0})],oe.prototype,\"createQueryVersion\",null),e([h({readOnly:!0})],oe.prototype,\"editingEnabled\",null),e([h({readOnly:!0})],oe.prototype,\"effectiveEditingEnabled\",null),e([h({...ie.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],oe.prototype,\"fields\",void 0),e([h(ie.fieldsIndex)],oe.prototype,\"fieldsIndex\",void 0),e([h(A)],oe.prototype,\"id\",void 0),e([h({type:[\"show\",\"hide\",\"hide-children\"],json:{origins:{\"portal-item\":{read:!1,write:!1}}}})],oe.prototype,\"listMode\",void 0),e([h({value:\"SubtypeGroupLayer\",type:[\"SubtypeGroupLayer\"],json:{origins:{\"portal-item\":{name:\"layerType\",write:{enabled:!0,ignoreOrigin:!0}}}}})],oe.prototype,\"operationalLayerType\",void 0),e([h(ie.outFields)],oe.prototype,\"outFields\",void 0),e([h({readOnly:!0})],oe.prototype,\"parsedUrl\",null),e([h({clonable:!1})],oe.prototype,\"source\",null),e([h({type:t.ofType(Z),json:{origins:{service:{read:{source:\"subtypes\",reader:(e,r,s)=>{const i=e.map((({code:e})=>{const t=new Z({subtypeCode:e});return t.read(r,s),t}));return new(t.ofType(Z))(i)}}}},name:\"layers\",write:{overridePolicy(e,r,t){const s=this.originOf(\"sublayers\"),i=b.PORTAL_ITEM;let o=!0;if(g(s)===i&&g(t.origin)>i){const r=e.some((e=>e.hasUserOverrides()));o=this._sublayersCollectionChanged||r}return{enabled:o,ignoreOrigin:!0}}}}})],oe.prototype,\"sublayers\",void 0),e([h({type:W})],oe.prototype,\"timeInfo\",void 0),e([h({json:{origins:{\"portal-item\":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],oe.prototype,\"title\",void 0),e([m(\"service\",\"title\",[\"name\"])],oe.prototype,\"readTitleFromService\",null),e([h({json:{read:!1}})],oe.prototype,\"type\",void 0),oe=e([f(te)],oe);const ae=oe;export{ae as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../Graphic.js\";import{id as t}from\"../../../kernel.js\";import i from\"../../../request.js\";import r from\"../../Attachment.js\";import s from\"../../Dictionary.js\";import{FeatureSetError as a,FeatureSetErrorCodes as n}from\"../support/errorsupport.js\";import l from\"../support/FeatureSet.js\";import o from\"../support/IdSet.js\";import{defaultMaxRecords as u,stableStringify as d,FeatureServiceDatabaseType as h,IdState as p,extractServiceUrl as c}from\"../support/shared.js\";import{toWhereClause as y,isSingleField as f}from\"../support/sqlUtils.js\";import{decodeStatType as m}from\"../support/stats.js\";import{createMD5Hash as _,outputTypes as g}from\"../../../core/MD5.js\";import{fromJSON as w}from\"../../../geometry/support/jsonUtils.js\";import{srToRESTValue as R}from\"../../../geometry/support/spatialReferenceUtils.js\";import S from\"../../../layers/FeatureLayer.js\";import F from\"../../../layers/SubtypeGroupLayer.js\";import{executeQuery as b}from\"../../../rest/query/executeQuery.js\";import\"../../../config.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import\"../../../core/urlUtils.js\";import\"../../../rest/query/support/AttachmentInfo.js\";import\"../../../rest/support/AttachmentQuery.js\";import{executeForCount as I}from\"../../../rest/query/executeForCount.js\";import\"../../../geometry.js\";import\"../../../geometry/support/normalizeUtils.js\";import\"../../../core/Error.js\";import\"../../../core/pbf.js\";import\"../../../core/unitUtils.js\";import\"../../../geometry/ellipsoidUtils.js\";import D from\"../../../rest/support/Query.js\";import{executeForIds as x}from\"../../../rest/query/executeForIds.js\";import{executeQueryJSON as C}from\"../../../rest/query/executeQueryJSON.js\";import\"../../../layers/graphics/featureConversionUtils.js\";import\"../../../rest/support/FeatureSet.js\";import\"../../../rest/support/RelationshipQuery.js\";import\"../../../rest/support/TopFeaturesQuery.js\";import P from\"../../../rest/support/StatisticDefinition.js\";class T extends l{constructor(e){super(e),this.declaredClass=\"esri.arcade.featureset.sources.FeatureLayerDynamic\",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return u}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||\"\"}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+\",\"+d(e.toJSON());return _(t,g.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&\"*\"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(\"oid\"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=h.StandardisedNoInterval,null!=e&&e>=10.61&&(this._databaseType=h.Standardised)):null!=e&&(e>=10.5&&(this._databaseType=h.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=h.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)\"global-id\"===e.type&&(this.globalIdField=e.name);this._layer instanceof F?(this.typeIdField=this._layer.subtypeField??\"\",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??\"\",this.types=this._layer.types)}_isInFeatureSet(){return p.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet(\"\",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new D;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace(\"OBJECTID\",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch(i){return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){const t=this._layer?.capabilities?.query;return!e.outStatistics&&!0===t?.supportsFormatPBF&&!0===t?.supportsQuantizationEditMode}async queryPBF(e){return e.quantizationParameters={mode:\"edit\"},(await b(this._layer.parsedUrl,e,{format:\"pbf\"},{})).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||\"SDE.DEFAULT\":\"\"}nativeCapabilities(){return{title:this._layer.title??\"\",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){e.returnZ=this.hasZ,e.returnM=this.hasM;const i=\"execute\"===t?C:\"executeForCount\"===t?I:x,r=\"execute\"===t&&this.pbfSupportedForQuery(e);let s=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);s=this.recentlyUsedQueries.getFromCache(t),null===s&&(s=!0!==r?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(t,s),s=s.catch((e=>{throw this.recentlyUsedQueries?.removeFromCache(t),e})))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===s&&(s=!0!==r?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),s}async _getFilteredSet(e,t,i,r,s){const a=await this.databaseType();if(this.isTable()&&t&&null!==e&&\"\"!==e){return new o([],[],!0,null)}if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let n=\"\",l=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(n=r.constructClause(),l=!0);const u=new D;this.datesInUnknownTimezone&&(u.timeReferenceUnknownClient=!0),u.where=null===i?null===t?\"1=1\":\"\":y(i,a),this._requestStandardised&&(u.sqlFormat=\"standard\"),u.spatialRelationship=this._makeRelationshipEnum(e),u.outSpatialReference=this.spatialReference,u.orderByFields=\"\"!==n?n.split(\",\"):null,u.geometry=null===t?null:t,u.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(u,\"executeForIds\");null===d&&(d=[]),this._checkCancelled(s);return new o([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a=\"\",n=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=r.constructClause(),n=!0);const l=await this.databaseType();let u=null===i?null===t?\"1=1\":\"\":y(i,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(u=\"\"!==u?\"((\"+this._layer.definitionExpression+\") AND (\"+u+\"))\":this._layer.definitionExpression);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;null!=h&&h=this._maxProcessingRate()-1))break}if(l>=i&&0===s.length)break}if(0===s.length)return\"success\";const o=new D;this._requestStandardised&&(o.sqlFormat=\"standard\"),this.datesInUnknownTimezone&&(o.timeReferenceUnknownClient=!0),o.objectIds=s,o.outFields=this._overrideFields??this._fieldsIncludingObjectId([\"*\"]),o.returnGeometry=!0,!0===this._removeGeometry&&(o.returnGeometry=!1),o.outSpatialReference=this.spatialReference;const u=await this.executeQuery(o,\"execute\");if(this._checkCancelled(r),void 0!==u.error)throw new a(n.RequestFailed,{reason:u.error});const d=this._layer.objectIdField;for(let a=0;a=o)break}if(0===_.features.length)return u;if(_.features.length===this._layer.capabilities?.query.maxRecordCount&&u.length\"+t.pagesDefinition.internal.lastMaxId.toString()+\")\":t.pagesDefinition.generatedOid+\">\"+t.pagesDefinition.internal.lastMaxId.toString());const l=t.pagesDefinition.internal.lastRetrieved,o=l,u=t.pagesDefinition.internal.lastPage,d=new D;if(this._requestStandardised&&(d.sqlFormat=\"standard\"),d.where=s,d.spatialRelationship=t.pagesDefinition.spatialRel,d.relationParameter=t.pagesDefinition.relationParam,d.outFields=t.pagesDefinition.outFields,d.outStatistics=t.pagesDefinition.outStatistics,d.geometry=t.pagesDefinition.geometry,d.groupByFieldsForStatistics=t.pagesDefinition.groupByFieldsForStatistics,d.num=t.pagesDefinition.resultRecordCount,d.start=t.pagesDefinition.internal.lastPage,d.returnGeometry=t.pagesDefinition.returnGeometry,this.datesInUnknownTimezone&&(d.timeReferenceUnknownClient=!0),d.orderByFields=\"\"!==t.pagesDefinition.orderByFields?t.pagesDefinition.orderByFields.split(\",\"):null,this.isTable()&&d.geometry&&d.spatialRelationship)return[];const h=await this.executeQuery(d,\"execute\");if(this._checkCancelled(r),!h.hasOwnProperty(\"features\"))throw new a(n.InvalidStatResponse);const p=[];if(t.pagesDefinition.internal.lastPage!==u)return[];h.features.length>0&&void 0===h.features[0].attributes[t.pagesDefinition.generatedOid]&&(t.pagesDefinition.generatedOid=t.pagesDefinition.generatedOid.toLowerCase());for(let e=0;e0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),a&&a.length>0&&(l.attachmentTypes=a),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:l,method:\"attachments\"});const o=await this._layer.queryAttachments(l),u=[];return o&&o[e]&&o[e].forEach((t=>{const i=this._layer.parsedUrl.path+\"/\"+e.toString()+\"/attachments/\"+t.id.toString();let a=null;n&&t.exifInfo&&(a=s.convertJsonToArcade(t.exifInfo,\"system\",!0)),u.push(new r(t.id,t.name,t.contentType,t.size,i,a,t.keywords??null))})),u}return[]}async queryRelatedFeatures(t){const r={f:\"json\",relationshipId:t.relationshipId.toString(),definitionExpression:t.where,outFields:t.outFields?.join(\",\"),returnGeometry:t.returnGeometry.toString()};void 0!==t.resultOffset&&null!==t.resultOffset&&(r.resultOffset=t.resultOffset.toString()),void 0!==t.resultRecordCount&&null!==t.resultRecordCount&&(r.resultRecordCount=t.resultRecordCount.toString()),t.orderByFields&&(r.orderByFields=t.orderByFields.join(\",\")),t.objectIds&&t.objectIds.length>0&&(r.objectIds=t.objectIds.join(\",\")),t.outSpatialReference&&(r.outSR=R(t.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:r,method:\"relatedrecords\",url:this._layer.parsedUrl.path+\"/queryRelatedRecords\"});const s=await i(this._layer.parsedUrl.path+\"/queryRelatedRecords\",{responseType:\"json\",query:r});if(s.data){const t={},i=s.data;if(i?.relatedRecordGroups){const r=i.spatialReference;for(const s of i.relatedRecordGroups){const a=s.objectId,n=[];for(const t of s.relatedRecords){t.geometry&&(t.geometry.spatialReference=r);const i=new e({geometry:t.geometry?w(t.geometry):null,attributes:t.attributes});n.push(i)}t[a]={features:n,exceededTransferLimit:!0===i.exceededTransferLimit}}}return t}throw new a(n.InvalidRequest)}async getFeatureByObjectId(e,t){const i=new D;i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+\"=\"+e.toString(),this.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:\"execute\"});const r=await C(this._layer.parsedUrl.path,i);return 1===r.features.length?r.features[0]:null}async getIdentityUser(){await this.load();const e=t?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=t?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let r=this._layer.url;const s=r.toLowerCase().indexOf(\"/rest/services\");if(r=s>-1?r.substring(0,s):r,r){r+=\"/rest/info\";try{const e=await i(r,{query:{f:\"json\"}});let t=\"\";return e.data?.owningSystemUrl&&(t=e.data.owningSystemUrl),t}catch(a){return\"\"}}return\"\"}getDataSourceFeatureSet(){const e=new T({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,{parsedUrl:{path:t},serviceItemId:r=null}=this._layer;if(t){const s=await i(t,{responseType:\"json\",query:{f:\"json\"}});e=s?.data?.name??null,r=s?.data?.serviceItemId??null}const s=this._layer.title&&null!==(this._layer.parent??null);return this.featureSetInfo={layerId:this._layer.layerId,layerName:\"\"===e?null:e,itemId:\"\"===r?null:r,serviceLayerUrl:\"\"===t?null:t,webMapLayerId:s?this._layer.id??null:null,webMapLayerTitle:s?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}export{T as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../Graphic.js\";import{FeatureSetError as t,FeatureSetErrorCodes as r}from\"../support/errorsupport.js\";import s from\"../support/FeatureSet.js\";import i from\"../support/IdSet.js\";import{defaultMaxRecords as a,FeatureServiceDatabaseType as l,IdState as n}from\"../support/shared.js\";import{toWhereClause as o}from\"../support/sqlUtils.js\";import u from\"../../../geometry/Geometry.js\";import h from\"../../../layers/FeatureLayer.js\";import y from\"../../../layers/SubtypeGroupLayer.js\";import c from\"../../../layers/support/FeatureType.js\";import d from\"../../../layers/support/Field.js\";import p from\"../../../rest/support/Query.js\";class f extends s{constructor(e){super(e),this.declaredClass=\"esri.arcade.featureset.sources.FeatureLayerMemory\",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return a}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return\"\"}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),null!==this._overrideFields)if(1===this._overrideFields.length&&\"*\"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const r of this.fields)if(\"oid\"===r.type)e.push(r),t.push(r.name);else for(const s of this._overrideFields)if(s.toLowerCase()===r.name.toLowerCase()){e.push(r),t.push(r.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)\"global-id\"===e.type&&(this.globalIdField=e.name);this._databaseType=l.Standardised,this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,this._layer instanceof y?(this.typeIdField=this._layer.subtypeField??\"\",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??\"\",this.types=this._layer.types)}isTable(){return this._forceIsTable||this._layer.isTable||\"table\"===this._layer.type||!this._layer.geometryType}_isInFeatureSet(){return n.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet(\"\",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(t){const r={};for(const e of this.fields)r[e.name]=t.attributes[e.name];return new e({geometry:!0===this._removeGeometry?null:t.geometry,attributes:r})}async _getFilteredSet(e,t,r,s,a){let n=\"\",u=!1;if(null!==s&&(n=s.constructClause(),u=!0),this.isTable()&&t&&null!==e&&\"\"!==e){return new i([],[],!0,null)}const h=new p;h.returnZ=this.hasZ,h.returnM=this.hasM,h.where=null===r?null===t?\"1=1\":\"\":o(r,l.Standardised),h.spatialRelationship=this._makeRelationshipEnum(e),h.outSpatialReference=this.spatialReference,h.orderByFields=\"\"!==n?n.split(\",\"):null,h.geometry=null===t?null:t,h.returnGeometry=!0,h.relationParameter=this._makeRelationshipParam(e);const y=await this._layer.queryFeatures(h);if(null===y)return new i([],[],u,null);this._checkCancelled(a);const c=[];y.features.forEach((e=>{const t=e.attributes[this._layer.objectIdField];c.push(t),this._featureCache[t]=this._changeFeature(e)}));return new i([],c,u,null)}_makeRelationshipEnum(e){if(e.includes(\"esriSpatialRelRelation\"))return\"relation\";switch(e){case\"esriSpatialRelRelation\":return\"relation\";case\"esriSpatialRelIntersects\":return\"intersects\";case\"esriSpatialRelContains\":return\"contains\";case\"esriSpatialRelOverlaps\":return\"overlaps\";case\"esriSpatialRelWithin\":return\"within\";case\"esriSpatialRelTouches\":return\"touches\";case\"esriSpatialRelCrosses\":return\"crosses\";case\"esriSpatialRelEnvelopeIntersects\":return\"envelope-intersects\"}return e}_makeRelationshipParam(e){return e.includes(\"esriSpatialRelRelation\")?e.split(\":\")[1]:\"\"}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new p;if(e.where=\"1=1\",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const e=[];return this._layer.source.items.forEach((t=>{const r=t.attributes[this._layer.objectIdField];e.push(r),this._featureCache[r]=this._changeFeature(t)})),this._wset=new i([],e,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),r=[];return t.features.forEach((e=>{const t=e.attributes[this._layer.objectIdField];r.push(t),this._featureCache[t]=this._changeFeature(e)})),this._wset=new i([],r,!1,null),this._wset}async _getFeatures(e,s,i){const a=[];-1!==s&&void 0===this._featureCache[s]&&a.push(s);for(let t=e._lastFetchedIndex;ti)));t++);if(0===a.length)return\"success\";throw new t(r.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const r in e)t[r]=e[r];return t}nativeCapabilities(){return{title:this._layer.title??\"\",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField;const s=e.layerDefinition.typeIdField??\"\",i=[];if(e.layerDefinition.types)for(const u of e.layerDefinition.types)i.push(c.fromJSON(u));let a=e.layerDefinition.geometryType;void 0===a&&(a=e.featureSet.geometryType||\"\");let l=e.featureSet.features;const n=t.toJSON();if(!r){let t=!1;for(const s of e.layerDefinition.fields)if(\"oid\"===s.type||\"esriFieldTypeOID\"===s.type){r=s.name,t=!0;break}if(!1===t){let t=\"FID\",s=!0,i=0;for(;s;){let r=!0;for(const s of e.layerDefinition.fields)if(s.name===t){r=!1;break}!0===r?s=!1:(i++,t=\"FID\"+i.toString())}e.layerDefinition.fields.push({type:\"esriFieldTypeOID\",name:t,alias:t});const a=[];for(let r=0;re.name)):[\"*\"]);u.outFields=h,u.relationshipId=this.relationship.id,u.where=\"1=1\";let c=!0;!0===this._removeGeometry&&(c=!1),u.returnGeometry=c,this._requestStandardised&&(u.sqlFormat=\"standard\"),u.outSpatialReference=this.spatialReference,u.orderByFields=\"\"!==d?d.split(\",\"):null;const y=await n.source.queryRelatedFeatures(u);this._checkCancelled(a);const p=y[this._findObjectId]?y[this._findObjectId].features:[],_=[];for(let s=0;se.name)):[\"*\"]);return p=new s(c||y?[\"GETPAGES\"]:[],c||y?[]:[\"GETPAGES\"],l,{outFields:f.join(\",\"),resultRecordCount:u,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:n,returnGeometry:_,returnIdsOnly:\"false\",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,u,0,0,a),p}_expandPagedSet(e,t,r,i,s){return this._expandPagedSetFeatureSet(e,t,r,i,s)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,r){const i=e.pagesDefinition.internal.lastRetrieved,s=i,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),d=new l;!0===this._requestStandardised&&(d.sqlFormat=\"standard\"),d.relationshipId=this.relationship.id,d.objectIds=e.pagesDefinition.objectIds,d.resultOffset=e.pagesDefinition.internal.lastPage,d.resultRecordCount=e.pagesDefinition.resultRecordCount,d.outFields=e.pagesDefinition.outFields.split(\",\"),d.where=e.pagesDefinition.where,d.orderByFields=\"\"!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(\",\"):null,d.returnGeometry=e.pagesDefinition.returnGeometry,d.outSpatialReference=this.spatialReference;const o=await n.source.queryRelatedFeatures(d);if(this._checkCancelled(r),e.pagesDefinition.internal.lastPage!==a)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let l=0;ls)))&&!(d>=s&&0===n.length);t++);if(0===n.length)return\"success\";throw new t(r.MissingFeatures)}async _refineSetBlock(e,t,r){return e}async _stat(e,t,r,i,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,r,i,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,i,s){return this._relatedLayer.queryAttachments(e,t,r,i,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../request.js\";import t from\"./featureSetCollection.js\";import{$ as a,a0 as r}from\"../chunks/languageUtils.js\";import n from\"./featureset/actions/AttributeFilter.js\";import i from\"./featureset/actions/GroupBy.js\";import s from\"./featureset/actions/OrderBy.js\";import l from\"./featureset/actions/SpatialFilter.js\";import o from\"./featureset/actions/Top.js\";import u from\"./featureset/sources/FeatureLayerDynamic.js\";import c from\"./featureset/sources/FeatureLayerMemory.js\";import d from\"./featureset/sources/FeatureLayerRelated.js\";import f from\"./featureset/support/cache.js\";import{FeatureSetError as p,FeatureSetErrorCodes as m}from\"./featureset/support/errorsupport.js\";import y from\"./featureset/support/FeatureSet.js\";import{extractServiceUrl as h}from\"./featureset/support/shared.js\";import{WhereClause as _}from\"../core/sql/WhereClause.js\";import w from\"../layers/FeatureLayer.js\";import S from\"../portal/PortalItem.js\";function L(){null===f.applicationCache&&(f.applicationCache=new f)}async function I(e,t){if(f.applicationCache){const r=f.applicationCache.getLayerInfo(e);if(r){const a=await r;return new w({url:e,outFields:t,sourceJSON:a})}const n=new w({url:e,outFields:t}),i=(async()=>(await n.load(),n.sourceJSON))();if(f.applicationCache){f.applicationCache.setLayerInfo(e,i);try{return await i,n}catch(a){throw f.applicationCache.clearLayerInfo(e),a}}return await i,n}return new w({url:e,outFields:t})}async function F(e,t,a,r,n,i=null){return g(await I(e,[\"*\"]),t,a,r,n,i)}function g(e,t=null,r=null,n=!0,i=null,s=null){if(e instanceof w||a(e)){const a={layer:e,spatialReference:t,outFields:r,includeGeometry:n,lrucache:i,interceptor:s};return!0==!(e.url||!e.source)?new c(a):new u(a)}const l=g(e.parent,t,r,n,i,s);return l.filter(_.create(e.parent.subtypeField+\"=\"+e.subtypeCode.toString(),e.parent.fieldsIndex,l.dateFieldsTimeZoneDefaultUTC))}async function A(t){if(null!==f.applicationCache){const e=f.applicationCache.getLayerInfo(t);if(null!==e)return e}const a=(async()=>{const a=await e(t,{responseType:\"json\",query:{f:\"json\"}});return a.data?a.data:null})();if(null!==f.applicationCache){f.applicationCache.setLayerInfo(t,a);try{return await a}catch(r){throw f.applicationCache.clearLayerInfo(t),r}}return a}async function N(t,a){const r=\"QUERYDATAELEMTS:\"+a.toString()+\":\"+t;if(null!==f.applicationCache){const e=f.applicationCache.getLayerInfo(r);if(null!==e)return e}const n=(async()=>{const r=await e(t+\"/queryDataElements\",{method:\"post\",responseType:\"json\",query:{layers:JSON.stringify([a.toString()]),f:\"json\"}});if(r.data){const e=r.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new p(m.DataElementsNotFound)})();if(null!==f.applicationCache){f.applicationCache.setLayerInfo(r,n);try{return await n}catch(i){throw f.applicationCache.clearLayerInfo(r),i}}return n}async function C(t){if(null!==f.applicationCache){const e=f.applicationCache.getLayerInfo(t);if(null!==e)return e}const a=(async()=>{const a=await e(t,{responseType:\"json\",query:{f:\"json\"}});if(a.data){const e=a.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==f.applicationCache){f.applicationCache.setLayerInfo(t,a);try{return await a}catch(r){throw f.applicationCache.clearLayerInfo(t),r}}return a}async function T(e,t){const a={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},r=await C(e);if(a.metadata=r,void 0!==r.controllerDatasetLayers?.utilityNetworkLayerId&&null!==r.controllerDatasetLayers.utilityNetworkLayerId){if(r.layers)for(const e of r.layers)a.layerNameLkp[e.id]=e.name;if(r.tables)for(const e of r.tables)a.layerNameLkp[e.id]=e.name;const n=r.controllerDatasetLayers.utilityNetworkLayerId;a.networkId=n;const i=await N(e,n);if(i){a.queryelem=i,a.queryelem?.dataElement&&void 0!==a.queryelem.dataElement.schemaGeneration&&(a.unVersion=a.queryelem.dataElement.schemaGeneration),a.lkp={},a.queryelem.dataElement.domainNetworks||(a.queryelem.dataElement.domainNetworks=[]);for(const e of a.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:a.layerNameLkp[t.layerId]??null};e.className&&(a.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:a.layerNameLkp[t.layerId]??null};e.className&&(a.lkp[e.className]=e)}}if(a.queryelem.dataElement.terminalConfigurations)for(const e of a.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)a.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const r=await A(e+\"/\"+n);if(void 0!==r.systemLayers?.associationsTableId&&null!==r.systemLayers.associationsTableId){const n=[];a.unVersion>=4&&(n.push(\"STATUS\"),n.push(\"PERCENTALONG\"));let i=await F(e+\"/\"+r.systemLayers.associationsTableId.toString(),t,[\"OBJECTID\",\"FROMNETWORKSOURCEID\",\"TONETWORKSOURCEID\",\"FROMGLOBALID\",\"TOGLOBALID\",\"TOTERMINALID\",\"FROMTERMINALID\",\"ASSOCIATIONTYPE\",\"ISCONTENTVISIBLE\",\"GLOBALID\",...n],!1,null,null);return await i.load(),a.unVersion>=4&&(i=i.filter(_.create(\"STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)\",i.getFieldsIndex(),i.dateFieldsTimeZoneDefaultUTC)),await i.load()),{lkp:a.lkp,associations:i,unVersion:a.unVersion,terminals:a.terminals}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:a.unVersion,lkp:null,terminals:[]}}async function k(e,t,a,r=null,n=null,i=!0,s=null,l=null){let o=e.serviceUrl();if(!o)return null;o=\"/\"===o.charAt(o.length-1)?o+t.relatedTableId.toString():o+\"/\"+t.relatedTableId.toString();const u=await F(o,r,n,i,s,l);return new d({layer:e,relatedLayer:u,relationship:t,objectId:a,spatialReference:r,outFields:n,includeGeometry:i,lrucache:s,interceptor:l})}n.registerAction(),i.registerAction(),s.registerAction(),l.registerAction(),o.registerAction();class b extends t{constructor(e,t=null,a=null,r=null){super(),this._map=e,this._overridespref=t,this._lrucache=a,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,a=null){const r=g(e,this._overridespref,null===a?[\"*\"]:a,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(a)}),r}async featureSetByName(e,t=!0,r=null){if(void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,r);null===r&&(r=[\"*\"]),r=(r=r.slice(0)).sort();const n=JSON.stringify(r);for(let a=0;a{if(t instanceof w){if(t.title===e)return!0}else if(a(t)){if(t.title===e)return!0;i.push(t)}return!1}));if(s)return this._makeAndAddFeatureSet(s,t,r);if(this._map.tables){const a=this._map.tables.find((t=>!!(t.title&&t.title===e||t.title&&t.title===e)));if(a){if(a instanceof w)return this._makeAndAddFeatureSet(a,t,r);if(a._materializedTable);else{const e=a.outFields?a:{...a,outFields:[\"*\"]};a._materializedTable=new w(e)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,r)}}for(const a of i){if(\"not-loaded\"===a.loadStatus||\"loading\"===a.loadStatus)try{await a.load()}catch(l){}const n=a.sublayers.find((t=>t.title===e));if(n)return this._makeAndAddFeatureSet(n,t,r)}return null}async featureSetById(e,t=!0,r=[\"*\"]){if(void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return await this._map.load(),this.featureSetById(e,t,r);null===r&&(r=[\"*\"]),r=(r=r.slice(0)).sort();const n=JSON.stringify(r);for(let a=0;a{if(t instanceof w){if(t.id===e)return!0}else if(a(t)){if(t.id===e)return!0;i.push(t)}return!1}));if(s)return this._makeAndAddFeatureSet(s,t,r);if(this._map.tables){const a=this._map.tables.find((t=>t.id===e));if(a){if(a instanceof w)return this._makeAndAddFeatureSet(a,t,r);if(a._materializedTable);else{const e={...a,outFields:[\"*\"]};a._materializedTable=new w(e)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,r)}}for(const a of i){if(\"not-loaded\"===a.loadStatus||\"loading\"===a.loadStatus)try{await a.load()}catch(l){}const n=a.sublayers.find((t=>t.id===e));if(n)return this._makeAndAddFeatureSet(n,t,r)}return null}}class O extends t{constructor(e,t=null,a=null,r=null){super(),this._url=e,this._overridespref=t,this._lrucache=a,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,a=null){const r=g(e,this._overridespref,null===a?[\"*\"]:a,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(a)}),r}async _loadMetaData(){const e=await C(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new O(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,a=null){null===a&&(a=[\"*\"]),a=(a=a.slice(0)).sort();const r=JSON.stringify(a);for(let s=0;s0){const i=[];for(let e=0;e{if(p(l,1,2,t,r),y(l[0]))return\"Unknown\";if(w(l[0]))return\"Unknown\";if(h(l[0])){if(await l[0].load(),1===l.length||null===l[1])return l[0].datesInUnknownTimezone?se(\"unknown\"):se(l[0].dateFieldsTimeZone);if(!(l[1]instanceof n)||!1===l[1].hasField(\"type\"))throw new a(t,i.InvalidParameter,r);const e=l[1].field(\"type\");if(!1===g(e))throw new a(t,i.InvalidParameter,r);switch(F(e).toLowerCase()){case\"preferredtimezone\":return se(l[0].preferredTimeZone);case\"editfieldsinfo\":return se(l[0].editFieldsInfo?.timeZone??null);case\"timeinfo\":return se(l[0].timeInfo?.timeZone??null);case\"field\":if(l[1].hasField(\"fieldname\")&&g(l[1].field(\"fieldname\")))return se(l[0].fieldTimeZone(F(l[1].field(\"fieldname\"))))}throw new a(t,i.InvalidParameter,r)}const f=I(l[0],D(t));if(null===f)return null;const u=f.timeZone;return\"system\"===u?e.systemTimeZoneCanonicalName:\"utc\"===u.toLowerCase()?\"UTC\":\"unknown\"===u.toLowerCase()?\"Unknown\":u}))},q.functions.sqltimestamp=function(e,t){return q.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,1,3,e,t);const o=s[0];if(T(o)){if(1===s.length)return o.toSQLWithKeyword();if(2===s.length)return o.changeTimeZone(F(s[1])).toSQLWithKeyword();throw new a(e,i.InvalidParameter,t)}if(w(o))return o.toSQLWithKeyword();if(h(o)){if(3!==s.length)throw new a(e,i.InvalidParameter,t);await o.load();const n=F(s[1]);if(w(s[2]))return s[2].toSQLWithKeyword();if(!1===T(s[2]))throw new a(e,i.InvalidParameter,t);const r=o.fieldTimeZone(n);return null===r?s[2].toSQLWithKeyword():s[2].changeTimeZone(r).toSQLWithKeyword()}throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"sqltimestamp\",min:2,max:4}),q.functions.featuresetbyid=function(e,t){return q.standardFunctionAsync(e,t,((n,r,o)=>{if(p(o,2,4,e,t),o[0]instanceof s){const n=F(o[1]);let r=E(o[2],null);const s=b(E(o[3],!0));if(null===r&&(r=[\"*\"]),!1===A(r))throw new a(e,i.InvalidParameter,t);return o[0].featureSetById(n,s,r)}throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"featuresetbyid\",min:2,max:4}),q.functions.getfeatureset=function(e,t){return q.standardFunctionAsync(e,t,((n,r,s)=>{if(p(s,1,2,e,t),N(s[0])){let t=E(s[1],\"datasource\");return null===t&&(t=\"datasource\"),t=F(t).toLowerCase(),o(s[0].fullSchema(),t,e.lrucache,e.interceptor,e.spatialReference)}throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"getfeatureset\",min:1,max:2}),q.functions.featuresetbyportalitem=function(e,n){return q.standardFunctionAsync(e,n,((r,s,o)=>{if(p(o,2,5,e,n),null===o[0])throw new a(e,i.PortalRequired,n);if(o[0]instanceof t){const t=F(o[1]),r=F(o[2]);let s=E(o[3],null);const f=b(E(o[4],!0));if(null===s&&(s=[\"*\"]),!1===A(s))throw new a(e,i.InvalidParameter,n);let u=null;return u=e.services?.portal?e.services.portal:J.getDefault(),u=v(o[0],u),l(t,r,e.spatialReference,s,f,u,e.lrucache,e.interceptor)}if(!1===g(o[0]))throw new a(e,i.PortalRequired,n);const f=F(o[0]),u=F(o[1]);let c=E(o[2],null);const d=b(E(o[3],!0));if(null===c&&(c=[\"*\"]),!1===A(c))throw new a(e,i.InvalidParameter,n);return l(f,u,e.spatialReference,c,d,e.services?.portal??J.getDefault(),e.lrucache,e.interceptor)}))},q.signatures.push({name:\"featuresetbyportalitem\",min:2,max:5}),q.functions.featuresetbyname=function(e,t){return q.standardFunctionAsync(e,t,((n,r,o)=>{if(p(o,2,4,e,t),o[0]instanceof s){const n=F(o[1]);let r=E(o[2],null);const s=b(E(o[3],!0));if(null===r&&(r=[\"*\"]),!1===A(r))throw new a(e,i.InvalidParameter,t);return o[0].featureSetByName(n,s,r)}throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"featuresetbyname\",min:2,max:4}),q.functions.featureset=function(e,t){return q.standardFunction(e,t,((r,s,o)=>{p(o,1,1,e,t);let l=o[0];const f={layerDefinition:{geometryType:\"\",objectIdField:\"\",hasM:!1,hasZ:!1,globalIdField:\"\",typeIdField:\"\",fields:[]},featureSet:{geometryType:\"\",features:[]}};if(g(l))l=JSON.parse(l),void 0!==l.layerDefinition?(f.layerDefinition=l.layerDefinition,f.featureSet=l.featureSet,l.layerDefinition.spatialReference&&(f.layerDefinition.spatialReference=l.layerDefinition.spatialReference)):(f.featureSet.features=l.features,f.featureSet.geometryType=l.geometryType,f.layerDefinition.geometryType=f.featureSet.geometryType,f.layerDefinition.objectIdField=l.objectIdFieldName??\"\",f.layerDefinition.typeIdField=l.typeIdFieldName,f.layerDefinition.globalIdField=l.globalIdFieldName,f.layerDefinition.fields=l.fields,l.spatialReference&&(f.layerDefinition.spatialReference=l.spatialReference));else{if(!(o[0]instanceof n))throw new a(e,i.InvalidParameter,t);{l=JSON.parse(o[0].castToText(!0));const e=ee(l,\"layerdefinition\");if(null!==e){f.layerDefinition.geometryType=ee(e,\"geometrytype\",\"\"),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.globalIdField=ee(e,\"globalidfield\",\"\"),f.layerDefinition.objectIdField=ee(e,\"objectidfield\",\"\"),f.layerDefinition.typeIdField=ee(e,\"typeidfield\",\"\"),f.layerDefinition.hasZ=!0===ee(e,\"hasz\",!1),f.layerDefinition.hasM=!0===ee(e,\"hasm\",!1);const t=ee(e,\"spatialreference\",null);t&&(f.layerDefinition.spatialReference=ne(t));for(const a of ee(e,\"fields\",[])){const e={name:ee(a,\"name\",\"\"),alias:ee(a,\"alias\",\"\"),type:ee(a,\"type\",\"\"),nullable:ee(a,\"nullable\",!0),editable:ee(a,\"editable\",!0),length:ee(a,\"length\",null),domain:te(ee(a,\"domain\"))};f.layerDefinition.fields.push(e)}const n=ee(l,\"featureset\",null);if(n){const e={};for(const t of f.layerDefinition.fields)e[t.name.toLowerCase()]=t.name;for(const t of ee(n,\"features\",[])){const n={},a=ee(t,\"attributes\",{});for(const t in a)n[e[t.toLowerCase()]]=a[t];f.featureSet.features.push({attributes:n,geometry:ae(ee(t,\"geometry\",null))})}}}else{f.layerDefinition.hasZ=!0===ee(l,\"hasz\",!1),f.layerDefinition.hasM=!0===ee(l,\"hasm\",!1),f.layerDefinition.geometryType=ee(l,\"geometrytype\",\"\"),f.featureSet.geometryType=f.layerDefinition.geometryType,f.layerDefinition.objectIdField=ee(l,\"objectidfieldname\",\"\"),f.layerDefinition.typeIdField=ee(l,\"typeidfieldname\",\"\");const e=ee(l,\"spatialreference\",null);e&&(f.layerDefinition.spatialReference=ne(e));let t=ee(l,\"fields\",null);if(A(t))for(const i of t){const e={name:ee(i,\"name\",\"\"),alias:ee(i,\"alias\",\"\"),type:ee(i,\"type\",\"\"),nullable:ee(i,\"nullable\",!0),editable:ee(i,\"editable\",!0),length:ee(i,\"length\",null),domain:te(ee(i,\"domain\"))};f.layerDefinition.fields.push(e)}else t=null,f.layerDefinition.fields=t;const n={};for(const i of f.layerDefinition.fields)n[i.name.toLowerCase()]=i.name;let a=ee(l,\"features\",null);if(A(a))for(const i of a){const e={},t=ee(i,\"attributes\",{});for(const a in t)e[n[a.toLowerCase()]]=t[a];f.featureSet.features.push({attributes:e,geometry:ae(ee(i,\"geometry\",null))})}else a=null,f.featureSet.features=a}}}if(!1===re(f))throw new a(e,i.InvalidParameter,t);return f.layerDefinition.geometryType||(f.layerDefinition.geometryType=\"esriGeometryNull\"),W.create(f,e.spatialReference)}))},q.signatures.push({name:\"featureset\",min:1,max:1}),q.functions.filter=function(e,t){return q.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),A(s[0])||x(s[0])){const n=[];let r=s[0];r instanceof m&&(r=r.toArray());let o=null;if(!L(s[1]))throw new a(e,i.InvalidParameter,t);o=s[1].createFunction(e);for(const e of r){const t=o(e);B(t)?!0===await t&&n.push(e):!0===t&&n.push(e)}return n}if(h(s[0])){const t=await s[0].load(),n=K.create(s[1],t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),a=n.getVariables();if(a.length>0){const t=[];for(let n=0;n{if(p(s,2,2,e,t),h(s[0])){const e=new H(s[1]);return new k({parentfeatureset:s[0],orderbyclause:e})}throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"orderby\",min:2,max:2}),q.functions.top=function(e,t){return q.standardFunctionAsync(e,t,(async(n,r,s)=>{if(p(s,2,2,e,t),h(s[0]))return new O({parentfeatureset:s[0],topnum:s[1]});if(A(s[0]))return S(s[1])>=s[0].length?s[0].slice(0):s[0].slice(0,S(s[1]));if(x(s[0]))return S(s[1])>=s[0].length()?s[0].slice(0):s[0].slice(0,S(s[1]));throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"top\",min:2,max:2}),q.functions.first=function(e,t){return q.standardFunctionAsync(e,t,(async(n,a,i)=>{if(p(i,1,1,e,t),h(i[0])){const t=await i[0].first(n.abortSignal);if(null!==t){const n=r.createFromGraphicLikeObject(t.geometry,t.attributes,i[0],e.timeZone);return n._underlyingGraphic=t,n}return t}return A(i[0])?0===i[0].length?null:i[0][0]:x(i[0])?0===i[0].length()?null:i[0].get(0):null}))},q.signatures.push({name:\"first\",min:1,max:1}),q.functions.attachments=function(e,t){return q.standardFunctionAsync(e,t,(async(r,s,o)=>{p(o,1,2,e,t);const l={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(o.length>1)if(o[1]instanceof n){if(o[1].hasField(\"minsize\")&&(l.minsize=S(o[1].field(\"minsize\"))),o[1].hasField(\"metadata\")&&(l.returnMetadata=b(o[1].field(\"metadata\"))),o[1].hasField(\"maxsize\")&&(l.maxsize=S(o[1].field(\"maxsize\"))),o[1].hasField(\"types\")){const e=C(o[1].field(\"types\"),!1);e.length>0&&(l.types=e)}}else if(null!==o[1])throw new a(e,i.InvalidParameter,t);if(N(o[0])){let t=o[0]._layer;return t instanceof V&&(t=f(t,e.spatialReference,[\"*\"],!0,e.lrucache,e.interceptor)),null===t?[]:!1===h(t)?[]:(await t.load(),t.queryAttachments(o[0].field(t.objectIdField),l.minsize,l.maxsize,l.types,l.returnMetadata))}if(null===o[0])return[];throw new a(e,i.InvalidParameter,t)}))},q.signatures.push({name:\"attachments\",min:1,max:2}),q.functions.featuresetbyrelationshipname=function(e,t){return q.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,2,4,e,t);const o=s[0],l=F(s[1]);let d=E(s[2],null);const m=b(E(s[3],!0));if(null===d&&(d=[\"*\"]),!1===A(d))throw new a(e,i.InvalidParameter,t);if(null===s[0])return null;if(!N(s[0]))throw new a(e,i.InvalidParameter,t);let y=o._layer;if(y instanceof V&&(y=f(y,e.spatialReference,[\"*\"],!0,e.lrucache,e.interceptor)),null===y)return null;if(!1===h(y))return null;y=await y.load();const w=y.relationshipMetaData().filter((e=>e.name===l));if(0===w.length)return null;if(void 0!==w[0].relationshipTableId&&null!==w[0].relationshipTableId&&w[0].relationshipTableId>-1)return u(y,w[0],o.field(y.objectIdField),y.spatialReference,d,m,e.lrucache,e.interceptor);let g=y.serviceUrl();if(!g)return null;g=\"/\"===g.charAt(g.length-1)?g+w[0].relatedTableId.toString():g+\"/\"+w[0].relatedTableId.toString();const I=await c(g,y.spatialReference,d,m,e.lrucache,e.interceptor);await I.load();let D=I.relationshipMetaData();if(D=D.filter((e=>e.id===w[0].id)),!1===o.hasField(w[0].keyField)||null===o.field(w[0].keyField)){const e=await y.getFeatureByObjectId(o.field(y.objectIdField),[w[0].keyField]);if(e){const t=K.create(D[0].keyField+\"= @id\",I.getFieldsIndex(),I.dateFieldsTimeZoneDefaultUTC);return t.parameters={id:e.attributes[w[0].keyField]},I.filter(t)}return new z({parentfeatureset:I})}const T=K.create(D[0].keyField+\"= @id\",I.getFieldsIndex(),I.dateFieldsTimeZoneDefaultUTC);return T.parameters={id:o.field(w[0].keyField)},I.filter(T)}))},q.signatures.push({name:\"featuresetbyrelationshipname\",min:2,max:4}),q.functions.featuresetbyassociation=function(e,t){return q.standardFunctionAsync(e,t,(async(n,r,s)=>{p(s,2,3,e,t);const o=s[0],l=F(E(s[1],\"\")).toLowerCase(),u=g(s[2])?F(s[2]):null;if(null===s[0])return null;if(!N(s[0]))throw new a(e,i.InvalidParameter,t);let c=o._layer;if(c instanceof V&&(c=f(c,e.spatialReference,[\"*\"],!0,e.lrucache,e.interceptor)),null===c)return null;if(!1===h(c))return null;await c.load();const m=c.serviceUrl(),y=await d(m,e.spatialReference);let w=null,I=null,D=!1;if(null!==u&&\"\"!==u&&void 0!==u){for(const e of y.terminals)e.terminalName===u&&(I=e.terminalId);null===I&&(D=!0)}const T=y.associations.getFieldsIndex(),b=T.get(\"TOGLOBALID\").name,A=T.get(\"FROMGLOBALID\").name,x=T.get(\"TOTERMINALID\").name,L=T.get(\"FROMTERMINALID\").name,S=T.get(\"FROMNETWORKSOURCEID\").name,C=T.get(\"TONETWORKSOURCEID\").name,v=T.get(\"ASSOCIATIONTYPE\").name,M=T.get(\"ISCONTENTVISIBLE\").name,k=T.get(\"OBJECTID\").name;for(const e of c.fields)if(\"global-id\"===e.type){w=o.field(e.name);break}let O=null,z=new P(new Q({name:\"percentalong\",alias:\"percentalong\",type:\"double\"}),K.create(\"0\",y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC)),W=new P(new Q({name:\"side\",alias:\"side\",type:\"string\"}),K.create(\"''\",y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC));const H=\"globalid\",_=\"globalId\",q={};for(const e in y.lkp)q[e]=y.lkp[e].sourceId;const B=new j(new Q({name:\"classname\",alias:\"classname\",type:\"string\"}),null,q);let J=\"\";switch(l){case\"midspan\":{J=`((${b}='${w}') OR ( ${A}='${w}')) AND (${v} IN (5))`,B.codefield=K.create(`CASE WHEN (${b}='${w}') THEN ${S} ELSE ${C} END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC);const e=G(R.findField(y.associations.fields,A));e.name=H,e.alias=H,O=new P(e,K.create(`CASE WHEN (${A}='${w}') THEN ${b} ELSE ${A} END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC)),z=y.unVersion>=4?new Z(R.findField(y.associations.fields,T.get(\"PERCENTALONG\").name)):new P(new Q({name:\"percentalong\",alias:\"percentalong\",type:\"double\"}),K.create(\"0\",y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC));break}case\"junctionedge\":{J=`((${b}='${w}') OR ( ${A}='${w}')) AND (${v} IN (4,6))`,B.codefield=K.create(`CASE WHEN (${b}='${w}') THEN ${S} ELSE ${C} END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC);const e=G(R.findField(y.associations.fields,A));e.name=H,e.alias=H,O=new P(e,K.create(`CASE WHEN (${A}='${w}') THEN ${b} ELSE ${A} END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC)),W=new P(new Q({name:\"side\",alias:\"side\",type:\"string\"}),K.create(`CASE WHEN (${v}=4) THEN 'from' ELSE 'to' END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC));break}case\"connected\":{let e=`${b}='@T'`,t=`${A}='@T'`;null!==I&&(e+=` AND ${x}=@A`,t+=` AND ${L}=@A`),J=\"((\"+e+\") OR (\"+t+\"))\",J=$(J,\"@T\",w??\"\"),e=$(e,\"@T\",w??\"\"),null!==I&&(e=$(e,\"@A\",I.toString()),J=$(J,\"@A\",I.toString())),B.codefield=K.create(\"CASE WHEN \"+e+` THEN ${S} ELSE ${C} END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC);const n=G(R.findField(y.associations.fields,A));n.name=H,n.alias=H,O=new P(n,K.create(\"CASE WHEN \"+e+` THEN ${A} ELSE ${b} END`,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC));break}case\"container\":J=`${b}='${w}' AND ${v} = 2`,null!==I&&(J+=` AND ${x} = `+I.toString()),B.codefield=S,J=\"( \"+J+\" )\",O=new U(R.findField(y.associations.fields,A),H,H);break;case\"content\":J=`(${A}='${w}' AND ${v} = 2)`,null!==I&&(J+=` AND ${L} = `+I.toString()),B.codefield=C,J=\"( \"+J+\" )\",O=new U(R.findField(y.associations.fields,b),H,H);break;case\"structure\":J=`(${b}='${w}' AND ${v} = 3)`,null!==I&&(J+=` AND ${x} = `+I.toString()),B.codefield=S,J=\"( \"+J+\" )\",O=new U(R.findField(y.associations.fields,A),H,_);break;case\"attached\":J=`(${A}='${w}' AND ${v} = 3)`,null!==I&&(J+=` AND ${L} = `+I.toString()),B.codefield=C,J=\"( \"+J+\" )\",O=new U(R.findField(y.associations.fields,b),H,_);break;default:throw new a(e,i.InvalidParameter,t)}D&&(J=\"1 <> 1\");return new R({parentfeatureset:y.associations,adaptedFields:[new Z(R.findField(y.associations.fields,k)),new Z(R.findField(y.associations.fields,M)),O,W,B,z],extraFilter:J?K.create(J,y.associations.getFieldsIndex(),y.associations.dateFieldsTimeZoneDefaultUTC):null})}))},q.signatures.push({name:\"featuresetbyassociation\",min:2,max:6}),q.functions.groupby=function(e,t){return q.standardFunctionAsync(e,t,(async(r,s,o)=>{if(p(o,3,3,e,t),!h(o[0]))throw new a(e,i.InvalidParameter,t);const l=await o[0].load(),f=[],u=[];let c=!1,d=[];if(g(o[1]))d.push(o[1]);else if(o[1]instanceof n)d.push(o[1]);else if(A(o[1]))d=o[1];else{if(!x(o[1]))throw new a(e,i.InvalidParameter,t);d=o[1].toArray()}for(const m of d)if(g(m)){const e=K.create(F(m),l.getFieldsIndex(),l.dateFieldsTimeZoneDefaultUTC),t=!0===_(e)?F(m):\"%%%%FIELDNAME\";f.push({name:t,expression:e}),\"%%%%FIELDNAME\"===t&&(c=!0)}else{if(!(m instanceof n))throw new a(e,i.InvalidParameter,t);{const n=m.hasField(\"name\")?m.field(\"name\"):\"%%%%FIELDNAME\",r=m.hasField(\"expression\")?m.field(\"expression\"):\"\";if(\"%%%%FIELDNAME\"===n&&(c=!0),!n)throw new a(e,i.InvalidParameter,t);f.push({name:n,expression:K.create(r||n,l.getFieldsIndex(),l.dateFieldsTimeZoneDefaultUTC)})}}if(d=[],g(o[2]))d.push(o[2]);else if(A(o[2]))d=o[2];else if(x(o[2]))d=o[2].toArray();else{if(!(o[2]instanceof n))throw new a(e,i.InvalidParameter,t);d.push(o[2])}for(const m of d){if(!(m instanceof n))throw new a(e,i.InvalidParameter,t);{const n=m.hasField(\"name\")?m.field(\"name\"):\"\",r=m.hasField(\"statistic\")?m.field(\"statistic\"):\"\",s=m.hasField(\"expression\")?m.field(\"expression\"):\"\";if(!n||!r||!s)throw new a(e,i.InvalidParameter,t);u.push({name:n,statistic:r.toLowerCase(),expression:K.create(s,l.getFieldsIndex(),l.dateFieldsTimeZoneDefaultUTC)})}}if(c){const e={};for(const n of l.fields)e[n.name.toLowerCase()]=1;for(const n of f)\"%%%%FIELDNAME\"!==n.name&&(e[n.name.toLowerCase()]=1);for(const n of u)\"%%%%FIELDNAME\"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of f)if(\"%%%%FIELDNAME\"===n.name){for(;1===e[\"field_\"+t.toString()];)t++;e[\"field_\"+t.toString()]=1,n.name=\"FIELD_\"+t.toString()}}for(const t of f)await X(t.expression,q,e);for(const t of u)await X(t.expression,q,e);return o[0].groupby(f,u)}))},q.signatures.push({name:\"groupby\",min:3,max:3}),q.functions.distinct=function(e,t){return q.standardFunctionAsync(e,t,(async(r,s,o)=>{if(h(o[0])){p(o,2,2,e,t);const r=await o[0].load(),s=[];let l=[];if(g(o[1]))l.push(o[1]);else if(o[1]instanceof n)l.push(o[1]);else if(A(o[1]))l=o[1];else{if(!x(o[1]))throw new a(e,i.InvalidParameter,t);l=o[1].toArray()}let f=!1;for(const o of l)if(g(o)){const e=K.create(F(o),r.getFieldsIndex(),r.dateFieldsTimeZoneDefaultUTC),t=!0===_(e)?F(o):\"%%%%FIELDNAME\";s.push({name:t,expression:e}),\"%%%%FIELDNAME\"===t&&(f=!0)}else{if(!(o instanceof n))throw new a(e,i.InvalidParameter,t);{const n=o.hasField(\"name\")?o.field(\"name\"):\"%%%%FIELDNAME\",l=o.hasField(\"expression\")?o.field(\"expression\"):\"\";if(\"%%%%FIELDNAME\"===n&&(f=!0),!n)throw new a(e,i.InvalidParameter,t);s.push({name:n,expression:K.create(l||n,r.getFieldsIndex(),r.dateFieldsTimeZoneDefaultUTC)})}}if(f){const e={};for(const n of r.fields)e[n.name.toLowerCase()]=1;for(const n of s)\"%%%%FIELDNAME\"!==n.name&&(e[n.name.toLowerCase()]=1);let t=0;for(const n of s)if(\"%%%%FIELDNAME\"===n.name){for(;1===e[\"field_\"+t.toString()];)t++;e[\"field_\"+t.toString()]=1,n.name=\"FIELD_\"+t.toString()}}for(const t of s)await X(t.expression,q,e);return o[0].groupby(s,[])}return Y(\"distinct\",r,s,o)}))}),q.functions.getfeaturesetinfo=function(e,t){return q.standardFunctionAsync(e,t,(async(a,i,r)=>{if(p(r,1,1,e,t),!h(r[0]))return null;const s=await r[0].getFeatureSetInfo();return s?n.convertObjectToArcadeDictionary({layerId:s.layerId,layerName:s.layerName,itemId:s.itemId,serviceLayerUrl:s.serviceLayerUrl,webMapLayerId:s.webMapLayerId??null,webMapLayerTitle:s.webMapLayerTitle??null,className:null,objectClassId:null},D(e),!1,!1):null}))},q.signatures.push({name:\"getfeaturesetinfo\",min:1,max:1})}export{oe as registerFunctions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ArcadeExecutionError as e,ExecutionErrorCodes as n}from\"../executionError.js\";import{shapeExtent as t}from\"../kernel.js\";import{F as r,E as i,j as a,u as s}from\"../../chunks/languageUtils.js\";import u from\"../featureset/actions/SpatialFilter.js\";import o from\"../featureset/sources/Empty.js\";import l from\"../../geometry/Geometry.js\";import{relate as c,crosses as f,touches as p,within as m,overlaps as d,contains as w,intersects as h}from\"../../geometry/geometryEngineAsync.js\";function y(e){return e instanceof l}function S(i,a,c,S){return S(i,a,(async(S,R,v)=>{if(v.length<2)throw new e(i,n.WrongNumberOfParameters,a);if(null===(v=r(v))[0]&&null===v[1])return!1;if(s(v[0])){if(v[1]instanceof l)return new u({parentfeatureset:v[0],relation:c,relationGeom:v[1]});if(null===v[1])return new o({parentfeatureset:v[0]});throw new e(i,n.InvalidParameter,a)}if(y(v[0])){if(y(v[1])){switch(c){case\"esriSpatialRelEnvelopeIntersects\":return h(t(v[0]),t(v[1]));case\"esriSpatialRelIntersects\":return h(v[0],v[1]);case\"esriSpatialRelContains\":return w(v[0],v[1]);case\"esriSpatialRelOverlaps\":return d(v[0],v[1]);case\"esriSpatialRelWithin\":return m(v[0],v[1]);case\"esriSpatialRelTouches\":return p(v[0],v[1]);case\"esriSpatialRelCrosses\":return f(v[0],v[1])}throw new e(i,n.InvalidParameter,a)}if(s(v[1]))return new u({parentfeatureset:v[1],relation:c,relationGeom:v[0]});if(null===v[1])return!1;throw new e(i,n.InvalidParameter,a)}if(null!==v[0])throw new e(i,n.InvalidParameter,a);return s(v[1])?new o({parentfeatureset:v[1]}):!(v[1]instanceof l||null===v[1])&&void 0}))}function R(t){\"async\"===t.mode&&(t.functions.intersects=function(e,n){return S(e,n,\"esriSpatialRelIntersects\",t.standardFunctionAsync)},t.functions.envelopeintersects=function(e,n){return S(e,n,\"esriSpatialRelEnvelopeIntersects\",t.standardFunctionAsync)},t.signatures.push({name:\"envelopeintersects\",min:2,max:2}),t.functions.contains=function(e,n){return S(e,n,\"esriSpatialRelContains\",t.standardFunctionAsync)},t.functions.overlaps=function(e,n){return S(e,n,\"esriSpatialRelOverlaps\",t.standardFunctionAsync)},t.functions.within=function(e,n){return S(e,n,\"esriSpatialRelWithin\",t.standardFunctionAsync)},t.functions.touches=function(e,n){return S(e,n,\"esriSpatialRelTouches\",t.standardFunctionAsync)},t.functions.crosses=function(e,n){return S(e,n,\"esriSpatialRelCrosses\",t.standardFunctionAsync)},t.functions.relate=function(u,f){return t.standardFunctionAsync(u,f,((t,p,m)=>{if(m=r(m),i(m,3,3,u,f),y(m[0])&&y(m[1]))return c(m[0],m[1],a(m[2]));if(m[0]instanceof l&&null===m[1])return!1;if(m[1]instanceof l&&null===m[0])return!1;if(s(m[0])&&null===m[1])return new o({parentfeatureset:m[0]});if(s(m[1])&&null===m[0])return new o({parentfeatureset:m[1]});if(s(m[0])&&m[1]instanceof l)return m[0].relate(m[1],a(m[2]));if(s(m[1])&&m[0]instanceof l)return m[1].relate(m[0],a(m[2]));if(null===m[0]&&null===m[1])return!1;throw new e(u,n.InvalidParameter,f)}))})}export{R as registerFunctions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{ArcadeDate as n}from\"../ArcadeDate.js\";import{ArcadeExecutionError as t,ExecutionErrorCodes as e}from\"../executionError.js\";import{E as a,u as r,o as i,c as o,q as s,H as c,L as u}from\"../../chunks/languageUtils.js\";import{calculateStat as f}from\"./fieldStats.js\";import{SqlTimeStampOffset as d}from\"../../core/sql/SqlTimestampOffset.js\";import{WhereClause as l}from\"../../core/sql/WhereClause.js\";async function m(n,t,e,a,o,u){if(1===a.length){if(i(a[0]))return f(n,a[0],c(a[1],-1));if(s(a[0]))return f(n,a[0].toArray(),c(a[1],-1))}else if(2===a.length){if(i(a[0]))return f(n,a[0],c(a[1],-1));if(s(a[0]))return f(n,a[0].toArray(),c(a[1],-1));if(r(a[0])){const e=await a[0].load(),r=await A(l.create(a[1],e.getFieldsIndex(),e.dateFieldsTimeZoneDefaultUTC),u,o);return g(o,await a[0].calculateStatistic(n,r,c(a[2],1e3),t.abortSignal))}}else if(3===a.length&&r(a[0])){const e=await a[0].load(),r=await A(l.create(a[1],e.getFieldsIndex(),e.dateFieldsTimeZoneDefaultUTC),u,o);return g(o,await a[0].calculateStatistic(n,r,c(a[2],1e3),t.abortSignal))}return f(n,a,-1)}function g(t,e){return e instanceof d?n.fromReaderAsTimeStampOffset(e.toStorageFormat()):e instanceof Date?n.dateJSAndZoneToArcadeDate(e,u(t)):e}async function A(n,t,e){const a=n.getVariables();if(a.length>0){const r=[];for(let n=0;nm(\"stdev\",e,a,r,t,n)))},n.functions.variance=function(t,e){return n.standardFunctionAsync(t,e,((e,a,r)=>m(\"variance\",e,a,r,t,n)))},n.functions.average=function(t,e){return n.standardFunctionAsync(t,e,((e,a,r)=>m(\"mean\",e,a,r,t,n)))},n.functions.mean=function(t,e){return n.standardFunctionAsync(t,e,((e,a,r)=>m(\"mean\",e,a,r,t,n)))},n.functions.sum=function(t,e){return n.standardFunctionAsync(t,e,((e,a,r)=>m(\"sum\",e,a,r,t,n)))},n.functions.min=function(t,e){return n.standardFunctionAsync(t,e,((e,a,r)=>m(\"min\",e,a,r,t,n)))},n.functions.max=function(t,e){return n.standardFunctionAsync(t,e,((e,a,r)=>m(\"max\",e,a,r,t,n)))},n.functions.count=function(c,u){return n.standardFunctionAsync(c,u,((n,f,d)=>{if(a(d,1,1,c,u),r(d[0]))return d[0].count(n.abortSignal);if(i(d[0])||o(d[0]))return d[0].length;if(s(d[0]))return d[0].length();throw new t(c,e.InvalidParameter,u)}))})}export{y as registerFunctions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport n from\"../Dictionary.js\";import{ArcadeExecutionError as a,ExecutionErrorCodes as e}from\"../executionError.js\";import{E as t,r,W as o,j as i,u as c,a3 as s,V as d,L as u,X as m,a4 as f,Y as l,a5 as y,H as v,t as p,U as w}from\"../../chunks/languageUtils.js\";import{layerFieldEsriConstants as h}from\"../featureset/support/shared.js\";function T(a,e){return a&&a.domain?\"coded-value\"===a.domain.type||\"codedValue\"===a.domain.type?n.convertObjectToArcadeDictionary({type:\"codedValue\",name:a.domain.name,dataType:h[a.field.type],codedValues:a.domain.codedValues.map((n=>({name:n.name,code:n.code})))},u(e)):n.convertObjectToArcadeDictionary({type:\"range\",name:a.domain.name,dataType:h[a.field.type],min:a.domain.min,max:a.domain.max},u(e)):null}function b(h){\"async\"===h.mode&&(h.functions.domain=function(n,d){return h.standardFunctionAsync(n,d,(async(u,m,f)=>{if(t(f,2,3,n,d),r(f[0])){return T(o(f[0],i(f[1]),void 0===f[2]?void 0:f[2]),n)}if(c(f[0])){await f[0]._ensureLoaded();return T(s(i(f[1]),f[0],null,void 0===f[2]?void 0:f[2]),n)}throw new a(n,e.InvalidParameter,d)}))},h.functions.subtypes=function(o,i){return h.standardFunctionAsync(o,i,(async(s,m,f)=>{if(t(f,1,1,o,i),r(f[0])){const a=d(f[0]);return a?n.convertObjectToArcadeDictionary(a,u(o)):null}if(c(f[0])){await f[0]._ensureLoaded();const a=f[0].subtypes();return a?n.convertObjectToArcadeDictionary(a,u(o)):null}throw new a(o,e.InvalidParameter,i)}))},h.functions.domainname=function(n,o){return h.standardFunctionAsync(n,o,(async(d,u,l)=>{if(t(l,2,4,n,o),r(l[0]))return m(l[0],i(l[1]),l[2],void 0===l[3]?void 0:l[3]);if(c(l[0])){await l[0]._ensureLoaded();const n=s(i(l[1]),l[0],null,void 0===l[3]?void 0:l[3]);return f(n,l[2])}throw new a(n,e.InvalidParameter,o)}))},h.signatures.push({name:\"domainname\",min:2,max:4}),h.functions.domaincode=function(n,o){return h.standardFunctionAsync(n,o,(async(d,u,m)=>{if(t(m,2,4,n,o),r(m[0]))return l(m[0],i(m[1]),m[2],void 0===m[3]?void 0:m[3]);if(c(m[0])){await m[0]._ensureLoaded();const n=s(i(m[1]),m[0],null,void 0===m[3]?void 0:m[3]);return y(n,m[2])}throw new a(n,e.InvalidParameter,o)}))},h.signatures.push({name:\"domaincode\",min:2,max:4})),h.functions.text=function(n,a){return h.standardFunctionAsync(n,a,((e,r,o)=>{if(t(o,1,2,n,a),!c(o[0]))return p(o[0],o[1]);{const n=v(o[1],\"\");if(\"\"===n)return o[0].castToText();if(\"schema\"===n.toLowerCase())return o[0].convertToText(\"schema\",e.abortSignal);if(\"featureset\"===n.toLowerCase())return o[0].convertToText(\"featureset\",e.abortSignal)}}))},h.functions.gdbversion=function(n,o){return h.standardFunctionAsync(n,o,(async(i,s,d)=>{if(t(d,1,1,n,o),r(d[0]))return d[0].gdbVersion();if(c(d[0])){return(await d[0].load()).gdbVersion}throw new a(n,e.InvalidParameter,o)}))},h.functions.schema=function(o,i){return h.standardFunctionAsync(o,i,(async(s,d,m)=>{if(t(m,1,1,o,i),c(m[0]))return await m[0].load(),n.convertObjectToArcadeDictionary(m[0].schema(),u(o));if(r(m[0])){const a=w(m[0]);return a?n.convertObjectToArcadeDictionary(a,u(o)):null}throw new a(o,e.InvalidParameter,i)}))}}export{b as registerFunctions};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../request.js\";import r from\"../core/Error.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"../geometry/Extent.js\";import a from\"../geometry/SpatialReference.js\";import{create as p}from\"../geometry/support/aaBoundingRect.js\";import l from\"./Layer.js\";import{BlendLayer as n}from\"./mixins/BlendLayer.js\";import{RefreshableLayer as m}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as c}from\"./mixins/ScaleRangeLayer.js\";import{createTileBitmap as f}from\"./support/imageBitmapUtils.js\";import y from\"./support/TileInfo.js\";import{TileKey as u}from\"./support/TileKey.js\";var h;const d=new u(\"0/0/0\",0,0,0,void 0);let g=h=class extends(n(c(m(l)))){constructor(){super(...arguments),this.tileInfo=y.create({spatialReference:a.WebMercator,size:256}),this.type=\"base-tile\",this.fullExtent=new i(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,a.WebMercator),this.spatialReference=a.WebMercator}getTileBounds(e,t,r,o){const s=o||p();return d.level=e,d.row=t,d.col=r,d.extent=s,this.tileInfo.updateTileInfo(d),d.extent=void 0,s}fetchTile(e,r,o,s={}){const{signal:i}=s,a=this.getTileUrl(e,r,o),p={responseType:\"image\",signal:i,query:{...this.refreshParameters}};return t(a??\"\",p).then((e=>e.data))}async fetchImageBitmapTile(e,r,o,s={}){const{signal:i}=s;if(this.fetchTile!==h.prototype.fetchTile){const t=await this.fetchTile(e,r,o,s);return f(t,e,r,o,i)}const a=this.getTileUrl(e,r,o)??\"\",p={responseType:\"blob\",signal:i,query:{...this.refreshParameters}},{data:l}=await t(a,p);return f(l,e,r,o,i)}getTileUrl(){throw new r(\"basetilelayer:gettileurl-not-implemented\",\"getTileUrl() is not implemented\")}};e([o({type:y})],g.prototype,\"tileInfo\",void 0),e([o({type:[\"show\",\"hide\"]})],g.prototype,\"listMode\",void 0),e([o({readOnly:!0,value:\"base-tile\"})],g.prototype,\"type\",void 0),e([o({nonNullable:!0})],g.prototype,\"fullExtent\",void 0),e([o()],g.prototype,\"spatialReference\",void 0),g=h=e([s(\"esri.layers.BaseTileLayer\")],g);const j=g;export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../request.js\";import r from\"../core/Error.js\";import{JSONMap as o}from\"../core/jsonMap.js\";import{MultiOriginJSONMixin as a}from\"../core/MultiOriginJSONSupport.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import n from\"../geometry/SpatialReference.js\";import l from\"./BaseTileLayer.js\";import{BlendLayer as p}from\"./mixins/BlendLayer.js\";import{OperationalLayer as u}from\"./mixins/OperationalLayer.js\";import g from\"./support/LOD.js\";import d from\"./support/TileInfo.js\";import y from\"../geometry/Point.js\";const c=new o({BingMapsAerial:\"aerial\",BingMapsRoad:\"road\",BingMapsHybrid:\"hybrid\"}),m=\"https://dev.virtualearth.net\";let h=class extends(p(u(a(l)))){constructor(e){super(e),this.type=\"bing-maps\",this.tileInfo=new d({size:[256,256],dpi:96,origin:new y({x:-20037508.342787,y:20037508.342787,spatialReference:n.WebMercator}),spatialReference:n.WebMercator,lods:[new g({level:1,resolution:78271.5169639999,scale:295828763.795777}),new g({level:2,resolution:39135.7584820001,scale:147914381.897889}),new g({level:3,resolution:19567.8792409999,scale:73957190.948944}),new g({level:4,resolution:9783.93962049996,scale:36978595.474472}),new g({level:5,resolution:4891.96981024998,scale:18489297.737236}),new g({level:6,resolution:2445.98490512499,scale:9244648.868618}),new g({level:7,resolution:1222.99245256249,scale:4622324.434309}),new g({level:8,resolution:611.49622628138,scale:2311162.217155}),new g({level:9,resolution:305.748113140558,scale:1155581.108577}),new g({level:10,resolution:152.874056570411,scale:577790.554289}),new g({level:11,resolution:76.4370282850732,scale:288895.277144}),new g({level:12,resolution:38.2185141425366,scale:144447.638572}),new g({level:13,resolution:19.1092570712683,scale:72223.819286}),new g({level:14,resolution:9.55462853563415,scale:36111.909643}),new g({level:15,resolution:4.77731426794937,scale:18055.954822}),new g({level:16,resolution:2.38865713397468,scale:9027.977411}),new g({level:17,resolution:1.19432856685505,scale:4513.988705}),new g({level:18,resolution:.597164283559817,scale:2256.994353}),new g({level:19,resolution:.298582141647617,scale:1128.497176}),new g({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style=\"road\",this.culture=\"en-US\",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get(\"bingMetadata\")}set bingMetadata(e){this._set(\"bingMetadata\",e)}get copyright(){return null!=this.bingMetadata?this.bingMetadata.copyright:null}get operationalLayerType(){return c.toJSON(this.style)}get bingLogo(){return null!=this.bingMetadata?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then((()=>this._getMetadata()))):this.addResolvingPromise(Promise.reject(new r(\"bingmapslayer:load\",\"Bing layer must have bing key.\"))),Promise.resolve(this)}getTileUrl(e,t,r){if(!this.loaded||null==this.bingMetadata)return null;const o=this.bingMetadata.resourceSets[0].resources[0],a=o.imageUrlSubdomains[t%o.imageUrlSubdomains.length],s=this._getQuadKey(e,t,r);return o.imageUrl.replace(\"{subdomain}\",a).replace(\"{quadkey}\",s)}async fetchAttributionData(){return this.load().then((()=>{if(null==this.bingMetadata)return null;return{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map((e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map((e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]})))})))}}))}_getMetadata(){const e={road:\"roadOnDemand\",aerial:\"aerial\",hybrid:\"aerialWithLabelsOnDemand\"}[this.style];return t(`${m}/REST/v1/Imagery/Metadata/${e}`,{responseType:\"json\",query:{include:\"ImageryProviders\",uriScheme:\"https\",key:this.key,suppressStatus:!0,output:\"json\",culture:this.culture,userRegion:this.region}}).then((e=>{const t=e.data;if(200!==t.statusCode)throw new r(\"bingmapslayer:getmetadata\",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new r(\"bingmapslayer:getmetadata\",\"no bing resourcesets\");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new r(\"bingmapslayer:getmetadata\",\"no bing resources\")})).catch((e=>{throw new r(\"bingmapslayer:getmetadata\",e.message)}))}_getPortalBingKey(){return t(this.portalUrl??\"\",{responseType:\"json\",authMode:\"no-prompt\",query:{f:\"json\"}}).then((e=>{if(!e.data.bingKey)throw new r(\"bingmapslayer:getportalbingkey\",\"The referenced Portal does not contain a valid bing key\");this.key=e.data.bingKey})).catch((e=>{throw new r(\"bingmapslayer:getportalbingkey\",e.message)}))}_getQuadKey(e,t,r){let o=\"\";for(let a=e;a>0;a--){let e=0;const s=1<null!=e?e:`${t.index}`}}})],n.prototype,\"name\",void 0),e([r({jpg:\"jpg\",png:\"png\",dds:\"dds\",\"ktx-etc2\":\"ktx-etc2\",ktx2:\"ktx2\",basis:\"basis\"})],n.prototype,\"format\",void 0),n=e([p(\"esri.layer.support.I3STextureFormat\")],n);let u=class extends t{constructor(){super(...arguments),this.atlas=!1}};e([o({type:[n]})],u.prototype,\"formats\",void 0),e([o({type:Boolean})],u.prototype,\"atlas\",void 0),u=e([p(\"esri.layer.support.I3STextureSetDefinition\")],u);let y=class extends t{};e([r({Float32:\"Float32\",UInt64:\"UInt64\",UInt32:\"UInt32\",UInt16:\"UInt16\",UInt8:\"UInt8\"})],y.prototype,\"type\",void 0),e([o({type:Number})],y.prototype,\"component\",void 0),y=e([p(\"esri.layer.support.I3SGeometryAttribute\")],y);let d=class extends t{};e([r({draco:\"draco\"})],d.prototype,\"encoding\",void 0),e([o({type:[String]})],d.prototype,\"attributes\",void 0),d=e([p(\"esri.layer.support.I3SGeometryCompressedAttributes\")],d);let c=class extends t{constructor(){super(...arguments),this.offset=0}};e([o({type:Number})],c.prototype,\"offset\",void 0),e([o({type:y})],c.prototype,\"position\",void 0),e([o({type:y})],c.prototype,\"normal\",void 0),e([o({type:y})],c.prototype,\"uv0\",void 0),e([o({type:y})],c.prototype,\"color\",void 0),e([o({type:y})],c.prototype,\"uvRegion\",void 0),e([o({type:y})],c.prototype,\"featureId\",void 0),e([o({type:y})],c.prototype,\"faceRange\",void 0),e([o({type:d})],c.prototype,\"compressedAttributes\",void 0),c=e([p(\"esri.layer.support.I3SGeometryBuffer\")],c);let m=class extends t{};e([r({triangle:\"triangle\"})],m.prototype,\"topology\",void 0),e([o()],m.prototype,\"geometryBuffers\",void 0),m=e([p(\"esri.layer.support.I3SGeometryDefinition\")],m);export{y as I3SGeometryAttribute,c as I3SGeometryBuffer,d as I3SGeometryCompressedAttributes,m as I3SGeometryDefinition,l as I3SMaterialDefinition,a as I3SMaterialPBRMetallicRoughness,i as I3SMaterialTexture,s as I3SNodePageDefinition,n as I3STextureFormat,u as I3STextureSetDefinition};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar A;!function(A){A[A.INVISIBLE=0]=\"INVISIBLE\",A[A.TRANSPARENT=1]=\"TRANSPARENT\",A[A.OPAQUE=2]=\"OPAQUE\"}(A||(A={}));export{A as Transparency};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../../Color.js\";import\"../../../../core/has.js\";import{pt2px as n}from\"../../../../core/screenUtils.js\";import{f as t,b as o}from\"../../../../chunks/vec4f64.js\";import{isExtrudeSymbol3DLayer as r,isFillSymbol3DLayer as s}from\"./layerUtils.js\";import{Transparency as i}from\"../../webgl-engine/lib/edgeRendering/interfaces.js\";function c(e){return e&&e.enabled&&(r(e)||s(e))&&null!=e.edges}function l(e){return e&&e.enabled&&e.edges||null}function u(e,n){return a(l(e),n)}function a(r,s){if(null==r)return null;const i=null!=r.color?o(e.toUnitRGBA(r.color)):t(0,0,0,0),c=n(r.size),l=n(r.extensionLength);switch(r.type){case\"solid\":return f({color:i,size:c,extensionLength:l,...s});case\"sketch\":return p({color:i,size:c,extensionLength:l,...s});default:return}}function f(e){return{...h,...e,type:\"solid\"}}function p(e){return{...g,...e,type:\"sketch\"}}const h={color:t(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:i.OPAQUE,hasSlicePlane:!1},g={color:t(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:i.OPAQUE,hasSlicePlane:!1};export{u as createMaterial,a as createMaterialFromEdges,f as createSolidEdgeMaterial,c as hasEdges};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clamp as t}from\"../../../../core/mathUtils.js\";var n;function e(t){switch(t){case\"multiply\":default:return n.Multiply;case\"ignore\":return n.Ignore;case\"replace\":return n.Replace;case\"tint\":return n.Tint}}function r(e,r,a){if(null==e||r===n.Ignore)return a[0]=255,a[1]=255,a[2]=255,void(a[3]=255);const c=t(Math.round(e[3]*i),0,i),p=0===c||r===n.Tint?0:r===n.Replace?u:l;a[0]=t(Math.round(e[0]*o),0,o),a[1]=t(Math.round(e[1]*o),0,o),a[2]=t(Math.round(e[2]*o),0,o),a[3]=c+p}!function(t){t[t.Multiply=1]=\"Multiply\",t[t.Ignore=2]=\"Ignore\",t[t.Replace=3]=\"Replace\",t[t.Tint=4]=\"Tint\"}(n||(n={}));const o=255,i=85,u=i,l=2*i;export{n as ColorMixModeEnum,r as encodeSymbolColor,e as parseColorMixMode};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{b as e,c as t}from\"../../../chunks/mat3.js\";import{a as n}from\"../../../chunks/mat3f64.js\";import{c as a,a as r}from\"../../../chunks/quat.js\";import{b as i,a as o}from\"../../../chunks/quatf64.js\";import{c as s,v as f,w as c,x as h,y as u,f as l,u as z,s as S,t as m,g as M,k as b,l as q,i as p,q as j,z as k,A as g}from\"../../../chunks/vec3.js\";import{g as x,c as v}from\"../../../chunks/vec3f64.js\";import{t as y}from\"../../../chunks/vec4.js\";import{c as d}from\"../../../chunks/vec4f64.js\";import{create as w}from\"../../../geometry/support/aaBoundingBox.js\";import{signedDistance as A,normal as B}from\"../../../geometry/support/plane.js\";import{ViewingMode as G}from\"../../ViewingMode.js\";import{computeOBB as I}from\"./dito.js\";const V=o(),C=v(),D=v(),E=d(),F=n();function H(e=[0,0,0],t=[-1,-1,-1],n=o()){return{center:x(e),halfSize:x(t),quaternion:i(n)}}function J(e){return H(e.center,e.halfSize,e.quaternion)}function K(e,t){s(t.center,e.center),s(t.halfSize,e.halfSize),a(t.quaternion,e.quaternion)}function L(e,t){return t=t||H(),I(e,t),t}function N(e,t){const n=A(t,e.center),a=Z(e,B(t));return n>a?1:n<-a?-1:0}function O(e,t){return C[0]=e.center[0]-t[0],C[1]=e.center[1]-t[1],C[2]=e.center[2]-t[2],r(V,e.quaternion),f(C,C,V),c(C,C),h(D,C,e.halfSize),u(D,C)1e-6){const t=(a+e.halfSize[r]-i[r])/o[r],n=(-a-e.halfSize[r]-i[r])/o[r];s=Math.max(s,Math.min(t,n)),c=Math.min(c,Math.max(t,n))}else if(i[r]>e.halfSize[r]+a||i[r]<-e.halfSize[r]-a)return!1;return s<=c}function W(n,a,i,o,s){r(V,n.quaternion),z(C,a,n.center),f(C,C,V);const c=C[0]<-n.halfSize[0]?-1:C[0]>n.halfSize[0]?1:0,h=C[1]<-n.halfSize[1]?-1:C[1]>n.halfSize[1]?1:0,u=C[2]<-n.halfSize[2]?-1:C[2]>n.halfSize[2]?1:0,l=Math.abs(c)+Math.abs(h)+Math.abs(u);if(0===l)return 1/0;const b=1===l?4:6,q=6*(c+3*h+9*u+13);e(F,n.quaternion),t(F,F,n.halfSize);for(let e=0;e>1)-1),m(C,C,F),M(E,n.center,C),E[3]=1,y(E,E,i);const a=1/Math.max(1e-6,E[3]);X[2*e]=E[0]*a,X[2*e+1]=E[1]*a}const p=2*b-2;let j=X[0]*(X[3]-X[p+1])+X[p]*(X[1]-X[p-1]);for(let e=2;e{const e=new Int8Array(162);let t=0;const n=n=>{for(let a=0;a0?1+t/i:1,s=a>0?1+n/a:1,c=(s+r)/2,h=(s-r)/2;p(o.halfSize,ne,h),j(o.halfSize,o.halfSize,e.halfSize,c),p(o.center,ne,c),j(o.center,o.center,e.halfSize,h),k(te,te),g(o.center,o.center,te),f(o.center,o.center,o.quaternion)}}else{const a=S(te,0,0,1);j(o.center,e.center,a,(n+t)/2),r(re,e.quaternion),f(a,a,re),c(a,a),j(o.halfSize,e.halfSize,a,(n-t)/2)}return o}const te=v(),ne=v(),ae=v(),re=o();export{J as clone,L as compute,ee as computeOffsetObb,$ as corners,H as create,U as intersectLine,N as intersectPlane,O as intersectSphere,T as isVisible,R as maximumDistancePlane,Q as minimumDistancePlane,W as projectedArea,Z as projectedRadius,_ as radius,K as set,P as toAaBoundingBox};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../../request.js\";import{binaryIndexOf as t,splitIntoChunks as r}from\"../../../../core/arrayUtils.js\";import n from\"../../../../core/Error.js\";import has from\"../../../../core/has.js\";import{isInt16Array as o,isInt32Array as a}from\"../../../../core/typedArrayUtil.js\";import{b as i}from\"../../../../chunks/mat3.js\";import{a as s}from\"../../../../chunks/mat3f64.js\";import{i as l}from\"../../../../chunks/mat4.js\";import{a as c}from\"../../../../chunks/mat4f64.js\";import{c as u,m as f,a as p}from\"../../../../chunks/quat.js\";import{a as m}from\"../../../../chunks/quatf64.js\";import{s as h,c as d,u as y,v as g,i as b,g as S,e as w}from\"../../../../chunks/vec3.js\";import{c as T}from\"../../../../chunks/vec3f64.js\";import{getReferenceEllipsoid as E}from\"../../../../geometry/ellipsoidUtils.js\";import{canProjectWithoutEngine as v}from\"../../../../geometry/projection.js\";import j from\"../../../../geometry/SpatialReference.js\";import{getSphericalPCPF as M}from\"../../../../geometry/spatialReferenceEllipsoidUtils.js\";import{computeTranslationToOriginAndRotation as R}from\"../../../../geometry/projection/computeTranslationToOriginAndRotation.js\";import{projectBuffer as I}from\"../../../../geometry/projection/projectBuffer.js\";import{projectVectorToVector as x}from\"../../../../geometry/projection/projectVectorToVector.js\";import{create as q,empty as k,expandPointInPlace as C,intersects as U}from\"../../../../geometry/support/aaBoundingRect.js\";import{isPlateCarree as N}from\"../../../../geometry/support/spatialReferenceUtils.js\";import z from\"../../../../rest/support/Query.js\";import{readBinaryAttribute as W}from\"./I3SBinaryReader.js\";import{computeGlobalTransformation as D}from\"./I3SProjectionUtil.js\";import{createSolidEdgeMaterial as A,createMaterialFromEdges as F}from\"../support/edgeUtils.js\";import{parseColorMixMode as O,ColorMixModeEnum as _}from\"../support/symbolColorUtils.js\";import{create as L,compute as G,corners as K}from\"../../support/orientedBoundingBox.js\";import{Vertices as B}from\"../../webgl-engine/lib/Attribute.js\";function P(e){return e?parseInt(e.substring(e.lastIndexOf(\"/\")+1,e.length),10):void 0}function $(e){if(has(\"disable-feature:i3s-draco\")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if(\"draco\"===e.compressedAttributes?.encoding)return!0;return!1}function V(e,t,r,n){r.traverse(t,(t=>{const r=t.mbs;return(null!=r&&Y(e,r))!==X.OUTSIDE&&(n(t),!0)}))}function Q(e,t,r){let n=0,o=0;for(let a=0;a=0===r&&(n[a]=n[o],a++),o++}n.length=a}const H=q();function J(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return H[0]=(e[0]-t.position[0])/t.rotationScale[0],H[1]=(e[1]-t.position[1])/t.rotationScale[4],H[2]=(e[2]-t.position[0])/t.rotationScale[0],H[3]=(e[3]-t.position[1])/t.rotationScale[4],H}var X;function Y(e,t){const r=t[0],n=t[1],o=t[3],a=e[0]-r,i=r-e[2],s=e[1]-n,l=n-e[3],c=Math.max(a,i,0),u=Math.max(s,l,0),f=c*c+u*u;if(f>o*o)return X.OUTSIDE;if(f>0)return X.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,i,s,l)>o?X.INSIDE:X.INTERSECTS_CENTER_INSIDE}function ee(e,t,r){const n=[],o=r?.missingFields,a=r?.originalFields;for(const i of e){const e=i.toLowerCase();let r=!1;for(const o of t)if(e===o.name.toLowerCase()){n.push(o.name),r=!0,a&&a.push(i);break}!r&&o&&o.push(i)}return n}async function te(e,t,r,o,a){if(0===t.length)return[];const i=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await ne(e.associatedLayer,t,r,o)}catch(s){if(e.associatedLayer.loaded)throw s}if(i){const s=re(t,r,a);if(null==s)throw new n(\"scenelayer:features-not-loaded\",\"Tried to query attributes for unloaded features\");const l=e.parsedUrl.path;return(await Promise.all(s.map((e=>ae(l,i,e.node,e.indices,o).then((t=>{for(let r=0;r=0){let e=n.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},o.push(e),n.set(r.node,e)),e.indices.push(s),e.graphics.push(i);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return o}async function ne(e,t,r,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const o=t.map((e=>e.attributes[r])),a=[],i=ee(n,e.fields,{originalFields:a}),s=await oe(e,o,i);for(let l=0;la){const n=r(t,a);return Promise.all(n.map((t=>oe(e,t,o)))).then((e=>e.flat()))}const i=new z({objectIds:t,outFields:o,orderByFields:[e.objectIdField]});return e.queryFeatures(i).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new n(\"scenelayer:feature-not-in-associated-layer\",\"Feature not found in associated feature layer\")}))}function ae(e,t,r,n,o){return ie(e,t,r.resources.attributes,n,o)}async function ie(t,r,n,o,a){const i=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${n}/attributes/${e.key}/0`;i.push({url:r,storageInfo:e})}const s=await Promise.allSettled(i.map((t=>e(t.url,{responseType:\"array-buffer\"}).then((e=>W(t.storageInfo,e.data)))))),l=[];for(const e of o){const t={};for(let r=0;r{if(!s)if(s=Qe,k(He),null!=e.serviceObb){ke(e.serviceObb,r,Je,t,o),K(Je,s);for(const e of s)w(e,e,et),C(He,e)}else{const n=e.mbs;if(!n)return;const a=n[3];x(n,r,Xe,t),w(Xe,Xe,et),Xe[2]+=o;for(let e=0;e<8;++e){const t=1&e?a:-a,r=2&e?a:-a,n=4&e?a:-a,o=s[e];d(o,[Xe[0]+t,Xe[1]+r,Xe[2]+n]),C(He,o)}}};let u=1/0,f=-1/0;const p=e=>{if(\"replace\"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;k(Ze);const o=r.spatialReference||n,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(x(r,o,Xe,t),w(Xe,Xe,et),C(Ze,Xe),Math.min(Xe[2],e))),e)),1/0);c(),U(He,Ze)&&(u=Math.min(u,a),f=Math.max(f,a))};if(a.forEach((e=>p(e))),u===1/0)return null;const m=(e,t,r)=>{w(Xe,r,i),e[t]=Xe[0],e[t+1]=Xe[1],e[t+2]=Xe[2],t+=24,r[2]=u,w(Xe,r,i),e[t]=Xe[0],e[t+1]=Xe[1],e[t+2]=Xe[2],t+=24,r[2]=f,w(Xe,r,i),e[t]=Xe[0],e[t+1]=Xe[1],e[t+2]=Xe[2]};for(let l=0;l<8;++l)m(Ye.data,3*l,s[l]);return G(Ye)}function Ge(e){return null!=e&&e.halfSize[0]>=0}function Ke(e){return e[3]>=0}function Be(e){null!=e&&(e.halfSize[0]=-1)}function Pe(e){null!=e&&(e[3]=-1)}const $e=c(),Ve=m(),Qe=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Ze=q(),He=q(),Je=L(),Xe=T(),Ye={data:new Array(72),size:3,exclusive:!0,stride:3},et=c();export{X as MbsIntersectResult,Ie as SymbolInfo,qe as addWraparound,Ee as checkPointCloudLayerCompatibleWithView,Te as checkPointCloudLayerValid,he as checkRecyclable,Se as checkSceneLayerCompatibleWithView,be as checkSceneLayerValid,me as checkSpatialReference,ye as checkSpatialReferences,Le as computeVisibilityObb,$ as containsDraco,P as extractWkid,Q as filterInPlace,ee as findFieldsCaseInsensitive,V as findIntersectingNodes,pe as getCacheKeySuffix,ce as getCachedAttributeValue,J as getClipRect,ue as getIndexCrs,xe as getSymbolInfo,fe as getVertexCrs,Y as intersectBoundingRectWithMbs,Pe as invalidateMbs,Be as invalidateObb,de as isSupportedLocalModeProjection,Ke as isValidMbs,Ge as isValidObb,Z as objectIdFilter,ie as queryAttributesFromCachedAttributesId,Me as rendererNeedsTextures,ke as transformObb,Re as transparentEdgeMaterial,te as whenGraphicAttributes};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import r from\"../../Graphic.js\";import t from\"../../PopupTemplate.js\";import\"../../renderers/ClassBreaksRenderer.js\";import\"../../renderers/DictionaryRenderer.js\";import\"../../renderers/DotDensityRenderer.js\";import\"../../renderers/HeatmapRenderer.js\";import\"../../renderers/PieChartRenderer.js\";import\"../../renderers/Renderer.js\";import\"../../renderers/SimpleRenderer.js\";import\"../../renderers/UniqueValueRenderer.js\";import\"../../renderers/support/jsonUtils.js\";import{webSceneRendererTypes as o}from\"../../renderers/support/types.js\";import s from\"../../request.js\";import i from\"../../core/Error.js\";import{JSONMap as a}from\"../../core/jsonMap.js\";import n from\"../../core/Loadable.js\";import p from\"../../core/Logger.js\";import{EsriPromiseMixin as l}from\"../../core/Promise.js\";import{property as d}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as y}from\"../../core/accessorSupport/decorators/enumeration.js\";import{reader as u}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import m from\"../../geometry/Extent.js\";import h from\"../../geometry/SpatialReference.js\";import f from\"../FeatureLayer.js\";import g from\"./BuildingSublayer.js\";import{zeroCapabilities as j}from\"../support/capabilities.js\";import{popupEnabled as v}from\"../support/commonProperties.js\";import{defineFieldProperties as b}from\"../support/fieldProperties.js\";import L from\"../support/FieldsIndex.js\";import{unpackFieldNames as S}from\"../support/fieldUtils.js\";import{fetchIndexInfo as I}from\"../support/I3SIndexInfo.js\";import{I3SNodePageDefinition as F,I3SMaterialDefinition as w,I3STextureSetDefinition as x,I3SGeometryDefinition as O}from\"../support/I3SLayerDefinitions.js\";import T from\"../../rest/support/Query.js\";import{createPopupTemplate as q}from\"../../support/popupUtils.js\";import R from\"../../symbols/support/ElevationInfo.js\";import{queryAttributesFromCachedAttributesId as P}from\"../../views/3d/layers/i3s/I3SUtil.js\";import{getRequiredFields as U,getFetchPopupTemplate as D}from\"../../views/layers/support/popupUtils.js\";const Q=\"esri.layers.buildingSublayers.BuildingComponentSublayer\",E=p.getLogger(Q),A=b();let _=class extends(n.LoadableMixin(l(g))){constructor(e){super(e),this.type=\"building-component\",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode=\"show\",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType=\"3d-object\"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:\"\"}}get fieldsIndex(){return new L(this.fields)}readAssociatedLayer(e,r){const t=this.layer.associatedFeatureServiceItem,o=r.associatedLayerID;return null!=t&&\"number\"==typeof o?new f({portalItem:t,layerId:o}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if(\"oid\"===e.type)return e.name;return null}get displayField(){return null!=this.associatedLayer?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=null!=e?e.signal:null,t=this._fetchService(r).then((()=>{this.indexInfo=I(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,E,r)}));return this.addResolvingPromise(t),Promise.resolve(this)}createPopupTemplate(e){return q(this,e)}async _fetchService(e){const r=(await s(this.parsedUrl.path,{query:{f:\"json\",token:this.apiKey},responseType:\"json\",signal:e})).data;this.read(r,{origin:\"service\",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){const t=this.getFeatureType(r?.feature)?.domains?.[e];return t&&\"inherited\"!==t.type?t:this.getField(e)?.domain??null}getFeatureType(e){return e&&null!=this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return null!=this.associatedLayer?this.associatedLayer.types??[]:[]}get typeIdField(){return null!=this.associatedLayer?this.associatedLayer.typeIdField:null}get geometryType(){return\"3d-object\"===this.layerType?\"mesh\":\"point\"}get profile(){return\"3d-object\"===this.layerType?\"mesh-pyramids\":\"points\"}get capabilities(){const e=null!=this.associatedLayer&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:j,{query:r,data:{supportsZ:t,supportsM:o,isVersioned:s}}=e;return{query:r,data:{supportsZ:t,supportsM:o,isVersioned:s}}}createQuery(){const e=new T;return\"mesh\"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||\"1=1\",e.sqlFormat=\"standard\",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryExtent(e||this.createQuery(),r)))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryFeatureCount(e||this.createQuery(),r)))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryFeatures(e||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=this.layer,r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then((t=>t.queryObjectIds(e||this.createQuery(),r)))}async queryCachedAttributes(e,r){const t=S(this.fieldsIndex,await U(this,D(this)));return P(this.parsedUrl.path,this.attributeStorageInfo,e,r,t)}async queryCachedFeature(e,t){const o=await this.queryCachedAttributes(e,[t]);if(!o||0===o.length)throw new i(\"scenelayer:feature-not-in-cached-data\",\"Feature not found in cached data\");const s=new r;return s.attributes=o[0],s.layer=this,s.sourceLayer=this,s}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:null!=this.associatedLayer}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return null!=e&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),null==this.associatedLayer)throw new i(\"buildingscenelayer:query-not-available\",\"BuildingSceneLayer component layer queries are not available without an associated feature layer\",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new i(\"buildingscenelayer:query-not-available\",\"BuildingSceneLayer associated feature layer could not be loaded\",{layer:this,error:e})}return this.associatedLayer}};e([d({readOnly:!0})],_.prototype,\"parsedUrl\",null),e([d({type:F,readOnly:!0})],_.prototype,\"nodePages\",void 0),e([d({type:[w],readOnly:!0})],_.prototype,\"materialDefinitions\",void 0),e([d({type:[x],readOnly:!0})],_.prototype,\"textureSetDefinitions\",void 0),e([d({type:[O],readOnly:!0})],_.prototype,\"geometryDefinitions\",void 0),e([d({readOnly:!0})],_.prototype,\"serviceUpdateTimeStamp\",void 0),e([d({readOnly:!0})],_.prototype,\"store\",void 0),e([d({type:String,readOnly:!0,json:{read:{source:\"store.rootNode\"}}})],_.prototype,\"rootNode\",void 0),e([d({readOnly:!0})],_.prototype,\"attributeStorageInfo\",void 0),e([d(A.fields)],_.prototype,\"fields\",void 0),e([d({readOnly:!0})],_.prototype,\"fieldsIndex\",null),e([d({readOnly:!0,type:f})],_.prototype,\"associatedLayer\",void 0),e([u(\"service\",\"associatedLayer\",[\"associatedLayerID\"])],_.prototype,\"readAssociatedLayer\",null),e([d(A.outFields)],_.prototype,\"outFields\",void 0),e([d({type:String,readOnly:!0})],_.prototype,\"objectIdField\",null),e([d({readOnly:!0,type:String,json:{read:!1}})],_.prototype,\"displayField\",null),e([d({readOnly:!0,type:String})],_.prototype,\"apiKey\",null),e([d({readOnly:!0,type:m})],_.prototype,\"fullExtent\",null),e([d({readOnly:!0,type:h})],_.prototype,\"spatialReference\",null),e([d({readOnly:!0})],_.prototype,\"version\",null),e([d({readOnly:!0,type:R})],_.prototype,\"elevationInfo\",null),e([d({readOnly:!0,type:Number})],_.prototype,\"minScale\",null),e([d({readOnly:!0,type:Number})],_.prototype,\"maxScale\",null),e([d({readOnly:!0,type:Number})],_.prototype,\"effectiveScaleRange\",null),e([d({type:[\"hide\",\"show\"],json:{write:!0}})],_.prototype,\"listMode\",void 0),e([d({types:o,json:{origins:{service:{read:{source:\"drawingInfo.renderer\"}}},name:\"layerDefinition.drawingInfo.renderer\",write:!0},value:null})],_.prototype,\"renderer\",void 0),e([d({type:String,json:{origins:{service:{read:!1,write:!1}},name:\"layerDefinition.definitionExpression\",write:{enabled:!0,allowNull:!0}}})],_.prototype,\"definitionExpression\",void 0),e([d(v)],_.prototype,\"popupEnabled\",void 0),e([d({type:t,json:{read:{source:\"popupInfo\"},write:{target:\"popupInfo\"}}})],_.prototype,\"popupTemplate\",void 0),e([d({readOnly:!0,type:String,json:{origins:{service:{read:{source:\"store.normalReferenceFrame\"}}},read:!1}})],_.prototype,\"normalReferenceFrame\",void 0),e([d({readOnly:!0,json:{read:!1}})],_.prototype,\"defaultPopupTemplate\",null),e([d()],_.prototype,\"types\",null),e([d()],_.prototype,\"typeIdField\",null),e([d({json:{write:!1}}),y(new a({\"3DObject\":\"3d-object\",Point:\"point\"}))],_.prototype,\"layerType\",void 0),e([d()],_.prototype,\"geometryType\",null),e([d()],_.prototype,\"profile\",null),e([d({readOnly:!0,json:{read:!1}})],_.prototype,\"capabilities\",null),_=e([c(Q)],_);const C=_;export{C as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import e from\"../../core/Collection.js\";import{loadAllChildren as o}from\"../../core/loadAll.js\";import s from\"../../core/Warning.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import n from\"./BuildingComponentSublayer.js\";import u from\"./BuildingSublayer.js\";var a;const l={type:e,readOnly:!0,json:{origins:{service:{read:{source:\"sublayers\",reader:p}}},read:!1}};function p(r,o,t){if(r&&Array.isArray(r))return new e(r.map((r=>{const e=y(r);if(e){const o=new e;return o.read(r,t),o}return t?.messages&&r&&t.messages.push(new s(\"building-scene-layer:unsupported-sublayer-type\",\"Building scene sublayer of type '\"+(r.type||\"unknown\")+\"' are not supported\",{definition:r,context:t})),null})))}let c=a=class extends u{constructor(r){super(r),this.type=\"building-group\",this.listMode=\"show\",this.sublayers=null}loadAll(){return o(this,(r=>a.forEachSublayer(this.sublayers,(e=>{\"building-group\"!==e.type&&r(e)}))))}};function y(r){return\"group\"===r.layerType?c:n}r([t({type:[\"hide\",\"show\",\"hide-children\"],json:{write:!0}})],c.prototype,\"listMode\",void 0),r([t(l)],c.prototype,\"sublayers\",void 0),c=a=r([i(\"esri.layers.buildingSublayers.BuildingGroupSublayer\")],c),function(r){function e(r,o){r.forEach((r=>{o(r),\"building-group\"===r.type&&e(r.sublayers,o)}))}r.sublayersProperty=l,r.readSublayers=p,r.forEachSublayer=e}(c||(c={}));const d=c;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet n=null;function t(t){n=t}function u(){return n}export{u as getLoader,t as registerLoader};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{result as e}from\"../../core/asyncUtils.js\";import r from\"../../core/Error.js\";import{allSettledErrors as o,throwIfAborted as t,eachAlways as s}from\"../../core/promiseUtils.js\";import{generateUUID as a}from\"../../core/uuid.js\";import{getSiblingOfSameTypeI as c,contentToBlob as n}from\"../../portal/support/resourceUtils.js\";async function u(e,r,o=null){const t=await i(e,r,o);await h(t,r,o)}async function p(e,r,o,t,s=null){const a=await i(o,t,s);await e.update({data:r}),await h(a,t,s)}async function i(e,s,n=null){if(!s?.resources)return;const u=s.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=s.portalItem;const p=new Set(s.resources.toKeep.map((e=>e.resource.path))),i=new Set,h=[];p.forEach((r=>{u.delete(r),e.paths.push(r)}));for(const r of s.resources.toUpdate)if(u.delete(r.resource.path),p.has(r.resource.path)||i.has(r.resource.path)){const{resource:o,content:t,finish:s,error:u}=r,p=c(o,a());e.paths.push(p.path),h.push(f({resource:p,content:t,compress:r.compress,finish:s,error:u},n))}else e.paths.push(r.resource.path),h.push(l(r,n)),i.add(r.resource.path);for(const r of s.resources.toAdd)e.paths.push(r.resource.path),u.has(r.resource.path)?u.delete(r.resource.path):h.push(f(r,n));if(0===h.length)return u;const m=await o(h);if(t(n),m.length>0)throw new r(\"save:resources\",\"Failed to save one or more resources\",{errors:m});return u}async function h(e,r,o=null){if(!e||!r.portalItem)return;const t=[];for(const s of e){const e=r.portalItem.resourceFromPath(s);t.push(e.portalItem.removeResource(e,o))}await s(t)}async function f(r,o){const t={...null!=o?o:{},compress:r.compress},s=await e(r.resource.portalItem.addResource(r.resource,await n(r.content),t));if(!0!==s.ok)throw r.error?.(s.error),s.error;r.finish?.(r.resource)}async function l(r,o){const t=await e(r.resource.update(await n(r.content),o));if(!0!==t.ok)throw r.error?.(t.error),t.error;r.finish?.(r.resource)}async function m(e){const r=[];for(const o of e.allLayers)if(\"beforeSave\"in o&&\"function\"==typeof o.beforeSave){const e=o.beforeSave();e&&r.push(e)}await Promise.allSettled(r)}export{m as beforeSave,u as saveResources,p as updateItemWithResources};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../request.js\";import r from\"../../core/Error.js\";import o from\"../../core/Logger.js\";import{debounce as i}from\"../../core/promiseUtils.js\";import{urlToObject as s}from\"../../core/urlUtils.js\";import{property as a}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as n}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as l}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as p}from\"../../core/accessorSupport/decorators/writer.js\";import{updateOrigins as c}from\"../../core/accessorSupport/originUtils.js\";import d from\"../../geometry/Extent.js\";import u from\"../../geometry/HeightModelInfo.js\";import m from\"../../geometry/SpatialReference.js\";import{titleFromUrlAndName as h,parse as y,cleanTitle as f,sanitizeUrlWithLayerId as v,writeUrlWithLayerId as S}from\"../support/arcgisLayerUrl.js\";import{id as g,url as w}from\"../support/commonProperties.js\";import{fetchIndexInfo as I}from\"../support/I3SIndexInfo.js\";import{getLoader as x}from\"../support/schemaValidatorLoader.js\";import b from\"../../portal/Portal.js\";import j from\"../../portal/PortalItem.js\";import{validateSaveAPIKey as _}from\"../../webdoc/saveAPIKeyUtils.js\";import{saveResources as R,updateItemWithResources as A}from\"../../webdoc/support/saveUtils.js\";const N=\"esri.layers.mixins.SceneService\",U=o.getLogger(N),E=o=>{let E=class extends o{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:\"\"},this.copyright=null,this.sublayerTitleMode=\"item-title\",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=i((async(e,t,r)=>{switch(e){case P.SAVE:return this._save(t);case P.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return m.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.substring(r.lastIndexOf(\"/\")+1,r.length),10);return null!=o?new m(o):null}}readFullExtent(e,t,r){if(null!=e&&\"object\"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return d.fromJSON(o,r)}const o=t.store,i=this._readSpatialReference(t);return null==i||null==o?.extent||!Array.isArray(o.extent)||o.extent.some((e=>e=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():\"\";return this.parseVersionString(o)}readTitlePortalItem(e){return\"item-title\"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if(\"item-title\"===this.sublayerTitleMode)return h(this.url,t.name);let o=t.name;if(!o&&this.url){const e=y(this.url);null!=e&&(o=e.title)}return\"item-title-and-service-name\"===this.sublayerTitleMode&&r&&(o=r+\" - \"+o),f(o)}set url(e){const t=v({layer:this,url:e,nonStandardUrlAllowed:!1,logger:U});this._set(\"url\",t.url),null!=t.layerId&&this._set(\"layerId\",t.layerId)}writeUrl(e,t,r,o){S(this,e,\"layers\",t,o)}get parsedUrl(){const e=this._get(\"url\"),t=s(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=I(this.parsedUrl.path,this.rootNode,e,this.apiKey,U,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if(\"page\"===e?.type){const t=e.rootIndex%e.pageSize,o=e.rootPage?.nodes?.[t];if(null==o?.obb?.center||null==o.obb.halfSize)throw new r(\"sceneservice:invalid-node-page\",\"Invalid node page.\");if(o.obb.center[0]0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??\"\",{query:{f:\"json\",token:this.apiKey},responseType:\"json\",signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,\"https:\"));let o=!1;if(r.data.layerType&&\"Voxel\"===r.data.layerType&&(o=!0),o)return this._fetchVoxelServiceLayer();const i=r.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+\"/layer\",{query:{f:\"json\",token:this.apiKey},responseType:\"json\",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:\"service\",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),\"beforeSave\"in this&&\"function\"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const i of o)e.typeKeywords.push(i);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===O.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>\"Hosted Service\"!==e))))}async _saveAs(e,t){const o={...L,...t};let i=j.from(e);if(!i)throw new r(\"sceneservice:portal-item-required\",\"_saveAs() requires a portal item to save to\");_(i),i.id&&(i=i.clone(),i.id=null);const s=i.portal||b.getDefault();await this._ensureLoadBeforeSave(),i.type=K,i.portal=s;const a={origin:\"portal-item\",url:null,messages:[],portal:s,portalItem:i,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},n={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(n,a,o),i.url=this.url,i.title||(i.title=this.title),this._updateTypeKeywords(i,o,O.newItem),await s.signIn(),await(s.user?.addItem({item:i,folder:o?.folder,data:n})),await R(this.resourceReferences,a,null),this.portalItem=i,c(a),a.portalItem=i,i}async _save(e){const t={...L,...e};if(!this.portalItem)throw new r(\"sceneservice:portal-item-not-set\",\"Portal item to save to has not been set on this SceneService\");if(_(this.portalItem),this.portalItem.type!==K)throw new r(\"sceneservice:portal-item-wrong-type\",`Portal item needs to have type \"${K}\"`);await this._ensureLoadBeforeSave();const o={origin:\"portal-item\",url:this.portalItem.itemUrl&&s(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||b.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},i={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,o,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,O.existingItem),await A(this.portalItem,i,this.resourceReferences,o,null),c(o),this.portalItem}async _validateAgainstJSONSchema(e,t,o){let i=t.messages?.filter((e=>\"error\"===e.type)).map((e=>new r(e.name,e.message,e.details)))??[];o?.validationOptions?.ignoreUnsupported&&(i=i.filter((e=>\"layer:unsupported\"!==e.name&&\"symbol:unsupported\"!==e.name&&\"symbol-layer:unsupported\"!==e.name&&\"property:unsupported\"!==e.name&&\"url:unsupported\"!==e.name&&\"scenemodification:unsupported\"!==e.name)));const s=o?.validationOptions,a=s?.enabled,n=x();if(a&&n){const t=(await n()).validate(e,o.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\\n${t.join(\"\\n\")}`;if(U.error(`_validateAgainstJSONSchema(): ${e}`),\"throw\"===s.failPolicy){const e=t.map((e=>new r(\"sceneservice:schema-validation\",e))).concat(i);throw new r(\"sceneservice-validate:error\",\"Failed to save layer item due to schema validation, see `details.errors`.\",{combined:e})}}}if(i.length>0)throw new r(\"sceneservice:save\",\"Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information\",{errors:i})}};return e([a(g)],E.prototype,\"id\",void 0),e([a({type:m})],E.prototype,\"spatialReference\",void 0),e([n(\"spatialReference\",[\"spatialReference\",\"store.indexCRS\",\"store.geographicCRS\"])],E.prototype,\"readSpatialReference\",null),e([a({type:d})],E.prototype,\"fullExtent\",void 0),e([n(\"fullExtent\",[\"fullExtent\",\"store.extent\",\"spatialReference\",\"store.indexCRS\",\"store.geographicCRS\"])],E.prototype,\"readFullExtent\",null),e([a({readOnly:!0,type:u})],E.prototype,\"heightModelInfo\",void 0),e([a({type:Number,json:{name:\"layerDefinition.minScale\",write:!0,origins:{service:{read:{source:\"minScale\"},write:!1}}}})],E.prototype,\"minScale\",void 0),e([a({type:Number,json:{name:\"layerDefinition.maxScale\",write:!0,origins:{service:{read:{source:\"maxScale\"},write:!1}}}})],E.prototype,\"maxScale\",void 0),e([a({readOnly:!0})],E.prototype,\"version\",void 0),e([n(\"version\",[\"store.version\"])],E.prototype,\"readVersion\",null),e([a({type:String,json:{read:{source:\"copyrightText\"}}})],E.prototype,\"copyright\",void 0),e([a({type:String,json:{read:!1}})],E.prototype,\"sublayerTitleMode\",void 0),e([a({type:String})],E.prototype,\"title\",void 0),e([n(\"portal-item\",\"title\")],E.prototype,\"readTitlePortalItem\",null),e([n(\"service\",\"title\",[\"name\"])],E.prototype,\"readTitleService\",null),e([a({type:Number,json:{origins:{service:{read:{source:\"id\"}},\"portal-item\":{write:{target:\"id\",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],E.prototype,\"layerId\",void 0),e([a(w)],E.prototype,\"url\",null),e([p(\"url\")],E.prototype,\"writeUrl\",null),e([a()],E.prototype,\"parsedUrl\",null),e([a({readOnly:!0})],E.prototype,\"store\",void 0),e([a({type:String,readOnly:!0,json:{read:{source:\"store.rootNode\"}}})],E.prototype,\"rootNode\",void 0),E=e([l(N)],E),E},T=-1e38;var O;!function(e){e[e.existingItem=0]=\"existingItem\",e[e.newItem=1]=\"newItem\"}(O||(O={}));const K=\"Scene Service\",L={getTypeKeywords:()=>[],portalItemLayerType:\"unknown\",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:\"throw\"}};var P;!function(e){e[e.SAVE=0]=\"SAVE\",e[e.SAVE_AS=1]=\"SAVE_AS\"}(P||(P={}));export{P as SaveOperationType,E as SceneService,K as sceneServiceItemType};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";let e=class extends o{constructor(){super(...arguments),this.type=null}};r([s({type:String,readOnly:!0,json:{write:!0}})],e.prototype,\"type\",void 0),e=r([t(\"esri.layers.support.BuildingFilterAuthoringInfo\")],e);const p=e;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{clone as t}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";var p;let i=p=class extends e{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new p({filterType:this.filterType,filterValues:t(this.filterValues)})}};r([o({type:String,json:{write:!0}})],i.prototype,\"filterType\",void 0),r([o({type:[String],json:{write:!0}})],i.prototype,\"filterValues\",void 0),i=p=r([s(\"esri.layers.support.BuildingFilterAuthoringInfoType\")],i);const l=i;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Collection.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{clone as s}from\"../../core/lang.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"./BuildingFilterAuthoringInfoType.js\";var c;const l=o.ofType(i);let n=c=class extends e{clone(){return new c({filterTypes:s(this.filterTypes)})}};r([t({type:l,json:{write:!0}})],n.prototype,\"filterTypes\",void 0),n=c=r([p(\"esri.layers.support.BuildingFilterAuthoringInfoBlock\")],n);const m=n;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../core/Collection.js\";import{clone as t}from\"../../core/lang.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import c from\"./BuildingFilterAuthoringInfo.js\";import i from\"./BuildingFilterAuthoringInfoBlock.js\";var p;const l=r.ofType(i);let n=p=class extends c{constructor(){super(...arguments),this.type=\"checkbox\"}clone(){return new p({filterBlocks:t(this.filterBlocks)})}};o([e({type:[\"checkbox\"]})],n.prototype,\"type\",void 0),o([e({type:l,json:{write:!0}})],n.prototype,\"filterBlocks\",void 0),n=p=o([s(\"esri.layers.support.BuildingFilterAuthoringInfoCheckbox\")],n);const u=n;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{};r([s({readOnly:!0,json:{read:!1}})],t.prototype,\"type\",void 0),t=r([e(\"esri.layers.support.BuildingFilterMode\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./BuildingFilterMode.js\";var t;let p=t=class extends e{constructor(){super(...arguments),this.type=\"solid\"}clone(){return new t}};r([o({type:[\"solid\"],readOnly:!0,json:{write:!0}})],p.prototype,\"type\",void 0),p=t=r([s(\"esri.layers.support.BuildingFilterModeSolid\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{clone as e}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{enumeration as s}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./BuildingFilterMode.js\";import{symbol3dEdgesProperty as i}from\"../../symbols/edges/utils.js\";var c;let m=c=class extends p{constructor(){super(...arguments),this.type=\"wire-frame\",this.edges=null}clone(){return new c({edges:e(this.edges)})}};r([s({wireFrame:\"wire-frame\"})],m.prototype,\"type\",void 0),r([o(i)],m.prototype,\"edges\",void 0),m=c=r([t(\"esri.layers.support.BuildingFilterModeWireFrame\")],m);const a=m;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./BuildingFilterMode.js\";var t;let p=t=class extends e{constructor(){super(...arguments),this.type=\"x-ray\"}clone(){return new t}};r([o({type:[\"x-ray\"],readOnly:!0,json:{write:!0}})],p.prototype,\"type\",void 0),p=t=r([s(\"esri.layers.support.BuildingFilterModeXRay\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as t}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./BuildingFilterMode.js\";import l from\"./BuildingFilterModeSolid.js\";import p from\"./BuildingFilterModeWireFrame.js\";import n from\"./BuildingFilterModeXRay.js\";var d;const a={nonNullable:!0,types:{key:\"type\",base:s,typeMap:{solid:l,\"wire-frame\":p,\"x-ray\":n}},json:{read:e=>{switch(e?.type){case\"solid\":return l.fromJSON(e);case\"wireFrame\":return p.fromJSON(e);case\"x-ray\":return n.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let u=d=class extends r{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new l,this.title=\"\"}clone(){return new d({filterExpression:this.filterExpression,filterMode:t(this.filterMode),title:this.title})}};e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,\"filterExpression\",void 0),e([o(a)],u.prototype,\"filterMode\",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,\"title\",void 0),u=d=e([i(\"esri.layers.support.BuildingFilterBlock\")],u);const c=u;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../core/Collection.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{clone as e}from\"../../core/lang.js\";import{generateUUID as i}from\"../../core/uuid.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as n}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./BuildingFilterAuthoringInfo.js\";import l from\"./BuildingFilterAuthoringInfoCheckbox.js\";import c from\"./BuildingFilterBlock.js\";var u;const d=r.ofType(c);let m=u=class extends t{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=i(),this.name=null}clone(){return new u({description:this.description,filterBlocks:e(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:e(this.filterAuthoringInfo)})}};o([s({type:String,json:{write:!0}})],m.prototype,\"description\",void 0),o([s({type:d,json:{write:{enabled:!0,isRequired:!0}}})],m.prototype,\"filterBlocks\",void 0),o([s({types:{key:\"type\",base:p,typeMap:{checkbox:l}},json:{read:o=>\"checkbox\"===o?.type?l.fromJSON(o):null,write:!0}})],m.prototype,\"filterAuthoringInfo\",void 0),o([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],m.prototype,\"id\",void 0),o([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],m.prototype,\"name\",void 0),m=u=o([n(\"esri.layers.support.BuildingFilter\")],m);const f=m;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import r from\"../../request.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import s from\"../../core/Loadable.js\";import o from\"../../core/Logger.js\";import{EsriPromiseMixin as i}from\"../../core/Promise.js\";import{property as l}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as a}from\"../../core/accessorSupport/decorators/subclass.js\";let p=class extends t{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};e([l({type:String})],p.prototype,\"fieldName\",void 0),e([l({type:String})],p.prototype,\"modelName\",void 0),e([l({type:String})],p.prototype,\"label\",void 0),e([l({type:Number})],p.prototype,\"min\",void 0),e([l({type:Number})],p.prototype,\"max\",void 0),e([l({json:{read:e=>Array.isArray(e)&&(e.every((e=>\"string\"==typeof e))||e.every((e=>\"number\"==typeof e)))?e.slice():null}})],p.prototype,\"mostFrequentValues\",void 0),e([l({type:[Number]})],p.prototype,\"subLayerIds\",void 0),p=e([a(\"esri.layers.support.BuildingFieldStatistics\")],p);let n=class extends(s.LoadableMixin(i(t))){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||\"loading\"===this.loadStatus?this._get(\"fields\"):(o.getLogger(this).error(\"building summary statistics are not loaded\"),null)}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const t=(await r(this.url,{query:{f:\"json\"},responseType:\"json\",signal:e})).data;this.read(t,{origin:\"service\"})}};e([l({constructOnly:!0,type:String})],n.prototype,\"url\",void 0),e([l({readOnly:!0,type:[p],json:{read:{source:\"summary\"}}})],n.prototype,\"fields\",null),n=e([a(\"esri.layers.support.BuildingSummaryStatistics\")],n);const u=n;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getMetersPerUnit as e}from\"../symbols/support/unitConversionUtils.js\";function n(e){return e?y:Z}function t(e,t){return t?.mode?t.mode:n(e).mode}function o(e,t){return null!=t?t:n(e)}function r(e,n){return t(null!=e&&e.hasZ,n)}function u(e,n){return o(null!=e&&!!e.hasZ,n)}function l(e){const n=a(e);return r(e.geometry,n)}function s(n){const t=a(n),o=r(n.geometry,t);return{mode:o,offset:null!=t&&\"on-the-ground\"!==o?(t.offset??0)*e(t.unit??\"meters\"):0}}function i(e){if(\"on-the-ground\"===l(e))return!1;const n=a(e),t=n?.featureExpressionInfo?n.featureExpressionInfo.expression:null;return!(!t||\"0\"===t)}function a(e){return e.layer&&\"elevationInfo\"in e.layer?e.layer.elevationInfo:null}function f(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=null!=t.offset?t.offset:0;switch(t.mode){case\"absolute-height\":return o-r;case\"on-the-ground\":return 0;case\"relative-to-ground\":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,\"ground\")??0)+r);case\"relative-to-scene\":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,\"scene\")??0)+r)}}function c(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function d(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,u,l=null){if(null==u)return;const s=null!=l?l.mode:\"absolute-height\";if(\"on-the-ground\"===s)return 0;const{absoluteZ:i}=g(n,t,o,r,e,u);return h(i,n,t,o,r,e,l,s)}function g(e,n,t,o,r,u){const l=null!=u.offset?u.offset:0;switch(u.mode){case\"absolute-height\":return{absoluteZ:t+l,elevation:0};case\"on-the-ground\":{const t=r.elevationProvider.getElevation(e,n,0,o,\"ground\")??0;return{absoluteZ:t,elevation:t}}case\"relative-to-ground\":{const u=r.elevationProvider.getElevation(e,n,t,o,\"ground\")??0;return{absoluteZ:t+u+l,elevation:u}}case\"relative-to-scene\":{const u=r.elevationProvider.getElevation(e,n,t,o,\"scene\")??0;return{absoluteZ:t+u+l,elevation:u}}}}function h(e,n,t,o,r,u,l,s){const i=null!=l?.offset?l.offset:0;switch(s){case\"absolute-height\":return e-i;case\"relative-to-ground\":return e-((u.elevationProvider.getElevation(n,t,o,r,\"ground\")??0)+i);case\"relative-to-scene\":return e-((u.elevationProvider.getElevation(n,t,o,r,\"scene\")??0)+i)}}function m(e,n){if(null==n)return!1;const{mode:t}=n;return null!=t&&(\"scene\"===e&&\"relative-to-scene\"===t||\"ground\"===e&&\"absolute-height\"!==t)}function p(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function b(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function E(e,n){return null!=n?.featureExpressionInfo&&\"0\"!==n.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function x(e,n){n&&e.warn(\".elevationInfo=\",n)}const y={mode:\"absolute-height\",offset:0},Z={mode:\"on-the-ground\",offset:null};function I(e,n){return e===n||null!=e&&null!=n&&e.mode===n.mode&&e.offset===n.offset}export{y as absoluteHeightElevationInfo,m as elevationContextAffectsAlignment,I as elevationInfoLikeEquals,p as elevationModeRequiredMessage,b as elevationModeUnsupportedMessage,E as featureExpressionUnsupportedMessage,c as getConvertedElevation,d as getConvertedElevationFromVector,o as getEffectiveElevationInfo,t as getEffectiveElevationMode,u as getGeometryEffectiveElevationInfo,r as getGeometryEffectiveElevationMode,s as getGraphicEffectiveElevationInfo,l as getGraphicEffectiveElevationMode,f as getZForElevationMode,i as hasGraphicFeatureExpressionInfo,x as logInvalidElevationInfoWarning,Z as onTheGroundElevationInfo,g as zValueInAbsoluteHeightMode};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Collection.js\";import t from\"../core/CollectionFlattener.js\";import s from\"../core/Error.js\";import{clone as i}from\"../core/lang.js\";import{loadAll as o}from\"../core/loadAll.js\";import a from\"../core/Logger.js\";import{MultiOriginJSONMixin as l}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as n}from\"../core/promiseUtils.js\";import{join as p}from\"../core/urlUtils.js\";import{property as y}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{reader as u}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as d}from\"../core/accessorSupport/decorators/subclass.js\";import c from\"../geometry/SpatialReference.js\";import m from\"./Layer.js\";import h from\"./buildingSublayers/BuildingComponentSublayer.js\";import b from\"./buildingSublayers/BuildingGroupSublayer.js\";import{APIKeyMixin as v}from\"./mixins/APIKeyMixin.js\";import{ArcGISService as f}from\"./mixins/ArcGISService.js\";import{OperationalLayer as g}from\"./mixins/OperationalLayer.js\";import{PortalLayer as S}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as j}from\"./mixins/ScaleRangeLayer.js\";import{SceneService as w,SaveOperationType as O}from\"./mixins/SceneService.js\";import{findAssociatedFeatureService as I}from\"./support/associatedFeatureServiceUtils.js\";import _ from\"./support/BuildingFilter.js\";import L from\"./support/BuildingSummaryStatistics.js\";import{sceneLayerFullExtent as T,legendEnabled as A,readOnlyService as E,elevationInfo as F}from\"./support/commonProperties.js\";import{logInvalidElevationInfoWarning as x,elevationModeRequiredMessage as B,featureExpressionUnsupportedMessage as P}from\"../support/elevationInfoUtils.js\";const K=r.ofType(_),R=i(b.sublayersProperty),U=R.json?.origins;U&&(U[\"web-scene\"]={type:[h],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},U[\"portal-item\"]={type:[h],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let C=class extends(w(f(g(S(j(l(v(m)))))))){constructor(e){super(e),this.operationalLayerType=\"BuildingSceneLayer\",this.allSublayers=new t({getCollections:()=>[this.sublayers],getChildrenFunction:e=>\"building-group\"===e.type?e.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new K,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type=\"building-scene\"}normalizeCtorArgs(e){return\"string\"==typeof e?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,t){const s=b.readSublayers(e,r,t);return b.forEachSublayer(s,(e=>e.layer=this)),this._sublayerOverrides&&(this.applySublayerOverrides(s,this._sublayerOverrides),this._sublayerOverrides=null),s}applySublayerOverrides(e,{overrides:r,context:t}){b.forEachSublayer(e,(e=>e.read(r.get(e.id),t)))}readSublayerOverrides(e,r){const t=new Map;for(const i of e)null!=i&&\"object\"==typeof i&&\"number\"==typeof i.id?t.set(i.id,i):r.messages?.push(new s(\"building-scene-layer:invalid-sublayer-override\",\"Invalid value for sublayer override. Not an object or no id specified.\",{value:i}));return{overrides:t,context:r}}writeSublayerOverrides(e,r,t){const s=[];b.forEachSublayer(this.sublayers,(e=>{const r=e.write({},t);Object.keys(r).length>1&&s.push(r)})),s.length>0&&(r.sublayers=s)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach((e=>{r.sublayers.push(i(e))}))}write(e,r){return e=super.write(e,r),!r||\"web-scene\"!==r.origin&&\"portal-item\"!==r.origin||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(\"web-scene\"===r.origin||\"portal-item\"===r.origin)&&null!=e&&Array.isArray(e.sublayers)){const t=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,t):this._sublayerOverrides=t}}readSummaryStatistics(e,r){if(\"string\"==typeof r.statisticsHRef){const e=p(this.parsedUrl?.path,r.statisticsHRef);return new L({url:e})}return null}set elevationInfo(e){this._set(\"elevationInfo\",e),this._validateElevationInfo()}load(e){const r=null!=e?e.signal:null,t=this.loadFromPortal({supportedTypes:[\"Scene Service\"]},e).catch(n).then((()=>this._fetchService(r))).then((()=>this._fetchAssociatedFeatureService(r)));return this.addResolvingPromise(t),Promise.resolve(this)}loadAll(){return o(this,(e=>{b.forEachSublayer(this.sublayers,(r=>{\"building-group\"!==r.type&&e(r)})),this.summaryStatistics&&e(this.summaryStatistics)}))}async saveAs(e,r){return this._debouncedSaveOperations(O.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"building-scene\"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"building-scene\"};return this._debouncedSaveOperations(O.SAVE,e)}validateLayer(e){if(!e.layerType||\"Building\"!==e.layerType)throw new s(\"buildingscenelayer:layer-type-not-supported\",\"BuildingSceneLayer does not support this layer type\",{layerType:e.layerType})}_getTypeKeywords(){return[\"Building\"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await I(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){a.getLogger(this).warn(\"Associated feature service item could not be loaded\",r)}}_validateElevationInfo(){const e=this.elevationInfo,r=\"Building scene layers\";x(a.getLogger(this),B(r,\"absolute-height\",e)),x(a.getLogger(this),P(r,e))}};e([y({type:[\"BuildingSceneLayer\"]})],C.prototype,\"operationalLayerType\",void 0),e([y({readOnly:!0})],C.prototype,\"allSublayers\",void 0),e([y(R)],C.prototype,\"sublayers\",void 0),e([u(\"service\",\"sublayers\")],C.prototype,\"readSublayers\",null),e([y({type:K,nonNullable:!0,json:{write:!0}})],C.prototype,\"filters\",void 0),e([y({type:String,json:{write:!0}})],C.prototype,\"activeFilterId\",void 0),e([y({readOnly:!0,type:L})],C.prototype,\"summaryStatistics\",void 0),e([u(\"summaryStatistics\",[\"statisticsHRef\"])],C.prototype,\"readSummaryStatistics\",null),e([y({type:[String],json:{read:!1}})],C.prototype,\"outFields\",void 0),e([y(T)],C.prototype,\"fullExtent\",void 0),e([y(A)],C.prototype,\"legendEnabled\",void 0),e([y({type:[\"show\",\"hide\",\"hide-children\"]})],C.prototype,\"listMode\",void 0),e([y(E(c))],C.prototype,\"spatialReference\",void 0),e([y(F)],C.prototype,\"elevationInfo\",null),e([y({json:{read:!1},readOnly:!0})],C.prototype,\"type\",void 0),e([y()],C.prototype,\"associatedFeatureServiceItem\",void 0),C=e([d(\"esri.layers.BuildingSceneLayer\")],C);const M=C;export{M as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import has from\"../../../core/has.js\";import e from\"../../../core/Loadable.js\";import{debounce as o}from\"../../../core/promiseUtils.js\";import{open as r}from\"../../../core/workers/workers.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import{subclass as i}from\"../../../core/accessorSupport/decorators/subclass.js\";import n from\"../../../rest/support/FeatureSet.js\";import a from\"../../../geometry/Extent.js\";let c=class extends e{constructor(t){super(t),this.type=\"csv\",this.refresh=o((async t=>{await this.load();const{extent:e,timeExtent:o}=await this._connection.invoke(\"refresh\",t);return e&&(this.sourceJSON.extent=e),o&&(this.sourceJSON.timeInfo.timeExtent=[o.start,o.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}}))}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const o=await this._connection.invoke(\"queryFeatures\",t?t.toJSON():null,e);return n.fromJSON(o)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke(\"queryFeatures\",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke(\"queryFeatureCount\",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke(\"queryObjectIds\",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const o=await this._connection.invoke(\"queryExtent\",t?t.toJSON():null,e);return{count:o.count,extent:a.fromJSON(o.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke(\"querySnapping\",t,e)}async _startWorker(t){this._connection=await r(\"CSVSourceWorker\",{strategy:has(\"feature-layers-workers\")?\"dedicated\":\"local\",signal:t,registryTarget:this});const{url:e,delimiter:o,fields:s,latitudeField:i,longitudeField:n,spatialReference:a,timeInfo:c}=this.loadOptions,u=await this._connection.invoke(\"load\",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:o,fields:s?.map((t=>t.toJSON())),latitudeField:i,longitudeField:n,spatialReference:a?.toJSON(),timeInfo:c?.toJSON()}},{signal:t});this.locationInfo=u.locationInfo,this.sourceJSON=u.layerDefinition,this.delimiter=u.delimiter}};t([s()],c.prototype,\"type\",void 0),t([s()],c.prototype,\"loadOptions\",void 0),t([s()],c.prototype,\"customParameters\",void 0),t([s()],c.prototype,\"locationInfo\",void 0),t([s()],c.prototype,\"sourceJSON\",void 0),t([s()],c.prototype,\"delimiter\",void 0),c=t([i(\"esri.layers.graphics.sources.CSVSource\")],c);export{c as CSVSource};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../core/Error.js\";import{throwIfAbortError as r}from\"../core/promiseUtils.js\";import{urlToObject as i}from\"../core/urlUtils.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as s}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as a}from\"../core/accessorSupport/decorators/subclass.js\";import l from\"./FeatureLayer.js\";import{CSVSource as n}from\"./graphics/sources/CSVSource.js\";import{createCapabilities as u}from\"./graphics/sources/support/clientSideDefaults.js\";import d from\"../rest/support/Query.js\";import{r as c,w as p}from\"../chunks/persistableUrlUtils.js\";import y from\"../geometry/SpatialReference.js\";function h(e,r){throw new t(r,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let m=class extends l{constructor(...e){super(...e),this.geometryType=\"point\",this.capabilities=u(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType=\"coordinates\",this.longitudeField=null,this.operationalLayerType=\"CSV\",this.outFields=[\"*\"],this.path=null,this.spatialReference=y.WGS84,this.source=null,this.type=\"csv\"}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:[\"CSV\"],supportsData:!1},e).catch(r).then((async()=>this.initLayerProperties(await this.createGraphicsSource(t))));return this.addResolvingPromise(i),Promise.resolve(this)}get isTable(){return this.loaded&&null==this.geometryType}readWebMapLabelsVisible(e,t){return null!=t.showLabels?t.showLabels:!!t.layerDefinition?.drawingInfo?.labelingInfo}set url(e){if(!e)return void this._set(\"url\",e);const t=i(e);this._set(\"url\",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async createGraphicsSource(e){const t=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set(\"source\",t),await t.load({signal:e}),this.read({locationInfo:t.locationInfo,columnDelimiter:t.delimiter},{origin:\"service\",url:this.parsedUrl}),t}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(d.from(e)||this.createQuery()))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(d.from(e)||this.createQuery())))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(d.from(e)||this.createQuery())))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(d.from(e)||this.createQuery())))}read(e,t){super.read(e,t),t&&\"service\"===t.origin&&this.revert([\"latitudeField\",\"longitudeField\"],\"service\")}write(e,t){return super.write(e,{...t,writeLayerSchema:!0})}clone(){throw new t(\"csv-layer:clone\",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return h(this,\"csv-layer:save\")}async saveAs(e,t){return h(this,\"csv-layer:save-as\")}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:\"service\",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};e([o({readOnly:!0,json:{read:!1,write:!1}})],m.prototype,\"capabilities\",void 0),e([o({type:[\",\",\" \",\";\",\"|\",\"\\t\"],json:{read:{source:\"columnDelimiter\"},write:{target:\"columnDelimiter\",ignoreOrigin:!0}}})],m.prototype,\"delimiter\",void 0),e([o({readOnly:!0,type:Boolean,json:{origins:{\"web-scene\":{read:!1,write:!1}}}})],m.prototype,\"editingEnabled\",void 0),e([o({json:{read:{source:\"layerDefinition.fields\"},write:{target:\"layerDefinition.fields\"}}})],m.prototype,\"fields\",void 0),e([o({type:Boolean,readOnly:!0})],m.prototype,\"isTable\",null),e([s(\"web-map\",\"labelsVisible\",[\"layerDefinition.drawingInfo.labelingInfo\",\"showLabels\"])],m.prototype,\"readWebMapLabelsVisible\",null),e([o({type:String,json:{read:{source:\"locationInfo.latitudeFieldName\"},write:{target:\"locationInfo.latitudeFieldName\",ignoreOrigin:!0}}})],m.prototype,\"latitudeField\",void 0),e([o({type:[\"show\",\"hide\"]})],m.prototype,\"listMode\",void 0),e([o({type:[\"coordinates\"],json:{read:{source:\"locationInfo.locationType\"},write:{target:\"locationInfo.locationType\",ignoreOrigin:!0,isRequired:!0}}})],m.prototype,\"locationType\",void 0),e([o({type:String,json:{read:{source:\"locationInfo.longitudeFieldName\"},write:{target:\"locationInfo.longitudeFieldName\",ignoreOrigin:!0}}})],m.prototype,\"longitudeField\",void 0),e([o({type:[\"CSV\"]})],m.prototype,\"operationalLayerType\",void 0),e([o()],m.prototype,\"outFields\",void 0),e([o({type:String,json:{origins:{\"web-scene\":{read:!1,write:!1}},read:!1,write:!1}})],m.prototype,\"path\",void 0),e([o({json:{read:!1},cast:null,type:n,readOnly:!0})],m.prototype,\"source\",void 0),e([o({json:{read:!1},value:\"csv\",readOnly:!0})],m.prototype,\"type\",void 0),e([o({json:{read:c,write:{isRequired:!0,ignoreOrigin:!0,writer:p}}})],m.prototype,\"url\",null),m=e([a(\"esri.layers.CSVLayer\")],m);const f=m;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../core/Accessor.js\";import{isSome as r}from\"../core/arrayUtils.js\";import{ClonableMixin as s}from\"../core/Clonable.js\";import{IdentifiableMixin as o}from\"../core/Identifiable.js\";import{JSONSupportMixin as i}from\"../core/JSONSupport.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/has.js\";import{subclass as a}from\"../core/accessorSupport/decorators/subclass.js\";let n=0,l=class extends(i(s(o(t)))){constructor(e){super(e),this.id=`${Date.now().toString(16)}-analysis-${n++}`,this.title=null}get parent(){return this._get(\"parent\")}set parent(e){const t=this.parent;if(null!=t)switch(t.type){case\"line-of-sight\":case\"dimension\":t.releaseAnalysis(this);break;case\"2d\":case\"3d\":t.analyses.includes(this)&&t.analyses.remove(this)}this._set(\"parent\",e)}get isEditable(){return this.requiredPropertiesForEditing.every(r)}};e([p({type:String,constructOnly:!0,clonable:!1})],l.prototype,\"id\",void 0),e([p({type:String})],l.prototype,\"title\",void 0),e([p({constructOnly:!0})],l.prototype,\"type\",void 0),e([p({clonable:!1,value:null})],l.prototype,\"parent\",null),e([p({readOnly:!0})],l.prototype,\"isEditable\",null),e([p({readOnly:!0})],l.prototype,\"requiredPropertiesForEditing\",void 0),l=e([a(\"esri.analysis.Analysis\")],l);const c=l;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import e from\"../Color.js\";import{Clonable as r}from\"../core/Clonable.js\";import{JSONSupportMixin as t}from\"../core/JSONSupport.js\";import{toPt as s,px2pt as i}from\"../core/screenUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import{Integer as l}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";let c=class extends(t(r)){constructor(o){super(o),this.type=\"simple\",this.color=new e(\"black\"),this.lineSize=2,this.fontSize=10,this.textColor=new e(\"black\"),this.textBackgroundColor=new e([255,255,255,.6])}};o([p({type:[\"simple\"],readOnly:!0,json:{write:{isRequired:!0}}})],c.prototype,\"type\",void 0),o([p({type:e,nonNullable:!0,json:{type:[l],write:{isRequired:!0}}})],c.prototype,\"color\",void 0),o([p({type:Number,cast:s,nonNullable:!0,range:{min:i(1)},json:{write:{isRequired:!0}}})],c.prototype,\"lineSize\",void 0),o([p({type:Number,cast:s,nonNullable:!0,json:{write:{isRequired:!0}}})],c.prototype,\"fontSize\",void 0),o([p({type:e,nonNullable:!0,json:{type:[l],write:{isRequired:!0}}})],c.prototype,\"textColor\",void 0),o([p({type:e,nonNullable:!0,json:{type:[l],write:{isRequired:!0}}})],c.prototype,\"textBackgroundColor\",void 0),c=o([n(\"esri.analysis.DimensionSimpleStyle\")],c);const a=c;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar t;!function(t){t.Horizontal=\"horizontal\",t.Vertical=\"vertical\",t.Direct=\"direct\"}(t||(t={}));const r=[t.Horizontal,t.Vertical,t.Direct];export{t as LengthDimensionMeasureType,r as lengthDimensionMeasureType};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import{LengthDimensionMeasureType as t,lengthDimensionMeasureType as e}from\"./dimensionUtils.js\";import{Clonable as r}from\"../core/Clonable.js\";import{cyclicalDegrees as s}from\"../core/Cyclical.js\";import{JSONSupportMixin as i}from\"../core/JSONSupport.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import{cast as n}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import{ensureNumber as a}from\"../core/accessorSupport/ensureType.js\";import c from\"../geometry/Point.js\";let l=class extends(i(r)){constructor(o){super(o),this.type=\"length\",this.startPoint=null,this.endPoint=null,this.measureType=t.Direct,this.offset=0,this.orientation=0}};o([p({type:[\"length\"],json:{write:{isRequired:!0}}})],l.prototype,\"type\",void 0),o([p({type:c,json:{write:!0}})],l.prototype,\"startPoint\",void 0),o([p({type:c,json:{write:!0}})],l.prototype,\"endPoint\",void 0),o([p({type:e,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,\"measureType\",void 0),o([p({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,\"offset\",void 0),o([p({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),n((o=>s.normalize(a(o),0,!0)))],l.prototype,\"orientation\",void 0),l=o([m(\"esri.analysis.LengthDimension\")],l);const u=l;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"./Analysis.js\";import n from\"./DimensionSimpleStyle.js\";import o from\"./LengthDimension.js\";import s from\"../core/Collection.js\";import{referenceSetter as i,castForReferenceSetter as r}from\"../core/collectionUtils.js\";import{watch as l,syncAndInitial as p}from\"../core/reactiveUtils.js\";import{property as u}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import a from\"../geometry/Extent.js\";import{projectOrLoadMany as c}from\"../geometry/projection.js\";const d=s.ofType(o);let y=class extends t{constructor(e){super(e),this.type=\"dimension\",this.style=new n,this.extent=null}initialize(){this.addHandles(l((()=>this._computeExtent()),(e=>{null==e?.pending&&this._set(\"extent\",null!=e?e.extent:null)}),p))}get dimensions(){return this._get(\"dimensions\")||new d}set dimensions(e){this._set(\"dimensions\",i(e,this.dimensions,d))}get spatialReference(){for(const e of this.dimensions){if(null!=e.startPoint)return e.startPoint.spatialReference;if(null!=e.endPoint)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce(((e,t)=>(e.push(t.startPoint,t.endPoint),e)),[])}async waitComputeExtent(){const e=this._computeExtent();return null!=e?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(null==e)return{pending:null,extent:null};const t=[];for(const s of this.dimensions)null!=s.startPoint&&t.push(s.startPoint),null!=s.endPoint&&t.push(s.endPoint);const n=c(t,e);if(null!=n.pending)return{pending:n.pending,extent:null};let o=null;return null!=n.geometries&&(o=n.geometries.reduce(((e,t)=>null==e?null!=t?a.fromPoint(t):null:null!=t?e.union(a.fromPoint(t)):e),null)),{pending:null,extent:o}}clear(){this.dimensions.removeAll()}};e([u({type:[\"dimension\"]})],y.prototype,\"type\",void 0),e([u({cast:r,type:d,nonNullable:!0})],y.prototype,\"dimensions\",null),e([u({readOnly:!0})],y.prototype,\"spatialReference\",null),e([u({types:{key:\"type\",base:null,typeMap:{simple:n}},nonNullable:!0})],y.prototype,\"style\",void 0),e([u({value:null,readOnly:!0})],y.prototype,\"extent\",void 0),e([u({readOnly:!0})],y.prototype,\"requiredPropertiesForEditing\",null),y=e([m(\"esri.analysis.DimensionAnalysis\")],y);const f=y;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import s from\"../analysis/DimensionAnalysis.js\";import r from\"../analysis/DimensionSimpleStyle.js\";import t from\"../analysis/LengthDimension.js\";import o from\"../core/Collection.js\";import{MultiOriginJSONMixin as i}from\"../core/MultiOriginJSONSupport.js\";import{watch as n,syncAndInitial as p}from\"../core/reactiveUtils.js\";import{property as a}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as c}from\"../core/accessorSupport/decorators/writer.js\";import y from\"./Layer.js\";import{OperationalLayer as m}from\"./mixins/OperationalLayer.js\";let u=class extends(m(i(y))){constructor(e){if(super(e),this.type=\"dimension\",this.operationalLayerType=\"ArcGISDimensionLayer\",this.source=new s,this.opacity=1,e){const{source:s,style:r}=e;s&&r&&(s.style=r)}}initialize(){this.addHandles([n((()=>this.source),((e,s)=>{null!=s&&s.parent===this&&(s.parent=null),null!=e&&(e.parent=this)}),p)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new s)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,s,r,t){s.dimensions=e.filter((({startPoint:e,endPoint:s})=>null!=e&&null!=s)).map((e=>e.toJSON(t))).toJSON()}};e([a({json:{read:!1},readOnly:!0})],u.prototype,\"type\",void 0),e([a({type:[\"ArcGISDimensionLayer\"]})],u.prototype,\"operationalLayerType\",void 0),e([a({nonNullable:!0})],u.prototype,\"source\",void 0),e([a({readOnly:!0})],u.prototype,\"spatialReference\",null),e([a({types:{key:\"type\",base:null,typeMap:{simple:r}},json:{write:{ignoreOrigin:!0}}})],u.prototype,\"style\",null),e([a({readOnly:!0})],u.prototype,\"fullExtent\",null),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},\"portal-item\":{read:!1,write:!1},\"web-document\":{read:!1,write:!1}}}})],u.prototype,\"opacity\",void 0),e([a({type:[\"show\",\"hide\"]})],u.prototype,\"listMode\",void 0),e([a({type:o.ofType(t),json:{write:{ignoreOrigin:!0},origins:{\"web-scene\":{write:{ignoreOrigin:!0}}}}})],u.prototype,\"dimensions\",null),e([c(\"web-scene\",\"dimensions\")],u.prototype,\"writeDimensions\",null),u=e([l(\"esri.layers.DimensionLayer\")],u);const d=u;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import t from\"../../../core/Error.js\";import has from\"../../../core/has.js\";import r from\"../../../core/Loadable.js\";import o from\"../../../core/Logger.js\";import{debounce as s}from\"../../../core/promiseUtils.js\";import{open as i}from\"../../../core/workers/workers.js\";import{property as n}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import{subclass as a}from\"../../../core/accessorSupport/decorators/subclass.js\";import{createCapabilities as u}from\"./support/clientSideDefaults.js\";import l from\"../../../rest/support/FeatureSet.js\";import c from\"../../../geometry/Extent.js\";import d from\"../../../geometry/Polygon.js\";import{featureGeometryTypeKebabDictionary as h}from\"../../../geometry/support/typeUtils.js\";let p=class extends r{constructor(){super(...arguments),this.type=\"geojson\",this.refresh=s((async e=>{await this.load();const{extent:t,timeExtent:r}=await this._connection.invoke(\"refresh\",e);return this.sourceJSON.extent=t,r&&(this.sourceJSON.timeInfo.timeExtent=[r.start,r.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then((()=>this._applyEdits(e)))}openPorts(){return this.load().then((()=>this._connection.openPorts()))}queryFeatures(e,t={}){return this.load(t).then((()=>this._connection.invoke(\"queryFeatures\",e?e.toJSON():null,t))).then((e=>l.fromJSON(e)))}queryFeaturesJSON(e,t={}){return this.load(t).then((()=>this._connection.invoke(\"queryFeatures\",e?e.toJSON():null,t)))}queryFeatureCount(e,t={}){return this.load(t).then((()=>this._connection.invoke(\"queryFeatureCount\",e?e.toJSON():null,t)))}queryObjectIds(e,t={}){return this.load(t).then((()=>this._connection.invoke(\"queryObjectIds\",e?e.toJSON():null,t)))}queryExtent(e,t={}){return this.load(t).then((()=>this._connection.invoke(\"queryExtent\",e?e.toJSON():null,t))).then((e=>({count:e.count,extent:c.fromJSON(e.extent)})))}querySnapping(e,t={}){return this.load(t).then((()=>this._connection.invoke(\"querySnapping\",e,t)))}_applyEdits(e){if(!this._connection)throw new t(\"geojson-layer-source:edit-failure\",\"Memory source not loaded\");const r=this.layer.objectIdField,o=[],s=[],i=[];if(e.addFeatures)for(const t of e.addFeatures)o.push(this._serializeFeature(t));if(e.deleteFeatures)for(const t of e.deleteFeatures)\"objectId\"in t&&null!=t.objectId?s.push(t.objectId):\"attributes\"in t&&null!=t.attributes[r]&&s.push(t.attributes[r]);if(e.updateFeatures)for(const t of e.updateFeatures)i.push(this._serializeFeature(t));return this._connection.invoke(\"applyEdits\",{adds:o,updates:i,deletes:s}).then((({extent:e,timeExtent:t,featureEditResults:r})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(r))))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const r=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:r?new t(\"geojson-layer-source:edit-failure\",r.description,{code:r.code}):null}}_serializeFeature(e){const{attributes:t}=e,r=this._geometryForSerialization(e);return r?{geometry:r.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return null==t?null:\"mesh\"===t.type||\"extent\"===t.type?d.fromExtent(t.extent):t}async _startWorker(e){this._connection=await i(\"GeoJSONSourceWorker\",{strategy:has(\"feature-layers-workers\")?\"dedicated\":\"local\",signal:e,registryTarget:this});const{fields:t,spatialReference:r,hasZ:s,geometryType:n,objectIdField:a,url:l,timeInfo:c,customParameters:d}=this.layer,p=\"defaults\"===this.layer.originOf(\"spatialReference\"),m={url:l,customParameters:d,fields:t&&t.map((e=>e.toJSON())),geometryType:h.toJSON(n),hasZ:s,objectIdField:a,timeInfo:c?c.toJSON():null,spatialReference:p?null:r&&r.toJSON()},y=await this._connection.invoke(\"load\",m,{signal:e});for(const i of y.warnings)o.getLogger(this.layer).warn(\"#load()\",`$${i.message} (title: '${this.layer.title||\"no title\"}', id: '${this.layer.id??\"no id\"}')`,{warning:i});y.featureErrors.length&&o.getLogger(this.layer).warn(\"#load()\",`Encountered ${y.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||\"no title\"}', id: '${this.layer.id??\"no id\"}')`,{errors:y.featureErrors}),this.sourceJSON=y.layerDefinition,this.capabilities=u(this.sourceJSON.hasZ,!0)}};e([n()],p.prototype,\"capabilities\",void 0),e([n()],p.prototype,\"type\",void 0),e([n({constructOnly:!0})],p.prototype,\"layer\",void 0),e([n()],p.prototype,\"sourceJSON\",void 0),p=e([a(\"esri.layers.graphics.sources.GeoJSONSource\")],p);export{p as GeoJSONSource};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../PopupTemplate.js\";import\"../renderers/ClassBreaksRenderer.js\";import\"../renderers/DictionaryRenderer.js\";import\"../renderers/DotDensityRenderer.js\";import\"../renderers/HeatmapRenderer.js\";import\"../renderers/PieChartRenderer.js\";import\"../renderers/Renderer.js\";import\"../renderers/SimpleRenderer.js\";import\"../renderers/UniqueValueRenderer.js\";import\"../renderers/support/jsonUtils.js\";import{rendererTypes as r,webSceneRendererTypes as i}from\"../renderers/support/types.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as s}from\"../core/promiseUtils.js\";import{urlToObject as p}from\"../core/urlUtils.js\";import{property as n}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import{featureGeometryTypeKebabDictionary as a}from\"../geometry/support/typeUtils.js\";import d from\"./Layer.js\";import{GeoJSONSource as u}from\"./graphics/sources/GeoJSONSource.js\";import{BlendLayer as m}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as y}from\"./mixins/CustomParametersMixin.js\";import{FeatureEffectLayer as h}from\"./mixins/FeatureEffectLayer.js\";import{FeatureReductionLayer as c}from\"./mixins/FeatureReductionLayer.js\";import{OperationalLayer as f}from\"./mixins/OperationalLayer.js\";import{OrderedLayer as j}from\"./mixins/OrderedLayer.js\";import{PortalLayer as g}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as v}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as b}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as x}from\"./mixins/TemporalLayer.js\";import{elevationInfo as I,id as F,labelsVisible as O,legendEnabled as S,opacity as E,popupEnabled as P,screenSizePerspectiveEnabled as T,url as w}from\"./support/commonProperties.js\";import L from\"./support/FeatureTemplate.js\";import R from\"./support/FeatureType.js\";import D from\"./support/Field.js\";import{defineFieldProperties as q}from\"./support/fieldProperties.js\";import{fixRendererFields as U,fixTimeInfoFields as J}from\"./support/fieldUtils.js\";import N from\"./support/LabelClass.js\";import{reader as Q}from\"./support/labelingInfo.js\";import C from\"../rest/support/Query.js\";import{createPopupTemplate as G}from\"../support/popupUtils.js\";import{timeZoneProperty as _}from\"../time/timeZoneUtils.js\";import Z from\"../geometry/SpatialReference.js\";import V from\"../geometry/Extent.js\";const B=q();let M=class extends(j(y(c(h(m(x(b(v(f(g(o(d)))))))))))){constructor(e){super(e),this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType=\"GeoJSON\",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new u({layer:this}),this.spatialReference=Z.WGS84,this.templates=null,this.title=\"GeoJSON\",this.type=\"geojson\",this.typeIdField=null,this.types=null}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:[\"GeoJson\"],supportsData:!1},e).catch(s).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:\"service\",url:this.parsedUrl}),this.revert([\"objectIdField\",\"fields\",\"timeInfo\"],\"service\"),U(this.renderer,this.fieldsIndex),J(this.timeInfo,this.fieldsIndex)}));return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty(\"definitionExpression\"),this.commitProperty(\"timeExtent\"),this.commitProperty(\"timeOffset\"),this.commitProperty(\"geometryType\"),this.commitProperty(\"capabilities\"),(this._get(\"createQueryVersion\")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}get parsedUrl(){return this.url?p(this.url):null}set renderer(e){U(e,this.fieldsIndex),this._set(\"renderer\",e)}set url(e){if(!e)return void this._set(\"url\",e);const t=p(e);this._set(\"url\",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:r}=await import(\"./graphics/editingSupport.js\");await this.load();const i=await r(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:\"service\",ignoreDefaults:!0}),i}on(e,t){return super.on(e,t)}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new C,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=[\"*\"],e.where=this.definitionExpression||\"1=1\";const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e}getFieldDomain(e,t){let r,i=!1;const o=t?.feature,s=o?.attributes,p=this.typeIdField&&s?.[this.typeIdField];return null!=p&&this.types&&(i=this.types.some((t=>t.id==p&&(r=t.domains&&t.domains[e],r&&\"inherited\"===r.type&&(r=this._getLayerDomain(e)),!0)))),i||r||(r=this._getLayerDomain(e)),r}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(C.from(e)||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(C.from(e)||this.createQuery(),t)))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(C.from(e)||this.createQuery(),t)))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(C.from(e)||this.createQuery(),t)))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:\"service\",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_getLayerDomain(e){if(!this.fields)return null;let t=null;return this.fields.some((r=>(r.name===e&&(t=r.domain),!!t))),t}};e([n({readOnly:!0,json:{read:!1,write:!1}})],M.prototype,\"capabilities\",null),e([n({type:String})],M.prototype,\"copyright\",void 0),e([n({readOnly:!0})],M.prototype,\"createQueryVersion\",null),e([n(_(\"dateFieldsTimeReference\"))],M.prototype,\"dateFieldsTimeZone\",void 0),e([n({readOnly:!0})],M.prototype,\"defaultPopupTemplate\",null),e([n({type:String,json:{name:\"layerDefinition.definitionExpression\",write:{enabled:!0,allowNull:!0}}})],M.prototype,\"definitionExpression\",void 0),e([n({type:String})],M.prototype,\"displayField\",void 0),e([n({type:Boolean})],M.prototype,\"editingEnabled\",void 0),e([n(I)],M.prototype,\"elevationInfo\",void 0),e([n({type:[D],json:{name:\"layerDefinition.fields\",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:\"fields\"}}}})],M.prototype,\"fields\",void 0),e([n(B.fieldsIndex)],M.prototype,\"fieldsIndex\",void 0),e([n({type:V,json:{name:\"extent\"}})],M.prototype,\"fullExtent\",void 0),e([n({type:[\"point\",\"polygon\",\"polyline\",\"multipoint\"],json:{read:{reader:a.read}}})],M.prototype,\"geometryType\",void 0),e([n({type:Boolean})],M.prototype,\"hasZ\",void 0),e([n(F)],M.prototype,\"id\",void 0),e([n({type:Boolean,readOnly:!0})],M.prototype,\"isTable\",null),e([n(O)],M.prototype,\"labelsVisible\",void 0),e([n({type:[N],json:{name:\"layerDefinition.drawingInfo.labelingInfo\",read:{reader:Q},write:!0}})],M.prototype,\"labelingInfo\",void 0),e([n(S)],M.prototype,\"legendEnabled\",void 0),e([n({type:[\"show\",\"hide\"]})],M.prototype,\"listMode\",void 0),e([n({type:String,json:{name:\"layerDefinition.objectIdField\",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:\"objectIdField\"}}}})],M.prototype,\"objectIdField\",void 0),e([n(E)],M.prototype,\"opacity\",void 0),e([n({type:[\"GeoJSON\"]})],M.prototype,\"operationalLayerType\",void 0),e([n({readOnly:!0})],M.prototype,\"parsedUrl\",null),e([n(P)],M.prototype,\"popupEnabled\",void 0),e([n({type:t,json:{name:\"popupInfo\",write:!0}})],M.prototype,\"popupTemplate\",void 0),e([n({types:r,json:{name:\"layerDefinition.drawingInfo.renderer\",write:!0,origins:{service:{name:\"drawingInfo.renderer\"},\"web-scene\":{types:i}}}})],M.prototype,\"renderer\",null),e([n(T)],M.prototype,\"screenSizePerspectiveEnabled\",void 0),e([n({readOnly:!0})],M.prototype,\"source\",void 0),e([n({type:Z})],M.prototype,\"spatialReference\",void 0),e([n({type:[L]})],M.prototype,\"templates\",void 0),e([n()],M.prototype,\"title\",void 0),e([n({json:{read:!1},readOnly:!0})],M.prototype,\"type\",void 0),e([n({type:String,readOnly:!0})],M.prototype,\"typeIdField\",void 0),e([n({type:[R]})],M.prototype,\"types\",void 0),e([n(w)],M.prototype,\"url\",null),M=e([l(\"esri.layers.GeoJSONLayer\")],M);const k=M;export{k as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import o from\"../config.js\";import r from\"../request.js\";import\"../symbols.js\";import{MultiOriginJSONMixin as t}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as s}from\"../core/promiseUtils.js\";import{getFilename as i}from\"../core/urlUtils.js\";import{property as l}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as p}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import a from\"../geometry/Extent.js\";import{isWGS84 as m}from\"../geometry/support/spatialReferenceUtils.js\";import y from\"./Layer.js\";import{BlendLayer as c}from\"./mixins/BlendLayer.js\";import{OperationalLayer as u}from\"./mixins/OperationalLayer.js\";import{PortalLayer as d}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as f}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as h}from\"./mixins/ScaleRangeLayer.js\";import{id as S,legendEnabled as g,url as j}from\"./support/commonProperties.js\";import b from\"../symbols/Symbol.js\";import v from\"../symbols/SimpleLineSymbol.js\";import x from\"../symbols/PictureMarkerSymbol.js\";import C from\"../symbols/SimpleMarkerSymbol.js\";import P from\"../symbols/SimpleFillSymbol.js\";const G=[\"atom\",\"xml\"],L={base:b,key:\"type\",typeMap:{\"simple-line\":v},errorContext:\"symbol\"},R={base:b,key:\"type\",typeMap:{\"picture-marker\":x,\"simple-marker\":C},errorContext:\"symbol\"},k={base:b,key:\"type\",typeMap:{\"simple-fill\":P},errorContext:\"symbol\"};let _=class extends(c(f(u(d(h(t(y))))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType=\"GeoRSS\",this.url=null,this.type=\"geo-rss\"}normalizeCtorArgs(e,o){return\"string\"==typeof e?{url:e,...o}:e}readFeatureCollections(e,o){return o.featureCollection.layers.forEach((e=>{const o=e.layerDefinition.drawingInfo.renderer.symbol;o&&\"esriSFS\"===o.type&&o.outline?.style.includes(\"esriSFS\")&&(o.outline.style=\"esriSLSSolid\")})),o.featureCollection.layers}get hasPoints(){return this._hasGeometry(\"esriGeometryPoint\")}get hasPolylines(){return this._hasGeometry(\"esriGeometryPolyline\")}get hasPolygons(){return this._hasGeometry(\"esriGeometryPolygon\")}get title(){const e=this._get(\"title\");return e&&\"defaults\"!==this.originOf(\"title\")?e:this.url?i(this.url,G)||\"GeoRSS\":e||\"\"}set title(e){this._set(\"title\",e)}load(e){const o=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Map Service\",\"Feature Service\",\"Feature Collection\",\"Scene Service\"]},e).catch(s).then((()=>this._fetchService(o))).then((e=>{this.read(e,{origin:\"service\"})}))),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:\"service\",ignoreDefaults:!0}),!0}async _fetchService(e){const t=this.spatialReference,{data:s}=await r(o.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(t)?void 0:t.wkid??JSON.stringify(t)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some((o=>o.featureSet?.geometryType===e&&o.featureSet.features?.length>0))??!1}};e([l()],_.prototype,\"description\",void 0),e([l()],_.prototype,\"featureCollections\",void 0),e([p(\"service\",\"featureCollections\",[\"featureCollection.layers\"])],_.prototype,\"readFeatureCollections\",null),e([l({type:a,json:{name:\"lookAtExtent\"}})],_.prototype,\"fullExtent\",void 0),e([l(S)],_.prototype,\"id\",void 0),e([l(g)],_.prototype,\"legendEnabled\",void 0),e([l({types:L,json:{write:!0}})],_.prototype,\"lineSymbol\",void 0),e([l({type:[\"show\",\"hide\"]})],_.prototype,\"listMode\",void 0),e([l({types:R,json:{write:!0}})],_.prototype,\"pointSymbol\",void 0),e([l({types:k,json:{write:!0}})],_.prototype,\"polygonSymbol\",void 0),e([l({type:[\"GeoRSS\"]})],_.prototype,\"operationalLayerType\",void 0),e([l(j)],_.prototype,\"url\",void 0),e([l({json:{origins:{service:{read:{source:\"name\",reader:e=>e||void 0}}}}})],_.prototype,\"title\",null),e([l({readOnly:!0,json:{read:!1},value:\"geo-rss\"})],_.prototype,\"type\",void 0),_=e([n(\"esri.layers.GeoRSSLayer\")],_);const w=_;export{w as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e=Symbol(\"WebScene\");export{e as WebSceneTag};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/CollectionFlattener.js\";import{loadAll as t}from\"../core/loadAll.js\";import i from\"../core/Logger.js\";import{MultiOriginJSONMixin as s}from\"../core/MultiOriginJSONSupport.js\";import{debounce as o,throwIfAbortError as a}from\"../core/promiseUtils.js\";import{watch as l,syncAndInitial as p,on as n,sync as d}from\"../core/reactiveUtils.js\";import{property as y}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{getProperties as c}from\"../core/accessorSupport/utils.js\";import{reader as h}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as u}from\"../core/accessorSupport/decorators/writer.js\";import{OriginId as b}from\"../core/accessorSupport/PropertyOrigin.js\";import v from\"./Layer.js\";import{BlendLayer as f}from\"./mixins/BlendLayer.js\";import{OperationalLayer as j}from\"./mixins/OperationalLayer.js\";import{PortalLayer as g}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as w}from\"./mixins/ScaleRangeLayer.js\";import{layerLookupMap as L}from\"./support/lazyLayerLoader.js\";import S from\"../portal/PortalItem.js\";import{createFlattenedTablesCollection as _}from\"../support/collectionUtils.js\";import{LayersMixin as I}from\"../support/LayersMixin.js\";import{TablesMixin as O}from\"../support/TablesMixin.js\";import{WebSceneTag as M}from\"../support/tagSymbols.js\";import{SaveOperationType as x}from\"../webdoc/interfaces.js\";import{beforeSave as P}from\"../webdoc/support/saveUtils.js\";import{getLayerJSON as A}from\"../webdoc/support/writeUtils.js\";let V=class extends(f(w(j(g(O(I(s(v)))))))){constructor(e){super(e),this.allLayers=new r({getCollections:()=>[this.layers],getChildrenFunction:e=>\"layers\"in e?e.layers:null}),this.allTables=_(this),this.fullExtent=void 0,this.operationalLayerType=\"GroupLayer\",this.spatialReference=void 0,this.type=\"group\",this._debouncedSaveOperations=o((async(e,r,t)=>{const{save:i,saveAs:s}=await import(\"./save/groupLayerUtils.js\");switch(e){case x.SAVE:return i(this,r);case x.SAVE_AS:return s(this,t,r)}}))}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([l((()=>{let e=this.parent;for(;e&&\"parent\"in e&&e.parent;)e=e.parent;return e&&M in e}),(e=>{const r=\"prevent-adding-tables\";this.removeHandles(r),e&&(this.tables.removeAll(),this.addHandles(n((()=>this.tables),\"before-add\",(e=>{e.preventDefault(),i.getLogger(this).errorOnce(\"tables\",\"tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.\")})),r))}),p),l((()=>this.visible),this._onVisibilityChange.bind(this),d)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf(\"portalItem\")===b.USER}_writeLayers(e,r,t,i){const s=[];if(!e)return s;e.forEach((e=>{const r=A(e,i.webmap?i.webmap.getLayerJSONFromResourceInfo(e):null,i);r?.layerType&&s.push(r)})),r.layers=s}set portalItem(e){this._set(\"portalItem\",e)}readPortalItem(e,r,t){const{itemId:i,layerType:s}=r;if(\"GroupLayer\"===s&&i)return new S({id:i,portal:t?.portal})}writePortalItem(e,r){e?.id&&(r.itemId=e.id)}set visibilityMode(e){const r=this._get(\"visibilityMode\")!==e;this._set(\"visibilityMode\",e),r&&this._enforceVisibility(e,this.visible)}async beforeSave(){return P(this)}load(e){const r=this.loadFromPortal({supportedTypes:[\"Feature Service\",\"Feature Collection\",\"Group Layer\",\"Scene Service\"],layerModuleTypeMap:L},e).catch((e=>{if(a(e),this.sourceIsPortalItem)throw e}));return this.addResolvingPromise(r),Promise.resolve(this)}async loadAll(){return t(this,(e=>{e(this.layers,this.tables)}))}async save(e){return this._debouncedSaveOperations(x.SAVE,e)}async saveAs(e,r){return this._debouncedSaveOperations(x.SAVE_AS,r,e)}layerAdded(e){e.visible&&\"exclusive\"===this.visibilityMode?this._turnOffOtherLayers(e):\"inherited\"===this.visibilityMode&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer readded to Grouplayer: uid=${e.uid}`):this.addHandles(l((()=>e.visible),(r=>this._onChildVisibilityChange(e,r)),d),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach((r=>{r!==e&&(r.visible=!1)}))}_enforceVisibility(e,r){if(!c(this).initialized)return;const t=this.layers;let i=t.find((e=>e.visible));switch(e){case\"exclusive\":t.length&&!i&&(i=t.at(0),i.visible=!0),this._turnOffOtherLayers(i);break;case\"inherited\":t.forEach((e=>{e.visible=r}))}}_onVisibilityChange(e){\"inherited\"===this.visibilityMode&&this.layers.forEach((r=>{r.visible=e}))}_onChildVisibilityChange(e,r){switch(this.visibilityMode){case\"exclusive\":r?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case\"inherited\":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some((e=>e.visible))}};e([y({readOnly:!0,dependsOn:[]})],V.prototype,\"allLayers\",void 0),e([y({readOnly:!0})],V.prototype,\"allTables\",void 0),e([y({json:{read:!0,write:!0}})],V.prototype,\"blendMode\",void 0),e([y()],V.prototype,\"fullExtent\",void 0),e([y({readOnly:!0})],V.prototype,\"sourceIsPortalItem\",null),e([y({json:{read:!1,write:{ignoreOrigin:!0}}})],V.prototype,\"layers\",void 0),e([u(\"layers\")],V.prototype,\"_writeLayers\",null),e([y({type:[\"GroupLayer\"]})],V.prototype,\"operationalLayerType\",void 0),e([y({json:{origins:{\"web-map\":{read:!1,write:{overridePolicy(e,r,t){return{enabled:\"Group Layer\"===e?.type&&t?.initiator!==this}}}},\"web-scene\":{read:!1,write:!1}}}})],V.prototype,\"portalItem\",null),e([h(\"web-map\",\"portalItem\",[\"itemId\"])],V.prototype,\"readPortalItem\",null),e([u(\"web-map\",\"portalItem\",{itemId:{type:String}})],V.prototype,\"writePortalItem\",null),e([y()],V.prototype,\"spatialReference\",void 0),e([y({json:{read:!1},readOnly:!0,value:\"group\"})],V.prototype,\"type\",void 0),e([y({type:[\"independent\",\"inherited\",\"exclusive\"],value:\"independent\",json:{write:!0,origins:{\"web-map\":{type:[\"independent\",\"exclusive\"],write:(e,r,t)=>{\"inherited\"!==e&&(r[t]=e)}}}}})],V.prototype,\"visibilityMode\",null),V=e([m(\"esri.layers.GroupLayer\")],V);const E=V;export{E as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import t from\"../Color.js\";import{JSONMap as e}from\"../core/jsonMap.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{toPt as i}from\"../core/screenUtils.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as n}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import{VisualVariablesMixin as a}from\"./mixins/VisualVariablesMixin.js\";import l from\"./support/AuthoringInfo.js\";import{LegendOptions as m}from\"./support/LegendOptions.js\";var c;const d=new e({flow_from:\"flow-from\",flow_to:\"flow-to\"});let h=c=class extends(a(r)){constructor(o){super(o),this.density=.8,this.color=new t([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation=\"flow-from\",this.type=\"flow\",this.authoringInfo=null,this.legendOptions=null,this.trailCap=\"butt\",this.background=\"none\"}clone(){const{density:o,maxPathLength:t,trailWidth:e,flowSpeed:r,trailLength:i,smoothing:s,flowRepresentation:n,trailCap:p,background:a}=this,l=this.color.clone(),m=(this.visualVariables||[]).map((o=>o.clone())),d=this.authoringInfo?.clone(),h=this.legendOptions?.clone();return new c({density:o,color:l,maxPathLength:t,trailWidth:e,flowSpeed:r,trailLength:i,trailCap:p,background:a,smoothing:s,flowRepresentation:n,visualVariables:m,authoringInfo:d,legendOptions:h})}getSymbol(o,t){}async getSymbolAsync(o,t){}getSymbols(){return[]}};o([s({type:Number,json:{write:!0}})],h.prototype,\"density\",void 0),o([s({type:t,json:{write:{allowNull:!0}}})],h.prototype,\"color\",void 0),o([s({type:Number,cast:i,json:{write:!0}})],h.prototype,\"maxPathLength\",void 0),o([s({type:Number,cast:i,json:{write:!0}})],h.prototype,\"trailWidth\",void 0),o([s({type:Number,json:{write:!0}})],h.prototype,\"flowSpeed\",void 0),o([s({type:Number,json:{write:!0}})],h.prototype,\"trailLength\",void 0),o([s({type:Number,cast:i,json:{write:!1}})],h.prototype,\"smoothing\",void 0),o([s({type:d.apiValues,json:{type:d.jsonValues,read:{reader:d.read},write:{writer:d.write}}})],h.prototype,\"flowRepresentation\",void 0),o([n({flowRenderer:\"flow\"})],h.prototype,\"type\",void 0),o([s({type:l,json:{write:!0}})],h.prototype,\"authoringInfo\",void 0),o([s({type:m,json:{write:!0}})],h.prototype,\"legendOptions\",void 0),o([s({type:String,json:{write:!0}})],h.prototype,\"trailCap\",void 0),o([s({type:String,json:{write:!0}})],h.prototype,\"background\",void 0),h=c=o([p(\"esri.renderers.FlowRenderer\")],h);const u=h;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as e}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";let c=class extends s{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};o([t({type:Number,json:{write:!0}})],c.prototype,\"value\",void 0),o([t({type:String,json:{write:!0}})],c.prototype,\"label\",void 0),o([t({type:r,json:{type:[e],write:!0}})],c.prototype,\"color\",void 0),c=o([p(\"esri.renderers.support.ColormapInfo\")],c);const l=c;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as e}from\"../core/accessorSupport/decorators/subclass.js\";import p from\"./support/ColormapInfo.js\";import{convertColorRampToColormap as a}from\"./support/colorRampUtils.js\";var c;let m=c=class extends r{constructor(o){super(o),this.colormapInfos=null,this.type=\"raster-colormap\"}static createFromColormap(o,r){if(!o)return null;const t=5===o[0].length,s=[...o].sort(((o,r)=>o[0]-r[0])).map((o=>p.fromJSON({value:o[0],color:t?o.slice(1,5):o.slice(1,4).concat([255]),label:r?r[o[0]]??\"\":o[0]})));return new c({colormapInfos:s})}static createFromColorramp(o){const r=a(o);return c.createFromColormap(r)}clone(){return new c({colormapInfos:this.colormapInfos.map((o=>o.toJSON()))})}extractColormap(){return this.colormapInfos.map((({value:o,color:r})=>[o,r.r,r.g,r.b,r.a>1?r.a:255*r.a&255])).sort(((o,r)=>o[0]-r[0]))}};o([t({type:[p],json:{write:!0}})],m.prototype,\"colormapInfos\",void 0),o([s({rasterColormap:\"raster-colormap\"})],m.prototype,\"type\",void 0),m=c=o([e(\"esri.renderers.RasterColormapRenderer\")],m);const l=m;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../core/JSONSupport.js\";import{clone as o}from\"../core/lang.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as i}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as s}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import{fromJSON as a,types as l}from\"../rest/support/colorRamps.js\";var c;let d=c=class extends r{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType=\"traditional\",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType=\"none\",this.type=\"raster-shaded-relief\",this.zFactor=1}readColorRamp(e){return a(e)}clone(){return new c({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:o(this.colorRamp)})}};e([t({type:Number,json:{write:!0}})],d.prototype,\"altitude\",void 0),e([t({type:Number,json:{write:!0}})],d.prototype,\"azimuth\",void 0),e([t({types:l,json:{write:!0}})],d.prototype,\"colorRamp\",void 0),e([s(\"colorRamp\")],d.prototype,\"readColorRamp\",null),e([t({type:[\"traditional\",\"multi-directional\"],json:{write:!0}})],d.prototype,\"hillshadeType\",void 0),e([t({type:Number,json:{write:!0}})],d.prototype,\"pixelSizePower\",void 0),e([t({type:Number,json:{write:!0}})],d.prototype,\"pixelSizeFactor\",void 0),e([t({type:[\"none\",\"adjusted\"],json:{write:!0}})],d.prototype,\"scalingType\",void 0),e([i({rasterShadedRelief:\"raster-shaded-relief\"})],d.prototype,\"type\",void 0),e([t({type:Number,json:{write:!0}})],d.prototype,\"zFactor\",void 0),d=c=e([p(\"esri.renderers.RasterShadedReliefRenderer\")],d);const m=d;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../core/JSONSupport.js\";import{clone as r}from\"../core/lang.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as s}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as i}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as a}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as p}from\"../core/accessorSupport/decorators/writer.js\";import{stretchTypeJSONDict as m,stretchTypeFunctionEnum as n}from\"./support/stretchRendererUtils.js\";import{fromJSON as c,types as u}from\"../rest/support/colorRamps.js\";var d;let h=d=class extends e{constructor(t){super(t),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType=\"none\",this.type=\"raster-stretch\"}readColorRamp(t){if(t)return c(t)}writeStatistics(t,e,r){t?.length&&(Array.isArray(t[0])||(t=t.map((t=>[t.min,t.max,t.avg,t.stddev]))),e[r]=t)}readStretchType(t,e){let r=e.stretchType;return\"number\"==typeof r&&(r=n[r]),m.read(r)}clone(){return new d({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:r(this.statistics),gamma:r(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:r(this.colorRamp),histograms:r(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};t([o({types:u,json:{write:!0}})],h.prototype,\"colorRamp\",void 0),t([i(\"colorRamp\")],h.prototype,\"readColorRamp\",null),t([o({type:Boolean,json:{write:!0}})],h.prototype,\"computeGamma\",void 0),t([o({type:Boolean,json:{write:{target:\"dra\"},read:{source:\"dra\"}}})],h.prototype,\"dynamicRangeAdjustment\",void 0),t([o({type:[Number],json:{write:!0}})],h.prototype,\"gamma\",void 0),t([o({type:Number,json:{write:!0}})],h.prototype,\"maxPercent\",void 0),t([o({type:Number,json:{write:!0}})],h.prototype,\"minPercent\",void 0),t([o({type:Number,json:{write:!0}})],h.prototype,\"numberOfStandardDeviations\",void 0),t([o({type:Number,json:{read:{source:\"max\"},write:{target:\"max\"}}})],h.prototype,\"outputMax\",void 0),t([o({type:Number,json:{read:{source:\"min\"},write:{target:\"min\"}}})],h.prototype,\"outputMin\",void 0),t([o({type:Number,json:{write:!0}})],h.prototype,\"sigmoidStrengthLevel\",void 0),t([o({json:{type:[[Number]],write:!0}})],h.prototype,\"statistics\",void 0),t([o()],h.prototype,\"histograms\",void 0),t([p(\"statistics\")],h.prototype,\"writeStatistics\",null),t([o({type:Boolean,json:{write:!0}})],h.prototype,\"useGamma\",void 0),t([o({type:m.apiValues,json:{type:m.jsonValues,write:m.write}})],h.prototype,\"stretchType\",void 0),t([i(\"stretchType\",[\"stretchType\"])],h.prototype,\"readStretchType\",null),t([s({rasterStretch:\"raster-stretch\"})],h.prototype,\"type\",void 0),h=d=t([a(\"esri.renderers.RasterStretchRenderer\")],h);const y=h;export{y as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import M from\"../Color.js\";import\"../geometry.js\";import i from\"../Graphic.js\";import\"../symbols.js\";import{JSONMap as t}from\"../core/jsonMap.js\";import{JSONSupport as a}from\"../core/JSONSupport.js\";import{clone as I}from\"../core/lang.js\";import{property as r}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as g}from\"../core/accessorSupport/decorators/enumeration.js\";import{reader as o}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as A}from\"../core/accessorSupport/decorators/subclass.js\";import{normalizeCentralMeridian as s}from\"../geometry/support/normalizeUtils.js\";import{unitKebabDict as d,getUnitConversionFactor as l,convertVectorFieldData as n,convertVectorFieldUnit as c}from\"../layers/support/rasterFunctions/vectorFieldUtils.js\";import D from\"./ClassBreaksRenderer.js\";import{VisualVariablesMixin as w}from\"./mixins/VisualVariablesMixin.js\";import y from\"./support/ClassBreakInfo.js\";import C from\"./visualVariables/RotationVariable.js\";import L from\"./visualVariables/SizeVariable.js\";import{getAllSizes as m,getRotationAngle as j}from\"./visualVariables/support/visualVariableUtils.js\";import p from\"../symbols/SimpleLineSymbol.js\";import T from\"../symbols/SimpleMarkerSymbol.js\";import{applySizesToSymbol as N,applyRotationToSymbol as H}from\"../symbols/support/utils.js\";import U from\"../geometry/Point.js\";import B from\"../symbols/PictureMarkerSymbol.js\";var S;const u=new Set([\"esriMetersPerSecond\",\"esriKilometersPerHour\",\"esriKnots\",\"esriFeetPerSecond\",\"esriMilesPerHour\"]),z=new t({beaufort_ft:\"beaufort-ft\",beaufort_km:\"beaufort-km\",beaufort_kn:\"beaufort-kn\",beaufort_m:\"beaufort-m\",beaufort_mi:\"beaufort-mi\",classified_arrow:\"classified-arrow\",ocean_current_kn:\"ocean-current-kn\",ocean_current_m:\"ocean-current-m\",simple_scalar:\"simple-scalar\",single_arrow:\"single-arrow\",wind_speed:\"wind-barb\"}),Z=new t({flow_from:\"flow-from\",flow_to:\"flow-to\"});let b=S=class extends(w(a)){constructor(e){super(e),this.attributeField=\"Magnitude\",this.flowRepresentation=\"flow-from\",this.rotationType=\"arithmetic\",this.style=\"single-arrow\",this.symbolTileSize=50,this.type=\"vector-field\"}readInputUnit(e,M){return u.has(e)?d.fromJSON(e):null}readOutputUnit(e,M){return u.has(e)?d.fromJSON(e):null}get styleRenderer(){const e=this.style,M=this.attributeField,i=this._createStyleRenderer(e);return i.field=M,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const M of this.visualVariables)\"size\"===M.type&&e.push(M);if(0===e.length){const M=new L({field:\"Magnitude\",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(M):this._set(\"visualVariables\",[M]),e.push(M)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const M of this.visualVariables)\"rotation\"===M.type&&e.push(M);if(0===e.length){const M=new C({field:\"Direction\",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(M):this._set(\"visualVariables\",[M]),e.push(M)}return e}clone(){return new S({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:I(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,M=!1,t=[]){const a=new Array,I=l(this.inputUnit,this.outputUnit),r=this.rotationVariables[0]?.rotationType||this.rotationType,g=M?n(e.pixelBlock,\"vector-uv\",r,I):c(e.pixelBlock,\"vector-magdir\",I);if(null==g)return a;const o=e.extent,A=null!=g.mask&&g.mask.length>0;let d=0;const D=(o.xmax-o.xmin)/g.width,w=(o.ymax-o.ymin)/g.height;for(let l=0;le.intersects(M)));if((!A||g.mask[d])&&!I){const e={Magnitude:g.pixels[0][d],Direction:g.pixels[1][d]},t=new i({geometry:{type:\"point\",x:M.x,y:M.y,spatialReference:o.spatialReference},attributes:e});t.symbol=this._getVisualVariablesAppliedSymbol(t),a.push(t)}}return a}getSymbol(e,M){}async getSymbolAsync(e,M){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new T({path:\"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z\",outline:new p({width:0}),size:20,color:e||new M([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const M=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,t=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach((i=>N(M,m([i],e)))),t&&t.length){const i=\"flow-to\"===this.flowRepresentation===(\"ocean-current-kn\"===this.style||\"ocean-current-m\"===this.style)?0:180;e.attributes.Direction=e.attributes.Direction+i,this.rotationVariables.forEach((i=>H(M,j(i,e),i.axis)))}return M}_createStyleRenderer(e){let M={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case\"single-arrow\":M=this._createSingleArrowRenderer();break;case\"beaufort-kn\":M=this._createBeaufortKnotsRenderer();break;case\"beaufort-m\":M=this._createBeaufortMeterRenderer();break;case\"beaufort-ft\":M=this._createBeaufortFeetRenderer();break;case\"beaufort-mi\":M=this._createBeaufortMilesRenderer();break;case\"beaufort-km\":M=this._createBeaufortKilometersRenderer();break;case\"ocean-current-m\":M=this._createCurrentMeterRenderer();break;case\"ocean-current-kn\":M=this._createCurrentKnotsRenderer();break;case\"simple-scalar\":M=this._createSimpleScalarRenderer();break;case\"wind-barb\":M=this._createWindBarbsRenderer();break;case\"classified-arrow\":M=this._createClassifiedArrowRenderer()}return new D(M)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],i=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new M([214,47,39])),classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new M([214,47,39])),classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=3.28084;i=i.map((e=>e*a));return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,t)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=2.23694;i=i.map((e=>e*a));return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,t)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=3.6;i=i.map((e=>e*a));return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,t)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],i=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new M([177,177,177])),classBreakInfos:this._getClassBreaks(e,i)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],i=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new M([177,177,177])),classBreakInfos:this._getClassBreaks(e,i)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new M([56,168,0]));let i=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const e=this.sizeVariables[0].minDataValue,M=this.sizeVariables[0].maxDataValue;if(e&&M){const t=(M-e)/5;i=Array.from(Array(6).keys()).map((M=>e+t*M))}}const t=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,t)}}_createSimpleScalarRenderer(){return{defaultSymbol:B.fromJSON({imageData:\"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=\",height:20,width:20,type:\"esriPMS\",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map((e=>5*e)),M=[{range:\"0-5\",path:\"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"5-10\",path:\"M25 0 L25 40 M25 35 L17.5 37.5\",imageData:\"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"10-15\",path:\"M25 0 L25 40 L10 45 L25 40\",imageData:\"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"15-20\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5\",imageData:\"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"20-25\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40\",imageData:\"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+\"},{range:\"25-30\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5\",imageData:\"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"30-35\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"35-40\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"40-45\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"45-50\",path:\"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"50-55\",path:\"M25 0 L25 40 L10 40 L25 35\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"55-60\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"60-65\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"65-70\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"70-75\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"75-80\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"80-85\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"85-90\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"90-95\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"95-100\",path:\"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"},{range:\"100-105\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"105-110\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"110-115\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+\"},{range:\"115-120\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"120-125\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+\"},{range:\"125-130\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"130-135\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+\"},{range:\"135-140\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg==\"},{range:\"140-145\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+\"},{range:\"145-150\",path:\"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5\",imageData:\"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4=\"}],i=B.fromJSON({imageData:\"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC\",height:20,width:20,type:\"esriPMS\",angle:0}),t=e.map(((t,a)=>{let I;if(a!==e.length-1)if(0===a)I={minValue:t,maxValue:e[a+1],symbol:i};else{const i=B.fromJSON({type:\"esriPMS\",imageData:M[a].imageData,contentType:\"image/svg+xml\",height:32,width:32,angle:0});I={minValue:t,maxValue:e[a+1],symbol:i}}return new y(I)}));return{defaultSymbol:i,classBreakInfos:t}}_getClassBreaks(e,i){return i.map(((i,t)=>new y({minValue:e[t],maxValue:e[t+1],symbol:this._getDefaultSymbol(new M(i))})))}};e([r({type:String,json:{write:!0}})],b.prototype,\"attributeField\",void 0),e([r({type:Z.apiValues,json:{type:Z.jsonValues,read:{reader:Z.read},write:{writer:Z.write}}})],b.prototype,\"flowRepresentation\",void 0),e([r({type:[\"geographic\",\"arithmetic\"],json:{write:!0}})],b.prototype,\"rotationType\",void 0),e([r({type:z.apiValues,json:{type:z.jsonValues,read:{reader:z.read},write:{writer:z.write}}})],b.prototype,\"style\",void 0),e([r({json:{write:!0}})],b.prototype,\"symbolTileSize\",void 0),e([r({type:d.apiValues,json:{type:d.jsonValues,write:{writer:d.write}}})],b.prototype,\"inputUnit\",void 0),e([o(\"inputUnit\")],b.prototype,\"readInputUnit\",null),e([r({type:d.apiValues,json:{type:d.jsonValues,read:{reader:d.read},write:{writer:d.write}}})],b.prototype,\"outputUnit\",void 0),e([o(\"outputUnit\")],b.prototype,\"readOutputUnit\",null),e([g({vectorField:\"vector-field\"})],b.prototype,\"type\",void 0),e([r({type:D})],b.prototype,\"styleRenderer\",null),e([r({type:L})],b.prototype,\"sizeVariables\",null),e([r({type:C})],b.prototype,\"rotationVariables\",null),b=S=e([A(\"esri.renderers.VectorFieldRenderer\")],b);const h=b;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"./core/Warning.js\";import r from\"./renderers/ClassBreaksRenderer.js\";import s from\"./renderers/FlowRenderer.js\";import t from\"./renderers/RasterColormapRenderer.js\";import a from\"./renderers/RasterShadedReliefRenderer.js\";import n from\"./renderers/RasterStretchRenderer.js\";import o from\"./renderers/UniqueValueRenderer.js\";import i from\"./renderers/VectorFieldRenderer.js\";const l={key:\"type\",base:null,typeMap:{\"unique-value\":o,\"class-breaks\":r,\"raster-colormap\":t,\"raster-stretch\":n,\"vector-field\":i,\"raster-shaded-relief\":a,flow:s}},d={...l,typeMap:{...l.typeMap}};delete d.typeMap[\"vector-field\"],delete d.typeMap.flow;const p={uniqueValue:o,classBreaks:r,rasterStretch:n,rasterColormap:t,vectorField:i,rasterShadedRelief:a,flowRenderer:s};function u(e){return e&&p[e.type]||null}function c(r,s){if(!r)return null;if(\"classBreaks\"===r.type&&r.classificationMethod){const e=r.authoringInfo||{classificationMethod:\"\"};e.classificationMethod=r.classificationMethod,r.authoringInfo=e}\"vectorField\"===r.type&&r.visualVariables&&!Array.isArray(r.visualVariables)&&(r.visualVariables=[r.visualVariables]);const t=u(r);if(t){const e=new t;return e.read(r,s),e}return s?.messages&&r&&s.messages.push(new e(\"renderer:unsupported\",\"Renderers of type '\"+(r.type||\"unknown\")+\"' are not supported\",{definition:r,context:s})),null}function f(e,r){return c(e,r)}export{r as ClassBreaksRenderer,s as FlowRenderer,t as RasterColormapRenderer,a as RasterShadedReliefRenderer,n as RasterStretchRenderer,o as UniqueValueRenderer,i as VectorFieldRenderer,f as fromJSON,l as rasterRendererTypes,c as read,d as websceneRasterRendererTypes};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{strict as o}from\"../../core/jsonMap.js\";const a=o()({RSP_NearestNeighbor:\"nearest\",RSP_BilinearInterpolation:\"bilinear\",RSP_CubicConvolution:\"cubic\",RSP_Majority:\"majority\"}),i=o()({esriNoDataMatchAny:\"any\",esriNoDataMatchAll:\"all\"}),n=o()({U1:\"u1\",U2:\"u2\",U4:\"u4\",U8:\"u8\",S8:\"s8\",U16:\"u16\",S16:\"s16\",U32:\"u32\",S32:\"s32\",F32:\"f32\",F64:\"f64\",C64:\"c64\",C128:\"c128\",UNKNOWN:\"unknown\"});export{a as interpolationKebab,i as noDataInterpretationKebab,n as pixelTypeKebabDict};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as e}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{pixelTypeKebabDict as p}from\"./rasterEnums.js\";let i=class extends o{constructor(){super(...arguments),this.pixelType=\"unknown\"}};r([t({type:String,json:{write:!0}})],i.prototype,\"name\",void 0),r([t({type:String,json:{write:!0}})],i.prototype,\"description\",void 0),r([t({type:e,json:{type:e,write:!0,name:\"_object_id\"}})],i.prototype,\"id\",void 0),r([t({type:String,json:{type:p.jsonValues,read:p.read,write:p.write}})],i.prototype,\"pixelType\",void 0),r([t({type:String,json:{write:!0}})],i.prototype,\"type\",void 0),i=r([s(\"esri.layers.support.RasterFunctionInfo\")],i);const n=i;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as e}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";let p=class extends t{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type=\"RasterFunctionVariable\"}};o([r({type:String,json:{write:!0}})],p.prototype,\"name\",void 0),o([r({type:Number,json:{type:e,write:!0,name:\"_object_id\"}})],p.prototype,\"id\",void 0),o([r({type:Boolean,json:{write:!0}})],p.prototype,\"isDataset\",void 0),o([r({type:Boolean,json:{write:!0}})],p.prototype,\"isPublic\",void 0),o([r({json:{write:!0}})],p.prototype,\"value\",void 0),o([r({type:String,json:{write:!0}})],p.prototype,\"type\",void 0),p=o([s(\"esri.layers.support.RasterFunctionVariable\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as t}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./RasterFunctionVariable.js\";const i={key:\"type\",base:null,typeMap:{RasterFunctionVariable:p}};let a=class extends e{};o([r({types:i,json:{types:i,name:\"MatchVariable\"}})],a.prototype,\"matchVariable\",void 0),o([r({types:i,json:{types:i,name:\"UnionDimension\"}})],a.prototype,\"unionDimension\",void 0),o([r({type:Number,json:{type:t,write:!0,name:\"_object_id\"}})],a.prototype,\"id\",void 0),o([r({type:String,json:{write:!0}})],a.prototype,\"type\",void 0),a=o([s(\"esri.layers.support.RasterFunctionProperties\")],a);const n=a;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONMap as o}from\"../../core/jsonMap.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as p}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./RasterFunctionInfo.js\";import n from\"./RasterFunctionProperties.js\";const y=new o({0:\"mosaic\",1:\"item\",2:\"item-group\"},{useNumericKeys:!0});let a=class extends e{constructor(){super(...arguments),this.functionType=\"mosaic\",this.type=\"RasterFunctionTemplate\"}};t([r({type:[String],json:{write:!0}})],a.prototype,\"aliases\",void 0),t([r({type:Object,json:{write:!0}})],a.prototype,\"arguments\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"description\",void 0),t([r({type:s,json:{write:!0,name:\"function\"}})],a.prototype,\"functionInfo\",void 0),t([r({type:y.apiValues,json:{type:[0,1,2],read:y.read,write:y.write}})],a.prototype,\"functionType\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"group\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"help\",void 0),t([r({type:Number,json:{type:p,write:!0,name:\"_object_id\"}})],a.prototype,\"id\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"name\",void 0),t([r({type:String,json:{write:!0,name:\"definition\"}})],a.prototype,\"queryDefinition\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"tag\",void 0),t([r({type:n,json:{write:!0}})],a.prototype,\"properties\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"thumbnail\",void 0),t([r({type:String,json:{write:!0}})],a.prototype,\"thumbnailEx\",void 0),t([r({json:{type:[\"RasterFunctionTemplate\"],write:!0}})],a.prototype,\"type\",void 0),a=t([i(\"esri.layers.support.RasterFunctionTemplate\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{clone as n}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{enumeration as r}from\"../../core/accessorSupport/decorators/enumeration.js\";import{reader as s}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as a}from\"../../core/accessorSupport/decorators/writer.js\";import u from\"./RasterFunctionTemplate.js\";var c;const p=new Set([\"raster\",\"raster2\",\"dem\",\"fillraster\"]),m=new Set([\"rasters\"]),f=t=>t?.rasterFunction?d.fromJSON(t):t,l=t=>t&&t instanceof d?t.toJSON():t,y=t=>t?.functionName&&!t.declaredClass,F=t=>y(t)?new d(t):t,h=t=>{if(null==t)return null;t=n(t);const e={};for(const n of Object.keys(t))p.has(n.toLowerCase())?e[n]=f(t[n]):m.has(n.toLowerCase())&&Array.isArray(t[n])?e[n]=t[n].map(f):e[n]=t[n];return e},w={types:{key:\"type\",base:null,typeMap:{RasterFunctionTemplate:u}},json:{write:!0,name:\"rasterFunctionDefinition\"}};let d=c=class extends e{constructor(t){super(t),this.functionName=null,this.outputPixelType=\"unknown\",this.variableName=null,this.functionDefinition=null}set functionArguments(t){if(t){const e=Object.keys(t);if(e.some((e=>p.has(e.toLowerCase())&&y(t[e])))||e.some((e=>m.has(e.toLowerCase())&&Array.isArray(t[e])&&t[e].some((t=>y(t)))))){t=n(t);for(const n of e)p.has(n.toLowerCase())?t[n]=F(t[n]):m.has(n.toLowerCase())&&Array.isArray(t[n])&&(t[n]=t[n].map((t=>F(t))))}}this._set(\"functionArguments\",t)}readFunctionArguments(t){return h(t)}writeFunctionArguments(t,e,n){const o={};for(const r of Object.keys(t))p.has(r.toLowerCase())?o[r]=l(t[r]):m.has(r.toLowerCase())&&Array.isArray(t[r])?o[r]=t[r].map(l):o[r]=l(t[r]);e[n]=o}readFunctionName(t,e){const n=e.rasterFunctionInfos,o=e.name;return o||(n?.length&&\"None\"!==n[0].name?n[0].name:e.rasterFunctionDefinition?e.rasterFunctionDefinition.name:e.rasterFunction)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(t){this.functionDefinition=t?u.fromJSON(t):null}clone(){return new c({functionName:this.functionName,functionArguments:n(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:n(this.rasterFunctionDefinition)})}};t([o({json:{type:Object,name:\"rasterFunctionArguments\"}})],d.prototype,\"functionArguments\",null),t([s(\"functionArguments\")],d.prototype,\"readFunctionArguments\",null),t([a(\"functionArguments\")],d.prototype,\"writeFunctionArguments\",null),t([o({json:{type:String,write:{target:\"rasterFunction\"}}})],d.prototype,\"functionName\",void 0),t([s(\"functionName\",[\"rasterFunction\",\"rasterFunctionInfos\",\"rasterFunctionDefinition\"])],d.prototype,\"readFunctionName\",null),t([r({C128:\"c128\",C64:\"c64\",F32:\"f32\",F64:\"f64\",S16:\"s16\",S32:\"s32\",S8:\"s8\",U1:\"u1\",U16:\"u16\",U2:\"u2\",U32:\"u32\",U4:\"u4\",U8:\"u8\",UNKNOWN:\"unknown\"},{ignoreUnknown:!1}),o({json:{default:\"unknown\"}})],d.prototype,\"outputPixelType\",void 0),t([o({type:String,json:{read:!0,write:!0}})],d.prototype,\"variableName\",void 0),t([o()],d.prototype,\"rasterFunctionDefinition\",null),t([o(w)],d.prototype,\"functionDefinition\",void 0),d=c=t([i(\"esri.layers.support.RasterFunction\")],d);const N=d;export{N as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst e={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:\"ComputeGamma\",type:\"RasterFunctionVariable\",value:!1},DRA:{isDataset:!1,isPublic:!1,name:\"DRA\",type:\"RasterFunctionVariable\",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:\"EstimateStatsHistogram\",type:\"RasterFunctionVariable\",value:!1},Gamma:{displayName:\"Gamma\",isDataset:!1,isPublic:!1,name:\"Gamma\",type:\"RasterFunctionVariable\"},Histograms:{isDataset:!1,isPublic:!1,name:\"Histograms\",type:\"RasterFunctionVariable\"},Max:{isDataset:!1,isPublic:!1,name:\"Max\",type:\"RasterFunctionVariable\",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:\"MaxPercent\",type:\"RasterFunctionVariable\",value:.5},Min:{isDataset:!1,isPublic:!1,name:\"Min\",type:\"RasterFunctionVariable\",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:\"MinPercent\",type:\"RasterFunctionVariable\",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:\"NumberOfStandardDeviation\",type:\"RasterFunctionVariable\",value:2},Raster:{isDataset:!0,isPublic:!1,name:\"Raster\",type:\"RasterFunctionVariable\"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:\"SigmoidStrengthLevel\",type:\"RasterFunctionVariable\",value:2},Statistics:{isDataset:!1,isPublic:!1,name:\"Statistics\",type:\"RasterFunctionVariable\"},StretchType:{isDataset:!1,isPublic:!1,name:\"StretchType\",type:\"RasterFunctionVariable\",value:0},type:\"StretchFunctionArguments\",UseGamma:{isDataset:!1,isPublic:!1,name:\"UseGamma\",type:\"RasterFunctionVariable\",value:!1}},description:\"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.\",function:{description:\"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.\",name:\"Stretch\",pixelType:\"UNKNOWN\",type:\"StretchFunction\"},functionType:0,name:\"Stretch\",thumbnail:\"\"},RemapFunction:{name:\"Remap\",description:\"Changes pixel values by assigning new values to ranges of pixel values or using an external table.\",function:{type:\"RemapFunction\",pixelType:\"UNKNOWN\",name:\"Remap\",description:\"Changes pixel values by assigning new values to ranges of pixel values or using an external table.\"},arguments:{Raster:{name:\"Raster\",isPublic:!1,isDataset:!0,type:\"RasterFunctionVariable\"},UseTable:{name:\"UseTable\",isPublic:!1,isDataset:!1,value:!1,type:\"RasterFunctionVariable\"},InputRanges:{name:\"InputRanges\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\",displayName:\"Input Ranges\"},OutputValues:{name:\"OutputValues\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\",displayName:\"Output Values\"},NoDataRanges:{name:\"NoDataRanges\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\",displayName:\"NoData Ranges\"},Table:{name:\"Table\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},InputField:{name:\"InputField\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},OutputField:{name:\"OutputField\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},InputMaxField:{name:\"InputMaxField\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},RemapTableType:{name:\"RemapTableType\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},AllowUnmatched:{name:\"AllowUnmatched\",isPublic:!1,isDataset:!1,value:!0,type:\"RasterFunctionVariable\"},type:\"RemapFunctionArguments\"},functionType:0,thumbnail:\"\"},ColormapFunction:{name:\"Colormap\",description:\"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.\",function:{type:\"ColormapFunction\",pixelType:\"UNKNOWN\",name:\"Colormap\",description:\"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.\"},arguments:{Raster:{name:\"Raster\",isPublic:!1,isDataset:!0,type:\"RasterFunctionVariable\"},ColorSchemeType:{name:\"ColorSchemeType\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},Colormap:{name:\"Colormap\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},ColormapName:{name:\"ColormapName\",isPublic:!1,isDataset:!1,value:\"Gray\",type:\"RasterFunctionVariable\"},ColorRamp:{name:\"ColorRamp\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},type:\"ColormapFunctionArguments\"},functionType:0,thumbnail:\"\"},ShadedReliefFunction:{name:\"Shaded Relief\",description:\"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.\",function:{type:\"ShadedReliefFunction\",pixelType:\"UNKNOWN\",name:\"Shaded Relief\",description:\"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.\"},arguments:{Raster:{name:\"Raster\",isPublic:!1,isDataset:!0,type:\"RasterFunctionVariable\"},ColorSchemeType:{name:\"ColorSchemeType\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},ColorRamp:{name:\"ColorRamp\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},HillshadeType:{name:\"HillshadeType\",isPublic:!1,isDataset:!1,value:0,type:\"RasterFunctionVariable\"},Colormap:{name:\"Colormap\",isPublic:!1,isDataset:!1,type:\"RasterFunctionVariable\"},Azimuth:{name:\"Azimuth\",isPublic:!1,isDataset:!1,value:315,type:\"RasterFunctionVariable\"},Altitude:{name:\"Altitude\",isPublic:!1,isDataset:!1,value:45,type:\"RasterFunctionVariable\"},SlopeType:{name:\"SlopeType\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},ZFactor:{name:\"ZFactor\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},PSPower:{name:\"PSPower\",isPublic:!1,isDataset:!1,value:.664,type:\"RasterFunctionVariable\"},PSZFactor:{name:\"PSZFactor\",isPublic:!1,isDataset:!1,value:.024,type:\"RasterFunctionVariable\"},RemoveEdgeEffect:{name:\"RemoveEdgeEffect\",isPublic:!1,isDataset:!1,value:!1,type:\"RasterFunctionVariable\"},type:\"ShadedReliefFunctionArguments\"},functionType:0,thumbnail:\"\"},HillshadeFunction:{name:\"Hillshade\",description:\"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image\",function:{type:\"HillshadeFunction\",pixelType:\"UNKNOWN\",name:\"Hillshade\",description:\"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image\"},arguments:{DEM:{name:\"DEM\",isPublic:!1,isDataset:!0,type:\"RasterFunctionVariable\"},HillshadeType:{name:\"HillshadeType\",isPublic:!1,isDataset:!1,value:0,type:\"RasterFunctionVariable\"},Azimuth:{name:\"Azimuth\",isPublic:!1,isDataset:!1,value:315,type:\"RasterFunctionVariable\"},Altitude:{name:\"Altitude\",isPublic:!1,isDataset:!1,value:45,type:\"RasterFunctionVariable\"},SlopeType:{name:\"SlopeType\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},ZFactor:{name:\"ZFactor\",isPublic:!1,isDataset:!1,value:1,type:\"RasterFunctionVariable\"},PSPower:{name:\"PSPower\",isPublic:!1,isDataset:!1,value:.664,type:\"RasterFunctionVariable\"},PSZFactor:{name:\"PSZFactor\",isPublic:!1,isDataset:!1,value:.024,type:\"RasterFunctionVariable\"},RemoveEdgeEffect:{name:\"RemoveEdgeEffect\",isPublic:!1,isDataset:!1,value:!1,type:\"RasterFunctionVariable\"},type:\"HillshadeFunctionArguments\"},functionType:0,thumbnail:\"\"},ResampleFunction:{name:\"Resample\",description:\"Changes the cell size of a raster.\",function:{type:\"ResampleFunction\",pixelType:\"UNKNOWN\",name:\"Resample\",description:\"Changes the cell size of a raster.\"},arguments:{Raster:{name:\"Raster\",isPublic:!1,isDataset:!0,type:\"RasterFunctionVariable\"},ResamplingType:{name:\"ResamplingType\",isPublic:!1,isDataset:!1,value:0,type:\"RasterFunctionVariable\"},InputCellSize:{name:\"InputCellsize\",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:\"RasterFunctionVariable\"},OutputCellSize:{name:\"OutputCellsize\",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:\"RasterFunctionVariable\"},type:\"ResampleFunctionArguments\"},functionType:0,thumbnail:\"\"}};export{e as schema};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as e}from\"../../core/lang.js\";import n from\"./RasterFunction.js\";import{getPixelValueRange as t}from\"./rasterFormats/pixelRangeUtils.js\";import{schema as r}from\"./rasterFunctions/rasterFunctionSchema.js\";import{getRFxArgColorRampValue as o,convertColorRampToColormap as a,getColorRampName as i,convertRGBATo32Bit as s}from\"../../renderers/support/colorRampUtils.js\";import{stretchTypeJSONDict as u}from\"../../renderers/support/stretchRendererUtils.js\";import l from\"../../renderers/visualVariables/SizeVariable.js\";const c=new Set([\"u1\",\"u2\",\"u4\",\"u8\",\"s8\",\"u16\",\"s16\"]),m={simple_scalar:\"Simple Scalar\",wind_barb:\"Wind Barb\",single_arrow:\"Single Arrow\",beaufort_kn:\"Beaufort Wind (Knots)\",beaufort_m:\"Beaufort Wind (MetersPerSecond)\",ocean_current_m:\"Ocean Current (MetersPerSecond)\",ocean_current_kn:\"Ocean Current (Knots)\"},f=new Set([\"raster-stretch\",\"unique-value\",\"class-breaks\",\"raster-shaded-relief\",\"vector-field\",\"raster-colormap\"]);function p(e){return f.has(e.type)}function g(n,t){if(!n||!t)return e(n||t);const r=e(n);if(r.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),d(r.functionDefinition.arguments,t),r.rasterFunctionDefinition=r.functionDefinition.toJSON()}else if(\"none\"!==t.functionName?.toLowerCase()){b(r.functionArguments).Raster=t}return r}function d(e,n){for(const t in e)\"raster\"===t.toLowerCase()&&(\"RasterFunctionVariable\"===e[t].type?(e[t]=n.rasterFunctionDefinition,e[t].type=\"RasterFunctionTemplate\"):\"RasterFunctionTemplate\"===e[t].type&&d(e[t].arguments,n))}function h(n){const t=e(r[n.functionName+\"Function\"]),o=n.functionArguments;for(const e in o)\"raster\"===e.toLowerCase()?(t.arguments[e]=h(o[e]),t.arguments[e].type=\"RasterFunctionTemplate\"):\"colormap\"===e.toLowerCase()?(t.arguments[e].value=V(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function y(e,n){switch(n=n||{},e.type){case\"raster-stretch\":return w(e,n);case\"class-breaks\":return S(e,n);case\"unique-value\":return F(e,n);case\"raster-colormap\":return A(e,n);case\"vector-field\":return T(e,n);case\"raster-shaded-relief\":return v(e,n);case\"flow\":throw new Error(\"Unsupported rendering rule.\")}}function b(e){const n=e?.Raster??e?.raster;return n&&\"esri.layers.support.RasterFunction\"===n.declaredClass?b(n.functionArguments):e}const R={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function T(e,t){const r=new n;r.functionName=\"VectorFieldRenderer\";const{dataType:o,bandNames:a}=t,i=\"vector-uv\"===o;let s,u;if(a&&2===a.length){const e=a.map((e=>e.toLowerCase()));s=e.indexOf(\"magnitude\"),u=e.indexOf(\"direction\")}-1!==s&&null!==s||(s=0,u=1);const c=\"arithmetic\"===e.rotationType?1:2,f=\"flow-from\"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>\"Magnitude\"===e.field)):new l,g={magnitudeBandID:s,directionBandID:u,isUVComponents:i,referenceSystem:c,massFlowAngleRepresentation:f,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:\"Vector Average\",symbologyName:m[e.style.toLowerCase().replace(\"-\",\"_\")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};r.functionArguments=g;const d=h(r);return t.convertToRFT?n.fromJSON({rasterFunctionDefinition:d}):r}function v(e,t){const r=t.convertToRFT;if(\"elevation\"!==t.dataType&&(\"generic\"!==t.dataType||1!==t.bandCount||\"s16\"!==t.pixelType&&\"s32\"!==t.pixelType&&\"f32\"!==t.pixelType&&\"f64\"!==t.pixelType))return new n;const i=new n;i.functionName=\"Hillshade\";const s=\"traditional\"===e.hillshadeType?0:1,u=\"none\"===e.scalingType?1:3,l={HillshadeType:s,SlopeType:u,ZFactor:e.zFactor};return 0===s&&(l.Azimuth=e.azimuth,l.Altitude=e.altitude),3===u&&(l.PSPower=e.pixelSizePower,l.PSZFactor=e.pixelSizeFactor),i.functionArguments=l,i.variableName=\"Raster\",e.colorRamp&&(i.functionName=\"ShadedRelief\",r?l.ColorRamp=o(e.colorRamp):l.Colormap=a(e.colorRamp)),r?new n({rasterFunctionDefinition:h(i)}):i}function w(e,t){const r=t.convertToRFT,s=new n;s.functionName=\"Stretch\";const l=R[u.toJSON(e.stretchType)],c=\"u8\",m={StretchType:l,Statistics:N(e.statistics??[]),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(m.Min=e.outputMin),null!=e.outputMax&&(m.Max=e.outputMax),l===R.standardDeviation?(m.NumberOfStandardDeviations=e.numberOfStandardDeviations,s.outputPixelType=c):l===R.percentClip?(m.MinPercent=e.minPercent,m.MaxPercent=e.maxPercent,s.outputPixelType=c):l===R.minMax?s.outputPixelType=c:l===R.sigmoid&&(m.SigmoidStrengthLevel=e.sigmoidStrengthLevel),s.functionArguments=m,s.variableName=\"Raster\",e.colorRamp){const u=e.colorRamp,l=new n;if(r)l.functionArguments={ColorRamp:o(u)};else{const n=i(u,!0);if(n)l.functionArguments={colorRampName:n};else if(!t.convertColorRampToColormap||\"algorithmic\"!==u.type&&\"multipart\"!==u.type){const n=e.colorRamp.toJSON();\"algorithmic\"===n.type?n.algorithm=n.algorithm||\"esriCIELabAlgorithm\":\"multipart\"===n.type&&n.colorRamps?.length&&n.colorRamps.forEach((e=>e.algorithm=e.algorithm||\"esriCIELabAlgorithm\")),l.functionArguments={colorRamp:n}}else l.functionArguments={Colormap:a(u)}}return l.variableName=\"Raster\",l.functionName=\"Colormap\",l.functionArguments.Raster=s,r?new n({rasterFunctionDefinition:h(l)}):l}return r?new n({rasterFunctionDefinition:h(s)}):s}function S(e,t){const r=[],o=[],a=[],i=[],s=1e-4,{pixelType:u,rasterAttributeTable:l}=t,c=null==l?null:l.features,m=C(l);if(m&&c&&Array.isArray(c)&&e.classBreakInfos){e.classBreakInfos.forEach(((n,t)=>{const r=n.symbol?.color;let o;r?.a&&null!=n.minValue&&null!=n.maxValue&&c.forEach((a=>{null!=n.minValue&&null!=n.maxValue&&(o=a.attributes[e.field],(o>=n.minValue&&o=n.minValue)&&i.push([a.attributes[m],r.r,r.g,r.b]))}))}));const r=u?x(i,u):i,o=new n;return o.functionName=\"Colormap\",o.functionArguments={},o.functionArguments.Colormap=r,o.variableName=\"Raster\",t.convertToRFT?new n({rasterFunctionDefinition:h(o)}):o}e.classBreakInfos.forEach(((e,n)=>{if(null==e.minValue||null==e.maxValue)return;const t=e.symbol&&e.symbol.color;t?.a?(0===n?r.push(e.minValue,e.maxValue+s):r.push(e.minValue+s,e.maxValue+s),o.push(n),i.push([n,t.r,t.g,t.b])):a.push(e.minValue,e.maxValue)}));const f=u?x(i,u):i,p=new n;p.functionName=\"Remap\",p.functionArguments={InputRanges:r,OutputValues:o,NoDataRanges:a},p.variableName=\"Raster\";const g=new n;return g.functionName=\"Colormap\",g.functionArguments={Colormap:f,Raster:p},t.convertToRFT?new n({rasterFunctionDefinition:h(g)}):g}function x(e,n){const r=c.has(n)?t(n):null;return r&&e.push([Math.floor(r[0]-1),0,0,0],[Math.ceil(r[1]+1),0,0,0]),e}function C(e){if(null==e)return;const{fields:n}=e,t=n?.find((e=>e?.name&&\"value\"===e.name.toLowerCase()));return t?.name}function F(e,t){const r=[],{pixelType:o,rasterAttributeTable:a}=t,i=null==a?null:a.features,s=C(a),u=e.defaultSymbol?.color?.toRgb(),l=e.uniqueValueInfos;if(l)if(i){if(s){const n=new Map;l.forEach((e=>{const t=e.value,r=e.symbol?.color;null!=t&&r?.a&&n.set(String(t),r.toRgb())}));const t=e.field;i.forEach((({attributes:e})=>{const o=String(e[t]),a=e[s],i=n.get(o);i?r.push([a,...i]):u&&r.push([a,...u])}))}}else for(let n=0;n{const t=e;if(Array.isArray(t))n.push(t);else{if(null==t.min||null==t.max)return;const e=[t.min,t.max,t.avg||0,t.stddev||0];n.push(e)}})),n}function V(e){const n=[],t=[];return e.forEach((e=>{n.push(e[0]),t.push(s([...e.slice(1),255]))})),{type:\"RasterColormap\",values:n,colors:t}}export{g as combineRenderingRules,y as convertRendererToRenderingRule,h as convertRenderingRuleToRFT,p as isSupportedRendererType};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{deprecatedProperty as t}from\"../../core/deprecate.js\";import{strict as o}from\"../../core/jsonMap.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as i}from\"../../core/lang.js\";import s from\"../../core/Logger.js\";import{property as n}from\"../../core/accessorSupport/decorators/property.js\";import{cast as a}from\"../../core/accessorSupport/decorators/cast.js\";import{reader as c}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as l}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as p}from\"../../core/accessorSupport/decorators/writer.js\";import{Integer as d}from\"../../core/accessorSupport/ensureType.js\";import m from\"../../geometry/Point.js\";import u from\"./DimensionalDefinition.js\";import h from\"./RasterFunction.js\";var w;const y=o()({MT_FIRST:\"first\",MT_LAST:\"last\",MT_MIN:\"min\",MT_MAX:\"max\",MT_MEAN:\"mean\",MT_BLEND:\"blend\",MT_SUM:\"sum\"}),M=o()({esriMosaicNone:\"none\",esriMosaicCenter:\"center\",esriMosaicNadir:\"nadir\",esriMosaicViewpoint:\"viewpoint\",esriMosaicAttribute:\"attribute\",esriMosaicLockRaster:\"lock-raster\",esriMosaicNorthwest:\"northwest\",esriMosaicSeamline:\"seamline\"});function g(e){let t;switch(e?e.toLowerCase().replace(\"esrimosaic\",\"\"):\"\"){case\"byattribute\":case\"attribute\":t=\"esriMosaicAttribute\";break;case\"lockraster\":t=\"esriMosaicLockRaster\";break;case\"center\":t=\"esriMosaicCenter\";break;case\"northwest\":t=\"esriMosaicNorthwest\";break;case\"nadir\":t=\"esriMosaicNadir\";break;case\"viewpoint\":t=\"esriMosaicViewpoint\";break;case\"seamline\":t=\"esriMosaicSeamline\";break;default:t=\"esriMosaicNone\"}return M.fromJSON(t)}let f=w=class extends r{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}get itemRenderingRule(){return t(s.getLogger(this),\"itemRenderingRule\",{replacement:\"itemRasterFunction\",version:\"4.27\",warnOnce:!0}),this._get(\"itemRasterFunction\")}set itemRenderingRule(e){t(s.getLogger(this),\"itemRenderingRule\",{replacement:\"itemRasterFunction\",version:\"4.27\",warnOnce:!0}),this._set(\"itemRasterFunction\",e)}readMethod(e,t){return g(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,o){null!=e&&(e=e.filter((({variableName:e,dimensionName:t})=>e&&\"*\"!==e||t))).length&&(t[o]=e.map((e=>e.toJSON())))}readOperation(e,t){const o=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),i=o||(r?y.toJSON(r):null);return y.fromJSON(i)||\"first\"}castSortValue(e){return null==e||\"string\"==typeof e||\"number\"==typeof e?e:`${e}`}clone(){return new w({ascending:this.ascending,itemRasterFunction:i(this.itemRasterFunction),lockRasterIds:i(this.lockRasterIds),method:this.method,multidimensionalDefinition:i(this.multidimensionalDefinition),objectIds:i(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:i(this.viewpoint),where:this.where})}};e([n({type:Boolean,json:{write:!0}})],f.prototype,\"ascending\",void 0),e([c(\"ascending\",[\"ascending\",\"sortAscending\"])],f.prototype,\"readAscending\",null),e([n({type:h,json:{name:\"itemRenderingRule\",write:!0}})],f.prototype,\"itemRasterFunction\",void 0),e([n({type:h})],f.prototype,\"itemRenderingRule\",null),e([n({type:[d],json:{write:{overridePolicy(){return{enabled:\"lock-raster\"===this.method}}}}})],f.prototype,\"lockRasterIds\",void 0),e([n({type:String,json:{type:M.jsonValues,write:{target:\"mosaicMethod\",writer:M.write}}})],f.prototype,\"method\",void 0),e([c(\"method\",[\"mosaicMethod\",\"defaultMosaicMethod\"])],f.prototype,\"readMethod\",null),e([n({type:[u],json:{write:!0}})],f.prototype,\"multidimensionalDefinition\",void 0),e([p(\"multidimensionalDefinition\")],f.prototype,\"writeMultidimensionalDefinition\",null),e([n({type:[d],json:{name:\"fids\",write:!0}})],f.prototype,\"objectIds\",void 0),e([n({json:{type:y.jsonValues,read:{reader:y.read},write:{target:\"mosaicOperation\",writer:y.write}}})],f.prototype,\"operation\",void 0),e([c(\"operation\",[\"mosaicOperation\",\"mosaicOperator\"])],f.prototype,\"readOperation\",null),e([n({type:String,json:{write:{overridePolicy(){return{enabled:\"attribute\"===this.method}}}}})],f.prototype,\"sortField\",void 0),e([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:\"attribute\"===this.method,allowNull:!0}}}}})],f.prototype,\"sortValue\",void 0),e([a(\"sortValue\")],f.prototype,\"castSortValue\",null),e([n({type:m,json:{write:!0}})],f.prototype,\"viewpoint\",void 0),e([n({type:String,json:{write:!0}})],f.prototype,\"where\",void 0),f=w=e([l(\"esri.layers.support.MosaicRule\")],f);const j=f;export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../../core/accessorSupport/decorators/writer.js\";import{isSupportedRendererType as n,combineRenderingRules as s,convertRendererToRenderingRule as a,convertRenderingRuleToRFT as p}from\"./imageryRendererUtils.js\";import l from\"./MosaicRule.js\";import{interpolationKebab as c,noDataInterpretationKebab as m}from\"./rasterEnums.js\";import u from\"./RasterFunction.js\";let y=class extends t{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(e,t,r){this.layer.version<10.3||(t[r]=e)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(e,t,r){this.format&&this.format.toLowerCase().includes(\"jpg\")&&null!=e&&(t[r]=e)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(e,t,r){\"lerc\"===this.format&&null!=e&&(t[r]=e)}get format(){return\"vector-field\"===this.layer.renderer?.type?\"lerc\":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(e,t,r){\"lerc\"===this.format&&this.layer.version>=10.5&&(t[r]=e)}get version(){const e=this.layer;return e.commitProperty(\"bandIds\"),e.commitProperty(\"format\"),e.commitProperty(\"compressionQuality\"),e.commitProperty(\"compressionTolerance\"),e.commitProperty(\"interpolation\"),e.commitProperty(\"noData\"),e.commitProperty(\"noDataInterpretation\"),e.commitProperty(\"mosaicRule\"),e.commitProperty(\"rasterFunction\"),e.commitProperty(\"adjustAspectRatio\"),e.commitProperty(\"pixelFilter\"),e.commitProperty(\"definitionExpression\"),e.commitProperty(\"multidimensionalSubset\"),(this._get(\"version\")||0)+1}set version(e){this._set(\"version\",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const r=e.definitionExpression;return t?r&&r!==t.where&&(t=t.clone(),t.where=r):r&&(t=new l({where:r})),t}get rasterFunction(){const e=this.layer;let{rasterFunction:t}=e;const r=e.pixelFilter,o=!e.format||e.format.includes(\"jpg\")||e.format.includes(\"png\");t=this._addResampleRasterFunction(t);const i=e.multidimensionalSubset?.areaOfInterest;return i&&(t=this._addClipFunction(t,i)),o&&!r&&\"vector-field\"!==e.renderer?.type&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(e){const t=this.layer,{rasterInfo:r,renderer:o}=t;if(e=e||t.rasterFunction,!o||!n(o))return e;return s(a(o,{rasterAttributeTable:r.attributeTable,pixelType:r.pixelType,dataType:r.dataType,bandNames:r.bandInfos.map((({name:e})=>e)),convertColorRampToColormap:t.version<10.6,convertToRFT:!!e?.rasterFunctionDefinition,bandCount:r.bandCount}),e)}_addResampleRasterFunction(e){if(!(\"vector-field\"===this.layer.renderer?.type)||\"Resample\"===e?.functionName)return e;const t=\"esriImageServiceDataTypeVector-UV\"===this.layer.serviceDataType?7:10,r=this.layer.serviceRasterInfo.pixelSize;let o=new u({functionName:\"Resample\",functionArguments:{ResamplingType:t,InputCellSize:r}});return o=e?.rasterFunctionDefinition?new u({rasterFunctionDefinition:p(o)}):o,s(o,e)}_addClipFunction(e,t){const r=new u({functionName:\"Clip\",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return s(r,e)}};e([r()],y.prototype,\"layer\",void 0),e([r({json:{write:!0}})],y.prototype,\"adjustAspectRatio\",null),e([i(\"adjustAspectRatio\")],y.prototype,\"writeAdjustAspectRatio\",null),e([r({json:{write:!0}})],y.prototype,\"bandIds\",null),e([r({json:{write:!0}})],y.prototype,\"compression\",void 0),e([r({json:{write:!0}})],y.prototype,\"compressionQuality\",null),e([i(\"compressionQuality\")],y.prototype,\"writeCompressionQuality\",null),e([r({json:{write:!0}})],y.prototype,\"compressionTolerance\",null),e([i(\"compressionTolerance\")],y.prototype,\"writeCompressionTolerance\",null),e([r({json:{write:!0}})],y.prototype,\"format\",null),e([r({type:String,json:{read:{reader:c.read},write:{writer:c.write}}})],y.prototype,\"interpolation\",null),e([r({json:{write:!0}})],y.prototype,\"noData\",null),e([r({type:String,json:{read:{reader:m.read},write:{writer:m.write}}})],y.prototype,\"noDataInterpretation\",null),e([r({json:{write:!0}})],y.prototype,\"pixelType\",void 0),e([r({json:{write:!0}})],y.prototype,\"lercVersion\",void 0),e([i(\"lercVersion\")],y.prototype,\"writeLercVersion\",null),e([r({type:Number})],y.prototype,\"version\",null),e([r({json:{write:!0}})],y.prototype,\"mosaicRule\",null),e([r({json:{write:!0,name:\"renderingRule\"}})],y.prototype,\"rasterFunction\",null),y=e([o(\"esri.layers.mixins.ExportImageServiceParameters\")],y);export{y as ExportImageServiceParameters};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"../../geometry/Extent.js\";import n from\"../../geometry/Polygon.js\";import{fromJSON as i}from\"../../geometry/support/jsonUtils.js\";import a from\"./DimensionalDefinition.js\";import p from\"../../geometry/Geometry.js\";var l;const m={base:p,key:\"type\",typeMap:{extent:o,polygon:n}};let u=l=class extends t{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(null==e||0===e.length)return[];const t=new Map;e.forEach((e=>{if(!e.dimensionName)return;let s,r;if(Array.isArray(e.values[0])){const t=e.values;s=t[0][0],r=t[e.values.length-1][1]}else{const t=e.values;s=t[0],r=t[e.values.length-1]}if(t.has(e.dimensionName)){const o=t.get(e.dimensionName);o[0]=Math.min(s,o[0]),o[1]=Math.max(r,o[1])}else t.set(e.dimensionName,[s,r])}));const s=[];for(const r of t)s.push({name:r[0],extent:r[1]});return s}get variables(){const{subsetDefinitions:e}=this;if(null==e||0===e.length)return[];const t=new Set;return e.forEach((e=>{e.variableName&&t.add(e.variableName)})),[...t]}clone(){const e=this.subsetDefinitions?.map((e=>e.clone())),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new l({areaOfInterest:t,subsetDefinitions:e})}};e([s({types:m,json:{read:i,write:!0}})],u.prototype,\"areaOfInterest\",void 0),e([s({readOnly:!0})],u.prototype,\"dimensions\",null),e([s({readOnly:!0})],u.prototype,\"variables\",null),e([s({type:[a],json:{write:!0}})],u.prototype,\"subsetDefinitions\",void 0),u=l=e([r(\"esri.layers.support.MultidimensionalSubset\")],u);const c=u;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import{open as r}from\"../../core/workers/workers.js\";import o from\"./PixelBlock.js\";class t{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await r(\"RasterWorker\");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const n=await this._workerThread.invoke(\"convertVectorFieldData\",{pixelBlock:r.pixelBlock.toJSON(),type:r.dataType},t);return n?new o(n):null}computeStatisticsHistograms(r,o){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");return this._workerThread.invoke(\"computeStatisticsHistograms\",{pixelBlock:r.pixelBlock.toJSON()},o)}async decode(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const n=await this._workerThread.invoke(\"decode\",r,t);return n?new o(n):null}async symbolize(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const n={extent:r.extent?.toJSON(),pixelBlock:r.pixelBlock?.toJSON(),simpleStretchParams:r.simpleStretchParams,bandIds:r.bandIds},a=await this._workerThread.invoke(\"symbolize\",n,t);return a?new o(a):null}async updateSymbolizer(r,o){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const t=r?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast(\"updateSymbolizer\",{symbolizerJSON:r.toJSON(),histograms:t},o))}async updateRasterFunction(r,o){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");await Promise.all(this._workerThread.broadcast(\"updateRasterFunction\",{rasterFunctionJSON:r.toJSON()},o))}async process(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const n=await this._workerThread.invoke(\"process\",{extent:r.extent?.toJSON(),primaryPixelSizes:r.primaryPixelSizes?.map((e=>null!=e?e.toJSON():null)),primaryPixelBlocks:r.primaryPixelBlocks.map((e=>null!=e?e.toJSON():null)),primaryRasterIds:r.primaryRasterIds},t);return n?new o(n):null}async stretch(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");if(!r?.pixelBlock)return null;const n={srcPixelBlock:r.pixelBlock.toJSON(),stretchParams:r.stretchParams},a=await this._workerThread.invoke(\"stretch\",n,t);return a?new o(a):null}async split(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");if(!r?.pixelBlock)return null;const n={srcPixelBlock:r.pixelBlock.toJSON(),tileSize:r.tileSize,maximumPyramidLevel:r.maximumPyramidLevel},a=await this._workerThread.invoke(\"split\",n,t);return a&&a.forEach(((e,r)=>{a.set(r,e?o.fromJSON(e):null)})),a}async estimateStatisticsHistograms(r,o){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");if(!r?.pixelBlock)return null;const t={srcPixelBlock:r.pixelBlock.toJSON()};return await this._workerThread.invoke(\"estimateStatisticsHistograms\",t,o)}async mosaicAndTransform(r,t){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");if(!r?.srcPixelBlocks?.length)return{pixelBlock:null};const n={...r,srcPixelBlocks:r.srcPixelBlocks.map((e=>null!=e?e.toJSON():null))},a=await this._workerThread.invoke(\"mosaicAndTransform\",n,t);return{pixelBlock:a.pixelBlock?new o(a.pixelBlock):null,localNorthDirections:a.localNorthDirections}}async createFlowMesh(r,o){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const t={buffer:r.flowData.data.buffer,maskBuffer:r.flowData.mask.buffer,width:r.flowData.width,height:r.flowData.height},{meshType:n,simulationSettings:a}=r,i=await this._workerThread.invoke(\"createFlowMesh\",{meshType:n,flowData:t,simulationSettings:a},{...o,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(i.vertexBuffer),indexData:new Uint32Array(i.indexBuffer)}}getProjectionOffsetGrid(r,o){if(!this._workerThread)throw new e(\"raster-jobhandler:no-connection\",\"no available worker connection\");const t=null!=r.datumTransformation?r.datumTransformation.steps.map((e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse}))):null,n=null!=r.rasterTransform?r.rasterTransform.toJSON():null,a={projectedExtent:r.projectedExtent.toJSON(),srcBufferExtent:r.srcBufferExtent.toJSON(),pixelSize:r.pixelSize,hasWrapAround:r.hasWrapAround,spacing:r.spacing,datumTransformationSteps:t,rasterTransform:n,isAdaptive:r.isAdaptive,includeGCSGrid:r.includeGCSGrid};return this._workerThread.invoke(\"getProjectionOffsetGrid\",a,o)}}export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../Color.js\";import\"../../rasterRenderers.js\";import{getMetersPerUnitForSR as t}from\"../../core/unitUtils.js\";import n from\"../../layers/support/Field.js\";import a from\"../FlowRenderer.js\";import l from\"./AuthoringInfo.js\";import r from\"./ClassBreakInfo.js\";import{predefinedJsonColorRamps as s,convertColorRampToColormap as i}from\"./colorRampUtils.js\";import{isVectorFieldRendererSupported as o,isColormapRendererSupported as u,isUVRendererSupported as m,isClassBreaksSupported as c,isShadedReliefRendererSupported as f,isFlowRendererSupported as p}from\"./rasterRendererChecks.js\";import d from\"./UniqueValueInfo.js\";import h from\"../../rest/support/ClassBreaksDefinition.js\";import{createGenerateRendererClassBreaks as b}from\"../../rest/support/generateRendererUtils.js\";import g from\"../../rest/support/MultipartColorRamp.js\";import y from\"../RasterStretchRenderer.js\";import v from\"../UniqueValueRenderer.js\";import C from\"../RasterColormapRenderer.js\";import w from\"../RasterShadedReliefRenderer.js\";import x from\"../ClassBreaksRenderer.js\";import M from\"../VectorFieldRenderer.js\";const R=.25,T=g.fromJSON({type:\"multipart\",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),j=g.fromJSON(s[0]),I=new Set([\"scientific\",\"standard-time\",\"vector-uv\",\"vector-magdir\",\"vector-u\",\"vector-v\",\"vector-magnitude\",\"vector-direction\"]);function V(e,t){const{attributeTable:n,colormap:a}=e;if(o(e)){const t=_(e);if(null!=t)return t}if(null!=a){const t=O(e);if(null!=t)return t}if(null!=n){const t=W(e);if(null!=t)return t}return L(e,t)}function k(e,t=!1){const n=[\"raster-stretch\"];return u(e,t)&&n.push(\"raster-colormap\"),m(e)&&n.push(\"unique-value\"),c(e,t)&&n.push(\"class-breaks\"),f(e)&&n.push(\"raster-shaded-relief\"),o(e)&&n.push(\"vector-field\"),p(e)&&n.push(\"flow\"),n}function S(e,t,n){const a=[\"nearest\",\"bilinear\",\"cubic\",\"majority\"].find((e=>e===n?.toLowerCase()));if(\"Map\"===t)return a??\"bilinear\";if(\"standard-time\"===e.dataType)return a??\"nearest\";return\"thematic\"===e.dataType||e.attributeTable||e.colormap?\"nearest\"===a||\"majority\"===a?a:\"nearest\":a??\"bilinear\"}function L(e,t){e=B(e,t?.variableName);const{bandCount:n}=e;let{bandIds:a,stretchType:l}=t||{};a?.some((e=>e>=n))&&(a=null);let r=e.statistics,s=e.histograms;n>1?(a=a?.length?a:E(e),r=null==r?null:a?.map((e=>r[e])),s=null==s?null:a?.map((e=>s[e]))):a=[0],null==l&&(l=z(e));let i=!1;switch(l){case\"none\":i=!1;break;case\"percent-clip\":i=!s?.length;break;default:i=!r?.length}const{dataType:o}=e,u=1===a?.length&&I.has(o)?T:null,m=new y({stretchType:l,dynamicRangeAdjustment:i,colorRamp:u,outputMin:0,outputMax:255,gamma:1===a?.length?[1]:[1,1,1],useGamma:!1});return\"percent-clip\"===l?m.maxPercent=m.minPercent=R:\"standard-deviation\"===l&&(m.numberOfStandardDeviations=2),i||null==e.multidimensionalInfo&&!t?.includeStatisticsInStretch||(\"percent-clip\"===l?m.histograms=s:\"min-max\"!==l&&\"standard-deviation\"!==l||(m.statistics=r)),m}function B(e,t){const{multidimensionalInfo:n}=e;if(!t||!n)return e;const a=n.variables.find((e=>e.name===t));if(!a)return e;if(e=e.clone(),a){const{statistics:t,histograms:n}=a;t?.length&&(e.statistics=t.map((e=>({min:e.min,max:e.max,avg:e.avg,stddev:e.stddev})))),n?.length&&(e.histograms=n)}return e}function E(e){const t=e.bandCount;if(1===t)return null;if(2===t)return[0];const{bandInfos:n}=e;let a;if(n.length===t){const{red:e,green:t,blue:l,nir:r}=F(n);null!=e&&null!=t&&null!=l?a=[e,t,l]:null!=r&&null!=e&&null!=t&&(a=[r,e,t])}return!a&&t>=3&&(a=[0,1,2]),a}function q(e,t){const n=e.bandInfos.map((({name:e})=>e));return t?.length?t.map((e=>n[e])):n}function F(e){const t={};for(let n=0;n=410&&e<=480&&l>=480&&l<=540?t.blue=n:null==t.green&&e>=490&&e<=560&&l>=560&&l<=610?t.green=n:null==t.red&&e>=595&&e<=670&&l>=660&&l<=730?t.red=n:null==t.nir&&e>=700&&e<=860&&l>=800&&l<=950&&(t.nir=n)}}return t}function z(e){let t=\"percent-clip\";const{pixelType:n,dataType:a,histograms:l,statistics:r,multidimensionalInfo:s}=e,i=I.has(a)||\"generic\"===a&&null!=s;return\"u8\"!==n||\"processed\"!==a&&null!=l&&null!=r?\"u8\"===n||\"elevation\"===a||i?t=\"min-max\":null!=l?t=\"percent-clip\":null!=r&&(t=\"min-max\"):t=\"none\",t}function W(t,n,a,r){if(!m(t,n))return null;const{attributeTable:s,statistics:o}=t,u=U(s,n),c=N(s,\"red\"),f=N(s,\"green\"),p=N(s,\"blue\"),h=new l,b=[],g=new Set,y=!!(c&&f&&p);if(null!=s)s.features.forEach((t=>{const n=t.attributes[u.name];if(!g.has(t.attributes[u.name])&&null!=n){g.add(n);const a=y&&(\"single\"===c.type||\"double\"===c.type)&&(\"single\"===f.type||\"double\"===f.type)&&(\"single\"===p.type||\"double\"===p.type)&&!s.features.some((e=>e.attributes[c.name]>1||e.attributes[f.name]>1||e.attributes[p.name]>1)),l=a?255:1;b.push(new d({value:t.attributes[u.name],label:t.attributes[u.name]+\"\",symbol:{type:\"simple-fill\",style:\"solid\",outline:null,color:new e(y?[t.attributes[c.name]*l,t.attributes[f.name]*l,t.attributes[p.name]*l,1]:[0,0,0,0])}}))}}));else if(o?.[0])for(let l=o[0].min;l<=o[0].max;l++)b.push(new d({value:l,label:l.toString(),symbol:{type:\"simple-fill\",style:\"solid\",outline:null,color:new e([0,0,0,0])}}));if(b.sort(((e,t)=>e.value&&\"string\"==typeof e.value.valueOf()?0:e.value>t.value?1:-1)),!y){const t=i(j,{numColors:b.length});b.forEach(((n,a)=>n.symbol.color=new e(t[a].slice(1,4)))),h.colorRamp=j}if(a||r){const t=a||i(r,{numColors:b.length}).map((e=>e.slice(1)));b.forEach(((n,a)=>n.symbol.color=new e(t[a]))),h.colorRamp=r}return new v({field:u.name,uniqueValueInfos:b,authoringInfo:h})}function U(e,t,a){let l;return null!=e?(l=t?e.fields.find((e=>t.toLowerCase()===e.name.toLowerCase())):D(e.fields),l||(a||(l=e.fields.find((e=>\"string\"===e.type))),l||(l=N(e,\"value\")))):l=new n({name:\"value\"}),l}function D(e){let t;for(let n=0;ne.name.toLowerCase()===t))}function O(e){if(!u(e))return null;let t;const{attributeTable:n,colormap:a}=e;if(null!=n){const e=N(n,\"value\"),a=U(n,null,!0);\"string\"===a.type&&(t={},n.features.forEach((n=>{const l=n.attributes;t[l[e.name]]=a?l[a.name]:l[e.name]})))}return C.createFromColormap(a,t)}function A(e,n=\"traditional\"){if(!f(e))return null;const{extent:a}=e,l=a.width*t(a.spatialReference);return new w({hillshadeType:n,scalingType:l>5e6?\"adjusted\":\"none\"})}function J(e,t){e=B(e,t?.variableName);const{attributeTable:n}=e;if(!c(e))return null;const a=null!=e.histograms?e.histograms[0]:null,s=null!=t?.numClasses&&isFinite(t?.numClasses)?t.numClasses:5,o=new l({classificationMethod:t?.classificationMethod,colorRamp:t?.colorRamp});let u=t?.field||\"value\";const m=[],f=[],p=1e3,d=null!=n,g=d&&n.fields.find((e=>\"count\"===e.name.toLowerCase())),y=d?n.fields.find((e=>e.name.toLowerCase()===u.toLowerCase())):void 0;if(y&&d){u=y.name;const e=n.features.length;let t=0;n.features.forEach((n=>t+=(g?n.attributes[g.name]:50)/e)),n.features.forEach((n=>{const a=n.attributes[y.name],l=g?n.attributes[g.name]:50;if(l>0){f.push(l);const n=Math.max(1,Math.round(l/e/t*p));for(let e=0;ec+=e/o)),a.counts.forEach(((e,t)=>{if(e>0){f.push(e);const r=Math.max(1,Math.round(e/o/c*p));u=d?n.features[t].attributes[y.name]:0===t?s:t===o-1?i:a.min+l*(t+.5);for(let e=0;ee.slice(1)))}const R=w.classBreaks.map(((e,t)=>new r({minValue:e.minValue,maxValue:e.maxValue,label:e.label,symbol:{type:\"simple-fill\",color:M[t]}})));return new x({field:u,classBreakInfos:R,authoringInfo:o})}function P(e,t,n){let a=0,l=0;if(null!=e.attributeTable){const n=e.attributeTable;a=l=n.features[0].attributes[t.name],n.features.forEach((e=>{const n=e.attributes[t.name];nl&&(l=n)}))}else if(null!=e.histograms){const t=e.histograms;a=t[0].min,l=t[0].max}return(l-a)/n}const G=new Map([[\"m/s\",\"meter-per-second\"],[\"km/h\",\"kilometer-per-hour\"],[\"knots\",\"knots\"],[\"ft/s\",\"feet-per-second\"],[\"mph\",\"mile-per-hour\"]]);function _(e){if(!o(e))return null;let t;if(null!=e.statistics&&e.statistics.length&&(\"vector-magdir\"===e.dataType||\"vector-uv\"===e.dataType)){const{minMagnitude:n,maxMagnitude:a}=X(e.dataType,e.statistics);t=[{type:\"size\",field:\"Magnitude\",minSize:10,maxSize:40,minDataValue:n,maxDataValue:a}]}const n=null!=e.multidimensionalInfo?G.get(e.multidimensionalInfo.variables[0].unit):null,a=new M({visualVariables:t,inputUnit:n,rotationType:\"geographic\"});return a.visualVariables=[...a.sizeVariables,...a.rotationVariables],a}function H(e){return{color:e.symbolLayers[0].material?.color,type:\"esriSFS\",style:\"esriSFSSolid\"}}function K(e){if(\"uniqueValue\"===e.type){const t=e.uniqueValueInfos,n=t?.[0].symbol;return n?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map((e=>({value:e.value,label:e.label,symbol:e.symbol?H(e.symbol):null})))),e}if(\"classBreaks\"===e.type){const t=e.classBreakInfos,n=t[0].symbol;return n?.symbolLayers?.length&&(e.classBreakInfos=t.map((e=>({classMinValue:e.classMinValue,classMaxValue:e.classMaxValue,label:e.label,symbol:e.symbol?H(e.symbol):null})))),e}return e}function Q(e){if(!p(e))return null;let t;if(null!=e.statistics&&e.statistics.length>0&&(\"vector-magdir\"===e.dataType||\"vector-uv\"===e.dataType)){const{minMagnitude:n,maxMagnitude:a}=X(e.dataType,e.statistics);t=[{type:\"color\",field:\"Magnitude\",stops:[{value:n,color:\"#1020C0\"},{value:a,color:\"#C02010\"}]}]}return new a({visualVariables:t})}function X(e,t){let n,a;if(\"vector-magdir\"===e)n=t[0].min,a=t[0].max;else{const e=t[0].min,l=t[0].max,r=t[1].min,s=t[1].max;n=0,a=Math.max(Math.abs(e),Math.abs(r),Math.abs(l),Math.abs(s))}return{minMagnitude:n,maxMagnitude:a}}export{J as createClassBreaksRenderer,O as createColormapRenderer,V as createDefaultRenderer,Q as createFlowRenderer,A as createShadedReliefRenderer,L as createStretchRenderer,W as createUVRenderer,_ as createVectorFieldRenderer,X as estimateMagnitudeRange,q as getBandNames,U as getClassField,E as getDefaultBandCombination,S as getDefaultInterpolation,P as getDefinedInterval,N as getField,k as getSupportedRendererTypes,B as getVariableRasterInfo,F as getWellKnownBandIndexes,K as normalizeRendererJSON};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"../../geometry/SpatialReference.js\";let p=class extends e{constructor(r){super(r),this.north=null,this.up=null,this.spatialReference=null}};r([o({type:Number,json:{write:!0}})],p.prototype,\"north\",void 0),r([o({type:Number,json:{write:!0}})],p.prototype,\"up\",void 0),r([o({type:s,json:{write:!0}})],p.prototype,\"spatialReference\",void 0),p=r([t(\"esri.rest.support.ImageAngleResult\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{lengthUnitsJSONMap as t,areaUnitsJSONMap as s,angleUnitsJSONMap as o}from\"../../core/unitUtils.js\";import{property as p}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";let u=class extends r{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};e([p({type:Number,json:{read:!0,write:!0}})],u.prototype,\"value\",void 0),e([p({type:String,json:{read:!0,write:!0}})],u.prototype,\"displayValue\",void 0),e([p({type:Number,json:{read:!0,write:!0}})],u.prototype,\"uncertainty\",void 0),u=e([i(\"esri.rest.support.ImageMeasureResultValue\")],u);let a=class extends u{constructor(){super(...arguments),this.unit=null}};e([p({type:String,json:{read:t.read,write:t.write}})],a.prototype,\"unit\",void 0),a=e([i(\"esri.rest.support.ImageMeasureResultLengthValue\")],a);let n=class extends u{constructor(){super(...arguments),this.unit=null}};e([p({type:String,json:{read:s.read,write:s.write}})],n.prototype,\"unit\",void 0),n=e([i(\"esri.rest.support.ImageMeasureResultAreaValue\")],n);let l=class extends u{constructor(){super(...arguments),this.unit=null}};e([p({type:String,json:{read:o.read,write:o.write}})],l.prototype,\"unit\",void 0),l=e([i(\"esri.rest.support.ImageMeasureResultAngleValue\")],l);let c=class extends r{constructor(){super(...arguments),this.name=null,this.sensorName=null}};e([p({type:String,json:{read:!0,write:!0}})],c.prototype,\"name\",void 0),e([p({type:String,json:{read:!0,write:!0}})],c.prototype,\"sensorName\",void 0),c=e([i(\"esri.rest.support.BaseImageMeasureResult\")],c);export{c as BaseImageMeasureResult,l as ImageMeasureResultAngleValue,n as ImageMeasureResultAreaValue,a as ImageMeasureResultLengthValue};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{BaseImageMeasureResult as o,ImageMeasureResultAreaValue as t,ImageMeasureResultLengthValue as p}from\"./BaseImageMeasureResult.js\";let a=class extends o{constructor(){super(...arguments),this.area=null,this.perimeter=null}};r([e({type:t,json:{read:!0,write:!0}})],a.prototype,\"area\",void 0),r([e({type:p,json:{read:!0,write:!0}})],a.prototype,\"perimeter\",void 0),a=r([s(\"esri.rest.support.ImageAreaResult\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{BaseImageMeasureResult as t,ImageMeasureResultLengthValue as o,ImageMeasureResultAngleValue as p}from\"./BaseImageMeasureResult.js\";let a=class extends t{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};e([r({type:o,json:{read:!0,write:!0}})],a.prototype,\"distance\",void 0),e([r({type:p,json:{read:!0,write:!0}})],a.prototype,\"azimuthAngle\",void 0),e([r({type:p,json:{read:!0,write:!0}})],a.prototype,\"elevationAngle\",void 0),a=e([s(\"esri.rest.support.ImageDistanceResult\")],a);const i=a;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import{BaseImageMeasureResult as o,ImageMeasureResultLengthValue as t}from\"./BaseImageMeasureResult.js\";let p=class extends o{constructor(){super(...arguments),this.height=null}};r([s({type:t,json:{read:!0,write:!0}})],p.prototype,\"height\",void 0),p=r([e(\"esri.rest.support.ImageHeightResult\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"../../geometry/Point.js\";import i from\"./FeatureSet.js\";let p=class extends t{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};o([e({json:{write:!0}})],p.prototype,\"catalogItemVisibilities\",void 0),o([e({type:i,json:{write:!0}})],p.prototype,\"catalogItems\",void 0),o([e({type:s,json:{write:!0}})],p.prototype,\"location\",void 0),o([e({json:{write:!0}})],p.prototype,\"name\",void 0),o([e({json:{write:!0}})],p.prototype,\"objectId\",void 0),o([e({json:{write:!0}})],p.prototype,\"processedValues\",void 0),o([e({json:{write:!0}})],p.prototype,\"properties\",void 0),o([e({json:{write:!0}})],p.prototype,\"value\",void 0),p=o([r(\"esri.rest.support.ImageIdentifyResult\")],p);const l=p;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(){super(...arguments),this.geometries=null}};r([s({json:{write:!0}})],t.prototype,\"geometries\",void 0),t=r([e(\"esri.rest.support.ImagePixelLocationResult\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{BaseImageMeasureResult as e}from\"./BaseImageMeasureResult.js\";import t from\"../../geometry/Point.js\";let p=class extends e{constructor(){super(...arguments),this.point=null}};r([o({type:t,json:{name:\"point.value\",read:!0,write:!0}})],p.prototype,\"point\",void 0),p=r([s(\"esri.rest.support.ImagePointResult\")],p);const a=p;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"../../geometry/Point.js\";let i=class extends t{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};o([r({json:{write:!0}})],i.prototype,\"attributes\",void 0),o([r({type:e,json:{write:!0}})],i.prototype,\"location\",void 0),o([r({json:{write:!0}})],i.prototype,\"locationId\",void 0),o([r({json:{write:!0}})],i.prototype,\"rasterId\",void 0),o([r({json:{write:!0}})],i.prototype,\"resolution\",void 0),o([r({json:{write:!0}})],i.prototype,\"pixelValue\",void 0),i=o([s(\"esri.rest.support.ImageSample\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import t from\"./ImageSample.js\";let p=class extends s{constructor(){super(...arguments),this.samples=null}};r([o({type:[t],json:{write:!0}})],p.prototype,\"samples\",void 0),p=r([e(\"esri.rest.support.ImageSampleResult\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../geometry.js\";import t from\"../request.js\";import{normalizeCentralMeridian as e}from\"../geometry/support/normalizeUtils.js\";import{srToRESTValue as o}from\"../geometry/support/spatialReferenceUtils.js\";import{parseUrl as n,encode as a,asValidOptions as r}from\"./utils.js\";import s from\"./support/ImageAngleResult.js\";import i from\"./support/ImageAreaResult.js\";import m from\"./support/ImageDistanceResult.js\";import u from\"./support/ImageHeightResult.js\";import c from\"./support/ImageIdentifyResult.js\";import l from\"./support/ImagePixelLocationResult.js\";import p from\"./support/ImagePointResult.js\";import f from\"./support/ImageSampleResult.js\";import g from\"../geometry/SpatialReference.js\";function y(t){const e=t?.time;if(e&&(null!=e.start||null!=e.end)){const o=[];null!=e.start&&o.push(e.start),null==e.end||o.includes(e.end)||o.push(e.end),t.time=o.join(\",\")}}async function d(t,o,s){const i=n(t),m=o.geometry?[o.geometry]:[],u=await e(m),c=o.toJSON();y(c);const l=u?.[0];null!=l&&(c.geometry=l.toJSON());const p=a({...i.query,f:\"json\",...c});return r(p,s)}async function S(e,o,i){const m=o.toJSON();null!=m.angleName&&(m.angleName=m.angleName.join(\",\")),o?.point?.spatialReference?.imageCoordinateSystem&&(m.point.spatialReference=G(o.point.spatialReference)),o?.spatialReference?.imageCoordinateSystem&&(m.spatialReference=$(o.spatialReference));const u=n(e),c=a({...u.query,f:\"json\",...m}),l=r(c,i),{data:p}=await t(`${u.path}/computeAngles`,l);return p.spatialReference=p.spatialReference?null!=p.spatialReference.geodataXform?new g({wkid:0,imageCoordinateSystem:p.spatialReference}):g.fromJSON(p.spatialReference):null,\"NaN\"===p.north&&(p.north=null),\"NaN\"===p.up&&(p.up=null),new s(p)}async function N(e,o,s){const i=o.toJSON(),{geometries:m}=o;if(m)for(let t=0;t{t.avg=t.mean,t.stddev=t.standardDeviation})),{statistics:m,histograms:i.histograms}}async function j(e,o,a){const r=await d(e,o,a),s=n(e),{data:i}=await t(`${s.path}/computeHistograms`,r);return{histograms:i.histograms}}async function J(o,s,i){const m=s.toJSON();y(m),m.outFields?.length&&(m.outFields=m.outFields.join(\",\"));const u=await e(s.geometry),c=u?.[0];null!=c&&(m.geometry=c.toJSON());const l=n(o),p=a({...l.query,f:\"json\",...m}),g=r(p,i),{data:d}=await t(`${l.path}/getSamples`,g),S=d?.samples?.map((t=>{const e=\"NaN\"===t.value||\"\"===t.value?null:t.value.split(\" \").map((t=>Number(t)));return{...t,pixelValue:e}}));return f.fromJSON({samples:S})}async function O(o,s,i){const m=n(o),u=s.geometry?[s.geometry]:[];return e(u).then((e=>{const o=s.toJSON(),n=e?.[0];null!=n&&(o.geometry=JSON.stringify(n.toJSON()));const u=a({...m.query,f:\"json\",...o}),c=r(u,i);return t(m.path+\"/identify\",c)})).then((t=>c.fromJSON(t.data)))}async function h(t,e,o){const n=await q(t,e,[e.fromGeometry,e.toGeometry],o);return u.fromJSON(n)}async function w(t,e,o){const n=await q(t,e,[e.geometry],o);return i.fromJSON(n)}async function C(t,e,o){const n=await q(t,e,[e.geometry],o);return p.fromJSON(n)}async function I(t,e,o){const n=await q(t,e,[e.fromGeometry,e.toGeometry],o);return m.fromJSON(n)}async function q(o,s,i,m){const u=n(o),c=await e(i),l=s.toJSON();null!=c[0]&&(l.fromGeometry=JSON.stringify(v(c[0]))),null!=c[1]&&(l.toGeometry=JSON.stringify(v(c[1])));const p=a({...u.query,f:\"json\",...l}),f=r(p,m),{data:g}=await t(u.path+\"/measure\",f);return g}function v(t){const e=t.toJSON();return t.spatialReference?.imageCoordinateSystem&&(e.spatialReference=G(t.spatialReference)),e}function G(t){const{imageCoordinateSystem:e}=t;if(e){const{id:t,referenceServiceName:o}=e;return null!=t?o?{icsid:t,icsns:o}:{icsid:t}:{ics:e}}return t.toJSON()}function $(t,e){if(!t.imageCoordinateSystem)return o(t);const n=G(t),{icsid:a,icsns:r}=n;return null==a||null!=r&&!e?.toLowerCase().includes(\"/\"+r.toLowerCase()+\"/\")?JSON.stringify(n):`0:${a}`}export{S as computeAngles,j as computeHistograms,N as computePixelSpaceLocations,R as computeStatisticsHistograms,G as getImageSpatialReferenceJSON,$ as getImageSpatialReferenceQueryParameter,J as getSamples,O as identify,w as measureAreaAndPerimeter,I as measureDistanceAndAngle,h as measureHeight,C as measurePointOrCentroid};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../request.js\";import t from\"../../geometry/Extent.js\";import a from\"../../geometry/Point.js\";import l from\"../../geometry/SpatialReference.js\";import i from\"../../layers/support/RasterInfo.js\";import{parseUrl as s,encode as n,asValidOptions as r}from\"../utils.js\";import o from\"../support/FeatureSet.js\";async function u(u,m,f){const p=s(u),{rasterFunction:c,sourceJSON:d}=m||{},h=c?JSON.stringify(c.rasterFunctionDefinition||c):null,g=n({...p.query,renderingRule:h,f:\"json\"}),b=r(g,f);u=p.path;const y=d||await e(u,b).then((e=>e.data)),S=y.hasRasterAttributeTable?e(`${u}/rasterAttributeTable`,b):null,V=y.hasColormap?e(`${u}/colormap`,b):null,v=y.hasHistograms?e(`${u}/histograms`,b):null,x=y.currentVersion>=10.3?e(`${u}/keyProperties`,b):null,D=y.hasMultidimensions?e(`${u}/multidimensionalInfo`,b):null,T=await Promise.allSettled([S,V,v,x,D]);let R=null;if(y.minValues&&y.minValues.length===y.bandCount){R=[];for(let e=0;e{e.statistics?.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))}));const{defaultVariable:E,serviceDataType:k}=y;E&&E!==M.DefaultVariable&&(M.DefaultVariable=E),k?.includes(\"esriImageServiceDataTypeVector\")&&!k.includes(M.DataType)&&(M.DataType=k.replace(\"esriImageServiceDataType\",\"\"));let q=y.noDataValue;return y.noDataValues?.length&&y.noDataValues.some((e=>e!==q))&&(q=y.noDataValues),new i({width:w,height:I,bandCount:y.bandCount,extent:t.fromJSON(y.extent),spatialReference:J,pixelSize:new a({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:J}),pixelType:y.pixelType.toLowerCase(),statistics:R,attributeTable:O,colormap:z,histograms:F,keyProperties:M,noDataValue:q,multidimensionalInfo:A})}function m(e,t,a){return u(e,{sourceJSON:t},a)}function f(e,t,a){return u(e,{rasterFunction:t},a)}function p(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}export{m as fetchServiceRasterInfo,f as generateRasterInfo,p as patchServiceInfo};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../request.js\";import t from\"../../geometry/Extent.js\";import i from\"../../geometry/Point.js\";import r from\"../../layers/support/RasterInfo.js\";import s from\"../../layers/support/RasterStorageInfo.js\";import{parseUrl as a,encode as l,asValidOptions as o}from\"../utils.js\";async function n(n,m,p){const f=a(n),u=l({...f?.query,f:\"json\"}),h=o(u,p),d=`${f?.path}/${m}/info`,c=e(`${d}`,h),g=e(`${d}/keyProperties`,h),x=await Promise.allSettled([c,g]),y=\"fulfilled\"===x[0].status?x[0].value.data:null,v=\"fulfilled\"===x[1].status?x[1].value.data:null;let P=null;y.statistics?.length&&(P=y.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const S=t.fromJSON(y.extent),j=Math.ceil(S.width/y.pixelSizeX-.1),w=Math.ceil(S.height/y.pixelSizeY-.1),b=S.spatialReference,k=new i({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:b}),z=y.histograms?.length?y.histograms:null,L=new s({origin:y.origin,blockWidth:y.blockWidth,blockHeight:y.blockHeight,firstPyramidLevel:y.firstPyramidLevel,maximumPyramidLevel:y.maxPyramidLevel});return new r({width:j,height:w,bandCount:y.bandCount,extent:S,spatialReference:b,pixelSize:k,pixelType:y.pixelType.toLowerCase(),statistics:P,histograms:z,keyProperties:v,storageInfo:L})}export{n as getCatalogItemRasterInfo};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as t}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as s}from\"../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import a from\"../../geometry/Point.js\";import i from\"../../geometry/SpatialReference.js\";var n;let m=n=class extends r{constructor(e){super(e),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new n(t({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};e([o({type:[String],json:{name:\"angleName\",write:!0}})],m.prototype,\"angleNames\",void 0),e([o({type:a,json:{write:!0}})],m.prototype,\"point\",void 0),e([o({type:i,json:{write:!0}})],m.prototype,\"spatialReference\",void 0),e([o({type:s,json:{write:!0}})],m.prototype,\"rasterId\",void 0),m=n=e([p(\"esri.rest.support.ImageAngleParameters\")],m);const l=m;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONMap as r}from\"../../core/jsonMap.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"../../layers/support/MosaicRule.js\";import n from\"../../geometry/Point.js\";const a=new r({esriMensurationPoint:\"point\",esriMensurationCentroid:\"centroid\",esriMensurationDistanceAndAngle:\"distance-and-angle\",esriMensurationAreaAndPerimeter:\"area-and-perimeter\",esriMensurationHeightFromBaseAndTop:\"base-and-top\",esriMensurationHeightFromBaseAndTopShadow:\"base-and-top-shadow\",esriMensurationHeightFromTopAndTopShadow:\"top-and-top-shadow\",esriMensurationPoint3D:\"point-3D\",esriMensurationCentroid3D:\"centroid-3D\",esriMensurationDistanceAndAngle3D:\"distance-and-angle-3D\",esriMensurationAreaAndPerimeter3D:\"area-and-perimeter-3D\"});let p=class extends o{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};e([t()],p.prototype,\"type\",void 0),e([t({type:a.apiValues,json:{read:a.read,write:a.write}})],p.prototype,\"measureOperation\",void 0),e([t({type:i,json:{write:!0}})],p.prototype,\"mosaicRule\",void 0),e([t({type:n,json:{write:!0}})],p.prototype,\"pixelSize\",void 0),e([t({json:{write:!0}})],p.prototype,\"raster\",void 0),p=e([s(\"esri.rest.support.BaseImageMeasureParameters\")],p);export{p as BaseImageMeasureParameters,a as measureOperationJSONMap};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{geometryTypes as r}from\"../../geometry.js\";import{clone as t}from\"../../core/lang.js\";import{lengthUnitsJSONMap as o,areaUnitsJSONMap as s}from\"../../core/unitUtils.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as a}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as p}from\"../../core/accessorSupport/decorators/writer.js\";import{getJsonType as m}from\"../../geometry/support/jsonUtils.js\";import{measureOperationJSONMap as n,BaseImageMeasureParameters as c}from\"./BaseImageMeasureParameters.js\";var l;let u=l=class extends c{constructor(){super(...arguments),this.type=\"area-perimeter\",this.geometry=null,this.is3D=!1,this.linearUnit=\"meters\",this.areaUnit=\"square-meters\"}writeGeometry(e,r,t){null!=e&&(r.geometryType=m(e),r[t]=e.toJSON())}get measureOperation(){return this.is3D?\"area-and-perimeter-3D\":\"area-and-perimeter\"}clone(){return new l(t({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([i({types:r,json:{name:\"fromGeometry\",read:!0,write:!0}})],u.prototype,\"geometry\",void 0),e([p(\"geometry\")],u.prototype,\"writeGeometry\",null),e([i({type:n.apiValues,json:{write:n.write}})],u.prototype,\"measureOperation\",null),e([i({json:{read:!0}})],u.prototype,\"is3D\",void 0),e([i({type:String,json:{read:o.read,write:o.write}})],u.prototype,\"linearUnit\",void 0),e([i({type:String,json:{read:s.read,write:s.write}})],u.prototype,\"areaUnit\",void 0),u=l=e([a(\"esri.rest.support.ImageAreaParameters\")],u);const y=u;export{y as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{clone as r}from\"../../core/lang.js\";import{lengthUnitsJSONMap as t,angleUnitsJSONMap as o}from\"../../core/unitUtils.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as a}from\"../../core/accessorSupport/decorators/writer.js\";import{getJsonType as p}from\"../../geometry/support/jsonUtils.js\";import{measureOperationJSONMap as n,BaseImageMeasureParameters as m}from\"./BaseImageMeasureParameters.js\";import l from\"../../geometry/Point.js\";var y;let c=y=class extends m{constructor(){super(...arguments),this.type=\"distance-angle\",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit=\"meters\",this.angularUnit=\"degrees\"}writeFromGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){return this.is3D?\"distance-and-angle-3D\":\"distance-and-angle\"}clone(){return new y(r({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([s({type:l,json:{read:!0,write:!0}})],c.prototype,\"fromGeometry\",void 0),e([a(\"fromGeometry\")],c.prototype,\"writeFromGeometry\",null),e([s({type:l,json:{read:!0,write:!0}})],c.prototype,\"toGeometry\",void 0),e([s({type:n.apiValues,json:{write:n.write}})],c.prototype,\"measureOperation\",null),e([s({json:{read:!0}})],c.prototype,\"is3D\",void 0),e([s({type:String,json:{read:t.read,write:t.write}})],c.prototype,\"linearUnit\",void 0),e([s({type:String,json:{read:o.read,write:o.write}})],c.prototype,\"angularUnit\",void 0),c=y=e([i(\"esri.rest.support.ImageDistanceParameters\")],c);const u=c;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{clone as r}from\"../../core/lang.js\";import{lengthUnitsJSONMap as t}from\"../../core/unitUtils.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../../core/accessorSupport/decorators/writer.js\";import{getJsonType as p}from\"../../geometry/support/jsonUtils.js\";import{measureOperationJSONMap as m,BaseImageMeasureParameters as a}from\"./BaseImageMeasureParameters.js\";import n from\"../../geometry/Point.js\";var y;let l=y=class extends a{constructor(){super(...arguments),this.type=\"height\",this.fromGeometry=null,this.toGeometry=null,this.operationType=\"base-and-top\",this.linearUnit=\"meters\"}writeFromGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){return this.operationType}clone(){return new y(r({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([o({type:n,json:{read:!0}})],l.prototype,\"fromGeometry\",void 0),e([i(\"fromGeometry\")],l.prototype,\"writeFromGeometry\",null),e([o({type:n,json:{read:!0,write:!0}})],l.prototype,\"toGeometry\",void 0),e([o({type:m.apiValues,json:{write:m.write}})],l.prototype,\"measureOperation\",null),e([o({json:{read:!0}})],l.prototype,\"operationType\",void 0),e([o({type:String,json:{read:t.read,write:t.write}})],l.prototype,\"linearUnit\",void 0),l=y=e([s(\"esri.rest.support.ImageHeightParameters\")],l);const c=l;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{geometryTypes as r}from\"../../geometry.js\";import t from\"../../TimeExtent.js\";import{deprecatedProperty as o}from\"../../core/deprecate.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{clone as i}from\"../../core/lang.js\";import n from\"../../core/Logger.js\";import{property as p}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as m}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as a}from\"../../core/accessorSupport/decorators/writer.js\";import{getJsonType as c,fromJSON as u}from\"../../geometry/support/jsonUtils.js\";import l from\"../../layers/support/MosaicRule.js\";import y from\"../../layers/support/RasterFunction.js\";import g from\"../../geometry/Point.js\";var j;let d=j=class extends s{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,r,t){null!=e&&(r.geometryType=c(e),r[t]=e.toJSON())}get renderingRule(){return o(n.getLogger(this),\"renderingRule\",{replacement:\"rasterFunction\",version:\"4.27\",warnOnce:!0}),this._get(\"rasterFunction\")}set renderingRule(e){o(n.getLogger(this),\"renderingRule\",{replacement:\"rasterFunction\",version:\"4.27\",warnOnce:!0}),this._set(\"rasterFunction\",e)}clone(){return new j(i({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};e([p({types:r,json:{read:u}})],d.prototype,\"geometry\",void 0),e([a(\"geometry\")],d.prototype,\"writeGeometry\",null),e([p({type:l,json:{write:!0}})],d.prototype,\"mosaicRule\",void 0),e([p({type:y})],d.prototype,\"renderingRule\",null),e([p({type:y,json:{write:!0,name:\"renderingRule\"}})],d.prototype,\"rasterFunction\",void 0),e([p({type:g,json:{write:!0}})],d.prototype,\"pixelSize\",void 0),e([p({json:{write:!0}})],d.prototype,\"raster\",void 0),e([p({type:t,json:{read:{source:\"time\"},write:{target:\"time\"}}})],d.prototype,\"timeExtent\",void 0),d=j=e([m(\"esri.rest.support.ImageHistogramParameters\")],d);const h=d;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../TimeExtent.js\";import{deprecatedProperty as r}from\"../../core/deprecate.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{clone as i}from\"../../core/lang.js\";import n from\"../../core/Logger.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as u}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as l}from\"../../core/accessorSupport/decorators/writer.js\";import a from\"../../geometry/Point.js\";import{getJsonType as p}from\"../../geometry/support/jsonUtils.js\";import m from\"../../layers/support/MosaicRule.js\";import c from\"../../layers/support/RasterFunction.js\";var y;let g=y=class extends o{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,r){null!=e&&(t.geometryType=p(e),t[r]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=m.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set(\"mosaicRule\",t)}writeMosaicRule(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON()))}get renderingRule(){return r(n.getLogger(this),\"renderingRule\",{replacement:\"rasterFunction\",version:\"4.27\",warnOnce:!0}),this._get(\"rasterFunction\")}set renderingRule(e){r(n.getLogger(this),\"renderingRule\",{replacement:\"rasterFunction\",version:\"4.27\",warnOnce:!0}),this._set(\"rasterFunction\",e)}get renderingRules(){return r(n.getLogger(this),\"renderingRules\",{replacement:\"rasterFunctions\",version:\"4.27\",warnOnce:!0}),this._get(\"rasterFunctions\")}set renderingRules(e){r(n.getLogger(this),\"renderingRules\",{replacement:\"rasterFunctions\",version:\"4.27\",warnOnce:!0}),this._set(\"rasterFunctions\",e)}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=c.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set(\"rasterFunction\",t)}writeRasterFunction(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[r]=JSON.stringify(e.rasterFunctionDefinition))}writeRasterFunctions(e,t,r){null!=e&&(t[r]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,r){null!=e&&(t[r]=JSON.stringify(e))}writeTimeExtent(e,t,r){if(null!=e){const o=null!=e.start?e.start.getTime():null,i=null!=e.end?e.end.getTime():null;t[r]=null!=o?null!=i?`${o},${i}`:`${o}`:null}}clone(){return new y(i({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};e([s({json:{write:!0}})],g.prototype,\"geometry\",void 0),e([l(\"geometry\")],g.prototype,\"writeGeometry\",null),e([s({type:m,json:{write:!0}})],g.prototype,\"mosaicRule\",null),e([l(\"mosaicRule\")],g.prototype,\"writeMosaicRule\",null),e([s({type:c})],g.prototype,\"renderingRule\",null),e([s({type:[c]})],g.prototype,\"renderingRules\",null),e([s({type:c,json:{write:!0,name:\"renderingRule\"}})],g.prototype,\"rasterFunction\",null),e([l(\"rasterFunction\")],g.prototype,\"writeRasterFunction\",null),e([s({type:[c],json:{write:!0,name:\"renderingRules\"}})],g.prototype,\"rasterFunctions\",void 0),e([l(\"rasterFunctions\")],g.prototype,\"writeRasterFunctions\",null),e([s({type:a,json:{write:!0}})],g.prototype,\"pixelSize\",void 0),e([l(\"pixelSize\")],g.prototype,\"writePixelSize\",null),e([s({type:Boolean,json:{write:!0}})],g.prototype,\"returnGeometry\",void 0),e([s({type:Boolean,json:{write:!0}})],g.prototype,\"returnCatalogItems\",void 0),e([s({type:Boolean,json:{write:!0}})],g.prototype,\"returnPixelValues\",void 0),e([s({type:Number,json:{write:!0}})],g.prototype,\"maxItemCount\",void 0),e([s({type:t,json:{write:{target:\"time\"}}})],g.prototype,\"timeExtent\",void 0),e([l(\"timeExtent\")],g.prototype,\"writeTimeExtent\",null),e([s({json:{write:!0}})],g.prototype,\"raster\",void 0),e([s({json:{write:!0}})],g.prototype,\"viewId\",void 0),e([s({type:Boolean,json:{write:!0}})],g.prototype,\"processAsMultidimensional\",void 0),g=y=e([u(\"esri.rest.support.ImageIdentifyParameters\")],g);const d=g;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as t}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as p}from\"../../core/accessorSupport/decorators/writer.js\";import i from\"../../geometry/Point.js\";var m;let c=m=class extends e{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(r,e,o){e.geometries={geometryType:\"esriGeometryPoint\",geometries:r.map((r=>r.toJSON()))}}clone(){return new m({geometries:this.geometries?.map((r=>r.clone()))??[],rasterId:this.rasterId})}};r([o({type:[i],json:{write:!0}})],c.prototype,\"geometries\",void 0),r([p(\"geometries\")],c.prototype,\"writeGeometry\",null),r([o({type:t,json:{write:!0}})],c.prototype,\"rasterId\",void 0),c=m=r([s(\"esri.rest.support.ImagePixelLocationParameters\")],c);const a=c;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{geometryTypes as r}from\"../../geometry.js\";import{clone as t}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../../core/accessorSupport/decorators/writer.js\";import{getJsonType as p,fromJSON as m}from\"../../geometry/support/jsonUtils.js\";import{measureOperationJSONMap as a,BaseImageMeasureParameters as n}from\"./BaseImageMeasureParameters.js\";var c;let u=c=class extends n{constructor(){super(...arguments),this.type=\"point\",this.geometry=null,this.is3D=!1}writeGeometry(e,r,t){null!=e&&(r.geometryType=p(e),r[t]=e.toJSON())}get measureOperation(){const{is3D:e,geometry:r}=this;return\"point\"===r.type?e?\"point-3D\":\"point\":e?\"centroid-3D\":\"centroid\"}clone(){return new c(t({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};e([o({types:r,json:{name:\"fromGeometry\",read:m}})],u.prototype,\"geometry\",void 0),e([i(\"geometry\")],u.prototype,\"writeGeometry\",null),e([o({type:a.apiValues,json:{read:a.read,write:a.write}})],u.prototype,\"measureOperation\",null),e([o({json:{read:!0}})],u.prototype,\"is3D\",void 0),u=c=e([s(\"esri.rest.support.ImagePointParameters\")],u);const y=u;export{y as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{geometryTypes as e}from\"../../geometry.js\";import o from\"../../TimeExtent.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as s}from\"../../core/lang.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as l}from\"../../core/accessorSupport/decorators/writer.js\";import{getJsonType as n,fromJSON as a}from\"../../geometry/support/jsonUtils.js\";import m from\"../../layers/support/MosaicRule.js\";import{interpolationKebab as u}from\"../../layers/support/rasterEnums.js\";import y from\"../../geometry/Multipoint.js\";import c from\"../../geometry/Point.js\";var d;let j=d=class extends r{constructor(){super(...arguments),this.geometry=null,this.interpolation=\"nearest\",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(t,e,o){null!=t&&(e.geometryType=n(t),e[o]=t.toJSON())}set locations(t){if(t?.length){const e=new y({spatialReference:t[0].spatialReference});e.points=t.map((t=>[t.x,t.y])),this._set(\"locations\",t),this.geometry=e}}clone(){return new d(s({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};t([i({types:e,json:{read:a}})],j.prototype,\"geometry\",void 0),t([l(\"geometry\")],j.prototype,\"writeGeometry\",null),t([i()],j.prototype,\"locations\",null),t([i({type:String,json:{type:u.jsonValues,read:u.read,write:u.write}})],j.prototype,\"interpolation\",void 0),t([i({type:m,json:{write:!0}})],j.prototype,\"mosaicRule\",void 0),t([i({type:[String],json:{write:!0}})],j.prototype,\"outFields\",void 0),t([i({type:c,json:{write:!0}})],j.prototype,\"pixelSize\",void 0),t([i({type:String,json:{write:!0}})],j.prototype,\"raster\",void 0),t([i({type:Boolean,json:{write:!0}})],j.prototype,\"returnFirstValueOnly\",void 0),t([i({type:Number,json:{write:!0}})],j.prototype,\"sampleDistance\",void 0),t([i({type:Number,json:{write:!0}})],j.prototype,\"sampleCount\",void 0),t([i({type:Number,json:{write:!0}})],j.prototype,\"sliceId\",void 0),t([i({type:o,json:{read:{source:\"time\"},write:{target:\"time\"}}})],j.prototype,\"timeExtent\",void 0),j=d=t([p(\"esri.rest.support.ImageSampleParameters\")],j);const h=j;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import t from\"../../Graphic.js\";import{rasterRendererTypes as r,websceneRasterRendererTypes as i,read as s}from\"../../rasterRenderers.js\";import n from\"../../request.js\";import{deprecatedProperty as o}from\"../../core/deprecate.js\";import a from\"../../core/Error.js\";import{clone as l}from\"../../core/lang.js\";import u from\"../../core/Logger.js\";import{watch as p}from\"../../core/reactiveUtils.js\";import{urlToObject as c}from\"../../core/urlUtils.js\";import{property as m,ensureRange as d}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as h,ensureClass as f,ensureNumber as y}from\"../../core/accessorSupport/ensureType.js\";import{reader as g}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as R}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as b}from\"../../core/accessorSupport/decorators/writer.js\";import{srToRESTValue as v}from\"../../geometry/support/spatialReferenceUtils.js\";import{opacity as x,url as S}from\"../support/commonProperties.js\";import I from\"../support/DimensionalDefinition.js\";import{ExportImageServiceParameters as w}from\"../support/ExportImageServiceParameters.js\";import _ from\"../support/Field.js\";import F from\"../support/FieldsIndex.js\";import{createBitmap as D}from\"../support/imageBitmapUtils.js\";import{isSupportedRendererType as j}from\"../support/imageryRendererUtils.js\";import P from\"../support/MosaicRule.js\";import T from\"../support/MultidimensionalSubset.js\";import O from\"../support/PixelBlock.js\";import{interpolationKebab as C,noDataInterpretationKebab as N,pixelTypeKebabDict as M}from\"../support/rasterEnums.js\";import A from\"../support/RasterFunction.js\";import J from\"../support/RasterInfo.js\";import q from\"../support/RasterJobHandler.js\";import{intersectMultimensionalSubset as E,getSubsetVariablesFromMdInfo as V,getDefaultMultidimensionalDefinition as H}from\"../support/rasterDatasets/multidimensionalUtils.js\";import{decode as Q,getFormat as L}from\"../support/rasterFormats/RasterCodec.js\";import{uvComponentToVector as U}from\"../support/rasterFunctions/vectorFieldUtils.js\";import{getSupportedRendererTypes as z,getDefaultBandCombination as B,createDefaultRenderer as G,normalizeRendererJSON as k}from\"../../renderers/support/rasterRendererHelper.js\";import W from\"../../renderers/support/RasterSymbolizer.js\";import{computeAngles as $,computePixelSpaceLocations as X,computeHistograms as K,computeStatisticsHistograms as Y,measureHeight as Z,measureAreaAndPerimeter as ee,measureDistanceAndAngle as te,measurePointOrCentroid as re,getImageSpatialReferenceQueryParameter as ie,getSamples as se,identify as ne}from\"../../rest/imageService.js\";import\"../../core/has.js\";import\"../support/source/DataLayerSource.js\";import{executeQueryJSON as oe}from\"../../rest/query/executeQueryJSON.js\";import\"../../config.js\";import\"../../kernel.js\";import\"../../core/unitUtils.js\";import\"../../geometry/ellipsoidUtils.js\";import\"../graphics/featureConversionUtils.js\";import ae from\"../../geometry/Extent.js\";import\"../../geometry/Geometry.js\";import\"../../geometry/Multipoint.js\";import\"../../geometry/Point.js\";import le from\"../../geometry/Polygon.js\";import\"../../geometry/Polyline.js\";import\"../../geometry/support/normalizeUtils.js\";import\"../../core/pbf.js\";import ue from\"../../rest/support/FeatureSet.js\";import pe from\"../../rest/support/Query.js\";import\"../../rest/query/support/AttachmentInfo.js\";import\"../../rest/support/AttachmentQuery.js\";import{executeForCount as ce}from\"../../rest/query/executeForCount.js\";import{executeForIds as me}from\"../../rest/query/executeForIds.js\";import\"../../rest/support/RelationshipQuery.js\";import\"../../rest/support/TopFeaturesQuery.js\";import{generateRasterInfo as de,fetchServiceRasterInfo as he,patchServiceInfo as fe}from\"../../rest/imageService/fetchRasterInfo.js\";import{getCatalogItemRasterInfo as ye}from\"../../rest/imageService/getCatalogItemRasterInfo.js\";import ge from\"../../rest/support/ImageAngleParameters.js\";import Re from\"../../rest/support/ImageAreaParameters.js\";import be from\"../../rest/support/ImageDistanceParameters.js\";import ve from\"../../rest/support/ImageHeightParameters.js\";import xe from\"../../rest/support/ImageHistogramParameters.js\";import Se from\"../../rest/support/ImageIdentifyParameters.js\";import Ie from\"../../rest/support/ImagePixelLocationParameters.js\";import we from\"../../rest/support/ImagePointParameters.js\";import _e from\"../../rest/support/ImageSampleParameters.js\";import{createFlowMesh as Fe}from\"../../views/2d/engine/flow/dataUtils.js\";import De from\"../../geometry/SpatialReference.js\";const je=new Set([\"png\",\"png8\",\"png24\",\"png32\",\"jpg\",\"bmp\",\"gif\",\"jpgpng\",\"lerc\",\"tiff\"]),Pe=d(y,{min:0,max:255});function Te(e){if(!e)return null;const t=JSON.stringify(e).match(/\"rasterFunction\":\"(.*?\")/gi),r=t?.map((e=>e.replace('\"rasterFunction\":\"',\"\").replace('\"',\"\")));return r?r.join(\"/\"):null}const Oe=d=>{let y=class extends d{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix=\"Raster.\",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType=\"polygon\",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set(\"exportImageServiceParameters\",new w({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.length<1||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,\"_\"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>\"number\"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,r){null!=e&&\"lerc\"!==this.format&&(t[r]=e)}writeCompressionTolerance(e,t,r){\"lerc\"===this.format&&null!=e&&(t[r]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?P.fromJSON(t):null}get fieldsIndex(){return this.fields?new F(this.fields):null}set format(e){e&&je.has(e.toLowerCase())&&this._set(\"format\",e.toLowerCase())}readFormat(e,t){return\"esriImageServiceDataTypeVector-UV\"===t.serviceDataType||\"esriImageServiceDataTypeVector-MagDir\"===t.serviceDataType||null!=this.pixelFilter?\"lerc\":\"jpgpng\"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=P.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set(\"mosaicRule\",t)}readMosaicRule(e,t){const r=e||t.mosaicRule;return r?P.fromJSON(r):this._isMosaicRuleSupported(t)?P.fromJSON(t):null}writeMosaicRule(e,t,r){let i=this.mosaicRule;const s=this.definitionExpression;i?s&&s!==i.where&&(i=i.clone(),i.where=s):s&&(i=new P({where:s})),this._isValidCustomizedMosaicRule(i)&&(t[r]=i.toJSON())}writeNoData(e,t,r){null!=e&&\"number\"==typeof e&&(t[r]=Pe(e))}readObjectIdField(e,t){if(!e){const r=t.fields.find((e=>\"esriFieldTypeOID\"===e.type||\"oid\"===e.type));e=r?.name}return e}get parsedUrl(){return c(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?\"mosaic-dataset\":\"raster-dataset\"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set(\"renderer\",e)}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer,n=s(i,r);return null==n?null:(\"vector-field\"===n.type&&t.symbolTileSize&&!i.symbolTileSize&&(n.symbolTileSize=t.symbolTileSize),j(n)||u.getLogger(this).warn(\"ArcGISImageService\",\"Imagery layer doesn't support given renderer type.\"),n)}writeRenderer(e,t,r){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),\"vector-field\"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,t=new _({name:\"Raster.ItemPixelValue\",alias:\"Item Pixel Value\",domain:null,editable:!1,length:50,type:\"string\"}),r=new _({name:\"Raster.ServicePixelValue\",alias:\"Service Pixel Value\",domain:null,editable:!1,length:50,type:\"string\"}),i=new _({name:\"Raster.ServicePixelValue.Raw\",alias:\"Raw Service Pixel Value\",domain:null,editable:!1,length:50,type:\"string\"});let s=this.fields?l(this.fields):[];s.push(r),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&s.push(t),this.version>=10.4&&null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.some((e=>\"none\"===e.name.toLowerCase()))&&s.push(i),null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.filter((e=>\"none\"!==e.name.toLowerCase())).forEach((e=>{s.push(new _({name:\"Raster.ServicePixelValue.\"+e.name,alias:e.name,domain:null,editable:!1,length:50,type:\"string\"}))})),this._isVectorDataSet()&&(s.push(new _({name:\"Raster.Magnitude\",alias:\"Magnitude\",domain:null,editable:!1,type:\"double\"})),s.push(new _({name:\"Raster.Direction\",alias:\"Direction\",domain:null,editable:!1,type:\"double\"})));const{attributeTable:n}=this.rasterInfo??{};if(null!=n){const t=n.fields.filter((e=>\"esriFieldTypeOID\"!==e.type&&\"value\"!==e.name.toLowerCase())).map((t=>{const r=l(t);return r.name=e+t.name,r}));s=s.concat(t)}return s}get renderingRule(){return o(u.getLogger(this),\"renderingRule\",{replacement:\"rasterFunction\",version:\"4.27\",warnOnce:!0}),this.rasterFunction}set renderingRule(e){o(u.getLogger(this),\"renderingRule\",{replacement:\"rasterFunction\",version:\"4.27\",warnOnce:!0}),this._set(\"rasterFunction\",e)}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=A.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set(\"rasterFunction\",t)}readRasterFunction(e,t){const r=t.rasterFunctionInfos;return t.renderingRule||r?.length&&\"None\"!==r[0].name?this._isRFTJson(t.renderingRule)?A.fromJSON({rasterFunctionDefinition:t.renderingRule}):A.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const r=e||t.extent.spatialReference;return r?De.fromJSON(r):null}readPixelType(e){return M.fromJSON(e)||e}writePixelType(e,t,r){null!=this.serviceRasterInfo&&this.pixelType===this.serviceRasterInfo.pixelType||(t[r]=M.toJSON(e))}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty(\"fields\")||t.hasOwnProperty(\"timeInfo\")?10:9.3),r}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let r=e;const{renderer:i,symbolizer:s,pixelFilter:n,bandIds:o}=this;if(!this._isPicture()&&i&&s&&!n){const n=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(i.toJSON()),a=this._rasterJobHandler.instance;if(a){n&&(s.bind(),await a.updateSymbolizer(s,t),this._cachedRendererJson=i.toJSON());const l=await a.symbolize({bandIds:o,...e},t);r={extent:e.extent,pixelBlock:l}}else r={extent:e.extent,pixelBlock:s.symbolize({bandIds:o,...e})}}return r}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new a(\"imagery-layer:compute-angles\",\"this operation is not supported on the input image service\");return e=f(ge,e).clone(),$(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new a(\"imagery-layer:compute-pixel-space-locations\",\"this operation is not supported on the input image service\");return e=f(Ie,e).clone(),X(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new a(\"imagery-layer:compute-histograms\",\"this operation is not supported on the input image service\");return e=f(xe,e).clone(),this._applyMosaicAndRenderingRules(e),K(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new a(\"imagery-layer:compute-statistics-histograms\",\"this operation is not supported on the input image service\");return e=f(xe,e).clone(),this._applyMosaicAndRenderingRules(e),Y(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const r=await this._fetchCapabilities(t?.signal);if(!(\"base-and-top\"===e.operationType?r.mensuration.supportsHeightFromBaseAndTop:\"base-and-top-shadow\"===e.operationType?r.mensuration.supportsHeightFromBaseAndTopShadow:r.mensuration.supportsHeightFromTopAndTopShadow))throw new a(\"imagery-layer:measure-height\",\"this operation is not supported on the input image service\");return e=f(ve,e).clone(),this._applyMosaicAndRenderingRules(e),Z(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const r=await this._fetchCapabilities(t?.signal);if(!(r.mensuration.supportsAreaAndPerimeter&&(!e.is3D||r.mensuration.supports3D)))throw new a(\"imagery-layer:measure-area-and-perimeter\",\"this operation is not supported on the input image service\");return e=f(Re,e).clone(),this._applyMosaicAndRenderingRules(e),ee(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const r=await this._fetchCapabilities(t?.signal);if(!(r.mensuration.supportsDistanceAndAngle&&(!e.is3D||r.mensuration.supports3D)))throw new a(\"imagery-layer:measure-distance-and-angle\",\"this operation is not supported on the input image service\");return e=f(be,e).clone(),this._applyMosaicAndRenderingRules(e),te(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const r=await this._fetchCapabilities(t?.signal);if(!(r.mensuration.supportsPointOrCentroid&&(!e.is3D||r.mensuration.supports3D)))throw new a(\"imagery-layer:measure-point-or-centroid\",\"this operation is not supported on the input image service\");return e=f(we,e).clone(),this._applyMosaicAndRenderingRules(e),re(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return null!=t?t.get(e):void 0}getFieldDomain(e,t){const r=this.getField(e);return r?r.domain:null}async fetchImage(e,t,r,i={}){if(null==e||null==t||null==r)throw new a(\"imagery-layer:fetch-image\",\"Insufficient parameters for requesting an image. A valid extent, width and height values are required.\");if(this.renderer||this.symbolizer){const e=await this._generateRasterInfo(this.rasterFunction,{signal:i.signal});e&&(this.rasterInfo=e)}const s=this.getExportImageServiceParameters(e,t,r,i.timeExtent);if(null==s){if(i.requestAsImageElement&&this._canRequestImageElement(this.format)){const e=document.createElement(\"canvas\");if(e.width=t,e.height=r,i.returnImageBitmap){return{imageBitmap:await D(e,`${Oe(this.parsedUrl)}/exportImage`,i.signal)}}return{imageOrCanvasElement:e}}const{bandIds:s,rasterInfo:n}=this,o=(s?.length||n.bandCount)??0,a=t*r,l=n.pixelType,u=[];for(let e=0;e=10.3?e?.rasterFunction:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new a(\"#fetchRasterAttributeTable()\",\"Failed to get rasterAttributeTable\")):n(Oe(this.parsedUrl)+\"/rasterAttributeTable\",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then((e=>ue.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const r={...t,query:this._getQueryParams()};return ye(Oe(this.parsedUrl),e,r)}async getCatalogItemICSInfo(e,t){const{data:r}=await n(Oe(this.parsedUrl)+\"/\"+e+\"/info/ics\",{query:this._getQueryParams(),...t}),i=r?.ics;if(!i)return;let s=null;try{s=(await n(Oe(this.parsedUrl)+\"/\"+e+\"/info\",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:i,icsToPixelTransform:null,icsExtent:null,northDirection:null};const o=this.version>=10.7?n(Oe(this.parsedUrl)+\"/\"+e+\"/info/icstopixel\",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=s.spatialReference,l={geometries:JSON.stringify({geometryType:\"esriGeometryEnvelope\",geometries:[s]}),inSR:v(a),outSR:\"0:\"+e},u=n(Oe(this.parsedUrl)+\"/project\",{query:this._getQueryParams(l),...t}).then((e=>e.data)).catch((()=>({}))),p=5,c=(s.xmin+s.xmax)/2,m=(s.ymax-s.ymin)/(p+1),d=s.ymin+m,h=[];for(let n=0;ne.data)).catch((()=>({}))),g=await Promise.all([o,u,y]);let R=g[0].ipxf;if(null==R){const e=i.geodataXform?.xf_0;\"topup\"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(R={affine:{name:\"ics [sensor: Frame] to pixel (column, row) transformation\",coefficients:e.coefficients,cellsizeRatio:0,type:\"GeometricXform\"}})}const b=ae.fromJSON(g[1]?.geometries?.[0]);b&&(b.spatialReference=new De({wkid:0,imageCoordinateSystem:i}));const x=g[2].geometries?g[2].geometries.filter((e=>null!=e?.x&&null!=e.y&&\"NaN\"!==e.x&&\"NaN\"!==e.y)):[],S=x.length;if(S<3)return{ics:i,icsToPixelTransform:R,icsExtent:b,northDirection:null};let I=0,w=0,_=0,F=0;for(let n=0;nx[0].x,T=x[p-1].y>x[0].y;return D===1/0?j=T?90:270:0===D?j=P?0:180:D>0?j=P?180*Math.atan(D)/Math.PI:180*Math.atan(D)/Math.PI+180:D<0&&(j=T?180+180*Math.atan(D)/Math.PI:360+180*Math.atan(D)/Math.PI),{ics:i,icsToPixelTransform:R,icsExtent:b,northDirection:j}}async generateRasterInfo(e,t){if(e=f(A,e),this.serviceRasterInfo&&(!e||\"none\"===e.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const r=Te(e);if(!r)throw new a(\"imagery-layer:generate-raster-info\",\"the rendering rule is not supported\");if(this._functionRasterInfos[r])return this._functionRasterInfos[r];const i={...t,query:this._getQueryParams()},s=de(Oe(this.parsedUrl),e,i);this._functionRasterInfos[r]=s;try{return await s}catch(n){throw this._functionRasterInfos[r]=null,n}}getExportImageServiceParameters(e,t,r,i){e=e.clone().shiftCentralMeridian();const s=ie(e.spatialReference,Oe(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const n=this.exportImageServiceParameters.toJSON(),{bandIds:o,noData:a}=n;let{renderingRule:l}=n;const u=this.rasterFunction?.rasterFunctionDefinition,p=!this.renderer||\"raster-stretch\"===this.renderer.type;if(o?.length&&this._hasRasterFunction(this.rasterFunction)&&!u&&p){const e={rasterFunction:\"ExtractBand\",rasterFunctionArguments:{BandIds:o}};if(\"Stretch\"===l.rasterFunction)e.rasterFunctionArguments.Raster=l.rasterFunctionArguments.Raster,l.rasterFunctionArguments.Raster=e;else if(\"Colormap\"===l.rasterFunction){const t=l.rasterFunctionArguments.Raster;\"Stretch\"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,l.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=l,l=e;n.bandIds=void 0}else n.bandIds=o?.join(\",\");a instanceof Array&&a.length>0&&(n.noData=a.join(\",\"));const c=this._processMultidimensionalIntersection(null,i,this.exportImageServiceParameters.mosaicRule);if(c.isOutSide)return null;n.mosaicRule=null!=c.mosaicRule?JSON.stringify(c.mosaicRule):null,i=c.timeExtent,n.renderingRule=this._getRenderingRuleString(A.fromJSON(l));const m={};if(null!=i){const{start:e,end:t}=i.toJSON();e&&t&&e===t?m.time=\"\"+e:null==e&&null==t||(m.time=`${e??\"null\"},${t??\"null\"}`)}return{bbox:e.xmin+\",\"+e.ymin+\",\"+e.xmax+\",\"+e.ymax,bboxSR:s,imageSR:s,size:t+\",\"+r,...n,...m}}async getSamples(e,t){const r=await this._fetchCapabilities(t?.signal);if(!r?.operations.supportsGetSamples)throw new a(\"imagery-layer:get-samples\",\"getSamples operation is not supported on the input image service\");e=f(_e,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),se(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new a(\"imagery-layer:identify\",\"identify operation is not supported on the input image service\");e=f(Se,e).clone(),this.version<10.91&&\"extent\"===e.geometry?.type&&(e.geometry=le.fromExtent(e.geometry));const r=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(r.isOutSide)throw new a(\"imagery-layer:identify\",\"the request cannot be fulfilled when falling outside of the multidimensional subset\");e.timeExtent=r.timeExtent,e.mosaicRule=r.mosaicRule;const{raster:i,rasterFunction:s}=this;return s&&null==e.rasterFunction&&(e.rasterFunction=s),i&&null==e.raster&&(e.raster=i),ne(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new pe;return e.outFields=[\"*\"],e.returnGeometry=!0,e.where=this.definitionExpression||\"1=1\",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),oe(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),me(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),ce(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new a(\"imagery-layer: query-visible-rasters\",\"missing query parameter\");await this.load();const{pixelSize:r,returnDomainValues:i,returnTopmostRaster:s,showNoDataRecords:n}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p=\"raster.servicepixelvalue\",c=this._rasterFunctionNamesIndex;if(null!=e.outFields&&(o=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>p.length)).map((e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new A({functionName:e[0]}))),u=t.map((e=>e[1]));const{rasterFunction:r}=this;0===l.length?r?.functionName?(l.push(r),u.push(r.functionName)):l=null:r?.functionName&&!l.some((e=>e.functionName===r.functionName))&&(l.push(r),u.push(r.functionName))}const m=null==e.outSpatialReference||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:d}=this;let h=e.timeExtent||this.timeExtent;if(d){const{isOutside:t,intersection:r}=E(d,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new a(\"imagery-layer:query-visible-rasters\",\"the request cannot be fulfilled when falling outside of the multidimensional subset\");null!=r?.timeExtent&&(h=r.timeExtent)}const f=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,h);let y=e.geometry;this.version<10.91&&\"extent\"===y?.type&&(y=le.fromExtent(y));const g=this._getQueryParams({geometry:y,timeExtent:h,mosaicRule:f,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:l,pixelSize:r,returnCatalogItems:o,returnGeometry:m,raster:this.raster,maxItemCount:s?1:null});delete g.f;const R=new Se(g);try{await this._generateRasterInfo(this.rasterFunction);const r=await ne(this.url,R,{signal:t?.signal,query:{...this.customParameters}}),s=e.outFields,a=null!=r.value&&r.value.toLowerCase().includes(\"nodata\");if(!(o&&!m&&r?.catalogItems?.features.length&&(n||!a)))return this._processVisibleRastersResponse(r,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s});const l=this.objectIdField||\"ObjectId\",p=r.catalogItems?.features??[],c=p.map((e=>e.attributes?.[l])),d=new pe({objectIds:c,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[l]}),h=await this.queryRasters(d);return h?.features?.length&&h.features.forEach((t=>{p.forEach((r=>{r.attributes[l]===t.attributes[l]&&(r.geometry=new le(t.geometry),null!=e.outSpatialReference&&(r.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(r,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s})}catch{throw new a(\"imagery-layer:query-visible-rasters\",\"encountered error when querying visible rasters\")}}async fetchVariableStatisticsHistograms(e,t){const r=n(Oe(this.parsedUrl)+\"/statistics\",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),i=n(Oe(this.parsedUrl)+\"/histograms\",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([r,i]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createFlowMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(e,t):Fe(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return V(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,r=null!=this.serviceRasterInfo?Promise.resolve(this.serviceRasterInfo):he(Oe(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set(\"serviceRasterInfo\",e),this._set(\"multidimensionalInfo\",e.multidimensionalInfo),fe(e,t),e))),i=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([r,i,s]).then((e=>{e[1]?this._set(\"rasterInfo\",e[1]):this._set(\"rasterInfo\",e[0]),e[2]&&this._set(\"rasterFunctionInfos\",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set(\"renderer\",null),u.getLogger(this).warn(\"ArcGISImageService\",\"Switching to the default renderer. Renderer applied is not valid for this Imagery Layer\")),this._set(\"renderer\",this._configRenderer(this.renderer)),this.addHandles([p((()=>this.rasterFunction),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))}))]);const{serviceRasterInfo:t}=this;null!=t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const r=this.timeInfo,{multidimensionalInfo:i}=this.serviceRasterInfo;if(null==e||null==i||null==t||null==r?.startField)return e;const{startField:s}=r,n=i.variables.some((e=>e.dimensions.some((e=>e.name===s))))?s:\"StdTime\";if(e=e.clone(),\"mosaic-dataset\"===this.sourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==n)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const o=e.multidimensionalDefinition.filter((e=>e.dimensionName===n)),a=null!=t.start?t.start.getTime():null,l=null!=t.end?t.end.getTime():null,u=null==a||null==l||a===l,p=u?[a||l]:[[a,l]],c=this.version>=10.8;if(o.length)o.forEach((e=>{e.dimensionName===n&&(c?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=u,e.values=p))}));else if(!c){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=n,e.isSlice=u,e.values=p})):e.multidimensionalDefinition.push(new I({variableName:\"\",dimensionName:n,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return null==e?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),\"mosaic-dataset\"!==this.sourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new a(\"imagery-layer:query-rasters\",\"query operation is not supported on the input image service\");return e=null!=e?f(pe,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new q;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>{})),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:r}=this;return\"unique-value\"===e.type&&this._hasRasterFunction(r)&&1===t?.bandCount&&[\"u8\",\"s8\"].includes(t.pixelType)||null!=t&&null!=e&&z(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:r,ssl:i}=await n(Oe(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,i&&(this.url=this.url.replace(/^http:/i,\"https:\"))}if(t.capabilities?.toLowerCase().split(\",\").map((e=>e.trim())).indexOf(\"tilesonly\")>-1)throw new a(\"imagery-layer:fetch-service-info\",\"use ImageryTileLayer to open tiles-only image services\");this.read(t,{origin:\"service\",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?\"esriImageServiceSourceTypeMosaicDataset\"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),r=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||r}_isVectorFieldResampleFunction(e){if(null==e)return!1;const{functionName:t,functionArguments:r}=e,i=\"resample\"===t?.toLowerCase(),s=r?.ResampleType||r?.resampleType;return i&&(7===s||10===s)}_isPicture(){return!this.format||this.format.includes(\"jpg\")||this.format.includes(\"png\")}_configRenderer(e){const t=this._isPicture(),{rasterInfo:r}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&r.bandCount>=3){const e=B(r);!e||3===r.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=G(r,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=k(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=r):this.symbolizer=new W({rendererJSON:t,rasterInfo:r}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:null!=e.pixelBlock?e.pixelBlock.clone():null}}_getQueryParams(e){null!=e?.renderingRule&&\"string\"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:r}=this;return{raster:t,viewId:r,f:\"json\",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,r){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):Q(e,t,r)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;if(this.loaded)return t;if(t&&this.version>=10.3){if(1===t.length&&\"none\"===t[0].name.toLowerCase())return t;const r=await n(Oe(this.parsedUrl)+\"/rasterFunctionInfos\",{query:this._getQueryParams(),signal:e});return r.data?.rasterFunctionInfos}return null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes(\"png\"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:r,returnImageBitmap:i,signal:s}=e;if(r&&this._canRequestImageElement(t.format)){const r=`${Oe(this.parsedUrl)}/exportImage`,{data:o}=await n(r,{responseType:i?\"blob\":\"image\",query:this._getQueryParams({f:\"image\",...this.refreshParameters,...e.imageServiceParameters}),signal:s});if(o instanceof Blob){return{imageBitmap:await D(o,r,s),params:t}}return{imageOrCanvasElement:o,params:t}}const o=this._initJobHandler(),l=n(Oe(this.parsedUrl)+\"/exportImage\",{responseType:\"array-buffer\",query:this._getQueryParams({f:\"image\",...e.imageServiceParameters}),signal:s}),u=(await Promise.all([l,o]))[0].data,p=t.format||\"jpgpng\";let c=p;if(\"bsq\"!==c&&\"bip\"!==c&&(c=L(u)),!c)throw new a(\"imagery-layer:fetch-image\",\"unsupported format signature \"+String.fromCharCode.apply(null,new Uint8Array(u)));const m={signal:s},d=\"gif\"===p||\"bmp\"===p||p.includes(\"png\")&&(\"png\"===c||\"jpg\"===c)?Q(u,{useCanvas:!0,...t},m):this._decodePixelBlock(u,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:p},m);return{pixelData:{pixelBlock:await d,extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch((()=>null))}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=H(e,{multidimensionalSubset:this.multidimensionalSubset});if(null!=t&&t.length>0){this.mosaicRule=this.mosaicRule||new P;const e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&\"none\"!==this.rasterFunction.functionName?.toLowerCase()&&t.forEach((e=>e.variableName=\"\")),t=t.filter((({variableName:e,dimensionName:t})=>e&&\"*\"!==e||t)),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,r){r=r||{};const i=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:o,templateFields:a}=r,l=e.processedValues;let u=e.catalogItems?.features,p=e.properties?.Values?.map((e=>e.replaceAll(/ /gi,\", \")))||[];const c=this.objectIdField||\"ObjectId\",m=\"string\"==typeof i&&i.toLowerCase().includes(\"nodata\"),d=[];if(i&&!u&&!m){const e={};e[c]=0;p=[i],u=[new t(this.fullExtent,null,e)]}if(!u)return[];let h,f,y;this._updateResponseFieldNames(u,a),m&&!n&&(u=[]);for(let t=0;t0&&s&&s.length>0&&s.includes(this.rasterFunction.functionName)?l[s.indexOf(this.rasterFunction.functionName)]:i,\"nodata\"===f.toLowerCase()&&!n)continue;const e=\"Raster.ItemPixelValue\",r=\"Raster.ServicePixelValue\";h.attributes[e]=f,h.attributes[r]=y,this._updateFeatureWithMagDirValues(h,f);const o=this.fields&&this.fields.length>0;let a=this.rasterFunction&&null!=this.serviceRasterInfo.attributeTable?o?f:i:y;this.rasterFunction||(a=o?f:i),this._updateFeatureWithRasterAttributeTableValues(h,a)}if(h.sourceLayer=h.layer=this,o&&this._updateFeatureWithDomainValues(h),s&&l&&s.length===l.length)for(let e=0;ee.name)).find((e=>\"value\"===e.toLowerCase()));if(!n)return;const o=i.filter((e=>e.attributes[n]===(null!=t?parseInt(t,10):null)));o&&o[0]&&s.forEach((t=>{const r=this._rasterAttributeTableFieldPrefix+t.name;e.attributes[r]=o[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const r=t.split(/,\\s*/).map((e=>parseFloat(e))),i=r.map((e=>[e])),s=r.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),n=new O({height:1,width:1,pixelType:\"f32\",pixels:i,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new ae(0,0,0,0,this.spatialReference)});const o=\"esriImageServiceDataTypeVector-MagDir\"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:U([n.pixels[0][0],n.pixels[1][0]]);e.attributes[\"Raster.Magnitude\"]=o[0],e.attributes[\"Raster.Direction\"]=o[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&\"coded-value\"===e.domain.type));null!=t&&t.forEach((t=>{const r=e.attributes[t.name];if(null!=r){const i=t.domain.codedValues.find((e=>e.code===r));i&&(e.attributes[t.name]=i.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const r=this.fieldsIndex;null!=r&&e.forEach((e=>{if(e?.attributes)for(const i of t){const t=r.get(i)?.name;t&&t!==i&&(e.attributes[i]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return null!=e?.functionName&&\"none\"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(\"Raw\"===e)return e.replace(\"Raw\",\"None\");const r=e.toLowerCase().replaceAll(/ /gi,\"_\");return t.has(r)?t.get(r):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty(\"functionType\")}_isVectorDataSet(){return\"esriImageServiceDataTypeVector-UV\"===this.serviceDataType||\"esriImageServiceDataTypeVector-MagDir\"===this.serviceDataType}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:r,rasterFunction:i}=this;i&&e instanceof xe&&null==e.rasterFunction&&(e.rasterFunction=i),r&&null==e.mosaicRule&&(e.mosaicRule=r),t&&null==e.raster&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(\",\").map((e=>e.trim())):[\"image\",\"catalog\"],{currentVersion:r,advancedQueryCapabilities:i,maxRecordCount:s}=e,n=t.includes(\"image\"),o=\"esriImageServiceDataTypeElevation\"===e.serviceDataType,a=!(!e.spatialReference&&!e.extent?.spatialReference),l=t.includes(\"edit\"),u=t.includes(\"mensuration\")&&a,p=null==e.mensurationCapabilities?[]:e.mensurationCapabilities.toLowerCase().split(\",\").map((e=>e.trim())),c=u&&p.includes(\"basic\");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:n,supportsExportImage:n,supportsIdentify:n,supportsMeasure:u,supportsDownload:t.includes(\"download\"),supportsQuery:t.includes(\"catalog\")&&e.fields&&e.fields.length>0,supportsGetSamples:r>=10.2&&n,supportsProject:r>=10.3&&n,supportsComputeStatisticsHistograms:r>=10.4&&n,supportsQueryBoundary:r>=10.6&&n,supportsCalculateVolume:r>=10.7&&o,supportsComputePixelLocation:r>=10.7&&t.includes(\"catalog\"),supportsComputeAngles:r>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:s,maxRecordCountFactor:void 0,supportsStatistics:!!i?.supportsStatistics,supportsOrderBy:!!i?.supportsOrderBy,supportsDistinct:!!i?.supportsDistinct,supportsPagination:!!i?.supportsPagination,supportsStandardizedQueriesOnly:!!i?.useStandardizedQueries,supportsPercentileStatistics:!!i?.supportsPercentileStatistics,supportsCentroid:!!i?.supportsReturningGeometryCentroid,supportsDistance:!!i?.supportsQueryWithDistance,supportsExtent:!!i?.supportsReturningQueryExtent,supportsGeometryProperties:!!i?.supportsReturningGeometryProperties,supportsHavingClause:!!i?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!i?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:c,supportsAreaAndPerimeter:c,supportsPointOrCentroid:c,supportsHeightFromBaseAndTop:u&&p.includes(\"base-top height\"),supportsHeightFromBaseAndTopShadow:u&&p.includes(\"base-top shadow height\"),supportsHeightFromTopAndTopShadow:u&&p.includes(\"top-top shadow height\"),supports3D:u&&p.includes(\"3d\")}}}};function Oe(e){return e?.path??\"\"}return e([m({clonable:!1})],y.prototype,\"_functionRasterInfos\",void 0),e([m({clonable:!1})],y.prototype,\"_rasterJobHandler\",void 0),e([m({clonable:!1})],y.prototype,\"_cachedRendererJson\",void 0),e([m({readOnly:!0})],y.prototype,\"_serviceSupportsMosaicRule\",void 0),e([g(\"_serviceSupportsMosaicRule\",[\"currentVersion\",\"fields\"])],y.prototype,\"readServiceSupportsMosaicRule\",null),e([m({readOnly:!0})],y.prototype,\"_rasterAttributeTableFieldPrefix\",void 0),e([m({readOnly:!0})],y.prototype,\"_rasterFunctionNamesIndex\",null),e([m()],y.prototype,\"adjustAspectRatio\",void 0),e([m({type:[h],json:{write:!0}})],y.prototype,\"bandIds\",void 0),e([g(\"bandIds\")],y.prototype,\"readBandIds\",null),e([m({readOnly:!0,json:{read:!1}})],y.prototype,\"capabilities\",void 0),e([g(\"service\",\"capabilities\",[\"capabilities\",\"currentVersion\",\"serviceDataType\"])],y.prototype,\"readCapabilities\",null),e([m({type:Number})],y.prototype,\"compressionQuality\",void 0),e([b(\"compressionQuality\")],y.prototype,\"writeCompressionQuality\",null),e([m({type:Number})],y.prototype,\"compressionTolerance\",void 0),e([b(\"compressionTolerance\")],y.prototype,\"writeCompressionTolerance\",null),e([m({json:{read:{source:\"copyrightText\"}}})],y.prototype,\"copyright\",void 0),e([m({readOnly:!0,dependsOn:[\"_serviceSupportsMosaicRule\"]})],y.prototype,\"defaultMosaicRule\",void 0),e([g(\"defaultMosaicRule\",[\"defaultMosaicMethod\"])],y.prototype,\"readDefaultMosaicRule\",null),e([m({type:String,json:{name:\"layerDefinition.definitionExpression\",write:{enabled:!0,allowNull:!0}}})],y.prototype,\"definitionExpression\",void 0),e([m({readOnly:!0,constructOnly:!0})],y.prototype,\"exportImageServiceParameters\",void 0),e([m()],y.prototype,\"rasterInfo\",void 0),e([m({readOnly:!0,type:[_]})],y.prototype,\"fields\",void 0),e([m({readOnly:!0})],y.prototype,\"fieldsIndex\",null),e([m({type:[\"png\",\"png8\",\"png24\",\"png32\",\"jpg\",\"bmp\",\"gif\",\"jpgpng\",\"lerc\",\"tiff\"],json:{write:!0}})],y.prototype,\"format\",null),e([g(\"service\",\"format\",[\"serviceDataType\"])],y.prototype,\"readFormat\",null),e([m({type:ae})],y.prototype,\"fullExtent\",void 0),e([m({readOnly:!0})],y.prototype,\"hasMultidimensions\",void 0),e([m({json:{read:{source:\"maxImageHeight\"}}})],y.prototype,\"imageMaxHeight\",void 0),e([m({json:{read:{source:\"maxImageWidth\"}}})],y.prototype,\"imageMaxWidth\",void 0),e([m({type:String,json:{type:C.jsonValues,read:C.read,write:C.write}})],y.prototype,\"interpolation\",void 0),e([m()],y.prototype,\"minScale\",void 0),e([g(\"service\",\"minScale\")],y.prototype,\"readMinScale\",null),e([m()],y.prototype,\"maxScale\",void 0),e([g(\"service\",\"maxScale\")],y.prototype,\"readMaxScale\",null),e([m({type:P})],y.prototype,\"mosaicRule\",null),e([g(\"mosaicRule\",[\"mosaicRule\",\"defaultMosaicMethod\"])],y.prototype,\"readMosaicRule\",null),e([b(\"mosaicRule\")],y.prototype,\"writeMosaicRule\",null),e([m()],y.prototype,\"multidimensionalInfo\",void 0),e([m({type:T,json:{write:!0}})],y.prototype,\"multidimensionalSubset\",void 0),e([m({json:{type:h}})],y.prototype,\"noData\",void 0),e([b(\"noData\")],y.prototype,\"writeNoData\",null),e([m({type:String,json:{type:N.jsonValues,read:N.read,write:N.write}})],y.prototype,\"noDataInterpretation\",void 0),e([m({type:String,readOnly:!0,json:{read:{source:[\"fields\"]}}})],y.prototype,\"objectIdField\",void 0),e([g(\"objectIdField\")],y.prototype,\"readObjectIdField\",null),e([m({readOnly:!0})],y.prototype,\"geometryType\",void 0),e([m({})],y.prototype,\"typeIdField\",void 0),e([m({})],y.prototype,\"types\",void 0),e([m({readOnly:!0})],y.prototype,\"parsedUrl\",null),e([m({type:Function})],y.prototype,\"pixelFilter\",void 0),e([m()],y.prototype,\"raster\",void 0),e([m({readOnly:!0})],y.prototype,\"sourceType\",void 0),e([g(\"sourceType\",[\"serviceSourceType\",\"fields\"])],y.prototype,\"readSourceType\",null),e([m()],y.prototype,\"viewId\",void 0),e([m({types:r,json:{name:\"layerDefinition.drawingInfo.renderer\",origins:{\"web-scene\":{types:i,name:\"layerDefinition.drawingInfo.renderer\",write:{overridePolicy:e=>({enabled:e&&\"vector-field\"!==e.type&&\"flow\"!==e.type})}}}}})],y.prototype,\"renderer\",null),e([g(\"renderer\")],y.prototype,\"readRenderer\",null),e([b(\"renderer\")],y.prototype,\"writeRenderer\",null),e([m({clonable:!1})],y.prototype,\"symbolizer\",void 0),e([m(x)],y.prototype,\"opacity\",void 0),e([m({readOnly:!0})],y.prototype,\"rasterFields\",null),e([m({constructOnly:!0})],y.prototype,\"rasterFunctionInfos\",void 0),e([m({type:A})],y.prototype,\"renderingRule\",null),e([m({type:A,json:{name:\"renderingRule\"}})],y.prototype,\"rasterFunction\",null),e([g(\"rasterFunction\",[\"renderingRule\",\"rasterFunctionInfos\"])],y.prototype,\"readRasterFunction\",null),e([m({readOnly:!0})],y.prototype,\"serviceDataType\",void 0),e([m({readOnly:!0,type:De})],y.prototype,\"spatialReference\",void 0),e([g(\"spatialReference\",[\"spatialReference\",\"extent\"])],y.prototype,\"readSpatialReference\",null),e([m({json:{type:M.jsonValues}})],y.prototype,\"pixelType\",void 0),e([g(\"pixelType\")],y.prototype,\"readPixelType\",null),e([b(\"pixelType\")],y.prototype,\"writePixelType\",null),e([m({constructOnly:!0,type:J})],y.prototype,\"serviceRasterInfo\",void 0),e([m()],y.prototype,\"sourceJSON\",void 0),e([m(S)],y.prototype,\"url\",void 0),e([m({readOnly:!0})],y.prototype,\"version\",void 0),e([g(\"version\",[\"currentVersion\",\"fields\",\"timeInfo\"])],y.prototype,\"readVersion\",null),y=e([R(\"esri.layers.mixins.ArcGISImageService\")],y),y};export{Oe as ArcGISImageService};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../PopupTemplate.js\";import{ClonableMixin as t}from\"../core/Clonable.js\";import s from\"../core/Error.js\";import{MultiOriginJSONMixin as i}from\"../core/MultiOriginJSONSupport.js\";import{debounce as o,throwIfAbortError as a}from\"../core/promiseUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as l}from\"../core/accessorSupport/decorators/writer.js\";import m from\"./Layer.js\";import{ArcGISImageService as c}from\"./mixins/ArcGISImageService.js\";import{ArcGISService as u}from\"./mixins/ArcGISService.js\";import{BlendLayer as y}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as d}from\"./mixins/CustomParametersMixin.js\";import{OperationalLayer as h}from\"./mixins/OperationalLayer.js\";import{PortalLayer as f}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as v}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as g}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as S}from\"./mixins/TemporalLayer.js\";import{legendEnabled as j,popupEnabled as w}from\"./support/commonProperties.js\";import{serviceSupportsSpatialReference as L}from\"./support/versionUtils.js\";import{createPopupTemplate as I}from\"../support/popupUtils.js\";import{SaveOperationType as b}from\"../webdoc/interfaces.js\";let T=class extends(y(S(g(h(f(c(v(d(u(i(t(m)))))))))))){constructor(...e){super(...e),this.isReference=null,this.operationalLayerType=\"ArcGISImageServiceLayer\",this.popupEnabled=!0,this.popupTemplate=null,this.type=\"imagery\",this._debouncedSaveOperations=o((async(e,r,t)=>{const{save:s,saveAs:i}=await import(\"./save/imageryUtils.js\");switch(e){case b.SAVE:return s(this,r);case b.SAVE_AS:return i(this,t,r)}}))}normalizeCtorArgs(e,r){return\"string\"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Image Service\"]},e).catch(a).then((()=>this._fetchService(r)))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get(\"legendEnabled\")??!0)}set legendEnabled(e){this._set(\"legendEnabled\",e)}get listMode(){return this._isPreviewLayer?\"hide\":this._get(\"listMode\")}set listMode(e){this._set(\"listMode\",e)}writeOperationalLayerType(e,r,t){const s=\"vector-field\"===this.renderer?.type;r[t]=s?\"ArcGISImageServiceVectorLayer\":\"ArcGISImageServiceLayer\"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes(\"/rasterrendering/imageserver\"))}createPopupTemplate(e){const r=this.rasterFields,t=this.title,s=new Set;let i=!1,o=!1;this.capabilities&&(i=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,o=\"esriImageServiceDataTypeVector-UV\"===this.serviceDataType||\"esriImageServiceDataTypeVector-MagDir\"===this.serviceDataType);const a=new Set;i&&a.add(\"raster.itempixelvalue\");for(const n of r){const e=n.name.toLowerCase();a.has(e)||e.includes(\"raster.servicepixelvalue.\")||s.add(n.name)}o&&s.add(\"raster.magnitude\").add(\"raster.direction\");const p=I({fields:r,title:t},{...e,visibleFieldNames:s});return p?.fieldInfos&&this.rasterInfo?.pixelType.startsWith(\"f\")&&p.fieldInfos.forEach((({format:e,fieldName:r})=>{e&&/^raster\\.(item|service)pixelvalue/i.test(r)&&(e.places=2)})),p}queryFeatures(e,r){return this.queryRasters(e,r).then((e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e}))}queryFeatureCount(e,r){return this.queryRasterCount(e,r)}redraw(){this.emit(\"redraw\")}async save(e){return this._debouncedSaveOperations(b.SAVE,e)}async saveAs(e,r){return this._debouncedSaveOperations(b.SAVE_AS,r,e)}serviceSupportsSpatialReference(e){return L(this,e)}write(e,r){if(!this._isPreviewLayer)return super.write(e,r);if(r?.messages){const e=`${r.origin}/${r.layerContainerType||\"operational-layers\"}`;r.messages.push(new s(\"layer:unsupported\",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}};e([p(j)],T.prototype,\"legendEnabled\",null),e([p({type:[\"show\",\"hide\"]})],T.prototype,\"listMode\",null),e([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],T.prototype,\"isReference\",void 0),e([p({type:[\"ArcGISImageServiceLayer\"],json:{origins:{\"web-map\":{type:[\"ArcGISImageServiceLayer\",\"ArcGISImageServiceVectorLayer\"],read:!1,write:{target:\"layerType\",ignoreOrigin:!0}}}}})],T.prototype,\"operationalLayerType\",void 0),e([l(\"web-map\",\"operationalLayerType\")],T.prototype,\"writeOperationalLayerType\",null),e([p(w)],T.prototype,\"popupEnabled\",void 0),e([p({type:r,json:{read:{source:\"popupInfo\"},write:{target:\"popupInfo\"}}})],T.prototype,\"popupTemplate\",void 0),e([p({readOnly:!0})],T.prototype,\"defaultPopupTemplate\",null),e([p({readOnly:!0,json:{read:!1}})],T.prototype,\"type\",void 0),e([p({readOnly:!0})],T.prototype,\"_isPreviewLayer\",null),T=e([n(\"esri.layers.ImageryLayer\")],T);const x=T;export{x as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import t from\"../../../request.js\";import i from\"../../../core/Error.js\";import{JSONSupport as o}from\"../../../core/JSONSupport.js\";import r from\"../../../core/Logger.js\";import{EsriPromiseMixin as n}from\"../../../core/Promise.js\";import{onAbort as s}from\"../../../core/promiseUtils.js\";import{property as l}from\"../../../core/accessorSupport/decorators/property.js\";import{ensureClass as a}from\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as c}from\"../../../core/accessorSupport/decorators/subclass.js\";import{sanitizeUrl as m}from\"../arcgisLayerUrl.js\";import{url as f}from\"../commonProperties.js\";import u from\"../DimensionalDefinition.js\";import h from\"../LOD.js\";import p from\"../RasterStorageInfo.js\";import d from\"../TileInfo.js\";import{isMultiSliceOrRangeDefinition as x,getSliceIndex as y,createSlices as g,getSliceIds as I}from\"./multidimensionalUtils.js\";import{getRasterId as R,getBlock as w,putBlock as S,deleteBlock as k,decreaseRefCount as T}from\"./RawBlockCache.js\";import{convertNoDataToMask as b}from\"../rasterFormats/pixelRangeUtils.js\";import{decode as v}from\"../rasterFormats/RasterCodec.js\";import{mosaic as P,approximateTransform as B,getLocalArithmeticNorthRotations as M}from\"../rasterFunctions/pixelUtils.js\";import{load as _,getWorldWidth as W,projectPoint as C,snapPyramid as j,shiftExtent as H,getWorldWrapCount as z,projectExtent as L,getProjectionOffsetGrid as E,getRasterDatasetAlignmentInfo as D,projectResolution as F}from\"../rasterFunctions/rasterProjectionHelper.js\";import{convertToLocalDirections as O,uvComponentToVector as A}from\"../rasterFunctions/vectorFieldUtils.js\";import G from\"../../../geometry/Extent.js\";import q from\"../../../geometry/Point.js\";const J=8,N=256;let V=class extends(n(o)){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:\"closest\"}}async init(){const e=_();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:\"closest\",tileInfo:d.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=W(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||\"gcs-shift\"===e.type}set rasterJobHandler(e){this._set(\"rasterJobHandler\",e),\"Function\"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}set url(e){this._set(\"url\",m(e,r.getLogger(this)))}async open(e){throw new i(\"BaseRaster:open-not-implemented\",\"open() is not implemented\")}async fetchTile(e,t,i,o={}){const r=o.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,i,r);return this.fetchPixels(n,r.size[0],r.size[1],o)}async identify(e,t={}){e=a(q,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:o}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:s}=r;let{transposedVariableName:l}=t;const c=null!=s&&n&&(null!=o||x(i));if(c&&!l){l=null!=i&&i.length>0?i[0].variableName??void 0:s.variables[0].name,t={...t,transposedVariableName:l}}t=this._getRequestOptionsWithSliceId(t);const{spatialReference:m,extent:f}=r,{datumTransformation:u}=t;let h=C(e,m,u);if(!f.intersects(h))return{location:h,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(h);if(!r.nativeExtent.intersects(e))return{location:e,value:null};h=e}let p=0;const d=null!=l&&null!=s&&r.hasMultidimensionalTranspose;if(\"Function\"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(d)return e.identify(h,t);const{pixelSize:i}=r,o=3,n=i.x*o/2,s=i.y*o/2,l=new G({xmin:h.x-n,xmax:h.x+n,ymin:h.y-s,ymax:h.y+s,spatialReference:m}),a={interpolation:\"nearest\"},{pixelBlock:c}=await e.fetchPixels(l,o,o,a),{pixelBlock:f}=await this.fetchPixels(l,o,o,a);if(null==c)return{location:h,value:null};const u=Math.floor(o*o*.5),p=!c.mask||c.mask[u]?c.pixels.map((e=>e[u])):null;let x;return null!=f&&(x=!f.mask||f.mask[u]?f.pixels.map((e=>e[u])):void 0),{location:h,value:p,processedValue:x,pyramidLevel:0}}if(!d)if(t.srcResolution){p=j(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel}else if(p=await this.computeBestPyramidLevelForLocation(e,t),null==p)return{location:h,value:null};const y=this.identifyPixelLocation(h,p,null,d);if(null===y)return{location:h,value:null};const{row:g,col:I,rowOffset:k,colOffset:T,blockWidth:b}=y,v=l??t.sliceId,P=R(this.url,v),B=`${p}/${g}/${I}`;let M=w(P,null,B);null==M&&(M=this.fetchRawTile(p,g,I,t),S(P,null,B,M));const _=await M;if(!_?.pixels?.length)return{location:h,value:null};const W=k*b+T;return this._processIdentifyResult(_,{srcLocation:h,position:W,pyramidLevel:p,useTransposedTile:!!d,requestSomeSlices:c,identifyOptions:t})}async fetchPixels(e,t,i,o={}){e=H(e),o=this._getRequestOptionsWithSliceId(o);const{_hasNoneOrGCSShiftTransform:r}=this;if(o.requestRawData&&r)return this._fetchPixels(e,t,i,o);const n=W(e.spatialReference),s=z(e);if(null==n||0===s||1===s&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,o);if(s>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,m=Math.round(n/(c-a)*t),f=m-Math.round((n/2-a)/(c-a)*t);let u=0;const h=[];for(let y=0;y<=s;y++){const r=new G({xmin:0===y?a:-n/2,xmax:y===s?c-n*y:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===y?m-f:y===s?t-u:m;u+=p,h.push(p);const d=o.disableWrapAround&&y>0?null:this._fetchPixels(r,p,i,o);l.push(d)}const p=(await Promise.all(l)).map((e=>e?.pixelBlock));let d=null;const x={width:t,height:i};if(this.rasterJobHandler){d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:x,destDimension:null,coefs:null,sampleSpacing:null,interpolation:\"nearest\",alignmentInfo:null,blockWidths:h},o)).pixelBlock}else d=P(p,x,{blockWidths:h});return{extent:e,srcExtent:L(e,this.rasterInfo.spatialReference,o.datumTransformation),pixelBlock:d}}async fetchRawPixels(e,t,i,o={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,o),{nativeExtent:n,nativePixelSize:s,storageInfo:l}=this.rasterInfo,a=2**e,c=s.x*a,m=s.y*a,f=new G({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-m*(t.y+i.height-1),ymax:n.ymax-m*t.y,spatialReference:n.spatialReference});if(!r)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:u,mosaicSize:h}=r;if(1===u.length&&null!=u[0]&&u[0].width===i.width&&u[0].height===i.height)return{extent:f,srcExtent:f,pixelBlock:r.pixelBlocks[0]};const p=e>0?l.pyramidBlockWidth:l.blockWidth,d=e>0?l.pyramidBlockHeight:l.blockHeight,x={x:t.x%p,y:t.y%d};let y;if(this.rasterJobHandler){y=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:u,srcMosaicSize:h,destDimension:i,clipOffset:x,clipSize:i,coefs:null,sampleSpacing:null,interpolation:o.interpolation,alignmentInfo:null,blockWidths:null},o)).pixelBlock}else y=P(u,h,{clipOffset:x,clipSize:i});return{extent:f,srcExtent:f,pixelBlock:y}}fetchRawTile(e,t,o,r){throw new i(\"BaseRaster:read-not-implemented\",\"fetchRawTile() is not implemented\")}computeExtent(e){return L(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?v(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,i,o=0){const{customFetchParameters:r}=this.ioConfig,{range:n,query:s,headers:l}=i;o=o??i.retryCount??this.ioConfig.retryCount;const a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await t(e,{...i,query:{...s,...r},headers:{...l,...a}})}catch(c){if(o>0)return o--,this.request(e,i,o);throw c}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:y(e,t)}getTileExtentFromTileInfo(e,t,i,o){const r=o.lodAt(e);return this.getTileExtent({x:r.resolution,y:r.resolution},t,i,o.origin,o.spatialReference,o.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:o}=this.rasterInfo;if(!e.tileInfo){const r=[],n=e.maximumPyramidLevel||0;let s=Math.max(o.x,o.y),l=1/.0254*96*s;for(let e=0;e<=n;e++)r.unshift(new h({level:n-e,resolution:s,scale:l})),s*=2,l*=2;const a=new q({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new d({origin:a,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,o){const{width:r,height:n,nativeExtent:s,pixelSize:l,spatialReference:a}=e,c=new q({x:s.xmin,y:s.ymax,spatialReference:a});null==o&&(o=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const m=this.computeBlockBoundary(s,512,512,{x:s.xmin,y:s.ymax},[l],o);e.storageInfo=new p({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:o,blockBoundary:m})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,o,r,n=0,s=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;il)return null;const h=this.getPyramidPixelSize(t),{x:p,y:d}=h,x=(a.y-u.y)/d/f,y=(u.x-a.x)/p/m,g=Math.min(f-1,Math.floor((x-Math.floor(x))*f)),I=Math.min(m-1,Math.floor((y-Math.floor(y))*m));return{pyramidLevel:t,row:Math.floor(x),col:Math.floor(y),rowOffset:g,colOffset:I,blockWidth:m,srcLocation:u}}getTileExtent(e,t,i,o,r,n){const[s,l]=n,a=o.x+i*s*e.x,c=a+s*e.x,m=o.y-t*l*e.y,f=m-l*e.y;return new G({xmin:a,xmax:c,ymin:f,ymax:m,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const o=this.rasterInfo.storageInfo.blockBoundary[e];return!o||o.maxRowt||o.minCol>i}async _fetchPixels(e,t,i,o={}){let r=z(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,o),{pyramidLevel:s,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:m,ul:f}=n;if(0===c||0===m)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:u}=this,h=u.transform,p=\"gcs-shift\"===h?.type,d=null!=W(e.spatialReference);!p&&d||(r=z(n.srcExtent,p));const x=await this._fetchRawTiles(s,f,{width:c,height:m,wrapCount:r},o);if(!x)return{extent:e,srcExtent:a,pixelBlock:null};const y=u.storageInfo,g=s>0?y.pyramidBlockWidth:y.blockWidth,I=s>0?y.pyramidBlockHeight:y.blockHeight;let{x:R,y:w}=u.pixelSize;if(s>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=y;if(null!=e&&e[s-1])({x:R,y:w}=e[s-1]);else{const e=t**s;R*=e,w*=e}}const S=u.spatialReference,k=new q({x:R,y:w,spatialReference:S}),T=g===c&&I===m&&f.x%g==0&&f.y%I==0,b=new q({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),v=!e.spatialReference.equals(S),C=S.isGeographic?1e-9:1e-4,{datumTransformation:j}=o;if(!v&&T&&1===x.pixelBlocks.length&&g===t&&I===i&&this._isSameResolution(l,b,C))return{extent:e,srcExtent:a,srcTilePixelSize:k,pixelBlock:x.pixelBlocks[0]};const H=d&&null!=W(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,L=o.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith(\"vector\");L&&!this.rasterJobHandler&&await _();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:b.toJSON(),datumTransformation:j,rasterTransform:h,hasWrapAround:r>0||H,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:L},o):E({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:b,datumTransformation:j,rasterTransform:h,hasWrapAround:r>0||H,isAdaptive:!1,includeGCSGrid:L});let F;const A=!o.requestRawData,G={rows:D.spacing[0],cols:D.spacing[1]},J=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(s,x.extent.xmin):void 0,{pixelBlocks:N,mosaicSize:V,isPartiallyFilled:U}=x;let $=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:N,srcMosaicSize:V,destDimension:A?{width:t,height:i}:null,coefs:A?D.coefficients:null,sampleSpacing:A?G:null,projectDirections:L,gcsGrid:L?D.gcsGrid:null,isUV:\"vector-uv\"===this.rasterInfo.dataType,interpolation:o.interpolation,alignmentInfo:J,blockWidths:null},o);({pixelBlock:F,localNorthDirections:$}=e)}else{const e=P(N,V,{alignmentInfo:J});F=A?B(e,{width:t,height:i},D.coefficients,G,o.interpolation):e,L&&D.gcsGrid&&($=M({width:t,height:i},D.gcsGrid),F=O(F,this.rasterInfo.dataType,$))}return o.requestRawData||L?{extent:e,srcExtent:a,srcTilePixelSize:k,pixelBlock:F,transformGrid:D,localNorthDirections:$,isPartiallyFilled:U}:{extent:e,srcExtent:a,srcTilePixelSize:k,pixelBlock:F}}async _fetchRawTiles(e,t,i,o){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:s,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:m,height:f,wrapCount:u}=i;const h=this._getRasterTileAlignmentInfo(e,0);o.buffer&&(a-=o.buffer.cols,c-=o.buffer.rows,m+=2*o.buffer.cols,f+=2*o.buffer.rows);let p=0,d=0,x=0;if(u&&null!=h){({worldColumnCountFromOrigin:d,originColumnOffset:x,rightPadding:p}=h);d*h.blockWidth-p>=a+m&&(p=0)}const y=Math.floor(a/s),g=Math.floor(c/l),I=Math.floor((a+m+p-1)/s),R=Math.floor((c+f+p-1)/l),w=n[e];if(!w)return null;const{minRow:S,minCol:k,maxCol:T,maxRow:b}=w;if(0===u&&(Rb||y>T))return null;const v=new Array;let P=!1;const B=null==this.ioConfig.allowPartialFill?o.allowPartialFill:this.ioConfig.allowPartialFill;for(let z=g;z<=R;z++)for(let t=y;t<=I;t++){let i=t;if(!o.disableWrapAround&&u&&null!=h&&d<=t&&(i=t-d-x),z>=S&&i>=k&&b>=z&&T>=i){const t=this._fetchRawTile(e,z,i,o);B?v.push(new Promise((e=>{t.then((t=>e(t))).catch((()=>{P=!0,e(null)}))}))):v.push(t)}else v.push(Promise.resolve(null))}if(0===v.length)return null;const M=await Promise.all(v),_={height:(R-g+1)*l,width:(I-y+1)*s},{spatialReference:W}=this.rasterInfo,C=this.getPyramidPixelSize(e),{x:j,y:H}=C;return{extent:new G({xmin:r.x+y*s*j,xmax:r.x+(I+1)*s*j,ymin:r.y-(R+1)*l*H,ymax:r.y-g*l*H,spatialReference:W}),pixelBlocks:M,mosaicSize:_,isPartiallyFilled:P}}_isSameResolution(e,t,i){return Math.abs(e.x-t.x)c||i>a)return Promise.resolve(null);const m=R(this.url,o.sliceId),f=`${e}/${t}/${i}`;let u=w(m,o.registryId,f);if(null==u){const r=new AbortController;u=this.fetchRawTile(e,t,i,{...o,signal:r.signal}),S(m,o.registryId,f,u,r),u.catch((()=>k(m,o.registryId,f)))}return o.signal&&s(o,(()=>{T(m,o.registryId,f)})),u}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if(!(2===t&&\"vector-magdir\"===i||\"vector-uv\"===i)||2!==e?.length||!e[0]?.length)return null;const o=e[0].length;if(\"vector-magdir\"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[r,n]=e,s=[],l=[];for(let a=0;a=16,u=a===n&&this._requireTooManySrcTiles(s,l,t,i);if(f||u||(0===s||0===l)){const s=new q({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=F(s,this.rasterInfo.spatialReference,e,r.datumTransformation);const u=!l||o.srcResolution&&l.x+l.y=e){const t=2**e;l={x:o.srcResolution.x*t,y:o.srcResolution.y*t}}}l&&(r.srcResolution=l,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,o){const{tileInfo:r}=this.rasterInfo.storageInfo;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=N||e/i>J||t/o>J}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,o=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:s,pyramidResolution:l,excessiveReading:a}=j(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||L(e,o,n);if(null==c)return;const m=i.transform;m&&(c=m.inverseTransform(c)),t.srcExtent=c;const{x:f,y:u}=i.storageInfo.origin,h=Math.floor((c.xmin-f)/l.x+.1),p=Math.floor((u-c.ymax)/l.y+.1),d=Math.floor((c.xmax-f)/l.x-.1),x=Math.floor((u-c.ymin)/l.y-.1),y=c.width<.1*l.x?0:d-h+1,g=c.height<.1*l.y?0:x-p+1;t.pyramidLevel=s,t.pyramidResolution=l,t.srcWidth=y,t.srcHeight=g,t.ul={x:h,y:p}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:o,pyramidLevel:r,useTransposedTile:n}=t,s=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[o]))return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!n){const t=e.pixels.map((e=>e[o])),n={location:i,value:t,pyramidLevel:r},s=this._computeMagDirValues(t.map((e=>[e])));return s?.length&&(n.magdirValue=s.map((e=>e[0]))),n}let a=e.pixels.map((e=>e.slice(o*s,o*s+s))),c=this._computeMagDirValues(a);const{requestSomeSlices:m,identifyOptions:f}=t;let h=g(l,f.transposedVariableName);if(m){const e=I(h,f.multidimensionalDefinition,f.timeExtent);a=a.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),h=e.map((e=>h[e]))}const p=e.noDataValues||this.rasterInfo.noDataValue,d={pixels:a,pixelType:e.pixelType};let x;null!=p&&(b(d,p),x=d.mask);return{location:i,value:null,dataSeries:h.map(((e,t)=>{const i={value:0===x?.[t]?null:a.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new u({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:r}}};e([l()],V.prototype,\"_rasterTileAlighmentInfo\",void 0),e([l({readOnly:!0})],V.prototype,\"_isGlobalWrappableSource\",null),e([l({readOnly:!0})],V.prototype,\"_hasNoneOrGCSShiftTransform\",null),e([l()],V.prototype,\"rasterJobHandler\",null),e([l(f)],V.prototype,\"url\",null),e([l({type:String,json:{write:!0}})],V.prototype,\"datasetName\",void 0),e([l({type:String,json:{write:!0}})],V.prototype,\"datasetFormat\",void 0),e([l()],V.prototype,\"hasUniqueSourceStorageInfo\",void 0),e([l()],V.prototype,\"rasterInfo\",void 0),e([l()],V.prototype,\"ioConfig\",void 0),e([l()],V.prototype,\"sourceJSON\",void 0),V=e([c(\"esri.layers.support.rasterDatasets.BaseRaster\")],V);const U=V;export{U as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import e from\"../../../core/Error.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as s}from\"../../../core/accessorSupport/decorators/subclass.js\";import a from\"./BaseRaster.js\";import{approximateTransform as i}from\"../rasterFunctions/pixelUtils.js\";import o from\"../../../rest/support/FeatureSet.js\";let n=class extends a{constructor(){super(...arguments),this.datasetFormat=\"Function\",this.tileType=\"Raster\",this.rasterFunction=null}async open(t){await this.init();const{rasterFunction:r}=this;this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((t=>t.rasterJobHandler=this.rasterJobHandler)));const{rasters:s,rasterIds:a}=this.primaryRasters,i=s.map((e=>e.rasterInfo?void 0:e.open(t)));await Promise.all(i);const n=s.map((({rasterInfo:t})=>t)),c=r.bind({rasterInfos:n,rasterIds:a});if(!c.success||0===n.length)throw new e(\"raster-function:open\",`cannot bind the function: ${c.error??\"\"}`);const l=\"Table\"===r.functionName?r:r.functionArguments?.raster;\"Table\"===l?.functionName&&(r.rasterInfo.attributeTable=o.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=n[0];this.hasUniqueSourceStorageInfo=1===n.length||n.slice(1).every((t=>this._hasSameStorageInfo(t,p))),this.set(\"sourceJSON\",s[0].sourceJSON),this.set(\"rasterInfo\",r.rasterInfo)}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(t,e,r,s={}){const{rasters:a,rasterIds:o}=this.primaryRasters;let n=!1;const{interpolation:c}=s,l=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&\"bilinear\"!==c&&l&&(n=1===a.length&&!s.skipRasterFunction,s={...s,interpolation:\"bilinear\",requestRawData:n});const p=a.map((a=>a.fetchPixels(t,e,r,s))),u=await Promise.all(p),m=u.map((t=>t.pixelBlock)),h=n||s.requestRawData?u.map((t=>t.srcTilePixelSize)):null;if(s.skipRasterFunction||m.every((t=>null==t)))return u[0];const d=u.find((t=>null!=t.pixelBlock))?.extent??t,f=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:m,primaryPixelSizes:h,primaryRasterIds:o}):this.rasterFunction.process({extent:d,primaryPixelBlocks:m,primaryPixelSizes:h,primaryRasterIds:o}),{transformGrid:y}=u[0];if(!n||null==f||null==y)return{...u[0],pixelBlock:f};const x={rows:y.spacing[0],cols:y.spacing[1]};let b;if(this.rasterJobHandler){b=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[f],srcMosaicSize:{width:f.width,height:f.height},destDimension:{width:e,height:r},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock}else b=i(f,{width:e,height:r},y.coefficients,x,c);return{extent:t,srcExtent:u[0].srcExtent,pixelBlock:b}}_hasSameStorageInfo(t,e){const{storageInfo:r,pixelSize:s,spatialReference:a,extent:i}=t,{storageInfo:o,pixelSize:n,spatialReference:c,extent:l}=e;return s.x===n.x&&s.y===n.y&&a.equals(c)&&i.equals(l)&&r.blockHeight===o.blockHeight&&r.blockWidth===o.blockWidth&&r.maximumPyramidLevel===o.maximumPyramidLevel}};t([r({type:String,json:{write:!0}})],n.prototype,\"datasetFormat\",void 0),t([r()],n.prototype,\"tileType\",void 0),t([r()],n.prototype,\"rasterFunction\",void 0),t([r()],n.prototype,\"primaryRasters\",void 0),n=t([s(\"esri.layers.support.rasterDatasets.FunctionRaster\")],n);const c=n;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getMetersPerUnitForSR as t}from\"../../../core/unitUtils.js\";import e from\"../../../geometry/Extent.js\";import i from\"../PixelBlock.js\";function n(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function a(t,e,n){if(\"extent\"===n.type)return o(t,e,n);const{width:a,height:x}=t,l=new Uint8Array(a*x),{contains:m,intersects:s}=await import(\"../../../geometry/geometryEngine.js\");return s(e,n)?\"polyline\"===n.type?r(t,e,n):m(n,e)?t:h(t,e,n):new i({pixelType:t.pixelType,width:a,height:x,mask:l,maskIsAlpha:!1,pixels:[...t.pixels]})}function h(t,e,n){if(!t)return t;const{width:a,height:h}=t,o=e.width/a,r=e.height/h,{xmin:x,ymax:l}=e;let m;if(\"extent\"===n.type){const t=(n.xmin-x)/o,e=(n.xmax-x)/o,i=(l-n.ymax)/r,a=(l-n.ymin)/r;m=[[[t,i],[t,a],[e,a],[e,i],[t,i]]]}else m=n.rings.map((t=>t.map((([t,e])=>[(t-x)/o,(l-e)/r]))));const s=document.createElement(\"canvas\");s.width=a,s.height=h;const p=s.getContext(\"2d\");p.fillStyle=\"#f00\",m.forEach((t=>{p.beginPath(),p.moveTo(t[0][0],t[0][1]);for(let e=0;e127?255:0);return new i({pixelType:t.pixelType,width:a,height:h,mask:M,maskIsAlpha:!1,pixels:[...t.pixels]})}function o(t,e,n){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h;if(n.width/r<.5||n.height/x<.5)return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const{xmin:l,xmax:m,ymin:s,ymax:p}=e,{xmin:f,xmax:y,ymin:c,ymax:M}=n,u=Math.max(l,f),w=Math.min(m,y),d=Math.max(s,c),g=Math.min(p,M),T=.5*r,k=.5*x;if(w-um-T||d>p-k||g.5&&R%1<.5||P===v&&U%1>.5&&j%1<.5)return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});if(0===E&&0===P&&I===a&&v===h)return t;const b=t.mask;for(let i=P;i<=v;i++)for(let t=E;t<=I;t++){const e=i*a+t;o[e]=b?b[e]:255}return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function r(t,e,n){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h,{xmin:l,ymax:m}=e,{paths:s}=n,p=t.mask;for(let i=0;iu?r*Math.round((f-u)/r):0),c=w-(cu?r*Math.round((y-u)/r):0),M=w-(Mu?r*Math.floor((f-u)/r+.1):0),c=w-(c{let V=class extends o{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=\"nearest\",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=\"Function\"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.rasterInfo?.extent}set multidimensionalDefinition(e){this._set(\"multidimensionalDefinition\",e),this.updateRenderer()}set rasterFunction(e){\"none\"===e?.functionName?.toLowerCase()&&(e=void 0),this._set(\"rasterFunction\",e),this.updateRasterFunction()}set url(e){this._set(\"url\",m(e,B))}set renderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer(\"override\"):(this._set(\"renderer\",e),this.updateRenderer())}readRenderer(e,t,r){const n=t?.layerDefinition?.drawingInfo?.renderer;return i(n,r)||void 0}async convertVectorFieldData(e,t){if(null==e||!this.rasterInfo)return null;const r=this._rasterJobHandler.instance,i=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:e,dataType:i},t):N(e,i)}async computeStatisticsHistograms(e,t){e=l(M,e).clone();const{rasterInfo:r}=this,{geometry:i}=e;if(null==i)throw new s(\"imagery-tile-mixin:compute-statistics-histograms\",\"geometry must be specified\");let n=i;const{spatialReference:o}=r;i.spatialReference.equals(o)||(await j(),n=\"extent\"===i.type?D(i,o):H(i,o));const a=e.pixelSize??new q({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:o}),{extent:u,width:c,height:d}=x(r,n,a),m=await this.fetchPixels(u,c,d,{...t,interpolation:\"nearest\"});if(null==m.pixelBlock)throw new s(\"imagery-tile-mixin:compute-statistics-histograms\",\"failed to fetch pixels\");const h=await w(m.pixelBlock,u,n),p=this._rasterJobHandler.instance;return p?p.computeStatisticsHistograms({pixelBlock:h},t):T(h)}async createFlowMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(e,t):U(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if(null==t)return e;let r=e.multidimensionalDefinition||this.multidimensionalDefinition;r?.length||(r=J(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const i=e.timeExtent||this.timeExtent;if(null!=r&&null!=i&&(null!=i.start||null!=i.end)){r=r.map((e=>e.clone()));const n=t.variables.find((({name:e})=>e===r[0].variableName))?.dimensions?.find((({name:e})=>\"StdTime\"===e)),s=r.find((({dimensionName:e})=>\"StdTime\"===e));if(!n||!s)return{...e,multidimensionalDefinition:null};const{start:o,end:a}=i,l=null==o?null:o.getTime(),u=null==a?null:a.getTime(),c=l??u,d=u??l;if(null!=n.values){const e=n.values.filter((e=>{if(Array.isArray(e)){if(c===d)return e[0]<=c&&e[1]>=c;const t=e[0]<=c&&e[1]>c||e[0]=d,r=e[0]>=c&&e[1]<=d||e[0]d;return t||r}return c===d?e===c:e>=c&&e<=d}));if(e.length){const t=e.sort(((e,t)=>{const r=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:e,n=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:t;if(c===d)return r-n;return Math.abs(i-d)-Math.abs(s-d)}))[0];s.values=[t]}else r=null}else if(n.hasRegularIntervals&&n.extent){const[e,t]=n.extent;c>t||d1&&e.forEach((e=>r[e.url]=e));const n=v(i.functionDefinition?.toJSON()??i.toJSON(),r),s=new F({rasterFunction:n});s.rasterJobHandler=this._rasterJobHandler.instance,await s.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=s}else this.raster=t,this._cachedRasterFunctionJson=null,await t.when();if(this._cachedRendererJson=null,!r&&!i)return;const{bandIds:n}=this,{bandCount:s}=this.raster.rasterInfo,o=n?.length?n.some((e=>e>=s)):s>=3;n&&(o||this.renderer&&\"raster-stretch\"!==this.renderer.type)&&this._set(\"bandIds\",null),this._configDefaultRenderer(\"auto\")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:r}=this.raster,i=_(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=i?.name,s=O({...this.renderer.toJSON(),variableName:n});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(s))return;const o=this._rasterJobHandler.instance;o&&(t.rasterInfo=z(r,n),t.rendererJSON=s,t.bind(),await o.updateSymbolizer(t),this._cachedRendererJson=s)}async applyRenderer(e,t){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;let i;await this.updateRenderer();const n=this._rasterJobHandler.instance,s=this.bandIds??[];return i=n?await n.symbolize({...e,simpleStretchParams:t,bandIds:s}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:s}),i}getTileUrl(e,t,r){return\"RasterTileServer\"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:\"\"}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=d(e);return g.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,i={}){if(L(this),i.requestAsImageElement){const s=this.getTileUrl(e,t,r);return n(s,{responseType:\"image\",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:i.signal}).then((e=>e.data))}const{rasterInfo:s}=this;if(null!=s.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition){const n=i.tileInfo||s.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,n),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),\"raster-shaded-relief\"===this.renderer?.type&&(i={...i,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,i)}async fetchPixels(e,t,r,i={}){return null!=this.rasterInfo.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),r=Math.round(r),this.raster.fetchPixels(e,t,r,i))}async identify(e,t={}){const{raster:r,rasterInfo:i}=this;if(null!=i.multidimensionalInfo){if(!(i.hasMultidimensionalTranspose&&!!(I(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new s(\"imagery-tile-mixin:identify\",\"the request cannot be fulfilled when falling outside of the multidimensional subset\");return r.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if(null==e||\"standard-time\"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,r=t?.[0]?.variableName;return e.variables.some((e=>e.name===r&&(!t?.[0].dimensionName||e.dimensions.some((e=>\"StdTime\"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo?.multidimensionalInfo;return S(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=J(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&\"Function\"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new b;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{L(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,\"Function\"===this.raster.datasetFormat&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){L(this);const{raster:e}=this,t=P(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set(\"interpolation\",t)}}_configDefaultRenderer(e=\"no\"){L(this);const{rasterInfo:t}=this.raster;!this.bandIds&&t.bandCount>1&&(this.bandIds=C(t));const r=_(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),i=r?.name;if(!this.renderer||\"override\"===e){const e=E(t,{bandIds:this.bandIds,variableName:i}),r=t.statistics,n=r&&r.length>0?r[0]:null,s=n?.max??0,o=n?.min??0;\"WCSServer\"===this.raster.datasetFormat&&\"raster-stretch\"===e.type&&(s>1e24||o<-1e24)&&(e.dynamicRangeAdjustment=!0,e.statistics=null,\"none\"===e.stretchType&&(e.stretchType=\"min-max\")),this.renderer=e}const n=O({...this.renderer.toJSON(),variableName:i}),s=z(t,i);this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=s):this.symbolizer=new A({rendererJSON:n,rasterInfo:s});const o=this.symbolizer.bind();if(o.success){if(\"auto\"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&\"raster-colormap\"===t.type){const e=E(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer(\"override\")}else if(\"raster-stretch\"===t.type){const e=this.bandIds?.length,r=t.statistics?.length;!t.dynamicRangeAdjustment&&r&&e&&r!==e&&this._configDefaultRenderer(\"override\")}}}else B.warn(\"imagery-tile-mixin\",o.error||\"The given renderer is not supported by the layer.\"),\"auto\"===e&&this._configDefaultRenderer(\"override\")}};function L(e){if(!e.raster||!e.rasterInfo)throw new s(\"imagery-tile\",\"no raster\")}return e([a({clonable:!1})],V.prototype,\"_cachedRendererJson\",void 0),e([a({clonable:!1})],V.prototype,\"_cachedRasterFunctionJson\",void 0),e([a({clonable:!1})],V.prototype,\"_compatibleFullExtent\",void 0),e([a({clonable:!1})],V.prototype,\"_isConstructedFromFunctionRaster\",void 0),e([a({clonable:!1})],V.prototype,\"_rasterJobHandler\",void 0),e([a()],V.prototype,\"bandIds\",void 0),e([a({json:{origins:{service:{read:{source:\"copyrightText\"}}}}})],V.prototype,\"copyright\",void 0),e([a({json:{read:!1}})],V.prototype,\"fullExtent\",null),e([a()],V.prototype,\"interpolation\",void 0),e([a()],V.prototype,\"ioConfig\",void 0),e([a({type:[p],json:{write:!0}})],V.prototype,\"multidimensionalDefinition\",null),e([a({type:f,json:{write:!0}})],V.prototype,\"multidimensionalSubset\",void 0),e([a()],V.prototype,\"raster\",void 0),e([a({type:y,json:{name:\"renderingRule\",write:!0}})],V.prototype,\"rasterFunction\",null),e([a()],V.prototype,\"rasterInfo\",void 0),e([a()],V.prototype,\"sourceJSON\",void 0),e([a({readOnly:!0,type:k,json:{read:!1}})],V.prototype,\"spatialReference\",void 0),e([a({type:g})],V.prototype,\"tileInfo\",void 0),e([a(h)],V.prototype,\"url\",null),e([a({types:t,json:{name:\"layerDefinition.drawingInfo.renderer\",write:{overridePolicy(){const e=\"raster-stretch\"===this.renderer?.type&&\"none\"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||\"Raster\"===this.raster.tileType||!e}}},origins:{\"web-scene\":{types:r,name:\"layerDefinition.drawingInfo.renderer\",write:{overridePolicy:e=>({enabled:e&&\"vector-field\"!==e.type&&\"flow\"!==e.type})}}}}})],V.prototype,\"renderer\",null),e([u(\"renderer\")],V.prototype,\"readRenderer\",null),e([a({clonable:!1})],V.prototype,\"symbolizer\",void 0),V=e([c(\"esri.layers.ImageryTileMixin\")],V),V};export{V as ImageryTileMixin};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{bytesToUTF8 as e}from\"./byteStreamUtils.js\";function t(e){const t=e.fields,r=e.records,n=t.some((e=>\"oid\"===e.name.toLowerCase()))?\"OBJECTID\":\"OID\",i=[{name:n,type:\"esriFieldTypeOID\",alias:\"OID\"}].concat(t.map((e=>({name:e.name,type:\"esriFieldType\"+e.typeName,alias:e.name})))),s=i.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[n]=o++,l=1;l0)for(;u.lengtho;){const t=[];32===n.getUint8(p)?(p+=1,g.forEach((n=>{if(\"C\"===n.type)t.push(e(new Uint8Array(r,p,n.length)).trim());else if(\"N\"===n.type)t.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(r,p,n.length)).trim(),10));else if(\"F\"===n.type)t.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(r,p,n.length)).trim()));else if(\"D\"===n.type){const e=String.fromCharCode.apply(null,new Uint8Array(r,p,n.length)).trim();t.push(new Date(parseInt(e.substring(0,4),10),parseInt(e.substring(4,6),10)-1,parseInt(e.substring(6,8),10)))}p+=n.length})),u.push(t)):p+=o}}return{header:l,fields:g,records:u,recordSet:t({fields:g,records:u})}}}export{r as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import t from\"../../../core/Error.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as o}from\"../../../core/accessorSupport/decorators/subclass.js\";import i from\"../LOD.js\";import s from\"../RasterInfo.js\";import a from\"../RasterStorageInfo.js\";import n from\"../TileInfo.js\";import l from\"./BaseRaster.js\";import f from\"./DBFParser.js\";import{isTransformSupported as m,readTransform as c}from\"../rasterTransforms/utils.js\";import p from\"../../../rest/support/FeatureSet.js\";import d from\"../../../geometry/SpatialReference.js\";import u from\"../../../geometry/Extent.js\";import h from\"../../../geometry/Point.js\";const g=new Map;g.set(\"int16\",\"esriFieldTypeSmallInteger\"),g.set(\"int32\",\"esriFieldTypeInteger\"),g.set(\"int64\",\"esriFieldTypeInteger\"),g.set(\"float32\",\"esriFieldTypeSingle\"),g.set(\"float64\",\"esriFieldTypeDouble\"),g.set(\"text\",\"esriFieldTypeString\");const y=8;let x=class extends l{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat=\"CRF\"}async open(e){await this.init();const{data:r}=await this.request(this.url+\"/conf.json\",{signal:e?.signal});if(!this._validateHeader(r))throw new t(\"cloudraster:open\",\"Invalid or unsupported conf.json.\");this.datasetName=this.url.slice(this.url.lastIndexOf(\"/\")+1);const{storageInfo:o,rasterInfo:i}=this._parseHeader(r);if(\"thematic\"===i.dataType){const e=await this._fetchAuxiliaryInformation();i.attributeTable=e}this._set(\"storageInfo\",o),this._set(\"rasterInfo\",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,o={}){const{transposeInfo:i}=this.rasterInfo.storageInfo,{transposedVariableName:s}=o,a=!(!i||!s),n=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(n<0)return null;const l=this._buildCacheFilePath(n,t,r,o.multidimensionalDefinition,s),f=this._getIndexRecordFromBundle(t,r,a),m=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:\"array-buffer\",signal:o.signal});if(!m)return null;const c=new Uint8Array(m.data),p=this._getTileEndAndContentType(c,f);if(0===p.recordSize)return null;const d=await this.request(l,{range:{from:p.position,to:p.position+p.recordSize},responseType:\"array-buffer\",signal:o.signal});if(!d)return null;const[u,h]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:u,height:h,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){const t=[\"origin\",\"extent\",\"geodataXform\",\"LODInfos\",\"blockWidth\",\"blockHeight\",\"bandCount\",\"pixelType\",\"pixelSizeX\",\"pixelSizeY\",\"format\",\"packetSize\"];return e&&\"RasterInfo\"===e.type&&!t.some((t=>!e[t]))}_parseHeader(e){const t=[\"u1\",\"u2\",\"u4\",\"u8\",\"s8\",\"u16\",\"s16\",\"u32\",\"s32\",\"f32\",\"f64\"][e.pixelType],{bandCount:r,colormap:o,blockWidth:l,blockHeight:f,firstPyramidLevel:m,maximumPyramidLevel:c}=e,p=e.statistics?.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),g=e.histograms?.[0]?.counts?.length?e.histograms:null,x=e.extent.spatialReference,S=e.geodataXform?.spatialReference,I=new d(x?.wkid||x?.wkt||x?.wkt2?x:S);let w=new u({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:I});const _=new h({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:I}),v=Math.round((w.xmax-w.xmin)/_.x),b=Math.round((w.ymax-w.ymin)/_.y),z=this._parseTransform(e.geodataXform),T=z?w:null;z&&(w=z.forwardTransform(w),_.x=(w.xmax-w.xmin)/v,_.y=(w.ymax-w.ymin)/b);const k=e.properties??{},j=e.format.toLowerCase().replace(\"cache/\",\"\"),C=new h(e.origin.x,e.origin.y,I);let R,F,P,H;if(o?.colors)for(R=[],F=0;F>>24,P<<8>>>24,P>>>24]);const D=e.LODInfos,L=[];for(F=0;F0)for(F=0;Fe.data)).catch((()=>null)),r=this.request(this.url+\"/conf.vat.dbf\",{responseType:\"array-buffer\",signal:e}).then((e=>e.data)).catch((()=>null)),o=await Promise.all([t,r]);let i;if(o[0]){let e=o[0].fields;const t=o[0].values;if(e&&t){e=e.map((e=>({type:\"OID\"===e.name?\"esriFieldTypeOID\":g.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(i={fields:e,features:r})}}if(!i&&o[1]){i=f.parse(o[1]).recordSet}return p.fromJSON(i)}_buildCacheFilePath(e,t,r,o,i){const s=this._getPackageSize(!!i),a=Math.floor(t/s)*s,n=Math.floor(r/s)*s,l=\"R\"+this._toHexString4(a)+\"C\"+this._toHexString4(n);let f=\"L\";f+=e>=10?e.toString():\"0\"+e.toString();const{multidimensionalInfo:m}=this.rasterInfo,c=o?.[0];if(null==m||!c)return`${this.url}/_alllayers/${f}/${l}.bundle`;let p=\"_yxs\";if(!i){p=m.variables.find((e=>e.name===c.variableName)).dimensions[0].values.indexOf(c.values[0]).toString(16);const e=4-p.length;for(let t=0;t0;)t=\"0\"+t}return t}};e([r({readOnly:!0})],x.prototype,\"storageInfo\",void 0),e([r({type:String,json:{write:!0}})],x.prototype,\"datasetFormat\",void 0),x=e([o(\"esri.layers.support.rasterDatasets.CloudRaster\")],x);const S=x;export{S as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import e from\"../../../core/Error.js\";import{eachAlways as s}from\"../../../core/promiseUtils.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as i}from\"../../../core/accessorSupport/decorators/subclass.js\";import o from\"../RasterInfo.js\";import a from\"./BaseRaster.js\";import{split as n}from\"../rasterFunctions/pixelUtils.js\";import{estimateStatisticsHistograms as m}from\"../rasterFunctions/stretchUtils.js\";import l from\"../../../geometry/Extent.js\";import p from\"../../../geometry/SpatialReference.js\";let c=class extends a{constructor(){super(...arguments),this.datasetFormat=\"MEMORY\",this.data=null}async open(t){await this.init();const e=this.data,{pixelBlock:s,statistics:r,histograms:i,name:a,keyProperties:n,nativeExtent:m,transform:c}=this.data,{width:h,height:f,pixelType:u}=s,d=e.extent??new l({xmin:-.5,ymin:.5,xmax:h-.5,ymax:f-.5,spatialReference:new p({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,x={x:d.width/h,y:d.height/f},g=new o({width:h,height:f,pixelType:u,extent:d,nativeExtent:m,transform:c,pixelSize:x,spatialReference:d.spatialReference,bandCount:s.pixels.length,keyProperties:n||{},statistics:r,isPseudoSpatialReference:y,histograms:i});this.createRemoteDatasetStorageInfo(g,512,512),this._set(\"rasterInfo\",g),this.updateTileInfo(),await this._buildInMemoryRaster(s,{width:512,height:512},t),this.datasetName=a,this.url=\"/InMemory/\"+a}fetchRawTile(t,e,s,r={}){const i=this._pixelBlockTiles.get(`${t}/${e}/${s}`);return Promise.resolve(i)}async _buildInMemoryRaster(t,r,i){const o=this.rasterInfo.storageInfo.maximumPyramidLevel,a=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:r,maximumPyramidLevel:o},i):Promise.resolve(n(t,r,o)),l=null!=this.rasterInfo.statistics,p=null!=this.rasterInfo.histograms,c=l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},i):Promise.resolve(m(t)),h=await s([a,c]);if(!h[0].value&&h[1].value)throw new e(\"inmemory-raster:open\",\"failed to build in memory raster\");this._pixelBlockTiles=h[0].value,l||(this.rasterInfo.statistics=h[1].value?.statistics),p||(this.rasterInfo.histograms=h[1].value?.histograms)}};t([r({type:String,json:{write:!0}})],c.prototype,\"datasetFormat\",void 0),t([r()],c.prototype,\"data\",void 0),c=t([i(\"esri.layers.support.rasterDatasets.InMemoryRaster\")],c);const h=c;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction n(e,t){if(!e||!t)return[];let l=t;t.includes(\"/\")?(l=t.slice(0,t.indexOf(\"/\")),t=t.slice(t.indexOf(\"/\")+1)):t=\"\";const r=[];if(t){const u=n(e,l);for(let e=0;er.push(n)))}return r}const u=e.getElementsByTagNameNS(\"*\",l);if(!u||0===u.length)return[];for(let n=0;n0?l?e(u[0],l):u[0]:null}function t(n,t=null){const l=t?e(n,t):n;let r;return l?(r=l.textContent||l.nodeValue,r?r.trim():null):null}function l(e,t){const l=n(e,t),r=[];let u;for(let n=0;nNumber(n)))??[]}function u(n,e){return l(n,e).map((n=>Number(n)))}function o(n,e){const l=t(n,e);return Number(l)}function i(n,e){const t=n?.nodeName?.toLowerCase(),l=e.toLowerCase();return t.slice(t.lastIndexOf(\":\")+1)===l}function c(n){return n.nodeName.slice(n.nodeName.lastIndexOf(\":\")+1)}export{e as getElement,o as getElementNumericValue,u as getElementNumericValues,t as getElementValue,l as getElementValues,n as getElements,c as getNodeNameIgnoreNS,r as getSpaceDelimitedNumericValues,i as isSameTagIgnoreNS};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../../geometry.js\";import{isSome as e}from\"../../../core/arrayUtils.js\";import{isWKT2 as t}from\"../../../geometry/support/spatialReferenceUtils.js\";import{isSameTagIgnoreNS as n,getElementValue as r,getElements as s,getElement as a,getElementNumericValue as i,getElementNumericValues as l}from\"./xmlUtilities.js\";import o from\"../rasterTransforms/PolynomialTransform.js\";import f from\"../../../geometry/SpatialReference.js\";function u(e,t){if(!e||!t)return null;const n=[];for(let r=0;rNumber(e)));let c,m,d,p;s(e,\"Metadata/MDI\").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute(\"key\").toUpperCase()){case\"STATISTICS_MINIMUM\":c=t;break;case\"STATISTICS_MAXIMUM\":m=t;break;case\"STATISTICS_MEAN\":d=t;break;case\"STATISTICS_STDDEV\":p=t}}));const S=i(e,\"Metadata/SourceBandIndex\");return{noDataValue:t,histogram:u?.length&&null!=l&&null!=o?{min:l,max:o,size:f||u.length,counts:u}:null,sourceBandIndex:S,statistics:null!=c&&null!=m?{min:c,max:m,avg:d,stddev:p}:null}}function d(e){if(!e)return null;let n=Number(e);if(!isNaN(n)&&0!==n)return new f({wkid:n});if(e=String(e).trim(),t(e))return new f({wkt2:e});const r=e.toUpperCase();if(r.startsWith(\"COMPD_CS\")){if(!r.includes(\"VERTCS\")||!r.includes(\"GEOGCS\")&&!r.startsWith(\"PROJCS\"))return null;const t=r.indexOf(\"VERTCS\"),s=r.indexOf(\"PROJCS\"),a=s>-1?s:r.indexOf(\"GEOGCS\");if(-1===a)return null;const i=e.slice(a,e.lastIndexOf(\"]\",t)+1).trim(),l=e.slice(t,e.lastIndexOf(\"]\")).trim();n=p(i);const o=new f(n?{wkid:n}:{wkt:i}),u=p(l);return u&&(o.vcsWkid=u),o}return r.startsWith(\"GEOGCS\")||r.startsWith(\"PROJCS\")?(n=p(e),new f(0!==n?{wkid:n}:{wkt:e})):null}function p(e){const t=e.replaceAll(\"]\",\"[\").replaceAll('\"',\"\").split(\"[\").map((e=>e.trim())).filter((e=>\"\"!==e)),n=t[t.length-1].split(\",\"),r=n[0]?.toLowerCase();if((\"epsg\"===r||\"esri\"===r)&&e.endsWith('\"]]')){const e=Number(n[1]);if(!isNaN(e)&&0!==e)return e}return 0}function S(t){if(\"pamdataset\"!==t?.documentElement.tagName?.toLowerCase())return{};const a={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(n(e,\"SRS\")){if(!a.spatialReference){const t=r(e);a.spatialReference=d(t)}}else if(n(e,\"Metadata\"))if(\"xml:ESRI\"===e.getAttribute(\"domain\")){const{spatialReference:t,transform:n}=c(e);a.transform=n,a.spatialReference||(a.spatialReference=t)}else{s(e,\"MDI\").forEach((e=>a.metadata[e.getAttribute(\"key\")]=r(e)))}else if(n(e,\"PAMRasterBand\")){const t=m(e);null!=t.sourceBandIndex&&null==a.rasterBands[t.sourceBandIndex]?a.rasterBands[t.sourceBandIndex]=t:a.rasterBands.push(t)}}));const i=a.rasterBands;if(i.length){const t=!!i[0].statistics;a.statistics=t?i.map((e=>e.statistics)).filter(e):null;const n=!!i[0].histogram;a.histograms=n?i.map((e=>e.histogram)).filter(e):null}return a}export{S as parsePAMInfo,d as parseSpatialReference};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import e from\"../../../core/Error.js\";import has from\"../../../core/has.js\";import{eachAlways as s,createAbortError as r}from\"../../../core/promiseUtils.js\";import{property as a}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import{subclass as o}from\"../../../core/accessorSupport/decorators/subclass.js\";import i from\"./BaseRaster.js\";import n from\"./InMemoryRaster.js\";import{parsePAMInfo as l}from\"./pamParser.js\";import{getFormat as m}from\"../rasterFormats/RasterCodec.js\";import{estimateStatisticsFromHistograms as p}from\"../rasterFunctions/stretchUtils.js\";import c from\"../rasterTransforms/PolynomialTransform.js\";import f from\"../../../geometry/SpatialReference.js\";import u from\"../../../geometry/Extent.js\";let h=class extends i{async open(t){await this.init();const e=await this._fetchData(t);let{spatialReference:s,statistics:r,histograms:a,transform:o}=await this._fetchAuxiliaryData(t);const i=!s;i&&(s=new f({wkid:3857})),a?.length&&null==r&&(r=p(a));const{width:l,height:m}=e;let c=new u({xmin:-.5,ymin:.5-m,xmax:l-.5,ymax:.5,spatialReference:s});const h=o?o.forwardTransform(c):c;let d=!0;if(o){const t=o.forwardCoefficients;d=t&&0===t[1]&&0===t[2],d&&(o=null,c=h)}const w=new n({data:{extent:h,nativeExtent:c,transform:o,pixelBlock:e,statistics:r,histograms:a,keyProperties:{DateType:\"Processed\"},isPseudoSpatialReference:i}});await w.open(),w.data=null,this._set(\"rasterInfo\",w.rasterInfo),this._inMemoryRaster=w}fetchRawTile(t,e,s,r={}){return this._inMemoryRaster.fetchRawTile(t,e,s,r)}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:\"array-buffer\",signal:t?.signal}),r=m(s).toUpperCase();if(\"JPG\"!==r&&\"PNG\"!==r&&\"GIF\"!==r&&\"BMP\"!==r)throw new e(\"image-aux-raster:open\",\"the data is not a supported format\");this._set(\"datasetFormat\",r);const a=r.toLowerCase(),o=\"gif\"===a||\"bmp\"===a||!has(\"ios\"),i=await this.decodePixelBlock(s,{format:a,useCanvas:o,hasNoZlibMask:!0});if(null==i)throw new e(\"image-aux-raster:open\",\"the data cannot be decoded\");return i}async _fetchAuxiliaryData(t){const e=t?.signal,a=this.ioConfig.skipExtensions??[],o=a.includes(\"aux.xml\")?null:this.request(this.url+\".aux.xml\",{responseType:\"xml\",signal:e}),i=this.datasetFormat,n=\"JPG\"===i?\"jgw\":\"PNG\"===i?\"pgw\":\"BMP\"===i?\"bpw\":null,m=n&&a.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf(\".\"))+\".\"+n,{responseType:\"text\",signal:e}),p=await s([o,m]);if(e?.aborted)throw r();const f=l(p[0].value?.data);if(!f.transform){const t=p[1].value?p[1].value.data.split(\"\\n\").slice(0,6).map((t=>Number(t))):null;f.transform=6===t?.length?new c({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return f}};t([a({type:String,json:{write:!0}})],h.prototype,\"datasetFormat\",void 0),h=t([o(\"esri.layers.support.rasterDatasets.ImageAuxRaster\")],h);const d=h;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import t from\"../../../core/Error.js\";import{assertIsSome as i}from\"../../../core/maybe.js\";import{urlToObject as s}from\"../../../core/urlUtils.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as a}from\"../../../core/accessorSupport/decorators/subclass.js\";import l from\"../RasterInfo.js\";import o from\"../RasterStorageInfo.js\";import n from\"../TileInfo.js\";import{TilemapCache as c}from\"../TilemapCache.js\";import m from\"./BaseRaster.js\";import{setValidBoundary as u}from\"../rasterFunctions/pixelUtils.js\";import h from\"../rasterTransforms/GCSShiftTransform.js\";import{patchServiceInfo as f,fetchServiceRasterInfo as p}from\"../../../rest/imageService/fetchRasterInfo.js\";import d from\"../../../geometry/SpatialReference.js\";import y from\"../../../geometry/Point.js\";import x from\"../../../geometry/Extent.js\";let g=class extends m{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat=\"RasterTileServer\",this.tileType=null}async open(e){await this.init();const r=e?.signal,a=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:\"json\"},signal:r});a.ssl&&(this.url=this.url.replace(/^http:/i,\"https:\"));const l=a.data;if(this.sourceJSON=l,!l)throw new t(\"imageserverraster:open\",\"cannot initialize tiled image service, missing service info\");if(!l.tileInfo)throw new t(\"imageserverraster:open\",\"use ImageryLayer to open non-tiled image services\");this._fixScaleInServiceInfo();const m=[\"jpg\",\"jpeg\",\"png\",\"png8\",\"png24\",\"png32\",\"mixed\"];this.tileType=l.cacheType,null==this.tileType&&(m.includes(l.tileInfo.format.toLowerCase())?this.tileType=\"Map\":\"lerc\"===l.tileInfo.format.toLowerCase()?this.tileType=\"Elevation\":this.tileType=\"Raster\"),this.datasetName=l.name?.slice(l.name.indexOf(\"/\")+1)??\"\";const u=await this._fetchRasterInfo({signal:r});if(null==u)throw new t(\"image-server-raster:open\",\"cannot initialize image service\");f(u,l);const h=\"Map\"===this.tileType?v(l.tileInfo,l):n.fromJSON(l.tileInfo);i(h);const[p,d]=this._computeMinMaxLOD(u,h),{extent:y,pixelSize:x}=u,g=.5/u.width*x.x,S=Math.max(x.x,x.y),{lods:I}=h;(\"Map\"!==this.tileType&&0!==l.maxScale||Math.abs(x.x-x.y)>g||!I.some((e=>Math.abs(e.resolution-S){e.level>=d.level&&e.level<=p.level&&b.push({x:e.resolution,y:e.resolution}),te.x-t.x));const _=this.computeBlockBoundary(y,j,M,h.origin,b,w),O=b.length>1?b.slice(1):null;let R;l.transposeInfo&&(R={tileSize:[l.transposeInfo.rows,l.transposeInfo.cols],packetSize:u.keyProperties?._yxs.PacketSize??0});const z=T.length<=1||T.length>=3&&T.slice(0,-1).every((e=>e===T[0]))?T[0]??2:Math.round(10/(d.resolution/p.resolution)**(-1/w))/10;if(u.storageInfo=new o({blockWidth:h.size[0],blockHeight:h.size[1],pyramidBlockWidth:h.size[0],pyramidBlockHeight:h.size[1],pyramidResolutions:O,pyramidScalingFactor:z,compression:h.format,origin:h.origin,firstPyramidLevel:1,maximumPyramidLevel:w,tileInfo:h,transposeInfo:R,blockBoundary:_}),this._fixGCSShift(u),this._set(\"rasterInfo\",u),l.capabilities.toLowerCase().includes(\"tilemap\")){const e={tileInfo:u.storageInfo.tileInfo,parsedUrl:s(this.url),url:this.url,tileServers:[]};this._tilemapCache=new c({layer:e})}}async fetchRawTile(e,t,i,s={}){const{storageInfo:r,extent:a}=this.rasterInfo,{transposeInfo:l}=r,o=null!=l&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const n=o?0:r.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${n}/${t}/${i}`,m=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null,{data:h}=await this.request(c,{query:m,responseType:\"array-buffer\",signal:s.signal});if(!h)return null;const f=o?l.tileSize:r.tileInfo.size,p=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:\"Elevation\"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==p)return null;const d=r.blockBoundary[e];if(\"jpg\"!==r.compression||i>d.minCol&&id.minRow&&t{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));if(!i)return!0;return(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return i}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+\"/statistics\",{query:{variable:e,f:\"json\"},signal:t}).then((e=>e.data?.statistics)),s=this.request(this.url+\"/histograms\",{query:{variable:e,f:\"json\"},signal:t}).then((e=>e.data?.histograms)),r=await Promise.all([i,s]);return r[0]&&r[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let a=r-s+this._levelOffset;const l=i.srcLocation;for(;a>=0;){try{if(\"available\"===await this._tilemapCache.fetchAvailability(a,i.row,i.col,t))break}catch{}if(a--,s++,i=this.identifyPixelLocation(l,s,t.datumTransformation),null===i)return null}return-1===a||null==i?null:s}async _fetchRasterInfo(e){const t=this.sourceJSON;if(\"Map\"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=d.fromJSON(t.spatialReference||e.spatialReference),a=new y({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new l({width:i,height:s,bandCount:3,extent:x.fromJSON(e),spatialReference:r,pixelSize:a,pixelType:\"u8\",statistics:null,keyProperties:{DataType:\"processed\"}})}const{signal:i}=e,s=p(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:\"json\"},signal:i}).then((e=>e.data?.slices)).catch((()=>null)):null,a=await Promise.all([s,r]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new h,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,a=t.lodAt(Math.max.apply(null,r.map((e=>e.level)))),l=t.lodAt(Math.min.apply(null,r.map((e=>e.level)))),{tileType:o}=this;if(\"Map\"===o)return this._levelOffset=r[0].level,[a,l];if(\"Raster\"===o){return[r.find((e=>e.resolution===i.x))??a,l]}const{minScale:n,maxScale:c}=this.sourceJSON;let m=a;c>0&&(m=r.find((e=>Math.abs(e.scale-c)e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??a));let u=l;return n>0&&(u=r.find((e=>Math.abs(e.scale-n)null!=e&&e>=r&&e<=a))});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,a=s?t(s):-1/0;return n.fromJSON({...e,lods:e.lods.filter((e=>{const i=t(e.scale);return i<=r&&i>=a}))})}return n.fromJSON(e)}e([r({type:String,json:{write:!0}})],g.prototype,\"datasetFormat\",void 0),e([r()],g.prototype,\"tileType\",void 0),g=e([a(\"esri.layers.support.rasterDatasets.ImageServerRaster\")],g);const S=g;export{S as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import e from\"../../../core/Error.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as s}from\"../../../core/accessorSupport/decorators/subclass.js\";import o from\"../PixelBlock.js\";import i from\"../RasterInfo.js\";import a from\"../RasterStorageInfo.js\";import n from\"./BaseRaster.js\";import{parseSpatialReference as l,parsePAMInfo as f}from\"./pamParser.js\";import{getElement as c,getElementValue as p}from\"./xmlUtilities.js\";import{isPlatformLittleEndian as m}from\"../rasterFormats/utils.js\";import{estimateStatisticsFromHistograms as h}from\"../rasterFunctions/stretchUtils.js\";import u from\"../../../geometry/SpatialReference.js\";import g from\"../../../geometry/Extent.js\";import d from\"../../../geometry/Point.js\";const y=new Map;y.set(\"Int8\",\"s8\"),y.set(\"UInt8\",\"u8\"),y.set(\"Int16\",\"s16\"),y.set(\"UInt16\",\"u16\"),y.set(\"Int32\",\"s32\"),y.set(\"UInt32\",\"u32\"),y.set(\"Float32\",\"f32\"),y.set(\"Float64\",\"f32\"),y.set(\"Double64\",\"f32\");const x=new Map;x.set(\"none\",{blobExtension:\".til\",isOneSegment:!0,decoderFormat:\"bip\"}),x.set(\"lerc\",{blobExtension:\".lrc\",isOneSegment:!1,decoderFormat:\"lerc\"}),x.set(\"deflate\",{blobExtension:\".pzp\",isOneSegment:!0,decoderFormat:\"deflate\"}),x.set(\"jpeg\",{blobExtension:\".pjg\",isOneSegment:!0,decoderFormat:\"jpg\"});let w=class extends n{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat=\"MRF\"}async open(t){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf(\"/\")+1);const e=t?t.signal:null,r=await this.request(this.url,{responseType:\"xml\",signal:e}),{rasterInfo:s,files:o}=this._parseHeader(r.data);if(-1===this.ioConfig.skipExtensions?.indexOf(\"aux.xml\")){const e=await this._fetchAuxiliaryData(t);null!=e&&(s.statistics=e.statistics??s.statistics,s.histograms=e.histograms,e.histograms&&null==s.statistics&&(s.statistics=h(e.histograms)))}this._set(\"rasterInfo\",s),this._files=o;const i=await this.request(o.index,{responseType:\"array-buffer\",signal:e});this._storageIndex=this._parseIndex(i.data);const{blockWidth:a,blockHeight:n}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:f,height:c}=this.rasterInfo,p=[],m=this._getBandSegmentCount();let u=0,g=-1;for(;u0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}async fetchRawTile(t,e,r,s={}){const{blockWidth:i,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:f,pixelType:c}=this.rasterInfo,{ranges:p,actualTileWidth:m,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!p||0===p.length)return null;if(0===p[0].from&&0===p[0].to){const t=new Uint8Array(i*a);return new o({width:i,height:a,pixels:null,mask:t,validPixelCount:0})}const{bandIds:u}=this.ioConfig,g=this._getBandSegmentCount(),d=[];let y=0;for(y=0;yt.data.byteLength)).reduce(((t,e)=>t+e)),b=new Uint8Array(I);let A=0;for(y=0;y1e24)for(y=0;y1e-6&&(e[y]=1);else for(y=0;y0)throw new Error(\"invalid array buffer must be multiples of 16\");let e,r,s,o,i,a;if(m){for(r=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),s=new Uint8Array(o),i=0;iparseFloat(t)))));if(c(t,\"MRF_META/CachedSource\"))throw new e(\"mrf:open\",\"currently does not support MRF referencing other data files\");const S=c(t,\"MRF_META/GeoTags\"),j=c(S,\"BoundingBox\");let k,M=!1;if(null!=j){const t=parseFloat(j.getAttribute(\"minx\")),e=parseFloat(j.getAttribute(\"miny\")),r=parseFloat(j.getAttribute(\"maxx\")),s=parseFloat(j.getAttribute(\"maxy\")),o=p(S,\"Projection\")||\"\";let i=u.WGS84;if(\"LOCAL_CS[]\"!==o)if(o.toLowerCase().startsWith(\"epsg:\")){const t=Number(o.slice(5));isNaN(t)||0===t||(i=new u({wkid:t}))}else i=l(o)??u.WGS84;else M=!0,i=new u({wkid:3857});k=new g(t,e,r,s),k.spatialReference=i}else M=!0,k=new g({xmin:-.5,ymin:.5-n,xmax:o-.5,ymax:.5,spatialReference:new u({wkid:3857})});const T=c(t,\"MRF_META/Rsets\"),C=parseInt(T?.getAttribute(\"scale\")||\"2\",10),U=k.spatialReference,B=new a({origin:new d({x:k.xmin,y:k.ymax,spatialReference:U}),blockWidth:b,blockHeight:A,pyramidBlockWidth:b,pyramidBlockHeight:A,compression:m,pyramidScalingFactor:C}),E=new d({x:k.width/o,y:k.height/n,spatialReference:U}),L=new i({width:o,height:n,extent:k,isPseudoSpatialReference:M,spatialReference:U,bandCount:f,pixelType:w,pixelSize:E,noDataValue:_,storageInfo:B}),P=p(t,\"datafile\"),W=p(t,\"IndexFile\");return{rasterInfo:L,files:{mrf:this.url,index:W||this.url.replace(\".mrf\",\".idx\"),data:P||this.url.replace(\".mrf\",x.get(m).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+\".aux.xml\",{responseType:\"xml\",signal:t?.signal});return f(e)}catch{return null}}};t([r()],w.prototype,\"_files\",void 0),t([r()],w.prototype,\"_storageIndex\",void 0),t([r({type:String,json:{write:!0}})],w.prototype,\"datasetFormat\",void 0),w=t([s(\"esri.layers.support.rasterIO.MRFRaster\")],w);const I=w;export{I as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import{isSome as t}from\"../../../core/arrayUtils.js\";import r from\"../../../core/Error.js\";import i from\"../../../core/Logger.js\";import{property as s}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/has.js\";import{subclass as a}from\"../../../core/accessorSupport/decorators/subclass.js\";import n from\"../RasterInfo.js\";import o from\"../RasterStorageInfo.js\";import f from\"./BaseRaster.js\";import l from\"./DBFParser.js\";import{parseSpatialReference as u,parsePAMInfo as p}from\"./pamParser.js\";import{parseSignature as c,getPyramidIFDs as h,getMaskIFDs as m,getImageInfo as d,parseIFD as y,parseFieldValues as g,isBSQConfig as T}from\"../rasterFormats/TiffDecoder.js\";import x from\"../rasterFormats/TiffTags.js\";import{estimateStatisticsFromHistograms as I}from\"../rasterFunctions/stretchUtils.js\";import w from\"../rasterTransforms/PolynomialTransform.js\";import R from\"../../../rest/support/FeatureSet.js\";import b from\"../../../geometry/SpatialReference.js\";import _ from\"../../../geometry/Extent.js\";import E from\"../../../geometry/Point.js\";const S=(e,t)=>e.get(t)?.values,F=(e,t)=>e.get(t)?.values?.[0];let P=class extends f{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat=\"TIFF\"}async open(e){await this.init();const t=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:\"array-buffer\",signal:t});if(!s)throw new r(\"tiffraster:open\",\"failed to open url \"+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf(\"/\")+1,this.url.lastIndexOf(\".\"));const{littleEndian:a,firstIFDPos:n,isBigTiff:o}=c(s),f=[];await this._readIFDs(f,s,a,n,0,o?8:4,t);const{imageInfo:l,rasterInfo:u}=this._parseIFDs(f),p=h(f),d=m(f);if(this._headerInfo={littleEndian:a,isBigTiff:o,ifds:f,pyramidIFDs:p,maskIFDs:d,...l},this._set(\"rasterInfo\",u),!l.isSupported)throw new r(\"tiffraster:open\",\"this tiff is not supported: \"+l.message);if(!l.tileWidth)throw new r(\"tiffraster:open\",\"none-tiled tiff is not optimized for access, convert to COG and retry.\");u.isPseudoSpatialReference&&i.getLogger(this).warn(\"The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.\");const y=f[0].get(\"PREDICTOR\")?.values?.[0],g=f[0].get(\"SAMPLEFORMAT\")?.values?.[0];if(3===g&&2===y)throw new r(\"tiffraster:open\",\"unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data\");const{skipExtensions:T=[]}=this.ioConfig;if(!T.includes(\"aux.xml\")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}T.includes(\"vat.dbf\")||1!==u.bandCount||\"u8\"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),null!=u.attributeTable&&(u.keyProperties.DataType=\"thematic\")),this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,r))return null;const s=await this._fetchRawTiffTile(e,t,r,!1,i);if(null!=s&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,r,!0,i);null!=a&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}_parseIFDs(e){const t=d(e),{width:r,height:i,tileWidth:s,tileHeight:a,planes:f,pixelType:l,compression:p,firstPyramidLevel:c,maximumPyramidLevel:h,pyramidBlockWidth:m,pyramidBlockHeight:y,tileBoundary:g,affine:T,metadata:x}=t,I=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid;let R=u(I),P=!!t.isPseudoGeographic;null==R&&(P=!0,R=new b({wkid:3857}));const v=new _({...t.extent,spatialReference:R}),D=new E(v?{x:v.xmin,y:v.ymax,spatialReference:R}:{x:0,y:0}),k=new o({blockWidth:s,blockHeight:a,pyramidBlockWidth:m,pyramidBlockHeight:y,compression:p,origin:D,firstPyramidLevel:c,maximumPyramidLevel:h,blockBoundary:g}),O=new E({x:(v.xmax-v.xmin)/r,y:(v.ymax-v.ymin)/i,spatialReference:R}),j=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{};let L=null;const B=F(e[0],\"PHOTOMETRICINTERPRETATION\"),z=S(e[0],\"COLORMAP\");if(B<=3&&z?.length>3&&z.length%3==0){L=[];const e=z.length/3;for(let t=0;t>>8,z[t+e]>>>8,z[t+2*e]>>>8])}const A=new n({width:r,height:i,bandCount:f,pixelType:l,pixelSize:O,storageInfo:k,spatialReference:R,isPseudoSpatialReference:P,keyProperties:j,extent:v,colormap:L,statistics:x?x.statistics:null});return T?.length&&(A.nativeExtent=new _({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:R}),A.transform=new w({polynomialOrder:1,forwardCoefficients:[T[2]+T[0]/2,T[5]-T[3]/2,T[0],T[3],-T[1],-T[4]]}),A.extent=A.transform.forwardTransform(A.nativeExtent),A.pixelSize=new E({x:(v.xmax-v.xmin)/r,y:(v.ymax-v.ymin)/i,spatialReference:R}),k.origin.x=-.5,k.origin.y=.5),{imageInfo:t,rasterInfo:A}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=I(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const r=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new E({x:(r.xmax-r.xmin)/t.width,y:(r.ymax-r.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=r}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}async _readIFDs(e,t,r,i,s,a=4,n){if(!i)return null;if(i>=t.byteLength||i<0){t=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:\"array-buffer\",signal:n})).data,s=i+s,i=0}const o=await this._readIFD(t,r,i,s,x.tiffTags,a,n);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-s,s,a,n)}async _readIFD(e,r,i,s,a=x.tiffTags,n=4,o){if(!e)return null;const f=y(e,r,i,s,a,n);if(f.success){const i=[];if(f.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const a=i.map((e=>e.offlineOffsetSize)).filter(t),n=Math.min.apply(null,a.map((e=>e[0])));if(Math.min.apply(null,a.map((e=>e[0]+e[1])))-n<=this._bufferSize){const{data:t}=await this.request(this.url,{range:{from:n,to:n+this._bufferSize},responseType:\"array-buffer\",signal:o});e=t,s=n,i.forEach((t=>g(e,r,t,s)))}}if(f.ifd?.has(\"GEOKEYDIRECTORY\")){const t=f.ifd.get(\"GEOKEYDIRECTORY\"),i=t?.values;if(i&&i.length>4){const a=i[0]+\".\"+i[1]+\".\"+i[2],n=await this._readIFD(e,r,t.valueOffset+6-s,s,x.geoKeys,2,o);t.data=n.ifd,t.data&&t.data.set(\"GEOTIFFVersion\",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}return f}if(f.requiredBufferSize&&f.requiredBufferSize!==e.byteLength){const t=await this.request(this.url,{range:{from:s,to:s+f.requiredBufferSize+4},responseType:\"array-buffer\",signal:o});return(e=t.data).byteLengththis.request(this.url,{range:e,responseType:\"array-buffer\",signal:s.signal}))),p=await Promise.all(u),c=p.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),h=1===p.length?p[0].data:new ArrayBuffer(c),m=[0],d=[0];if(p.length>1){const e=new Uint8Array(h);for(let t=0,r=0;tm||r>d||tt.add(r))),t}static async open(e){const{url:r,ioConfig:s,sourceJSON:o}=e;let a=e.datasetFormat;null==a&&r.lastIndexOf(\".\")&&(a=r.slice(r.lastIndexOf(\".\")+1).toUpperCase()),\"OVR\"===a||\"TIF\"===a?a=\"TIFF\":\"JPG\"!==a&&\"JPEG\"!==a&&\"JFIF\"!==a||(a=\"JPG\"),r.toLowerCase().includes(\"/imageserver\")&&!r.toLowerCase().includes(\"/wcsserver\")&&(a=\"RasterTileServer\");const n={url:r,sourceJSON:o,datasetFormat:a,ioConfig:s??{bandIds:null,sampling:null}};let l,i;if(a&&this.supportedFormats.has(a)){if(\"CRF\"===a&&!s?.enableCRF)throw new t(\"rasterfactory:open\",`cannot open raster: ${r}`);return l=c.get(a).constructor,i=new l(n),await i.open({signal:e.signal}),i}if(a)throw new t(\"rasterfactory:open\",\"not a supported format \"+a);const u=Array.from(c.keys());let F=0;const m=()=>(a=u[F++],a&&(\"CRF\"!==a||s?.enableCRF)?(l=c.get(a).constructor,i=new l(n),i.open({signal:e.signal}).then((()=>i)).catch((()=>m()))):null);return m()}static register(t,e,r){c.has(t.toUpperCase())||c.set(t.toUpperCase(),{desc:e,constructor:r})}}export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../PopupTemplate.js\";import{ClonableMixin as t}from\"../core/Clonable.js\";import s from\"../core/Error.js\";import i from\"../core/Logger.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{debounce as a,throwIfAbortError as n}from\"../core/promiseUtils.js\";import{watch as l}from\"../core/reactiveUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import{ensureClass as m,Integer as u}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{enumeration as c}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as d}from\"../core/accessorSupport/decorators/subclass.js\";import h from\"./Layer.js\";import{ArcGISService as y}from\"./mixins/ArcGISService.js\";import{BlendLayer as f}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as g}from\"./mixins/CustomParametersMixin.js\";import{ImageryTileMixin as v}from\"./mixins/ImageryTileMixin.js\";import{OperationalLayer as S}from\"./mixins/OperationalLayer.js\";import{PortalLayer as j}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as R}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as b}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as w}from\"./mixins/TemporalLayer.js\";import{legendEnabled as O}from\"./support/commonProperties.js\";import I from\"./support/Field.js\";import{interpolationKebab as P}from\"./support/rasterEnums.js\";import T from\"./support/RasterFunction.js\";import _ from\"./support/rasterDatasets/FunctionRaster.js\";import x from\"./support/rasterDatasets/RasterFactory.js\";import{create as N,getPrimaryRasterUrls as F}from\"./support/rasterFunctions/rasterFunctionHelper.js\";import{createPopupTemplate as J}from\"../support/popupUtils.js\";import{SaveOperationType as L}from\"../webdoc/interfaces.js\";let E=class extends(f(b(S(j(g(v(w(y(R(o(t(h)))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode=\"show\",this.sourceJSON=null,this.version=null,this.type=\"imagery-tile\",this.operationalLayerType=\"ArcGISTiledImageServiceLayer\",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=a((async(e,r,t)=>{const{save:s,saveAs:i}=await import(\"./save/imageryUtils.js\");switch(e){case L.SAVE:return s(this,r);case L.SAVE_AS:return i(this,t,r)}}))}normalizeCtorArgs(e,r){return\"string\"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Image Service\"]},e).catch(n).then((()=>this._openRaster(r)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[new I({name:\"Raster.ServicePixelValue\",alias:\"Pixel Value\",domain:null,editable:!1,length:50,type:\"string\"}),new I({name:\"Raster.ServicePixelValue.Raw\",alias:\"Raw Pixel Value\",domain:null,editable:!1,length:50,type:\"string\"})],{rasterInfo:r}=this,t=r?.attributeTable,s=null!=t?t.fields:null,i=\"Raster.\";if(s){const r=s.filter((e=>\"oid\"!==e.type&&\"value\"!==e.name.toLowerCase())).map((e=>{const r=e.clone();return r.name=i+e.name,r}));e.push(...r)}const o=r?.dataType,a=r?.multidimensionalInfo;if((\"vector-magdir\"===o||\"vector-uv\"===o)&&null!=a){const r=a.variables[0].unit?.trim(),t=\"Magnitude\"+(r?` (${r})`:\"\");e.push(new I({name:\"Raster.Magnitude\",alias:t,domain:null,editable:!1,type:\"double\"})),e.push(new I({name:\"Raster.Direction\",alias:\"Direction (°)\",domain:null,editable:!1,type:\"double\"}))}return e}createPopupTemplate(e){const{rasterFields:r}=this,t=new Set(r.map((({name:e})=>e)).filter((e=>\"raster.servicepixelvalue.raw\"!==e.toLowerCase())));return J({fields:r,title:this.title},{...e,visibleFieldNames:t})}async generateRasterInfo(e,r){if(!(e=m(T,e)))return this.rasterInfo;try{const t={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>t[e.url]=e));const s=N(e.functionDefinition?.toJSON()??e.toJSON(),t),i=new _({rasterFunction:s});return await i.open(r),i.rasterInfo}catch(t){if(t instanceof s)throw t;throw new s(\"imagery-tile-layer\",\"the given raster function is not supported\")}}async save(e){return this._debouncedSaveOperations(L.SAVE,e)}async saveAs(e,r){return this._debouncedSaveOperations(L.SAVE_AS,r,e)}write(e,r){const t=this._primaryRasters[0]??this.raster;if(this.loaded?\"RasterTileServer\"===t.datasetFormat&&(\"Raster\"===t.tileType||\"Map\"===t.tileType):this.url&&/\\/ImageServer(\\/|\\/?$)/i.test(this.url))return super.write(e,r);if(r?.messages){const e=`${r.origin}/${r.layerContainerType||\"operational-layers\"}`;r.messages.push(new s(\"layer:unsupported\",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let r=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),\"Function\"===this.raster.datasetFormat?(r=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:r}=this,t=[this.url];r&&F(r.toJSON(),t);const a=await Promise.all(t.map((r=>x.open({url:r,sourceJSON:this.sourceJSON,ioConfig:{sampling:\"closest\",...this.ioConfig,customFetchParameters:this.customParameters},signal:e})))),n=a.findIndex((e=>null==e));if(n>-1)throw new s(\"imagery-tile-layer:open\",`cannot open raster: ${t[n]}`);if(this._primaryRasters=a,r){const e={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((r=>e[r.url]=r));const t=N(r.functionDefinition?.toJSON()??r.toJSON(),e),n=new _({rasterFunction:t});try{await n.open(),this.raster=n}catch(o){const e=i.getLogger(this);o instanceof s&&e.error(\"imagery-tile-layer:open\",o.message),e.warn(\"imagery-tile-layer:open\",\"the raster function cannot be applied and is removed\"),this._set(\"rasterFunction\",null),this.raster=a[0]}}else this.raster=a[0]}const t=this.raster.rasterInfo;if(!t)throw new s(\"imagery-tile-layer:load\",\"cannot load resources on \"+this.url);if(this._set(\"rasterInfo\",r?t:this._primaryRasters[0].rasterInfo),this._set(\"spatialReference\",t.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e=\"Map\"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:\"service\"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:\"service\"});this.title||(this.title=this.raster.datasetName),\"Map\"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(l((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}};e([p({clonable:!1})],E.prototype,\"_primaryRasters\",void 0),e([p({type:[u],json:{write:{overridePolicy(){return{enabled:!this.loaded||\"Raster\"===this.raster.tileType||\"0,1,2\"!==this.bandIds?.join(\",\")}}}}})],E.prototype,\"bandIds\",void 0),e([p({json:{write:{overridePolicy(){return{enabled:!this.loaded||\"Raster\"===this.raster.tileType||\"bilinear\"!==this.interpolation}}}}}),c(P)],E.prototype,\"interpolation\",void 0),e([p(O)],E.prototype,\"legendEnabled\",void 0),e([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,\"isReference\",void 0),e([p({type:[\"show\",\"hide\"]})],E.prototype,\"listMode\",void 0),e([p({json:{read:!0,write:!0}})],E.prototype,\"blendMode\",void 0),e([p()],E.prototype,\"sourceJSON\",void 0),e([p({readOnly:!0,json:{origins:{service:{read:{source:\"currentVersion\"}}}}})],E.prototype,\"version\",void 0),e([p({readOnly:!0,json:{read:!1}})],E.prototype,\"type\",void 0),e([p({type:[\"ArcGISTiledImageServiceLayer\"]})],E.prototype,\"operationalLayerType\",void 0),e([p({type:Boolean,value:!0,json:{read:{source:\"disablePopup\",reader:(e,r)=>!r.disablePopup},write:{target:\"disablePopup\",overridePolicy(){return{enabled:!this.loaded||\"Raster\"===this.raster.tileType}},writer(e,r,t){r[t]=!e}}}})],E.prototype,\"popupEnabled\",void 0),e([p({type:r,json:{read:{source:\"popupInfo\"},write:{target:\"popupInfo\",overridePolicy(){return{enabled:!this.loaded||\"Raster\"===this.raster.tileType}}}}})],E.prototype,\"popupTemplate\",void 0),e([p({readOnly:!0})],E.prototype,\"defaultPopupTemplate\",null),e([p({readOnly:!0,type:[I]})],E.prototype,\"fields\",void 0),e([p({readOnly:!0,type:[I]})],E.prototype,\"rasterFields\",null),E=e([d(\"esri.layers.ImageryTileLayer\")],E);const A=E;export{A as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getPathExtension as i}from\"../../core/urlUtils.js\";function p(i){return o[t(i)]||e}function t(i){return\"json\"===i.type?\"application/json\":\"blob\"===i.type?i.blob.type:n(i.url)}function n(p){const t=i(p);return g[t]||a}const o={},a=\"text/plain\",e=o[a],g={png:\"image/png\",jpeg:\"image/jpeg\",jpg:\"image/jpg\",bmp:\"image/bmp\",gif:\"image/gif\",json:\"application/json\",txt:\"text/plain\",xml:\"application/xml\",svg:\"image/svg+xml\",zip:\"application/zip\",pbf:\"application/vnd.mapbox-vector-tile\",gz:\"application/gzip\",\"bin.gz\":\"application/octet-stream\"};for(const l in g)o[g[l]]=l;export{p as getResourceContentExtension};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../Error.js\";import{createMD5Hash as r}from\"../../MD5.js\";import{isMultiOriginJSONMixin as e}from\"../../multiOriginJSONSupportUtils.js\";import{isAbsolute as o,isBlobProtocol as s,join as n,blobUrlToBlob as i,getPathExtension as p}from\"../../urlUtils.js\";import{generateUUID as c}from\"../../uuid.js\";import{getPropertyMetadata as u}from\"../metadata.js\";import{nameToId as a}from\"../PropertyOrigin.js\";import{propertyJSONMeta as l}from\"./property.js\";import{getResourceContentExtension as m}from\"../../../portal/support/resourceExtension.js\";import{r as d,t as f,M as y,i as g,p as h,a as v}from\"../../../chunks/persistableUrlUtils.js\";function j(t){const r=t?.origins??[void 0];return(e,o)=>{const s=U(t,e,o);for(const t of r){const r=l(e,t,o);for(const t in s)r[t]=s[t]}}}function U(t,r,e){if(\"resource\"===t?.type)return w(t,r,e);switch(t?.type??\"other\"){case\"other\":return{read:!0,write:!0};case\"url\":{const{read:t,write:r}=v;return{read:t,write:r}}}}function w(t,r,n){const i=u(r,n);return{type:String,read:(t,r,e)=>{const o=d(t,r,e);return i.type===String?o:\"function\"==typeof i.type?new i.type({url:o}):void 0},write:{writer(r,p,c,u){if(!u?.resources)return\"string\"==typeof r?void(p[c]=f(r,u)):void(p[c]=r.write({},u));const l=x(r),m=f(l,{...u,verifyItemRelativeUrls:u?.verifyItemRelativeUrls?{writtenUrls:u.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},y.NO),d=i.type!==String&&(!e(this)||u?.origin&&this.originIdOf(n)>a(u.origin)),h={object:this,propertyName:n,value:r,targetUrl:m,dest:p,targetPropertyName:c,context:u,params:t};u?.portalItem&&m&&!o(m)?d&&t?.contentAddressed?I(h):d?N(h):P(h):u?.portalItem&&(null==m||null!=g(m)||s(m)||d)?I(h):p[c]=m}}}}function I(e){const{targetUrl:o,params:p,value:u,context:a,dest:l,targetPropertyName:d}=e;if(!a.portalItem)return;const f=h(o),y=b(u,o,a);if(p?.contentAddressed&&\"json\"!==y.type)return void a.messages?.push(new t(\"persistable:contentAddressingUnsupported\",`Property \"${d}\" is trying to serializing a resource with content of type ${y.type} with content addressing. Content addressing is only supported for json resources.`,{content:y}));const g=p?.contentAddressed&&\"json\"===y.type?r(y.jsonString):f?.filename??c(),v=n(p?.prefix??f?.prefix,g),j=`${v}.${m(y)}`;if(p?.contentAddressed&&a.resources&&\"json\"===y.type){const t=a.resources.toKeep.find((t=>t.resource.path===j))??a.resources.toAdd.find((t=>t.resource.path===j));if(t)return void(l[d]=t.resource.itemRelativeUrl)}const U=a.portalItem.resourceFromPath(j);s(o)&&a.resources&&a.resources.pendingOperations.push(i(o).then((t=>{U.path=`${v}.${m({type:\"blob\",blob:t})}`,l[d]=U.itemRelativeUrl})).catch((()=>{})));const w=p?.compress??!1;a.resources&&S({...e,resource:U,content:y,compress:w,updates:a.resources.toAdd}),l[d]=U.itemRelativeUrl}function N(t){const{context:r,targetUrl:e,params:o,value:s,dest:n,targetPropertyName:i}=t;if(!r.portalItem)return;const c=r.portalItem.resourceFromPath(e),u=b(s,e,r),a=m(u),l=p(c.path),d=o?.compress??!1;a===l?(r.resources&&S({...t,resource:c,content:u,compress:d,updates:r.resources.toUpdate}),n[i]=e):I(t)}function P({context:t,targetUrl:r,dest:e,targetPropertyName:o}){t.portalItem&&t.resources&&(t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(r),compress:!1}),e[o]=r)}function S({object:t,propertyName:r,updates:e,resource:o,content:s,compress:n}){e.push({resource:o,content:s,compress:n,finish:e=>{O(t,r,e)}})}function b(t,r,e){return\"string\"==typeof t?{type:\"url\",url:r}:{type:\"json\",jsonString:JSON.stringify(t.toJSON(e))}}function x(t){return null==t?null:\"string\"==typeof t?t:t.url}function O(t,r,e){\"string\"==typeof t[r]?t[r]=e.url:t[r].url=e.url}export{j as persistable};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as o}from\"../../core/lang.js\";import t from\"../../core/Warning.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../../core/accessorSupport/decorators/writer.js\";import{persistable as a}from\"../../core/accessorSupport/decorators/persistable.js\";import{canProjectWithoutEngine as c,projectPolygon as n}from\"../../geometry/projection.js\";import m from\"../../geometry/Polygon.js\";var l;let y=l=class extends r{constructor(e){super(e),this.geometry=null,this.type=\"clip\"}writeGeometry(e,r,o,s){if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!c(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new t(\"scenemodification:unsupported\",\"Scene modifications with incompatible spatial references are not supported\",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const p=new m;n(e,p,s.layer.spatialReference),r[o]=p.toJSON(s)}else r[o]=e.toJSON(s);delete r[o].spatialReference}clone(){return new l({geometry:o(this.geometry),type:this.type})}};e([s({type:m}),a()],y.prototype,\"geometry\",void 0),e([i([\"web-scene\",\"portal-item\"],\"geometry\")],y.prototype,\"writeGeometry\",null),e([s({type:[\"clip\",\"mask\",\"replace\"],nonNullable:!0}),a()],y.prototype,\"type\",void 0),y=l=e([p(\"esri.layers.support.SceneModification\")],y);const f=y;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../request.js\";import t from\"../../core/Collection.js\";import{JSONSupportMixin as e}from\"../../core/JSONSupport.js\";import{urlToObject as s}from\"../../core/urlUtils.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./SceneModification.js\";var a;let n=a=class extends(e(t.ofType(p))){constructor(r){super(r),this.url=null}clone(){return new a({url:this.url,items:this.items.map((r=>r.clone()))})}toJSON(r){return this.toArray().map((o=>o.toJSON(r))).filter((r=>!!r.geometry))}static fromJSON(r,o){const t=new a;for(const e of r)t.add(p.fromJSON(e,o));return t}static async fromUrl(r,t,e){const i={url:s(r),origin:\"service\"},c=await o(r,{responseType:\"json\",signal:e?.signal}),n=t.toJSON(),m=[];for(const o of c.data)m.push(p.fromJSON({...o,geometry:{...o.geometry,spatialReference:n}},i));return new a({url:r,items:m})}};r([i({type:String})],n.prototype,\"url\",void 0),n=a=r([c(\"esri.layers.support.SceneModifications\")],n);const m=n;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../core/Error.js\";import o from\"../core/Logger.js\";import{MultiOriginJSONMixin as r}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as i}from\"../core/promiseUtils.js\";import{on as s,sync as a}from\"../core/reactiveUtils.js\";import{property as n}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as p}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as d}from\"../core/accessorSupport/decorators/subclass.js\";import{persistable as m}from\"../core/accessorSupport/decorators/persistable.js\";import c from\"./Layer.js\";import{APIKeyMixin as l}from\"./mixins/APIKeyMixin.js\";import{ArcGISService as y}from\"./mixins/ArcGISService.js\";import{OperationalLayer as h}from\"./mixins/OperationalLayer.js\";import{PortalLayer as f}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as u}from\"./mixins/ScaleRangeLayer.js\";import{SceneService as v,SaveOperationType as g}from\"./mixins/SceneService.js\";import{elevationInfo as S}from\"./support/commonProperties.js\";import{I3SNodePageDefinition as j,I3SMaterialDefinition as w,I3STextureSetDefinition as _,I3SGeometryDefinition as I}from\"./support/I3SLayerDefinitions.js\";import L from\"./support/SceneModifications.js\";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as x,featureExpressionUnsupportedMessage as O}from\"../support/elevationInfoUtils.js\";import{f as M}from\"../chunks/persistableUrlUtils.js\";let b=class extends(v(y(h(f(u(r(l(c)))))))){constructor(...e){super(...e),this.geometryType=\"mesh\",this.operationalLayerType=\"IntegratedMeshLayer\",this.type=\"integrated-mesh\",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile=\"mesh-pyramids\",this.modifications=null,this._modificationsSource=null,this.path=null}initialize(){this.addHandles(s((()=>this.modifications),\"after-changes\",(()=>this.modifications=this.modifications),a))}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:M(e,o),context:o}}set elevationInfo(e){this._set(\"elevationInfo\",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:[\"Scene Service\"]},e)}catch(o){i(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await L.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin(\"modifications\",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then((()=>{}),(()=>{}))}async saveAs(e,t){return this._debouncedSaveOperations(g.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"integrated-mesh\"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"integrated-mesh\"};return this._debouncedSaveOperations(g.SAVE,e)}validateLayer(e){if(e.layerType&&\"IntegratedMesh\"!==e.layerType)throw new t(\"integrated-mesh-layer:layer-type-not-supported\",\"IntegratedMeshLayer does not support this layer type\",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new t(\"layer:service-version-not-supported\",\"Service version is not supported.\",{serviceVersion:this.version.versionString,supportedVersions:\"1.x\"});if(this.version.major>1)throw new t(\"layer:service-version-too-new\",\"Service version is too new.\",{serviceVersion:this.version.versionString,supportedVersions:\"1.x\"})}_getTypeKeywords(){return[\"IntegratedMeshLayer\"]}_validateElevationInfo(){const e=this.elevationInfo,t=\"Integrated mesh layers\";T(o.getLogger(this),x(t,\"absolute-height\",e)),T(o.getLogger(this),O(t,e))}};e([n({type:String,readOnly:!0})],b.prototype,\"geometryType\",void 0),e([n({type:[\"show\",\"hide\"]})],b.prototype,\"listMode\",void 0),e([n({type:[\"IntegratedMeshLayer\"]})],b.prototype,\"operationalLayerType\",void 0),e([n({json:{read:!1},readOnly:!0})],b.prototype,\"type\",void 0),e([n({type:j,readOnly:!0})],b.prototype,\"nodePages\",void 0),e([n({type:[w],readOnly:!0})],b.prototype,\"materialDefinitions\",void 0),e([n({type:[_],readOnly:!0})],b.prototype,\"textureSetDefinitions\",void 0),e([n({type:[I],readOnly:!0})],b.prototype,\"geometryDefinitions\",void 0),e([n({readOnly:!0})],b.prototype,\"serviceUpdateTimeStamp\",void 0),e([n({type:L}),m({origins:[\"web-scene\",\"portal-item\"],type:\"resource\",prefix:\"modifications\"})],b.prototype,\"modifications\",void 0),e([p([\"web-scene\",\"portal-item\"],\"modifications\")],b.prototype,\"readModifications\",null),e([n(S)],b.prototype,\"elevationInfo\",null),e([n({type:String,json:{origins:{\"web-scene\":{read:!0,write:!0},\"portal-item\":{read:!0,write:!0}},read:!1}})],b.prototype,\"path\",void 0),b=e([d(\"esri.layers.IntegratedMeshLayer\")],b);const U=b;export{U as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import t from\"../../core/Collection.js\";import r from\"../../core/Evented.js\";import{JSONSupportMixin as s}from\"../../core/JSONSupport.js\";import i from\"../../core/Loadable.js\";import{on as o,watch as l,whenOnce as a,sync as n}from\"../../core/reactiveUtils.js\";import{stripHTML as p}from\"../../core/string.js\";import{property as u}from\"../../core/accessorSupport/decorators/property.js\";import{ensureType as y}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as h}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import{computeExtent as m,sublayersFromJSON as d,fetchService as f,parseKML as v}from\"./kmlUtils.js\";import b from\"../../geometry/Extent.js\";var j;let S=j=class extends(r.EventedMixin(s(i))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([o((()=>this.sublayers),\"after-add\",(({item:e})=>{e.parent=this,e.layer=this.layer}),n),o((()=>this.sublayers),\"after-remove\",(({item:e})=>{e.layer=e.parent=null}),n),l((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer}),n),l((()=>this.layer),(e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e}),n)])}initialize(){a((()=>this.networkLink)).then((()=>a((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const r=null!=e?e.signal:null,s=this._fetchService(this._get(\"networkLink\")?.href??\"\",r).then((e=>{const r=m(e.sublayers);this.fullExtent=b.fromJSON(r),this.sourceJSON=e;const s=y(t.ofType(j),d(j,e));this.sublayers?this.sublayers.addMany(s):this.sublayers=s,this.layer?.emit(\"sublayer-update\"),this.layer&&this.layer.notifyChange(\"visibleSublayers\")}));return this.addResolvingPromise(s),Promise.resolve(this)}get visible(){return this._get(\"visible\")}set visible(e){this._get(\"visible\")!==e&&(this._set(\"visible\",e),this.layer&&this.layer.notifyChange(\"visibleSublayers\"))}readVisible(e,t){return!!t.visibility}_fetchService(e,t){return f(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>v(e.data)))}};e([u()],S.prototype,\"description\",void 0),e([u({type:b})],S.prototype,\"fullExtent\",void 0),e([u()],S.prototype,\"id\",void 0),e([u({readOnly:!0,value:null})],S.prototype,\"networkLink\",void 0),e([u({json:{write:{allowNull:!0}}})],S.prototype,\"parent\",void 0),e([u({type:t.ofType(S),json:{write:{allowNull:!0}}})],S.prototype,\"sublayers\",void 0),e([u({value:null,json:{read:{source:\"name\",reader:e=>p(e)}}})],S.prototype,\"title\",void 0),e([u({value:!0})],S.prototype,\"visible\",null),e([h(\"visible\",[\"visibility\"])],S.prototype,\"readVisible\",null),e([u()],S.prototype,\"sourceJSON\",void 0),e([u()],S.prototype,\"layer\",void 0),S=j=e([c(\"esri.layers.support.KMLSublayer\")],S);const k=S;export{k as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import r from\"../core/Collection.js\";import t from\"../core/CollectionFlattener.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as s}from\"../core/promiseUtils.js\";import{watch as i,sync as l}from\"../core/reactiveUtils.js\";import{getFilename as a}from\"../core/urlUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as n}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as u}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as y}from\"../core/accessorSupport/decorators/writer.js\";import m from\"../geometry/SpatialReference.js\";import c from\"./Layer.js\";import{BlendLayer as h}from\"./mixins/BlendLayer.js\";import{OperationalLayer as d}from\"./mixins/OperationalLayer.js\";import{PortalLayer as f}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as b}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as j}from\"./mixins/ScaleRangeLayer.js\";import{url as v}from\"./support/commonProperties.js\";import g from\"./support/KMLSublayer.js\";import{sublayersFromJSON as S,fetchService as x,parseKML as L}from\"./support/kmlUtils.js\";import E from\"../geometry/Extent.js\";const w=[\"kml\",\"xml\"];let F=class extends(h(b(j(d(f(o(c))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new t({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=m.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType=\"KML\",this.sublayers=null,this.type=\"kml\",this.url=null}initialize(){this.addHandles([i((()=>this.sublayers),((e,r)=>{r&&r.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),l),this.on(\"sublayer-update\",(()=>this.notifyChange(\"fullExtent\")))])}normalizeCtorArgs(e,r){return\"string\"==typeof e?{url:e,...r}:e}readSublayersFromItemOrWebMap(e,r){this._visibleFolders=r.visibleFolders}readSublayers(e,r,t){return S(g,r,t,this._visibleFolders)}writeSublayers(e,r){const t=[],o=e.toArray();for(;o.length;){const e=o[0];e.networkLink||(e.visible&&t.push(e.id),e.sublayers&&o.push(...e.sublayers.toArray())),o.shift()}r.visibleFolders=t}get title(){const e=this._get(\"title\");return e&&\"defaults\"!==this.originOf(\"title\")?e:this.url?a(this.url,w)||\"KML\":e||\"\"}set title(e){this._set(\"title\",e)}get visibleSublayers(){const e=this.sublayers,r=[],t=e=>{e.visible&&(r.push(e),e.sublayers&&e.sublayers.forEach(t))};return e&&e.forEach(t),r}get fullExtent(){return this._recomputeFullExtent()}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"KML\"],supportsData:!1},e).catch(s).then((()=>this._fetchService(r)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const r=await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:x(this.url??\"\",this.outSpatialReference,this.refreshInterval,e))),t=L(r.data);t&&this.read(t,{origin:\"service\"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const r=t=>{if(t.sublayers)for(const o of t.sublayers.items)r(o),o.visible&&o.fullExtent&&(null!=e?e.union(o.fullExtent):e=o.fullExtent.clone())};return r(this),e}};e([p({readOnly:!0})],F.prototype,\"allSublayers\",void 0),e([p({type:m})],F.prototype,\"outSpatialReference\",void 0),e([p({type:String,json:{origins:{\"web-scene\":{read:!0,write:!0}},read:!1}})],F.prototype,\"path\",void 0),e([p({readOnly:!0,json:{read:!1,write:!1}})],F.prototype,\"legendEnabled\",void 0),e([p({type:[\"show\",\"hide\",\"hide-children\"]})],F.prototype,\"listMode\",void 0),e([p({type:[\"KML\"]})],F.prototype,\"operationalLayerType\",void 0),e([p({})],F.prototype,\"resourceInfo\",void 0),e([p({type:r.ofType(g),json:{write:{ignoreOrigin:!0}}})],F.prototype,\"sublayers\",void 0),e([n([\"web-map\",\"portal-item\"],\"sublayers\",[\"visibleFolders\"])],F.prototype,\"readSublayersFromItemOrWebMap\",null),e([n(\"service\",\"sublayers\",[\"sublayers\"])],F.prototype,\"readSublayers\",null),e([y(\"sublayers\")],F.prototype,\"writeSublayers\",null),e([p({readOnly:!0,json:{read:!1}})],F.prototype,\"type\",void 0),e([p({json:{origins:{\"web-map\":{read:{source:\"title\"}}},write:{ignoreOrigin:!0}}})],F.prototype,\"title\",null),e([p(v)],F.prototype,\"url\",void 0),e([p({readOnly:!0})],F.prototype,\"visibleSublayers\",null),e([p({type:E})],F.prototype,\"extent\",void 0),e([p()],F.prototype,\"fullExtent\",null),F=e([u(\"esri.layers.KMLLayer\")],F);const O=F;export{O as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nfunction e(e,l){return t(e)===t(l)}function t(e){if(null==e)return null;const t=null!=e.layer?e.layer.id:\"\";let l=null;return l=null!=e.objectId?e.objectId:null!=e.layer&&\"objectIdField\"in e.layer&&null!=e.layer.objectIdField&&null!=e.attributes?e.attributes[e.layer.objectIdField]:e.uid,null==l?null:`o-${t}-${l}`}const l={json:{write:{writer:r,target:{\"feature.layerId\":{type:[Number,String]},\"feature.objectId\":{type:[Number,String]}}},origins:{\"web-scene\":{read:n}}}};function r(e,t){null!=e?.layer?.objectIdField&&null!=e.attributes&&(t.feature={layerId:e.layer.id,objectId:e.attributes[e.layer.objectIdField]})}function n(e){if(null!=e.layerId&&null!=e.objectId)return{uid:null,layer:{id:e.layerId,objectIdField:\"ObjectId\"},attributes:{ObjectId:e.objectId}}}export{e as featureReferenceEquals,l as featureReferenceProperty,t as getFeatureId};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import{featureReferenceEquals as r,featureReferenceProperty as e}from\"./featureReferenceUtils.js\";import s from\"../core/Accessor.js\";import{ClonableMixin as t}from\"../core/Clonable.js\";import{JSONSupportMixin as i}from\"../core/JSONSupport.js\";import{equalsMaybe as p}from\"../core/maybe.js\";import{property as a}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";import{persistable as n}from\"../core/accessorSupport/decorators/persistable.js\";import m from\"../geometry/Point.js\";import l from\"../symbols/support/ElevationInfo.js\";let f=class extends(i(t(s))){constructor(o){super(o),this.position=null,this.elevationInfo=null,this.feature=null}equals(o){return p(this.position,o.position)&&p(this.elevationInfo,o.elevationInfo)&&r(this.feature,o.feature)}};o([a({type:m,json:{write:{isRequired:!0}}})],f.prototype,\"position\",void 0),o([a({type:l}),n()],f.prototype,\"elevationInfo\",void 0),o([a(e)],f.prototype,\"feature\",void 0),f=o([c(\"esri.analysis.LineOfSightAnalysisObserver\")],f);const u=f;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../chunks/tslib.es6.js\";import{featureReferenceEquals as r,featureReferenceProperty as t}from\"./featureReferenceUtils.js\";import{Clonable as e}from\"../core/Clonable.js\";import{JSONSupportMixin as s}from\"../core/JSONSupport.js\";import{equalsMaybe as i}from\"../core/maybe.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as a}from\"../core/accessorSupport/decorators/subclass.js\";import{persistable as n}from\"../core/accessorSupport/decorators/persistable.js\";import c from\"../geometry/Point.js\";import m from\"../symbols/support/ElevationInfo.js\";let l=class extends(s(e)){constructor(o){super(o),this.position=null,this.elevationInfo=null,this.feature=null}equals(o){return i(this.position,o.position)&&i(this.elevationInfo,o.elevationInfo)&&r(this.feature,o.feature)}};o([p({type:c}),n()],l.prototype,\"position\",void 0),o([p({type:m}),n()],l.prototype,\"elevationInfo\",void 0),o([p(t)],l.prototype,\"feature\",void 0),l=o([a(\"esri.analysis.LineOfSightAnalysisTarget\")],l);const f=l;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../chunks/tslib.es6.js\";import e from\"./Analysis.js\";import r from\"./LineOfSightAnalysisObserver.js\";import o from\"./LineOfSightAnalysisTarget.js\";import s from\"../core/Collection.js\";import{referenceSetter as i,castForReferenceSetter as n}from\"../core/collectionUtils.js\";import{watch as l,syncAndInitial as p}from\"../core/reactiveUtils.js\";import{property as a}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as u}from\"../core/accessorSupport/decorators/subclass.js\";import{projectOrLoad as c}from\"../geometry/projection.js\";import{fromValues as m,expandWithVec3 as g,toExtent as y}from\"../geometry/support/aaBoundingBox.js\";import{getGeometryEffectiveElevationMode as f}from\"../support/elevationInfoUtils.js\";const h=s.ofType(o);let d=class extends e{constructor(t){super(t),this.type=\"line-of-sight\",this.observer=null,this.extent=null}initialize(){this.addHandles(l((()=>this._computeExtent()),(t=>{null==t?.pending&&this._set(\"extent\",null!=t?t.extent:null)}),p))}get targets(){return this._get(\"targets\")||new h}set targets(t){this._set(\"targets\",i(t,this.targets,h))}get spatialReference(){return null!=this.observer?.position?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return null!=t?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(null==this.observer?.position||null==t)return null;const e=t=>\"absolute-height\"===f(t.position,t.elevationInfo),r=this.observer.position,o=m(r.x,r.y,r.z,r.x,r.y,r.z);for(const i of this.targets)if(null!=i.position){const e=c(i.position,t);if(null!=e.pending)return{pending:e.pending,extent:null};if(null!=e.geometry){const{x:t,y:r,z:s}=e.geometry;g(o,[t,r,s])}}const s=y(o,t);return e(this.observer)&&this.targets.every(e)||(s.zmin=void 0,s.zmax=void 0),{pending:null,extent:s}}clear(){this.observer=null,this.targets.removeAll()}};t([a({type:[\"line-of-sight\"]})],d.prototype,\"type\",void 0),t([a({type:r,json:{read:!0,write:!0}})],d.prototype,\"observer\",void 0),t([a({cast:n,type:h,nonNullable:!0,json:{read:!0,write:!0}})],d.prototype,\"targets\",null),t([a({value:null,readOnly:!0})],d.prototype,\"extent\",void 0),t([a({readOnly:!0})],d.prototype,\"spatialReference\",null),t([a({readOnly:!0})],d.prototype,\"requiredPropertiesForEditing\",null),d=t([u(\"esri.analysis.LineOfSightAnalysis\")],d);const v=d;export{v as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import s from\"../analysis/LineOfSightAnalysis.js\";import t from\"../analysis/LineOfSightAnalysisObserver.js\";import r from\"../analysis/LineOfSightAnalysisTarget.js\";import i from\"../core/Collection.js\";import{referenceSetter as o}from\"../core/collectionUtils.js\";import{MultiOriginJSONMixin as a}from\"../core/MultiOriginJSONSupport.js\";import{watch as n,syncAndInitial as l}from\"../core/reactiveUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as y}from\"../core/accessorSupport/decorators/subclass.js\";import c from\"./Layer.js\";import{OperationalLayer as u}from\"./mixins/OperationalLayer.js\";const h=i.ofType(r);let m=class extends(u(a(c))){constructor(e){super(e),this.type=\"line-of-sight\",this.operationalLayerType=\"LineOfSightLayer\",this.analysis=new s,this.opacity=1}initialize(){this.addHandles(n((()=>this.analysis),((e,s)=>{null!=s&&s.parent===this&&(s.parent=null),null!=e&&(e.parent=this)}),l))}async load(){return null!=this.analysis&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(e){const{analysis:s}=this;s&&(s.observer=e)}get targets(){return null!=this.analysis?this.analysis.targets:new i}set targets(e){o(e,this.analysis?.targets)}get fullExtent(){return null!=this.analysis?this.analysis.extent:null}get spatialReference(){return null!=this.analysis?this.analysis.spatialReference:null}releaseAnalysis(e){this.analysis===e&&(this.analysis=new s)}};e([p({json:{read:!1},readOnly:!0})],m.prototype,\"type\",void 0),e([p({type:[\"LineOfSightLayer\"]})],m.prototype,\"operationalLayerType\",void 0),e([p({type:t,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],m.prototype,\"observer\",null),e([p({type:h,json:{read:!0,write:{ignoreOrigin:!0}}})],m.prototype,\"targets\",null),e([p({nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,\"analysis\",void 0),e([p({readOnly:!0})],m.prototype,\"fullExtent\",null),e([p({readOnly:!0})],m.prototype,\"spatialReference\",null),e([p({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},\"portal-item\":{read:!1,write:!1},\"web-document\":{read:!1,write:!1}}}})],m.prototype,\"opacity\",void 0),e([p({type:[\"show\",\"hide\"]})],m.prototype,\"listMode\",void 0),m=e([y(\"esri.layers.LineOfSightLayer\")],m);const d=m;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../geometry.js\";import{convertFromGeometry as e}from\"../graphics/featureConversionUtils.js\";import{OptimizedFeature as t}from\"../graphics/OptimizedFeature.js\";import{fromJSON as r}from\"../../geometry/support/jsonUtils.js\";const i=\"ESRI__DESTINATION_ID\",s=\"ESRI__ORIGIN_ID\";class o{constructor(){this._featureLookup=new Map}static getInstance(){return o.instance||(o.instance=new o),o.instance}static resetInstance(){o.instance&&(o.instance=null)}deleteFromStore(e){e.forEach((e=>{this._featureLookup.delete(e)}))}readFromStoreByList(e){const t=[];return e.forEach((e=>{const r=this.readFromStoreById(e);r&&t.push(r)})),t}readFromStoreById(e){return this._featureLookup.get(e)??null}writeToStore(o,n,p){const a=[];return o.forEach((o=>{if(!o?.id)return;o.properties||(o.properties=[]);let u,c=null;if(p&&o.properties[p]&&(c=e(o.properties[p])),\"originId\"in o&&\"destinationId\"in o&&(o.properties[s]=o.originId,o.properties[i]=o.destinationId),o.properties[n]=o.id,o.id&&this._featureLookup.has(o.id)&&this._featureLookup.get(o.id).attributes){const e=this._featureLookup.get(o.id),i=JSON.parse(JSON.stringify(Object.assign(e.attributes,o.properties)));p&&o.properties[p]&&(i[p]=r(o.properties[p])),u=new t(c?JSON.parse(JSON.stringify(c)):e?.geometry?JSON.parse(JSON.stringify(e.geometry)):null,i,null,o.properties[n])}else u=new t(c?JSON.parse(JSON.stringify(c)):null,o.properties,null,o.properties[n]);this._featureLookup.set(o.id,u),a.push(u)})),a}}export{o as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import s from\"../../core/Accessor.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends s{constructor(r){super(r),this.resultRows=[]}};r([o()],t.prototype,\"resultRows\",void 0),t=r([e(\"esri.rest.knowledgeGraph.GraphQueryResult\")],t);const c=t;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import s from\"../../core/Accessor.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends s{constructor(r){super(r),this.resultRowsStream=new ReadableStream}};r([o()],t.prototype,\"resultRowsStream\",void 0),t=r([e(\"esri.rest.knowledgeGraph.GraphQueryResult\")],t);const c=t;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";let s=class extends e{constructor(o){super(o),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};o([r({type:String,json:{write:!0}})],s.prototype,\"name\",void 0),o([r({type:Boolean,json:{write:!0}})],s.prototype,\"unique\",void 0),o([r({type:Boolean,json:{write:!0}})],s.prototype,\"ascending\",void 0),o([r({type:String,json:{write:!0}})],s.prototype,\"description\",void 0),o([r({type:[String],json:{write:!0}})],s.prototype,\"fieldNames\",void 0),s=o([t(\"esri.rest.knowledgeGraph.FieldIndex\")],s);const i=s;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";let i=class extends e{constructor(t){super(t),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};t([o({type:String,json:{write:!0}})],i.prototype,\"name\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"alias\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"fieldType\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"geometryType\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"hasM\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"hasZ\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"nullable\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"editable\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"required\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"defaultVisibility\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"systemMaintained\",void 0),t([o()],i.prototype,\"role\",void 0),t([o({type:Object,json:{type:String,write:{writer:(t,e)=>{e.defaultValue=null!=t?t.toString():null}}}})],i.prototype,\"defaultValue\",void 0),i=t([r(\"esri.rest.knowledgeGraph.GraphProperty\")],i);const s=i;export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./FieldIndex.js\";import p from\"./GraphProperty.js\";let i=class extends o{constructor(r){super(r),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};r([t({type:String,json:{write:!0}})],i.prototype,\"name\",void 0),r([t({type:String,json:{write:!0}})],i.prototype,\"alias\",void 0),r([t({type:String,json:{write:!0}})],i.prototype,\"role\",void 0),r([t({type:Boolean,json:{write:!0}})],i.prototype,\"strict\",void 0),r([t({type:[p],json:{write:!0}})],i.prototype,\"properties\",void 0),r([t({type:[s],json:{write:!0}})],i.prototype,\"fieldIndexes\",void 0),i=r([e(\"esri.rest.knowledgeGraph.GraphObjectType\")],i);const l=i;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../core/Logger.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import\"../../core/Error.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./GraphObjectType.js\";let e=class extends o{constructor(r){super(r)}};e=r([s(\"esri.rest.knowledgeGraph.EntityType\")],e);const t=e;export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./GraphObjectType.js\";let t=class extends e{constructor(r){super(r),this.endPoints=[]}};r([o()],t.prototype,\"endPoints\",void 0),t=r([s(\"esri.rest.knowledgeGraph.RelationshipType\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"../../geometry/SpatialReference.js\";import i from\"./EntityType.js\";import p from\"./RelationshipType.js\";let l=class extends e{constructor(t){super(t),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};t([o({type:Date,json:{type:Number,write:{writer:(t,e)=>{e.timestamp=t?.getTime()}}}})],l.prototype,\"timestamp\",void 0),t([o({type:s,json:{write:!0}})],l.prototype,\"spatialReference\",void 0),t([o({type:Boolean,json:{write:!0}})],l.prototype,\"strict\",void 0),t([o({type:String,json:{write:!0}})],l.prototype,\"objectIdField\",void 0),t([o({type:String,json:{write:!0}})],l.prototype,\"globalIdField\",void 0),t([o()],l.prototype,\"arcgisManaged\",void 0),t([o()],l.prototype,\"identifierInfo\",void 0),t([o()],l.prototype,\"searchIndexes\",void 0),t([o({type:[i],json:{write:!0}})],l.prototype,\"entityTypes\",void 0),t([o({type:[p],json:{write:!0}})],l.prototype,\"relationshipTypes\",void 0),l=t([r(\"esri.rest.knowledgeGraph.DataModel\")],l);const n=l;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";let i=class extends e{constructor(t){super(t),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description=\"\",this.copyrightText=\"\",this.units=\"\",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId=\"\",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};t([o({type:[String],json:{write:!0}})],i.prototype,\"capabilities\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"supportsSearch\",void 0),t([o({type:[String],json:{write:!0}})],i.prototype,\"supportedQueryFormats\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"allowGeometryUpdates\",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,\"searchMaxRecordCount\",void 0),t([o({type:Object,json:{write:!0}})],i.prototype,\"serviceCapabilities\",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,\"maxRecordCount\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"description\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"copyrightText\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"units\",void 0),t([o({type:Object,json:{write:!0}})],i.prototype,\"spatialReference\",void 0),t([o({type:Number,json:{write:!0}})],i.prototype,\"currentVersion\",void 0),t([o({type:Object,json:{write:!0}})],i.prototype,\"dateFieldsTimeReference\",void 0),t([o({type:String,json:{write:!0}})],i.prototype,\"serviceItemId\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"supportsDocuments\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"dataEditingNotSupported\",void 0),t([o({type:Boolean,json:{write:!0}})],i.prototype,\"schemaEditingNotSupported\",void 0),i=t([r(\"esri.rest.knowledgeGraph.ServiceDefinition\")],i);const s=i;export{s as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./DataModel.js\";import i from\"./ServiceDefinition.js\";let p=class extends r{constructor(o){super(o),this.dataModel=null,this.serviceDefinition=null}};o([e({type:String,json:{write:!0}})],p.prototype,\"url\",void 0),o([e({type:s,json:{write:!0}})],p.prototype,\"dataModel\",void 0),o([e({type:i,json:{write:!0}})],p.prototype,\"serviceDefinition\",void 0),p=o([t(\"esri.rest.knowledgeGraph.KnowledgeGraph\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getAssetUrl as e}from\"../../../assets.js\";import has from\"../../../core/has.js\";const t=\"esri/rest/knowledgeGraph/wasmInterface/\";let s,n=null;async function r(){const e=n??s;if(e)return e;const t=has(\"wasm-simd\");return s=o(t),s}async function o(s){if(s){const{default:s}=await import(\"../../../chunks/arcgis-knowledge-client-core-simd.js\").then((e=>e.a));return s({locateFile:s=>e(t+s)})}const{default:n}=await import(\"../../../chunks/arcgis-knowledge-client-core.js\").then((e=>e.a));return n({locateFile:s=>e(t+s)})}const a={setWasmInterfacePromise:e=>n=e,restoreWasmInterfacePromise:()=>n=null};export{o as getNewInterface,r as getWasmInterface,a as test};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../../geometry.js\";import e from\"../../../core/Error.js\";import t from\"../../../geometry/Multipoint.js\";import n from\"../../../geometry/Point.js\";import o from\"../../../geometry/Polygon.js\";import r from\"../../../geometry/Polyline.js\";import i from\"../../../geometry/Geometry.js\";function a(e,t){const n=new t.ArrayValue;return n.deleteLater(),e.forEach((e=>{n.add_value(m(e,t))})),n}function l(e,t){const n=new t.ObjectValue;n.deleteLater();for(const[o,r]of Object.entries(e))n.set_key_value(o,m(r,t));return n}function s(i,a){if(i instanceof t)return f(i,a);if(i instanceof n)return g(i,a);if(i instanceof r||i instanceof o)return c(i,a);throw new e(\"knowledge-graph:unsupported-geometry\",\"Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge\",{geometry:i})}function u(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function y(t,n,o){if(!t.extent)throw new e(\"knowledge-graph:illegal-output-quantization\",\"The Output quantization provided to the encoder had an illegal value as part of its extent\",t.extent);if(!t.quantizeMode)throw new e(\"knowledge-graph:illegal-output-quantization\",\"The Output quantization contained an illegal mode setting\",t.quantizeMode);if(!t.tolerance)throw new e(\"knowledge-graph:illegal-output-quantization\",\"The Output quantization contained an illegal tolerance setting\",t.quantizeMode);n.output_quantization_parameters={extent:{xmax:t.extent.xmax,ymax:t.extent.ymax,xmin:t.extent.xmin,ymin:t.extent.ymin},quantize_mode:o.esriQuantizeMode[t.quantizeMode],tolerance:t.tolerance}}function m(e,t){if(null==e)return\"\";if(\"object\"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof i)return s(e,t);if(Array.isArray(e)){const n=new t.ArrayValue;return n.deleteLater(),e.forEach((e=>{n.add_value(m(e,t))})),n}return l(e,t)}function c(e,t){const n=new t.GeometryValue;n.deleteLater(),n.has_z=e.hasZ,n.has_m=e.hasM;const i=[],a=[];let l=[];e instanceof r?(n.geometry_type=t.esriGeometryType.esriGeometryPolyline,l=e.paths):e instanceof o&&(n.geometry_type=t.esriGeometryType.esriGeometryPolygon,l=e.rings);let s=0,u=0;return l.forEach((e=>{let t=0;e.forEach((e=>{t++,e.forEach((e=>{i[u]=e,u++}))})),a[s]=t,s++})),n.coords=new Float64Array(i),n.lengths=new Uint32Array(a),n}function f(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=n.geometry_type=t.esriGeometryType.esriGeometryMultipoint,n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],r=[];r[0]=e.points.length;let i=0;return e.points.forEach((e=>{e.forEach((e=>{o[i]=e,i++}))})),n.coords=new Float64Array(o),n.lengths=new Uint32Array(r),n}function g(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=t.esriGeometryType.esriGeometryPoint,n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],r=[];r[0]=1,o[0]=e.x,o[1]=e.y;let i=2;return e.hasZ&&(o[i]=e.z,i++),e.hasM&&(o[i]=e.m,i++),n.coords=new Float64Array(o),n.lengths=new Uint32Array(r),n}export{a as bindParamArrayToWasm,l as bindParamObjectToWasm,s as geometryToWasm,u as setInputQuantizationParametersOnEncoder,y as setOutputQuantizationParametersOnEncoder};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(r){super(r),this.properties=null}};r([s({json:{write:!0}})],t.prototype,\"properties\",void 0),t=r([e(\"esri.rest.knowledgeGraph.GraphObject\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./GraphObject.js\";let s=class extends e{constructor(r){super(r),this.typeName=null,this.id=null}};r([o({type:String,json:{write:!0}})],s.prototype,\"typeName\",void 0),r([o({type:String,json:{write:!0}})],s.prototype,\"id\",void 0),s=r([t(\"esri.rest.knowledgeGraph.GraphNamedObject\")],s);const p=s;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./GraphNamedObject.js\";import s from\"../../geometry/Point.js\";let p=class extends e{constructor(r){super(r),this.layoutGeometry=null}};r([o({type:s,json:{write:!0}})],p.prototype,\"layoutGeometry\",void 0),p=r([t(\"esri.rest.knowledgeGraph.Entity\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./GraphNamedObject.js\";import s from\"../../geometry/Polyline.js\";let i=class extends e{constructor(o){super(o),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};o([r({type:String,json:{write:!0}})],i.prototype,\"originId\",void 0),o([r({type:String,json:{write:!0}})],i.prototype,\"destinationId\",void 0),o([r({type:s,json:{write:!0}})],i.prototype,\"layoutGeometry\",void 0),i=o([t(\"esri.rest.Relationship.Relationship\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../../../geometry.js\";import e from\"../../../core/Error.js\";import t from\"../Entity.js\";import o from\"../Relationship.js\";import{geometryToWasm as i}from\"./queryToWasmEncodedFactories.js\";import n from\"../../../geometry/Geometry.js\";function r(i,n){if(!i.typeName)throw new e(\"knowledge-graph:no-type-name\",\"You must indicate the entity/relationship named object type to apply edits\");if(i instanceof t){const e=new n.EntityValue;e.deleteLater(),e.type_name=i.typeName;for(const[t,o]of Object.entries(i.properties))e.set_key_value(t,a(o,n));return i.id&&e.set_id(i.id),e}if(i instanceof o){const e=new n.RelationshipValue;e.deleteLater(),e.type_name=i.typeName;for(const[t,o]of Object.entries(i.properties))e.set_key_value(t,a(o,n));return i.id&&e.set_id(i.id),i.originId&&i.destinationId&&e.set_related_entity_ids(i.originId,i.destinationId),e}throw new e(\"knowledge-graph:applyEdits-encoding-failure\",\"Could not determine the type of a named graph object passed to the encoder\")}function s(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function a(e,t){return null==e?\"\":\"object\"!=typeof e||e instanceof Date?e:e instanceof n?i(e,t):\"\"}export{s as inputQuantizationParemetersToWasmFormat,r as namedObjectToWasm};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(r){super(r),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};r([e()],t.prototype,\"name\",void 0),r([e()],t.prototype,\"supportedCategory\",void 0),r([e()],t.prototype,\"analyzers\",void 0),r([e()],t.prototype,\"searchProperties\",void 0),t=r([s(\"esri.rest.knowledgeGraph.SearchIndex\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar e,r,i,t,o,s,y;!function(e){e[e.Regular=0]=\"Regular\",e[e.Provenance=1]=\"Provenance\",e[e.Document=2]=\"Document\"}(e||(e={})),function(e){e[e.esriFieldTypeSmallInteger=0]=\"esriFieldTypeSmallInteger\",e[e.esriFieldTypeInteger=1]=\"esriFieldTypeInteger\",e[e.esriFieldTypeSingle=2]=\"esriFieldTypeSingle\",e[e.esriFieldTypeDouble=3]=\"esriFieldTypeDouble\",e[e.esriFieldTypeString=4]=\"esriFieldTypeString\",e[e.esriFieldTypeDate=5]=\"esriFieldTypeDate\",e[e.esriFieldTypeOID=6]=\"esriFieldTypeOID\",e[e.esriFieldTypeGeometry=7]=\"esriFieldTypeGeometry\",e[e.esriFieldTypeBlob=8]=\"esriFieldTypeBlob\",e[e.esriFieldTypeRaster=9]=\"esriFieldTypeRaster\",e[e.esriFieldTypeGUID=10]=\"esriFieldTypeGUID\",e[e.esriFieldTypeGlobalID=11]=\"esriFieldTypeGlobalID\",e[e.esriFieldTypeXML=12]=\"esriFieldTypeXML\",e[e.esriFieldTypeBigInteger=13]=\"esriFieldTypeBigInteger\",e[e.esriFieldTypeDateOnly=14]=\"esriFieldTypeDateOnly\",e[e.esriFieldTypeTimeOnly=15]=\"esriFieldTypeTimeOnly\",e[e.esriFieldTypeTimestampOffset=16]=\"esriFieldTypeTimestampOffset\"}(r||(r={})),function(e){e[e.esriGeometryNull=0]=\"esriGeometryNull\",e[e.esriGeometryPoint=1]=\"esriGeometryPoint\",e[e.esriGeometryMultipoint=2]=\"esriGeometryMultipoint\",e[e.esriGeometryPolyline=3]=\"esriGeometryPolyline\",e[e.esriGeometryPolygon=4]=\"esriGeometryPolygon\",e[e.esriGeometryEnvelope=5]=\"esriGeometryEnvelope\",e[e.esriGeometryAny=6]=\"esriGeometryAny\",e[e.esriGeometryMultiPatch=7]=\"esriGeometryMultiPatch\"}(i||(i={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]=\"esriMethodHintUNSPECIFIED\",e[e.esriUUIDESRI=1]=\"esriUUIDESRI\",e[e.esriUUIDRFC4122=2]=\"esriUUIDRFC4122\"}(t||(t={})),function(e){e[e.esriTypeUNSPECIFIED=0]=\"esriTypeUNSPECIFIED\",e[e.esriTypeEntity=1]=\"esriTypeEntity\",e[e.esriTypeRelationship=2]=\"esriTypeRelationship\",e[e.esriTypeBoth=4]=\"esriTypeBoth\"}(o||(o={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]=\"esriGraphPropertyUNSPECIFIED\",e[e.esriGraphPropertyRegular=1]=\"esriGraphPropertyRegular\",e[e.esriGraphPropertyDocumentName=2]=\"esriGraphPropertyDocumentName\",e[e.esriGraphPropertyDocumentTitle=3]=\"esriGraphPropertyDocumentTitle\",e[e.esriGraphPropertyDocumentUrl=4]=\"esriGraphPropertyDocumentUrl\",e[e.esriGraphPropertyDocumentText=5]=\"esriGraphPropertyDocumentText\",e[e.esriGraphPropertyDocumentKeywords=6]=\"esriGraphPropertyDocumentKeywords\",e[e.esriGraphPropertyDocumentContentType=7]=\"esriGraphPropertyDocumentContentType\",e[e.esriGraphPropertyDocumentMetadata=8]=\"esriGraphPropertyDocumentMetadata\",e[e.esriGraphPropertyDocumentFileExtension=9]=\"esriGraphPropertyDocumentFileExtension\"}(s||(s={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]=\"esriIdentifierInfoTypeUNSPECIFIED\",e[e.esriIdentifierInfoTypeDatabaseNative=1]=\"esriIdentifierInfoTypeDatabaseNative\",e[e.esriIdentifierInfoTypeUniformProperty=2]=\"esriIdentifierInfoTypeUniformProperty\"}(y||(y={}));export{r as EsriFieldTypes,i as EsriGeometryTypes,s as EsriGraphPropertyRole,y as EsriIdentifierInfoType,o as EsriNamedTypeCategory,t as EsriUuidMethodHintTypes,e as NamedObjectTypes};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../geometry/SpatialReference.js\";import t from\"../DataModel.js\";import i from\"../EntityType.js\";import n from\"../FieldIndex.js\";import r from\"../GraphObjectType.js\";import a from\"../GraphProperty.js\";import o from\"../RelationshipType.js\";import s from\"../SearchIndex.js\";import{EsriIdentifierInfoType as p,EsriUuidMethodHintTypes as l,NamedObjectTypes as f,EsriFieldTypes as d,EsriGeometryTypes as u,EsriGraphPropertyRole as m,EsriNamedTypeCategory as y}from\"./WasmDataModelWrapperInterfaces.js\";function _(i){return i.deleteLater(),new t({timestamp:i.timestamp,spatialReference:new e(i.spatial_reference),strict:i.strict,objectIdField:i.objectid_property,globalIdField:i.globalid_property,arcgisManaged:i.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:p[i.identifier_info?.identifier_mapping_info?.identifier_info_type?.value],databaseNativeIdentifier:i.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:i.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:l[i.identifier_info?.identifier_generation_info?.uuid_method_hint?.value]}},searchIndexes:M(i.search_indexes),entityTypes:j(i.entity_types),relationshipTypes:x(i.relationship_types)})}function c(e){return e.deleteLater(),new i(b(e))}function g(e){return e.deleteLater(),new n({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:I(e.fields)})}function h(e){return e.deleteLater(),new r(b(e))}function b(e){return{name:e.name,alias:e.alias,role:f[e.role.value]?f[e.role.value]:null,strict:e.strict,properties:T(e.properties),fieldIndexes:w(e.field_indexes)}}function v(e){return e.deleteLater(),new a({alias:e.alias,name:e.name,fieldType:d[e.field_type.value]?d[e.field_type.value]:null,geometryType:u[e.geometry_type.value]?u[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:m[e.role.value],defaultValue:e.default_value})}function z(e){e.deleteLater();const t=b(e),i=[];for(let n=0;n{const t=[];for(let e=0;e{if(null==e)return null;if(\"object\"!=typeof e)return e;if(\"getDate\"in e)return e;if(\"geometry_type\"in e)switch(e.geometry_type.value){case null:return null;case u.ESRI_GEOMETRY_POINT:return p(e);case u.ESRI_GEOMETRY_MULTIPOINT:return l(e);case u.ESRI_GEOMETRY_POLYLINE:return c(e);case u.ESRI_GEOMETRY_POLYGON:return i(e);case u.ESRI_GEOMETRY_ENVELOPE:case u.ESRI_GEOMETRY_MULTI_PATCH:return _.warnOnce(\"Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null\"),null;case u.ESRI_GEOMETRY_NULL:case u.ESRI_GEOMETRY_ANY:default:return _.warnOnce(\"Unknown or blank geometry type returned - Result interpreted as null\"),null}else{if(!(\"object_value_type\"in e))return _.warnOnce(\"A decoded value came back of a type that is not supported. Result interpreted as null\"),null;switch(e.object_value_type.value){case a.OBJECT:return g(e,t);case a.ENTITY:return f(e,t);case a.RELATIONSHIP:return j(e,t);case a.PATH:return R(e,t);case a.ARRAY:return m(e,t);default:return _.warnOnce(\"Unknown graph object type detected! Result interpreted as null\"),null}}}};function m(e,t){const n=[],r=e.count();for(let o=0;o{const t=new i({url:e}),r=[];return r.push(S(t)),r.push(q(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await W(e)},refreshServiceDefinition:async e=>{const r=(await t(e.url,{query:{f:\"json\"}})).data;return r.capabilities=r?.capabilities?.split(\",\"),r.supportedQueryFormats=r?.supportedQueryFormats?.split(\",\"),e.serviceDefinition=new d(r),e.serviceDefinition},executeQueryStreaming:async(e,t,a)=>{const n=`${e.url}/graph/query`;await A(e);const i=await R(n,a);i.data.body=await C(t,e);const d=await Q(i.data.url,i.data);if(e.dataModel)return new o({resultRowsStream:await I(d,e.dataModel)});throw new r(\"knowledge-graph:undefined-data-model\",\"The KnowledgeGraph supplied did not have a data model\")},executeApplyEdits:async(e,t,a)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new r(\"knowledge-graph:data-editing-not-supported\",\"The Knowledge Graph Service definition indicated that data editing is not supported\");const n=`${e.url}/graph/applyEdits`;await A(e);const o=await R(n,a);o.data.body=await D(t,e);return P(await Q(o.data.url,o.data))},executeQuery:async(e,a,o)=>{const i=`${e.url}/graph/query`,d=await t(i,{responseType:\"array-buffer\",query:{f:\"pbf\",openCypherQuery:a.openCypherQuery,...o?.query},signal:o?.signal,timeout:o?.timeout}),p=d.getHeader?.(\"content-type\"),c=d.data;if(p?.includes(\"application/x-protobuf\")){const t=new((await s()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new n({resultRows:L(t,c,e.dataModel)});throw new r(\"knowledge-graph:undefined-data-model\",\"The KnowledgeGraph supplied did not have a data model\")}throw new r(\"knowledge-graph:unexpected-server-response\",\"server returned an unexpected response\",{responseType:p,data:d.data})},executeSearch:async(e,a,o)=>{const i=a.typeCategoryFilter,d=`${e.url}/graph/search`,p=await t(d,{responseType:\"array-buffer\",query:{f:\"pbf\",searchQuery:`\"${a.searchQuery}\"`,typeCategoryFilter:i,...o?.query},signal:o?.signal,timeout:o?.timeout}),c=p.getHeader?.(\"content-type\"),l=p.data;if(c?.includes(\"application/x-protobuf\")){const t=new((await s()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new n({resultRows:L(t,l,e.dataModel)});throw new r(\"knowledge-graph:undefined-data-model\",\"The KnowledgeGraph supplied did not have a data model\")}throw new r(\"knowledge-graph:unexpected-server-response\",\"server returned an unexpected response\",{responseType:c,data:p.data})},executeSearchStreaming:async(e,t,a)=>{const n=`${e.url}/graph/search`;await A(e);const i=await R(n,a);i.data.body=await F(t);const d=await Q(i.data.url,i.data);if(e.dataModel)return new o({resultRowsStream:await I(d,e.dataModel)});throw new r(\"knowledge-graph:undefined-data-model\",\"The KnowledgeGraph supplied did not have a data model\")},_fetchWrapper:async(e,t)=>fetch(e,t)};async function b(e,t,r){return k.executeApplyEdits(e,t,r)}async function v(e,t,r){return k.executeQuery(e,t,r)}async function x(e,t,r){return k.executeQueryStreaming(e,t,r)}async function G(e,t,r){return k.executeSearch(e,t,r)}async function E(e,t,r){return k.executeSearchStreaming(e,t,r)}async function T(e){return k.fetchKnowledgeGraph(e)}async function S(e){return k.refreshDataModel(e)}async function q(e){return k.refreshServiceDefinition(e)}async function Q(e,t){return k._fetchWrapper(e,t)}async function A(t){const r=e?.findCredential(t.url);r||(t.dataModel?await W(t):await S(t))}function M(e,t,a){if(0!==e.error_code)throw new r(t,a,{errorCode:e.error_code,errorMessage:e.error_message})}function j(e,t,r,a){null==t?r.set_param_key_value(e,\"\"):\"object\"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof _?r.set_param_key_value(e,u(t,a)):t instanceof Array?r.set_param_key_value(e,l(t,a)):r.set_param_key_value(e,h(t,a))}async function D(e,t){if(t.dataModel||await S(t),!t.dataModel)throw new r(\"knowledge-graph:data-model-undefined\",\"Encoding could not proceed because a data model was not provided and it could not be determined from the service\");const a=await s(),n=!!e.options?.cascadeDelete,o=new a.GraphApplyEditsEncoder(a.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?g(e.options?.inputQuantizationParameters):a.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let t;e.entityAdds?.forEach((e=>{t=o.add_entity(y(e,a)),M(t,\"knowledge-graph:applyEdits-encoding-failed\",\"Attempting to encode the applyEdits - an entity failed to be added to the encoder\")})),e.relationshipAdds?.forEach((e=>{if(!e.originId||!e.destinationId)throw new r(\"knowledge-graph:relationship-origin-destination-missing\",\"When adding a new relationship, you must provide both an origin and destination id on the appropriate class property\");t=o.add_relationship(y(e,a)),M(t,\"knowledge-graph:applyEdits-encoding-failed\",\"Attempting to encode the applyEdits - a relationship failed to be added to the encoder\")})),e.entityUpdates?.forEach((e=>{if(!e.id)throw new r(\"knowledge-graph:entity-id-missing\",\"When updating an entity or relationship, you must specify the id on the class level property\");t=o.update_entity(y(e,a)),M(t,\"knowledge-graph:applyEdits-encoding-failed\",\"Attempting to encode the applyEdits - an entity failed to be added to the encoder\")})),e.relationshipUpdates?.forEach((e=>{if(!e.id)throw new r(\"knowledge-graph:relationship-id-missing\",\"When updating an entity or relationship, you must specify the id on the class level property\");t=o.update_relationship(y(e,a)),M(t,\"knowledge-graph:applyEdits-encoding-failed\",\"Attempting to encode the applyEdits - a relationship failed to be added to the encoder\")})),e.entityDeletes?.forEach((e=>{if(!e.typeName)throw new r(\"knowledge-graph:no-type-name\",\"You must indicate the entity/relationship named object type to apply edits - delete\");const t=o.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach((e=>{t.delete_by_id(e)}))})),e.relationshipDeletes?.forEach((e=>{if(!e.typeName)throw new r(\"knowledge-graph:no-type-name\",\"You must indicate the entity/relationship named object type to apply edits - delete\");const t=o.make_delete_helper(e.typeName,!1);e.ids?.forEach((e=>{t.delete_by_id(e)}))})),o.encode()}catch(d){throw new r(\"knowledge-graph:applyEdits-encoding-failed\",\"Attempting to encode the applyEdits failed\",{error:d})}const i=o.get_encoding_result();return M(i.error,\"knowledge-graph:applyEdits-encoding-failed\",\"Attempting to encode the applyEdits failed\"),i.get_byte_buffer()}async function C(e,t){const a=await s(),n=new a.GraphQueryRequestEncoder;if(n.deleteLater(),n.output_spatial_reference=a.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[r,d]of Object.entries(e.bindParameters))j(r,d,n,a);if(e.bindGeometryQuantizationParameters)p(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await S(t),4326!==t.dataModel?.spatialReference?.wkid)throw new r(\"knowledge-graph:SR-quantization-mismatch\",\"If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder\");n.input_quantization_parameters=a.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&c(e.outputQuantizationParameters,n,a);try{n.encode()}catch(i){throw new r(\"knowledge-graph:query-encoding-failed\",\"Attempting to encode the query failed\",{error:i})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new r(\"knowledge-graph:query-encoding-failed\",\"Attempting to encode the query failed\",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return o.get_byte_buffer()}async function F(e){const t=await s(),a=new t.GraphSearchRequestEncoder;if(a.deleteLater(),a.search_query=e.searchQuery,a.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!0===e.returnSearchContext&&(a.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(a.start_index=e.start),null!=e.num&&(a.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{a.set_ids_filter(l(e.idsFilter,t))}catch(o){throw new r(\"knowledge-graph:ids-format-error\",\"Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string\",{error:o})}e.namedTypesFilter?.forEach((e=>{a.add_named_type_filter(e)}));try{a.encode()}catch(o){throw new r(\"knowledge-graph:search-encoding-failed\",\"Attempting to encode the search failed\",{error:o})}const n=a.get_encoding_result();if(0!==n.error.error_code)throw new r(\"knowledge-graph:search-encoding-failed\",\"Attempting to get encoding result from the query failed\",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return n.get_byte_buffer()}async function R(e,r){return t(e,{responseType:\"native-request-init\",method:\"post\",query:{f:\"pbf\",...r?.query},body:\"x\",headers:{\"Content-Type\":\"application/octet-stream\"},signal:r?.signal,timeout:r?.timeout})}async function P(e){const t=e.headers.get(\"content-type\");if(t?.includes(\"application/x-protobuf\")){const t=await e.arrayBuffer(),r=new((await s()).GraphApplyEditsDecoder);return r.deleteLater(),r.decode(new Uint8Array(t)),m(r)}throw new r(\"knowledge-graph:unexpected-server-response\",\"server returned an unexpected response\",{responseType:t,data:e.text()})}function L(e,t,a){e.push_buffer(new Uint8Array(t));const n=[];let o=0;for(;e.next_row();){o||(o=e.get_header_keys().size());const t=new Array(o);for(let r=0;r{if(i){let t;if(n.has_error()&&(t=new r(\"knowledge-graph:stream-decoding-error\",\"One or more result rows were not successfully decoded\",{errorCode:n.error.error_code,errorMessage:n.error.error_message})),a.releaseLock(),t)throw e.error(t),t;return void e.close()}const s=L(n,d,t);return s.length>0&&e.enqueue(s),o()}))}}})}throw new r(\"knowledge-graph:unexpected-server-response\",\"server returned an unexpected response\",{responseType:n,data:e.text()})}async function W(e){const a=`${e.url}/dataModel/queryDataModel`,n=await t(a,{responseType:\"array-buffer\",query:{f:\"pbf\"}}),o=n.getHeader?.(\"content-type\"),i=n.data;if(o?.includes(\"application/x-protobuf\")){const e=(await s()).decode_data_model_from_protocol_buffer(new Uint8Array(i));if(!e)throw new r(\"knowledge-graph:data-model-decode-failure\",\"The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)\");return f(e)}throw new r(\"knowledge-graph:unexpected-server-response\",\"server returned an unexpected response\",{responseType:o,data:n.data})}export{Q as _fetchWrapper,b as executeApplyEdits,v as executeQuery,x as executeQueryStreaming,G as executeSearch,E as executeSearchStreaming,T as fetchKnowledgeGraph,k as kgRestServices,S as refreshDataModel,q as refreshServiceDefinition};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Accessor.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let p=class extends o{constructor(r){super(r),this.openCypherQuery=\"\"}};r([s()],p.prototype,\"openCypherQuery\",void 0),p=r([e(\"esri.rest.knowledgeGraph.GraphQuery\")],p);const t=p;export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import e from\"./GraphQuery.js\";let s=class extends e{constructor(r){super(r),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null}};r([t()],s.prototype,\"bindParameters\",void 0),r([t()],s.prototype,\"bindGeometryQuantizationParameters\",void 0),r([t()],s.prototype,\"outputQuantizationParameters\",void 0),s=r([o(\"esri.rest.knowledgeGraph.GraphQueryStreaming\")],s);const a=s;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport m from\"../../core/Error.js\";import{executeQueryStreaming as n}from\"../../rest/knowledgeGraphService.js\";import i from\"../../rest/knowledgeGraph/GraphQueryStreaming.js\";function e(n){if(!n.spatialReference.isWGS84)throw new m(\"knowledge-graph:layer-support-utils\",\"The extentToInBoundsRings function only supports WGS84 spatial references.\");let i;return i=n.xmax>180&&n.xmin<180?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[180,n.ymax],[180,n.ymin],[n.xmin,n.ymin]],[[-180,n.ymin],[-180,n.ymax],[n.xmax-360,n.ymax],[n.xmax-360,n.ymin],[-180,n.ymin]]]:n.xmax>180&&n.xmin>180?[[[n.xmin-360,n.ymin],[n.xmin-360,n.ymax],[n.xmax-360,n.ymax],[n.xmax-360,n.ymin],[n.xmin-360,n.ymin]]]:n.xmax>-180&&n.xmin<-180?[[[n.xmin+360,n.ymin],[n.xmin+360,n.ymax],[180,n.ymax],[180,n.ymin],[n.xmin+360,n.ymin]],[[-180,n.ymin],[-180,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[-180,n.ymin]]]:n.xmax<-180&&n.xmin<-180?[[[n.xmin+360,n.ymin],[n.xmin+360,n.ymax],[n.xmax+360,n.ymax],[n.xmax+360,n.ymin],[n.xmin+360,n.ymin]]]:[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]],i}async function a(m,e){const a=[],x=new Map,r=[];if(e.dataModel?.relationshipTypes)for(const n of e.dataModel.relationshipTypes)n.name&&x.set(n.name,[]);for(const n of m)x.has(n.typeName)&&x.get(n.typeName)?.push(n.id);for(const[t,y]of x){if(y.length<1)continue;const m=new i({openCypherQuery:`MATCH (n)-[r:${t}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:y}});r.push(n(e,m).then((async m=>{const n=m.resultRowsStream.getReader();for(;;){const{done:m,value:i}=await n.read();if(m)break;for(const n of i)a.push({id:n[0],typeName:n[1]}),a.push({id:n[2],typeName:n[3]})}})))}return await Promise.all(r),a}export{e as extentToInBoundsRings,a as getRelationshipEndNodeIds};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import t from\"../../core/Accessor.js\";import i from\"../../core/Error.js\";import n from\"../../core/Logger.js\";import{getOrCreateMapValue as o}from\"../../core/MapUtils.js\";import{parseWhereClause as s}from\"../../core/sql.js\";import{property as a}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";import{encodeGeohash as p}from\"../../geohash/geohashUtils.js\";import d from\"../../geometry/Polygon.js\";import{initializeProjection as m,project as l}from\"../../geometry/projection.js\";import{WGS84 as h}from\"../../geometry/support/spatialReferenceUtils.js\";import c from\"./SessionMemoryStorage.js\";import{extentToInBoundsRings as y}from\"./supportUtils.js\";import{executeQueryStreaming as u}from\"../../rest/knowledgeGraphService.js\";import f from\"../../rest/knowledgeGraph/GraphQueryStreaming.js\";import g from\"../../rest/support/Query.js\";import w from\"../../geometry/Extent.js\";const b=\"ESRI__ID\",T=\"ESRI__ORIGIN_ID\",D=\"ESRI__DESTINATION_ID\",M=\"ESRI__LAYOUT_GEOMETRY\",I=12,k=n.getLogger(\"esri.rest.knowledgeGraph.knowledgeGraphLayer.KnowledgeGraphLayerDataManager\");let E=class extends t{constructor(e){super(e),this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.memberIdTypeLookup=new Map,this._processingCacheUpdatesLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach((i=>{i.name&&(t.set(i.name,\"entity\"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&\"esriGeometryNull\"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??\"\",geometryType:e.geometryType})})))})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((i=>{i.name&&(t.set(i.name,\"relationship\"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&\"esriGeometryNull\"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??\"\",geometryType:e.geometryType})})))})),e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,n)=>{if(\"entity\"===t.get(n))this.entityTypeNames.add(n);else{if(\"relationship\"!==t.get(n))return k.warn(`A named type, ${n}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(n);this.relationshipTypeNames.add(n)}const o=new Map;i.members?.forEach((e=>{this.memberIdTypeLookup.set(e.id,n);const t=this.getById(e.id);t&&o.set(e.id,t)})),this.sublayerCaches.set(n,o)}))}addToLayer(e){e.forEach((({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i(\"knowledge-graph:layer-data-manager\",\"You cannot add to a layer's exclusion list if it was not created with an exclusion list originally\");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),this.memberIdTypeLookup.set(t,e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),this.memberIdTypeLookup.set(t,e)}}))}getById(e){return c.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new g({where:\"1=1\",outFields:[\"*\"]}),\"link-chart\"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??\"\"),o=n.outFields,s=n.geometry;let a=\"\",r=\"\";s&&s.extent&&(a=p(s.extent.ymin,s.extent.xmin,I),r=p(s.extent.ymax,s.extent.xmax,I)),o&&1===o.length&&o[0]===b&&\"1=1\"===n.where||await Promise.all(i??[]);const d=this.sublayerCaches.has(t.objectType.name??\"\")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],m=[];return d.forEach((i=>{if(i.geometry=e.linkChartDiagramLookup.get(i.attributes[t.objectIdField]),i.attributes[M]=i.geometry,a&&r){const n=e.linkChartGeohashLookup.get(i.attributes[t.objectIdField]);n?n>=a&&n<=r&&m.push(i):m.push(i)}else m.push(i)})),m}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e){const t=[],i=[],n=new Map;return e.forEach((e=>{if(this.memberIdTypeLookup.has(e)){const t=this.memberIdTypeLookup.get(e);if(!this.entityTypeNames.has(t))return;n.has(t)?n.get(t)?.push(e):n.set(t,[e])}})),n.forEach(((e,n)=>{const o=`MATCH (n:${n})-[r]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`,s=new Promise((i=>{(async()=>{const i=(await u(this.knowledgeGraph,new f({openCypherQuery:o,bindParameters:{ids:e}}))).resultRowsStream.getReader();try{for(;;){const{done:e,value:n}=await i.read();if(e)break;for(let i=0;i{i()}))}));i.push(s)})),await Promise.all(i),t}async refreshCacheContent(e,t,n,s=!0){const a=c.getInstance(),r=[],p=new Map,d=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&d.set(e.name,e)})),this.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&d.set(e.name,e)})),e||this.inclusionModeDefinition?e?e.forEach((e=>{if(this.memberIdTypeLookup.has(e)){const t=this.memberIdTypeLookup.get(e);p.has(t)?p.get(t)?.push(e):p.set(t,[e])}})):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e.useAllData?p.set(t,null):e.members&&e.members.forEach((e=>{p.has(t)&&null!==p.get(t)?p.get(t)?.push(e.id):p.set(t,[e.id])}))})):(this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&p.set(e.name,null)})),this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&p.set(e.name,null)})));for(const[m,l]of p){const e=new Promise((e=>{const r=async()=>{const e=new Set,r=[];let p,h=\"\",c=!1;if(t||d.get(m)?.properties?.forEach((t=>{t.name&&e.add(t.name)})),n&&this.geographicLookup.has(m)){const t=this.geographicLookup.get(m)?.name;t&&e.add(t)}if(this.entityTypeNames.has(m))h=`MATCH (n:${m}) ${l?\"WHERE id(n) IN $ids \":\"\"}return ID(n)`,e.forEach((e=>{h+=`, n.${e}`,r.push(e)}));else{if(!this.relationshipTypeNames.has(m))throw new i(\"knowledge-graph:layer-data-manager\",`The graph type of ${m} could not be determined. Was this type set in the KG data model and inclusion definition?`);c=!0,h=`MATCH ()-[n:${m}]->() ${l?\"WHERE id(n) IN $ids \":\"\"}return ID(n), id(startNode(n)), id(endNode(n))`,e.forEach((e=>{h+=`, n.${e}`,r.push(e)}))}p=new f(l?{openCypherQuery:h,bindParameters:{ids:l}}:{openCypherQuery:h});const y=(await u(this.knowledgeGraph,p)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await y.read();if(e)break;const i=[];for(let s=0;snew Set)).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,(()=>new Set)).add(p.id));n{p?.set(e.attributes[b],e),s&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(m).members.has(e.attributes[b])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(m).members.set(e.attributes[b],{id:e.attributes[b]}),this.memberIdTypeLookup.set(e.attributes[b],m))}))}};r().then((()=>{e(null)}))}));r.push(e),this._processingCacheUpdatesLookup.get(m)?.push(e)}await Promise.all(r)}removeFromLayer(e){const t=new Set,i=new Set(e.map((e=>e.id)));for(const n of e)t.add(n.typeName),this.memberIdTypeLookup.delete(n.id),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.members?.has(n.id)&&e.members.delete(n.id)}));t.forEach((e=>{this.sublayerCaches.get(e)?.forEach(((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)}))}))}async retrieveDataFromService(e,t,n){const o=c.getInstance(),a=new Set,r=[];let p,g=\"\",T=[];const D=\"relationship\"===t.graphType,M=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,I=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let k=!M&&I?Array.from(I).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(k=e.objectIds);else if(null!=e.objectIds&&k&&k.length>0){const t=e.objectIds;e.objectIds=k.filter((e=>t.includes(e)))}else if(null!=e.objectIds)k=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=k}if(null!=e.outFields){const i=e.outFields;i.includes(\"*\")?t.fields.forEach((e=>{a.add(e.name)})):i.forEach((e=>{e!==b&&e!==t.geometryFieldName&&a.add(e)}))}if(null!=e.geometry){const n=e.geometry;let o;const c=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,u=c?.spatialReference,b=c?.serviceCapabilities?.geometryCapabilities;let T=b?.geometryMaxBoundingRectangleSizeX,M=b?.geometryMaxBoundingRectangleSizeY;if(n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,h),o=l(n.extent,h)):o=n.extent,T&&M&&u){if(4326!==u.wkid){const e=new w({spatialReference:u,xmax:T,ymax:M}),t=l(e,h);T=t.xmax,M=t.ymax}if(o.xmax-o.xmin>T)throw new i(\"knowledge-graph:layer-data-manager\",`Extent x bounds should be within ${T}° latitude, limit exceeded`);if(o.ymax-o.ymin>M)throw new i(\"knowledge-graph:layer-data-manager\",`Extent y bounds should be within ${M}° longitude, limit exceeded`)}if(null!=e.where&&\"1=1\"!==e.where){const i=await s(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach((e=>{i.fieldNames.includes(e.name)&&a.add(e.name)}))}g=D?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&a.add(t.geometryFieldName),a.forEach((e=>{g+=`, n.${e}`,r.push(e)})),p=new f({openCypherQuery:g,bindParameters:{param_filter_geom:new d({rings:y(o)})}})}else{let i=\"\";if(null!=e.where&&\"1=1\"!==e.where){const n=await s(e.where,t.fieldsIndex);t.fields.forEach((e=>{n.fieldNames.includes(e.name)&&a.add(e.name)}));const o=new Set([\"column-reference\",\"string\",\"number\",\"binary-expression\"]),r=new Set([\"=\",\"<\",\"<=\",\"<>\",\">\",\">=\",\"AND\",\"OR\",\"LIKE\"]);let p=!1;const d=e=>{if(\"column-reference\"===e.type)return`n.${e.column}`;if(\"string\"===e.type)return`'${e.value}'`;if(\"number\"===e.type)return`${e.value}`;if(\"binary-expression\"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if(\"binary-expression\"===e.type&&\"LIKE\"===e.operator){let t=\"\";if(\"function\"===e.left.type&&\"column-reference\"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if(\"column-reference\"!==e.left.type)return p=!0,\"\";t+=`lower(n.${e.left.column})`}if(t+=\" CONTAINS (\",\"string\"!==e.right.type)return p=!0,\"\";{let i=e.right.value;\"%\"===i.charAt(0)&&(i=i.slice(1)),\"%\"===i.charAt(i.length-1)&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,\"\"};i=d(n.parseTree),p&&(i=\"\")}let n=\"\";n=D?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;k&&(o=!0,n+=\" WHERE ID(n) IN $ids\"),i&&(n+=o?\" AND\":\" WHERE\",n+=` ${i}`),n+=\" return ID(n)\",D&&(n+=\", id(startNode(n)), id(endNode(n))\"),e.returnGeometry&&t.geometryFieldName&&a.add(t.geometryFieldName),a.forEach((e=>{n+=`, n.${e}`,r.push(e)})),p=new f(k?{openCypherQuery:n,bindParameters:{ids:k}}:{openCypherQuery:n})}const E=(await u(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await E.read();if(e)break;const n=[];for(let t=0;t{let p=class extends o{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return r([e(t.fields)],p.prototype,\"fields\",void 0),r([e(t.fieldsIndex)],p.prototype,\"fieldsIndex\",void 0),p=r([s(\"esri.layers.knowledgeGraphLayer.KnowledgeGraphSublayerBase\")],p),p};export{p as KnowledgeGraphSublayerBase};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import t from\"../../PopupTemplate.js\";import\"../../renderers/ClassBreaksRenderer.js\";import\"../../renderers/DictionaryRenderer.js\";import\"../../renderers/DotDensityRenderer.js\";import\"../../renderers/HeatmapRenderer.js\";import\"../../renderers/PieChartRenderer.js\";import\"../../renderers/Renderer.js\";import\"../../renderers/SimpleRenderer.js\";import\"../../renderers/UniqueValueRenderer.js\";import{fromJSON as r}from\"../../renderers/support/jsonUtils.js\";import{rendererTypes as o}from\"../../renderers/support/types.js\";import\"../../core/workers/workers.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import{initializeProjection as a,project as n}from\"../../geometry/projection.js\";import{WGS84 as p}from\"../../geometry/support/spatialReferenceUtils.js\";import l from\"../Layer.js\";import y from\"../graphics/data/FeatureStore.js\";import{QueryEngine as u}from\"../graphics/data/QueryEngine.js\";import{createCapabilities as m,createDrawingInfo as d}from\"../graphics/sources/support/clientSideDefaults.js\";import{mockOidFieldName as h,mockLayoutGeometryFieldName as c}from\"./KnowledgeGraphLayerDataManager.js\";import{KnowledgeGraphSublayerBase as g}from\"./KnowledgeGraphSublayerBase.js\";import{BlendLayer as f}from\"../mixins/BlendLayer.js\";import{FeatureReductionLayer as j}from\"../mixins/FeatureReductionLayer.js\";import{RefreshableLayer as b}from\"../mixins/RefreshableLayer.js\";import{ScaleRangeLayer as T}from\"../mixins/ScaleRangeLayer.js\";import w from\"../support/Field.js\";import{fixRendererFields as S}from\"../support/fieldUtils.js\";import F from\"../../rest/support/FeatureSet.js\";import x from\"../../rest/support/Query.js\";import{createPopupTemplate as Q}from\"../../support/popupUtils.js\";import O from\"../../core/workers/RemoteClient.js\";import v from\"../../geometry/Extent.js\";import E from\"../../geometry/Polygon.js\";import L from\"../../geometry/Polyline.js\";import{featureGeometryTypeKebabDictionary as N}from\"../../geometry/support/typeUtils.js\";let M=class extends(j(g(f(T(b(l)))))){constructor(e){if(super(e),this.capabilities=m(!1,!1),this.definitionExpression=\"\",this.displayField=\"\",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=h,this.objectType=null,this.parentCompositeLayer=null,this.popupTemplate=null,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new O(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=x.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type=\"knowledge-graph-sublayer\",\"link-chart\"===e.parentCompositeLayer.type)\"relationship\"===e.graphType?this.geometryType=\"polyline\":this.geometryType=\"point\",this.geometryFieldName=c;else if(e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType&&\"esriGeometryNull\"!==e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name)?.geometryType){const t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=t?.name??null,this.geometryType=t?.geometryType?N.fromJSON(t.geometryType):null;const r=t?.name,o=r?e.objectType.properties?.[r]:null;o?(this.hasM=o.hasM??!1,this.hasZ=o.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;e.objectType.properties?.forEach((e=>{let t=null,r=e.fieldType;\"esriFieldTypeOID\"===r&&(r=\"esriFieldTypeInteger\"),this.fields.push(w.fromJSON({name:e.name,type:r,alias:e.alias,defaultValue:t,editable:e.editable,nullable:e.nullable}))})),this.fields.push(w.fromJSON({name:this.objectIdField,type:\"esriFieldTypeString\",alias:this.objectIdField,editable:!1})),this._set(\"fields\",[...this.fields]),e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel?.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),\"link-chart\"===e.parentCompositeLayer.type?\"relationship\"===e.graphType?this.renderer=r(d(N.toJSON(\"polyline\")).renderer):this.renderer=r(d(N.toJSON(\"point\")).renderer):this.renderer=r(d(N.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){S(e,this.fieldsIndex),this._set(\"renderer\",e)}createPopupTemplate(e){return Q(this,e)}createQuery(){return new x({where:\"1=1\",outFields:[\"*\"]})}getField(e){for(let t=0;t{e.sourceLayer=this})),s}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:s}=await this._setupQueryObjects(r),i=await s.executeQueryForExtent(o.toJSON(),t?.signal);let a;return a=null!=i.extent?.xmin&&null!=i.extent?.xmax&&null!=i.extent?.ymin&&null!=i.extent?.ymax?new v(i.extent):new v,{count:i.count,extent:a}}async queryObjectIds(e,t){const r=x.from(e);let o;if(\"link-chart\"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new y({geometryType:N.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new u({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:N.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new x({where:\"1=1\",outFields:[h]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){const r=x.from(e),o=r.geometry;let s;if(o&&!o.spatialReference?.isWGS84&&(await a(o.spatialReference,p),r.geometry=n(o instanceof E||o instanceof L?o:o.extent,p)),\"link-chart\"===this.parentCompositeLayer.type&&this._cachedQueryEngine)s=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);s=this.loadQueryEngine(e)}return{resolvedQuery:r,queryEngine:s}}};e([s()],M.prototype,\"capabilities\",void 0),e([s({readOnly:!0})],M.prototype,\"defaultPopupTemplate\",null),e([s()],M.prototype,\"definitionExpression\",void 0),e([s()],M.prototype,\"displayField\",void 0),e([s()],M.prototype,\"elevationInfo\",void 0),e([s()],M.prototype,\"geometryType\",void 0),e([s()],M.prototype,\"geometryFieldName\",void 0),e([s()],M.prototype,\"graphType\",void 0),e([s()],M.prototype,\"hasM\",void 0),e([s()],M.prototype,\"hasZ\",void 0),e([s()],M.prototype,\"labelsVisible\",void 0),e([s()],M.prototype,\"labelingInfo\",void 0),e([s()],M.prototype,\"objectIdField\",void 0),e([s()],M.prototype,\"objectType\",void 0),e([s()],M.prototype,\"parentCompositeLayer\",void 0),e([s({type:t,json:{name:\"popupInfo\",write:!0}})],M.prototype,\"popupTemplate\",void 0),e([s({types:o,json:{write:{target:\"layerDefinition.drawingInfo.renderer\"}}})],M.prototype,\"renderer\",null),e([s()],M.prototype,\"source\",void 0),e([s({json:{read:!1}})],M.prototype,\"type\",void 0),M=e([i(\"esri.layers.knowledgeGraph.KnowledgeGraphSublayer\")],M);const C=M;export{C as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{getAssetUrl as t}from\"../../assets.js\";let e,r=null;function a(){return!!r}function n(){return e||(e=import(\"../../chunks/lclayout.js\").then((t=>t.l)).then((({default:e})=>e({locateFile:e=>t(`esri/libs/linkchartlayout/${e}`)}))).then((t=>{s(t)})),e)}function s(t){r=t}var o;function u(t,e,a,n,s,o){const u=a.length,y=s.length,l=Float64Array.BYTES_PER_ELEMENT,i=Uint32Array.BYTES_PER_ELEMENT,c=Uint8Array.BYTES_PER_ELEMENT,E=16,p=E-1+u*(c+2*l)+y*(2*i),f=r._malloc(p);try{const c=f+E-f%E,p=c+u*l,b=p+u*l,A=b+y*i,P=A+y*i,_=()=>[r.HEAPF64.subarray(c>>3,(c>>3)+u),r.HEAPF64.subarray(p>>3,(p>>3)+u),r.HEAPU32.subarray(b>>2,(b>>2)+y),r.HEAPU32.subarray(A>>2,(A>>2)+y),r.HEAPU8.subarray(P,P+u)],[C,H,d,m,F]=_();C.set(a),H.set(n),d.set(s),m.set(o),F.set(e);const h=t(u,P,c,p,y,b,A),[B,L,R,T,g]=_();return a.set(B),n.set(L),s.set(R),o.set(T),e.set(g),h}finally{r._free(f)}}!function(t){t[t.None=0]=\"None\",t[t.IsMovable=1]=\"IsMovable\",t[t.IsGeographic=2]=\"IsGeographic\",t[t.IsRoot=4]=\"IsRoot\"}(o||(o={}));const y=2,l=1,i=-1;var c,E,p,f,b,A,P,_;function C(t,e,a,n,s,o,u,y,l,i,c,E,p,f,b){const A=e.length,P=Float64Array.BYTES_PER_ELEMENT,_=Uint32Array.BYTES_PER_ELEMENT,C=16,H=C-1+t*(8*P)+A*(3*_),d=r._malloc(H);try{const H=d+C-d%C,m=H+t*P,F=m+t*P,h=F+t*P,B=h+t*P,L=B+t*P,R=L+t*P,T=R+t*P,g=T+t*P,N=g+A*_,U=N+A*_,M=()=>[r.HEAPF64.subarray(H>>3,(H>>3)+t),r.HEAPF64.subarray(m>>3,(m>>3)+t),r.HEAPF64.subarray(F>>3,(F>>3)+t),r.HEAPF64.subarray(h>>3,(h>>3)+t),r.HEAPF64.subarray(B>>3,(B>>3)+t),r.HEAPF64.subarray(L>>3,(L>>3)+t),r.HEAPF64.subarray(R>>3,(R>>3)+t),r.HEAPF64.subarray(T>>3,(T>>3)+t),r.HEAPU32.subarray(g>>2,(g>>2)+A),r.HEAPU32.subarray(N>>2,(N>>2)+A),r.HEAPU32.subarray(U>>2,(U>>2)+A)],[I,S,v,Y,z,G,D,j,k,w,x]=M();I.set(y),S.set(l),v.set(i),Y.set(c),z.set(E),G.set(p),D.set(f),j.set(b),k.set(e),w.set(a),x.set(n);const $=r.computeCentrality(t,A,g,N,U,s,o,u,H,m,F,h,B,L,R,T),[q,J,K,O,Q,V,W,X,Z,tt,et]=M();return y.set(q),l.set(J),i.set(K),c.set(O),E.set(Q),p.set(V),f.set(W),b.set(X),e.set(Z),a.set(tt),n.set(et),$}finally{r._free(d)}}!function(t){function e(){return r.getMinIdealEdgeLength()}function a(t,e,a,n,s,o=y,c=l,E=i){return u(((t,e,a,n,s,u,y)=>r.applyForceDirectedLayout(t,e,a,n,s,u,y,o,c,E)),t,e,a,n,s)}t.getMinIdealEdgeLength=e,t.apply=a}(c||(c={})),function(t){function e(t,e,a,n,s,o=y,c=l,E=i){return u(((t,e,a,n,s,u,y)=>r.applyCommunityLayout(t,e,a,n,s,u,y,o,c,E)),t,e,a,n,s)}t.apply=e}(E||(E={})),function(t){function e(t,e,a,n,s){return u(r.applySimpleLayout,t,e,a,n,s)}t.apply=e}(p||(p={})),function(t){function e(t,e,a,n,s){return u(r.applyHierarchicalLayout,t,e,a,n,s)}t.apply=e}(f||(f={})),function(t){function e(t,e,a,n,s){return u(r.applyRadialTreeLayout,t,e,a,n,s)}t.apply=e}(b||(b={})),function(t){function e(t,e,a,n,s){return u(r.applySmartTreeLayout,t,e,a,n,s)}t.apply=e}(A||(A={})),function(t){t[t.Undirected=0]=\"Undirected\",t[t.Directed=1]=\"Directed\",t[t.Reversed=2]=\"Reversed\"}(P||(P={})),function(t){t[t.ByCC_Raw=0]=\"ByCC_Raw\",t[t.ByCC_NormalizeGlobally=1]=\"ByCC_NormalizeGlobally\",t[t.ByCC_NormalizeByCC=2]=\"ByCC_NormalizeByCC\"}(_||(_={}));export{_ as CentralityMode,E as LCCommunityLayout,c as LCForceDirectedLayout,f as LCHierarchicalLayout,b as LCRadialTreeLayout,p as LCSimpleLayout,A as LCSmartTreeLayout,o as NodeFlag,P as RelationshipInterpretation,r as _lclib,C as computeCentrality,y as defaultBudgetTheoreticalSeconds,l as defaultIdealEdgeLengthMultiplier,i as defaultRepulsionRadiusMultiplier,a as isLoaded,n as load};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../core/Collection.js\";import a from\"../core/Error.js\";import i from\"../core/Logger.js\";import{throwIfAborted as o}from\"../core/promiseUtils.js\";import{property as n}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import{encodeGeohash as r}from\"../geohash/geohashUtils.js\";import h from\"./Layer.js\";import{convertFromGeometry as l}from\"./graphics/featureConversionUtils.js\";import c from\"./graphics/OptimizedGeometry.js\";import{KnowledgeGraphLayerDataManager as d,mockOidFieldName as p,mockOriginIdFieldName as u,mockDestinationIdFieldName as y,mockLayoutGeometryFieldName as m,geohashEncodingPrecision as f}from\"./knowledgeGraph/KnowledgeGraphLayerDataManager.js\";import g from\"./knowledgeGraph/KnowledgeGraphSublayer.js\";import{getRelationshipEndNodeIds as k}from\"./knowledgeGraph/supportUtils.js\";import{BlendLayer as C}from\"./mixins/BlendLayer.js\";import{ScaleRangeLayer as L}from\"./mixins/ScaleRangeLayer.js\";import{LCSimpleLayout as M,LCSmartTreeLayout as b,LCRadialTreeLayout as w,LCHierarchicalLayout as x,LCCommunityLayout as D,LCForceDirectedLayout as E,NodeFlag as T,load as G}from\"../libs/linkchartlayout/LinkChartLayout.js\";import{fetchKnowledgeGraph as N}from\"../rest/knowledgeGraphService.js\";import I from\"../rest/knowledgeGraph/EntityType.js\";import R from\"../rest/knowledgeGraph/RelationshipType.js\";import _ from\"../geometry/Extent.js\";import A from\"../geometry/Point.js\";import v from\"../geometry/Polyline.js\";const S=(e,t,a)=>(e.has(t)||e.set(t,a()),e.get(t));let j=class extends(C(L(h))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:\"RADIAL_TREE\",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.knowledgeGraph=null,this.layers=new t,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new _({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new t,this.type=\"link-chart\",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a(\"knowledge-graph:linkchart-layer-constructor\",\"If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it\")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split(\"/\");this.title=e[e.length-2]}const t=new Set;let o=[],n=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a(\"knowledge-graph:composite-layer-constructor\",\"If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined\");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,s)=>{if(!this._graphTypeLookup.get(s))return i.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this._graphTypeLookup.get(s)instanceof R||\"strictOrigin\"in this._graphTypeLookup.get(s)?t.has(s)||(t.add(s),n.push(this._graphTypeLookup.get(s))):this._graphTypeLookup.get(s)instanceof I||\"properties\"in this._graphTypeLookup.get(s)?t.has(s)||(t.add(s),o.push(this._graphTypeLookup.get(s))):(i.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))})):(o=e.knowledgeGraph.dataModel.entityTypes??[],n=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new d({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=o,this.memberRelationshipTypes=n,this.dataManager=s}load(e){return this.addResolvingPromise(new Promise((t=>{N(this.url).then((a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof c?e.linkChartLocation:e.linkChartLocation?l(e.linkChartLocation):null,this.linkChartDiagramLookup.set(e.id,t),t&&2===t.coords.length&&0===t.lengths.length?this.linkChartGeohashLookup.set(e.id,r(t.coords[1],t.coords[0],f)):this.linkChartGeohashLookup.set(e.id,\"\")})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t=\"GEOGRAPHIC\"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{o(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on(\"layerview-create\",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await k(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));await this._handleNewRecords(i)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let i=[];for(const n of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(n.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(n.typeName)?.members?.has(n.id)&&i.push(n);if(t){const e=new Set,t=[];for(const a of i)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)this.dataManager.memberIdTypeLookup.has(a)&&t.push({id:a,typeName:this.dataManager.memberIdTypeLookup.get(a)});i=i.concat(t)}this.dataManager.removeFromLayer(i);for(const n of i)this.sublayerIdsCache.get(n.typeName)?.delete(n.id),this.linkChartDiagramLookup.delete(n.id);a&&await this.calculateLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor});const o=[];return this.layers.forEach((e=>{o.push(e.refreshCachedQueryEngine())})),await Promise.all(o),this._refreshNamedTypes(),i}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),a=t.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(t),{records:a}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:\"relationship\",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new g({objectType:e,parentCompositeLayer:this,graphType:\"entity\",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=S(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof c)this.linkChartDiagramLookup.set(e.id,e.linkChartLocation),2===e.linkChartLocation.coords.length&&0===e.linkChartLocation.lengths.length?this.linkChartGeohashLookup.set(e.id,r(e.linkChartLocation.coords[1],e.linkChartLocation.coords[0],f)):this.linkChartGeohashLookup.set(e.id,\"\");else{const t=l(e.linkChartLocation);this.linkChartDiagramLookup.set(e.id,e.linkChartLocation?t:null),\"x\"in e.linkChartLocation&&\"y\"in e.linkChartLocation?this.linkChartGeohashLookup.set(e.id,r(e.linkChartLocation.x,e.linkChartLocation.y,f)):this.linkChartGeohashLookup.set(e.id,\"\")}}))}))}async calculateLinkChartLayout(e=\"RADIAL_TREE\",t){const o=[],n=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{o.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{n.push({typeName:t,feature:e})}))})),this.linkChartDiagramLookup=new Map;const s=new Map,h=new Map,c=new Map,d=new Map,g=new Uint8Array(o.length),k=new Float64Array(o.length),C=new Float64Array(o.length),L=new Uint32Array(n.length),N=new Uint32Array(n.length),I=[],R=\"FORCE_DIRECTED\",S=t?.xScaleFactor??1,j=t?.yScaleFactor??1,P=new _({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let F,z=\"FORCE_DIRECTED\",O=0,U=0;switch(z=\"GEOGRAPHIC\"===e?R:e,z){case\"FORCE_DIRECTED\":F=E.apply;break;case\"COMMUNITY\":F=D.apply;break;case\"HIERARCHICAL\":F=x.apply;break;case\"RADIAL_TREE\":F=w.apply;break;case\"SMART_TREE\":F=b.apply;break;default:F=M.apply}o.forEach((({typeName:a,feature:i})=>{if(t?.lockedNodeLocations?.has(i.attributes[p])){\"GEOGRAPHIC\"===e&&this.dataManager.geographicLookup.has(a)?g[O]=T.IsGeographic:g[O]=T.None;const o=t.lockedNodeLocations.get(i.attributes[p]);k[O]=o.x,C[O]=o.y}else if(\"GEOGRAPHIC\"===e&&this.dataManager.geographicLookup.has(a)){g[O]=T.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],o=this.dataManager.geographicLookup.get(a)?.geometryType;switch(o){case\"esriGeometryPoint\":k[O]=t?.x,C[O]=t?.y;break;case\"esriGeometryPolygon\":e=t?.centroid,null!=e?.x&&null!=e?.y?(k[O]=e.x,C[O]=e.y):g[O]=T.IsMovable;break;case\"esriGeometryPolyline\":case\"esriGeometryMultipoint\":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(k[O]=e.x,C[O]=e.y):g[O]=T.IsMovable;break;default:g[O]=T.IsMovable}(null==k[O]||null==C[O]||Number.isNaN(k[O])||Number.isNaN(C[O]))&&(g[O]=T.IsMovable,k[O]=0,C[O]=0)}else g[O]=T.IsMovable,k[O]=0,C[O]=0;d.set(i.attributes[p],O),I[O]={feature:i,typeName:a},O++}));let Q=!1;n.forEach((e=>{const t=d.get(e.feature.attributes[u]),a=d.get(e.feature.attributes[y]);void 0!==t&&void 0!==a?(L[U]=t,N[U]=a,U++):(Q=!0,this.linkChartDiagramLookup.set(e.feature.attributes[u],null),this.linkChartGeohashLookup.set(e.feature.attributes[u],null))})),Q&&i.getLogger(this).warn(\"A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null\"),await G();if(!F(g,k,C,L,N))throw new a(\"knowledge-graph:layout-failed\",\"Attempting to arrange the records in the specified layout failed\");for(let a=0;a84.9999&&(C[a]=84.9999),C[a]<-84.9999&&(C[a]=-84.9999),k[a]>179.9999&&(k[a]=179.9999),k[a]<-179.9999&&(k[a]=-179.9999),I[a].feature.attributes[m]=new A(k[a],C[a]),s.has(I[a].typeName)){const e=s.get(I[a].typeName);e?.set(I[a].feature.attributes[p],I[a].feature)}else{const e=new Map;e.set(I[a].feature.attributes[p],I[a].feature),s.set(I[a].typeName,e)}c.set(I[a].feature.attributes[p],I[a].feature);const e=l(I[a].feature.attributes[m]);this.linkChartDiagramLookup.set(I[a].feature.attributes[p],I[a].feature.attributes[m]?e:null),this.linkChartGeohashLookup.set(I[a].feature.attributes[p],r(I[a].feature.attributes[m].y,I[a].feature.attributes[m].x,f)),I[a].feature.attributes[m].xP.xmax&&(P.xmax=I[a].feature.attributes[m].x),I[a].feature.attributes[m].yP.ymax&&(P.ymax=I[a].feature.attributes[m].y)}return this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,n.forEach((e=>{const t=I[d.get(e.feature.attributes[u])]?.feature.attributes[m],a=I[d.get(e.feature.attributes[y])]?.feature.attributes[m];if(!t||!a)return;const i=new v({paths:[[t.x,t.y],[a.x,a.y]]});if(e.feature.attributes[m]=i,h.has(e.typeName)){const t=h.get(e.typeName);t?.set(e.feature.attributes[p],e.feature)}else{const t=new Map;t.set(e.feature.attributes[p],e.feature),h.set(e.typeName,t)}c.set(e.feature.attributes[p],e.feature);const o=l(e.feature.attributes[m]);this.linkChartDiagramLookup.set(e.feature.attributes[p],e.feature.attributes[m]?o:null),this.linkChartGeohashLookup.set(e.feature.attributes[p],\"\")})),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:S,yScaleFactor:j},{nodes:s,links:h,idMap:c}}async applyNewLinkChartLayout(e=\"RADIAL_TREE\",t){const a=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const o=t.id;a&&(i=\"x\"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(o,new A({x:i.x,y:i.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(t).keys()));Array.from(e.members.keys()).filter((e=>!a.has(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t)if(this._graphTypeLookup.has(a)){const e=this._graphTypeLookup.get(a),t=\"endPoints\"in e?\"relationship\":\"entity\",i=new g({objectType:e,parentCompositeLayer:this,graphType:t,title:a});\"entity\"===t?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.set(a,new Map)}await this.dataManager.refreshCacheContent(e.map((e=>e.id))),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e=>{e?.members?.forEach((e=>{const t=e.linkChartLocation;let a;const i=e.id;if(!t)return;a=\"x\"in t?{x:t.x,y:t.y}:{x:t.coords[0],y:t.coords[1]};const o=l(a);this.linkChartDiagramLookup.set(i,o),this.linkChartGeohashLookup.set(i,r(a.x,a.y,f)),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmaxa.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.linkChartDiagramLookup.get(e.attributes[u]),a=this.linkChartDiagramLookup.get(e.attributes[y]);if(t&&a){const i=l(new v({paths:[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]}));this.linkChartDiagramLookup.set(e.attributes[p],i)}else this.linkChartDiagramLookup.set(e.attributes[p],null);this.linkChartGeohashLookup.set(e.attributes[p],\"\")}))}))):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout(\"RADIAL_TREE\",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit(\"refresh\",{dataChanged:!0});for(const e of this.tables)e.emit(\"refresh\",{dataChanged:!0})}};e([n()],j.prototype,\"dataPreloadedInLocalCache\",void 0),e([n()],j.prototype,\"defaultLinkChartConfig\",void 0),e([n()],j.prototype,\"dataManager\",void 0),e([n()],j.prototype,\"knowledgeGraph\",void 0),e([n()],j.prototype,\"layers\",void 0),e([n()],j.prototype,\"linkChartDiagramLookup\",void 0),e([n()],j.prototype,\"linkChartExtent\",void 0),e([n()],j.prototype,\"linkChartGeohashLookup\",void 0),e([n()],j.prototype,\"memberEntityTypes\",void 0),e([n()],j.prototype,\"memberRelationshipTypes\",void 0),e([n()],j.prototype,\"sublayerIdsCache\",void 0),e([n()],j.prototype,\"tables\",void 0),e([n({json:{read:!1}})],j.prototype,\"type\",void 0),j=e([s(\"esri.layers.LinkChartLayer\")],j);const P=j;export{P as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../Graphic.js\";import\"../symbols.js\";import r from\"../core/Collection.js\";import o from\"../core/Error.js\";import{clone as i}from\"../core/lang.js\";import{MultiOriginJSONMixin as l}from\"../core/MultiOriginJSONSupport.js\";import{setDeepValue as n}from\"../core/object.js\";import a from\"../core/Warning.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{reader as p}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as y}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as m}from\"../core/accessorSupport/decorators/writer.js\";import{projectOrLoad as u,canProjectWithoutEngine as c,isLoaded as f,load as d,project as g}from\"../geometry/projection.js\";import{empty as b,expand as S,equals as h,toExtent as O,negativeInfinity as w}from\"../geometry/support/aaBoundingRect.js\";import{normalizeCentralMeridian as j}from\"../geometry/support/normalizeUtils.js\";import{equals as N}from\"../geometry/support/spatialReferenceUtils.js\";import L from\"./FeatureLayer.js\";import x from\"./GraphicsLayer.js\";import J from\"./Layer.js\";import{findLastObjectIdFromFeatures as T}from\"./graphics/objectIdUtils.js\";import{BlendLayer as v}from\"./mixins/BlendLayer.js\";import{OperationalLayer as C}from\"./mixins/OperationalLayer.js\";import{PortalLayer as M}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as I}from\"./mixins/ScaleRangeLayer.js\";import R from\"./support/Field.js\";import E from\"../symbols/SimpleFillSymbol.js\";import D from\"../symbols/SimpleLineSymbol.js\";import _ from\"../symbols/SimpleMarkerSymbol.js\";import G from\"../symbols/TextSymbol.js\";import P from\"../geometry/SpatialReference.js\";import F from\"../geometry/Extent.js\";function B(e){return\"markup\"===e.featureCollectionType||e.layers.some((e=>null!=e.layerDefinition.visibilityField||!k(e)))}function k({layerDefinition:e,featureSet:t}){const r=e.geometryType??t.geometryType;return $.find((t=>r===t.geometryTypeJSON&&e.drawingInfo?.renderer?.symbol?.type===t.identifyingSymbol.type))}function z(){return new F({xmin:-180,ymin:-90,xmax:180,ymax:90})}const U=new R({name:\"OBJECTID\",alias:\"OBJECTID\",type:\"oid\",nullable:!1,editable:!1}),W=new R({name:\"title\",alias:\"Title\",type:\"string\",nullable:!0,editable:!0,length:255});let A=class extends x{constructor(e){super(e),this.visibilityMode=\"inherited\"}initialize(){for(const e of this.graphics)e.sourceLayer=this.layer;this.graphics.on(\"after-add\",(e=>{e.item.sourceLayer=this.layer})),this.graphics.on(\"after-remove\",(e=>{e.item.sourceLayer=null}))}get fullExtent(){const e=this.layer?.spatialReference,t=this.fullBounds;return e?null==t?u(z(),e).geometry:O(t,e):null}get fullBounds(){const e=this.layer?.spatialReference;if(!e)return null;const t=b();return this.graphics.forEach((r=>{const o=null!=r.geometry?u(r.geometry,e).geometry:null;null!=o&&S(t,\"point\"===o.type?o:o.extent,t)})),h(t,w)?null:t}get sublayers(){return this.graphics}};e([s({readOnly:!0})],A.prototype,\"fullExtent\",null),e([s({readOnly:!0})],A.prototype,\"fullBounds\",null),e([s({readOnly:!0})],A.prototype,\"sublayers\",null),e([s()],A.prototype,\"layer\",void 0),e([s()],A.prototype,\"layerId\",void 0),e([s({readOnly:!0})],A.prototype,\"visibilityMode\",void 0),A=e([y(\"esri.layers.MapNotesLayer.MapNotesSublayer\")],A);const $=[{geometryType:\"polygon\",geometryTypeJSON:\"esriGeometryPolygon\",id:\"polygonLayer\",layerId:0,title:\"Polygons\",identifyingSymbol:(new E).toJSON()},{geometryType:\"polyline\",geometryTypeJSON:\"esriGeometryPolyline\",id:\"polylineLayer\",layerId:1,title:\"Polylines\",identifyingSymbol:(new D).toJSON()},{geometryType:\"multipoint\",geometryTypeJSON:\"esriGeometryMultipoint\",id:\"multipointLayer\",layerId:2,title:\"Multipoints\",identifyingSymbol:(new _).toJSON()},{geometryType:\"point\",geometryTypeJSON:\"esriGeometryPoint\",id:\"pointLayer\",layerId:3,title:\"Points\",identifyingSymbol:(new _).toJSON()},{geometryType:\"point\",geometryTypeJSON:\"esriGeometryPoint\",id:\"textLayer\",layerId:4,title:\"Text\",identifyingSymbol:(new G).toJSON()}];let q=class extends(v(I(C(M(l(J)))))){constructor(e){super(e),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType=\"notes\",this.legendEnabled=!1,this.listMode=\"hide-children\",this.minScale=0,this.maxScale=0,this.spatialReference=P.WGS84,this.sublayers=new r($.map((e=>new A({id:e.id,layerId:e.layerId,title:e.title,layer:this})))),this.title=\"Map Notes\",this.type=\"map-notes\",this.visibilityMode=\"inherited\"}readCapabilities(e,t,r){return{operations:{supportsMapNotesEditing:!B(t)&&\"portal-item\"!==r?.origin}}}readFeatureCollections(e,t,o){if(!B(t))return null;const i=t.layers.map((e=>{const t=new L;return t.read(e,o),t}));return new r({items:i})}readLegacyfeatureCollectionJSON(e,t){return B(t)?i(t.featureCollection):null}get fullExtent(){const e=this.spatialReference,t=b();if(null!=this.sublayers)this.sublayers.forEach((({fullBounds:e})=>null!=e?S(t,e,t):t),t);else if(this.featureCollectionJSON?.layers.some((e=>e.layerDefinition.extent))){this.featureCollectionJSON.layers.forEach((r=>{const o=u(r.layerDefinition.extent,e).geometry;null!=o&&S(t,o,t)}))}return h(t,w)?u(z(),e).geometry:O(t,e)}readMinScale(e,t){for(const r of t.layers)if(null!=r.layerDefinition.minScale)return r.layerDefinition.minScale;return 0}readMaxScale(e,t){for(const r of t.layers)if(null!=r.layerDefinition.maxScale)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer(\"multipointLayer\")}get pointLayer(){return this._findSublayer(\"pointLayer\")}get polygonLayer(){return this._findSublayer(\"polygonLayer\")}get polylineLayer(){return this._findSublayer(\"polylineLayer\")}readSpatialReference(e,t){return t.layers.length?P.fromJSON(t.layers[0].layerDefinition.spatialReference):P.WGS84}readSublayers(e,o,i){if(B(o))return null;const l=[];let n=o.layers.reduce(((e,t)=>Math.max(e,t.layerDefinition.id??-1)),-1)+1;for(const r of o.layers){const{layerDefinition:e,featureSet:o}=r,i=e.id??n++,a=k(r);if(null!=a){const r=new A({id:a.id,title:e.name,layerId:i,layer:this,graphics:o.features.map((({geometry:e,symbol:r,attributes:o,popupInfo:i})=>t.fromJSON({attributes:o,geometry:e,symbol:r,popupTemplate:i})))});l.push(r)}}return new r(l)}writeSublayers(e,t,r,i){const{minScale:l,maxScale:a}=this;if(null==e)return;const s=e.some((e=>e.graphics.length>0));if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new o(\"map-notes-layer:editing-not-supported\",\"New map notes cannot be added to this layer\")));const p=[];let y=this.spatialReference.toJSON();e:for(const o of e)for(const e of o.graphics)if(null!=e.geometry){y=e.geometry.spatialReference.toJSON();break e}for(const o of $){const t=e.find((e=>o.id===e.id));this._writeMapNoteSublayer(p,t,o,l,a,y,i)}n(\"featureCollection.layers\",p,t)}get textLayer(){return this._findSublayer(\"textLayer\")}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Feature Collection\"]},e)),Promise.resolve(this)}read(e,t){\"featureCollection\"in e&&(e=i(e),Object.assign(e,e.featureCollection)),super.read(e,t)}async beforeSave(){if(null==this.sublayers)return;let e=null;const t=[];for(const o of this.sublayers)for(const r of o.graphics)if(null!=r.geometry){const o=r.geometry;e?N(o.spatialReference,e)||(c(o.spatialReference,e)||f()||await d(),r.geometry=g(o,e)):e=o.spatialReference,t.push(r)}const r=await j(t.map((e=>e.geometry)));t.forEach(((e,t)=>e.geometry=r[t]))}_findSublayer(e){return null==this.sublayers?null:this.sublayers?.find((t=>t.id===e))??null}_writeMapNoteSublayer(e,t,r,o,l,n,a){const s=[];if(null!=t){for(const e of t.graphics)this._writeMapNote(s,e,r.geometryType,a);this._normalizeObjectIds(s,U),e.push({layerDefinition:{name:t.title,drawingInfo:{renderer:{type:\"simple\",symbol:i(r.identifyingSymbol)}},id:t.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:\"OBJECTID\",fields:[U.toJSON(),W.toJSON()],spatialReference:n},featureSet:{features:s,geometryType:r.geometryTypeJSON}})}}_writeMapNote(e,t,r,o){if(null==t)return;const{geometry:i,symbol:l,popupTemplate:n}=t;if(null==i)return;if(i.type!==r)return void o?.messages?.push(new a(\"map-notes-layer:invalid-geometry-type\",`Geometry \"${i.type}\" cannot be saved in \"${r}\" layer`,{graphic:t}));if(null==l)return void o?.messages?.push(new a(\"map-notes-layer:no-symbol\",\"Skipping map notes with no symbol\",{graphic:t}));const s={attributes:{...t.attributes},geometry:i.toJSON(),symbol:l.toJSON()};null!=n&&(s.popupInfo=n.toJSON()),e.push(s)}_normalizeObjectIds(e,t){const r=t.name;let o=T(r,e)+1;const i=new Set;for(const l of e){l.attributes||(l.attributes={});const{attributes:e}=l;(null==e[r]||i.has(e[r]))&&(e[r]=o++),i.add(e[r])}}};e([s({readOnly:!0})],q.prototype,\"capabilities\",void 0),e([p([\"portal-item\",\"web-map\"],\"capabilities\",[\"layers\"])],q.prototype,\"readCapabilities\",null),e([s({readOnly:!0})],q.prototype,\"featureCollections\",void 0),e([p([\"web-map\",\"portal-item\"],\"featureCollections\",[\"layers\"])],q.prototype,\"readFeatureCollections\",null),e([s({readOnly:!0,json:{origins:{\"web-map\":{write:{enabled:!0,target:\"featureCollection\"}}}}})],q.prototype,\"featureCollectionJSON\",void 0),e([p([\"web-map\",\"portal-item\"],\"featureCollectionJSON\",[\"featureCollection\"])],q.prototype,\"readLegacyfeatureCollectionJSON\",null),e([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],q.prototype,\"featureCollectionType\",void 0),e([s({readOnly:!0})],q.prototype,\"fullExtent\",null),e([s({readOnly:!0,json:{origins:{\"web-map\":{write:{target:\"featureCollection.showLegend\",overridePolicy(){return{enabled:null!=this.featureCollectionJSON}}}}}}})],q.prototype,\"legendEnabled\",void 0),e([s({type:[\"show\",\"hide\",\"hide-children\"]})],q.prototype,\"listMode\",void 0),e([s({type:Number,nonNullable:!0,json:{write:!1}})],q.prototype,\"minScale\",void 0),e([p([\"web-map\",\"portal-item\"],\"minScale\",[\"layers\"])],q.prototype,\"readMinScale\",null),e([s({type:Number,nonNullable:!0,json:{write:!1}})],q.prototype,\"maxScale\",void 0),e([p([\"web-map\",\"portal-item\"],\"maxScale\",[\"layers\"])],q.prototype,\"readMaxScale\",null),e([s({readOnly:!0})],q.prototype,\"multipointLayer\",null),e([s({value:\"ArcGISFeatureLayer\",type:[\"ArcGISFeatureLayer\"]})],q.prototype,\"operationalLayerType\",void 0),e([s({readOnly:!0})],q.prototype,\"pointLayer\",null),e([s({readOnly:!0})],q.prototype,\"polygonLayer\",null),e([s({readOnly:!0})],q.prototype,\"polylineLayer\",null),e([s({type:P})],q.prototype,\"spatialReference\",void 0),e([p([\"web-map\",\"portal-item\"],\"spatialReference\",[\"layers\"])],q.prototype,\"readSpatialReference\",null),e([s({readOnly:!0,json:{origins:{\"web-map\":{write:{ignoreOrigin:!0}}}}})],q.prototype,\"sublayers\",void 0),e([p(\"web-map\",\"sublayers\",[\"layers\"])],q.prototype,\"readSublayers\",null),e([m(\"web-map\",\"sublayers\")],q.prototype,\"writeSublayers\",null),e([s({readOnly:!0})],q.prototype,\"textLayer\",null),e([s()],q.prototype,\"title\",void 0),e([s({readOnly:!0,json:{read:!1}})],q.prototype,\"type\",void 0),q=e([y(\"esri.layers.MapNotesLayer\")],q);const H=q;export{H as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{Clonable as r}from\"../../core/Clonable.js\";import o from\"../../core/Logger.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import\"../../core/Error.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import{projectOrLoad as s}from\"../../geometry/projection.js\";let c=class extends r{projectOrWarn(e,r){if(null==e)return e;const{geometry:t,pending:c}=s(e,r);return c?null:c||t?t:(o.getLogger(this).warn(\"geometry could not be projected to the spatial reference\",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:r}),null)}};c=e([t(\"esri.layers.support.GeoreferenceBase\")],c);const a=c;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import t from\"../../core/Accessor.js\";import r from\"../../core/Error.js\";import{JSONSupportMixin as n}from\"../../core/JSONSupport.js\";import e from\"../../core/Logger.js\";import{transformProjective as i,getProjectiveTransform as s}from\"../../core/perspectiveUtils.js\";import{createScreenPoint as l}from\"../../core/screenUtils.js\";import{property as c}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as a}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as p}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as u}from\"../../core/accessorSupport/decorators/writer.js\";import{d as m}from\"../../chunks/mat3.js\";import{f,a as P}from\"../../chunks/mat3f64.js\";import{s as h,r as y,l as d}from\"../../chunks/vec2.js\";import{a as g,f as j}from\"../../chunks/vec2f64.js\";import w from\"../../geometry/Point.js\";import v from\"../../geometry/Polygon.js\";import{projectOrLoad as R}from\"../../geometry/projection.js\";import x from\"../../geometry/SpatialReference.js\";import S from\"./GeoreferenceBase.js\";const C=P(),T=g();let _=class extends t{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};o([c()],_.prototype,\"sourcePoint\",void 0),o([c({type:w})],_.prototype,\"mapPoint\",void 0),_=o([p(\"esri.layers.support.ControlPoint\")],_);let O=class extends(n(S)){constructor(o){super(o),this.controlPoints=null,this.height=0,this.type=\"control-points\",this.width=0}readControlPoints(o,t){const r=x.fromJSON(t.spatialReference),n=f(...t.coefficients,1);return o.map((o=>(h(T,o.x,o.y),i(T,T,n),{sourcePoint:o,mapPoint:new w({x:T[0],y:T[1],spatialReference:r})})))}writeControlPoints(o,t,n,i){if(null!=this.transform)null!=o&&k(o[0])&&(t.controlPoints=o.map((o=>{const t=o.sourcePoint;return{x:t.x,y:t.y}})),t.spatialReference=o[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const o=new r(\"web-document-write:invalid-georeference\",\"Invalid 'controlPoints', 'width', 'height' configuration.\",{layer:i?.layer,georeference:this});i?.messages?i.messages.push(o):e.getLogger(this).error(o.name,o.message)}}get coords(){if(null==this.controlPoints)return null;const o=this._updateTransform(C);if(null==o||!k(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return K(o,this.width,this.height,t)}set coords(o){if(null==this.controlPoints||!k(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if(null==(o=this.projectOrWarn(o,t)))return;const{width:r,height:n}=this,{rings:[[e,s,c,a]]}=o,p={sourcePoint:l(0,n),mapPoint:new w({x:e[0],y:e[1],spatialReference:t})},u={sourcePoint:l(0,0),mapPoint:new w({x:s[0],y:s[1],spatialReference:t})},m={sourcePoint:l(r,0),mapPoint:new w({x:c[0],y:c[1],spatialReference:t})},f={sourcePoint:l(r,n),mapPoint:new w({x:a[0],y:a[1],spatialReference:t})};k(p)&&k(u)&&k(m)&&k(f)&&(E(C,p,u,m,f),this.controlPoints=this.controlPoints.map((({sourcePoint:o})=>(h(T,o.x,o.y),i(T,T,C),{sourcePoint:o,mapPoint:new w({x:T[0],y:T[1],spatialReference:t})}))))}get inverseTransform(){return null==this.transform?null:m(P(),this.transform)}get transform(){return this._updateTransform()}toMap(o){if(null==o||null==this.transform||null==this.controlPoints||!k(this.controlPoints[0]))return null;h(T,o.x,o.y);const t=this.controlPoints[0].mapPoint.spatialReference;return i(T,T,this.transform),new w({x:T[0],y:T[1],spatialReference:t})}toSource(o){if(null==o||null==this.inverseTransform||null==this.controlPoints||!k(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return o=o.normalize(),null==(o=R(o,t).geometry)?null:(h(T,o.x,o.y),i(T,T,this.inverseTransform),l(T[0],T[1]))}toSourceNormalized(o){const t=this.toSource(o);return null!=t&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(o){const{controlPoints:t,width:r,height:n}=this;if(!(null!=t&&r>0&&n>0))return null;const[e,i,s,l]=t;if(!k(e))return null;const c=e.mapPoint.spatialReference,a=this._projectControlPoint(i,c),p=this._projectControlPoint(s,c),u=this._projectControlPoint(l,c);if(!a.valid||!p.valid||!u.valid)return null;if(!k(a.controlPoint))return null;null==o&&(o=P());let m=null;return m=k(p.controlPoint)&&k(u.controlPoint)?E(o,e,a.controlPoint,p.controlPoint,u.controlPoint):k(p.controlPoint)?B(o,e,a.controlPoint,p.controlPoint):q(o,e,a.controlPoint),m.every((o=>0===o))?null:m}_projectControlPoint(o,t){if(!k(o))return{valid:!0,controlPoint:o};const{sourcePoint:r,mapPoint:n}=o,{geometry:i,pending:s}=R(n,t);return s?{valid:!1,controlPoint:null}:s||i?{valid:!0,controlPoint:{sourcePoint:r,mapPoint:i}}:(e.getLogger(this).warn(\"map point could not be projected to the spatial reference\",{georeference:this,controlPoint:o,sourceSpatialReference:n.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function k(o){return null!=o?.sourcePoint&&null!=o.mapPoint}o([c({type:[_],json:{write:{allowNull:!1,isRequired:!0}}})],O.prototype,\"controlPoints\",void 0),o([a(\"controlPoints\")],O.prototype,\"readControlPoints\",null),o([u(\"controlPoints\")],O.prototype,\"writeControlPoints\",null),o([c()],O.prototype,\"coords\",null),o([c({json:{write:!0}})],O.prototype,\"height\",void 0),o([c({readOnly:!0})],O.prototype,\"inverseTransform\",null),o([c({readOnly:!0})],O.prototype,\"transform\",null),o([c({json:{write:!0}})],O.prototype,\"width\",void 0),O=o([p(\"esri.layers.support.ControlPointsGeoreference\")],O);const N=g(),b=g(),I=g(),M=g(),A=g(),J=g(),L=g(),U=g(),z=Math.PI/2;function G(o,t,r){h(o,r.sourcePoint.x,r.sourcePoint.y),h(t,r.mapPoint.x,r.mapPoint.y)}function q(o,t,r){return G(N,A,t),G(b,J,r),y(I,b,N,z),y(M,N,b,z),y(L,J,A,-z),y(U,A,J,-z),H(o,N,b,I,M,A,J,L,U)}function B(o,t,r,n){return G(N,A,t),G(b,J,r),G(I,L,n),d(M,N,b,.5),y(M,I,M,Math.PI),d(U,A,J,.5),y(U,L,U,Math.PI),H(o,N,b,I,M,A,J,L,U)}function E(o,t,r,n,e){return G(N,A,t),G(b,J,r),G(I,L,n),G(M,U,e),H(o,N,b,I,M,A,J,L,U)}const W=new Array(8).fill(0),D=new Array(8).fill(0);function F(o,t,r,n,e){return o[0]=t[0],o[1]=t[1],o[2]=r[0],o[3]=r[1],o[4]=n[0],o[5]=n[1],o[6]=e[0],o[7]=e[1],o}function H(o,t,r,n,e,i,l,c,a){return s(o,F(W,t,r,n,e),F(D,i,l,c,a))}function K(o,t,r,n){const e=j(0,r),s=j(0,0),l=j(t,0),c=j(t,r);return i(e,e,o),i(s,s,o),i(l,l,o),i(c,c,o),new v({rings:[[e,s,l,c,e]],spatialReference:n})}const Q=O;export{Q as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{getProjectiveTransform as o,transformProjective as e}from\"../../core/perspectiveUtils.js\";import{createScreenPoint as r}from\"../../core/screenUtils.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as n}from\"../../core/accessorSupport/decorators/subclass.js\";import{a as i}from\"../../chunks/mat3f64.js\";import{s as l}from\"../../chunks/vec2.js\";import{a as p}from\"../../chunks/vec2f64.js\";import c from\"../../geometry/Point.js\";import u from\"../../geometry/Polygon.js\";import{projectOrLoad as m}from\"../../geometry/projection.js\";import a from\"./GeoreferenceBase.js\";const f=p();let y=class extends a{constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type=\"corners\"}get coords(){let{topLeft:t,topRight:o,bottomLeft:e,bottomRight:r}=this;if(null==t||null==o||null==e||null==r)return null;const s=t.spatialReference;return o=this.projectOrWarn(o,s),e=this.projectOrWarn(e,s),r=this.projectOrWarn(r,s),null==o||null==e||null==r?null:new u({rings:[[[e.x,e.y],[t.x,t.y],[o.x,o.y],[r.x,r.y],[e.x,e.y]]],spatialReference:s})}set coords(t){const{topLeft:o}=this;if(null==o)return;const e=o.spatialReference;if(null==(t=this.projectOrWarn(t,e)))return;const{rings:[[r,s,n,i]]}=t;this.bottomLeft=new c({x:r[0],y:r[1],spatialReference:e}),this.topLeft=new c({x:s[0],y:s[1],spatialReference:e}),this.topRight=new c({x:n[0],y:n[1],spatialReference:e}),this.bottomRight=new c({x:i[0],y:i[1],spatialReference:e})}toSourceNormalized(t){const{topLeft:s,topRight:n,bottomRight:p,bottomLeft:c}=this;if(null==t||null==s||null==n||null==p||null==c)return null;const u=s.spatialReference;t=t.normalize();const a=m(t,u).geometry;if(null==a)return null;l(f,a.x,a.y);const y=o(i(),[s.x,s.y,c.x,c.y,n.x,n.y,p.x,p.y],[0,0,0,1,1,0,1,1]);return e(f,f,y),r(f[0],f[1])}};t([s()],y.prototype,\"coords\",null),t([s({type:c})],y.prototype,\"bottomLeft\",void 0),t([s({type:c})],y.prototype,\"bottomRight\",void 0),t([s({type:c})],y.prototype,\"topLeft\",void 0),t([s({type:c})],y.prototype,\"topRight\",void 0),y=t([n(\"esri.layers.support.CornersGeoreference\")],y);const h=y;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{rad2deg as e,scale as r}from\"../../core/mathUtils.js\";import{createScreenPoint as o}from\"../../core/screenUtils.js\";import{property as n}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{t as i}from\"../../chunks/common.js\";import a from\"../../geometry/Extent.js\";import c from\"../../geometry/Polygon.js\";import{projectOrLoad as m}from\"../../geometry/projection.js\";import l from\"./GeoreferenceBase.js\";let p=class extends l{constructor(t){super(t),this.extent=null,this.rotation=0,this.type=\"extent-and-rotation\"}get coords(){if(null==this.extent)return null;const{xmin:t,ymin:e,xmax:r,ymax:o,spatialReference:n}=this.extent;let s;if(this.rotation){const{x:n,y:i}=this.extent.center,a=u(n,i,this.rotation);s=[a(t,e),a(t,o),a(r,o),a(r,e)],s.push(s[0])}else s=[[t,e],[t,o],[r,o],[r,e],[t,e]];return new c({rings:[s],spatialReference:n})}set coords(t){if(null==t||null==this.extent)return;const r=this.extent.spatialReference;if(t=this.projectOrWarn(t,r),null==t?.extent)return;const{rings:[[o,n,s]],extent:{center:{x:i,y:c}}}=t,m=e(Math.PI/2-Math.atan2(n[1]-o[1],n[0]-o[0])),l=u(i,c,-m),[p,x]=l(o[0],o[1]),[f,y]=l(s[0],s[1]);this.extent=new a({xmin:p,ymin:x,xmax:f,ymax:y,spatialReference:r}),this.rotation=m}toSourceNormalized(t){const{extent:e,rotation:n}=this;if(null==t||null==e)return null;const{xmin:s,ymin:i,xmax:a,ymax:c,center:l,spatialReference:p}=e;t=t.normalize();const x=m(t,p).geometry;if(null==x)return null;let f=x.x,y=x.y;return n&&([f,y]=u(l.x,l.y,-n)(f,y)),o(r(f,s,a,0,1),r(y,c,i,0,1))}};function u(t,e,r){const o=i(r),n=Math.cos(o),s=Math.sin(o);return(r,o)=>[n*(r-t)+s*(o-e)+t,n*(o-e)-s*(r-t)+e]}t([n()],p.prototype,\"coords\",null),t([n({type:a})],p.prototype,\"extent\",void 0),t([n({type:Number})],p.prototype,\"rotation\",void 0),p=t([s(\"esri.layers.support.ExtentAndRotationGeoreference\")],p);const x=p;export{x as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{NumericIdentifiableMixin as r}from\"../../core/Identifiable.js\";import{JSONSupportMixin as o}from\"../../core/JSONSupport.js\";import t from\"../../core/Loadable.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as n}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./ControlPointsGeoreference.js\";import i from\"./CornersGeoreference.js\";import a from\"./ExtentAndRotationGeoreference.js\";import m from\"./GeoreferenceBase.js\";const l={key:\"type\",base:m,typeMap:{\"control-points\":p,corners:i,\"extent-and-rotation\":a}};let u=class extends(r(o(t))){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return p.fromJSON(e)}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:r,contentWidth:o,contentHeight:t}=this;if(null==e||null==r||0===o||0===t)return null;const s=r.toSourceNormalized(e);return null==s?null:(s.x*=o,s.y*=t,s)}};e([s({types:l,json:{write:!0}})],u.prototype,\"georeference\",void 0),e([n(\"georeference\")],u.prototype,\"readGeoreference\",null),e([s()],u.prototype,\"opacity\",void 0),u=e([c(\"esri.layers.support.MediaElementBase\")],u);const f=u;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import e from\"../../request.js\";import r from\"../../core/Error.js\";import{getImageData as o}from\"../../core/imageUtils.js\";import{isDataProtocol as n,isBlobProtocol as i,isAbsolute as s,dataToBlob as a,join as l}from\"../../core/urlUtils.js\";import{generateUUID as m}from\"../../core/uuid.js\";import{property as c}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as p}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as u}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as h}from\"../../core/accessorSupport/decorators/writer.js\";import d from\"./MediaElementBase.js\";import{getResourceContentExtension as g}from\"../../portal/support/resourceExtension.js\";import{f,t as y,i as v,M as j}from\"../../chunks/persistableUrlUtils.js\";let I=class extends d{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type=\"image\",this.image=null}load(){const t=this.image;if(\"string\"==typeof t){const e=o(t).then((t=>{this._set(\"content\",t)}));this.addResolvingPromise(e)}else if(t instanceof HTMLImageElement){const e=t.decode().then((()=>{this._set(\"content\",t)}));this.addResolvingPromise(e)}else t?this._set(\"content\",t):this.addResolvingPromise(Promise.reject(new r(\"image-element:invalid-image-type\",\"Invalid image type\",{image:t})));return Promise.resolve(this)}get contentWidth(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(t,e,r){return f(e.url,r)}writeImage(t,e,r,o){if(null==t)return;const a=o?.portalItem,l=o?.resources;if(!a||!l)return void(\"string\"==typeof t&&(e[r]=y(t,o)));const m=\"string\"!=typeof t||n(t)||i(t)?null:t;if(m){if(null==v(m))return void(e[r]=m);const t=y(m,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},j.NO);if(a&&t&&!s(t))return l.toKeep.push({resource:a.resourceFromPath(t),compress:!1}),void(e[r]=t)}e[r]=\"\",l.pendingOperations.push(w(t).then((t=>{const o=H(t,a);e[r]=o.itemRelativeUrl,l.toAdd.push({resource:o,content:{type:\"blob\",blob:t},compress:!1,finish:t=>{this.image=t.url}})})))}};t([c()],I.prototype,\"animationOptions\",void 0),t([c({readOnly:!0})],I.prototype,\"content\",void 0),t([c({readOnly:!0})],I.prototype,\"contentWidth\",null),t([c({readOnly:!0})],I.prototype,\"contentHeight\",null),t([c({json:{name:\"url\",type:String}})],I.prototype,\"image\",void 0),t([p(\"image\",[\"url\"])],I.prototype,\"readImage\",null),t([h(\"image\")],I.prototype,\"writeImage\",null),t([c({readOnly:!0,json:{name:\"mediaType\"}})],I.prototype,\"type\",void 0),I=t([u(\"esri.layers.support.ImageElement\")],I);const b=I;async function w(t){if(\"string\"==typeof t){if(n(t))return a(t);return(await e(t,{responseType:\"blob\"})).data}return new Promise((e=>E(t).toBlob(e)))}function E(t){if(t instanceof HTMLCanvasElement)return t;const e=t instanceof HTMLImageElement?t.naturalWidth:t.width,r=t instanceof HTMLImageElement?t.naturalHeight:t.height,o=document.createElement(\"canvas\"),n=o.getContext(\"2d\");return o.width=e,o.height=r,t instanceof HTMLImageElement?n.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&n.putImageData(t,0,0),o}function H(t,e){const r=m(),o=`${l(\"media\",r)}.${g({type:\"blob\",blob:t})}`;return e.resourceFromPath(o)}export{b as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import o from\"../../core/Error.js\";import{once as t}from\"../../core/events.js\";import s from\"../../core/Logger.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import n from\"./MediaElementBase.js\";let a=class extends n{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type=\"video\"}load(){const e=this.video;if(\"string\"==typeof e){const o=document.createElement(\"video\");o.src=e,o.crossOrigin=\"anonymous\",o.autoplay=!0,o.muted=!0,o.loop=!0,this.addResolvingPromise(this._loadVideo(o).then((()=>{this._set(\"content\",o)})))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set(\"content\",e)}))):this.addResolvingPromise(Promise.reject(new o(\"video-element:invalid-video-type\",\"Invalid video type\",{video:e})));return Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){\"not-loaded\"===this.loadStatus?this._set(\"video\",e):s.getLogger(this).error(\"#video\",\"video cannot be changed after the element is loaded.\")}_loadVideo(e){return new Promise(((o,s)=>{const r=t(e,\"canplay\",(()=>{this.removeHandles(\"canplay\"),this.autoplay?e.play().then(o,s):o()}));this.addHandles(r,\"canplay\"),\"anonymous\"!==e.crossOrigin&&(e.crossOrigin=\"anonymous\",e.src?.includes(\"blob:\")||(e.src=e.src))}))}};e([r()],a.prototype,\"autoplay\",void 0),e([r({readOnly:!0})],a.prototype,\"content\",void 0),e([r({readOnly:!0})],a.prototype,\"contentWidth\",null),e([r({readOnly:!0})],a.prototype,\"contentHeight\",null),e([r()],a.prototype,\"video\",null),a=e([i(\"esri.layers.support.VideoElement\")],a);const d=a;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import t from\"../../core/Collection.js\";import{referenceSetter as s}from\"../../core/collectionUtils.js\";import r from\"../../core/Evented.js\";import o from\"../../core/Loadable.js\";import n from\"../../core/Logger.js\";import{EsriPromiseMixin as i}from\"../../core/Promise.js\";import{throwIfAborted as a}from\"../../core/promiseUtils.js\";import{watch as l}from\"../../core/reactiveUtils.js\";import{property as m}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"../../geometry/Extent.js\";import{initializeProjection as d,project as h}from\"../../geometry/projection.js\";import{fromExtent as f}from\"../../geometry/support/aaBoundingRect.js\";import{extentIntersectsPolygon as u}from\"../../geometry/support/intersectsBase.js\";import{equals as g}from\"../../geometry/support/spatialReferenceUtils.js\";import{BoundsStore as _}from\"../graphics/data/BoundsStore.js\";import x from\"./ImageElement.js\";import y from\"./MediaElementBase.js\";import{MediaElementView as j}from\"./MediaElementView.js\";import R from\"./VideoElement.js\";import E from\"../../geometry/SpatialReference.js\";const w={key:\"type\",defaultKeyValue:\"image\",base:y,typeMap:{image:x,video:R}},M=t.ofType(w);let I=class extends(o.LoadableMixin(i(r.EventedAccessor))){constructor(e){super(e),this._index=new _,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=e=>{for(const s of e.removed){const e=this._elementViewsMap.get(s);this._elementViewsMap.delete(s),this._index.delete(e),this.removeHandles(e),e.destroy(),this.notifyChange(\"fullExtent\")}const{spatialReference:t}=this;for(const s of e.added){if(this._elementViewsMap.get(s))continue;const e=new j({spatialReference:t,element:s});this._elementViewsMap.set(s,e);const r=l((()=>e.coords),(()=>this._updateIndexForElement(e,!1)));this._updateIndexForElement(e,!0),this.addHandles(r,e)}this._elementsIndexes.clear(),this.elements.forEach(((e,t)=>this._elementsIndexes.set(e,t))),this.emit(\"refresh\")},this.elements=new M}async load(e){if(a(e),!this.spatialReference){const e=this.elements.find((e=>null!=e.georeference?.coords));this._set(\"spatialReference\",e?e.georeference.coords.spatialReference:E.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on(\"change\",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set(\"elements\",s(e,this._get(\"elements\"),M))}get fullExtent(){if(\"not-loaded\"===this.loadStatus)return null;const e=this._index.fullBounds;return null==e?null:new p({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){\"not-loaded\"===this.loadStatus?this._set(\"spatialReference\",e):n.getLogger(this).error(\"#spatialReference\",\"spatialReference cannot be changed after the source is loaded.\")}async queryElements(e,t){await this.load(),await d(e.spatialReference,this.spatialReference,null,t);const s=g(e.spatialReference,this.spatialReference)?e:h(e,this.spatialReference);if(!s)return[];const r=s.normalize(),o=[];for(const n of r)this._index.forEachInBounds(f(n),(({normalizedCoords:e,element:t})=>{null!=e&&u(n,e)&&o.push(t)}));return o.sort(((e,t)=>this._elementsIndexes.get(e)-this._elementsIndexes.get(t))),o}_updateIndexForElement(e,t){const s=e.normalizedBounds,r=this._index.has(e),o=null!=s;this._index.delete(e),o&&this._index.set(e,s),this.notifyChange(\"fullExtent\"),t||(r!==o?this.emit(\"refresh\"):this.emit(\"change\",{element:e.element}))}};e([m()],I.prototype,\"elements\",null),e([m({readOnly:!0})],I.prototype,\"fullExtent\",null),e([m()],I.prototype,\"spatialReference\",null),I=e([c(\"esri.layers.support.LocalMediaElementSource\")],I);const S=I;export{S as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Collection.js\";import o from\"../core/Error.js\";import t from\"../core/Logger.js\";import{MultiOriginJSONMixin as s}from\"../core/MultiOriginJSONSupport.js\";import{property as i}from\"../core/accessorSupport/decorators/property.js\";import{cast as a}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as p}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as l}from\"../core/accessorSupport/decorators/writer.js\";import n from\"./Layer.js\";import{BlendLayer as u}from\"./mixins/BlendLayer.js\";import{OperationalLayer as m}from\"./mixins/OperationalLayer.js\";import{ScaleRangeLayer as d}from\"./mixins/ScaleRangeLayer.js\";import y from\"./support/ImageElement.js\";import f from\"./support/LocalMediaElementSource.js\";import h from\"./support/VideoElement.js\";function S(e){return\"object\"==typeof e&&null!=e&&\"type\"in e}let g=class extends(u(d(m(s(n))))){constructor(e){super(e),this.effectiveSource=null,this.copyright=null,this.operationalLayerType=\"MediaLayer\",this.spatialReference=null,this.type=\"media\",this.source=new f}load(e){const t=this.source;if(!t)return this.addResolvingPromise(Promise.reject(new o(\"media-layer:source-missing\",\"Set 'MediaLayer.source' before loading the layer.\"))),Promise.resolve(this);const s=S(t)?new f({elements:new r([t])}):t;this._set(\"effectiveSource\",s),this.spatialReference&&(s.spatialReference=this.spatialReference);const i=s.load(e).then((()=>{this.spatialReference=s.spatialReference}));return this.addResolvingPromise(i),Promise.resolve(this)}destroy(){this.effectiveSource?.destroy(),this.source?.destroy()}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){\"not-loaded\"===this.loadStatus?this._set(\"source\",e):t.getLogger(this).error(\"#source\",\"source cannot be changed after the layer is loaded.\")}castSource(e){return e?Array.isArray(e)?new f({elements:new r(e)}):e instanceof r?new f({elements:e}):e:null}readSource(e,r,o){const t=\"image\"===r.mediaType?new y:\"video\"===r.mediaType?new h:null;return t?.read(r,o),t}writeSource(e,r,t,s){e&&S(e)&&\"image\"===e.type?e.write(r,s):s?.messages&&s?.messages?.push(new o(\"media-layer:unsupported-source\",\"source must be an 'ImageElement'\"))}};e([i({readOnly:!0})],g.prototype,\"effectiveSource\",void 0),e([i({type:String})],g.prototype,\"copyright\",void 0),e([i({readOnly:!0})],g.prototype,\"fullExtent\",null),e([i({type:[\"MediaLayer\"]})],g.prototype,\"operationalLayerType\",void 0),e([i({type:[\"show\",\"hide\"]})],g.prototype,\"listMode\",void 0),e([i({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1}}})],g.prototype,\"source\",null),e([a(\"source\")],g.prototype,\"castSource\",null),e([p(\"source\",[\"url\"])],g.prototype,\"readSource\",null),e([l(\"source\")],g.prototype,\"writeSource\",null),e([i()],g.prototype,\"spatialReference\",void 0),e([i({readOnly:!0})],g.prototype,\"type\",void 0),g=e([c(\"esri.layers.MediaLayer\")],g);const j=g;export{j as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import t from\"../../../core/Error.js\";import s from\"../../../core/Loadable.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as o}from\"../../../core/accessorSupport/decorators/subclass.js\";import{queryFeatureSetJSON as p,crsDefault as i,getSpatialReferenceWkid as a,getServerLandingPage as u,getServerConformance as n,getServerCollections as c,getServerOpenApi as l,getCollectionDefinition as d,crsPrefix as m}from\"../../ogc/ogcFeatureUtils.js\";import y from\"../../../rest/support/FeatureSet.js\";import f from\"../../../geometry/SpatialReference.js\";import{typeKebabDictionary as g}from\"../../../geometry/support/typeUtils.js\";let h=class extends s{constructor(){super(...arguments),this.featureDefinition=null,this.type=\"ogc-feature\"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:r},layer:{apiKey:o,customParameters:p,effectiveMaxRecordCount:i}}=this;return{type:\"ogc-source\",collection:e,layerDefinition:t,maxRecordCount:i,queryParameters:{apiKey:o,customParameters:p},spatialReference:s,supportedCrs:r}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then((e=>y.fromJSON(e)))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then((()=>p(s,e,t)))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const s=new RegExp(`^${t}$`,\"i\");return e.conformsTo.some((e=>s.test(e)))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const t=e?.components?.parameters;return t?.limit?.schema?.maximum??t?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const t=e.storageCrs??i,s=a(t);return null==s?f.WGS84:new f({wkid:s})}_getSupportedSpatialReferences(e,t){const s=\"#/crs\",r=e.crs??[i],o=r.includes(s)?r.filter((e=>e!==s)).concat(t.crs??[]):r,p=/^http:\\/\\/www\\.opengis.net\\/def\\/crs\\/epsg\\/.*\\/3785$/i;return o.filter((e=>!p.test(e)))}async _loadOGCServices(e,s){const r=null!=s?s.signal:null,{apiKey:o,collectionId:p,customParameters:i,fields:y,geometryType:f,hasZ:h,objectIdField:S,timeInfo:C,url:R}=e,w={fields:y?.map((e=>e.toJSON())),geometryType:g.toJSON(f),hasZ:h??!1,objectIdField:S,timeInfo:C?.toJSON()},x={apiKey:o,customParameters:i,signal:r},j=await u(R,x),[v,F]=await Promise.all([n(j,x),c(j,x)]);if(!this._conformsToType(v,\"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson\"))throw new t(\"ogc-feature-layer:no-geojson-support\",\"Server does not support geojson\");const O=F.collections.find((e=>e.id===p));if(!O)throw new t(\"ogc-feature-layer:collection-not-found\",\"Server does not contain the named collection\");const D=this._conformsToType(v,\"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30\")?await l(j,x):null,T=await d(O,w,x),A=this._getMaxRecordCount(D),_=this._getCapabilities(T.hasZ,A),P=this._getStorageSpatialReference(O).toJSON(),b=this._getSupportedSpatialReferences(O,F),q=new RegExp(`^${m}`,\"i\"),E={};for(const t of b){const e=a(t);null!=e&&(E[e]||(E[e]=t.replace(q,\"\")))}this.featureDefinition={capabilities:_,collection:O,layerDefinition:T,spatialReference:P,supportedCrs:E}}};e([r()],h.prototype,\"featureDefinition\",void 0),e([r({constructOnly:!0})],h.prototype,\"layer\",void 0),e([r()],h.prototype,\"type\",void 0),h=e([o(\"esri.layers.graphics.sources.OGCFeatureSource\")],h);export{h as OGCFeatureSource};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import r from\"../PopupTemplate.js\";import\"../renderers/ClassBreaksRenderer.js\";import\"../renderers/DictionaryRenderer.js\";import\"../renderers/DotDensityRenderer.js\";import\"../renderers/HeatmapRenderer.js\";import\"../renderers/PieChartRenderer.js\";import\"../renderers/Renderer.js\";import\"../renderers/SimpleRenderer.js\";import\"../renderers/UniqueValueRenderer.js\";import\"../renderers/support/jsonUtils.js\";import{rendererTypes as t,webSceneRendererTypes as i}from\"../renderers/support/types.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{property as s}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import{featureGeometryTypeKebabDictionary as p}from\"../geometry/support/typeUtils.js\";import l from\"./Layer.js\";import{OGCFeatureSource as a}from\"./graphics/sources/OGCFeatureSource.js\";import{APIKeyMixin as d}from\"./mixins/APIKeyMixin.js\";import{BlendLayer as y}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as m}from\"./mixins/CustomParametersMixin.js\";import{FeatureEffectLayer as u}from\"./mixins/FeatureEffectLayer.js\";import{FeatureReductionLayer as c}from\"./mixins/FeatureReductionLayer.js\";import{OperationalLayer as f}from\"./mixins/OperationalLayer.js\";import{OrderedLayer as h}from\"./mixins/OrderedLayer.js\";import{PortalLayer as j}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as g}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as v}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as x}from\"./mixins/TemporalLayer.js\";import{elevationInfo as b,labelsVisible as I,legendEnabled as S,popupEnabled as R,screenSizePerspectiveEnabled as F,url as L}from\"./support/commonProperties.js\";import O from\"./support/FeatureType.js\";import T from\"./support/Field.js\";import{defineFieldProperties as w}from\"./support/fieldProperties.js\";import{fixRendererFields as D,fixTimeInfoFields as C}from\"./support/fieldUtils.js\";import P from\"./support/LabelClass.js\";import{reader as E}from\"./support/labelingInfo.js\";import _ from\"../rest/support/Query.js\";import{createPopupTemplate as U}from\"../support/popupUtils.js\";import q from\"../geometry/Extent.js\";import G from\"../geometry/SpatialReference.js\";const M=w();let B=class extends(d(m(c(u(y(h(x(v(f(j(g(o(l))))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType=\"OGCFeatureLayer\",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new a({layer:this}),this.spatialReference=null,this.title=null,this.type=\"ogc-feature\",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"OGCFeatureServer\"]},e).then((()=>this._fetchService(e)))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&null==this.geometryType}set renderer(e){D(e,this.fieldsIndex),this._set(\"renderer\",e)}on(e,r){return super.on(e,r)}createPopupTemplate(e){return U(this,e)}createQuery(){return new _}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){let t,i=!1;const o=r?.feature?.attributes,s=this.typeIdField&&o?.[this.typeIdField];return null!=s&&this.types&&(i=this.types.some((r=>r.id==s&&(t=r.domains?.[e],\"inherited\"===t?.type&&(t=this._getLayerDomain(e)),!0)))),i||t||(t=this._getLayerDomain(e)),t}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(_.from(e)||this.createQuery(),r))).then((e=>(e?.features?.forEach((e=>{e.layer=e.sourceLayer=this})),e)))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:\"service\"}),D(this.renderer,this.fieldsIndex),C(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const r of this.fields)if(r.name===e&&r.domain)return r.domain;return null}};e([s({readOnly:!0,json:{origins:{service:{read:!0}}}})],B.prototype,\"capabilities\",void 0),e([s({type:String,json:{write:!0}})],B.prototype,\"collectionId\",void 0),e([s({type:String})],B.prototype,\"copyright\",void 0),e([s({readOnly:!0})],B.prototype,\"defaultPopupTemplate\",null),e([s({type:String})],B.prototype,\"definitionExpression\",void 0),e([s({readOnly:!0,type:String,json:{origins:{service:{name:\"collection.description\"}}}})],B.prototype,\"description\",void 0),e([s({type:String})],B.prototype,\"displayField\",void 0),e([s({type:Number})],B.prototype,\"effectiveMaxRecordCount\",null),e([s(b)],B.prototype,\"elevationInfo\",void 0),e([s({type:[T],json:{origins:{service:{name:\"layerDefinition.fields\"}}}})],B.prototype,\"fields\",void 0),e([s(M.fieldsIndex)],B.prototype,\"fieldsIndex\",void 0),e([s({readOnly:!0,type:q,json:{origins:{service:{name:\"layerDefinition.extent\"}}}})],B.prototype,\"fullExtent\",void 0),e([s({type:p.apiValues,json:{origins:{service:{name:\"layerDefinition.geometryType\",read:{reader:p.read}}}}})],B.prototype,\"geometryType\",void 0),e([s({type:Boolean,json:{origins:{service:{name:\"layerDefinition.hasZ\"}}}})],B.prototype,\"hasZ\",void 0),e([s({type:Boolean,readOnly:!0})],B.prototype,\"isTable\",null),e([s({type:[P],json:{origins:{\"web-document\":{name:\"layerDefinition.drawingInfo.labelingInfo\",read:{reader:E},write:!0}}}})],B.prototype,\"labelingInfo\",void 0),e([s(I)],B.prototype,\"labelsVisible\",void 0),e([s(S)],B.prototype,\"legendEnabled\",void 0),e([s({type:Number})],B.prototype,\"maxRecordCount\",void 0),e([s({type:String,json:{origins:{service:{name:\"layerDefinition.objectIdField\"}}}})],B.prototype,\"objectIdField\",void 0),e([s({type:[\"OGCFeatureLayer\"]})],B.prototype,\"operationalLayerType\",void 0),e([s(R)],B.prototype,\"popupEnabled\",void 0),e([s({type:r,json:{name:\"popupInfo\",write:!0}})],B.prototype,\"popupTemplate\",void 0),e([s({types:t,json:{origins:{service:{name:\"layerDefinition.drawingInfo.renderer\",write:!1},\"web-scene\":{types:i,name:\"layerDefinition.drawingInfo.renderer\",write:!0}},name:\"layerDefinition.drawingInfo.renderer\",write:!0}})],B.prototype,\"renderer\",null),e([s(F)],B.prototype,\"screenSizePerspectiveEnabled\",void 0),e([s({readOnly:!0})],B.prototype,\"source\",void 0),e([s({readOnly:!0,type:G,json:{origins:{service:{read:!0}}}})],B.prototype,\"spatialReference\",void 0),e([s({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:\"collection.title\"}}}})],B.prototype,\"title\",void 0),e([s({readOnly:!0,json:{read:!1}})],B.prototype,\"type\",void 0),e([s({type:String,readOnly:!0})],B.prototype,\"typeIdField\",void 0),e([s({type:[O]})],B.prototype,\"types\",void 0),e([s(L)],B.prototype,\"url\",void 0),B=e([n(\"esri.layers.OGCFeatureLayer\")],B);const V=B;export{V as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{clone as e}from\"../../core/lang.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";var i;let p=i=class extends t{constructor(r){super(r)}clone(){return new i({customLayerParameters:e(this.customLayerParameters),customParameters:e(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};r([o({json:{type:Object,write:!0}})],p.prototype,\"customLayerParameters\",void 0),r([o({json:{type:Object,write:!0}})],p.prototype,\"customParameters\",void 0),r([o({type:String,json:{write:!0}})],p.prototype,\"layerIdentifier\",void 0),r([o({type:String,json:{write:!0}})],p.prototype,\"tileMatrixSet\",void 0),r([o({type:String,json:{write:!0}})],p.prototype,\"url\",void 0),p=i=r([s(\"esri.layer.support.WMTSLayerInfo\")],p);export{p as WMTSLayerInfo};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../request.js\";import r from\"../core/Error.js\";import{MultiOriginJSONMixin as l}from\"../core/MultiOriginJSONSupport.js\";import{replace as o}from\"../core/string.js\";import{Url as s,ensureTrailingSlash as i,isProtocolRelative as n,normalize as a}from\"../core/urlUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as u}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as c}from\"../core/accessorSupport/decorators/writer.js\";import f from\"./Layer.js\";import{BlendLayer as y}from\"./mixins/BlendLayer.js\";import{OperationalLayer as h}from\"./mixins/OperationalLayer.js\";import{PortalLayer as d}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as v}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as w}from\"./mixins/ScaleRangeLayer.js\";import{createTileBitmap as g}from\"./support/imageBitmapUtils.js\";import j from\"./support/LOD.js\";import T from\"./support/TileInfo.js\";import{WMTSLayerInfo as b}from\"./support/WMTSLayerInfo.js\";import S from\"../geometry/Extent.js\";import R from\"../geometry/SpatialReference.js\";import x from\"../geometry/Point.js\";var U;let L=U=class extends(y(v(w(h(d(l(f))))))){constructor(...e){super(...e),this.copyright=\"\",this.fullExtent=new S(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,R.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=R.WebMercator,this.subDomains=null,this.tileInfo=new T({size:[256,256],dpi:96,format:\"png8\",compressionQuality:0,origin:new x({x:-20037508.342787,y:20037508.342787,spatialReference:R.WebMercator}),spatialReference:R.WebMercator,lods:[new j({level:0,scale:591657527.591555,resolution:156543.033928}),new j({level:1,scale:295828763.795777,resolution:78271.5169639999}),new j({level:2,scale:147914381.897889,resolution:39135.7584820001}),new j({level:3,scale:73957190.948944,resolution:19567.8792409999}),new j({level:4,scale:36978595.474472,resolution:9783.93962049996}),new j({level:5,scale:18489297.737236,resolution:4891.96981024998}),new j({level:6,scale:9244648.868618,resolution:2445.98490512499}),new j({level:7,scale:4622324.434309,resolution:1222.99245256249}),new j({level:8,scale:2311162.217155,resolution:611.49622628138}),new j({level:9,scale:1155581.108577,resolution:305.748113140558}),new j({level:10,scale:577790.554289,resolution:152.874056570411}),new j({level:11,scale:288895.277144,resolution:76.4370282850732}),new j({level:12,scale:144447.638572,resolution:38.2185141425366}),new j({level:13,scale:72223.819286,resolution:19.1092570712683}),new j({level:14,scale:36111.909643,resolution:9.55462853563415}),new j({level:15,scale:18055.954822,resolution:4.77731426794937}),new j({level:16,scale:9027.977411,resolution:2.38865713397468}),new j({level:17,scale:4513.988705,resolution:1.19432856685505}),new j({level:18,scale:2256.994353,resolution:.597164283559817}),new j({level:19,scale:1128.497176,resolution:.298582141647617}),new j({level:20,scale:564.248588,resolution:.14929107082380833}),new j({level:21,scale:282.124294,resolution:.07464553541190416}),new j({level:22,scale:141.062147,resolution:.03732276770595208}),new j({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type=\"web-tile\",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return\"string\"==typeof e?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:[\"WMTS\"]},e).then((()=>{let e=\"\";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const t=new s(this.urlTemplate);!(!!this.subDomains&&this.subDomains.length>0)&&t.authority?.includes(\"{subDomain}\")&&(e=\"is missing 'subDomains' property\")}else e=\"spatialReference must match tileInfo.spatialReference\";else e=\"is missing the required 'urlTemplate' property value\";if(e)throw new r(\"web-tile-layer:load\",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)}));return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||R.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,l=new s(t),o=l.scheme?l.scheme+\"://\":\"//\",n=o+l.authority+\"/\",a=l.authority;if(a?.includes(\"{subDomain}\")){if(r&&r.length>0&&a.split(\".\").length>1)for(const s of r)e.push(o+a.replaceAll(/\\{subDomain\\}/gi,s)+\"/\")}else e.push(n);return e.map(i)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new s(e),r=(t.scheme?t.scheme+\"://\":\"//\")+t.authority+\"/\";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){n(e)&&(e=\"https:\"+e),e&&(e=e.replaceAll(/\\{z\\}/gi,\"{level}\").replaceAll(/\\{x\\}/gi,\"{col}\").replaceAll(/\\{y\\}/gi,\"{row}\"),e=a(e)),t.templateUrl=e}fetchTile(e,r,l,o={}){const{signal:s}=o,i=this.getTileUrl(e,r,l),n={responseType:\"image\",signal:s,query:{...this.refreshParameters}};return t(i,n).then((e=>e.data))}async fetchImageBitmapTile(e,r,l,o={}){const{signal:s}=o;if(this.fetchTile!==U.prototype.fetchTile){const t=await this.fetchTile(e,r,l,o);return g(t,e,r,l,s)}const i=this.getTileUrl(e,r,l),n={responseType:\"blob\",signal:s,query:{...this.refreshParameters}},{data:a}=await t(i,n);return g(a,e,r,l,s)}getTileUrl(e,t,r){const{levelValues:l,tileServers:s,urlPath:i}=this;if(!l||!s||!i)return\"\";const n=l[e];return s[t%s.length]+o(i,{level:n,z:n,col:r,x:r,row:t,y:t})}};e([p({type:String,value:\"\",json:{write:!0}})],L.prototype,\"copyright\",void 0),e([p({type:S,json:{write:!0},nonNullable:!0})],L.prototype,\"fullExtent\",void 0),e([p({readOnly:!0,json:{read:!1,write:!1}})],L.prototype,\"legendEnabled\",void 0),e([p({type:[\"show\",\"hide\"]})],L.prototype,\"listMode\",void 0),e([p({json:{read:!0,write:!0}})],L.prototype,\"blendMode\",void 0),e([p()],L.prototype,\"levelValues\",null),e([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],L.prototype,\"isReference\",void 0),e([p({type:[\"WebTiledLayer\"],value:\"WebTiledLayer\"})],L.prototype,\"operationalLayerType\",void 0),e([p({readOnly:!0,json:{read:!1,write:!1}})],L.prototype,\"popupEnabled\",void 0),e([p({type:R})],L.prototype,\"spatialReference\",void 0),e([u(\"spatialReference\",[\"spatialReference\",\"fullExtent.spatialReference\"])],L.prototype,\"readSpatialReference\",null),e([p({type:[String],json:{write:!0}})],L.prototype,\"subDomains\",void 0),e([p({type:T,json:{write:!0}})],L.prototype,\"tileInfo\",void 0),e([p({readOnly:!0})],L.prototype,\"tileServers\",null),e([p({json:{read:!1}})],L.prototype,\"type\",void 0),e([p()],L.prototype,\"urlPath\",null),e([p({type:String,json:{origins:{\"portal-item\":{read:{source:\"url\"}}}}})],L.prototype,\"urlTemplate\",void 0),e([u(\"urlTemplate\",[\"urlTemplate\",\"templateUrl\"])],L.prototype,\"readUrlTemplate\",null),e([c(\"urlTemplate\",{templateUrl:{type:String}})],L.prototype,\"writeUrlTemplate\",null),e([p({type:b,json:{write:!0}})],L.prototype,\"wmtsInfo\",void 0),L=U=e([m(\"esri.layers.WebTileLayer\")],L);const I=L;export{I as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import{property as o}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as r}from\"../core/accessorSupport/decorators/subclass.js\";import t from\"../geometry/Point.js\";import l from\"./WebTileLayer.js\";import s from\"./support/LOD.js\";import n from\"./support/TileInfo.js\";import i from\"../portal/PortalItem.js\";import p from\"../geometry/SpatialReference.js\";import a from\"../geometry/Extent.js\";let c=class extends l{constructor(...e){super(...e),this.portalItem=null,this.isReference=null,this.tileInfo=new n({size:[256,256],dpi:96,format:\"png8\",compressionQuality:0,origin:new t({x:-20037508.342787,y:20037508.342787,spatialReference:p.WebMercator}),spatialReference:p.WebMercator,lods:[new s({level:0,scale:591657527.591555,resolution:156543.033928}),new s({level:1,scale:295828763.795777,resolution:78271.5169639999}),new s({level:2,scale:147914381.897889,resolution:39135.7584820001}),new s({level:3,scale:73957190.948944,resolution:19567.8792409999}),new s({level:4,scale:36978595.474472,resolution:9783.93962049996}),new s({level:5,scale:18489297.737236,resolution:4891.96981024998}),new s({level:6,scale:9244648.868618,resolution:2445.98490512499}),new s({level:7,scale:4622324.434309,resolution:1222.99245256249}),new s({level:8,scale:2311162.217155,resolution:611.49622628138}),new s({level:9,scale:1155581.108577,resolution:305.748113140558}),new s({level:10,scale:577790.554289,resolution:152.874056570411}),new s({level:11,scale:288895.277144,resolution:76.4370282850732}),new s({level:12,scale:144447.638572,resolution:38.2185141425366}),new s({level:13,scale:72223.819286,resolution:19.1092570712683}),new s({level:14,scale:36111.909643,resolution:9.55462853563415}),new s({level:15,scale:18055.954822,resolution:4.77731426794937}),new s({level:16,scale:9027.977411,resolution:2.38865713397468}),new s({level:17,scale:4513.988705,resolution:1.19432856685505}),new s({level:18,scale:2256.994353,resolution:.597164283559817}),new s({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=[\"a\",\"b\",\"c\"],this.fullExtent=new a(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,p.WebMercator),this.urlTemplate=\"https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png\",this.operationalLayerType=\"OpenStreetMap\",this.type=\"open-street-map\",this.copyright=\"Map data © OpenStreetMap contributors, CC-BY-SA\"}get refreshInterval(){return 0}};e([o({type:i,json:{read:!1,write:!1,origins:{\"web-document\":{read:!1,write:!1}}}})],c.prototype,\"portalItem\",void 0),e([o({type:Boolean,json:{read:!1,write:!1}})],c.prototype,\"isReference\",void 0),e([o({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{\"web-document\":{read:!1,write:!1}}}})],c.prototype,\"refreshInterval\",null),e([o({type:n,json:{write:!1}})],c.prototype,\"tileInfo\",void 0),e([o({type:[\"show\",\"hide\"]})],c.prototype,\"listMode\",void 0),e([o({readOnly:!0,json:{read:!1,write:!1}})],c.prototype,\"subDomains\",void 0),e([o({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],c.prototype,\"fullExtent\",void 0),e([o({readOnly:!0,json:{read:!1,write:!1}})],c.prototype,\"urlTemplate\",void 0),e([o({type:[\"OpenStreetMap\"]})],c.prototype,\"operationalLayerType\",void 0),e([o({json:{read:!1}})],c.prototype,\"type\",void 0),e([o({json:{read:!1,write:!1}})],c.prototype,\"copyright\",void 0),e([o({json:{read:!1,write:!1}})],c.prototype,\"wmtsInfo\",void 0),c=e([r(\"esri.layers.OpenStreetMapLayer\")],c);const u=c;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst o=[2155,2194,2204,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2314,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2964,2965,2966,2967,2968,2992,2994,3080,3089,3091,3102,3359,3359,3361,3363,3365,3366,3404,3407,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3441,3442,3443,3444,3445,3446,3451,3452,3453,3454,3455,3456,3457,3458,3459,3479,3481,3483,3485,3487,3490,3492,3494,3496,3498,3500,3502,3504,3506,3508,3510,3512,3515,3517,3519,3521,3523,3525,3527,3529,3531,3533,3535,3537,3539,3541,3543,3545,3547,3549,3551,3553,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3582,3584,3586,3588,3590,3593,3598,3600,3605,3608,3610,3612,3614,3616,3618,3620,3622,3624,3626,3628,3630,3632,3634,3636,3640,3642,3644,3646,3648,3650,3652,3654,3656,3658,3660,3662,3664,3668,3670,3672,3674,3676,3677,3679,3680,3682,3683,3686,3688,3690,3692,3696,3698,3700,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3753,3754,3755,3756,3757,3758,3759,3760,3991,3992,4217,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4438,4439,4455,4456,4457,5466,5588,5589,5623,5624,5625,5646,5654,5655,6128,6129,6141,6200,6201,6202,6391,6405,6407,6409,6411,6413,6416,6418,6420,6422,6424,6426,6428,6430,6432,6434,6436,6438,6441,6443,6445,6447,6449,6451,6453,6455,6457,6459,6461,6463,6465,6467,6469,6471,6473,6475,6477,6479,6484,6486,6488,6490,6492,6494,6496,6499,6501,6503,6505,6507,6510,6515,6517,6519,6521,6523,6525,6527,6529,6531,6533,6535,6537,6539,6541,6543,6545,6547,6549,6551,6553,6555,6557,6559,6561,6563,6565,6568,6570,6572,6574,6576,6578,6582,6584,6586,6588,6590,6593,6595,6597,6599,6601,6603,6605,6607,6609,6612,6614,6616,6618,6625,6626,6627,6633,6785,6787,6789,6791,6793,6795,6797,6799,6801,6803,6805,6807,6809,6811,6813,6815,6817,6819,6821,6823,6825,6827,6829,6831,6833,6835,6837,6839,6841,6843,6845,6847,6849,6851,6853,6855,6857,6859,6861,6863,6868,6880,6885,6887,6923,6925,6966,6997,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7132,7258,7260,7262,7264,7266,7268,7270,7272,7274,7276,7278,7280,7282,7284,7286,7288,7290,7292,7294,7296,7298,7300,7302,7304,7306,7308,7310,7312,7314,7316,7318,7320,7322,7324,7326,7328,7330,7332,7334,7336,7338,7340,7342,7344,7346,7348,7350,7352,7354,7356,7358,7360,7362,7364,7366,7368,7370,7558,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,24100,26729,26730,26731,26732,26733,26734,26735,26736,26737,26738,26739,26740,26741,26742,26743,26744,26745,26746,26747,26748,26749,26750,26751,26752,26753,26754,26755,26756,26757,26758,26759,26760,26766,26767,26768,26769,26770,26771,26772,26773,26774,26775,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26786,26787,26791,26792,26793,26794,26795,26796,26797,26798,26799,26801,26802,26803,26811,26812,26813,26814,26815,26819,26820,26821,26822,26825,26826,26830,26831,26832,26833,26836,26837,26841,26842,26843,26844,26847,26848,26849,26850,26851,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26862,26863,26864,26865,26866,26867,26868,26869,26870,32001,32002,32003,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32064,32065,32066,32067,32074,32075,32076,32077,32099,32164,32165,32166,32167,32664,32665,32666,32667,65061,102120,102121,102629,102630,102631,102632,102633,102634,102635,102636,102637,102638,102639,102640,102641,102642,102643,102644,102645,102646,102648,102649,102650,102651,102652,102653,102654,102655,102656,102657,102658,102659,102660,102661,102662,102663,102664,102665,102666,102667,102668,102669,102670,102671,102672,102673,102674,102675,102676,102677,102678,102679,102680,102681,102682,102683,102684,102685,102686,102687,102688,102689,102690,102691,102692,102693,102694,102695,102696,102697,102698,102700,102704,102707,102708,102709,102710,102711,102712,102713,102714,102715,102716,102717,102718,102719,102720,102721,102722,102723,102724,102725,102726,102727,102728,102729,102730,102733,102734,102735,102736,102737,102738,102739,102740,102741,102742,102743,102744,102745,102746,102747,102748,102749,102750,102751,102752,102753,102754,102755,102756,102757,102758,102761,102766],t=[5614,5702,6130,6131,6132,6358,6359,6360],c=[115700,4326];export{c as ellipsoidalWkid,o as horizontalWkidHeightUnitFeet,t as verticalWkidHeightUnitFeet};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{horizontalWkidHeightUnitFeet as e,verticalWkidHeightUnitFeet as t,ellipsoidalWkid as r}from\"./wkid.js\";function n(t){return e.includes(t)?\"feet\":\"meters\"}function i(e,r){return\"number\"==typeof e?t.includes(e)?\"feet\":\"meters\":n(r)}function u(e,t){return r.includes(e)||4326===t?\"ellipsoidal\":\"gravity-related-height\"}export{u as getHeightModel,n as getHorizontalUnit,i as getVerticalUnit};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../../chunks/tslib.es6.js\";import t from\"../../../core/Accessor.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as e}from\"../../../core/accessorSupport/decorators/subclass.js\";import{getHeightModel as i,getVerticalUnit as s,getHorizontalUnit as p}from\"../constants/utils.js\";let n=class extends t{get isAdvanced(){return!1}getInfo(){const{horizontalWKID:o,verticalWKID:t}=this;let r=o,e=t;const n=this;if(4===n.type){const{properties:o}=n;r=4326,e=o.verticalWKID}return{heightModel:i(r,e),heightUnit:s(e,r),horizontalUnit:p(r)}}};o([r({json:{write:!0}})],n.prototype,\"affineTransformations\",void 0),o([r({json:{write:!0}})],n.prototype,\"focalLength\",void 0),o([r({json:{write:!0}})],n.prototype,\"principalOffsetPoint\",void 0),o([r({json:{write:!0}})],n.prototype,\"radialDistortionCoefficients\",void 0),o([r({json:{write:!0}})],n.prototype,\"tangentialDistortionCoefficients\",void 0),o([r({json:{write:!0}})],n.prototype,\"horizontalWKID\",void 0),o([r({json:{write:!0}})],n.prototype,\"verticalWKID\",void 0),o([r({json:{write:!0}})],n.prototype,\"x\",void 0),o([r({json:{write:!0}})],n.prototype,\"y\",void 0),o([r({json:{write:!0}})],n.prototype,\"z\",void 0),o([r({json:{write:!0}})],n.prototype,\"type\",void 0),n=o([e(\"esri.layers.orientedImagery.core.CameraOrientation\")],n);const a=n;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import{ClonableMixin as o}from\"../../../core/Clonable.js\";import{JSONSupportMixin as e}from\"../../../core/JSONSupport.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as i}from\"../../../core/accessorSupport/decorators/subclass.js\";import s from\"./CameraOrientation.js\";let p=class extends(o(e(s))){constructor(){super(...arguments),this.type=1}get isAdvanced(){const{affineTransformations:t,focalLength:o,principalOffsetPoint:e,radialDistortionCoefficients:r,tangentialDistortionCoefficients:i}=this;return t?.length>1||!Number.isNaN(o)||e?.length>1||r?.length>1||i?.length>1}toString(){const{type:t,horizontalWKID:o,verticalWKID:e,x:r,y:i,z:s,heading:p,pitch:n,roll:a,affineTransformations:c,focalLength:f,principalOffsetPoint:m,radialDistortionCoefficients:y,tangentialDistortionCoefficients:l}=this,u=[t,o,e,r,i,s,p,n,a];return this.isAdvanced&&(c?.forEach((t=>u.push(t))),u.push(f),m?.forEach((t=>u.push(t))),y?.forEach((t=>u.push(t))),l?.forEach((t=>u.push(t)))),u.map((t=>Number.isNaN(t)?\"\":t)).join(\"|\")}};t([r({json:{write:!0}})],p.prototype,\"type\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"affineTransformations\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"focalLength\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"principalOffsetPoint\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"radialDistortionCoefficients\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"tangentialDistortionCoefficients\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"heading\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"pitch\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"roll\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"horizontalWKID\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"verticalWKID\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"x\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"y\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"z\",void 0),p=t([i(\"esri.layers.orientedImagery.core.CameraOrientationHPR\")],p);const n=p;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../../chunks/tslib.es6.js\";import{ClonableMixin as t}from\"../../../core/Clonable.js\";import{JSONSupportMixin as e}from\"../../../core/JSONSupport.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as i}from\"../../../core/accessorSupport/decorators/subclass.js\";import s from\"./CameraOrientation.js\";let p=class extends(t(e(s))){constructor(){super(...arguments),this.type=2}get isAdvanced(){const{affineTransformations:o,focalLength:t,principalOffsetPoint:e,radialDistortionCoefficients:r,tangentialDistortionCoefficients:i}=this;return o?.length>1||!Number.isNaN(t)||e?.length>1||r?.length>1||i?.length>1}toString(){const{type:o,horizontalWKID:t,verticalWKID:e,x:r,y:i,z:s,omega:p,phi:n,kappa:a,affineTransformations:c,focalLength:f,principalOffsetPoint:m,radialDistortionCoefficients:y,tangentialDistortionCoefficients:u}=this,l=[o,t,e,r,i,s,p,n,a];return this.isAdvanced&&(c?.forEach((o=>l.push(o))),l.push(f),m?.forEach((o=>l.push(o))),y?.forEach((o=>l.push(o))),u?.forEach((o=>l.push(o)))),l.map((o=>isNaN(o)?\"\":o)).join(\"|\")}};o([r({json:{write:!0}})],p.prototype,\"type\",void 0),o([r({type:[Number],json:{write:!0}})],p.prototype,\"affineTransformations\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"focalLength\",void 0),o([r({type:[Number],json:{write:!0}})],p.prototype,\"principalOffsetPoint\",void 0),o([r({type:[Number],json:{write:!0}})],p.prototype,\"radialDistortionCoefficients\",void 0),o([r({type:[Number],json:{write:!0}})],p.prototype,\"tangentialDistortionCoefficients\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"omega\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"phi\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"kappa\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"horizontalWKID\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"verticalWKID\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"x\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"y\",void 0),o([r({type:Number,json:{write:!0}})],p.prototype,\"z\",void 0),p=o([i(\"esri.layers.orientedImagery.core.CameraOrientationOPK\")],p);const n=p;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../../chunks/tslib.es6.js\";import{ClonableMixin as o}from\"../../../core/Clonable.js\";import{JSONSupportMixin as e}from\"../../../core/JSONSupport.js\";import{property as r}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as i}from\"../../../core/accessorSupport/decorators/subclass.js\";import s from\"./CameraOrientation.js\";let p=class extends(o(e(s))){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:t,focalLength:o,principalOffsetPoint:e,radialDistortionCoefficients:r,tangentialDistortionCoefficients:i}=this;return t?.length>1||!Number.isNaN(o)||e?.length>1||r?.length>1||i?.length>1}toString(){const{type:t,horizontalWKID:o,verticalWKID:e,x:r,y:i,z:s,yaw:p,pitch:n,roll:a,affineTransformations:c,focalLength:f,principalOffsetPoint:y,radialDistortionCoefficients:m,tangentialDistortionCoefficients:l}=this,u=[t,o,e,r,i,s,p,n,a];return this.isAdvanced&&(c?.forEach((t=>u.push(t))),u.push(f),y?.forEach((t=>u.push(t))),y?.forEach((t=>u.push(t))),m?.forEach((t=>u.push(t))),l?.forEach((t=>u.push(t)))),u.map((t=>Number.isNaN(t)?\"\":t)).join(\"|\")}};t([r({json:{write:!0}})],p.prototype,\"type\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"affineTransformations\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"focalLength\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"principalOffsetPoint\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"radialDistortionCoefficients\",void 0),t([r({type:[Number],json:{write:!0}})],p.prototype,\"tangentialDistortionCoefficients\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"yaw\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"pitch\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"roll\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"horizontalWKID\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"verticalWKID\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"x\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"y\",void 0),t([r({type:Number,json:{write:!0}})],p.prototype,\"z\",void 0),p=t([i(\"esri.layers.orientedImagery.core.CameraOrientationYPR\")],p);const n=p;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import r from\"../../../core/Error.js\";import{JSONSupport as o}from\"../../../core/JSONSupport.js\";import{property as t}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import\"../../../core/has.js\";import{subclass as s}from\"../../../core/accessorSupport/decorators/subclass.js\";import{fetchArcGISServiceJSON as i}from\"../../../support/requestPresets.js\";let n=class extends o{constructor(){super(...arguments),this.url=null}};e([t({type:Number,json:{write:!0}})],n.prototype,\"lod\",void 0),e([t({type:String,json:{write:!0}})],n.prototype,\"rasterFunction\",void 0),e([t({type:String,json:{write:!0}})],n.prototype,\"url\",void 0),n=e([s(\"esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource\")],n);let p=class extends o{};e([t({type:Number,json:{write:!0}})],p.prototype,\"constantElevation\",void 0),p=e([s(\"esri.layers.orientedImagery.cor.ElevationSourceDefinitions.ConstantElevation\")],p);const a=e=>\"constantElevation\"in e;async function c(e){const o=await i(e),{tileInfo:t,cacheType:s}=o;return o.hasOwnProperty(\"bandCount\")&&o.hasOwnProperty(\"pixelSizeX\")?\"LERC\"!==t?.format?.toUpperCase()||s&&\"elevation\"!==s.toLowerCase()?{isSupported:!1,error:new r(\"elevation-source:unsupported-imagery-service\",\"Only elevation 3d services are supported\")}:{isSupported:!0}:{isSupported:!1,error:new r(\"elevation-source:invalid-service-url\",`ElevationSource URL expects an elevation 3D image service but given ${e}`)}}export{p as ConstantElevation,n as ElevationSource,a as isConstantElevation,c as validateElevationSourceURL};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nvar P;!function(P){P[P.HPR=1]=\"HPR\",P[P.OPK=2]=\"OPK\",P[P.YPR=3]=\"YPR\",P[P.LTP=4]=\"LTP\"}(P||(P={}));export{P as CameraOrientationType};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{JSONMap as t}from\"../../../core/jsonMap.js\";import n from\"./CameraOrientationHPR.js\";import i from\"./CameraOrientationOPK.js\";import e from\"./CameraOrientationYPR.js\";import{ElevationSource as o,isConstantElevation as r,ConstantElevation as s}from\"./ElevationSourceDefinitions.js\";import{CameraOrientationType as a}from\"../enums/CameraOrientationType.js\";function c(t,n,i){return n&&(t=`${n}${t}`),i&&(t+=`${i}`),t}function l(t,n,i){let{url:e}=t;return e?(e=c(e,n,i),new o({...t,url:e})):null}function f(t,n,i){return t?r(t)?new s(t):l(t,n,i):t}const u=new t({Minutes:\"minutes\",Hours:\"hours\",Days:\"days\",Weeks:\"weeks\",Months:\"months\",Years:\"years\"}),p=new t({360:\"360\",Horizontal:\"horizontal\",Inspection:\"inspection\",Nadir:\"nadir\",Oblique:\"oblique\",\"\":null}),m=new Map;m.set(`${a.OPK}`,{desc:\"Using Omega Phi Kappa\",constructor:i}),m.set(`${a.HPR}`,{desc:\"Using Heading, Pitch and Roll\",constructor:n}),m.set(`${a.YPR}`,{desc:\"Using Yaw, Pitch and Roll\",constructor:e});const d=new Map;function g(t){const[n,i,e,o,r,s,a,c,l,f,u,p,m,d,g,h,P,D,y,O,$,w,C]=t;return{type:n,horizontalWKID:i,verticalWKID:e,x:o,y:r,z:s,omega:a,phi:c,kappa:l,affineTransformations:[f,u,p,m,d,g],focalLength:h,principalOffsetPoint:[P,D],radialDistortionCoefficients:[y,O,$],tangentialDistortionCoefficients:[w,C]}}function h(t){const[n,i,e,o,r,s,a,c,l,f,u,p,m,d,g,h,P,D,y,O,$,w,C]=t;return{type:n,horizontalWKID:i,verticalWKID:e,x:o,y:r,z:s,heading:a,pitch:c,roll:l,affineTransformations:[f,u,p,m,d,g],focalLength:h,principalOffsetPoint:[P,D],radialDistortionCoefficients:[y,O,$],tangentialDistortionCoefficients:[w,C]}}function P(t){const[n,i,e,o,r,s,a,c,l,f,u,p,m,d,g,h,P,D,y,O,$,w,C]=t;return{type:n,horizontalWKID:i,verticalWKID:e,x:o,y:r,z:s,yaw:a,pitch:c,roll:l,affineTransformations:[f,u,p,m,d,g],focalLength:h,principalOffsetPoint:[P,D],radialDistortionCoefficients:[y,O,$],tangentialDistortionCoefficients:[w,C]}}function D(t){const[n,i,e,o,r,s,...a]=t,c=d.get(s);if(!c)return null;return{type:n,latitude:i,longitude:e,ellipsoidRadius:o,squaredEccentricity:r,properties:c([s,\"\",...a])}}function y(t){if(!t)return null;const n=`${t}`.split(\"|\");if(0===n.length)return null;const i=m.get(n[0]);if(!i)return null;const e=d.get(n[0]);if(!e)return null;return new(0,i.constructor)(e(n))}d.set(`${a.HPR}`,h),d.set(`${a.YPR}`,P),d.set(`${a.OPK}`,g),d.set(`${a.LTP}`,D);export{c as appendPrefixAndSuffix,m as cameraOrientationRegistry,y as createCameraOrientation,f as getEffectiveElevationSource,p as orientedImageryTypeMap,l as processElevationSource,u as timeIntervalUnitTypeMap,d as transformersRegistry};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../core/Error.js\";import{JSONMap as r}from\"../core/jsonMap.js\";import{property as i}from\"../core/accessorSupport/decorators/property.js\";import{cast as o}from\"../core/accessorSupport/decorators/cast.js\";import{subclass as a}from\"../core/accessorSupport/decorators/subclass.js\";import n from\"./FeatureLayer.js\";import{orientedImageryTypeMap as p,timeIntervalUnitTypeMap as s,getEffectiveElevationSource as y}from\"./orientedImagery/core/utils.js\";function l(e,t,r){return{name:`orientedImageryProperties.${e}`,write:!t||{target:`orientedImageryProperties.${e}`,writer:t},origins:{service:{name:`orientedImageryInfo.orientedImageryProperties.${e}`,write:t,read:r}}}}let m=class extends n{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType=\"point\",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType=\"OrientedImageryLayer\",this.orientationAccuracy=null,this.orientedImageryType=null,this.type=\"oriented-imagery\",this.timeIntervalUnit=null,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:r}=this;return y(e,t,r)}findFirstValidLayerId(e){return e.layers?.find((e=>\"Oriented Imagery Layer\"===e.type))?.id}_verifySource(){if(super._verifySource(),\"point\"!==this.geometryType)throw new t(\"oriented-imagery-layer:invalid-geometry-type\",\"OrientedImageryLayer only supports point geometry type\")}};e([i({type:Number,json:l(\"cameraHeading\")})],m.prototype,\"cameraHeading\",void 0),e([i({type:Number,json:l(\"cameraHeight\")})],m.prototype,\"cameraHeight\",void 0),e([i({type:Number,json:l(\"cameraPitch\")})],m.prototype,\"cameraPitch\",void 0),e([i({type:Number,json:l(\"cameraRoll\")})],m.prototype,\"cameraRoll\",void 0),e([i({type:Number,json:l(\"coveragePercent\")})],m.prototype,\"coveragePercent\",void 0),e([i({type:String,json:l(\"demPathPrefix\")})],m.prototype,\"demPathPrefix\",void 0),e([i({type:String,json:l(\"demPathSuffix\")})],m.prototype,\"demPathSuffix\",void 0),e([i({type:String,json:l(\"depthImagePathPrefix\")})],m.prototype,\"depthImagePathPrefix\",void 0),e([i({type:String,json:l(\"depthImagePathSuffix\")})],m.prototype,\"depthImagePathSuffix\",void 0),e([i({type:Object,json:l(\"elevationSource\")})],m.prototype,\"elevationSource\",void 0),e([i()],m.prototype,\"effectiveElevationSource\",null),e([i({type:Number,json:l(\"farDistance\")})],m.prototype,\"farDistance\",void 0),e([i({json:{write:!0}})],m.prototype,\"geometryType\",void 0),e([i({type:Number,json:l(\"horizontalFieldOfView\")})],m.prototype,\"horizontalFieldOfView\",void 0),e([i({type:String,json:l(\"horizontalMeasurementUnit\")})],m.prototype,\"horizontalMeasurementUnit\",void 0),e([i({type:String,json:l(\"imagePathPrefix\")})],m.prototype,\"imagePathPrefix\",void 0),e([i({type:String,json:l(\"imagePathSuffix\")})],m.prototype,\"imagePathSuffix\",void 0),e([i({type:Number,json:l(\"imageRotation\")})],m.prototype,\"imageRotation\",void 0),e([i({type:Number,json:l(\"maximumDistance\")})],m.prototype,\"maximumDistance\",void 0),e([i({type:Number,json:l(\"nearDistance\")})],m.prototype,\"nearDistance\",void 0),e([i({type:[\"OrientedImageryLayer\"]})],m.prototype,\"operationalLayerType\",void 0),e([i({json:l(\"orientationAccuracy\",((e,t)=>{e&&(t.orientationAccuracy=e.join(\",\"))}))}),o((e=>e?e.trim().split(\",\").map(Number):null))],m.prototype,\"orientationAccuracy\",void 0),e([i({json:{...l(\"orientedImageryType\",p.write,p.read),type:p.apiValues}})],m.prototype,\"orientedImageryType\",void 0),e([i({json:{read:!1},value:\"oriented-imagery\",readOnly:!0})],m.prototype,\"type\",void 0),e([i({json:{...l(\"timeIntervalUnit\",s.write,s.read),type:s.apiValues}})],m.prototype,\"timeIntervalUnit\",void 0),e([i({type:Number,json:l(\"verticalFieldOfView\")})],m.prototype,\"verticalFieldOfView\",void 0),e([i({json:{...l(\"verticalMeasurementUnit\"),type:new r({Feet:\"feet\",Meter:\"meter\"}).apiValues}})],m.prototype,\"verticalMeasurementUnit\",void 0),e([i({type:String,json:l(\"videoPathPrefix\")})],m.prototype,\"videoPathPrefix\",void 0),e([i({type:String,json:l(\"videoPathSuffix\")})],m.prototype,\"videoPathSuffix\",void 0),m=e([a(\"esri.layers.OrientedImageryLayer\")],m);const u=m;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(r){super(r),this.field=null,this.type=null}clone(){return console.warn(\".clone() is not implemented for \"+this.declaredClass),null}};r([e({type:String,json:{write:{enabled:!0,isRequired:!0}}})],t.prototype,\"field\",void 0),r([e({readOnly:!0,nonNullable:!0,json:{read:!1}})],t.prototype,\"type\",void 0),t=r([s(\"esri.layers.pointCloudFilters.PointCloudFilter\")],t);const l=t;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{clone as r}from\"../../core/lang.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as i}from\"../../core/accessorSupport/ensureType.js\";import{enumeration as o}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import l from\"./PointCloudFilter.js\";var d;let p=d=class extends l{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type=\"bitfield\"}clone(){return new d({field:this.field,requiredClearBits:r(this.requiredClearBits),requiredSetBits:r(this.requiredSetBits)})}};e([t({type:[i],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,\"requiredClearBits\",void 0),e([t({type:[i],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,\"requiredSetBits\",void 0),e([o({pointCloudBitfieldFilter:\"bitfield\"})],p.prototype,\"type\",void 0),p=d=e([s(\"esri.layers.pointCloudFilters.PointCloudBitfieldFilter\")],p);const u=p;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{clone as e}from\"../../core/lang.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{enumeration as o}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"./PointCloudFilter.js\";var n;let p=n=class extends i{constructor(r){super(r),this.includedReturns=[],this.type=\"return\"}clone(){return new n({field:this.field,includedReturns:e(this.includedReturns)})}};r([t({type:[[\"firstOfMany\",\"last\",\"lastOfMany\",\"single\"]],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,\"includedReturns\",void 0),r([o({pointCloudReturnFilter:\"return\"})],p.prototype,\"type\",void 0),p=n=r([s(\"esri.layers.pointCloudFilters.PointCloudReturnFilter\")],p);const u=p;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{clone as o}from\"../../core/lang.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{enumeration as t}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"./PointCloudFilter.js\";var p;let l=p=class extends i{constructor(e){super(e),this.mode=\"exclude\",this.type=\"value\",this.values=[]}clone(){return new p({field:this.field,mode:this.mode,values:o(this.values)})}};e([r({type:[\"exclude\",\"include\"],json:{write:{enabled:!0,isRequired:!0}}})],l.prototype,\"mode\",void 0),e([t({pointCloudValueFilter:\"value\"})],l.prototype,\"type\",void 0),e([r({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],l.prototype,\"values\",void 0),l=p=e([s(\"esri.layers.pointCloudFilters.PointCloudValueFilter\")],l);const u=l;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"./PointCloudBitfieldFilter.js\";import o from\"./PointCloudFilter.js\";import i from\"./PointCloudReturnFilter.js\";import r from\"./PointCloudValueFilter.js\";const e={key:\"type\",base:o,typeMap:{value:r,bitfield:t,return:i}};export{e as types};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import{clone as o}from\"../core/lang.js\";import{property as e}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{enumeration as t}from\"../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../core/accessorSupport/decorators/subclass.js\";import p from\"./PointCloudRenderer.js\";var i;let c=i=class extends p{constructor(r){super(r),this.type=\"point-cloud-rgb\",this.field=null}clone(){return new i({...this.cloneProperties(),field:o(this.field)})}};r([t({pointCloudRGBRenderer:\"point-cloud-rgb\"})],c.prototype,\"type\",void 0),r([e({type:String,json:{write:!0}})],c.prototype,\"field\",void 0),c=i=r([s(\"esri.renderers.PointCloudRGBRenderer\")],c);const n=c;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../PointCloudClassBreaksRenderer.js\";import o from\"../../PointCloudRenderer.js\";import r from\"../../PointCloudRGBRenderer.js\";import t from\"../../PointCloudStretchRenderer.js\";import n from\"../../PointCloudUniqueValueRenderer.js\";const i={key:\"type\",base:o,typeMap:{\"point-cloud-class-breaks\":e,\"point-cloud-rgb\":r,\"point-cloud-stretch\":t,\"point-cloud-unique-value\":n},errorContext:\"renderer\"};export{i as types};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../PopupTemplate.js\";import t from\"../request.js\";import o from\"../core/Error.js\";import{clone as i}from\"../core/lang.js\";import s from\"../core/Logger.js\";import{MultiOriginJSONMixin as n}from\"../core/MultiOriginJSONSupport.js\";import{setDeepValue as a}from\"../core/object.js\";import{throwIfAbortError as p}from\"../core/promiseUtils.js\";import{join as l}from\"../core/urlUtils.js\";import{property as d}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{reader as u}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as c}from\"../core/accessorSupport/decorators/writer.js\";import y from\"./Layer.js\";import{APIKeyMixin as f}from\"./mixins/APIKeyMixin.js\";import{ArcGISService as h}from\"./mixins/ArcGISService.js\";import{OperationalLayer as g}from\"./mixins/OperationalLayer.js\";import{PortalLayer as v}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as w}from\"./mixins/ScaleRangeLayer.js\";import{SceneService as I,SaveOperationType as j}from\"./mixins/SceneService.js\";import{types as S}from\"./pointCloudFilters/typeUtils.js\";import{popupEnabled as b,elevationInfo as x,legendEnabled as T}from\"./support/commonProperties.js\";import P from\"./support/Field.js\";import{defineFieldProperties as F}from\"./support/fieldProperties.js\";import L from\"../popup/ExpressionInfo.js\";import{types as _}from\"../renderers/support/pointCloud/typeUtils.js\";import{logInvalidElevationInfoWarning as C,elevationModeRequiredMessage as E,featureExpressionUnsupportedMessage as A}from\"../support/elevationInfoUtils.js\";import{createPopupTemplate as N}from\"../support/popupUtils.js\";const R=F();let O=class extends(I(h(g(v(w(n(f(y)))))))){constructor(...e){super(...e),this.operationalLayerType=\"PointCloudLayer\",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type=\"point-cloud\"}normalizeCtorArgs(e,r){return\"string\"==typeof e?{url:e,...r}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const r=this.fieldsIndex.get(e);return r?.domain?r.domain:null}readServiceFields(e,r,t){return Array.isArray(e)?e.map((e=>{const r=new P;return\"FieldTypeInteger\"===e.type&&((e=i(e)).type=\"esriFieldTypeInteger\"),r.read(e,t),r})):Array.isArray(r.attributeStorageInfo)?r.attributeStorageInfo.map((e=>new P({name:e.name,type:\"ELEVATION\"===e.name?\"double\":\"integer\"}))):null}set elevationInfo(e){this._set(\"elevationInfo\",e),this._validateElevationInfo()}writeRenderer(e,r,t,o){a(\"layerDefinition.drawingInfo.renderer\",e.write({},o),r)}load(e){const r=null!=e?e.signal:null,t=this.loadFromPortal({supportedTypes:[\"Scene Service\"]},e).catch(p).then((()=>this._fetchService(r)));return this.addResolvingPromise(t),Promise.resolve(this)}createPopupTemplate(e){const r=N(this,e);return r&&(this._formatPopupTemplateReturnsField(r),this._formatPopupTemplateRGBField(r)),r}_formatPopupTemplateReturnsField(e){const r=this.fieldsIndex.get(\"RETURNS\");if(!r)return;const t=e.fieldInfos?.find((e=>e.fieldName===r.name));if(!t)return;const o=new L({name:\"pcl-returns-decoded\",title:r.alias||r.name,expression:`\\n var returnValue = $feature.${r.name};\\n return (returnValue % 16) + \" / \" + Floor(returnValue / 16);\\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName=\"expression/pcl-returns-decoded\"}_formatPopupTemplateRGBField(e){const r=this.fieldsIndex.get(\"RGB\");if(!r)return;const t=e.fieldInfos?.find((e=>e.fieldName===r.name));if(!t)return;const o=new L({name:\"pcl-rgb-decoded\",title:r.alias||r.name,expression:`\\n var rgb = $feature.${r.name};\\n var red = Floor(rgb / 65536, 0);\\n var green = Floor((rgb - (red * 65536)) / 256,0);\\n var blue = rgb - (red * 65536) - (green * 256);\\n\\n return \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName=\"expression/pcl-rgb-decoded\"}async queryCachedStatistics(e,r){if(await this.load(r),!this.attributeStorageInfo)throw new o(\"scenelayer:no-cached-statistics\",\"Cached statistics are not available for this layer\");const i=this.fieldsIndex.get(e);if(!i)throw new o(\"pointcloudlayer:field-unexisting\",`Field '${e}' does not exist on the layer`);for(const o of this.attributeStorageInfo)if(o.name===i.name){const e=l(this.parsedUrl.path,`./statistics/${o.key}`);return t(e,{query:{f:\"json\",token:this.apiKey},responseType:\"json\",signal:r?r.signal:null}).then((e=>e.data))}throw new o(\"pointcloudlayer:no-cached-statistics\",\"Cached statistics for this attribute are not available\")}async saveAs(e,r){return this._debouncedSaveOperations(j.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"point-cloud\"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"point-cloud\"};return this._debouncedSaveOperations(j.SAVE,e)}validateLayer(e){if(e.layerType&&\"PointCloud\"!==e.layerType)throw new o(\"pointcloudlayer:layer-type-not-supported\",\"PointCloudLayer does not support this layer type\",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o(\"layer:service-version-not-supported\",\"Service version is not supported.\",{serviceVersion:this.version.versionString,supportedVersions:\"1.x-2.x\"});if(this.version.major>2)throw new o(\"layer:service-version-too-new\",\"Service version is too new.\",{serviceVersion:this.version.versionString,supportedVersions:\"1.x-2.x\"})}hasCachedStatistics(e){return null!=this.attributeStorageInfo&&this.attributeStorageInfo.some((r=>r.name===e))}_getTypeKeywords(){return[\"PointCloud\"]}_validateElevationInfo(){const e=this.elevationInfo;C(s.getLogger(this),E(\"Point cloud layers\",\"absolute-height\",e)),C(s.getLogger(this),A(\"Point cloud layers\",e))}};e([d({type:[\"PointCloudLayer\"]})],O.prototype,\"operationalLayerType\",void 0),e([d(b)],O.prototype,\"popupEnabled\",void 0),e([d({type:r,json:{name:\"popupInfo\",write:!0}})],O.prototype,\"popupTemplate\",void 0),e([d({readOnly:!0,json:{read:!1}})],O.prototype,\"defaultPopupTemplate\",null),e([d({readOnly:!0,json:{write:!1,read:!1,origins:{\"web-document\":{write:!1,read:!1}}}})],O.prototype,\"opacity\",void 0),e([d({type:[\"show\",\"hide\"]})],O.prototype,\"listMode\",void 0),e([d({types:[S],json:{origins:{service:{read:{source:\"filters\"}}},name:\"layerDefinition.filters\",write:!0}})],O.prototype,\"filters\",void 0),e([d({type:[P]})],O.prototype,\"fields\",void 0),e([d(R.fieldsIndex)],O.prototype,\"fieldsIndex\",void 0),e([u(\"service\",\"fields\",[\"fields\",\"attributeStorageInfo\"])],O.prototype,\"readServiceFields\",null),e([d(R.outFields)],O.prototype,\"outFields\",void 0),e([d({readOnly:!0})],O.prototype,\"attributeStorageInfo\",void 0),e([d(x)],O.prototype,\"elevationInfo\",null),e([d({type:String,json:{origins:{\"web-scene\":{read:!0,write:!0},\"portal-item\":{read:!0,write:!0}},read:!1}})],O.prototype,\"path\",void 0),e([d(T)],O.prototype,\"legendEnabled\",void 0),e([d({types:_,json:{origins:{service:{read:{source:\"drawingInfo.renderer\"}}},name:\"layerDefinition.drawingInfo.renderer\",write:{target:{\"layerDefinition.drawingInfo.renderer\":{types:_},\"layerDefinition.drawingInfo.transparency\":{type:Number}}}}})],O.prototype,\"renderer\",void 0),e([c(\"renderer\")],O.prototype,\"writeRenderer\",null),e([d({json:{read:!1},readOnly:!0})],O.prototype,\"type\",void 0),O=e([m(\"esri.layers.PointCloudLayer\")],O);const V=O;export{V as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{symbolTypes as t}from\"../../symbols.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"../../symbols/SimpleMarkerSymbol.js\";let p=class extends r{constructor(o){super(o),this.break=new i({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new i({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new i({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new i({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new i({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new i({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};o([s({types:t})],p.prototype,\"break\",void 0),o([s({types:t})],p.prototype,\"first\",void 0),o([s({types:t})],p.prototype,\"unlocated\",void 0),o([s({types:t})],p.prototype,\"last\",void 0),o([s({types:t})],p.prototype,\"middle\",void 0),o([s({types:t})],p.prototype,\"waypoint\",void 0),p=o([e(\"esri.layers.support.RouteStopSymbols\")],p);const l=p;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{symbolTypes as r}from\"../../symbols.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"./RouteStopSymbols.js\";import p from\"../../symbols/SimpleLineSymbol.js\";import l from\"../../symbols/SimpleMarkerSymbol.js\";import m from\"../../symbols/SimpleFillSymbol.js\";let c=class extends t{constructor(o){super(o),this.directionLines=new p({color:[0,122,194],width:6}),this.directionPoints=new l({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new l({style:\"x\",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new m({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new p({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new p({width:8,color:[20,89,127]}),this.stops=new i}};o([s({types:r})],c.prototype,\"directionLines\",void 0),o([s({types:r})],c.prototype,\"directionPoints\",void 0),o([s({types:r})],c.prototype,\"pointBarriers\",void 0),o([s({types:r})],c.prototype,\"polygonBarriers\",void 0),o([s({types:r})],c.prototype,\"polylineBarriers\",void 0),o([s({types:r})],c.prototype,\"routeInfo\",void 0),o([s({type:i})],c.prototype,\"stops\",void 0),c=o([e(\"esri.layers.support.RouteSymbols\")],c);const n=c;export{n as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as o}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{impedanceAttributeNameJsonMap as p,durationImpedanceAttributeNameJsonMap as i,networkAttributeUnitJsonMap as a,usageTypeJsonMap as n}from\"./networkEnums.js\";let u=class extends r{constructor(t){super(t),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};t([e({type:String})],u.prototype,\"dataType\",void 0),t([o(p,{ignoreUnknown:!1})],u.prototype,\"name\",void 0),t([e({type:[String]})],u.prototype,\"parameterNames\",void 0),t([e({type:String})],u.prototype,\"restrictionUsageParameterName\",void 0),t([o(i,{ignoreUnknown:!1})],u.prototype,\"timeNeutralAttributeName\",void 0),t([e({type:String})],u.prototype,\"trafficSupport\",void 0),t([o(a)],u.prototype,\"units\",void 0),t([o(n)],u.prototype,\"usageType\",void 0),u=t([s(\"esri.rest.support.NetworkAttribute\")],u);const m=u;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./NetworkAttribute.js\";let p=class extends r{constructor(t){super(t),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};t([o({type:Number})],p.prototype,\"buildTime\",void 0),t([o({type:String})],p.prototype,\"name\",void 0),t([o({type:[s]})],p.prototype,\"networkAttributes\",void 0),t([o()],p.prototype,\"networkSources\",void 0),t([o({type:String})],p.prototype,\"state\",void 0),p=t([e(\"esri.rest.support.NetworkDataset\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as o}from\"../../core/accessorSupport/decorators/enumeration.js\";import{reader as s}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as a}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as i}from\"../../core/accessorSupport/decorators/writer.js\";import u from\"./NetworkDataset.js\";import{impedanceAttributeNameJsonMap as p,directionsLengthUnitJsonMap as l,durationImpedanceAttributeNameJsonMap as n}from\"./networkEnums.js\";import d from\"./TravelMode.js\";let c=class extends e{constructor(t){super(t),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(t){return null==t?null:t.map((t=>p.fromJSON(t)))}writeAccumulateAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>p.toJSON(t))))}readDefaultTravelMode(t,e){const r=e.supportedTravelModes?.find((({id:t})=>t===e.defaultTravelMode))??e.supportedTravelModes?.find((({itemId:t})=>t===e.defaultTravelMode));return r?d.fromJSON(r):null}};t([r()],c.prototype,\"accumulateAttributeNames\",void 0),t([s(\"accumulateAttributeNames\")],c.prototype,\"readAccumulateAttributes\",null),t([i(\"accumulateAttributeNames\")],c.prototype,\"writeAccumulateAttributes\",null),t([r()],c.prototype,\"attributeParameterValues\",void 0),t([r()],c.prototype,\"currentVersion\",void 0),t([r()],c.prototype,\"defaultTravelMode\",void 0),t([s(\"defaultTravelMode\",[\"defaultTravelMode\",\"supportedTravelModes\"])],c.prototype,\"readDefaultTravelMode\",null),t([r()],c.prototype,\"directionsLanguage\",void 0),t([o(l)],c.prototype,\"directionsLengthUnits\",void 0),t([r()],c.prototype,\"directionsSupportedLanguages\",void 0),t([o(n,{ignoreUnknown:!1})],c.prototype,\"directionsTimeAttribute\",void 0),t([r()],c.prototype,\"hasZ\",void 0),t([o(p,{ignoreUnknown:!1})],c.prototype,\"impedance\",void 0),t([r({type:u})],c.prototype,\"networkDataset\",void 0),t([r({type:[d]})],c.prototype,\"supportedTravelModes\",void 0),c=t([a(\"esri.rest.support.NetworkServiceDescription\")],c);const m=c;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../request.js\";import r from\"../core/Error.js\";import t from\"../core/Logger.js\";import{getDeepValue as o}from\"../core/object.js\";import{removeTrailingSlash as s}from\"../core/urlUtils.js\";import{asValidOptions as a,parseUrl as n}from\"./utils.js\";import i from\"./support/NetworkServiceDescription.js\";const l=t.getLogger(\"esri.rest.networkService\");function u(e,r,t,o){o[t]=[r.length,r.length+e.length],e.forEach((e=>{r.push(e.geometry)}))}function f(e,r){for(let t=0;t=10.4?p(t,o,s):v(t,s),{defaultTravelMode:f,supportedTravelModes:c}=await u;return l.defaultTravelMode=f,l.supportedTravelModes=c,i.fromJSON(l)}async function v(r,t){const i=a({f:\"json\"},t),{data:l}=await e(r.replace(/\\/rest\\/.*$/i,\"/info\"),i);if(!l?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:u}=l,f=s(u)+\"/sharing/rest/portals/self\",{data:c}=await e(f,i),d=o(\"helperServices.routingUtilities.url\",c);if(!d)return{supportedTravelModes:[],defaultTravelMode:null};const v=n(u),p=/\\/solve$/i.test(v.path)?\"Route\":/\\/solveclosestfacility$/i.test(v.path)?\"ClosestFacility\":\"ServiceAreas\",m=a({f:\"json\",serviceName:p},t),h=s(d)+\"/GetTravelModes/execute\",g=await e(h,m),w=[];let T=null;if(g?.data?.results?.length){const e=g.data.results;for(const r of e)if(\"supportedTravelModes\"===r.paramName){if(r.value?.features)for(const{attributes:e}of r.value.features)if(e){const r=JSON.parse(e.TravelMode);w.push(r)}}else\"defaultTravelMode\"===r.paramName&&(T=r.value)}return{supportedTravelModes:w,defaultTravelMode:T}}async function p(t,o,n){try{const r=a({f:\"json\",token:o},n),i=s(t)+\"/retrieveTravelModes\",{data:{supportedTravelModes:l,defaultTravelMode:u}}=await e(i,r);return{supportedTravelModes:l,defaultTravelMode:u}}catch(i){throw new r(\"network-service:retrieveTravelModes\",\"Could not get to the NAServer's retrieveTravelModes.\",{error:i})}}export{u as collectGeometries,f as dropZValuesOffInputGeometry,d as fetchServiceDescription,c as isInputGeometryZAware};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{JSONMap as s}from\"../../core/jsonMap.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";const p=new s({esriJobMessageTypeInformative:\"informative\",esriJobMessageTypeProcessDefinition:\"process-definition\",esriJobMessageTypeProcessStart:\"process-start\",esriJobMessageTypeProcessStop:\"process-stop\",esriJobMessageTypeWarning:\"warning\",esriJobMessageTypeError:\"error\",esriJobMessageTypeEmpty:\"empty\",esriJobMessageTypeAbort:\"abort\"});let i=class extends r{constructor(e){super(e),this.description=null,this.type=null}};e([o({type:String,json:{write:!0}})],i.prototype,\"description\",void 0),e([o({type:String,json:{read:p.read,write:p.write}})],i.prototype,\"type\",void 0),i=e([t(\"esri.rest.support.GPMessage\")],i);const a=i;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONMap as s}from\"../../core/jsonMap.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import t from\"./GPMessage.js\";const p=new s({0:\"informative\",1:\"process-definition\",2:\"process-start\",3:\"process-stop\",50:\"warning\",100:\"error\",101:\"empty\",200:\"abort\"});let c=class extends t{constructor(r){super(r),this.type=null}};r([o({type:String,json:{read:p.read,write:p.write}})],c.prototype,\"type\",void 0),c=r([e(\"esri.rest.support.NAMessage\")],c);const a=c;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as t}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import{directionsStringTypeJsonMap as p}from\"./networkEnums.js\";let c=class extends o{constructor(r){super(r)}};r([s({json:{read:{source:\"string\"}}})],c.prototype,\"text\",void 0),r([t(p,{name:\"stringType\"})],c.prototype,\"type\",void 0),c=r([e(\"esri.rest.support.DirectionsString\")],c);const i=c;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as o}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as t}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import{getTimezoneOffset as i}from\"../route/utils.js\";import p from\"./DirectionsString.js\";import m from\"../../geometry/Point.js\";let a=class extends e{constructor(r){super(r),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(r,e){return i(e.ETA,e.arriveTimeUTC)}readGeometry(r,e){return m.fromJSON(e.point)}};r([o({type:Date,json:{read:{source:\"arriveTimeUTC\"}}})],a.prototype,\"arriveTime\",void 0),r([o()],a.prototype,\"arriveTimeOffset\",void 0),r([t(\"arriveTimeOffset\",[\"arriveTimeUTC\",\"ETA\"])],a.prototype,\"readArriveTimeOffset\",null),r([o({type:m})],a.prototype,\"geometry\",void 0),r([t(\"geometry\",[\"point\"])],a.prototype,\"readGeometry\",null),r([o({type:[p]})],a.prototype,\"strings\",void 0),a=r([s(\"esri.rest.support.DirectionsEvent\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import e from\"../../Graphic.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as s}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import p from\"./DirectionsEvent.js\";import n from\"./DirectionsString.js\";import c from\"../../geometry/Polyline.js\";function i(r){if(null==r||\"\"===r)return null;let e=0,t=0,s=0,o=0;const p=[];let n,c,i,a,m,l,u,f,y=0,d=0,h=0;if(m=r.match(/((\\+|\\-)[^\\+\\-\\|]+|\\|)/g),m||(m=[]),0===parseInt(m[y],32)){y=2;const r=parseInt(m[y],32);y++,l=parseInt(m[y],32),y++,1&r&&(d=m.indexOf(\"|\")+1,u=parseInt(m[d],32),d++),2&r&&(h=m.indexOf(\"|\",d)+1,f=parseInt(m[h],32),h++)}else l=parseInt(m[y],32),y++;for(;y0,hasM:h>0}}let a=class extends e{constructor(r){super(r),this.events=null,this.strings=null}readGeometry(r,e){const t=i(e.compressedGeometry);return null!=t?c.fromJSON(t):null}};r([t({type:[p]})],a.prototype,\"events\",void 0),r([s(\"geometry\",[\"compressedGeometry\"])],a.prototype,\"readGeometry\",null),r([t({type:[n]})],a.prototype,\"strings\",void 0),a=r([o(\"esri.rest.support.DirectionsFeature\")],a);const m=a;export{m as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{isSome as t}from\"../../core/arrayUtils.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/has.js\";import{reader as o}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import a from\"./DirectionsFeature.js\";import n from\"./FeatureSet.js\";import p from\"../../geometry/SpatialReference.js\";import i from\"../../geometry/Extent.js\";import l from\"../../geometry/Polyline.js\";function u(e,t){if(0===e.length)return new l({spatialReference:t});const r=[];for(const n of e)for(const e of n.paths)r.push(...e);const o=[];r.forEach(((e,t)=>{0!==t&&e[0]===r[t-1][0]&&e[1]===r[t-1][1]||o.push(e)}));const{hasM:s,hasZ:a}=e[0];return new l({hasM:s,hasZ:a,paths:[o],spatialReference:t})}let m=class extends n{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType=\"polyline\",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,t){if(!e)return[];const r=t.summary.envelope.spatialReference??t.spatialReference,o=r&&p.fromJSON(r);return e.map((e=>{const t=a.fromJSON(e);if(null!=t.geometry&&(t.geometry.spatialReference=o),null!=t.events)for(const r of t.events)null!=r.geometry&&(r.geometry.spatialReference=o);return t}))}get mergedGeometry(){if(!this.features)return null;return u(this.features.map((({geometry:e})=>e)),this.extent.spatialReference)}get strings(){return this.features.flatMap((({strings:e})=>e)).filter(t)}};e([r({type:i,json:{read:{source:\"summary.envelope\"}}})],m.prototype,\"extent\",void 0),e([r({nonNullable:!0})],m.prototype,\"features\",void 0),e([o(\"features\")],m.prototype,\"readFeatures\",null),e([r()],m.prototype,\"geometryType\",void 0),e([r({readOnly:!0})],m.prototype,\"mergedGeometry\",null),e([r()],m.prototype,\"routeId\",void 0),e([r()],m.prototype,\"routeName\",void 0),e([r({value:null,readOnly:!0})],m.prototype,\"strings\",null),e([r({json:{read:{source:\"summary.totalDriveTime\"}}})],m.prototype,\"totalDriveTime\",void 0),e([r({json:{read:{source:\"summary.totalLength\"}}})],m.prototype,\"totalLength\",void 0),e([r({json:{read:{source:\"summary.totalTime\"}}})],m.prototype,\"totalTime\",void 0),m=e([s(\"esri.rest.support.DirectionsFeatureSet\")],m);const c=m;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import o from\"../../Graphic.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"./DirectionsFeatureSet.js\";import p from\"./FeatureSet.js\";let n=class extends r{constructor(t){super(t),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};t([e({type:p,json:{write:!0}})],n.prototype,\"directionLines\",void 0),t([e({type:p,json:{write:!0}})],n.prototype,\"directionPoints\",void 0),t([e({type:i,json:{write:!0}})],n.prototype,\"directions\",void 0),t([e({type:o,json:{write:!0}})],n.prototype,\"route\",void 0),t([e({type:String,json:{write:!0}})],n.prototype,\"routeName\",void 0),t([e({type:[o],json:{write:!0}})],n.prototype,\"stops\",void 0),t([e({type:p,json:{write:!0}})],n.prototype,\"traversedEdges\",void 0),t([e({type:p,json:{write:!0}})],n.prototype,\"traversedJunctions\",void 0),t([e({type:p,json:{write:!0}})],n.prototype,\"traversedTurns\",void 0),n=t([s(\"esri.rest.support.RouteResult\")],n);const u=n;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import o from\"../../Graphic.js\";import{isSome as e}from\"../../core/arrayUtils.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/has.js\";import{reader as p}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import a from\"./FeatureSet.js\";import l from\"./NAMessage.js\";import u from\"./RouteResult.js\";function n(r){return r?a.fromJSON(r).features.filter(e):[]}let c=class extends s{constructor(r){super(r),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(r,o){return n(o.barriers)}readPolylineBarriers(r){return n(r)}readPolygonBarriers(r){return n(r)}};r([t({type:[l]})],c.prototype,\"messages\",void 0),r([t({type:[o]})],c.prototype,\"pointBarriers\",void 0),r([p(\"pointBarriers\",[\"barriers\"])],c.prototype,\"readPointBarriers\",null),r([t({type:[o]})],c.prototype,\"polylineBarriers\",void 0),r([p(\"polylineBarriers\")],c.prototype,\"readPolylineBarriers\",null),r([t({type:[o]})],c.prototype,\"polygonBarriers\",void 0),r([p(\"polygonBarriers\")],c.prototype,\"readPolygonBarriers\",null),r([t({type:[u]})],c.prototype,\"routeResults\",void 0),c=r([i(\"esri.rest.support.RouteSolveResult\")],c);const y=c;export{y as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../request.js\";import{get as r}from\"../core/accessorSupport/get.js\";import{normalizeCentralMeridian as t}from\"../geometry/support/normalizeUtils.js\";import{collectGeometries as s,isInputGeometryZAware as o,fetchServiceDescription as a,dropZValuesOffInputGeometry as i}from\"./networkService.js\";import{parseUrl as n}from\"./utils.js\";import{routeParametersToQueryParameters as u}from\"./route/utils.js\";import f from\"./support/FeatureSet.js\";import p from\"./support/RouteSolveResult.js\";function c(e){return e instanceof f}async function l(f,p,l){const y=[],d=[],g={},h={},R=n(f),{path:v}=R;c(p.stops)&&s(p.stops.features,d,\"stops.features\",g),c(p.pointBarriers)&&s(p.pointBarriers.features,d,\"pointBarriers.features\",g),c(p.polylineBarriers)&&s(p.polylineBarriers.features,d,\"polylineBarriers.features\",g),c(p.polygonBarriers)&&s(p.polygonBarriers.features,d,\"polygonBarriers.features\",g);const B=await t(d);for(const e in g){const r=g[e];y.push(e),h[e]=B.slice(r[0],r[1])}if(o(h,y)){let e=null;try{e=await a(v,p.apiKey,l)}catch{}e&&!e.hasZ&&i(h,y)}for(const e in h)h[e].forEach(((t,s)=>{r(p,e)[s].geometry=t}));const E={...l,query:{...R.query,...u(p),f:\"json\"}},T=v.endsWith(\"/solve\")?v:`${v}/solve`,{data:b}=await e(T,E);return m(b)}function m(e){const{barriers:r,directionLines:t,directionPoints:s,directions:o,messages:a,polygonBarriers:i,polylineBarriers:n,routes:u,stops:f,traversedEdges:c,traversedJunctions:l,traversedTurns:m}=e,y=e=>{const r=g.find((r=>r.routeName===e));if(null!=r)return r;const t={routeId:g.length+1,routeName:e};return g.push(t),t},d=e=>{const r=g.find((r=>r.routeId===e));if(null!=r)return r;const t={routeId:e,routeName:null};return g.push(t),t},g=[];u?.features.forEach(((e,r)=>{e.geometry.spatialReference=u.spatialReference??void 0;const t=e.attributes.Name,s=r+1;g.push({routeId:s,routeName:t,route:e})})),o?.forEach((e=>{const{routeName:r}=e;y(r).directions=e}));const h=(f?.features.every((e=>null==e.attributes.RouteName))??!1)&&g.length>0?g[0].routeName:null;return f?.features.forEach((e=>{e.geometry&&(e.geometry.spatialReference??=f.spatialReference??void 0);const r=h??e.attributes.RouteName,t=y(r);t.stops??=[],t.stops.push(e)})),t?.features.forEach((e=>{const r=e.attributes.RouteID,s=d(r),{geometryType:o,spatialReference:a}=t;s.directionLines??={features:[],geometryType:o,spatialReference:a},s.directionLines.features.push(e)})),s?.features.forEach((e=>{const r=e.attributes.RouteID,t=d(r),{geometryType:o,spatialReference:a}=s;t.directionPoints??={features:[],geometryType:o,spatialReference:a},t.directionPoints.features.push(e)})),c?.features.forEach((e=>{const r=e.attributes.RouteID,t=d(r),{geometryType:s,spatialReference:o}=c;t.traversedEdges??={features:[],geometryType:s,spatialReference:o},t.traversedEdges.features.push(e)})),l?.features.forEach((e=>{const r=e.attributes.RouteID,t=d(r),{geometryType:s,spatialReference:o}=l;t.traversedJunctions??={features:[],geometryType:s,spatialReference:o},t.traversedJunctions.features.push(e)})),m?.features.forEach((e=>{const r=e.attributes.RouteID,t=d(r);t.traversedTurns??={features:[]},t.traversedTurns.features.push(e)})),p.fromJSON({routeResults:g,barriers:r,polygonBarriers:i,polylineBarriers:n,messages:a})}export{l as solve};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst t={type:String,json:{read:{source:\"token\"},write:{target:\"token\"}}};export{t as apiKey};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{geometryTypes as t}from\"../../geometry.js\";import{ClonableMixin as e}from\"../../core/Clonable.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as p}from\"../../core/accessorSupport/decorators/enumeration.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import{geometryTypeJsonMap as a,spatialRelationshipJsonMap as m}from\"./networkEnums.js\";import{fromJSON as n}from\"../../geometry/support/jsonUtils.js\";let l=class extends(e(r)){constructor(o){super(o),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type=\"layer\",this.where=null}};o([s({type:Boolean,json:{write:!0}})],l.prototype,\"doNotLocateOnRestrictedElements\",void 0),o([s({types:t,json:{read:n,write:!0}})],l.prototype,\"geometry\",void 0),o([p(a)],l.prototype,\"geometryType\",void 0),o([s({type:String,json:{name:\"layerName\",write:!0}})],l.prototype,\"name\",void 0),o([p(m,{name:\"spatialRel\"})],l.prototype,\"spatialRelationship\",void 0),o([s({type:String,json:{write:!0}})],l.prototype,\"type\",void 0),o([s({type:String,json:{write:!0}})],l.prototype,\"where\",void 0),l=o([i(\"esri.rest.support.DataLayer\")],l);const c=l;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import r from\"./FeatureSet.js\";var s;let c=s=class extends r{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new s({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};e([t({type:Boolean,json:{write:!0}})],c.prototype,\"doNotLocateOnRestrictedElements\",void 0),c=s=e([o(\"esri.rest.support.NetworkFeatureSet\")],c);const p=c;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";let p=class extends(r(t)){constructor(o){super(o),this.doNotLocateOnRestrictedElements=null,this.url=null}};o([e({type:Boolean,json:{write:!0}})],p.prototype,\"doNotLocateOnRestrictedElements\",void 0),o([e({type:String,json:{write:!0}})],p.prototype,\"url\",void 0),p=o([s(\"esri.rest.support.NetworkUrl\")],p);const c=p;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import\"../../geometry.js\";import{ClonableMixin as e}from\"../../core/Clonable.js\";import r from\"../../core/Collection.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import{ensureClass as s}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{enumeration as n}from\"../../core/accessorSupport/decorators/enumeration.js\";import{reader as p}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as u}from\"../../core/accessorSupport/decorators/subclass.js\";import{writer as l}from\"../../core/accessorSupport/decorators/writer.js\";import{apiKey as a}from\"./commonProperties.js\";import y from\"./DataLayer.js\";import m from\"./FeatureSet.js\";import{impedanceAttributeNameJsonMap as c,restrictionAttributeNameJsonMap as d,directionsLengthUnitJsonMap as v,directionsOutputTypeJsonMap as w,directionsStyleNameJsonMap as j,durationImpedanceAttributeNameJsonMap as h,lengthUnitJsonMap as S,outputLineJsonMap as B,restrictUTurnJsonMap as f}from\"./networkEnums.js\";import b from\"./NetworkFeatureSet.js\";import T from\"./NetworkUrl.js\";import g from\"./TravelMode.js\";import A from\"../../geometry/SpatialReference.js\";var N;let P=N=class extends(e(o)){constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines=\"true-shape\",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(t){return s(N,t)}readAccumulateAttributes(t){return null==t?null:t.map((t=>c.fromJSON(t)))}writeAccumulateAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>c.toJSON(t))))}writePointBarriers(t,e,r){D(t,e,r)}writePolygonBarrier(t,e,r){D(t,e,r)}writePolylineBarrier(t,e,r){D(t,e,r)}readRestrictionAttributes(t){return null==t?null:t.map((t=>d.fromJSON(t)))}writeRestrictionAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>d.toJSON(t))))}readStartTime(t,e){const{startTime:r}=e;return null==r?null:\"now\"===r?\"now\":new Date(r)}writeStartTime(t,e){null!=t&&(e.startTime=\"now\"===t?\"now\":t.getTime())}readStops(t,e){return C(e.stops)}writeStops(t,e,r){D(t,e,r)}};t([i({type:[String],json:{name:\"accumulateAttributeNames\",write:!0}})],P.prototype,\"accumulateAttributes\",void 0),t([p(\"accumulateAttributes\")],P.prototype,\"readAccumulateAttributes\",null),t([l(\"accumulateAttributes\")],P.prototype,\"writeAccumulateAttributes\",null),t([i(a)],P.prototype,\"apiKey\",void 0),t([i({json:{write:!0}})],P.prototype,\"attributeParameterValues\",void 0),t([i({type:String,json:{write:!0}})],P.prototype,\"directionsLanguage\",void 0),t([n(v)],P.prototype,\"directionsLengthUnits\",void 0),t([n(w)],P.prototype,\"directionsOutputType\",void 0),t([n(j)],P.prototype,\"directionsStyleName\",void 0),t([n(h,{name:\"directionsTimeAttributeName\",ignoreUnknown:!1})],P.prototype,\"directionsTimeAttribute\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"findBestSequence\",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,\"geometryPrecision\",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,\"geometryPrecisionM\",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,\"geometryPrecisionZ\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"ignoreInvalidLocations\",void 0),t([n(c,{name:\"impedanceAttributeName\",ignoreUnknown:!1})],P.prototype,\"impedanceAttribute\",void 0),t([i({type:Number,json:{write:!0}})],P.prototype,\"outputGeometryPrecision\",void 0),t([n(S)],P.prototype,\"outputGeometryPrecisionUnits\",void 0),t([n(B)],P.prototype,\"outputLines\",void 0),t([i({type:A,json:{name:\"outSR\",write:!0}})],P.prototype,\"outSpatialReference\",void 0),t([i({json:{write:!0}})],P.prototype,\"overrides\",void 0),t([i({json:{name:\"barriers\",write:!0}})],P.prototype,\"pointBarriers\",void 0),t([l(\"pointBarriers\")],P.prototype,\"writePointBarriers\",null),t([i({json:{write:!0}})],P.prototype,\"polygonBarriers\",void 0),t([l(\"polygonBarriers\")],P.prototype,\"writePolygonBarrier\",null),t([i({json:{write:!0}})],P.prototype,\"polylineBarriers\",void 0),t([l(\"polylineBarriers\")],P.prototype,\"writePolylineBarrier\",null),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"preserveFirstStop\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"preserveLastStop\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"preserveObjectID\",void 0),t([i({type:[String],json:{name:\"restrictionAttributeNames\",write:!0}})],P.prototype,\"restrictionAttributes\",void 0),t([p(\"restrictionAttributes\")],P.prototype,\"readRestrictionAttributes\",null),t([l(\"restrictionAttributes\")],P.prototype,\"writeRestrictionAttributes\",null),t([n(f)],P.prototype,\"restrictUTurns\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnBarriers\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnDirections\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnPolygonBarriers\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnPolylineBarriers\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnRoutes\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnStops\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnTraversedEdges\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnTraversedJunctions\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnTraversedTurns\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"returnZ\",void 0),t([i({type:Date,json:{type:Number,write:!0}})],P.prototype,\"startTime\",void 0),t([p(\"startTime\")],P.prototype,\"readStartTime\",null),t([l(\"startTime\")],P.prototype,\"writeStartTime\",null),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"startTimeIsUTC\",void 0),t([i({json:{write:!0}})],P.prototype,\"stops\",void 0),t([p(\"stops\")],P.prototype,\"readStops\",null),t([l(\"stops\")],P.prototype,\"writeStops\",null),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"timeWindowsAreUTC\",void 0),t([i({type:g,json:{write:!0}})],P.prototype,\"travelMode\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"useHierarchy\",void 0),t([i({type:Boolean,json:{write:!0}})],P.prototype,\"useTimeWindows\",void 0),P=N=t([u(\"esri.rest.support.RouteParameters\")],P);const O=P;function U(t){return t&&\"type\"in t}function J(t){return t&&\"features\"in t&&\"doNotLocateOnRestrictedElements\"in t}function L(t){return t&&\"url\"in t}function R(t){return t&&\"features\"in t}function C(t){return U(t)?y.fromJSON(t):L(t)?T.fromJSON(t):J(t)?b.fromJSON(t):R(t)?m.fromJSON(t):null}function D(t,e,o){null!=t&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}export{O as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../config.js\";import\"../geometry.js\";import r from\"../Graphic.js\";import o from\"../PopupTemplate.js\";import\"../renderers/ClassBreaksRenderer.js\";import\"../renderers/DictionaryRenderer.js\";import\"../renderers/DotDensityRenderer.js\";import\"../renderers/HeatmapRenderer.js\";import\"../renderers/PieChartRenderer.js\";import\"../renderers/Renderer.js\";import\"../renderers/SimpleRenderer.js\";import\"../renderers/UniqueValueRenderer.js\";import{read as i}from\"../renderers/support/jsonUtils.js\";import s from\"../core/Logger.js\";import n from\"../core/Collection.js\";import l from\"../core/Error.js\";import{MultiOriginJSONMixin as a}from\"../core/MultiOriginJSONSupport.js\";import{setDeepValue as u}from\"../core/object.js\";import{isAbortError as p}from\"../core/promiseUtils.js\";import{on as c}from\"../core/reactiveUtils.js\";import{convertUnit as m}from\"../core/unitUtils.js\";import{urlToObject as y}from\"../core/urlUtils.js\";import{property as f}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as d}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as h}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as w}from\"../core/accessorSupport/decorators/writer.js\";import{updateOrigins as S}from\"../core/accessorSupport/originUtils.js\";import g from\"../geometry/Extent.js\";import{initializeProjection as b,project as v}from\"../geometry/projection.js\";import{WGS84 as B}from\"../geometry/support/spatialReferenceUtils.js\";import P from\"./Layer.js\";import{BlendLayer as j}from\"./mixins/BlendLayer.js\";import{OperationalLayer as N}from\"./mixins/OperationalLayer.js\";import{PortalLayer as I}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as _}from\"./mixins/ScaleRangeLayer.js\";import{sanitizeUrl as R}from\"./support/arcgisLayerUrl.js\";import D from\"./support/RouteSymbols.js\";import L from\"../portal/Portal.js\";import C from\"../portal/PortalItem.js\";import{TypeKeyword as O}from\"../portal/support/portalItemUtils.js\";import{fetchServiceDescription as F}from\"../rest/networkService.js\";import{solve as T}from\"../rest/route.js\";import x from\"../rest/support/DirectionLine.js\";import k from\"../rest/support/DirectionPoint.js\";import A from\"../rest/support/PointBarrier.js\";import G from\"../rest/support/PolygonBarrier.js\";import J from\"../rest/support/PolylineBarrier.js\";import U from\"../rest/support/RouteInfo.js\";import M from\"../rest/support/RouteParameters.js\";import q from\"../rest/support/RouteSettings.js\";import E from\"../rest/support/Stop.js\";import W from\"../geometry/SpatialReference.js\";import V from\"../geometry/Multipoint.js\";function z(e){return e.length?e:null}function H(e){switch(e){case\"esriGeometryPoint\":return{type:\"esriSMS\",style:\"esriSMSCircle\",size:12,color:[0,0,0,0],outline:H(\"esriGeometryPolyline\")};case\"esriGeometryPolyline\":return{type:\"esriSLS\",style:\"esriSLSSolid\",width:1,color:[0,0,0,0]};case\"esriGeometryPolygon\":return{type:\"esriSFS\",style:\"esriSFSNull\",outline:H(\"esriGeometryPolyline\")}}}function K(e){return\"layers\"in e}function Q(e){return\"esri.rest.support.FeatureSet\"===e.declaredClass}function Y(e){return\"esri.rest.support.NetworkFeatureSet\"===e.declaredClass}function Z(e,t,r){const o=t.networkDataset?.networkAttributes,i=o?.filter((({usageType:e})=>\"cost\"===e))??[],s=r.travelMode??t.defaultTravelMode;if(null==s)return void ue.warn(\"route-layer:missing-travel-mode\",\"The routing service must have a default travel mode or one must be specified in the route parameter.\");const{timeAttributeName:n,distanceAttributeName:a}=s,u=i.find((({name:e})=>e===n)),p=i.find((({name:e})=>e===a)),c=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,m=u?.units,y=p?.units;if(!m||!y)throw new l(\"routelayer:unknown-impedance-units\",\"the units of either the distance or time impedance are unknown\");const f=r.directionsLanguage??t.directionsLanguage,d=r.accumulateAttributes??t.accumulateAttributeNames??[],h=new Set(i.filter((({name:e})=>e===n||e===a||e===c||null!=e&&d.includes(e))).map((({name:e})=>e))),w=e=>{for(const t in e)h.has(t)||delete e[t]};for(const l of e.pointBarriers)null!=l.costs&&(l.addedCost=l.costs[c]??0,w(l.costs));for(const l of e.polygonBarriers)null!=l.costs&&(l.scaleFactor=l.costs[c]??1,w(l.costs));for(const l of e.polylineBarriers)null!=l.costs&&(l.scaleFactor=l.costs[c]??1,w(l.costs));const{routeInfo:S}=e,{findBestSequence:g,preserveFirstStop:b,preserveLastStop:v,startTimeIsUTC:B,timeWindowsAreUTC:P}=r;S.analysisSettings=new q({accumulateAttributes:d,directionsLanguage:f,findBestSequence:g,preserveFirstStop:b,preserveLastStop:v,startTimeIsUTC:B,timeWindowsAreUTC:P,travelMode:s}),S.totalDuration=X(S.totalCosts?.[n]??0,m),S.totalDistance=ee(S.totalCosts?.[a]??0,y),S.totalLateDuration=X(S.totalViolations?.[n]??0,m),S.totalWaitDuration=X(S.totalWait?.[n]??0,m),null!=S.totalCosts&&w(S.totalCosts),null!=S.totalViolations&&w(S.totalViolations),null!=S.totalWait&&w(S.totalWait);for(const l of e.stops)null!=l.serviceCosts&&(l.serviceDuration=X(l.serviceCosts[n]??0,m),l.serviceDistance=ee(l.serviceCosts[a]??0,y),w(l.serviceCosts)),null!=l.cumulativeCosts&&(l.cumulativeDuration=X(l.cumulativeCosts[n]??0,m),l.cumulativeDistance=ee(l.cumulativeCosts[a]??0,y),w(l.cumulativeCosts)),null!=l.violations&&(l.lateDuration=X(l.violations[n]??0,m),w(l.violations)),null!=l.wait&&(l.waitDuration=X(l.wait[n]??0,m),w(l.wait))}async function $(e){const t=W.WGS84;return await b(e.spatialReference,t),v(e,t)}function X(e,t){switch(t){case\"seconds\":return e/60;case\"hours\":return 60*e;case\"days\":return 60*e*24;default:return e}}function ee(e,t){return\"decimal-degrees\"===t||\"points\"===t||\"unknown\"===t?e:m(e,t,\"meters\")}function te(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}const re=n.ofType(x),oe=n.ofType(k),ie=n.ofType(A),se=n.ofType(G),ne=n.ofType(J),le=n.ofType(E),ae=\"esri.layers.RouteLayer\",ue=s.getLogger(ae);let pe=class extends(j(_(N(I(a(P)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type=\"Feature Collection\",this.defaultSymbols=new D,this.directionLines=null,this.directionPoints=null,this.featureCollectionType=\"route\",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new ie,this.polygonBarriers=new se,this.polylineBarriers=new ne,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new le,this.type=\"route\";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(c((()=>this.stops),\"change\",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter((e=>!!e)),s=i.map(((e,t)=>t)),n=\"web-map\"===o.origin?\"featureCollection.layers\":\"layers\";u(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,\"DirectionLines\",(e=>x.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,\"DirectionPoints\",(e=>k.fromGraphic(e)))}get fullExtent(){const e=new g({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter((e=>null!=e.geometry));if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const o=t.toArray().map((e=>{const t=e.geometry;return[t.x,t.y]}));return new V({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=K(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.maxScale));return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=K(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.minScale));return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,\"Barriers\",(e=>A.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,\"PolygonBarriers\",(e=>G.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,\"PolylineBarriers\",(e=>J.fromGraphic(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,\"RouteInfo\",(e=>U.fromGraphic(e)));return r.length>0?r.at(0):null}readSpatialReference(e,t){const r=K(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return W.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??B;return W.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,\"Stops\",(e=>E.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return null!=this.routeInfo?.name?this.routeInfo.name:\"Route\"}set title(e){this._overrideIfSome(\"title\",e)}get url(){return t.routeServiceUrl}set url(e){null!=e?this._set(\"url\",R(e,ue)):this._set(\"url\",t.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Feature Collection\"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set(\"directionLines\",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set(\"directionPoints\",null)),null!=this.routeInfo&&this._set(\"routeInfo\",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new l(\"routelayer:portal-item-not-set\",\"save() requires to the layer to have a portal item\");if(!t.id)throw new l(\"routelayer:portal-item-not-saved\",\"Please use saveAs() first to save the routelayer\");if(\"Feature Collection\"!==t.type)throw new l(\"routelayer:portal-item-wrong-type\",'Portal item needs to have type \"Feature Collection\"');if(null==this.routeInfo)throw new l(\"routelayer:route-unsolved\",\"save() requires a solved route\");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if(\"admin\"!==i&&\"update\"!==i)throw new l(\"routelayer:insufficient-permissions\",\"To save this layer, you need to be the owner or an administrator of your organization\");const s={messages:[],origin:\"portal-item\",portal:r,url:o?y(o):void 0,writtenProperties:[]},n=this.write(void 0,s);return t.extent=await $(e),t.title=this.title,await t.update({data:n}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new l(\"routelayer:route-unsolved\",\"saveAs() requires a solved route\");const r=C.from(e).clone();r.extent??=await $(this.fullExtent),r.id=null,r.portal??=L.getDefault(),r.title??=this.title,r.type=\"Feature Collection\",r.typeKeywords=[\"Data\",\"Feature Collection\",O.MULTI_LAYER,\"Route Layer\"];const{portal:o}=r,i={messages:[],origin:\"portal-item\",portal:o,url:null,writtenProperties:[]};await o.signIn();const s=t?.folder,n=this.write(void 0,i);return await(o.user?.addItem({item:r,folder:s,data:n})),this.portalItem=r,S(i),i.portalItem=r,r}async solve(e,t){const r=e?.stops??this.stops,o=e?.pointBarriers??z(this.pointBarriers),i=e?.polylineBarriers??z(this.polylineBarriers),s=e?.polygonBarriers??z(this.polygonBarriers);if(null==r)throw new l(\"routelayer:undefined-stops\",\"the route layer must have stops defined in the route parameters.\");if((Q(r)||Y(r))&&r.features.length<2||n.isCollection(r)&&r.length<2)throw new l(\"routelayer:insufficent-stops\",\"the route layer must have two or more stops to solve a route.\");if(n.isCollection(r))for(const n of r)n.routeName=null;const a=e?.apiKey,u=this.url,c=await this._getServiceDescription(u,a,t),m=e?.travelMode??c.defaultTravelMode,y=e?.accumulateAttributes??[];null!=m&&(y.push(m.distanceAttributeName),m.timeAttributeName&&y.push(m.timeAttributeName));const f={startTime:new Date},d={accumulateAttributes:y,directionsOutputType:\"featuresets\",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:i,polygonBarriers:s,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!s,returnPolylineBarriers:!!i,returnRoutes:!0,returnStops:!0,stops:r},h=e?M.from(e):new M;for(const n in f)null==h[n]&&(h[n]=f[n]);let w;h.set(d);try{w=await T(u,h,t)}catch(g){throw p(g)?g:new l(\"routelayer:failed-route-request\",\"the routing request failed\",{error:g})}const S=this._toRouteLayerSolution(w);return this._isOverridden(\"title\")||(this.title=S.routeInfo.name??\"Route\"),Z(S,c,h),S}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}),this._set(\"directionLines\",r),this._set(\"directionPoints\",o),this._set(\"routeInfo\",l),null!=l.geometry&&(this.spatialReference=l.geometry.spatialReference)}_getNetworkFeatures(e,t,s,l){const a=K(e)?e.layers:e.featureCollection?.layers,u=a?.find((e=>e.layerDefinition.name===t));if(null==u)return new n;const{layerDefinition:p,popupInfo:c,featureSet:m}=u,y=p.drawingInfo.renderer,{features:f}=m,d=m.spatialReference??p.spatialReference??p.extent.spatialReference??B,h=y&&i(y),w=W.fromJSON(d),S=f.map((e=>{const i=r.fromJSON(e);null!=i.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(i.geometry.spatialReference=w);const n=s(i);return n.symbol??=h?.getSymbol(i)??this._getNetworkSymbol(t),n.popupTemplate??=c&&o.fromJSON(c),n}));return l&&S.some((e=>!e.symbol))&&l(S),new n(S)}_getNetworkSymbol(e){switch(e){case\"Barriers\":return this.defaultSymbols.pointBarriers;case\"DirectionPoints\":return this.defaultSymbols.directionPoints;case\"DirectionLines\":return this.defaultSymbols.directionLines;case\"PolylineBarriers\":return this.defaultSymbols.polylineBarriers;case\"PolygonBarriers\":return this.defaultSymbols.polygonBarriers;case\"RouteInfo\":return this.defaultSymbols.routeInfo;case\"Stops\":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await F(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||0===e.length)return;if(null==this.defaultSymbols.stops)return;if(e.every((({symbol:e})=>null!=e)))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops;if(null==this.routeInfo||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const l=e.map((({sequence:e})=>e)).filter((e=>null!=e)),a=Math.min(...l),u=Math.max(...l);for(const p of e)p.sequence!==a?p.sequence!==u?\"ok\"===p.status||\"not-located-on-closest\"===p.status?\"waypoint\"!==p.locationType?\"break\"!==p.locationType?p.symbol=o:p.symbol=n:p.symbol=s:p.symbol=i:p.symbol=r:p.symbol=t}_toRouteLayerSolution(e){const t=e.routeResults[0].stops?.map((e=>E.fromJSON(e.toJSON())));this._setStopSymbol(t);const r=new le(t),o=new se(e.polygonBarriers?.map((e=>{const t=G.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),i=new ne(e.polylineBarriers?.map((e=>{const t=J.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),s=new ie(e.pointBarriers?.map((e=>{const t=A.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),n=e.routeResults[0].route?.toJSON(),l=U.fromJSON(n);l.symbol=this.defaultSymbols.routeInfo;const a=new oe(e.routeResults[0].directionPoints?.features.map((e=>{const t=k.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new re(e.routeResults[0].directionLines?.features.map((e=>{const t=x.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:a,pointBarriers:s,polygonBarriers:o,polylineBarriers:i,routeInfo:l,stops:r}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,\"esriGeometryPolyline\",x.fields,x.popupInfo,\"DirectionLines\",\"Direction Lines\")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,\"esriGeometryPoint\",k.fields,k.popupInfo,\"DirectionPoints\",\"Direction Points\")}_writeNetworkFeatures(e,t,r,o,i,s,n){if(!e?.length)return null;const l=this.spatialReference.toJSON(),{fullExtent:a,maxScale:u,minScale:p}=this;return{featureSet:{features:e.toArray().map((e=>te(e))),geometryType:r,spatialReference:l},layerDefinition:{capabilities:\"Query,Update,Editing\",drawingInfo:{renderer:{type:\"simple\",symbol:null!=t?t.toJSON():H(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:u,minScale:p,name:s,objectIdField:\"ObjectID\",spatialReference:l,title:n,type:\"Feature Layer\",typeIdField:\"\"},popupInfo:i}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,\"esriGeometryPoint\",A.fields,A.popupInfo,\"Barriers\",\"Point Barriers\")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,\"esriGeometryPolygon\",G.fields,G.popupInfo,\"PolygonBarriers\",\"Polygon Barriers\")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,\"esriGeometryPolyline\",J.fields,J.popupInfo,\"PolylineBarriers\",\"Line Barriers\")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new n([this.routeInfo]):null,this.defaultSymbols.routeInfo,\"esriGeometryPolyline\",U.fields,U.popupInfo,\"RouteInfo\",\"Route Details\")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,\"esriGeometryPoint\",E.fields,E.popupInfo,\"Stops\",\"Stops\");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:\"uniqueValue\",field1:\"Sequence\",defaultSymbol:o,uniqueValueInfos:[{value:\"1\",symbol:r,label:\"First Stop\"},{value:`${this.stops.length}`,symbol:i,label:\"Last Stop\"}]},e}};e([f({readOnly:!0,json:{read:!1,origins:{\"portal-item\":{write:{allowNull:!0,ignoreOrigin:!0}},\"web-map\":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],pe.prototype,\"_featureCollection\",void 0),e([w([\"web-map\",\"portal-item\"],\"_featureCollection\")],pe.prototype,\"writeFeatureCollectionWebmap\",null),e([f({readOnly:!0,json:{read:!1,origins:{\"web-map\":{write:{target:\"type\",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],pe.prototype,\"_type\",void 0),e([f({nonNullable:!0,type:D})],pe.prototype,\"defaultSymbols\",void 0),e([f({readOnly:!0})],pe.prototype,\"directionLines\",void 0),e([d([\"web-map\",\"portal-item\"],\"directionLines\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readDirectionLines\",null),e([f({readOnly:!0})],pe.prototype,\"directionPoints\",void 0),e([d([\"web-map\",\"portal-item\"],\"directionPoints\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readDirectionPoints\",null),e([f({readOnly:!0,json:{read:!1,origins:{\"web-map\":{write:{ignoreOrigin:!0}}}}})],pe.prototype,\"featureCollectionType\",void 0),e([f({readOnly:!0})],pe.prototype,\"fullExtent\",null),e([f({json:{origins:{\"web-map\":{name:\"featureCollection.showLegend\"}},write:!0}})],pe.prototype,\"legendEnabled\",void 0),e([f({type:[\"show\",\"hide\"]})],pe.prototype,\"listMode\",void 0),e([f({type:Number,nonNullable:!0,json:{write:!1}})],pe.prototype,\"maxScale\",void 0),e([d([\"web-map\",\"portal-item\"],\"maxScale\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readMaxScale\",null),e([f({type:Number,nonNullable:!0,json:{write:!1}})],pe.prototype,\"minScale\",void 0),e([d([\"web-map\",\"portal-item\"],\"minScale\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readMinScale\",null),e([f({type:[\"ArcGISFeatureLayer\"],value:\"ArcGISFeatureLayer\"})],pe.prototype,\"operationalLayerType\",void 0),e([f({nonNullable:!0,type:n.ofType(A)})],pe.prototype,\"pointBarriers\",void 0),e([d([\"web-map\",\"portal-item\"],\"pointBarriers\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readPointBarriers\",null),e([f({nonNullable:!0,type:n.ofType(G)})],pe.prototype,\"polygonBarriers\",void 0),e([d([\"web-map\",\"portal-item\"],\"polygonBarriers\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readPolygonBarriers\",null),e([f({nonNullable:!0,type:n.ofType(J)})],pe.prototype,\"polylineBarriers\",void 0),e([d([\"web-map\",\"portal-item\"],\"polylineBarriers\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readPolylineBarriers\",null),e([f({readOnly:!0})],pe.prototype,\"routeInfo\",void 0),e([d([\"web-map\",\"portal-item\"],\"routeInfo\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readRouteInfo\",null),e([f({type:W})],pe.prototype,\"spatialReference\",void 0),e([d([\"web-map\",\"portal-item\"],\"spatialReference\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readSpatialReference\",null),e([f({nonNullable:!0,type:n.ofType(E)})],pe.prototype,\"stops\",void 0),e([d([\"web-map\",\"portal-item\"],\"stops\",[\"layers\",\"featureCollection.layers\"])],pe.prototype,\"readStops\",null),e([f()],pe.prototype,\"title\",null),e([f({readOnly:!0,json:{read:!1}})],pe.prototype,\"type\",void 0),e([f()],pe.prototype,\"url\",null),pe=e([h(ae)],pe);const ce=pe;export{ce as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";let s=class extends e{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type=\"rangeInfo\"}};r([t({type:String,json:{read:!0,write:!0}})],s.prototype,\"name\",void 0),r([t({type:String,json:{read:!0,write:!0}})],s.prototype,\"field\",void 0),r([t({type:[Number],json:{read:!0,write:!0}})],s.prototype,\"currentRangeExtent\",void 0),r([t({type:[Number],json:{read:!0,write:!0}})],s.prototype,\"fullRangeExtent\",void 0),r([t({type:[\"rangeInfo\"],readOnly:!0,json:{read:!1,write:!0}})],s.prototype,\"type\",void 0),s=r([o(\"esri.layers.support.RangeInfo\")],s);export{s as RangeInfo};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import r from\"../../core/Collection.js\";import{JSONSupportMixin as t}from\"../../core/JSONSupport.js\";import o from\"../../core/Warning.js\";import\"../../core/Logger.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import\"../../core/Error.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";import i from\"../../geometry/Polygon.js\";import{canProjectWithoutEngine as n,projectPolygon as a}from\"../../geometry/projection.js\";var c;let p=c=class extends(t(r.ofType(i))){constructor(e){super(e)}clone(){return new c(this.items.map((e=>e.clone())))}write(e,r){return this.toJSON(r)}toJSON(e){const r=e?.layer?.spatialReference;return r?this.toArray().map((t=>{if(!r.equals(t.spatialReference)){if(!n(t.spatialReference,r))return e?.messages&&e.messages.push(new o(\"scenefilter:unsupported\",\"Scene filters with incompatible spatial references are not supported\",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const s=new i;a(t,s,r),t=s}const s=t.toJSON(e);return delete s.spatialReference,s})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new o(\"scenefilter:unsupported\",\"Writing Scene filters without context layer is not supported\",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((r=>r.toJSON(e))))}static fromJSON(e,r){const t=new c;return e.forEach((e=>t.add(i.fromJSON(e,r)))),t}};p=c=e([s(\"esri.layers.support.PolygonCollection\")],p);const l=p;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import r from\"../../request.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{clone as s}from\"../../core/lang.js\";import{on as t,sync as i}from\"../../core/reactiveUtils.js\";import{property as a}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import{reader as p}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import{persistable as n}from\"../../core/accessorSupport/decorators/persistable.js\";import l from\"./PolygonCollection.js\";import{f as m}from\"../../chunks/persistableUrlUtils.js\";var u;let g=u=class extends o{constructor(e){super(e),this.spatialRelationship=\"disjoint\",this.geometries=new l,this._geometriesSource=null}initialize(){this.addHandles(t((()=>this.geometries),\"after-changes\",(()=>this.geometries=this.geometries),i))}readGeometries(e,r,o){Array.isArray(e)?this.geometries=l.fromJSON(e,o):this._geometriesSource={url:m(e,o),context:o}}async loadGeometries(e,o){if(null==this._geometriesSource)return;const{url:s,context:t}=this._geometriesSource,i=await r(s,{responseType:\"json\",signal:o?.signal}),a=e.toJSON(),p=i.data.map((e=>({...e,spatialReference:a})));this.geometries=l.fromJSON(p,t),this._geometriesSource=null}clone(){const e=new u({geometries:s(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};e([a({type:[\"disjoint\",\"contains\"],nonNullable:!0,json:{write:!0}})],g.prototype,\"spatialRelationship\",void 0),e([a({type:l,nonNullable:!0,json:{write:!0}}),n({origins:[\"web-scene\",\"portal-item\"],type:\"resource\",prefix:\"geometries\",contentAddressed:!0})],g.prototype,\"geometries\",void 0),e([p([\"web-scene\",\"portal-item\"],\"geometries\")],g.prototype,\"readGeometries\",null),g=u=e([c(\"esri.layers.support.SceneFilter\")],g);const h=g;export{h as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../Graphic.js\";import r from\"../PopupTemplate.js\";import\"../renderers/ClassBreaksRenderer.js\";import\"../renderers/DictionaryRenderer.js\";import\"../renderers/DotDensityRenderer.js\";import\"../renderers/HeatmapRenderer.js\";import\"../renderers/PieChartRenderer.js\";import\"../renderers/Renderer.js\";import\"../renderers/SimpleRenderer.js\";import\"../renderers/UniqueValueRenderer.js\";import\"../renderers/support/jsonUtils.js\";import{webSceneRendererTypes as i}from\"../renderers/support/types.js\";import s from\"../request.js\";import{ClonableMixin as o}from\"../core/Clonable.js\";import a from\"../core/Collection.js\";import n from\"../core/Error.js\";import l from\"../core/Logger.js\";import{MultiOriginJSONMixin as p}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as d,isAbortError as y}from\"../core/promiseUtils.js\";import{whenOnce as u}from\"../core/reactiveUtils.js\";import{join as c}from\"../core/urlUtils.js\";import{property as h}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{getProperties as f}from\"../core/accessorSupport/utils.js\";import{reader as m}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as g}from\"../core/accessorSupport/decorators/subclass.js\";import{OriginId as v}from\"../core/accessorSupport/PropertyOrigin.js\";import b from\"./Layer.js\";import{APIKeyMixin as I}from\"./mixins/APIKeyMixin.js\";import{ArcGISService as w}from\"./mixins/ArcGISService.js\";import{EditBusLayer as L}from\"./mixins/EditBusLayer.js\";import{OperationalLayer as j}from\"./mixins/OperationalLayer.js\";import{PortalLayer as F}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as S}from\"./mixins/ScaleRangeLayer.js\";import{SceneService as _,SaveOperationType as O}from\"./mixins/SceneService.js\";import{isHostedAgolService as E}from\"./support/arcgisLayerUrl.js\";import{findAssociatedFeatureService as A}from\"./support/associatedFeatureServiceUtils.js\";import{zeroCapabilities as P}from\"./support/capabilities.js\";import{elevationInfo as T,labelsVisible as D,legendEnabled as U,popupEnabled as x,screenSizePerspectiveEnabled as R}from\"./support/commonProperties.js\";import{computeEffectiveEditingEnabled as q,getGlobalIdToObjectIdMap as C}from\"./support/featureLayerUtils.js\";import{FeatureReduction as G}from\"./support/FeatureReduction.js\";import Q from\"./support/FeatureReductionSelection.js\";import{defineFieldProperties as N}from\"./support/fieldProperties.js\";import k from\"./support/FieldsIndex.js\";import{fixRendererFields as V,unpackFieldNames as $}from\"./support/fieldUtils.js\";import{I3SNodePageDefinition as K,I3SMaterialDefinition as H,I3STextureSetDefinition as M,I3SGeometryDefinition as z}from\"./support/I3SLayerDefinitions.js\";import W from\"./support/LabelClass.js\";import{reader as B}from\"./support/labelingInfo.js\";import Z from\"./support/LayerFloorInfo.js\";import{layerLookupMap as J}from\"./support/lazyLayerLoader.js\";import{RangeInfo as X}from\"./support/RangeInfo.js\";import Y from\"./support/SceneFilter.js\";import{loadStyleRenderer as ee}from\"../renderers/support/styleUtils.js\";import te from\"../rest/support/Query.js\";import{logInvalidElevationInfoWarning as re,elevationModeUnsupportedMessage as ie,featureExpressionUnsupportedMessage as se}from\"../support/elevationInfoUtils.js\";import{sceneLayerEditingEnabled as oe}from\"../support/featureFlags.js\";import{createPopupTemplate as ae}from\"../support/popupUtils.js\";import{queryAttributesFromCachedAttributesId as ne}from\"../views/3d/layers/i3s/I3SUtil.js\";import{getRequiredFields as le,getFetchPopupTemplate as pe}from\"../views/layers/support/popupUtils.js\";import{transparencyToOpacity as de}from\"../webdoc/support/opacityUtils.js\";const ye=new Set([\"3DObject\",\"Point\"]),ue=N();let ce=class extends(L(_(w(j(F(S(p(I(o(b)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType=\"ArcGISSceneServiceLayer\",this.type=\"scene\",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new a,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}destroy(){this._set(\"renderer\",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&\"inherited\"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new k(this.fields)}readNodePages(e,t,r){return\"Point\"===t.layerType&&(e=t.pointNodePages),null==e||\"object\"!=typeof e?null:K.fromJSON(e,r)}set elevationInfo(e){this._set(\"elevationInfo\",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&q(this.associatedLayer)}get geometryType(){return fe[this.profile]||\"mesh\"}set renderer(e){V(e,this.fieldsIndex),this._set(\"renderer\",e)}readCachedDrawingInfo(e){return null!=e&&\"object\"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:P;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,I=!!this.associatedLayer?.infoFor3D&&oe();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:I&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:I&&c&&b,supportsDelete:I&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden(\"editingEnabled\")?this._get(\"editingEnabled\"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome(\"editingEnabled\",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>(\"esriFieldTypeOID\"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>(\"esriFieldTypeGlobalID\"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&he[r]?he[r]:(l.getLogger(this).error(\"Unknown or missing profile\",{profile:r,layer:this}),\"mesh-pyramids\")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:[\"Scene Service\"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await ee(this,{origin:\"service\"},t),V(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error(\"#_loadFilterGeometries()\",this,\"Failed to load filter geometries. Geometry filter will not be applied for this layer.\",{error:e}),this.filter=null}}createQuery(){const e=new te;return\"mesh\"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||\"1=1\",e.sqlFormat=\"standard\",e.outFields=[\"*\"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new n(\"scenelayer:query-not-available\",\"SceneLayer queries are not available without an associated feature layer\",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new n(\"scenelayer:query-not-available\",\"SceneLayer queries are not available without an associated feature layer\",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=$(this.fieldsIndex,await le(this,pe(this)));return ne(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new n(\"scenelayer:feature-not-in-cached-data\",\"Feature not found in cached data\");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error(\"#getFieldUsageInfo()\",\"Unavailable until layer is loaded\"),t)}createPopupTemplate(e){return ae(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new n(\"scenelayer:query-not-available\",\"SceneLayer queries are not available without an associated feature layer\",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new n(\"scenelayer:query-not-available\",\"SceneLayer associated feature layer could not be loaded\",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new n(\"scenelayer:no-cached-statistics\",\"Cached statistics are not available for this layer\");const r=this.fieldsIndex.get(e);if(!r)throw new n(\"scenelayer:field-unexisting\",`Field '${e}' does not exist on the layer`);for(const i of this.statisticsInfo)if(i.name===r.name){const e=c(this.parsedUrl.path,i.href);return s(e,{query:{f:\"json\",token:this.apiKey},responseType:\"json\",signal:t?t.signal:null}).then((e=>e.data))}throw new n(\"scenelayer:no-cached-statistics\",\"Cached statistics for this attribute are not available\")}async saveAs(e,t){return this._debouncedSaveOperations(O.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"scene\"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:\"scene\"};return this._debouncedSaveOperations(O.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await import(\"./graphics/editingSupport.js\");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new n(`${this.type}-layer:not-editable`,\"Service is not editable\");await s.load();const{globalIdField:o}=s,a=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(a&&null==o)throw new n(`${this.type}-layer:not-editable`,\"Valid globalIdField expected on editable SceneLayer\");if(a&&!l)throw new n(`${this.type}-layer:globalid-required`,\"globalIdUsed must not be false for SceneLayer editing as globalIds are required.\");return E(s.url)&&a&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await C(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new n(`${this.type}-layer:not-editable`,\"Service is not editable\");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!ye.has(e.layerType))throw new n(\"scenelayer:layer-type-not-supported\",\"SceneLayer does not support this layer type\",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new n(\"layer:service-version-not-supported\",\"Service version is not supported.\",{serviceVersion:this.version.versionString,supportedVersions:\"1.x, 2.x\"});if(this.version.major>2)throw new n(\"layer:service-version-too-new\",\"Service version is too new.\",{serviceVersion:this.version.versionString,supportedVersions:\"1.x, 2.x\"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case\"east-north-up\":case\"earth-centered\":r=!0,i=s;break;case\"vertex-reference-frame\":r=!0,i=!s;break;default:r=!1}}if(!r)throw new n(\"scenelayer:unsupported-normal-reference-frame\",\"Normal reference frame is invalid.\");if(!i)throw new n(\"scenelayer:incompatible-normal-reference-frame\",\"Normal reference frame is incompatible with layer spatial reference.\")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(\"points\"===this.profile)e.push(\"Point\");else{if(\"mesh-pyramids\"!==this.profile)throw new n(\"scenelayer:unknown-profile\",\"SceneLayer:save() encountered an unknown SceneLayer profile: \"+this.profile);e.push(\"3DObject\")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set(\"fields\",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=[\"popupTemplate\",\"popupEnabled\"],t=f(this);for(let r=0;rthis.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;\"mesh-pyramids\"===this.profile&&re(l.getLogger(this),ie(\"Mesh scene layers\",\"relative-to-scene\",e)),re(l.getLogger(this),se(\"Scene layers\",e))}};e([h({types:{key:\"type\",base:G,typeMap:{selection:Q}},json:{origins:{\"web-scene\":{name:\"layerDefinition.featureReduction\",write:!0},\"portal-item\":{name:\"layerDefinition.featureReduction\",write:!0}}}})],ce.prototype,\"featureReduction\",void 0),e([h({type:[X],json:{read:!1,origins:{\"web-scene\":{name:\"layerDefinition.rangeInfos\",write:!0},\"portal-item\":{name:\"layerDefinition.rangeInfos\",write:!0}}}})],ce.prototype,\"rangeInfos\",void 0),e([h({json:{read:!1}})],ce.prototype,\"associatedLayer\",void 0),e([h({type:[\"show\",\"hide\"]})],ce.prototype,\"listMode\",void 0),e([h({type:[\"ArcGISSceneServiceLayer\"]})],ce.prototype,\"operationalLayerType\",void 0),e([h({json:{read:!1},readOnly:!0})],ce.prototype,\"type\",void 0),e([h({...ue.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,\"fields\",void 0),e([h()],ce.prototype,\"types\",null),e([h()],ce.prototype,\"typeIdField\",null),e([h()],ce.prototype,\"templates\",null),e([h()],ce.prototype,\"formTemplate\",null),e([h({readOnly:!0,clonable:!1})],ce.prototype,\"fieldsIndex\",null),e([h({type:Z,json:{read:{source:\"layerDefinition.floorInfo\"},write:{target:\"layerDefinition.floorInfo\"}}})],ce.prototype,\"floorInfo\",void 0),e([h(ue.outFields)],ce.prototype,\"outFields\",void 0),e([h({type:K,readOnly:!0,json:{read:!1}})],ce.prototype,\"nodePages\",void 0),e([m(\"service\",\"nodePages\",[\"nodePages\",\"pointNodePages\"])],ce.prototype,\"readNodePages\",null),e([h({type:[H],readOnly:!0})],ce.prototype,\"materialDefinitions\",void 0),e([h({type:[M],readOnly:!0})],ce.prototype,\"textureSetDefinitions\",void 0),e([h({type:[z],readOnly:!0})],ce.prototype,\"geometryDefinitions\",void 0),e([h({readOnly:!0})],ce.prototype,\"serviceUpdateTimeStamp\",void 0),e([h({readOnly:!0})],ce.prototype,\"attributeStorageInfo\",void 0),e([h({readOnly:!0})],ce.prototype,\"statisticsInfo\",void 0),e([h({type:a.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:\"layerDefinition.excludeObjectIds\",write:{enabled:!0}}})],ce.prototype,\"excludeObjectIds\",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:\"layerDefinition.definitionExpression\",write:{enabled:!0,allowNull:!0}}})],ce.prototype,\"definitionExpression\",void 0),e([h({type:Y,json:{name:\"layerDefinition.polygonFilter\",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],ce.prototype,\"filter\",void 0),e([h({type:String,json:{origins:{\"web-scene\":{read:!0,write:!0}},read:!1}})],ce.prototype,\"path\",void 0),e([h(T)],ce.prototype,\"elevationInfo\",null),e([h({readOnly:!0,json:{read:!1}})],ce.prototype,\"effectiveCapabilities\",null),e([h({readOnly:!0})],ce.prototype,\"effectiveEditingEnabled\",null),e([h({type:String})],ce.prototype,\"geometryType\",null),e([h(D)],ce.prototype,\"labelsVisible\",void 0),e([h({type:[W],json:{origins:{service:{name:\"drawingInfo.labelingInfo\",read:{reader:B},write:!1}},name:\"layerDefinition.drawingInfo.labelingInfo\",read:{reader:B},write:!0}})],ce.prototype,\"labelingInfo\",void 0),e([h(U)],ce.prototype,\"legendEnabled\",void 0),e([h({type:Number,json:{origins:{\"web-document\":{default:1,write:{enabled:!0,target:{opacity:{type:Number},\"layerDefinition.drawingInfo.transparency\":{type:Number}}},read:{source:[\"opacity\",\"layerDefinition.drawingInfo.transparency\"],reader(e,t){if(\"number\"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?de(r):void 0}}},\"portal-item\":{write:!0},service:{read:!1}}}})],ce.prototype,\"opacity\",void 0),e([h({type:[\"Low\",\"High\"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,\"priority\",void 0),e([h({type:[\"Labels\"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,\"semantic\",void 0),e([h({types:i,json:{origins:{service:{read:{source:\"drawingInfo.renderer\"}}},name:\"layerDefinition.drawingInfo.renderer\",write:!0},value:null})],ce.prototype,\"renderer\",null),e([h({json:{read:!1}})],ce.prototype,\"cachedDrawingInfo\",void 0),e([m(\"service\",\"cachedDrawingInfo\")],ce.prototype,\"readCachedDrawingInfo\",null),e([h({readOnly:!0,json:{read:!1}})],ce.prototype,\"capabilities\",null),e([h({type:Boolean,json:{read:!1}})],ce.prototype,\"editingEnabled\",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],ce.prototype,\"infoFor3D\",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],ce.prototype,\"relationships\",null),e([h(x)],ce.prototype,\"popupEnabled\",void 0),e([h({type:r,json:{name:\"popupInfo\",write:!0}})],ce.prototype,\"popupTemplate\",void 0),e([h({readOnly:!0,json:{read:!1}})],ce.prototype,\"defaultPopupTemplate\",null),e([h({type:String,json:{read:!1}})],ce.prototype,\"objectIdField\",void 0),e([m(\"service\",\"objectIdField\",[\"objectIdField\",\"fields\"])],ce.prototype,\"readObjectIdField\",null),e([h({type:String,json:{read:!1}})],ce.prototype,\"globalIdField\",void 0),e([m(\"service\",\"globalIdField\",[\"globalIdField\",\"fields\"])],ce.prototype,\"readGlobalIdField\",null),e([h({readOnly:!0,type:String,json:{read:!1}})],ce.prototype,\"displayField\",null),e([h({type:String,json:{read:!1}})],ce.prototype,\"profile\",void 0),e([m(\"service\",\"profile\",[\"store.profile\"])],ce.prototype,\"readProfile\",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:\"store.normalReferenceFrame\"}}},read:!1}})],ce.prototype,\"normalReferenceFrame\",void 0),e([h(R)],ce.prototype,\"screenSizePerspectiveEnabled\",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,\"serviceItemId\",void 0),ce=e([g(\"esri.layers.SceneLayer\")],ce);const he={\"mesh-pyramids\":\"mesh-pyramids\",meshpyramids:\"mesh-pyramids\",\"features-meshes\":\"mesh-pyramids\",points:\"points\",\"features-points\":\"points\",lines:\"lines\",\"features-lines\":\"lines\",polygons:\"polygons\",\"features-polygons\":\"polygons\"},fe={\"mesh-pyramids\":\"mesh\",points:\"point\",lines:\"polyline\",polygons:\"polygon\"},me=ce;export{me as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";var t;let i=t=class extends o{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new t({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};e([r({type:Number,json:{write:!0}})],i.prototype,\"age\",void 0),e([r({type:Number,json:{write:!0}})],i.prototype,\"ageReceived\",void 0),e([r({type:Number,json:{write:!0}})],i.prototype,\"displayCount\",void 0),e([r({type:Number,json:{write:!0}})],i.prototype,\"maxObservations\",void 0),i=t=e([s(\"esri.layers.support.PurgeOptions\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import t from\"../PopupTemplate.js\";import\"../renderers/ClassBreaksRenderer.js\";import\"../renderers/DictionaryRenderer.js\";import\"../renderers/DotDensityRenderer.js\";import\"../renderers/HeatmapRenderer.js\";import\"../renderers/PieChartRenderer.js\";import\"../renderers/Renderer.js\";import\"../renderers/SimpleRenderer.js\";import\"../renderers/UniqueValueRenderer.js\";import{read as r}from\"../renderers/support/jsonUtils.js\";import{rendererTypes as i,webSceneRendererTypes as o}from\"../renderers/support/types.js\";import s from\"../request.js\";import{ClonableMixin as n}from\"../core/Clonable.js\";import a from\"../core/Error.js\";import{handlesGroup as p}from\"../core/handleUtils.js\";import{clone as l}from\"../core/lang.js\";import d from\"../core/Logger.js\";import{MultiOriginJSONMixin as m}from\"../core/MultiOriginJSONSupport.js\";import{debounce as c,throwIfAbortError as u}from\"../core/promiseUtils.js\";import{property as y}from\"../core/accessorSupport/decorators/property.js\";import{Integer as f}from\"../core/accessorSupport/ensureType.js\";import{reader as h}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as g}from\"../core/accessorSupport/decorators/subclass.js\";import{featureGeometryTypeKebabDictionary as j}from\"../geometry/support/typeUtils.js\";import v from\"./Layer.js\";import{ArcGISService as w}from\"./mixins/ArcGISService.js\";import{BlendLayer as b}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as S}from\"./mixins/CustomParametersMixin.js\";import{FeatureEffectLayer as I}from\"./mixins/FeatureEffectLayer.js\";import{FeatureReductionLayer as x}from\"./mixins/FeatureReductionLayer.js\";import{OperationalLayer as R}from\"./mixins/OperationalLayer.js\";import{PortalLayer as T}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as F}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as P}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as L}from\"./mixins/TemporalLayer.js\";import{labelsVisible as U,legendEnabled as E,maxScale as k,minScale as A,popupEnabled as D,screenSizePerspectiveEnabled as O,url as _}from\"./support/commonProperties.js\";import{createDefaultRenderer as C}from\"./support/featureLayerUtils.js\";import V from\"./support/Field.js\";import{defineFieldProperties as N}from\"./support/fieldProperties.js\";import{fixRendererFields as G,fixTimeInfoFields as J}from\"./support/fieldUtils.js\";import M from\"./support/LabelClass.js\";import{reader as q}from\"./support/labelingInfo.js\";import z from\"./support/PurgeOptions.js\";import{loadStyleRenderer as $}from\"../renderers/support/styleUtils.js\";import W from\"../rest/support/Query.js\";import{createPopupTemplate as B}from\"../support/popupUtils.js\";import Q from\"../symbols/support/ElevationInfo.js\";import{SaveOperationType as H}from\"../webdoc/interfaces.js\";import K from\"../geometry/SpatialReference.js\";import X from\"../geometry/Extent.js\";const Y=N();function Z(e,t){return new a(\"layer:unsupported\",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}let ee=class extends(x(I(b(L(P(F(w(R(T(m(S(n(v))))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType=\"ArcGISStreamLayer\",this.outFields=[\"*\"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new z,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=K.WGS84,this.type=\"stream\",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=c((async(e,t,r)=>{const{save:i,saveAs:o}=await import(\"./save/streamLayerUtils.js\");switch(e){case H.SAVE:return i(this,t);case H.SAVE_AS:return o(this,r,t)}}))}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}load(e){if(!(\"WebSocket\"in globalThis))return this.addResolvingPromise(Promise.reject(new a(\"stream-layer:websocket-unsupported\",\"WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service.\"))),Promise.resolve(this);const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Stream Service\",\"Feed\"]},e).catch(u).then((()=>this._fetchService(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set(\"featureReduction\",t)}set renderer(e){G(e,this.fieldsIndex),this._set(\"renderer\",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const o=t.drawingInfo?.renderer;if(o){const e=r(o,t,i)||void 0;return e||d.getLogger(this).error(\"Failed to create renderer\",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return C(t,i)}async connect(e){const[{createConnection:t}]=await Promise.all([import(\"./graphics/sources/connections/createConnection.js\"),this.load()]),r=this.geometryType?j.toJSON(this.geometryType):null,{customParameters:i=null,definitionExpression:o=null,geometryDefinition:s=null,maxReconnectionAttempts:n=0,maxReconnectionInterval:a=20,spatialReference:l=this.spatialReference}=e||this.createConnectionParameters(),d=t(this.parsedUrl,this.spatialReference,l,r,{geometry:s,where:o},n,a,i??void 0),m=p([this.on(\"send-message-to-socket\",(e=>d.sendMessageToSocket(e))),this.on(\"send-message-to-client\",(e=>d.sendMessageToClient(e)))]);return d.once(\"destroy\",m.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return B(this,e)}createQuery(){const e=new W;return e.returnGeometry=!0,e.outFields=[\"*\"],e.where=this.definitionExpression||\"1=1\",e}getFieldDomain(e,t){if(!this.fields)return null;let r=null;return this.fields.some((t=>(t.name===e&&(r=t.domain),!!r))),r}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit(\"send-message-to-socket\",e)}sendMessageToClient(e){this.emit(\"send-message-to-client\",e)}async save(e){return this._debouncedSaveOperations(H.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(H.SAVE_AS,t,e)}write(e,t){const r=t?.messages;return this.webSocketUrl?(r?.push(Z(this,\"using a custom websocket connection cannot be written to web scenes and web maps\")),null):this.parsedUrl?super.write(e,t):(r?.push(Z(this,\"using a client-side only connection without a url cannot be written to web scenes and web maps\")),null)}async _fetchService(e){if(!!!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:t}=await s(this.parsedUrl.path,{query:{f:\"json\",...this.customParameters,...this.parsedUrl.query},responseType:\"json\",signal:e});this.sourceJSON=t}}else{if(!this.timeInfo?.trackIdField)throw new a(\"stream-layer:missing-metadata\",\"The stream layer trackIdField must be specified.\");if(!this.objectIdField){const e=this.fields.find((e=>\"oid\"===e.type))?.name;if(!e)throw new a(\"stream-layer:missing-metadata\",\"The stream layer objectIdField must be specified.\");this.objectIdField=e}if(!this.fields)throw new a(\"stream-layer:missing-metadata\",\"The stream layer fields must be specified.\");if(this.fields.some((e=>e.name===this.objectIdField))||this.fields.push(new V({name:this.objectIdField,alias:this.objectIdField,type:\"oid\"})),!this.geometryType)throw new a(\"stream-layer:missing-metadata\",\"The stream layer geometryType must be specified.\");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:\"service\",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),G(this.renderer,this.fieldsIndex),J(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField=\"__esri_stream_id__\"),$(this,{origin:\"service\"})}};e([y({type:String})],ee.prototype,\"copyright\",void 0),e([y({readOnly:!0})],ee.prototype,\"defaultPopupTemplate\",null),e([y({type:String,json:{name:\"layerDefinition.definitionExpression\",write:{enabled:!0,allowNull:!0}}})],ee.prototype,\"definitionExpression\",void 0),e([y({type:String})],ee.prototype,\"displayField\",void 0),e([y({type:Q})],ee.prototype,\"elevationInfo\",void 0),e([y({json:{origins:{\"web-map\":{read:!1,write:!1},\"portal-item\":{read:!1,write:!1},\"web-scene\":{read:!1,write:!1}}}})],ee.prototype,\"featureReduction\",null),e([y(Y.fields)],ee.prototype,\"fields\",void 0),e([y(Y.fieldsIndex)],ee.prototype,\"fieldsIndex\",void 0),e([y({type:X,json:{name:\"layerDefinition.definitionGeometry\",write:!0}})],ee.prototype,\"geometryDefinition\",void 0),e([y({type:j.apiValues,json:{read:{reader:j.read}}})],ee.prototype,\"geometryType\",void 0),e([y(U)],ee.prototype,\"labelsVisible\",void 0),e([y({type:[M],json:{name:\"layerDefinition.drawingInfo.labelingInfo\",read:{reader:q},write:!0}})],ee.prototype,\"labelingInfo\",void 0),e([y(E)],ee.prototype,\"legendEnabled\",void 0),e([y({type:[\"show\",\"hide\"],json:{origins:{\"portal-item\":{read:!1,write:!1}}}})],ee.prototype,\"listMode\",void 0),e([y({type:f})],ee.prototype,\"maxReconnectionAttempts\",void 0),e([y({type:f})],ee.prototype,\"maxReconnectionInterval\",void 0),e([y(k)],ee.prototype,\"maxScale\",void 0),e([y(A)],ee.prototype,\"minScale\",void 0),e([y({type:String})],ee.prototype,\"objectIdField\",void 0),e([y({value:\"ArcGISStreamLayer\",type:[\"ArcGISStreamLayer\"]})],ee.prototype,\"operationalLayerType\",void 0),e([y({readOnly:!0})],ee.prototype,\"outFields\",void 0),e([y(D)],ee.prototype,\"popupEnabled\",void 0),e([y({type:t,json:{name:\"popupInfo\",write:!0}})],ee.prototype,\"popupTemplate\",void 0),e([y({type:z})],ee.prototype,\"purgeOptions\",void 0),e([y({json:{read:!1,write:!1}})],ee.prototype,\"refreshInterval\",void 0),e([y({types:i,json:{origins:{service:{write:{target:\"drawingInfo.renderer\",enabled:!1}},\"web-scene\":{name:\"layerDefinition.drawingInfo.renderer\",types:o,write:!0}},write:{target:\"layerDefinition.drawingInfo.renderer\"}}})],ee.prototype,\"renderer\",null),e([h(\"service\",\"renderer\",[\"drawingInfo.renderer\",\"defaultSymbol\"]),h(\"renderer\",[\"layerDefinition.drawingInfo.renderer\",\"layerDefinition.defaultSymbol\"])],ee.prototype,\"readRenderer\",null),e([y((()=>{const e=l(O);return e.json.origins[\"portal-item\"]={read:!1,write:!1},e})())],ee.prototype,\"screenSizePerspectiveEnabled\",void 0),e([y()],ee.prototype,\"sourceJSON\",void 0),e([y({type:K,json:{origins:{service:{read:{source:\"spatialReference\"}}}}})],ee.prototype,\"spatialReference\",void 0),e([y({json:{read:!1}})],ee.prototype,\"type\",void 0),e([y(_)],ee.prototype,\"url\",void 0),e([y({type:Number})],ee.prototype,\"updateInterval\",void 0),e([y({json:{read:!1,write:!1}})],ee.prototype,\"useViewTime\",void 0),e([y({type:String})],ee.prototype,\"webSocketUrl\",void 0),ee=e([g(\"esri.layers.StreamLayer\")],ee);const te=ee;export{te as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../request.js\";import t from\"../core/Error.js\";import{loadAll as s}from\"../core/loadAll.js\";import{MultiOriginJSONMixin as i}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as o}from\"../core/promiseUtils.js\";import{urlToObject as a,objectToQuery as l,makeAbsolute as n}from\"../core/urlUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import{cast as c}from\"../core/accessorSupport/decorators/cast.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as u}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as h}from\"../core/accessorSupport/decorators/writer.js\";import d from\"../geometry/SpatialReference.js\";import y from\"./Layer.js\";import{APIKeyMixin as f}from\"./mixins/APIKeyMixin.js\";import{ArcGISCachedService as v}from\"./mixins/ArcGISCachedService.js\";import{ArcGISMapService as g}from\"./mixins/ArcGISMapService.js\";import{ArcGISService as S}from\"./mixins/ArcGISService.js\";import{BlendLayer as _}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as j}from\"./mixins/CustomParametersMixin.js\";import{OperationalLayer as T}from\"./mixins/OperationalLayer.js\";import{PortalLayer as b}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as w}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as O}from\"./mixins/ScaleRangeLayer.js\";import{SublayersOwner as L}from\"./mixins/SublayersOwner.js\";import{parse as R,isHostedAgolService as U,isArcGISUrl as P}from\"./support/arcgisLayerUrl.js\";import{url as x}from\"./support/commonProperties.js\";import{createTileBitmap as A}from\"./support/imageBitmapUtils.js\";import M from\"./support/Sublayer.js\";var W;const I=[\"Canvas/World_Dark_Gray_Base\",\"Canvas/World_Dark_Gray_Reference\",\"Canvas/World_Light_Gray_Base\",\"Canvas/World_Light_Gray_Reference\",\"Elevation/World_Hillshade\",\"Elevation/World_Hillshade_Dark\",\"Ocean/World_Ocean_Base\",\"Ocean/World_Ocean_Reference\",\"Ocean_Basemap\",\"Reference/World_Boundaries_and_Places\",\"Reference/World_Boundaries_and_Places_Alternate\",\"Reference/World_Transportation\",\"World_Imagery\",\"World_Street_Map\",\"World_Topo_Map\"];let B=W=class extends(_(O(L(v(g(T(b(S(i(w(f(j(y))))))))))))){constructor(...e){super(...e),this.listMode=\"show\",this.isReference=null,this.operationalLayerType=\"ArcGISTiledMapServiceLayer\",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type=\"tile\",this.url=null}normalizeCtorArgs(e,r){return\"string\"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"Map Service\"]},e).catch(o).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&d.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),o=[],a={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},a);o.push(r)}));o.some((e=>Object.keys(e).length>1))&&(r.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>a(e).path)):null}fetchTile(e,t,s,i={}){const{signal:o}=i,a=this.getTileUrl(e,t,s),l={responseType:\"image\",signal:o,query:{...this.refreshParameters}};return r(a,l).then((e=>e.data))}async fetchImageBitmapTile(e,t,s,i={}){const{signal:o}=i;if(this.fetchTile!==W.prototype.fetchTile){const r=await this.fetchTile(e,t,s,i);return A(r,e,t,s,o)}const a=this.getTileUrl(e,t,s),l={responseType:\"blob\",signal:o,query:{...this.refreshParameters}},{data:n}=await r(a,l);return A(n,e,t,s,o)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=l({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[r%o.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?\"?\"+i:\"\"}`}loadAll(){return s(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((s,i)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new t(\"tile-layer:unsupported-url\",\"use ImageryTileLayer to open a tiled image service\");return void s({data:this.sourceJSON})}if(!this.parsedUrl)throw new t(\"tile-layer:undefined-url\",\"layer's url is not defined\");const o=R(this.parsedUrl.path);if(null!=o&&\"ImageServer\"===o.serverType)throw new t(\"tile-layer:unsupported-url\",\"use ImageryTileLayer to open a tiled image service\");r(this.parsedUrl.path,{query:{f:\"json\",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:\"json\",signal:e}).then(s,i)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,\"https:\")),this.sourceJSON=r.data,this.read(r.data,{origin:\"service\",url:this.parsedUrl}),10.1===this.version&&!U(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,s){if(!P(e))return Promise.reject();const i=e.replace(/(.*\\/rest)\\/.*/i,\"$1\")+\"/info\";return r(i,{query:{f:\"json\",...this.customParameters,token:this.apiKey},responseType:\"json\",signal:s}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new t(\"tile-layer:version-not-available\")}))}_getMapName(e){const r=e.match(/^(?:https?:)?\\/\\/(server\\.arcgisonline\\.com|services\\.arcgisonline\\.com|ibasemaps-api\\.arcgis\\.com)\\/arcgis\\/rest\\/services\\/([^\\/]+(\\/[^\\/]+)*)\\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(null==e)return null;let r;e=e.toLowerCase();for(let t=0,s=I.length;t({enabled:!1})}}})],B.prototype,\"isReference\",void 0),e([p({readOnly:!0,type:[\"ArcGISTiledMapServiceLayer\"]})],B.prototype,\"operationalLayerType\",void 0),e([p({type:Boolean})],B.prototype,\"resampling\",void 0),e([p()],B.prototype,\"sourceJSON\",void 0),e([p({type:d})],B.prototype,\"spatialReference\",void 0),e([u(\"spatialReference\",[\"spatialReference\",\"tileInfo\"])],B.prototype,\"readSpatialReference\",null),e([p({type:String,json:{origins:{\"web-scene\":{read:!0,write:!0}},read:!1}})],B.prototype,\"path\",void 0),e([p({readOnly:!0})],B.prototype,\"sublayers\",void 0),e([h(\"sublayers\",{layers:{type:[M]}})],B.prototype,\"writeSublayers\",null),e([p({json:{read:!1,write:!1}})],B.prototype,\"popupEnabled\",void 0),e([p()],B.prototype,\"tileServers\",null),e([c(\"tileServers\")],B.prototype,\"castTileServers\",null),e([p({readOnly:!0,json:{read:!1}})],B.prototype,\"type\",void 0),e([p(x)],B.prototype,\"url\",void 0),B=W=e([m(\"esri.layers.TileLayer\")],B);const C=Symbol(\"default-fetch-tile\");B.prototype.fetchTile[C]=!0;const N=B;export{N as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../chunks/tslib.es6.js\";import o from\"../core/Error.js\";import{MultiOriginJSONMixin as e}from\"../core/MultiOriginJSONSupport.js\";import{schedule as s}from\"../core/scheduling.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as n}from\"../core/accessorSupport/decorators/subclass.js\";import i from\"./Layer.js\";import{PortalLayer as p}from\"./mixins/PortalLayer.js\";let a=class extends(p(e(i))){constructor(r){super(r),this.resourceInfo=null,this.type=\"unknown\"}initialize(){this.addResolvingPromise(new Promise(((r,e)=>{s((()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let s=\"Unknown layer type\";r&&(s+=\" \"+r),e(new o(\"layer:unknown-layer-type\",s,{layerType:r}))}))})))}read(r,o){super.read({resourceInfo:r},o)}write(r,o){return null}};r([t({readOnly:!0})],a.prototype,\"resourceInfo\",void 0),r([t({type:[\"show\",\"hide\"]})],a.prototype,\"listMode\",void 0),r([t({json:{read:!1},readOnly:!0,value:\"unknown\"})],a.prototype,\"type\",void 0),a=r([n(\"esri.layers.UnknownLayer\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import r from\"../core/Error.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{schedule as s}from\"../core/scheduling.js\";import{property as t}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as i}from\"../core/accessorSupport/decorators/subclass.js\";import p from\"./Layer.js\";import{PortalLayer as n}from\"./mixins/PortalLayer.js\";let a=class extends(n(o(p))){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type=\"unsupported\"}initialize(){this.addResolvingPromise(new Promise(((e,o)=>{s((()=>{const e=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let s=\"Unsupported layer type\";e&&(s+=\" \"+e),o(new r(\"layer:unsupported-layer-type\",s,{layerType:e}))}))})))}read(e,r){const o={resourceInfo:e};null!=e.id&&(o.id=e.id),null!=e.title&&(o.title=e.title),super.read(o,r)}write(e,r){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};e([t({readOnly:!0})],a.prototype,\"resourceInfo\",void 0),e([t({type:[\"show\",\"hide\"]})],a.prototype,\"listMode\",void 0),e([t({type:Boolean,readOnly:!1})],a.prototype,\"persistenceEnabled\",void 0),e([t({json:{read:!1},readOnly:!0,value:\"unsupported\"})],a.prototype,\"type\",void 0),a=e([i(\"esri.layers.UnsupportedLayer\")],a);const c=a;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nlet A=null;function o(o){if(A)return A;const l={lossy:\"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\",lossless:\"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==\",alpha:\"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==\",animation:\"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA\"};return A=new Promise((A=>{const n=new Image;n.onload=()=>{n.onload=n.onerror=null,A(n.width>0&&n.height>0)},n.onerror=()=>{n.onload=n.onerror=null,A(!1)},n.src=\"data:image/webp;base64,\"+l[o]})),A}export{o as checkWebPSupport};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../request.js\";import e from\"../../core/Error.js\";import i from\"../../core/Logger.js\";import{isArrayBuffer as s,isUint8ClampedArray as r}from\"../../core/typedArrayUtil.js\";import{urlToObject as a,objectToQuery as o}from\"../../core/urlUtils.js\";const h=1.15;class n{constructor(t,e){this._spriteSource=t,this._maxTextureSize=e,this.devicePixelRatio=1,this._spriteImageFormat=\"png\",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus=\"not-loaded\",\"url\"===t.type&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const e in this._spritesData)t.push(e);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus=\"loading\";try{await this._loadSprites(t),this.loadStatus=\"loaded\"}catch{this.loadStatus=\"failed\"}}else this.loadStatus=\"failed\"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>h;const{width:s,height:r,data:a,json:o}=await this._getSpriteData(this._spriteSource,t),n=Object.keys(o);if(!n||0===n.length||!a)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=o,this.width=s,this.height=r;const d=Math.max(this._maxTextureSize,4096);if(s>d||r>d){const t=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${d} pixels}`;throw i.getLogger(\"esri.layers.support.SpriteSource\").error(t),new e(\"SpriteSource\",t)}let p;for(let e=0;ee.data.index))),this._tileIndexPromise}async dataKey(e,r){const l=await this.fetchTileIndex();return t(r),this._getIndexedDataKey(l,e)}_getIndexedDataKey(e,t){const l=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;0!==i.level;)i=new r(i.level-1,i.row>>1,i.col>>1,i.world),l.push(i);let o,s,n=e,a=l.pop();if(1===n)return a;for(;l.length;)if(o=l.pop(),s=(1&o.col)+((1&o.row)<<1),n){if(0===n[s]){a=null;break}if(1===n[s]){a=o;break}a=o,n=n[s]}return a}}export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../../request.js\";import{destroyMaybe as t}from\"../../../../core/maybe.js\";import{isAbortError as i}from\"../../../../core/promiseUtils.js\";import r from\"../../tiling/TileKey.js\";class l{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=t(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=e(this._tileIndexUrl,{query:{...t?.query}}).then((e=>e.data.index))),this._tileIndexPromise}dataKey(e,t){const{level:l,row:s,col:o}=e,n=new r(e);return this._tilemap.fetchAvailabilityUpsample(l,s,o,n,t).then((()=>(n.world=e.world,n))).catch((e=>{if(i(e))throw e;return null}))}}export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../../../request.js\";import{clone as r}from\"../../../../../core/lang.js\";import{getOrCreateMapValue as e}from\"../../../../../core/MapUtils.js\";import{onAbort as o,isAborted as s}from\"../../../../../core/promiseUtils.js\";import{urlToObject as i,addQueryParameters as n}from\"../../../../../core/urlUtils.js\";class l{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){null===this._promise&&(this._abortController=new AbortController,this._promise=this._makeRequest(this._tileUrl,this._abortController.signal));const e=this._abortOptions;return e.push(t),o(t,(()=>{e.every((t=>s(t)))&&this._abortController.abort()})),this._promise.then((t=>r(t)))}async _makeRequest(r,e){const{data:o}=await t(r,{responseType:\"array-buffer\",signal:e});return o}}const a=new Map;function c(t,r,e,o,s){const l=i(t),a=l.query;if(a)for(const[i,n]of Object.entries(a))switch(n){case\"{x}\":a[i]=o.toString();break;case\"{y}\":a[i]=e.toString();break;case\"{z}\":a[i]=r.toString()}const c=l.path;return p(n(c.replaceAll(/\\{z\\}/gi,r.toString()).replaceAll(/\\{y\\}/gi,e.toString()).replaceAll(/\\{x\\}/gi,o.toString()),{...l.query}),s)}function p(t,r){return e(a,t,(()=>new l(t))).getData(r).then((r=>(a.delete(t),r))).catch((r=>{throw a.delete(t),r}))}export{c as request};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{clone as t}from\"../../../../../core/lang.js\";import{urlToObject as e,isAbsolute as i,join as l,addQueryParameters as s}from\"../../../../../core/urlUtils.js\";import r from\"../../../../../geometry/Extent.js\";import o from\"../../../../../layers/support/TileInfo.js\";import{TilemapCache as n}from\"../../../../../layers/support/TilemapCache.js\";import a from\"../TilemapIndex.js\";import p from\"../TilemapRequest.js\";import{request as h}from\"./VectorTilesRequestManager.js\";class u{constructor(h,u,m){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=h,this.sourceUrl=u;const f=e(this.sourceUrl),c=t(m),x=c.tiles;if(f)for(let t=0;tt.toLowerCase().trim())),y=!0===m?.exportTilesAllowed,T=!0===d?.includes(\"tilemap\"),I=y&&m.hasOwnProperty(\"maxExportTilesCount\")?m.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:y,supportsTileMap:T},exportTiles:y?{maxExportTilesCount:+I}:null},this.tileInfo=o.fromJSON(c.tileInfo);const g=m.tileMap?s(l(f.path,m.tileMap),f.query??{}):null;T?(this.type=\"vector-tile\",this.tilemap=new p(new n({layer:{parsedUrl:f,tileInfo:this.tileInfo},minLOD:c.minLOD??this.tileInfo.lods[0].level,maxLOD:c.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),g)):g&&(this.tilemap=new a(g)),this.fullExtent=r.fromJSON(m.fullExtent),this.initialExtent=r.fromJSON(m.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,e){return await(this.tilemap?.dataKey(t,e))??t}requestTile(t,e,i,l){const s=this.tileServers[e%this.tileServers.length];return h(s,t,e,i,l)}isCompatibleWith(t){const e=this.tileInfo,i=t.tileInfo;if(!e.spatialReference.equals(i.spatialReference))return!1;if(!e.origin.equals(i.origin))return!1;if(Math.round(e.dpi)!==Math.round(i.dpi))return!1;const l=e.lods,s=i.lods,r=Math.min(l.length,s.length);for(let o=0;o=s||Math.abs(n.y-r.y)>=s)return!1;let o,t;l.lods[0].scale>e.lods[0].scale?(o=l,t=e):(t=l,o=e);for(let i=o.lods[0].scale;i>=t.lods[t.lods.length-1].scale-s;i/=2)if(Math.abs(i-t.lods[0].scale)r.lods[0].scale?s.lods[0]:r.lods[0],d=s.lods[s.lods.length-1].scale<=r.lods[r.lods.length-1].scale?s.lods[s.lods.length-1]:r.lods[r.lods.length-1],c=f.scale,p=f.resolution,g=d.scale,h=[];let m=c,y=p,x=0;for(;m>g;)h.push(new e({level:x,resolution:y,scale:m})),x++,m/=2,y/=2;return new n({size:[o,o],dpi:i,format:t||\"pbf\",origin:u,lods:h,spatialReference:a})}export{r as areSchemasOverlapping,o as unionTileInfos};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../request.js\";import{createTask as r}from\"../core/asyncUtils.js\";import i from\"../core/Error.js\";import{clone as o}from\"../core/lang.js\";import{MultiOriginJSONMixin as s}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as l}from\"../core/promiseUtils.js\";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from\"../core/urlUtils.js\";import{property as u}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{reader as c}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as m}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as h}from\"../core/accessorSupport/decorators/writer.js\";import d from\"../geometry/Extent.js\";import S from\"../geometry/SpatialReference.js\";import f from\"./Layer.js\";import{APIKeyMixin as g}from\"./mixins/APIKeyMixin.js\";import{ArcGISCachedService as v}from\"./mixins/ArcGISCachedService.js\";import{ArcGISService as j}from\"./mixins/ArcGISService.js\";import{BlendLayer as _}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as w}from\"./mixins/CustomParametersMixin.js\";import{OperationalLayer as T}from\"./mixins/OperationalLayer.js\";import{PortalLayer as b}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as U}from\"./mixins/ScaleRangeLayer.js\";import{checkWebPSupport as x}from\"./support/imageUtils.js\";import L from\"./support/SpriteSource.js\";import I from\"./support/TileInfo.js\";import{TilemapCache as R}from\"./support/TilemapCache.js\";import{loadMetadata as O}from\"./support/vectorTileLayerLoader.js\";import{createForItemRead as P}from\"../portal/support/jsonContext.js\";import{parseKnownArcGISOnlineDomain as M}from\"../portal/support/urlUtils.js\";import{e as C}from\"../chunks/persistableUrlUtils.js\";import{areSchemasOverlapping as V,unionTileInfos as D}from\"../views/2d/engine/vectorTiles/tileInfoUtils.js\";import k from\"../views/2d/engine/vectorTiles/style/StyleRepository.js\";import{getWebGLCapabilities as E}from\"../views/webgl/capabilities.js\";let N=class extends(_(U(v(j(T(b(w(g(s(f)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType=\"VectorTileLayer\",this.style=null,this.tilemapCache=null,this.type=\"vector-tile\",this.url=null,this.path=null}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:[\"Vector Tile Service\"],supportsData:!1},e).catch(l).then((async()=>{if(!this.portalItem?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:\"json\",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},P(this.portalItem))})).catch(l).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`);const r=M(e);t.styleUrl=C(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new I;if(e.length>1)for(let r=0;r(this._spriteSourceMap.clear(),this._getSourceAndStyle(i,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit(\"paint-change\",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return o(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit(\"style-layer-change\",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit(\"delete-style-layer\",{layer:e})}getLayoutProperties(e){return o(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit(\"layout-change\",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit(\"style-layer-visibility-change\",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new i(\"vectortilelayer:unsupported\",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error(\"invalid style!\");const r=await O(e,{...t,query:{...this.customParameters,token:this.apiKey}});if(\"webp\"===r.spriteFormat){await x(\"lossy\")||(r.spriteFormat=\"png\")}this._set(\"currentStyleInfo\",{...r}),\"string\"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set(\"sourceNameToSource\",r.sourceNameToSource),this._set(\"primarySource\",r.sourceNameToSource[r.primarySourceName]),this._set(\"styleRepository\",new k(r.style)),this.read(r.layerDefinition,{origin:\"service\"}),this.emit(\"load-style\")}_getDefaultAttribution(e){const t=e.match(/^https?:\\/\\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\\.arcgis\\.com(\\/[^\\/]+)?\\/arcgis\\/rest\\/services\\/([^\\/]+(\\/[^\\/]+)*)\\/vectortileserver/i),r=[\"OpenStreetMap_v2\",\"OpenStreetMap_Daylight_v2\",\"OpenStreetMap_Export_v2\",\"OpenStreetMap_FTS_v2\",\"OpenStreetMap_GCS_v2\",\"World_Basemap\",\"World_Basemap_v2\",\"World_Basemap_Export_v2\",\"World_Basemap_GCS_v2\",\"World_Basemap_WGS84\",\"World_Contours_v2\"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const o=t[1]||\"\";for(const s of r)if(s.toLowerCase().includes(i))return y(`//static.arcgis.com/attribution/Vector${o}/${s}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],N.prototype,\"attributionDataUrl\",null),e([u({type:[\"show\",\"hide\"]})],N.prototype,\"listMode\",void 0),e([u({json:{read:!0,write:!0}})],N.prototype,\"blendMode\",void 0),e([u({readOnly:!0,json:{read:!1}})],N.prototype,\"capabilities\",null),e([u({readOnly:!0})],N.prototype,\"currentStyleInfo\",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],N.prototype,\"fullExtent\",null),e([u({json:{read:!1},readOnly:!0,type:d})],N.prototype,\"initialExtent\",null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],N.prototype,\"isReference\",void 0),e([u({type:[\"VectorTileLayer\"]})],N.prototype,\"operationalLayerType\",void 0),e([u({readOnly:!0})],N.prototype,\"parsedUrl\",null),e([u()],N.prototype,\"style\",void 0),e([u({readOnly:!0})],N.prototype,\"serviceUrl\",null),e([u({type:S,readOnly:!0})],N.prototype,\"spatialReference\",null),e([u({readOnly:!0})],N.prototype,\"styleRepository\",void 0),e([u({readOnly:!0})],N.prototype,\"sourceNameToSource\",void 0),e([u({readOnly:!0})],N.prototype,\"primarySource\",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{\"web-document\":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],N.prototype,\"styleUrl\",null),e([h([\"portal-item\",\"web-document\"],\"styleUrl\")],N.prototype,\"writeStyleUrl\",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:I})],N.prototype,\"tileInfo\",null),e([u()],N.prototype,\"tilemapCache\",void 0),e([c(\"service\",\"tilemapCache\",[\"capabilities\",\"tileInfo\"])],N.prototype,\"readTilemapCache\",null),e([u({json:{read:!1},readOnly:!0,value:\"vector-tile\"})],N.prototype,\"type\",void 0),e([u({json:{origins:{\"web-document\":{read:{source:\"styleUrl\"}},\"portal-item\":{read:{source:\"url\"}}},write:!1,read:!1}})],N.prototype,\"url\",void 0),e([u({readOnly:!0})],N.prototype,\"version\",void 0),e([c(\"version\",[\"version\",\"currentVersion\"])],N.prototype,\"readVersion\",null),e([u({type:String,json:{origins:{\"web-scene\":{read:!0,write:!0}},read:!1}})],N.prototype,\"path\",void 0),N=e([m(\"esri.layers.VectorTileLayer\")],N);const A=N;export{A as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{s,m as a}from\"../../chunks/quat.js\";import{a as t}from\"../../chunks/quatf64.js\";import{c as n,f as o}from\"../../chunks/vec3f64.js\";import{a as c,t as r}from\"../../chunks/common.js\";import{c as m,n as u,v as f}from\"../../chunks/vec3.js\";const h=n(),i=t(),p=t(),e=t(),j=o(0,0,1),k=o(0,1,0),v=o(1,0,0);function q(a){m(h,a),u(h,h);const n=Math.atan2(h[1],h[0]),o=s(t(),j,-n);f(h,h,o);const r=-1*Math.atan2(h[2],h[0]);return[c(n)+270,c(r)+90]}function M(t,n){return s(p,j,r(t-270)),s(e,k,r(n-90)),a(i,p,e),m(h,v),f(h,h,i),u(h,h),[h[0],h[1],h[2]]}export{M as computeNormalFromOrientationTilt,q as computeOrientationTiltFromNormal};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as o}from\"../../core/Clonable.js\";import{cyclicalDegrees as r}from\"../../core/Cyclical.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import{cast as i}from\"../../core/accessorSupport/decorators/cast.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as n}from\"../../core/accessorSupport/decorators/subclass.js\";import{ensureNumber as l}from\"../../core/accessorSupport/ensureType.js\";import{computeOrientationTiltFromNormal as a,computeNormalFromOrientationTilt as p}from\"./voxelPlaneUtils.js\";let m=class extends(o(e)){constructor(t){super(t),this.enabled=!0,this.label=\"\",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[t,o]=a(this.normal);return r.normalize(l(t),0,!0)}set orientation(t){const o=p(t,this.tilt);this._set(\"normal\",o),this._set(\"orientation\",t)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[t,o]=a(this.normal);return r.normalize(l(o),0,!0)}set tilt(t){const o=p(this.orientation,t);this._set(\"normal\",o),this._set(\"tilt\",t)}};t([s({type:Boolean,json:{write:!0}})],m.prototype,\"enabled\",void 0),t([s({type:String,json:{write:!0}})],m.prototype,\"label\",void 0),t([s({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),i((t=>r.normalize(l(t),0,!0)))],m.prototype,\"orientation\",null),t([s({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),i((t=>r.normalize(l(t),0,!0)))],m.prototype,\"tilt\",null),t([s({type:[Number],json:{write:!0}})],m.prototype,\"normal\",void 0),t([s({type:[Number],json:{write:!0}})],m.prototype,\"point\",void 0),m=t([n(\"esri.layers.voxel.VoxelSlice\")],m);const c=m;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import{cyclicalDegrees as o}from\"../../core/Cyclical.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as i}from\"../../core/accessorSupport/decorators/property.js\";import{ensureNumber as s,Integer as l}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as n}from\"../../core/accessorSupport/decorators/subclass.js\";import{persistable as p}from\"../../core/accessorSupport/decorators/persistable.js\";import{computeOrientationTiltFromNormal as a}from\"./voxelPlaneUtils.js\";import m from\"./VoxelSlice.js\";import{r as c}from\"../../chunks/persistableUrlUtils.js\";let d=class extends(r(t)){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label=\"\",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,r]=a(this.normal);return o.normalize(s(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,r]=a(this.normal);return o.normalize(s(r),0,!0)}};e([i({type:Boolean,json:{default:!0,write:!0}})],d.prototype,\"enabled\",void 0),e([i({type:String,json:{origins:{service:{read:c}},write:{enabled:!0,isRequired:!0}}}),p({origins:[\"web-scene\"],type:\"resource\",prefix:\"sections\",compress:!0})],d.prototype,\"href\",void 0),e([i({type:l,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,\"id\",void 0),e([i({type:String,json:{write:!0}})],d.prototype,\"label\",void 0),e([i({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],d.prototype,\"orientation\",null),e([i({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],d.prototype,\"tilt\",null),e([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,\"normal\",void 0),e([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,\"point\",void 0),e([i({type:[l],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,\"sizeInPixel\",void 0),e([i({type:[m],json:{write:!0}})],d.prototype,\"slices\",void 0),e([i({type:l,json:{default:0,write:!0}})],d.prototype,\"timeId\",void 0),e([i({type:l,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,\"variableId\",void 0),d=e([n(\"esri.layers.voxel.VoxelSection\")],d);const u=d;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as s}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};r([e({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],t.prototype,\"diffuseFactor\",void 0),r([e({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],t.prototype,\"specularFactor\",void 0),t=r([s(\"esri.layers.voxel.VoxelSimpleShading\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as r}from\"../../core/accessorSupport/decorators/subclass.js\";let s=class extends t{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};o([e({type:[\"discrete\",\"continuous\"],json:{write:!0}})],s.prototype,\"continuity\",void 0),o([e({type:Boolean,json:{write:!0}})],s.prototype,\"hasNoData\",void 0),o([e({type:Number,json:{write:!0}})],s.prototype,\"noData\",void 0),o([e({type:Number,json:{write:!0}})],s.prototype,\"offset\",void 0),o([e({type:Number,json:{write:!0}})],s.prototype,\"scale\",void 0),o([e({type:String,json:{write:{enabled:!0,isRequired:!0}}})],s.prototype,\"type\",void 0),s=o([r(\"esri.layers.voxel.VoxelFormat\")],s);const p=s;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"./VoxelFormat.js\";let i=class extends e{constructor(){super(...arguments),this.id=null,this.description=\"\",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit=\"\",this.volumeId=0,this.type=null}};t([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],i.prototype,\"id\",void 0),t([r({type:String,json:{write:!0}})],i.prototype,\"description\",void 0),t([r({type:String,json:{write:{enabled:!0,isRequired:!0}}})],i.prototype,\"name\",void 0),t([r({type:s,json:{write:!0}})],i.prototype,\"originalFormat\",void 0),t([r({type:s,json:{write:{enabled:!0,isRequired:!0}}})],i.prototype,\"renderingFormat\",void 0),t([r({type:String,json:{write:!0}})],i.prototype,\"unit\",void 0),t([r({type:Number,json:{write:!0}})],i.prototype,\"volumeId\",void 0),t([r({type:[\"stc-hot-spot-results\",\"stc-cluster-outlier-results\",\"stc-estimated-bin\",\"generic-nearest-interpolated\"],json:{write:!0}})],i.prototype,\"type\",void 0),i=t([o(\"esri.layers.voxel.VoxelVariable\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import e from\"../../Color.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as p}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";let l=class extends(r(t)){constructor(){super(...arguments),this.color=e.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=\"\",this.colorLocked=!1}};o([s({type:e,json:{type:[p],write:{enabled:!0,isRequired:!0}}})],l.prototype,\"color\",void 0),o([s({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],l.prototype,\"value\",void 0),o([s({type:Boolean,json:{default:!0,write:!0}})],l.prototype,\"enabled\",void 0),o([s({type:String,json:{write:!0}})],l.prototype,\"label\",void 0),o([s({type:Boolean,json:{default:!1,write:!0}})],l.prototype,\"colorLocked\",void 0),l=o([i(\"esri.layers.voxel.VoxelIsosurface\")],l);const a=l;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{ClonableMixin as e}from\"../../core/Clonable.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as p}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";let c=class extends(e(s)){constructor(){super(...arguments),this.color=null,this.position=0}};o([t({type:r,json:{type:[p],write:{enabled:!0,isRequired:!0}}})],c.prototype,\"color\",void 0),o([t({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,\"position\",void 0),c=o([i(\"esri.layers.voxel.VoxelColorStop\")],c);const l=c;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";let p=class extends(r(e)){constructor(){super(...arguments),this.opacity=1,this.position=0}};o([s({type:Number,json:{name:\"alpha\",write:{enabled:!0,isRequired:!0}}})],p.prototype,\"opacity\",void 0),o([s({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,\"position\",void 0),p=o([t(\"esri.layers.voxel.VoxelOpacityStop\")],p);const i=p;export{i as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{ClonableMixin as o}from\"../../core/Clonable.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";let p=class extends(o(e)){constructor(){super(...arguments),this.enabled=!1,this.range=null}};r([s({type:Boolean,json:{default:!1,write:!0}})],p.prototype,\"enabled\",void 0),r([s({type:[Number],json:{write:!0}})],p.prototype,\"range\",void 0),p=r([t(\"esri.layers.voxel.VoxelRangeFilter\")],p);const a=p;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import t from\"../../Color.js\";import{ClonableMixin as r}from\"../../core/Clonable.js\";import e from\"../../core/Collection.js\";import{referenceSetter as s}from\"../../core/collectionUtils.js\";import{JSONSupport as i}from\"../../core/JSONSupport.js\";import{clamp as p,lerp as n}from\"../../core/mathUtils.js\";import{property as l}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as c}from\"../../core/accessorSupport/decorators/subclass.js\";import a from\"./VoxelColorStop.js\";import h from\"./VoxelOpacityStop.js\";import f from\"./VoxelRangeFilter.js\";var u;!function(o){o[o.Color=1]=\"Color\",o[o.Alpha=2]=\"Alpha\",o[o.Both=3]=\"Both\"}(u||(u={}));let y=class extends(r(i)){constructor(o){super(o),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(e.ofType(a)),this.opacityStops=new(e.ofType(h))}set colorStops(o){this._set(\"colorStops\",s(o,this._get(\"colorStops\"),e.ofType(a)))}set opacityStops(o){this._set(\"opacityStops\",s(o,this._get(\"opacityStops\"),e.ofType(h)))}getPreviousNext(o,t,r){let e=o;for(;--e>0&&t[e].type!==r&&t[e].type!==u.Both;);let s=o;const i=t.length;for(;++so.position{r.color[e]=Math.round(n(t[e],p[e],o))}))}else-1!==s?g.forEach((o=>{r.color[o]=e[s].color[o]})):g.forEach((o=>{r.color[o]=e[i].color[o]}))}}for(const t of e)r.push({color:t.color,position:t.position})}r[0].position=0,r[r.length-1].position=1;let i=0,l=1;for(let c=0;cr[l].position;)i=l++;const s=(e-r[i].position)/(r[l].position-r[i].position),a=r[i].color,h=r[l].color,f=new t;g.forEach((o=>{f[o]=Math.round(n(a[o],h[o],s))})),f.a=p(1-n(a.a,h.a,s)/255,0,1),o.push(f)}return o}getColorForContinuousDataValue(o,t){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let e=this.stretchRange[0],s=this.stretchRange[1];if(e>s){const o=e;e=s,s=o}o=p(o,e,s);const i=r[Math.round((o-e)/(s-e)*(this._colorMapSize-1))].clone();return t||(i.a=1),i}};o([l({type:[\"linear\",\"nearest\"],json:{write:!0}})],y.prototype,\"interpolation\",void 0),o([l({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],y.prototype,\"stretchRange\",void 0),o([l({type:e.ofType(a),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],y.prototype,\"colorStops\",null),o([l({type:e.ofType(h),json:{read:{source:\"alphaStops\"},write:{enabled:!0,target:\"alphaStops\",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],y.prototype,\"opacityStops\",null),o([l({type:f,json:{write:!0}})],y.prototype,\"rangeFilter\",void 0),o([l({type:[t],clonable:!1,json:{read:!1}})],y.prototype,\"rasterizedTransferFunction\",null),y=o([c(\"esri.layers.voxel.VoxelTransferFunctionStyle\")],y);const S=y,g=[\"r\",\"g\",\"b\"];export{S as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as o}from\"../../chunks/tslib.es6.js\";import r from\"../../Color.js\";import{ClonableMixin as e}from\"../../core/Clonable.js\";import{JSONSupport as t}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as p}from\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";let a=class extends(e(t)){constructor(){super(...arguments),this.color=r.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=\"\"}};o([s({type:r,json:{type:[p],write:{enabled:!0,isRequired:!0}}})],a.prototype,\"color\",void 0),o([s({type:p,json:{write:{enabled:!0,isRequired:!0}}})],a.prototype,\"value\",void 0),o([s({type:Boolean,json:{default:!0,write:!0}})],a.prototype,\"enabled\",void 0),o([s({type:String,json:{write:!0}})],a.prototype,\"label\",void 0),a=o([i(\"esri.layers.voxel.VoxelUniqueValue\")],a);const l=a;export{l as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import s from\"../../core/Collection.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{clone as o}from\"../../core/lang.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as i}from\"../../core/accessorSupport/ensureType.js\";import{subclass as u}from\"../../core/accessorSupport/decorators/subclass.js\";import n from\"./VoxelIsosurface.js\";import l from\"./VoxelTransferFunctionStyle.js\";import a from\"./VoxelUniqueValue.js\";var p;let c=p=class extends r{constructor(e){super(e),this.variableId=0,this.label=\"\",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(s.ofType(a)),this.isosurfaces=new(s.ofType(n))}clone(){return new p({variableId:this.variableId,label:this.label,transferFunction:o(this.transferFunction),uniqueValues:o(this.uniqueValues),isosurfaces:o(this.isosurfaces)})}};e([t({type:i,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,\"variableId\",void 0),e([t({type:String,json:{write:!0}})],c.prototype,\"label\",void 0),e([t({type:l,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],c.prototype,\"transferFunction\",void 0),e([t({type:s.ofType(a),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],c.prototype,\"uniqueValues\",void 0),e([t({type:s.ofType(n),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,s=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&s}}}}})],c.prototype,\"isosurfaces\",void 0),c=p=e([u(\"esri.layers.voxel.VoxelVariableStyle\")],c);const f=c;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(){super(...arguments),this.values=null}};r([s({type:[Number],json:{write:!0}})],t.prototype,\"values\",void 0),t=r([e(\"esri.layers.voxel.VoxelIrregularSpacing\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";let t=class extends o{constructor(){super(...arguments),this.scale=1,this.offset=0}};r([s({type:Number,json:{write:!0}})],t.prototype,\"scale\",void 0),r([s({type:Number,json:{write:!0}})],t.prototype,\"offset\",void 0),t=r([e(\"esri.layers.voxel.VoxelRegularSpacing\")],t);const p=t;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as e}from\"../../core/JSONSupport.js\";import{property as t}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as i}from\"../../core/accessorSupport/decorators/subclass.js\";import o from\"./VoxelIrregularSpacing.js\";import s from\"./VoxelRegularSpacing.js\";let p=class extends e{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(null==this.irregularSpacing||void 0===this.irregularSpacing)&&null!==this.regularSpacing}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};r([t({type:o,json:{write:!0}})],p.prototype,\"irregularSpacing\",void 0),r([t({type:Boolean,json:{write:!0}})],p.prototype,\"isPositiveUp\",void 0),r([t({type:Boolean,json:{write:!0}})],p.prototype,\"isWrappedDateLine\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"label\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"name\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"quantity\",void 0),r([t({type:s,json:{write:!0}})],p.prototype,\"regularSpacing\",void 0),r([t({type:Number,json:{write:!0}})],p.prototype,\"size\",void 0),r([t({type:String,json:{write:!0}})],p.prototype,\"unit\",void 0),r([t({type:Boolean,json:{read:!1}})],p.prototype,\"isRegular\",null),p=r([i(\"esri.layers.voxel.VoxelDimension\")],p);const a=p;export{a as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import{JSONSupport as i}from\"../../core/JSONSupport.js\";import s from\"../../core/Logger.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";import{f as n,B as o,A as a,g as l}from\"../../chunks/vec3.js\";import{f as p,e as u}from\"../../chunks/vec3f64.js\";import m from\"../../geometry/Point.js\";import c from\"../../geometry/SpatialReference.js\";import{equals as h}from\"../../geometry/support/spatialReferenceUtils.js\";import g from\"./VoxelDimension.js\";const y=\"esri.layers.voxel.VoxelVolume\",d=s.getLogger(y);let f=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||\"xyt\"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||\"xyt\"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return\"xyt\";if(e&&i)return\"xyzt\"}return\"xyz\"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if(\"xyt\"===this.volumeType)return d.error(\"computeVoxelSpacePosition cannot be used with XYT volumes.\"),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return d.error(\"pos argument should have the same spatial reference as the VoxelLayer.\"),[0,0,0];const i=p(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const s=this.dimensions[this.zDimension];if(!s.isRegular&&Array.isArray(s.irregularSpacing?.values)&&s.irregularSpacing.values.length>1){const r=e.z??0,t=s.irregularSpacing.values,n=s.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-r)r.normalize(a(t),0,!0)))],m.prototype,\"orientation\",null),t([s({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),i((t=>r.normalize(a(t),0,!0)))],m.prototype,\"tilt\",null),t([s({type:[Number],json:{write:!0}})],m.prototype,\"normal\",void 0),t([s({type:[Number],json:{write:!0}})],m.prototype,\"point\",void 0),m=t([n(\"esri.layers.voxel.VoxelDynamicSection\")],m);const c=m;export{c as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../core/Collection.js\";import{referenceSetter as o}from\"../../core/collectionUtils.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{clone as i}from\"../../core/lang.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import{Integer as c}from\"../../core/accessorSupport/ensureType.js\";import{subclass as l}from\"../../core/accessorSupport/decorators/subclass.js\";import a from\"./VoxelDynamicSection.js\";import n from\"./VoxelSlice.js\";var p;let m=p=class extends s{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode=\"scale-height\",this.verticalOffset=0,this.slices=new(t.ofType(n)),this.dynamicSections=new(t.ofType(a))}set slices(e){this._set(\"slices\",o(e,this._get(\"slices\"),t.ofType(n)))}set dynamicSections(e){this._set(\"dynamicSections\",o(e,this._get(\"dynamicSections\"),t.ofType(a)))}clone(){return new p({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:i(this.slices),dynamicSections:i(this.dynamicSections)})}};e([r({type:c,json:{write:{enabled:!0,isRequired:!0}}})],m.prototype,\"volumeId\",void 0),e([r({type:Number,json:{default:1,write:!0}})],m.prototype,\"verticalExaggeration\",void 0),e([r({type:[\"scale-position\",\"scale-height\"],json:{default:\"scale-height\",write:!0}})],m.prototype,\"exaggerationMode\",void 0),e([r({type:Number,json:{default:0,write:!0}})],m.prototype,\"verticalOffset\",void 0),e([r({type:t.ofType(n),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],m.prototype,\"slices\",null),e([r({type:t.ofType(a),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],m.prototype,\"dynamicSections\",null),m=p=e([l(\"esri.layers.voxel.VoxelVolumeStyle\")],m);const d=m;export{d as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../PopupTemplate.js\";import i from\"../core/Collection.js\";import r from\"../core/Error.js\";import o from\"../core/Logger.js\";import{MultiOriginJSONMixin as s}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as n}from\"../core/promiseUtils.js\";import{property as l}from\"../core/accessorSupport/decorators/property.js\";import{Integer as a}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{reader as u}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as p}from\"../core/accessorSupport/decorators/subclass.js\";import{n as c}from\"../chunks/vec3.js\";import{f as m}from\"../chunks/vec3f64.js\";import y from\"../geometry/Extent.js\";import d from\"./Layer.js\";import{APIKeyMixin as f}from\"./mixins/APIKeyMixin.js\";import{ArcGISService as v}from\"./mixins/ArcGISService.js\";import{OperationalLayer as h}from\"./mixins/OperationalLayer.js\";import{PortalLayer as b}from\"./mixins/PortalLayer.js\";import{ScaleRangeLayer as g}from\"./mixins/ScaleRangeLayer.js\";import{SceneService as S}from\"./mixins/SceneService.js\";import{sanitizeUrl as V}from\"./support/arcgisLayerUrl.js\";import{legendEnabled as x,url as j}from\"./support/commonProperties.js\";import w from\"./support/Field.js\";import I from\"./voxel/VoxelSection.js\";import T from\"./voxel/VoxelSimpleShading.js\";import D from\"./voxel/VoxelVariable.js\";import F from\"./voxel/VoxelVariableStyle.js\";import N from\"./voxel/VoxelVolume.js\";import L from\"./voxel/VoxelVolumeIndex.js\";import P from\"./voxel/VoxelVolumeStyle.js\";import{createPopupTemplate as O}from\"../support/popupUtils.js\";const A=\"esri.layers.VoxelLayer\",E=o.getLogger(A);let R=class extends(S(v(h(b(g(s(f(d)))))))){constructor(e){super(e),this.serviceRoot=\"\",this.operationalLayerType=\"Voxel\",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode=\"volume\",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new T,this.opacity=1,this.variables=new i,this.volumes=new i,this.index=null,this.minScale=0,this.maxScale=0,this.type=\"voxel\",this.version={major:Number.NaN,minor:Number.NaN,versionString:\"\"},this.fullExtent=null,this.popupEnabled=!1,this.test=null,this.volumeStyles=new(i.ofType(P)),this.variableStyles=new(i.ofType(F)),this.sections=new(i.ofType(I))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set(\"url\",V(e,E))}load(e){const t=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:[\"Scene Service\"]},e).catch(n).then((()=>this._fetchService(t))).then((()=>this.serviceRoot=this.url));return this.addResolvingPromise(i),Promise.resolve(this)}read(e,t){super.read(e,t);for(const i of this.volumes)i.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new r(\"voxel-layer:layer-type-not-supported\",\"VoxelLayer does not support this layer type\",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new r(\"layer:service-version-not-supported\",\"Service version is not supported.\",{serviceVersion:this.version.versionString,supportedVersions:\"3.x\"});if(this.version.major>3)throw new r(\"layer:service-version-too-new\",\"Service version is too new.\",{serviceVersion:this.version.versionString,supportedVersions:\"3.x\"})}readFullExtent(e,t,i){if(null!=e&&\"object\"==typeof e){const r=y.fromJSON(e,i);if(0===r.zmin&&0===r.zmax&&Array.isArray(t.volumes)){const e=N.fromJSON(t.volumes[0]);if(e.isValid&&\"xyt\"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,i=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>i){const t=e;e=i,i=t}r.zmin=e,r.zmax=i}}}return r}return null}get voxelFields(){const e=[new w({name:\"Voxel.ServiceValue\",alias:\"Value\",domain:null,editable:!1,length:128,type:\"string\"}),new w({name:\"Voxel.ServiceVariableLabel\",alias:\"Variable\",domain:null,editable:!1,length:128,type:\"string\"}),new w({name:\"Voxel.Position\",alias:\"Voxel Position\",domain:null,editable:!1,length:128,type:\"string\"})],t=this.getVolume(null);if(null!=t){if(\"xyzt\"===t.volumeType||\"xyt\"===t.volumeType){const t=new w({name:\"Voxel.ServiceLocalTime\",alias:\"Local Time\",domain:null,editable:!1,length:128,type:\"string\"});e.push(t);const i=new w({name:\"Voxel.ServiceNativeTime\",alias:\"Native Time\",domain:null,editable:!1,length:128,type:\"string\"});e.push(i)}if(\"xyt\"!==t.volumeType){const t=new w({name:\"Voxel.ServiceDepth\",alias:\"Depth\",domain:null,editable:!1,length:128,type:\"string\"});e.push(t)}}return e}get popupTemplate(){return this.loaded?this.createPopupTemplate():null}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.voxelFields,i=this.title;return O({fields:t,title:i},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):\"\"}getVariableStyle(e){let t=-1;t=null!=e?e:this.currentVariableId;if(!this.variableStyles||-1===t)return null;const i=this.variableStyles.findIndex((e=>e.variableId===t));return i<0?null:this.variableStyles.at(i)}getVariable(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variables||-1===t)return null;const i=this.variables.findIndex((e=>e.id===t));return i<0?null:this.variables.at(i)}getVolume(e){const t=this.getVariable(e);return null!=t?this.volumes.find((({id:e})=>e===t.volumeId)):null}getVolumeStyle(e){const t=this.getVariable(e);return null!=t?this.volumeStyles.find((({volumeId:e})=>e===t.volumeId)):null}getColorForContinuousDataValue(e,t,i){const r=this.getVariable(e);if(null==r||\"continuous\"!==r.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const o=this.variableStyles.findIndex((t=>t.variableId===e));if(o<0)return null;const s=this.variableStyles.at(o);return s?.transferFunction?s.transferFunction.getColorForContinuousDataValue(t,i):null}getSections(){const e=[];for(const t of this.sections)e.push(new I({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const i=this._getVariable(t);if(null!=i){const r=t.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),E.error(\"A maximum of 4 isosurfaces are supported for Voxel Layers.\"));for(const e of r.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(r.variableId,e.value,!1);null===t||t.equals(e.color)||(e.color=t)}if(\"continuous\"===i.renderingFormat.continuity)(null===r.transferFunction||r.transferFunction.colorStops.length<2)&&E.error(`VoxelVariableStyle for variable ${i.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==r.transferFunction&&(Array.isArray(r.transferFunction.stretchRange)&&2===r.transferFunction.stretchRange.length||(E.error(`VoxelVariableStyle for variable ${i.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll()));else if(\"discrete\"===i.renderingFormat.continuity)if(0===t.uniqueValues.length)E.error(`VoxelVariableStyle for variable ${i.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(r)}else E.error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const i=this._getVolumeFromVolumeId(t.volumeId);if(null!=i){const r=t.clone();for(const e of r.slices)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label=\"invalid\");for(const e of r.dynamicSections)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label=\"invalid\");e.push(r)}else E.error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const i of this.variables)if(i.id===t)return i;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,i){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;const r=m(e.normal[0],e.normal[1],e.normal[2]);c(r,r);const o=1e-6;return!(Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,i){t[i]=!e}},origins:{\"portal-item\":{default:!0},\"web-scene\":{default:!0}}}})],R.prototype,\"popupEnabled\",void 0),e([l({type:t,json:{read:!1}})],R.prototype,\"popupTemplate\",null),e([l({readOnly:!0})],R.prototype,\"defaultPopupTemplate\",null),R=e([p(A)],R);const M=R;export{M as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../chunks/tslib.es6.js\";import\"../../../geometry.js\";import t from\"../../../core/Error.js\";import has from\"../../../core/has.js\";import r from\"../../../core/Loadable.js\";import{debounce as s,eachAlways as o}from\"../../../core/promiseUtils.js\";import{open as a}from\"../../../core/workers/workers.js\";import{property as i}from\"../../../core/accessorSupport/decorators/property.js\";import\"../../../core/accessorSupport/ensureType.js\";import\"../../../core/arrayUtils.js\";import{subclass as n}from\"../../../core/accessorSupport/decorators/subclass.js\";import{featureGeometryTypeKebabDictionary as c}from\"../../../geometry/support/typeUtils.js\";import{createCapabilities as p,createDrawingInfo as l}from\"./support/clientSideDefaults.js\";import{getCapabilities as u,getWFSLayerInfo as m,prepareWFSLayerFields as y,findFeatureType as d}from\"../../ogc/wfsUtils.js\";import f from\"../../../rest/support/FeatureSet.js\";import{utc as h}from\"../../../time/timeZoneUtils.js\";import w from\"../../../geometry/Extent.js\";let g=class extends r{constructor(){super(...arguments),this._connection=null,this.capabilities=p(!1,!1),this.type=\"wfs\",this.refresh=s((async e=>{await this.load();const{extent:t}=await this._connection.invoke(\"refresh\",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke(\"queryFeatures\",e?e.toJSON():null,t);return f.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke(\"queryFeatures\",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke(\"queryFeatureCount\",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke(\"queryObjectIds\",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._connection.invoke(\"queryExtent\",e?e.toJSON():null,t);return{count:r.count,extent:w.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke(\"querySnapping\",e,t)}async _createLoadOptions(e){const{url:r,customParameters:s,name:o,namespaceUri:a,fields:i,geometryType:n,swapXY:p}=this.layer,l=\"defaults\"===this.layer.originOf(\"spatialReference\")?void 0:this.layer.spatialReference;if(!r)throw new t(\"wfs-layer:missing-url\",\"WFSLayer must be created with a url\");this.wfsCapabilities||(this.wfsCapabilities=await u(r,{customParameters:s,...e}));const f=[\"fields\",\"geometryType\",\"name\",\"namespaceUri\",\"swapXY\"].some((e=>null==this.layer[e])),h=f?await m(this.wfsCapabilities,o,a,{spatialReference:l,customParameters:s,signal:e?.signal}):{...y(i??[]),geometryType:n,name:o,namespaceUri:a,spatialReference:l,swapXY:p},w=d(this.wfsCapabilities.readFeatureTypes(),h.name,h.namespaceUri),g=c.toJSON(h.geometryType);return{customParameters:s,featureType:w,fields:h.fields?.map((e=>e.toJSON()))??[],geometryField:h.geometryField,geometryType:g,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:h.objectIdField,spatialReference:h.spatialReference?.toJSON(),swapXY:!!h.swapXY}}async _startWorker(e){const[t,r]=await o([this._createLoadOptions(e),a(\"WFSSourceWorker\",{...e,strategy:has(\"feature-layers-workers\")?\"dedicated\":\"local\",registryTarget:this})]),s=t.error||r.error||null,i=r.value||null;if(s)throw i&&i.close(),s;const n=t.value;this._connection=r.value;const c=(await this._connection.invoke(\"load\",n,e)).extent;this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:h},extent:c,fields:n.fields,geometryType:n.geometryType,objectIdField:n.objectIdField,geometryField:n.geometryField,drawingInfo:l(n.geometryType),name:n.featureType.title,wfsInfo:{name:n.featureType.name,featureUrl:n.getFeatureUrl,maxFeatures:3e3,swapXY:n.swapXY,supportedSpatialReferences:n.featureType.supportedSpatialReferences,version:\"2.0.0\",wfsNamespace:n.featureType.namespaceUri}}}};e([i()],g.prototype,\"capabilities\",void 0),e([i({constructOnly:!0})],g.prototype,\"layer\",void 0),e([i()],g.prototype,\"sourceJSON\",void 0),e([i()],g.prototype,\"type\",void 0),e([i()],g.prototype,\"wfsCapabilities\",void 0),g=e([n(\"esri.layers.graphics.sources.WFSSource\")],g);export{g as WFSSource};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import\"../geometry.js\";import r from\"../PopupTemplate.js\";import\"../renderers/ClassBreaksRenderer.js\";import\"../renderers/DictionaryRenderer.js\";import\"../renderers/DotDensityRenderer.js\";import\"../renderers/HeatmapRenderer.js\";import\"../renderers/PieChartRenderer.js\";import\"../renderers/Renderer.js\";import\"../renderers/SimpleRenderer.js\";import\"../renderers/UniqueValueRenderer.js\";import\"../renderers/support/jsonUtils.js\";import{rendererTypes as t,webSceneRendererTypes as i}from\"../renderers/support/types.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{setDeepValue as s}from\"../core/object.js\";import{urlToObject as n}from\"../core/urlUtils.js\";import{property as p}from\"../core/accessorSupport/decorators/property.js\";import{Integer as a}from\"../core/accessorSupport/ensureType.js\";import\"../core/arrayUtils.js\";import\"../core/has.js\";import{subclass as l}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as d}from\"../core/accessorSupport/decorators/writer.js\";import{featureGeometryTypeKebabDictionary as m}from\"../geometry/support/typeUtils.js\";import u from\"./Layer.js\";import{WFSSource as y}from\"./graphics/sources/WFSSource.js\";import{BlendLayer as f}from\"./mixins/BlendLayer.js\";import{CustomParametersMixin as c}from\"./mixins/CustomParametersMixin.js\";import{FeatureEffectLayer as h}from\"./mixins/FeatureEffectLayer.js\";import{FeatureReductionLayer as g}from\"./mixins/FeatureReductionLayer.js\";import{OperationalLayer as j}from\"./mixins/OperationalLayer.js\";import{OrderedLayer as v}from\"./mixins/OrderedLayer.js\";import{PortalLayer as w}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as F}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as b}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as x}from\"./mixins/TemporalLayer.js\";import{wfsOidFieldName as I}from\"./ogc/wfsUtils.js\";import{elevationInfo as O,labelsVisible as R,legendEnabled as S,opacityDrawingInfo as P,popupEnabled as T,screenSizePerspectiveEnabled as U,url as q}from\"./support/commonProperties.js\";import E from\"./support/Field.js\";import{defineFieldProperties as L}from\"./support/fieldProperties.js\";import{fixRendererFields as C,fixTimeInfoFields as D}from\"./support/fieldUtils.js\";import Q from\"./support/LabelClass.js\";import{reader as W}from\"./support/labelingInfo.js\";import V from\"../rest/support/Query.js\";import{createPopupTemplate as N}from\"../support/popupUtils.js\";import{timeZoneProperty as X}from\"../time/timeZoneUtils.js\";import Y from\"../geometry/SpatialReference.js\";import k from\"../geometry/Extent.js\";var B;const J=L();let M=B=class extends(v(c(g(h(f(x(F(b(j(w(o(u)))))))))))){static fromWFSLayerInfo(e){const{customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:d,wfsCapabilities:m}=e;return new B({customParameters:r,fields:t,geometryField:i,geometryType:o,name:s,namespaceUri:n,objectIdField:p,spatialReference:a,swapXY:l,url:d,wfsCapabilities:m})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType=\"WFS\",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new y({layer:this}),this.spatialReference=Y.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title=\"WFS\",this.type=\"wfs\",this.url=null,this.version=void 0}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"WFS\"]},e).then((()=>this.source.load(e))).then((()=>{this.read(this.source.sourceJSON,{origin:\"service\",url:this.parsedUrl}),this.revert([\"objectIdField\",\"fields\",\"timeInfo\",\"spatialReference\",\"name\",\"namespaceUri\"],\"service\"),C(this.renderer,this.fieldsIndex),D(this.timeInfo,this.fieldsIndex)}))),Promise.resolve(this)}get capabilities(){return this.source?.capabilities}get createQueryVersion(){return this.commitProperty(\"definitionExpression\"),this.commitProperty(\"timeExtent\"),this.commitProperty(\"timeOffset\"),this.commitProperty(\"geometryType\"),this.commitProperty(\"capabilities\"),(this._get(\"createQueryVersion\")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t){const i=e.filter((e=>e.name!==I));this.geometryField&&i.unshift(new E({name:this.geometryField,alias:this.geometryField,type:\"geometry\"})),s(t,i.map((e=>e.toJSON())),r)}get parsedUrl(){return n(this.url)}set renderer(e){C(e,this.fieldsIndex),this._set(\"renderer\",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return N(this,e)}createQuery(){const e=new V;e.returnGeometry=!0,e.outFields=[\"*\"],e.where=this.definitionExpression||\"1=1\";const{timeOffset:r,timeExtent:t}=this;return e.timeExtent=null!=r&&null!=t?t.offset(-r.value,r.unit):t||null,e}getFieldDomain(e,r){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,r){return this.load().then((()=>this.source.queryFeatures(V.from(e)||this.createQuery(),r))).then((e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this;return e}))}queryObjectIds(e,r){return this.load().then((()=>this.source.queryObjectIds(V.from(e)||this.createQuery(),r)))}queryFeatureCount(e,r){return this.load().then((()=>this.source.queryFeatureCount(V.from(e)||this.createQuery(),r)))}queryExtent(e,r){return this.load().then((()=>this.source.queryExtent(V.from(e)||this.createQuery(),r)))}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh(this.customParameters);return null!=r&&this.read(r,{origin:\"service\",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([p({readOnly:!0})],M.prototype,\"capabilities\",null),e([p({type:String})],M.prototype,\"copyright\",void 0),e([p({readOnly:!0})],M.prototype,\"createQueryVersion\",null),e([p({json:{name:\"wfsInfo.customParameters\",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],M.prototype,\"customParameters\",void 0),e([p(X(\"dateFieldsTimeReference\"))],M.prototype,\"dateFieldsTimeZone\",void 0),e([p({readOnly:!0})],M.prototype,\"defaultPopupTemplate\",null),e([p({type:String,json:{name:\"layerDefinition.definitionExpression\",write:{enabled:!0,allowNull:!0}}})],M.prototype,\"definitionExpression\",void 0),e([p({type:String})],M.prototype,\"displayField\",void 0),e([p(O)],M.prototype,\"elevationInfo\",void 0),e([p({type:String,readOnly:!0,json:{name:\"wfsInfo.featureUrl\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"featureUrl\",void 0),e([p({type:[E],json:{name:\"layerDefinition.fields\",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:\"fields\"}}}})],M.prototype,\"fields\",void 0),e([d(\"fields\")],M.prototype,\"writeFields\",null),e([p(J.fieldsIndex)],M.prototype,\"fieldsIndex\",void 0),e([p({type:k,json:{name:\"extent\"}})],M.prototype,\"fullExtent\",void 0),e([p()],M.prototype,\"geometryField\",void 0),e([p({type:String,json:{read:{source:\"layerDefinition.geometryType\",reader:m.read},write:{target:\"layerDefinition.geometryType\",writer:m.write,ignoreOrigin:!0},origins:{service:{read:m.read}}}})],M.prototype,\"geometryType\",void 0),e([p({type:String})],M.prototype,\"id\",void 0),e([p(R)],M.prototype,\"labelsVisible\",void 0),e([p({type:[Q],json:{name:\"layerDefinition.drawingInfo.labelingInfo\",read:{reader:W},write:!0}})],M.prototype,\"labelingInfo\",void 0),e([p(S)],M.prototype,\"legendEnabled\",void 0),e([p({type:[\"show\",\"hide\"]})],M.prototype,\"listMode\",void 0),e([p({type:String})],M.prototype,\"objectIdField\",void 0),e([p({type:[\"WFS\"]})],M.prototype,\"operationalLayerType\",void 0),e([p({type:a,json:{name:\"wfsInfo.maxFeatures\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"maxFeatures\",void 0),e([p({type:[0],readOnly:!0,json:{origins:{\"web-map\":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],M.prototype,\"mode\",void 0),e([p({type:String,json:{name:\"wfsInfo.name\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"name\",void 0),e([p({type:String,json:{name:\"wfsInfo.wfsNamespace\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"namespaceUri\",void 0),e([p(P)],M.prototype,\"opacity\",void 0),e([p(J.outFields)],M.prototype,\"outFields\",void 0),e([p({readOnly:!0})],M.prototype,\"parsedUrl\",null),e([p(T)],M.prototype,\"popupEnabled\",void 0),e([p({type:r,json:{name:\"popupInfo\",write:!0}})],M.prototype,\"popupTemplate\",void 0),e([p({types:t,json:{origins:{service:{name:\"drawingInfo.renderer\"},\"web-scene\":{types:i,name:\"layerDefinition.drawingInfo.renderer\",write:!0}},name:\"layerDefinition.drawingInfo.renderer\",write:{ignoreOrigin:!0}}})],M.prototype,\"renderer\",null),e([p(U)],M.prototype,\"screenSizePerspectiveEnabled\",void 0),e([p({readOnly:!0})],M.prototype,\"source\",void 0),e([p({type:Y,json:{name:\"layerDefinition.spatialReference\",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:\"extent.spatialReference\"}}}})],M.prototype,\"spatialReference\",void 0),e([p({readOnly:!0,type:[a],json:{name:\"wfsInfo.supportedSpatialReferences\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"spatialReferences\",void 0),e([p({type:Boolean,value:!1,json:{name:\"wfsInfo.swapXY\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"swapXY\",void 0),e([p({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:\"name\"}}}})],M.prototype,\"title\",void 0),e([p({json:{read:!1},readOnly:!0})],M.prototype,\"type\",void 0),e([p(q)],M.prototype,\"url\",void 0),e([p({type:String,readOnly:!0,json:{name:\"wfsInfo.version\",write:{ignoreOrigin:!0,isRequired:!0}}})],M.prototype,\"version\",void 0),e([p()],M.prototype,\"wfsCapabilities\",null),M=B=e([l(\"esri.layers.WFSLayer\")],M);const Z=M;export{Z as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nconst n=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function o(o){return null!=o&&n.some((([n,t])=>o>=n&&o<=t))}export{o as isAxesOrderReversedForWkid};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../chunks/tslib.es6.js\";import t from\"../../core/Collection.js\";import{IdentifiableMixin as r}from\"../../core/Identifiable.js\";import{MultiOriginJSONSupport as s}from\"../../core/MultiOriginJSONSupport.js\";import{on as o,watch as i,sync as l}from\"../../core/reactiveUtils.js\";import{property as n}from\"../../core/accessorSupport/decorators/property.js\";import{cast as a}from\"../../core/accessorSupport/decorators/cast.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as p}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as y}from\"../../core/accessorSupport/decorators/subclass.js\";import{ensureType as d}from\"../../core/accessorSupport/ensureType.js\";import u from\"../../geometry/Extent.js\";var h;let c=0,m=h=class extends(r(s)){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([o((()=>this.sublayers),\"after-add\",(({item:e})=>{e.parent=this,e.layer=this.layer}),l),o((()=>this.sublayers),\"after-remove\",(({item:e})=>{e.layer=e.parent=null}),l),i((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer}),l),i((()=>this.layer),(e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e}),l)])}get id(){const e=this._get(\"id\");return e??c++}set id(e){this._set(\"id\",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return d(t.ofType(h),e)}set visible(e){this._setAndNotifyLayer(\"visible\",e)}clone(){const e=new h;return this.hasOwnProperty(\"description\")&&(e.description=this.description),this.hasOwnProperty(\"fullExtent\")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty(\"fullExtents\")&&(e.fullExtents=this.fullExtents?.map((e=>e.clone()))??null),this.hasOwnProperty(\"legendUrl\")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty(\"legendEnabled\")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty(\"layer\")&&(e.layer=this.layer),this.hasOwnProperty(\"name\")&&(e.name=this.name),this.hasOwnProperty(\"parent\")&&(e.parent=this.parent),this.hasOwnProperty(\"queryable\")&&(e.queryable=this.queryable),this.hasOwnProperty(\"sublayers\")&&(e.sublayers=this.sublayers?.map((e=>e.clone()))),this.hasOwnProperty(\"spatialReferences\")&&(e.spatialReferences=this.spatialReferences?.map((e=>e))),this.hasOwnProperty(\"visible\")&&(e.visible=this.visible),this.hasOwnProperty(\"title\")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit(\"wms-sublayer-update\",{propertyName:e,id:this.id}))}};e([n()],m.prototype,\"description\",void 0),e([n({readOnly:!0})],m.prototype,\"dimensions\",void 0),e([n({type:u,json:{name:\"extent\"}})],m.prototype,\"fullExtent\",void 0),e([n()],m.prototype,\"fullExtents\",void 0),e([n({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],m.prototype,\"id\",null),e([n({type:String,json:{name:\"legendUrl\",write:{ignoreOrigin:!0}}})],m.prototype,\"legendUrl\",void 0),e([p(\"legendUrl\",[\"legendUrl\",\"legendURL\"])],m.prototype,\"readLegendUrl\",null),e([n({type:Boolean,json:{name:\"showLegend\",origins:{\"web-map\":{read:!1,write:!1},\"web-scene\":{read:!1,write:!1}}}})],m.prototype,\"legendEnabled\",void 0),e([n()],m.prototype,\"layer\",void 0),e([n()],m.prototype,\"maxScale\",void 0),e([n()],m.prototype,\"minScale\",void 0),e([n({readOnly:!0})],m.prototype,\"effectiveScaleRange\",null),e([n({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,\"name\",void 0),e([n()],m.prototype,\"parent\",void 0),e([n({type:Boolean,json:{read:{source:\"showPopup\"},write:{ignoreOrigin:!0,target:\"showPopup\"}}})],m.prototype,\"popupEnabled\",void 0),e([n({type:Boolean,json:{write:{ignoreOrigin:!0}}})],m.prototype,\"queryable\",void 0),e([n()],m.prototype,\"sublayers\",void 0),e([a(\"sublayers\")],m.prototype,\"castSublayers\",null),e([n({type:[Number],json:{read:{source:\"spatialReferences\"}}})],m.prototype,\"spatialReferences\",void 0),e([n({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,\"title\",void 0),e([n({type:Boolean,value:!0,json:{read:{source:\"defaultVisibility\"}}})],m.prototype,\"visible\",null),m=h=e([y(\"esri.layers.support.WMSSublayer\")],m);const f=m;export{f as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{isSome as e}from\"../../core/arrayUtils.js\";import t from\"../../core/Error.js\";import{urlToObject as n}from\"../../core/urlUtils.js\";import r from\"../../geometry/Extent.js\";import i from\"../../geometry/SpatialReference.js\";import{isAxesOrderReversedForWkid as s}from\"../ogc/crsUtils.js\";const o={84:4326,83:4269,27:4267};function l(n){if(!n)return null;const i={idCounter:-1};if(\"string\"==typeof n){n=(new DOMParser).parseFromString(n,\"text/xml\")}const s=n.documentElement;if(\"ServiceExceptionReport\"===s.nodeName){const e=Array.prototype.slice.call(s.childNodes).map((e=>e.textContent)).join(\"\\r\\n\");throw new t(\"wmslayer:wms-capabilities-xml-is-not-valid\",\"The server returned errors when the WMS capabilities were requested.\",e)}const o=d(\"Capability\",s),l=d(\"Service\",s),a=o&&d(\"Request\",o);if(!o||!l||!a)return null;const m=d(\"Layer\",o);if(!m)return null;const f=\"WMS_Capabilities\"===s.nodeName||\"WMT_MS_Capabilities\"===s.nodeName?s.getAttribute(\"version\"):\"1.3.0\",p=h(\"Title\",l,\"\")||h(\"Name\",l,\"\"),x=h(\"AccessConstraints\",l,\"\"),y=/^none$/i.test(x)?\"\":x,S=h(\"Abstract\",l,\"\"),E=parseInt(h(\"MaxWidth\",l,\"5000\"),10),w=parseInt(h(\"MaxHeight\",l,\"5000\"),10),L=N(a,\"GetMap\"),M=g(a,\"GetMap\"),C=b(m,f,i);if(!C)return null;let v,I=0;const R=Array.prototype.slice.call(o.childNodes),U=C.sublayers??[],T=e=>{null!=e&&U.push(e)};R.forEach((e=>{\"Layer\"===e.nodeName&&(0===I?v=e:1===I?(C.name&&(C.name=\"\",T(b(v,f,i))),T(b(e,f,i))):T(b(e,f,i)),I++)}));let V=C.sublayers,O=C.extent;const _=C.fullExtents??[];if(V||(V=[]),0===V.length&&V.push(C),!O){const e=new r(V[0].extent);C.extent=e.toJSON(),O=C.extent}const B=C.spatialReferences.length>0?C.spatialReferences:u(C),D=g(a,\"GetFeatureInfo\"),j=D?N(a,\"GetFeatureInfo\"):null,k=c(V),q=C.minScale||0,X=C.maxScale||0,G=C.dimensions??[],W=k.reduce(((e,t)=>e.concat(t.dimensions??[])),[]),P=G.concat(W).filter(F);let $=null;if(P.length){const t=P.map((e=>{const{extent:t}=e;return A(t)?t.map((e=>e.getTime())):t?.map((e=>[e.min.getTime(),e.max.getTime()]))})).flat(2).filter(e);$={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...t),Math.max(...t)]}}return{copyright:y,description:S,dimensions:G,extent:O,fullExtents:_,featureInfoFormats:j,featureInfoUrl:D,mapUrl:M,maxWidth:E,maxHeight:w,maxScale:X,minScale:q,layers:k,spatialReferences:B,supportedImageFormatTypes:L,timeInfo:$,title:p,version:f}}function a(e){const t=e.filter((e=>e.popupEnabled&&e.name&&e.queryable));return t.length?t.map((({name:e})=>e)).join():null}function u(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const e=u(t);if(e.length>0)return e}return[]}function c(e){let t=[];for(const n of e)t.push(n),n.sublayers?.length&&(t=t.concat(c(n.sublayers)),delete n.sublayers);return t}function m(e,t,n){return t.getAttribute(e)??n}function f(e,t,n,r){const i=d(e,n);return i?m(t,i,r):r}function d(e,t){for(let n=0;ne)).filter(e)}const i=[];for(const e of r)if(e.getAttribute(\"name\")===n){const t=p(\"Format\",e);for(const{textContent:e}of t)null!=e&&i.push(e)}return i}function y(e,t,n){const r=d(t,e);if(!r)return n;const{textContent:i}=r;if(null==i||\"\"===i)return n;const s=Number(i);return isNaN(s)?n:s}function b(e,t,n){if(!e)return null;const l={id:n.idCounter++,fullExtents:[],parentLayerId:null,queryable:\"1\"===e.getAttribute(\"queryable\"),spatialReferences:[],sublayers:null},a=d(\"LatLonBoundingBox\",e),u=d(\"EX_GeographicBoundingBox\",e);let c=null;a&&(c=x(a,4326)),u&&(c=new r(0,0,0,0,new i({wkid:4326})),c.xmin=parseFloat(h(\"westBoundLongitude\",u,\"0\")),c.ymin=parseFloat(h(\"southBoundLatitude\",u,\"0\")),c.xmax=parseFloat(h(\"eastBoundLongitude\",u,\"0\")),c.ymax=parseFloat(h(\"northBoundLatitude\",u,\"0\"))),a||u||(c=new r(-180,-90,180,90,new i({wkid:4326}))),l.minScale=y(e,\"MaxScaleDenominator\",0),l.maxScale=y(e,\"MinScaleDenominator\",0);const f=[\"1.0.0\",\"1.1.0\",\"1.1.1\"].includes(t)?\"SRS\":\"CRS\";return Array.prototype.slice.call(e.childNodes).forEach((e=>{if(\"Name\"===e.nodeName)l.name=e.textContent||\"\";else if(\"Title\"===e.nodeName)l.title=e.textContent||\"\";else if(\"Abstract\"===e.nodeName)l.description=e.textContent||\"\";else if(\"BoundingBox\"===e.nodeName){const n=e.getAttribute(f);if(n&&0===n.indexOf(\"EPSG:\")){const r=parseInt(n.substring(5),10);0===r||isNaN(r)||c||(c=\"1.3.0\"===t?x(e,r,s(r)):x(e,r))}const r=n&&n.indexOf(\":\");if(r&&r>-1){let i=parseInt(n.substring(r+1,n.length),10);0===i||isNaN(i)||(i=o[i]??i);const a=\"1.3.0\"===t?x(e,i,s(i)):x(e,i);a&&l.fullExtents&&l.fullExtents.push(a)}}else if(e.nodeName===f){(e.textContent?.split(\" \")??[]).forEach((e=>{const t=e.includes(\":\")?parseInt(e.split(\":\")[1],10):parseInt(e,10);if(0!==t&&!isNaN(t)){const e=o[t]??t;l.spatialReferences.includes(e)||l.spatialReferences.push(e)}}))}else if(\"Style\"!==e.nodeName||l.legendUrl){if(\"Layer\"===e.nodeName){const r=b(e,t,n);r&&(r.parentLayerId=l.id,l.sublayers||(l.sublayers=[]),l.sublayers.push(r))}}else{const t=d(\"LegendURL\",e);if(t){const e=d(\"OnlineResource\",t);e&&(l.legendUrl=e.getAttribute(\"xlink:href\"))}}})),l.extent=c?.toJSON(),l.dimensions=p(\"Dimension\",e).filter((e=>e.getAttribute(\"name\")&&e.getAttribute(\"units\")&&e.textContent)).map((e=>{const t=e.getAttribute(\"name\"),n=e.getAttribute(\"units\"),r=e.textContent,i=e.getAttribute(\"unitSymbol\")??void 0,s=e.getAttribute(\"default\")??void 0,o=\"0\"!==m(\"default\",e,\"0\"),l=\"0\"!==m(\"nearestValue\",e,\"0\"),a=\"0\"!==m(\"current\",e,\"0\");if(F({name:t,units:n})){return{name:\"time\",units:\"ISO8601\",extent:I(r),default:I(s),multipleValues:o,nearestValue:l,current:a}}if(w({name:t,units:n})){return{name:\"elevation\",units:n,extent:C(r),unitSymbol:i,default:C(s),multipleValues:o,nearestValue:l}}return{name:t,units:n,extent:v(r),unitSymbol:i,default:v(s),multipleValues:o,nearestValue:l}})),l}function A(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function S(e){return e.nodeType===Node.ELEMENT_NODE}function E(e){return void 0!==e.min&&void 0!==e.max}function w(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\\d+$/i.test(e.units)}function L(e){return!F(e)&&!w(e)}function F(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function M(e,t){const r=[],i=n(e);for(const n in i.query)i.query.hasOwnProperty(n)&&(t.includes(n.toLowerCase())||r.push(n+\"=\"+i.query[n]));return i.path+(r.length?\"?\"+r.join(\"&\"):\"\")}function C(t){if(!t)return;const n=t.includes(\"/\"),r=t.split(\",\");return n?r.map((e=>{const t=e.split(\"/\");if(t.length<2)return null;return{min:parseFloat(t[0]),max:parseFloat(t[1]),resolution:t.length>=3&&\"0\"!==t[2]?parseFloat(t[2]):void 0}})).filter(e):r.map((e=>parseFloat(e)))}function v(t){if(!t)return;const n=t.includes(\"/\"),r=t.split(\",\");return n?r.map((e=>{const t=e.split(\"/\");if(t.length<2)return null;return{min:t[0],max:t[1],resolution:t.length>=3&&\"0\"!==t[2]?t[2]:void 0}})).filter(e):r}function I(t){if(!t)return;const n=t.includes(\"/\"),r=t.split(\",\");return n?r.map((e=>{const t=e.split(\"/\");if(t.length<2)return null;return{min:new Date(t[0]),max:new Date(t[1]),resolution:t.length>=3&&\"0\"!==t[2]?R(t[2]):void 0}})).filter(e):r.map((e=>new Date(e)))}function R(e){const t=/(?:p(\\d+y|\\d+(?:\\.|,)\\d+y)?(\\d+m|\\d+(?:\\.|,)\\d+m)?(\\d+d|\\d+(?:\\.|,)\\d+d)?)?(?:t(\\d+h|\\d+(?:\\.|,)\\d+h)?(\\d+m|\\d+(?:\\.|,)\\d+m)?(\\d+s|\\d+(?:\\.|,)\\d+s)?)?/i,n=e.match(t);if(!n)return null;return{years:U(n[1]),months:U(n[2]),days:U(n[3]),hours:U(n[4]),minutes:U(n[5]),seconds:U(n[6])}}function U(e){if(!e)return 0;const t=/(?:\\d+(?:\\.|,)\\d+|\\d+)/,n=e.match(t);if(!n)return 0;const r=n[0].replace(\",\",\".\");return Number(r)}function T(e){return e.toISOString().replace(/\\.[0-9]{3}/,\"\")}const V=new Set([102100,3857,102113,900913]),O=new Set([3395,54004]);function _(e,t){let n=e.wkid;return null==t?n:(null!=n&&t.includes(n)||!e.latestWkid||(n=e.latestWkid),null!=n&&V.has(n)?t.find((e=>V.has(e)))||t.find((e=>O.has(e)))||102100:n)}export{R as fromISODuration,a as getPopupLayers,E as isDimensionInterval,w as isElevationDimension,L as isGenericDimension,F as isTimeDimension,_ as normalizeWKID,l as parseCapabilities,T as toISOString};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../config.js\";import r from\"../Graphic.js\";import o from\"../PopupTemplate.js\";import s from\"../request.js\";import i from\"../core/Collection.js\";import a from\"../core/CollectionFlattener.js\";import{JSONMap as n}from\"../core/jsonMap.js\";import{clone as l}from\"../core/lang.js\";import{MultiOriginJSONMixin as p}from\"../core/MultiOriginJSONSupport.js\";import{throwIfAbortError as m}from\"../core/promiseUtils.js\";import{on as u,watch as c,sync as f}from\"../core/reactiveUtils.js\";import{urlToObject as y,addQueryParameters as d,addProxy as h,Url as g}from\"../core/urlUtils.js\";import{property as b}from\"../core/accessorSupport/decorators/property.js\";import{Integer as w}from\"../core/accessorSupport/ensureType.js\";import{reader as v}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as x}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as j}from\"../core/accessorSupport/decorators/writer.js\";import{willPropertyWrite as I}from\"../core/accessorSupport/write.js\";import S from\"../geometry/Extent.js\";import F from\"../geometry/SpatialReference.js\";import{getScale as P}from\"../geometry/support/scaleUtils.js\";import{equals as R}from\"../geometry/support/spatialReferenceUtils.js\";import E from\"./Layer.js\";import{BlendLayer as O}from\"./mixins/BlendLayer.js\";import{OperationalLayer as L}from\"./mixins/OperationalLayer.js\";import{PortalLayer as U}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as M}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as T}from\"./mixins/ScaleRangeLayer.js\";import{TemporalLayer as _}from\"./mixins/TemporalLayer.js\";import{isAxesOrderReversedForWkid as $}from\"./ogc/crsUtils.js\";import{isWmsServer as C}from\"./support/arcgisLayerUrl.js\";import{legendEnabled as W,url as q}from\"./support/commonProperties.js\";import{ExportWMSImageParameters as N}from\"./support/ExportWMSImageParameters.js\";import{createBitmap as B}from\"./support/imageBitmapUtils.js\";import H from\"./support/WMSSublayer.js\";import{normalizeWKID as k,toISOString as G,getPopupLayers as A,parseCapabilities as D}from\"./support/wmsUtils.js\";const J=new n({bmp:\"image/bmp\",gif:\"image/gif\",jpg:\"image/jpeg\",png:\"image/png\",svg:\"image/svg+xml\"},{ignoreUnknown:!1});function V(e){return\"text/html\"===e}function z(e){return\"text/plain\"===e}let Q=class extends(O(_(M(T(L(U(p(E)))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType=\"WMS\",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type=\"wms\",this.version=null,this.addHandles([u((()=>this.sublayers),\"after-add\",(({item:e})=>{e.parent=e.layer=this}),f),u((()=>this.sublayers),\"after-remove\",(({item:e})=>{e.layer=e.parent=null}),f),c((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=r.layer=this}),f)])}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"WMS\"]},e).catch(m).then((()=>this._fetchService(t)))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new S({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return null==this.featureInfoFormats?null:this.featureInfoFormats.find(V)??this.featureInfoFormats.find(z)??null}set featureInfoFormat(e){null==e?(this.revert(\"featureInfoFormat\",\"service\"),this._clearOverride(\"featureInfoFormat\")):(V(e)||z(e))&&this._override(\"featureInfoFormat\",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes(\"image/png\")?\"image/png\":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new F(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter((e=>e!==r)),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return X(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return X(t.layers,r)}writeSublayers(e,t,r,o){t.layers=[];const s=new Map,i=e.flatten((({sublayers:e})=>e??[]));for(const a of i)if(\"number\"==typeof a.parent?.id){const e=s.get(a.parent.id);null!=e?e.push(a.id):s.set(a.parent.id,[a.id])}for(const a of i){const e={sublayer:a,...o},r=a.write({parentLayerId:\"number\"==typeof a.parent?.id?a.parent.id:-1},e);if(s.has(a.id)&&(r.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const r=a.write({},e);delete r.id,t.layers.push(r)}}t.visibleLayers=i.filter((({visible:e,sublayers:t})=>e&&!t)).map((({name:e})=>e)).toArray()}set url(e){if(!e)return void this._set(\"url\",e);const{path:t,query:r}=y(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const o=d(t,r??{});this._set(\"url\",o)}createExportImageParameters(e,t,r,o){const s=o?.pixelRatio??1,i=P({extent:e,width:t})*s,a=new N({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,c=k(u,this.spatialReferences),f=\"1.3.0\"===this.version&&$(c)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,y=a.toJSON();return{bbox:f,[\"1.3.0\"===this.version?\"crs\":\"srs\"]:null==c||isNaN(c)?void 0:\"EPSG:\"+c,...y}}async fetchImage(e,t,r,o){const i=this.mapUrl,a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement(\"canvas\");return e.width=t,e.height=r,e}const n=o?.timeExtent?.start,l=o?.timeExtent?.end,p=null!=n&&null!=l?n.getTime()===l.getTime()?G(n):`${G(n)}/${G(l)}`:void 0,m={responseType:\"image\",query:this._mixCustomParameters({width:t,height:r,...a,time:p,...this.refreshParameters}),signal:o?.signal};return s(i??\"\",m).then((e=>e.data))}async fetchImageBitmap(e,t,r,o){const i=this.mapUrl??\"\",a=this.createExportImageParameters(e,t,r,o);if(!a.layers){const e=document.createElement(\"canvas\");return e.width=t,e.height=r,e}const n=o?.timeExtent?.start,l=o?.timeExtent?.end,p=null!=n&&null!=l?n.getTime()===l.getTime()?G(n):`${G(n)}/${G(l)}`:void 0,m={responseType:\"blob\",query:this._mixCustomParameters({width:t,height:r,...a,time:p,...this.refreshParameters}),signal:o?.signal},{data:u}=await s(i,m);return B(u,i,o?.signal)}fetchFeatureInfo(e,t,r,o,s){const i=P({extent:e,width:t}),a=new N({layer:this,scale:i}),n=A(a.visibleSublayers);if(null==this.featureInfoUrl||null==n)return Promise.resolve([]);if(null==this.fetchFeatureInfoFunction&&null==this.featureInfoFormat)return Promise.resolve([]);const l=\"1.3.0\"===this.version?{I:o,J:s}:{x:o,y:s},p={query_layers:n,request:\"GetFeatureInfo\",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...l},m={...this.createExportImageParameters(e,t,r),...p},u=this._mixCustomParameters(m);return null!=this.fetchFeatureInfoFunction?this.fetchFeatureInfoFunction(u):this._defaultFetchFeatureInfoFunction(d(this.featureInfoUrl,u))}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}findSublayerByName(e){return this.allSublayers.find((t=>t.name===e))}serviceSupportsSpatialReference(e){return C(this.url)||null!=this.spatialReferences&&this.spatialReferences.some((t=>{const r=900913===t?F.WebMercator:new F({wkid:t});return R(r,e)}))}_defaultFetchFeatureInfoFunction(e){const t=document.createElement(\"iframe\");t.src=h(e),t.style.border=\"none\",t.style.margin=\"0\",t.style.width=\"100%\",t.setAttribute(\"sandbox\",\"\");const s=new o({title:this.title,content:t}),i=new r({sourceLayer:this,popupTemplate:s});return Promise.resolve([i])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:o}=await s(t,{query:{SERVICE:\"WMS\",REQUEST:\"GetCapabilities\",...r,...this.customParameters},responseType:\"xml\",signal:e});this.resourceInfo=D(o)}if(this.parsedUrl){const e=new g(this.parsedUrl.path),{httpsDomains:r}=t.request;\"https\"!==e.scheme||e.port&&\"443\"!==e.port||!e.host||r.includes(e.host)||r.push(e.host)}this.read(this.resourceInfo,{origin:\"service\"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function K(e,t){return e.some((e=>{for(const r in e)if(I(e,r,null,t))return!0;return!1}))}function X(e,t,r){e=e??[];const o=new Map;e.every((e=>null==e.id))&&(e=l(e)).forEach(((e,t)=>e.id=t));for(const i of e){const e=new H;e.read(i,t),r&&!r.includes(e.name)&&(e.visible=!1),o.set(e.id,e)}const s=[];for(const a of e){const e=null!=a.id?o.get(a.id):null;if(e)if(null!=a.parentLayerId&&a.parentLayerId>=0){const t=o.get(a.parentLayerId);if(!t)continue;t.sublayers||(t.sublayers=new i),t.sublayers.push(e)}else s.push(e)}return s}e([b({readOnly:!0})],Q.prototype,\"allSublayers\",void 0),e([b({json:{type:Object,write:!0}})],Q.prototype,\"customParameters\",void 0),e([b({json:{type:Object,write:!0}})],Q.prototype,\"customLayerParameters\",void 0),e([b({type:String,json:{write:!0}})],Q.prototype,\"copyright\",void 0),e([b()],Q.prototype,\"description\",void 0),e([b({readOnly:!0})],Q.prototype,\"dimensions\",void 0),e([b({json:{type:[[Number]],read:{source:\"extent\"},write:{target:\"extent\"},origins:{\"web-document\":{write:{ignoreOrigin:!0}},\"portal-item\":{write:{ignoreOrigin:!0}}}}})],Q.prototype,\"fullExtent\",void 0),e([v([\"web-document\",\"portal-item\"],\"fullExtent\",[\"extent\"])],Q.prototype,\"readFullExtentFromItemOrMap\",null),e([j([\"web-document\",\"portal-item\"],\"fullExtent\",{extent:{type:[[Number]]}})],Q.prototype,\"writeFullExtent\",null),e([b()],Q.prototype,\"fullExtents\",void 0),e([b({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,\"featureInfoFormat\",null),e([b({type:[String],readOnly:!0})],Q.prototype,\"featureInfoFormats\",void 0),e([b({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,\"featureInfoUrl\",void 0),e([b()],Q.prototype,\"fetchFeatureInfoFunction\",void 0),e([b({type:String,json:{origins:{\"web-document\":{default:\"image/png\",type:J.jsonValues,read:{reader:J.read,source:\"format\"},write:{writer:J.write,target:\"format\"}}}}})],Q.prototype,\"imageFormat\",void 0),e([v(\"imageFormat\",[\"supportedImageFormatTypes\"])],Q.prototype,\"readImageFormat\",null),e([b({type:Number,json:{read:{source:\"maxHeight\"},write:{target:\"maxHeight\"}}})],Q.prototype,\"imageMaxHeight\",void 0),e([b({type:Number,json:{read:{source:\"maxWidth\"},write:{target:\"maxWidth\"}}})],Q.prototype,\"imageMaxWidth\",void 0),e([b()],Q.prototype,\"imageTransparency\",void 0),e([b(W)],Q.prototype,\"legendEnabled\",void 0),e([b({type:[\"show\",\"hide\",\"hide-children\"]})],Q.prototype,\"listMode\",void 0),e([b({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,\"mapUrl\",void 0),e([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Q.prototype,\"isReference\",void 0),e([b({type:[\"WMS\"]})],Q.prototype,\"operationalLayerType\",void 0),e([b()],Q.prototype,\"resourceInfo\",void 0),e([b({type:F,json:{origins:{service:{read:{source:\"extent.spatialReference\"}}},write:!1}})],Q.prototype,\"spatialReference\",void 0),e([v([\"web-document\",\"portal-item\"],\"spatialReference\",[\"spatialReferences\"])],Q.prototype,\"readSpatialReferenceFromItemOrDocument\",null),e([b({type:[w],json:{read:!1,origins:{service:{read:!0},\"web-document\":{read:!1,write:{ignoreOrigin:!0}},\"portal-item\":{read:!1,write:{ignoreOrigin:!0}}}}})],Q.prototype,\"spatialReferences\",void 0),e([j([\"web-document\",\"portal-item\"],\"spatialReferences\")],Q.prototype,\"writeSpatialReferences\",null),e([b({type:i.ofType(H),json:{write:{target:\"layers\",overridePolicy(e,t,r){if(K(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],Q.prototype,\"sublayers\",void 0),e([v([\"web-document\",\"portal-item\"],\"sublayers\",[\"layers\",\"visibleLayers\"])],Q.prototype,\"readSublayersFromItemOrMap\",null),e([v(\"service\",\"sublayers\",[\"layers\"])],Q.prototype,\"readSublayers\",null),e([j(\"sublayers\",{layers:{type:[H]},visibleLayers:{type:[String]}})],Q.prototype,\"writeSublayers\",null),e([b({json:{read:!1},readOnly:!0,value:\"wms\"})],Q.prototype,\"type\",void 0),e([b(q)],Q.prototype,\"url\",null),e([b({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,\"version\",void 0),Q=e([x(\"esri.layers.WMSLayer\")],Q);const Y=Q;export{Y as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import{JSONSupport as o}from\"../../core/JSONSupport.js\";import{property as r}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as e}from\"../../core/accessorSupport/decorators/subclass.js\";import s from\"../../geometry/Extent.js\";import i from\"./TileInfo.js\";var l;let n=l=class extends o{constructor(t){super(t),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const t=new l;return this.hasOwnProperty(\"fullExtent\")&&(t.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty(\"id\")&&(t.id=this.id),this.hasOwnProperty(\"tileInfo\")&&(t.tileInfo=this.tileInfo&&this.tileInfo.clone()),t}};t([r({type:s,json:{read:{source:\"fullExtent\"}}})],n.prototype,\"fullExtent\",void 0),t([r({type:String,json:{read:{source:\"id\"}}})],n.prototype,\"id\",void 0),t([r({type:i,json:{read:{source:\"tileInfo\"}}})],n.prototype,\"tileInfo\",void 0),n=l=t([e(\"esri.layer.support.TileMatrixSet\")],n);const p=n;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as r}from\"../../chunks/tslib.es6.js\";import{JSONSupport as s}from\"../../core/JSONSupport.js\";import{property as e}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{subclass as t}from\"../../core/accessorSupport/decorators/subclass.js\";var o;let i=o=class extends s{constructor(r){super(r),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const r=new o;return this.hasOwnProperty(\"description\")&&(r.description=this.description),this.hasOwnProperty(\"id\")&&(r.id=this.id),this.hasOwnProperty(\"isDefault\")&&(r.isDefault=this.isDefault),this.hasOwnProperty(\"keywords\")&&(r.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty(\"legendUrl\")&&(r.legendUrl=this.legendUrl),this.hasOwnProperty(\"title\")&&(r.title=this.title),r}};r([e({json:{read:{source:\"id\"}}})],i.prototype,\"id\",void 0),r([e({json:{read:{source:\"title\"}}})],i.prototype,\"title\",void 0),r([e({json:{read:{source:\"abstract\"}}})],i.prototype,\"description\",void 0),r([e({json:{read:{source:\"legendUrl\"}}})],i.prototype,\"legendUrl\",void 0),r([e({json:{read:{source:\"isDefault\"}}})],i.prototype,\"isDefault\",void 0),r([e({json:{read:{source:\"keywords\"}}})],i.prototype,\"keywords\",void 0),i=o=r([t(\"esri.layer.support.WMTSStyle\")],i);const p=i;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as t}from\"../../chunks/tslib.es6.js\";import e from\"../../core/Collection.js\";import{JSONSupport as r}from\"../../core/JSONSupport.js\";import{property as s}from\"../../core/accessorSupport/decorators/property.js\";import\"../../core/accessorSupport/ensureType.js\";import\"../../core/arrayUtils.js\";import\"../../core/has.js\";import{reader as i}from\"../../core/accessorSupport/decorators/reader.js\";import{subclass as o}from\"../../core/accessorSupport/decorators/subclass.js\";import l from\"../../geometry/Extent.js\";import a from\"./TileMatrixSet.js\";import n from\"./WMTSStyle.js\";var p;let m=p=class extends r{constructor(t){super(t),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(t,e){return(t=e.fullExtent)?l.fromJSON(t):null}readFullExtents(t,e){return e.fullExtents?.length?e.fullExtents.map((t=>l.fromJSON(t))):e.tileMatrixSets?.map((t=>l.fromJSON(t.fullExtent))).filter((t=>t))??[]}get imageFormat(){let t=this._get(\"imageFormat\");return t||(t=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:\"\"),t}set imageFormat(t){const e=this.imageFormats;t&&(t.includes(\"image/\")||e&&!e.includes(t))&&(t.includes(\"image/\")||(t=\"image/\"+t),e&&!e.includes(t))?console.error(\"The layer doesn't support the format of \"+t):this._set(\"imageFormat\",t)}get styleId(){let t=this._get(\"styleId\");return t||(t=this.styles?.at(0)?.id??\"\"),t}set styleId(t){this._set(\"styleId\",t)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find((t=>t.id===this.tileMatrixSetId)):null}clone(){const t=new p;return this.hasOwnProperty(\"description\")&&(t.description=this.description),this.hasOwnProperty(\"imageFormats\")&&(t.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty(\"imageFormat\")&&(t.imageFormat=this.imageFormat),this.hasOwnProperty(\"fullExtent\")&&(t.fullExtent=this.fullExtent?.clone()),this.hasOwnProperty(\"id\")&&(t.id=this.id),this.hasOwnProperty(\"layer\")&&(t.layer=this.layer),this.hasOwnProperty(\"styleId\")&&(t.styleId=this.styleId),this.hasOwnProperty(\"styles\")&&(t.styles=this.styles?.clone()),this.hasOwnProperty(\"tileMatrixSetId\")&&(t.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty(\"tileMatrixSets\")&&(t.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty(\"title\")&&(t.title=this.title),t}};t([s()],m.prototype,\"description\",void 0),t([s()],m.prototype,\"fullExtent\",void 0),t([i(\"fullExtent\",[\"fullExtent\"])],m.prototype,\"readFullExtent\",null),t([s({readOnly:!0})],m.prototype,\"fullExtents\",void 0),t([i(\"fullExtents\",[\"fullExtents\",\"tileMatrixSets\"])],m.prototype,\"readFullExtents\",null),t([s()],m.prototype,\"id\",void 0),t([s()],m.prototype,\"imageFormat\",null),t([s({json:{read:{source:\"formats\"}}})],m.prototype,\"imageFormats\",void 0),t([s()],m.prototype,\"layer\",void 0),t([s()],m.prototype,\"parent\",void 0),t([s()],m.prototype,\"styleId\",null),t([s({type:e.ofType(n),json:{read:{source:\"styles\"}}})],m.prototype,\"styles\",void 0),t([s({json:{write:{ignoreOrigin:!0}}})],m.prototype,\"title\",void 0),t([s()],m.prototype,\"tileMatrixSetId\",void 0),t([s({readOnly:!0})],m.prototype,\"tileMatrixSet\",null),t([s({type:e.ofType(a),json:{read:{source:\"tileMatrixSets\"}}})],m.prototype,\"tileMatrixSets\",void 0),m=p=t([o(\"esri.layers.support.WMTSSublayer\")],m);const u=m;export{u as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{isSome as e}from\"../../core/arrayUtils.js\";import t from\"../../core/Error.js\";import{getReferenceEllipsoidFromWKID as n}from\"../../geometry/ellipsoidUtils.js\";import i from\"../../geometry/Extent.js\";import r from\"../../geometry/Point.js\";import l from\"../../geometry/support/WKIDUnitConversion.js\";import{isAxesOrderReversedForWkid as o}from\"../ogc/crsUtils.js\";import{visitXML as s}from\"../ogc/xmlUtils.js\";import a from\"./LOD.js\";import c from\"./TileInfo.js\";const u=90.71428571428571;function p(e){const n=e.replaceAll(/ows:/gi,\"\");if(!g(\"Contents\",(new DOMParser).parseFromString(n,\"text/xml\").documentElement))throw new t(\"wmtslayer:wmts-capabilities-xml-is-not-valid\",\"the wmts get capabilities response is not compliant\",{text:e})}function f(e,n){e=e.replaceAll(/ows:/gi,\"\");const i=(new DOMParser).parseFromString(e,\"text/xml\").documentElement,r=new Map,l=new Map,o=g(\"Contents\",i);if(!o)throw new t(\"wmtslayer:wmts-capabilities-xml-is-not-valid\");const s=g(\"OperationsMetadata\",i),a=s?.querySelector(\"[name='GetTile']\"),c=a?.getElementsByTagName(\"Get\"),u=c&&Array.prototype.slice.call(c),p=n.url?.indexOf(\"https\"),f=void 0!==p&&p>-1;let d,m,h=n.serviceMode,T=n?.url;if(u?.length&&u.some((e=>{const t=g(\"Constraint\",e);return!t||C(\"AllowedValues\",\"Value\",h,t)?(T=e.attributes[0].nodeValue,!0):(!t||C(\"AllowedValues\",\"Value\",\"RESTful\",t)||C(\"AllowedValues\",\"Value\",\"REST\",t)?m=e.attributes[0].nodeValue:t&&!C(\"AllowedValues\",\"Value\",\"KVP\",t)||(d=e.attributes[0].nodeValue),!1)})),!T)if(m)T=m,h=\"RESTful\";else if(d)T=d,h=\"KVP\";else{const e=g(\"ServiceMetadataURL\",i);T=e?.getAttribute(\"xlink:href\")}const y=T.indexOf(\"1.0.0/\");-1===y&&\"RESTful\"===h?T+=\"/\":y>-1&&(T=T.substring(0,y)),\"KVP\"===h&&(T+=y>-1?\"\":\"?\"),f&&(T=T.replace(/^http:/i,\"https:\"));const R=w(\"ServiceIdentification>ServiceTypeVersion\",i),S=w(\"ServiceIdentification>AccessConstraints\",i),A=S&&/^none$/i.test(S)?null:S,V=x(\"Layer\",o),b=x(\"TileMatrixSet\",o),E=V.map((e=>{const t=w(\"Identifier\",e);return r.set(t,e),M(t,e,b,f,R)}));return{copyright:A,dimensionMap:l,layerMap:r,layers:E,serviceMode:h,tileUrl:T}}function d(e){return e.layers.forEach((e=>{e.tileMatrixSets?.forEach((e=>{const t=e.tileInfo;t&&96!==t.dpi&&(t.lods?.forEach((n=>{n.scale=96*n.scale/t.dpi,n.resolution=j(t.spatialReference?.wkid,n.scale*u/96,e.id)})),t.dpi=96)}))})),e}function m(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let n=0;ne.textContent)).filter(e)}function w(e,t){return e.split(\">\").forEach((e=>{t&&(t=g(e,t))})),t&&t.textContent}function C(e,t,n,i){let r;return Array.prototype.slice.call(i.childNodes).some((i=>{if(i.nodeName.includes(e)){const e=g(t,i),l=e?.textContent;if(l===n||n.split(\":\")&&n.split(\":\")[1]===l)return r=i,!0}return!1})),r}function M(e,t,n,i,r){const l=w(\"Abstract\",t),o=h(\"Format\",t);return{id:e,fullExtent:A(t),fullExtents:V(t),description:l,formats:o,styles:b(t,i),title:w(\"Title\",t),tileMatrixSets:E(r,t,n)}}function T(e,t){const n=[],i=e.layerMap?.get(t);if(!i)return null;const r=x(\"ResourceURL\",i),l=x(\"Dimension\",i);let o,s,a,c;return l.length&&(o=w(\"Identifier\",l[0]),s=h(\"Default\",l[0])||h(\"Value\",l[0])),l.length>1&&(a=w(\"Identifier\",l[1]),c=h(\"Default\",l[1])||h(\"Value\",l[1])),e.dimensionMap.set(t,{dimensions:s,dimensions2:c}),r.forEach((e=>{let t=e.getAttribute(\"template\");if(\"tile\"===e.getAttribute(\"resourceType\")){if(o&&s.length)if(t.includes(\"{\"+o+\"}\"))t=t.replace(\"{\"+o+\"}\",\"{dimensionValue}\");else{const e=t.toLowerCase().indexOf(\"{\"+o.toLowerCase()+\"}\");e>-1&&(t=t.substring(0,e)+\"{dimensionValue}\"+t.substring(e+o.length+2))}if(a&&c.length)if(t.includes(\"{\"+a+\"}\"))t=t.replace(\"{\"+a+\"}\",\"{dimensionValue2}\");else{const e=t.toLowerCase().indexOf(\"{\"+a.toLowerCase()+\"}\");e>-1&&(t=t.substring(0,e)+\"{dimensionValue2}\"+t.substring(e+a.length+2))}n.push({template:t,format:e.getAttribute(\"format\"),resourceType:\"tile\"})}})),n}function y(e,t,n,i,r,l,o,s){const a=R(e,t,i);if(!(a?.length>0))return\"\";const{dimensionMap:c}=e,u=c.get(t).dimensions?.[0],p=c.get(t).dimensions2?.[0];return a[o%a.length].template.replaceAll(/\\{Style\\}/gi,r??\"\").replaceAll(/\\{TileMatrixSet\\}/gi,n??\"\").replaceAll(/\\{TileMatrix\\}/gi,l).replaceAll(/\\{TileRow\\}/gi,\"\"+o).replaceAll(/\\{TileCol\\}/gi,\"\"+s).replaceAll(/\\{dimensionValue\\}/gi,u).replaceAll(/\\{dimensionValue2\\}/gi,p)}function R(e,t,n){const i=T(e,t),r=i?.filter((e=>e.format===n));return(r?.length?r:i)??[]}function S(e,t,n,i){const{dimensionMap:r}=e,l=T(e,t);let o=\"\";if(l&&l.length>0){const e=r.get(t).dimensions?.[0],s=r.get(t).dimensions2?.[0];o=l[0].template,o.indexOf(\".xxx\")===o.length-4&&(o=o.slice(0,-4)),o=o.replaceAll(/\\{Style\\}/gi,i),o=o.replaceAll(/\\{TileMatrixSet\\}/gi,n),o=o.replaceAll(/\\{TileMatrix\\}/gi,\"{level}\"),o=o.replaceAll(/\\{TileRow\\}/gi,\"{row}\"),o=o.replaceAll(/\\{TileCol\\}/gi,\"{col}\"),o=o.replaceAll(/\\{dimensionValue\\}/gi,e),o=o.replaceAll(/\\{dimensionValue2\\}/gi,s)}return o}function A(e){const t=g(\"WGS84BoundingBox\",e),n=t?w(\"LowerCorner\",t).split(\" \"):[\"-180\",\"-90\"],i=t?w(\"UpperCorner\",t).split(\" \"):[\"180\",\"90\"];return{xmin:parseFloat(n[0]),ymin:parseFloat(n[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function V(e){const t=[];return s(e,{BoundingBox:e=>{if(!e.getAttribute(\"crs\"))return;const n=e.getAttribute(\"crs\").toLowerCase(),i=I(n),r=n.includes(\"epsg\")&&o(i.wkid);let l,a,c,u;s(e,{LowerCorner:e=>{[l,a]=e.textContent.split(\" \").map((e=>Number.parseFloat(e))),r&&([l,a]=[a,l])},UpperCorner:e=>{[c,u]=e.textContent.split(\" \").map((e=>Number.parseFloat(e))),r&&([c,u]=[u,c])}}),t.push({xmin:l,ymin:a,xmax:c,ymax:u,spatialReference:i})}}),t}function b(e,t){return x(\"Style\",e).map((e=>{const n=g(\"LegendURL\",e),i=g(\"Keywords\",e),r=i?h(\"Keyword\",i):[];let l=n&&n.getAttribute(\"xlink:href\");t&&(l=l&&l.replace(/^http:/i,\"https:\"));return{abstract:w(\"Abstract\",e),id:w(\"Identifier\",e),isDefault:\"true\"===e.getAttribute(\"isDefault\"),keywords:r,legendUrl:l,title:w(\"Title\",e)}}))}function E(e,t,n){return x(\"TileMatrixSetLink\",t).map((t=>L(e,t,n)))}function L(e,t,n){const i=g(\"TileMatrixSet\",t).textContent,r=h(\"TileMatrix\",t),l=n.find((e=>{const t=g(\"Identifier\",e),n=t?.textContent;return!!(n===i||i.split(\":\")&&i.split(\":\")[1]===n)})),o=g(\"TileMatrixSetLimits\",t),s=o&&x(\"TileMatrixLimits\",o),a=new Map;if(s?.length)for(const c of s){const e=g(\"TileMatrix\",c).textContent,t=+g(\"MinTileRow\",c).textContent,n=+g(\"MaxTileRow\",c).textContent,i=+g(\"MinTileCol\",c).textContent,r=+g(\"MaxTileCol\",c).textContent;a.set(e,{minCol:i,maxCol:r,minRow:t,maxRow:n})}const u=w(\"SupportedCRS\",l).toLowerCase(),p=N(l,u),f=p.spatialReference,d=g(\"TileMatrix\",l),m=[parseInt(w(\"TileWidth\",d),10),parseInt(w(\"TileHeight\",d),10)],M=[];if(r.length)r.forEach(((e,t)=>{const n=C(\"TileMatrix\",\"Identifier\",e,l);M.push(k(n,u,t,i,a))}));else{x(\"TileMatrix\",l).forEach(((e,t)=>{M.push(k(e,u,t,i,a))}))}const T=F(e,l,p,m,M[0]).toJSON(),y=new c({dpi:96,spatialReference:f,size:m,origin:p,lods:M}).toJSON();return{id:i,fullExtent:T,tileInfo:y}}function I(e){e=e.toLowerCase();let t=parseInt(e.split(\":\").pop(),10);900913!==t&&3857!==t||(t=102100);const n=D(e);return null!=n&&(t=n),{wkid:t}}function N(e,t){return v(g(\"TileMatrix\",e),t)}function v(e,t){const n=I(t),[i,l]=w(\"TopLeftCorner\",e).split(\" \").map((e=>parseFloat(e))),s=t.includes(\"epsg\")&&o(n.wkid);return new r(s?{x:l,y:i,spatialReference:n}:{x:i,y:l,spatialReference:n})}function F(e,t,n,r,l){const o=g(\"BoundingBox\",t);let s,a,c,u,p,f;if(o&&(s=w(\"LowerCorner\",o).split(\" \"),a=w(\"UpperCorner\",o).split(\" \")),s&&s.length>1&&a&&a.length>1)c=parseFloat(s[0]),p=parseFloat(s[1]),u=parseFloat(a[0]),f=parseFloat(a[1]);else{const e=g(\"TileMatrix\",t),i=parseInt(w(\"MatrixWidth\",e),10),o=parseInt(w(\"MatrixHeight\",e),10);c=n.x,f=n.y,u=c+i*r[0]*l.resolution,p=f-o*r[1]*l.resolution}return O(e,n.spatialReference,n)?new i(p,c,f,u,n.spatialReference):new i(c,p,u,f,n.spatialReference)}function O(e,t,n){return\"1.0.0\"===e&&o(t.wkid)&&!(n.spatialReference.isGeographic&&n.x<-90&&n.y>=-90)}var U;function D(e){return e.includes(\"crs84\")||e.includes(\"crs:84\")?U.CRS84:e.includes(\"crs83\")||e.includes(\"crs:83\")?U.CRS83:e.includes(\"crs27\")||e.includes(\"crs:27\")?U.CRS27:null}function k(e,t,n,i,r){const l=I(t),o=w(\"Identifier\",e);let s=parseFloat(w(\"ScaleDenominator\",e));const c=j(l.wkid,s,i);s*=96/u;const p=+w(\"MatrixWidth\",e),f=+w(\"MatrixHeight\",e),{maxCol:d=p-1,maxRow:m=f-1,minCol:g=0,minRow:x=0}=r.get(o)??{},{x:h,y:C}=v(e,t);return new a({cols:[g,d],level:n,levelValue:o,origin:[h,C],scale:s,resolution:c,rows:[x,m]})}function j(e,t,i){let r;return r=l.hasOwnProperty(\"\"+e)?l.values[l[e]]:\"default028mm\"===i?6370997*Math.PI/180:n(e).metersPerDegree,7*t/25e3/r}!function(e){e[e.CRS84=4326]=\"CRS84\",e[e.CRS83=4269]=\"CRS83\",e[e.CRS27=4267]=\"CRS27\"}(U||(U={}));export{y as getTileUrlFromResourceUrls,S as getTileUrlTemplateFromResourceUrls,R as getTileUrlTemplates,f as parseCapabilities,d as parseResourceInfo,p as validateCapabilities};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../chunks/tslib.es6.js\";import t from\"../request.js\";import{isSome as r}from\"../core/arrayUtils.js\";import i from\"../core/Collection.js\";import s from\"../core/Error.js\";import{clone as a}from\"../core/lang.js\";import{MultiOriginJSONMixin as o}from\"../core/MultiOriginJSONSupport.js\";import{getDeepValue as l}from\"../core/object.js\";import{throwIfAbortError as n}from\"../core/promiseUtils.js\";import{watch as m,on as p,sync as c}from\"../core/reactiveUtils.js\";import{urlToObject as u,objectToQuery as y}from\"../core/urlUtils.js\";import{property as d}from\"../core/accessorSupport/decorators/property.js\";import\"../core/accessorSupport/ensureType.js\";import{reader as h}from\"../core/accessorSupport/decorators/reader.js\";import{subclass as f}from\"../core/accessorSupport/decorators/subclass.js\";import{writer as g}from\"../core/accessorSupport/decorators/writer.js\";import v from\"../geometry/Extent.js\";import w from\"./Layer.js\";import I from\"./WebTileLayer.js\";import{BlendLayer as L}from\"./mixins/BlendLayer.js\";import{OperationalLayer as S}from\"./mixins/OperationalLayer.js\";import{PortalLayer as M}from\"./mixins/PortalLayer.js\";import{RefreshableLayer as T}from\"./mixins/RefreshableLayer.js\";import{ScaleRangeLayer as b}from\"./mixins/ScaleRangeLayer.js\";import{createTileBitmap as P}from\"./support/imageBitmapUtils.js\";import j from\"./support/TileInfo.js\";import x from\"./support/TileInfoTilemapCache.js\";import{WMTSLayerInfo as E}from\"./support/WMTSLayerInfo.js\";import _ from\"./support/WMTSSublayer.js\";import{getTileUrlFromResourceUrls as C,getTileUrlTemplateFromResourceUrls as U,validateCapabilities as R,parseCapabilities as O,parseResourceInfo as A}from\"./support/wmtsUtils.js\";var W;const F={\"image/png\":\".png\",\"image/png8\":\".png\",\"image/png24\":\".png\",\"image/png32\":\".png\",\"image/jpg\":\".jpg\",\"image/jpeg\":\".jpeg\",\"image/gif\":\".gif\",\"image/bmp\":\".bmp\",\"image/tiff\":\".tif\",\"image/jpgpng\":\"\",\"image/jpegpng\":\"\",\"image/unknown\":\"\"},V=new Set([\"version\",\"service\",\"request\",\"layer\",\"style\",\"format\",\"tilematrixset\",\"tilematrix\",\"tilerow\",\"tilecol\"]);let B=W=class extends(L(T(b(S(M(o(w))))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright=\"\",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType=\"WebTiledLayer\",this.resourceInfo=null,this.serviceMode=\"RESTful\",this.sublayers=null,this.type=\"wmts\",this.version=\"1.0.0\",this.addHandles([m((()=>this.activeLayer),((e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)}),c),p((()=>this.sublayers),\"after-add\",(({item:e})=>{e.layer=this,e.parent=this}),c),p((()=>this.sublayers),\"after-remove\",(({item:e})=>{e.layer=null,e.parent=null}),c),m((()=>this.sublayers),((e,t)=>{if(t)for(const r of t)r.layer=null,r.parent=null;if(e)for(const r of e)r.layer=this,r.parent=this}),c)])}normalizeCtorArgs(e,t){return\"string\"==typeof e?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[\"WMTS\"]},e).catch(n).then((()=>this._fetchService(e))).catch((e=>{throw n(e),new s(\"wmtslayer:unsupported-service-data\",\"Invalid response from the WMTS service.\",{error:e})}))),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new _);let i=t.layers.find((e=>e.id===this.activeLayer.id));return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let o=null;const l=i?.tileMatrixSet;l&&(Array.isArray(l)?l.length&&(o=l[0]):o=l);const n=s?.format,m=s?.style;return new _({id:a,imageFormat:n,styleId:m,tileMatrixSetId:o})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=l(\"tileMatrixSet.tileInfo\",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes(\"?\")?\"KVP\":\"RESTful\"}readSublayersFromService(e,t,r){return $(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map((e=>e.tileInfo?.spatialReference)).toArray().filter(r)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new x(e):void 0}get title(){return this.activeLayer?.title??\"Layer\"}set title(e){this._overrideIfSome(\"title\",e)}get url(){return this._get(\"url\")}set url(e){e&&\"/\"===e.substr(-1)?this._set(\"url\",e.slice(0,-1)):this._set(\"url\",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new E({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new I({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,r,i,s={}){const{signal:a}=s,o=this.getTileUrl(e,r,i),{data:l}=await t(o,{responseType:\"image\",signal:a});return l}async fetchImageBitmapTile(e,r,i,s={}){const{signal:a}=s;if(this.fetchTile!==W.prototype.fetchTile){const t=await this.fetchTile(e,r,i,s);return P(t,e,r,i,a)}const o=this.getTileUrl(e,r,i),{data:l}=await t(o,{responseType:\"blob\",signal:a});return P(l,e,r,i,a)}findSublayerById(e){return this.sublayers?.find((t=>t.id===e))}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let o=this.resourceInfo?\"\":C({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);if(!o){o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\\{level\\}/gi,a).replaceAll(/\\{row\\}/gi,`${t}`).replaceAll(/\\{col\\}/gi,`${r}`)}return o=this._appendCustomLayerParameters(o),o}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=U({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if(\"KVP\"===this.serviceMode)return this.url+\"?SERVICE=WMTS&VERSION=\"+this.version+\"&REQUEST=GetTile&LAYER=\"+e+\"&STYLE=\"+i+\"&FORMAT=\"+r+\"&TILEMATRIXSET=\"+t+\"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}\";if(\"RESTful\"===this.serviceMode){let s=\"\";return F[r.toLowerCase()]&&(s=F[r.toLowerCase()]),this.url+e+\"/\"+i+\"/\"+t+\"/{level}/{row}/{col}\"+s}return\"\"}async _fetchService(e){let t;if(this.resourceInfo)\"KVP\"===this.resourceInfo.serviceMode&&(this.url+=this.url.includes(\"?\")?\"\":\"?\"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),R(t.data)}catch{const i=\"KVP\"===this.serviceMode?\"RESTful\":\"KVP\";try{t=await this._getCapabilities(i,e),R(t.data),this.serviceMode=i}catch(r){throw new s(\"wmtslayer:unsupported-service-data\",\"Services does not support RESTful or KVP service modes.\",{error:r})}}this.resourceInfo?t.data=A(t.data):t.data=O(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:\"service\"})}async _getCapabilities(e,r){const i=this._getCapabilitiesUrl(e);return await t(i,{...r,responseType:\"text\"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id),r=t?.tileMatrixSets?.find((t=>t.id===e));return r}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=u(e),i={...r.query,...t},s=y(i);return\"\"===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=u(this.url).path;let t=this.url;switch(e){case\"KVP\":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case\"RESTful\":{const e=`/${this.version}/WMTSCapabilities.xml`,r=new RegExp(e,\"i\");t=t.replace(r,\"\"),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=u(e).query;if(!t)return null;const r={};return Object.keys(t).forEach((e=>{r[e.toLowerCase()]=t[e]})),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?a(e):{},t.forEach((t=>{e.hasOwnProperty(t)||V.has(t)||(e[t]=r[t])})))}return e}};function $(e,t){return e.map((e=>{const r=new _;return r.read(e,t),r}))}e([d()],B.prototype,\"dimensionMap\",void 0),e([d()],B.prototype,\"layerMap\",void 0),e([d({type:_,json:{origins:{\"web-document\":{write:{ignoreOrigin:!0}}}}})],B.prototype,\"activeLayer\",void 0),e([h(\"service\",\"activeLayer\",[\"layers\"])],B.prototype,\"readActiveLayerFromService\",null),e([h([\"web-document\",\"portal-item\"],\"activeLayer\",[\"wmtsInfo\"])],B.prototype,\"readActiveLayerFromItemOrWebDoc\",null),e([g([\"web-document\",\"portal-item\"],\"activeLayer\",{templateUrl:{type:String},tileInfo:{type:j},\"wmtsInfo.layerIdentifier\":{type:String},\"wmtsInfo.tileMatrixSet\":{type:String}})],B.prototype,\"writeActiveLayer\",null),e([d({type:String,value:\"\",json:{write:!0}})],B.prototype,\"copyright\",void 0),e([d({type:[\"show\",\"hide\"]})],B.prototype,\"listMode\",void 0),e([d({json:{read:!0,write:!0}})],B.prototype,\"blendMode\",void 0),e([d({json:{origins:{\"web-document\":{read:{source:[\"wmtsInfo.customParameters\",\"wmtsInfo.url\"]},write:{target:\"wmtsInfo.customParameters\"}},\"portal-item\":{read:{source:[\"wmtsInfo.customParameters\",\"wmtsInfo.url\"]},write:{target:\"wmtsInfo.customParameters\"}}}}})],B.prototype,\"customParameters\",void 0),e([h([\"portal-item\",\"web-document\"],\"customParameters\")],B.prototype,\"readCustomParameters\",null),e([d({json:{origins:{\"web-document\":{read:{source:\"wmtsInfo.customLayerParameters\"},write:{target:\"wmtsInfo.customLayerParameters\"}},\"portal-item\":{read:{source:\"wmtsInfo.customLayerParameters\"},write:{target:\"wmtsInfo.customLayerParameters\"}}}}})],B.prototype,\"customLayerParameters\",void 0),e([d({type:v,json:{write:{ignoreOrigin:!0},origins:{\"web-document\":{read:{source:\"fullExtent\"}},\"portal-item\":{read:{source:\"fullExtent\"}}}}})],B.prototype,\"fullExtent\",void 0),e([d({readOnly:!0})],B.prototype,\"fullExtents\",null),e([d({type:[\"WebTiledLayer\"]})],B.prototype,\"operationalLayerType\",void 0),e([d()],B.prototype,\"resourceInfo\",void 0),e([d()],B.prototype,\"serviceMode\",void 0),e([h([\"portal-item\",\"web-document\"],\"serviceMode\",[\"templateUrl\"])],B.prototype,\"readServiceMode\",null),e([d({type:i.ofType(_)})],B.prototype,\"sublayers\",void 0),e([h(\"service\",\"sublayers\",[\"layers\"])],B.prototype,\"readSublayersFromService\",null),e([d({readOnly:!0})],B.prototype,\"supportedSpatialReferences\",null),e([d({readOnly:!0})],B.prototype,\"tilemapCache\",null),e([d({json:{read:{source:\"title\"}}})],B.prototype,\"title\",null),e([d({json:{read:!1},readOnly:!0,value:\"wmts\"})],B.prototype,\"type\",void 0),e([d({json:{origins:{service:{read:{source:\"tileUrl\"}},\"web-document\":{read:{source:\"wmtsInfo.url\"},write:{target:\"wmtsInfo.url\"}},\"portal-item\":{read:{source:\"wmtsInfo.url\"},write:{target:\"wmtsInfo.url\"}}}}})],B.prototype,\"url\",null),e([d()],B.prototype,\"version\",void 0),B=W=e([f(\"esri.layers.WMTSLayer\")],B);const K=B;export{K as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../../../chunks/tslib.es6.js\";import r from\"../../../../../core/Accessor.js\";import{property as t}from\"../../../../../core/accessorSupport/decorators/property.js\";import\"../../../../../core/accessorSupport/ensureType.js\";import\"../../../../../core/arrayUtils.js\";import\"../../../../../core/has.js\";import{subclass as o}from\"../../../../../core/accessorSupport/decorators/subclass.js\";let s=class extends r{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const e=this.tileStore.tileScheme.spatialReference;return e&&e.toJSON()||null}};e([t({readOnly:!0})],s.prototype,\"supportsTileUpdates\",null),e([t({constructOnly:!0})],s.prototype,\"remoteClient\",void 0),e([t({constructOnly:!0})],s.prototype,\"service\",void 0),e([t()],s.prototype,\"spatialReference\",null),e([t({constructOnly:!0})],s.prototype,\"tileInfo\",void 0),e([t({constructOnly:!0})],s.prototype,\"tileStore\",void 0),s=e([o(\"esri.views.2d.layers.features.processors.BaseProcessor\")],s);const p=s;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../../../chunks/tslib.es6.js\";import\"../../../../../core/has.js\";import\"../../../../../core/Logger.js\";import\"../../../../../core/accessorSupport/ensureType.js\";import\"../../../../../core/arrayUtils.js\";import\"../../../../../core/Error.js\";import{subclass as t}from\"../../../../../core/accessorSupport/decorators/subclass.js\";import{diff as s}from\"../../../../../core/accessorSupport/diffUtils.js\";import{calculateHeatmapIntensityInfoReaders as r}from\"../../../../../renderers/support/heatmapUtils.js\";import{tileSize as i}from\"../../../engine/webgl/definitions.js\";import o from\"./BaseProcessor.js\";import{getPow2NeighborKey as a}from\"../support/tileUtils.js\";class n{constructor(e,t){this.offset=e,this.extent=t}}function d(e){const t=e.key,s=new Map,r=256,o=i,d=e.tileInfoView.tileInfo.isWrappable;return s.set(a(t,-1,-1,d).id,new n([-o,-o],[o-r,o-r,o,o])),s.set(a(t,0,-1,d).id,new n([0,-o],[0,o-r,o,o])),s.set(a(t,1,-1,d).id,new n([o,-o],[0,o-r,r,o])),s.set(a(t,-1,0,d).id,new n([-o,0],[o-r,0,o,o])),s.set(a(t,1,0,d).id,new n([o,0],[0,0,r,o])),s.set(a(t,-1,1,d).id,new n([-o,o],[o-r,0,o,r])),s.set(a(t,0,1,d).id,new n([0,o],[0,0,o,r])),s.set(a(t,1,1,d).id,new n([o,o],[0,0,r,r])),s}let l=class extends o{constructor(){super(...arguments),this.type=\"heatmap\",this._tileKeyToFeatureSets=new Map}initialize(){this.addHandles([this.tileStore.on(\"update\",this.onTileUpdate.bind(this))])}async update(e,t){const r=t.schema.processors[0];if(\"heatmap\"!==r.type)return;s(this._schema,r)&&(e.mesh=!0,this._schema=r)}onTileUpdate(e){for(const t of e.removed)this._tileKeyToFeatureSets.delete(t.key.id)}onTileClear(e){const t={clear:!0};return this._tileKeyToFeatureSets.delete(e.key.id),this.remoteClient.invoke(\"tileRenderer.onTileData\",{tileKey:e.id,data:t})}async onTileMessage(e,t,s){this._tileKeyToFeatureSets.has(e.key.id)||this._tileKeyToFeatureSets.set(e.key.id,new Map);const i=this._tileKeyToFeatureSets.get(e.key.id);if(i&&null!=t.addOrUpdate&&t.addOrUpdate.hasFeatures&&i.set(t.addOrUpdate.instance,t),t.end){const t=[],i=d(e);this._tileKeyToFeatureSets.forEach(((s,r)=>{if(r===e.key.id)s.forEach((({addOrUpdate:e})=>{e&&t.push(e)}));else if(i.has(r)){const e=i.get(r),[o,a]=e.offset;s.forEach((({addOrUpdate:e})=>{if(e){const s=e.transform(o,a,1,1);t.push(s)}}))}}));const o=r(t,this._schema.mesh,512,512),a={tileKey:e.key.id,intensityInfo:o},n=[o.matrix];return this.remoteClient.invoke(\"tileRenderer.onTileData\",a,{...s,transferList:n})}}onTileError(e,t,s){return this.remoteClient.invoke(\"tileRenderer.onTileError\",{tileKey:e.id,error:t},s)}};l=e([t(\"esri.views.2d.layers.features.processors.HeatmapProcessor\")],l);const p=l;export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{isAbortError as e}from\"../../../../../core/promiseUtils.js\";class t{constructor(e){this._remoteClient=e,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){}async fetchResource(t,r){const s=this._resourceMap,i=s.get(t);if(i)return i;let n=this._inFlightResourceMap.get(t);if(n)return n;try{n=this._remoteClient.invoke(\"tileRenderer.fetchResource\",{url:t},{...r}),this._inFlightResourceMap.set(t,n),n.then((e=>(this._inFlightResourceMap.delete(t),s.set(t,e),e)))}catch(o){return e(o)?null:{width:0,height:0}}return n}getResource(e){return this._resourceMap.get(e)??null}loadFont(e){return Promise.resolve(null)}}export{t as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{_ as e}from\"../../../../../chunks/tslib.es6.js\";import{bidiText as t}from\"../../../../../core/BidiText.js\";import\"../../../../../core/Error.js\";import\"../../../../../core/has.js\";import\"../../../../../core/Logger.js\";import{assertIsSome as s}from\"../../../../../core/maybe.js\";import{throwIfAborted as r,isAbortError as i}from\"../../../../../core/promiseUtils.js\";import\"../../../../../core/accessorSupport/ensureType.js\";import\"../../../../../core/arrayUtils.js\";import{subclass as a}from\"../../../../../core/accessorSupport/decorators/subclass.js\";import{diff as o,hasDiff as n}from\"../../../../../core/accessorSupport/diffUtils.js\";import l from\"../../../../../geometry/SpatialReference.js\";import{isAggregateId as c}from\"../../../engine/webgl/DisplayId.js\";import{WGLSymbologyType as d}from\"../../../engine/webgl/enums.js\";import{MeshData as h}from\"../../../engine/webgl/mesh/MeshData.js\";import{WGLMeshFactory as f}from\"../../../engine/webgl/mesh/factories/WGLMeshFactory.js\";import{WGLTemplateStore as u}from\"../../../engine/webgl/mesh/templates/WGLTemplateStore.js\";import{createMatcher as m}from\"../../../engine/webgl/util/Matcher.js\";import{codepoints as g}from\"../textUtils.js\";import p from\"./BaseProcessor.js\";import y from\"../support/ResourceManagerProxy.js\";function _(e,t){const s=t-t/4,r=t+t/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=r)}function b(e){const t=e.message,s={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const r in t.data){const e=r,i=t.data[e];if(s.message.data[e]=null,null!=i){const t=i.stride,r=i.indices.slice(0),a=i.vertices.slice(0),o=i.records.slice(0),n=i.metrics?.slice(0),l={stride:t,indices:r,vertices:a,records:o,metrics:n};s.transferList.push(r,a,o),s.message.data[e]=l}}return s}let S=class extends p{constructor(){super(...arguments),this.type=\"symbol\",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.addHandles([this.tileStore.on(\"update\",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new y(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(e){this._bufferIds.forEach((t=>{t.forEach(e)}))}async update(e,t){const s=t.schema.processors[0];if(\"symbol\"!==s.type)return;const r=o(this._schema,s);(n(r,\"mesh\")||n(r,\"target\"))&&(e.mesh=!0,e.why?.mesh.push(\"Symbology changed\"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(e,t,s,i){return r(i),this._onTileData(e,t,s,i)}onTileClear(e,t){const s={clear:!0,end:t};return this._bufferData.delete(e.key.id),this._bufferIds.delete(e.key.id),this.remoteClient.invoke(\"tileRenderer.onTileData\",{tileKey:e.id,data:s})}onTileError(e,t,s){const r=s.signal,i={tileKey:e.id,error:t};return this.remoteClient.invoke(\"tileRenderer.onTileError\",i,{signal:r})}onTileUpdate(e){for(const t of e.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of e.added)this._bufferData.forEach((e=>{for(const s of e)s.message.tileKey===t.id&&this._updateTileMesh(\"append\",t,b(s),[],!1,!1,null)}))}_addBufferData(e,t){this._bufferData.has(e)||this._bufferData.set(e,[]),this._bufferData.get(e)?.push(b(t))}_createFactory(e){const{geometryType:t,objectIdField:s,fields:r}=this.service,i=(e,t)=>this.remoteClient.invoke(\"tileRenderer.getMaterialItems\",e,t),a={geometryType:t,fields:r,spatialReference:l.fromJSON(this.spatialReference)},o=new u(i,this.tileStore.tileScheme.tileInfo),{matcher:n,aggregateMatcher:c}=e.mesh;return this._store=o,this._matchers.feature=m(n,o,a,this._resourceManagerProxy),this._matchers.aggregate=c?m(c,o,a,this._resourceManagerProxy):null,new f(t,s,o)}async _onTileData(e,t,s,i){r(i);const{type:a,addOrUpdate:o,remove:n,clear:l,end:c}=t,d=!!this._schema.mesh.sortKey;if(!o){const t={type:a,addOrUpdate:null,remove:n,clear:l,end:c,sort:d};return this.remoteClient.invoke(\"tileRenderer.onTileData\",{tileKey:e.id,data:t},i)}const h=this._processFeatures(e,o,s,i,t.status?.version);try{const s=await h;if(null==s){const t={type:a,addOrUpdate:null,remove:n,clear:l,end:c,sort:d};return this.remoteClient.invoke(\"tileRenderer.onTileData\",{tileKey:e.id,data:t},i)}const r=[];for(const t of s){let s=!1;const i=t.message.bufferIds,a=e.key.id,o=t.message.tileKey;if(a!==o&&null!=i){if(!this.tileStore.get(o)){this._addBufferData(a,t),r.push(t);continue}let e=this._bufferIds.get(o);e||(e=new Set,this._bufferIds.set(o,e));const n=Array.from(i);for(const t of n){if(e.has(t)){s=!0;break}e.add(t)}}s||(this._addBufferData(a,t),r.push(t))}await Promise.all(r.map((s=>{const r=e.key.id===s.message.tileKey,o=r?t.remove:[],n=r&&t.end;return this._updateTileMesh(a,e,s,o,n,!!t.clear,i.signal)})))}catch(f){this._handleError(e,f,i)}}async _updateTileMesh(e,t,s,i,a,o,n){const l=e,c=s.message.tileKey,d=!!this._schema.mesh.sortKey;c!==t.key.id&&(a=!1);const h=s?.message,f={type:l,addOrUpdate:h,remove:i,clear:o,end:a,sort:d},u={transferList:s?.transferList??[],signal:n};return r(u),this.remoteClient.invoke(\"tileRenderer.onTileData\",{tileKey:c,data:f},u)}async _processFeatures(e,t,s,i,a){if(null==t||!t.hasFeatures)return null;const o={transform:e.transform,hasZ:!1,hasM:!1},n=this._factory,l={viewingMode:\"\",scale:e.scale},c=await this._matchers.feature,d=await this._matchers.aggregate;r(i);const h=this._getLabelInfos(e,t);return await n.analyze(t.getCursor(),this._resourceManagerProxy,c,d,o,l),r(i),this._writeFeatureSet(e,t,o,h,n,s,a)}_writeFeatureSet(e,t,s,r,i,a,o){const n=t.getSize(),l=this._schema.mesh.matcher.symbologyType,c=new h(e.key.id,{features:n,records:n,metrics:0},l,a,l!==d.HEATMAP,o),f={viewingMode:\"\",scale:e.scale},u=t.getCursor();for(;u.next();)try{const t=u.getDisplayId(),a=null!=r?r.get(t):null;i.writeCursor(c,u,s,f,e.level,a,this._resourceManagerProxy)}catch(g){}const m=e.tileInfoView.tileInfo.isWrappable;return c.serialize(m)}_handleError(e,t,s){if(!i(t)){const r={tileKey:e.id,error:t.message};return this.remoteClient.invoke(\"tileRenderer.onTileError\",r,{signal:s.signal})}return Promise.resolve()}_getLabelingSchemaForScale(e){const t=this._schema.mesh.labels;if(null==t)return null;if(\"subtype\"===t.type){const s={type:\"subtype\",classes:{}};let r=!1;for(const i in t.classes){const a=t.classes[i].filter((t=>_(t,e.scale)));r=r||!!a.length,s.classes[i]=a}return r?s:null}const s=t.classes.filter((t=>_(t,e.scale)));return s.length?{type:\"simple\",classes:s}:null}_getLabels(e,t){if(\"subtype\"===t.type){const r=this.service.subtypeField;s(r,\"Expected to find subtype Field\");const i=e.readAttribute(r);return null==i?[]:t.classes[i]??[]}return t.classes}_getLabelInfos(e,s){const r=this._getLabelingSchemaForScale(e);if(null==r)return null;const i=new Map,a=s.getCursor();for(;a.next();){const e=a.getDisplayId(),s=[],o=c(e),n=o&&1!==a.readAttribute(\"cluster_count\")?\"aggregate\":\"feature\",l=this._getLabels(a,r);for(const r of l){if(r.target!==n)continue;const i=a.getStorage(),l=o&&\"feature\"===n?i.getComputedStringAtIndex(a.readAttribute(\"referenceId\"),r.fieldIndex):i.getComputedStringAtIndex(e,r.fieldIndex);if(!l)continue;const c=t(l.toString()),d=c[0],h=c[1];this._store.getMosaicItem(r.symbol,g(d)).then((e=>{s[r.index]={glyphs:e.glyphMosaicItems??[],rtl:h,index:r.index}}))}i.set(e,s)}return i}};S=e([a(\"esri.views.2d.layers.features.processors.SymbolProcessor\")],S);const w=S;export{w as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../core/Error.js\";import r from\"../../core/Logger.js\";import{parseWhereClause as t}from\"../../core/sql.js\";import{formatDate as n,convertDateFormatToIntlOptions as o}from\"../../intl/date.js\";import{formatNumber as a}from\"../../intl/number.js\";import{getDomainRange as l}from\"./domainUtils.js\";import{isDateField as i,isNumericField as s}from\"./fieldUtils.js\";import{getLabelExpression as u,getSingleFieldArcadeExpression as c}from\"./labelUtils.js\";import{createLabelExpression as f}from\"../../support/arcadeOnDemand.js\";const m=r.getLogger(\"esri.layers.support.labelFormatUtils\"),p={type:\"simple\",evaluate:()=>null},d={getAttribute:(e,r)=>e.field(r)};async function w(r,n,o){if(!r||!r.symbol||!n)return p;const a=r.where,l=u(r);let i;if(\"arcade\"===l.type){const r=await f(l.expression,o,n);if(null==r)return p;i={type:\"arcade\",evaluate(t,n){try{const e=\"attributes\"in t?r.repurposeFeature(t):t;e.contextTimeZone=n??null;const o=r.evaluate({$view:{timeZone:n},$feature:e},r.services);if(null!=o)return o.toString()}catch(o){m.error(new e(\"arcade-expression-error\",\"Encountered an error when evaluating label expression for feature\",{error:o,feature:t,expression:l}))}return null},needsHydrationToEvaluate:()=>null==c(l.expression)}}else i={type:\"simple\",evaluate:e=>l.expression.replaceAll(/{[^}]*}/g,(r=>{const t=r.slice(1,-1),o=n.get(t);if(!o)return r;let a=null;if(\"attributes\"in e){e&&e.attributes&&(a=e.attributes[o.name])}else a=e.field(o.name);return null==a?\"\":g(a,o)}))};if(a){let r;try{r=await t(a,n)}catch(s){return m.error(new e(\"bad-where-clause\",\"Encountered an error when evaluating where clause, ignoring\",{where:a,error:s})),p}const o=i.evaluate;i.evaluate=(t,n)=>{const l=\"attributes\"in t?void 0:d;try{if(r.testFeature(t,l))return o(t,n)}catch(s){m.error(new e(\"bad-where-clause\",\"Encountered an error when evaluating where clause for feature\",{where:a,feature:t,error:s}))}return null}}return i}function g(e,r){if(null==e)return\"\";const t=r.domain;if(t)if(\"codedValue\"===t.type||\"coded-value\"===t.type){const r=e;for(const e of t.codedValues)if(e.code===r)return e.name}else if(\"range\"===t.type){const{max:n,min:o}=l(r),a=+e;if(null!=o&&null!=n&&o<=a&&a<=n)return t.name}let u=e;return i(r)?u=n(u,o(\"short-date\")):s(r)&&(u=a(+u)),u||\"\"}export{w as createLabelFunction,g as formatField};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport e from\"../../../../../core/Error.js\";import r from\"../../../../../core/Logger.js\";import{parseWhereClause as t}from\"../../../../../core/sql.js\";const a=r.getLogger(\"esri.views.2d.layers.features.support.whereUtils\"),o={getAttribute:(e,r)=>e.readAttribute(r)};async function s(r,s){try{const n=await t(r,s);if(!n.isStandardized){const r=new e(\"mapview - bad input\",\"Unable to apply filter's definition expression, as expression is not standardized.\",n);a.error(r)}return e=>{const r=e.readArcadeFeature();return n.testFeature(r,o)}}catch(n){return a.warn(\"mapview-bad-where-clause\",\"Encountered an error when evaluating where clause\",r),e=>!0}}export{s as createWhereClause};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport t from\"../../../../../core/Error.js\";import e from\"../../../../../core/Logger.js\";import{create as i}from\"../../../../../geometry/support/aaBoundingRect.js\";import{getBoundsXY as s}from\"../../../../../geometry/support/boundsUtils.js\";import{normalizeQueryLike as r}from\"../../../../../layers/graphics/data/queryUtils.js\";import{getSpatialQueryOperator as o}from\"../../../../../layers/graphics/data/spatialQuerySupport.js\";import{getTimeOperator as h}from\"../../../../../layers/graphics/data/timeSupport.js\";import a from\"../../../../../rest/support/Query.js\";import{featureAdapter as l}from\"../FeatureStore2D.js\";import{createWhereClause as n}from\"./whereUtils.js\";const d=1,m=2;class p{constructor(t){this._geometryBounds=i(),this._idToVisibility=new Map,this._serviceInfo=t}get hash(){return this._hash}check(t){return this._applyFilter(t)}clear(){const t=this._resetAllHiddenIds();return this.update(),{show:t,hide:[]}}invalidate(){this._idToVisibility.forEach(((t,e)=>{this._idToVisibility.set(e,0)}))}setKnownIds(t){for(const e of t)this._idToVisibility.set(e,d)}setTrue(t){const e=[],i=[],s=new Set(t);return this._idToVisibility.forEach(((t,r)=>{const o=!!(this._idToVisibility.get(r)&d),h=s.has(r);!o&&h?e.push(r):o&&!h&&i.push(r),this._idToVisibility.set(r,h?d|m:0)})),{show:e,hide:i}}createQuery(){const{geometry:t,spatialRel:e,where:i,timeExtent:s,objectIds:r}=this;return a.fromJSON({geometry:t,spatialRel:e,where:i,timeExtent:s,objectIds:r})}async update(t,e){this._hash=JSON.stringify(t);const i=await r(t,null,e);await Promise.all([this._setGeometryFilter(i),this._setIdFilter(i),this._setAttributeFilter(i),this._setTimeFilter(i)])}async _setAttributeFilter(t){if(!t?.where)return this._clause=null,void(this.where=null);this._clause=await n(t.where,this._serviceInfo.fieldsIndex),this.where=t.where}_setIdFilter(t){this._idsToShow=t?.objectIds&&new Set(t.objectIds),this._idsToHide=t?.hiddenIds&&new Set(t.hiddenIds),this.objectIds=t?.objectIds}async _setGeometryFilter(t){if(!t?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const e=t.geometry,i=t.spatialRel||\"esriSpatialRelIntersects\",r=await o(i,e,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);s(this._geometryBounds,e),this._spatialQueryOperator=r,this.geometry=e,this.spatialRel=i}_setTimeFilter(i){if(this.timeExtent=this._timeOperator=null,i?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=i.timeExtent,this._timeOperator=h(this._serviceInfo.timeInfo,i.timeExtent,l);else{const s=new t(\"feature-layer-view:time-filter-not-available\",\"Unable to apply time filter, as layer doesn't have time metadata.\",i.timeExtent);e.getLogger(\"esri.views.2d.layers.features.controllers.FeatureFilter\").error(s)}}_applyFilter(t){return this._filterByGeometry(t)&&this._filterById(t)&&this._filterByTime(t)&&this._filterByExpression(t)}_filterByExpression(t){return!this.where||this._clause(t)}_filterById(t){return(!this._idsToHide?.size||!this._idsToHide.has(t.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(t.getObjectId()))}_filterByGeometry(t){if(!this.geometry)return!0;const e=t.readHydratedGeometry();return!!e&&this._spatialQueryOperator(e)}_filterByTime(t){return null==this._timeOperator||this._timeOperator(t)}_resetAllHiddenIds(){const t=[];return this._idToVisibility.forEach(((e,i)=>{e&d||(this._idToVisibility.set(i,d),t.push(i))})),t}}export{p as default};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as t}from\"./_commonjsHelpers.js\";function n(t,n){for(var e=0;er[n]})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}))}var e,r,i,o={exports:{}};o.exports,e=o,o.exports,r=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0,\"undefined\"!=typeof __filename&&(r=r||__filename),i=function(t){var n,e;(t=void 0!==(t=t||{})?t:{}).ready=new Promise((function(t,r){n=t,e=r}));var i,o,u,s,a,c,f=Object.assign({},t),p=\"object\"==typeof window,l=\"function\"==typeof importScripts,h=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,d=\"\";function m(n){return t.locateFile?t.locateFile(n,d):d+n}h?(d=l?require(\"path\").dirname(d)+\"/\":__dirname+\"/\",c=()=>{a||(s=require(\"fs\"),a=require(\"path\"))},i=function(t,n){return c(),t=a.normalize(t),s.readFileSync(t,n?void 0:\"utf8\")},u=t=>{var n=i(t,!0);return n.buffer||(n=new Uint8Array(n)),n},o=(t,n,e)=>{c(),t=a.normalize(t),s.readFile(t,(function(t,r){t?e(t):n(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\\\/g,\"/\"),process.argv.slice(2),process.on(\"uncaughtException\",(function(t){if(!(t instanceof ht))throw t})),process.on(\"unhandledRejection\",(function(t){throw t})),t.inspect=function(){return\"[Emscripten Module object]\"}):(p||l)&&(l?d=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(d=document.currentScript.src),r&&(d=r),d=0!==d.indexOf(\"blob:\")?d.substr(0,d.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",i=t=>{var n=new XMLHttpRequest;return n.open(\"GET\",t,!1),n.send(null),n.responseText},l&&(u=t=>{var n=new XMLHttpRequest;return n.open(\"GET\",t,!1),n.responseType=\"arraybuffer\",n.send(null),new Uint8Array(n.response)}),o=(t,n,e)=>{var r=new XMLHttpRequest;r.open(\"GET\",t,!0),r.responseType=\"arraybuffer\",r.onload=()=>{200==r.status||0==r.status&&r.response?n(r.response):e()},r.onerror=e,r.send(null)}),t.print||console.log.bind(console);var _,y,g=t.printErr||console.warn.bind(console);Object.assign(t,f),f=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(_=t.wasmBinary),t.noExitRuntime,\"object\"!=typeof WebAssembly&&L(\"no native wasm support detected\");var v,w,b,A,R,x,S=!1,P=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function j(t,n,e){for(var r=n+e,i=n;t[i]&&!(i>=r);)++i;if(i-n>16&&t.buffer&&P)return P.decode(t.subarray(n,i));for(var o=\"\";n>10,56320|1023&c)}}else o+=String.fromCharCode((31&u)<<6|s)}else o+=String.fromCharCode(u)}return o}function E(t,n){return t?j(b,t,n):\"\"}function I(n){v=n,t.HEAP8=w=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=A=new Int32Array(n),t.HEAPU8=b=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=R=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var T=[],H=[],D=[];function M(){if(t.preRun)for(\"function\"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)U(t.preRun.shift());V(T)}function O(){V(H)}function W(){if(t.postRun)for(\"function\"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)C(t.postRun.shift());V(D)}function U(t){T.unshift(t)}function q(t){H.unshift(t)}function C(t){D.unshift(t)}var F=0,B=null;function k(n){F++,t.monitorRunDependencies&&t.monitorRunDependencies(F)}function z(n){if(F--,t.monitorRunDependencies&&t.monitorRunDependencies(F),0==F&&B){var e=B;B=null,e()}}function L(n){t.onAbort&&t.onAbort(n),g(n=\"Aborted(\"+n+\")\"),S=!0,n+=\". Build with -sASSERTIONS for more info.\";var r=new WebAssembly.RuntimeError(n);throw e(r),r}var G,X=\"data:application/octet-stream;base64,\";function N(t){return t.startsWith(X)}function Y(t){return t.startsWith(\"file://\")}function J(t){try{if(t==G&&_)return new Uint8Array(_);if(u)return u(t);throw\"both async and sync fetching of the wasm failed\"}catch(g){L(g)}}function K(){if(!_&&(p||l)){if(\"function\"==typeof fetch&&!Y(G))return fetch(G,{credentials:\"same-origin\"}).then((function(t){if(!t.ok)throw\"failed to load wasm binary file at '\"+G+\"'\";return t.arrayBuffer()})).catch((function(){return J(G)}));if(o)return new Promise((function(t,n){o(G,(function(n){t(new Uint8Array(n))}),n)}))}return Promise.resolve().then((function(){return J(G)}))}function Q(){var n={a:ct};function r(n,e){var r=n.exports;t.asm=r,I((y=t.asm.g).buffer),x=t.asm.m,q(t.asm.h),z()}function i(t){r(t.instance)}function o(t){return K().then((function(t){return WebAssembly.instantiate(t,n)})).then((function(t){return t})).then(t,(function(t){g(\"failed to asynchronously prepare wasm: \"+t),L(t)}))}function u(){return _||\"function\"!=typeof WebAssembly.instantiateStreaming||N(G)||Y(G)||h||\"function\"!=typeof fetch?o(i):fetch(G,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,n).then(i,(function(t){return g(\"wasm streaming compile failed: \"+t),g(\"falling back to ArrayBuffer instantiation\"),o(i)}))}))}if(k(),t.instantiateWasm)try{return t.instantiateWasm(n,r)}catch(s){return g(\"Module.instantiateWasm callback failed with error: \"+s),!1}return u().catch(e),{}}function V(n){for(;n.length>0;){var e=n.shift();if(\"function\"!=typeof e){var r=e.func;\"number\"==typeof r?void 0===e.arg?$(r)():$(r)(e.arg):r(void 0===e.arg?null:e.arg)}else e(t)}}N(G=\"lerc-wasm.wasm\")||(G=m(G));var Z=[];function $(t){var n=Z[t];return n||(t>=Z.length&&(Z.length=t+1),Z[t]=n=x.get(t)),n}function tt(t,n,e,r){L(\"Assertion failed: \"+E(t)+\", at: \"+[n?E(n):\"unknown filename\",e,r?E(r):\"unknown function\"])}function nt(t){return ft(t+24)+24}function et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){R[this.ptr+4>>2]=t},this.get_type=function(){return R[this.ptr+4>>2]},this.set_destructor=function(t){R[this.ptr+8>>2]=t},this.get_destructor=function(){return R[this.ptr+8>>2]},this.set_refcount=function(t){A[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,w[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=w[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,w[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=w[this.ptr+13>>0]},this.init=function(t,n){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=A[this.ptr>>2];A[this.ptr>>2]=t+1},this.release_ref=function(){var t=A[this.ptr>>2];return A[this.ptr>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){R[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return R[this.ptr+16>>2]},this.get_exception_ptr=function(){if(lt(this.get_type()))return R[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}function rt(t,n,e){throw new et(t).init(n,e),t}function it(){L(\"\")}function ot(t,n,e){b.copyWithin(t,n,n+e)}function ut(){return 2147483648}function st(t){try{return y.grow(t-v.byteLength+65535>>>16),I(y.buffer),1}catch(n){}}function at(t){var n=b.length;t>>>=0;var e=ut();if(t>e)return!1;let r=(t,n)=>t+(n-t%n)%n;for(var i=1;i<=4;i*=2){var o=n*(1+.2/i);if(o=Math.min(o,t+100663296),st(Math.min(e,r(Math.max(t,o),65536))))return!0}return!1}var ct={a:tt,c:nt,b:rt,d:it,f:ot,e:at};Q(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.h).apply(null,arguments)},t._lerc_getBlobInfo=function(){return(t._lerc_getBlobInfo=t.asm.i).apply(null,arguments)},t._lerc_getDataRanges=function(){return(t._lerc_getDataRanges=t.asm.j).apply(null,arguments)},t._lerc_decode=function(){return(t._lerc_decode=t.asm.k).apply(null,arguments)},t._lerc_decode_4D=function(){return(t._lerc_decode_4D=t.asm.l).apply(null,arguments)};var ft=t._malloc=function(){return(ft=t._malloc=t.asm.n).apply(null,arguments)};t._free=function(){return(t._free=t.asm.o).apply(null,arguments)};var pt,lt=t.___cxa_is_pointer_type=function(){return(lt=t.___cxa_is_pointer_type=t.asm.p).apply(null,arguments)};function ht(t){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+t+\")\",this.status=t}function dt(e){function r(){pt||(pt=!0,t.calledRun=!0,S||(O(),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),W()))}F>0||(M(),F>0||(t.setStatus?(t.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){t.setStatus(\"\")}),1),r()}),1)):r()))}if(B=function t(){pt||dt(),pt||(B=t)},t.run=dt,t.preInit)for(\"function\"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return dt(),t.ready},e.exports=i;var u=o.exports;const s=n({__proto__:null,default:t(u)},[u]);export{s as l};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as n}from\"./_commonjsHelpers.js\";function r(n,r){for(var e=0;et[r]})}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:\"Module\"}))}var e,t,i,o={exports:{}};o.exports,e=o,o.exports,t=\"undefined\"!=typeof document&&document.currentScript?document.currentScript.src:void 0,i=function(n={}){var r,e,i=void 0!==n?n:{};i.ready=new Promise(((n,t)=>{r=n,e=t}));var o=Object.assign({},i),a=\"object\"==typeof window,u=\"function\"==typeof importScripts;\"object\"==typeof process&&\"object\"==typeof process.versions&&process.versions.node;var c,f=\"\";function s(n){return i.locateFile?i.locateFile(n,f):f+n}(a||u)&&(u?f=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(f=document.currentScript.src),t&&(f=t),f=0!==f.indexOf(\"blob:\")?f.substr(0,f.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):\"\",u&&(c=n=>{var r=new XMLHttpRequest;return r.open(\"GET\",n,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}));var l,d,p=i.print||console.log.bind(console),v=i.printErr||console.warn.bind(console);Object.assign(i,o),o=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(l=i.wasmBinary),i.noExitRuntime,\"object\"!=typeof WebAssembly&&z(\"no native wasm support detected\");var h,m,g,y,_,w,b,A,T,C=!1;function P(){var n=d.buffer;i.HEAP8=h=new Int8Array(n),i.HEAP16=g=new Int16Array(n),i.HEAP32=_=new Int32Array(n),i.HEAPU8=m=new Uint8Array(n),i.HEAPU16=y=new Uint16Array(n),i.HEAPU32=w=new Uint32Array(n),i.HEAPF32=b=new Float32Array(n),i.HEAPF64=A=new Float64Array(n)}var E=[],W=[],j=[];function k(){if(i.preRun)for(\"function\"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)S(i.preRun.shift());Z(E)}function F(){Z(W)}function R(){if(i.postRun)for(\"function\"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)U(i.postRun.shift());Z(j)}function S(n){E.unshift(n)}function x(n){W.unshift(n)}function U(n){j.unshift(n)}var I=0,O=null;function H(n){I++,i.monitorRunDependencies&&i.monitorRunDependencies(I)}function D(n){if(I--,i.monitorRunDependencies&&i.monitorRunDependencies(I),0==I&&O){var r=O;O=null,r()}}function z(n){i.onAbort&&i.onAbort(n),v(n=\"Aborted(\"+n+\")\"),C=!0,n+=\". Build with -sASSERTIONS for more info.\";var r=new WebAssembly.RuntimeError(n);throw e(r),r}var V,M=\"data:application/octet-stream;base64,\";function B(n){return n.startsWith(M)}function q(n){try{if(n==V&&l)return new Uint8Array(l);if(c)return c(n);throw\"both async and sync fetching of the wasm failed\"}catch(v){z(v)}}function N(n){return l||!a&&!u||\"function\"!=typeof fetch?Promise.resolve().then((()=>q(n))):fetch(n,{credentials:\"same-origin\"}).then((r=>{if(!r.ok)throw\"failed to load wasm binary file at '\"+n+\"'\";return r.arrayBuffer()})).catch((()=>q(n)))}function L(n,r,e){return N(n).then((n=>WebAssembly.instantiate(n,r))).then((n=>n)).then(e,(n=>{v(\"failed to asynchronously prepare wasm: \"+n),z(n)}))}function G(n,r,e,t){return n||\"function\"!=typeof WebAssembly.instantiateStreaming||B(r)||\"function\"!=typeof fetch?L(r,e,t):fetch(r,{credentials:\"same-origin\"}).then((n=>WebAssembly.instantiateStreaming(n,e).then(t,(function(n){return v(\"wasm streaming compile failed: \"+n),v(\"falling back to ArrayBuffer instantiation\"),L(r,e,t)}))))}function X(){var n={env:Fr,wasi_snapshot_preview1:Fr};function r(n,r){var e=n.exports;return i.asm=e,d=i.asm.memory,P(),T=i.asm.__indirect_function_table,x(i.asm.__wasm_call_ctors),D(),e}function t(n){r(n.instance)}if(H(),i.instantiateWasm)try{return i.instantiateWasm(n,r)}catch(o){v(\"Module.instantiateWasm callback failed with error: \"+o),e(o)}return G(l,V,n,t).catch(e),{}}function Z(n){for(;n.length>0;)n.shift()(i)}B(V=\"i3s.wasm\")||(V=s(V));var $=[];function J(n){var r=$[n];return r||(n>=$.length&&($.length=n+1),$[n]=r=T.get(n)),r}function K(n,r){J(n)(r)}function Q(n){this.excPtr=n,this.ptr=n-24,this.set_type=function(n){w[this.ptr+4>>2]=n},this.get_type=function(){return w[this.ptr+4>>2]},this.set_destructor=function(n){w[this.ptr+8>>2]=n},this.get_destructor=function(){return w[this.ptr+8>>2]},this.set_caught=function(n){n=n?1:0,h[this.ptr+12>>0]=n},this.get_caught=function(){return 0!=h[this.ptr+12>>0]},this.set_rethrown=function(n){n=n?1:0,h[this.ptr+13>>0]=n},this.get_rethrown=function(){return 0!=h[this.ptr+13>>0]},this.init=function(n,r){this.set_adjusted_ptr(0),this.set_type(n),this.set_destructor(r)},this.set_adjusted_ptr=function(n){w[this.ptr+16>>2]=n},this.get_adjusted_ptr=function(){return w[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ir(this.get_type()))return w[this.excPtr>>2];var n=this.get_adjusted_ptr();return 0!==n?n:this.excPtr}}function Y(n,r,e){throw new Q(n).init(r,e),n}var nn={};function rn(n){for(;n.length;){var r=n.pop();n.pop()(r)}}function en(n){return this.fromWireType(_[n>>2])}var tn={},on={},an={},un=48,cn=57;function fn(n){if(void 0===n)return\"_unknown\";var r=(n=n.replace(/[^a-zA-Z0-9_]/g,\"$\")).charCodeAt(0);return r>=un&&r<=cn?\"_\"+n:n}function sn(n,r){return{[n=fn(n)]:function(){return r.apply(this,arguments)}}[n]}function ln(n,r){var e=sn(r,(function(n){this.name=r,this.message=n;var e=new Error(n).stack;void 0!==e&&(this.stack=this.toString()+\"\\n\"+e.replace(/^Error(:[^\\n]*)?\\n/,\"\"))}));return e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return void 0===this.message?this.name:this.name+\": \"+this.message},e}var dn=void 0;function pn(n){throw new dn(n)}function vn(n,r,e){function t(r){var t=e(r);t.length!==n.length&&pn(\"Mismatched type converter count\");for(var i=0;i{on.hasOwnProperty(n)?i[r]=on[n]:(o.push(n),tn.hasOwnProperty(n)||(tn[n]=[]),tn[n].push((()=>{i[r]=on[n],++a===o.length&&t(i)})))})),0===o.length&&t(i)}function hn(n){var r=nn[n];delete nn[n];var e=r.rawConstructor,t=r.rawDestructor,i=r.fields;vn([n],i.map((n=>n.getterReturnType)).concat(i.map((n=>n.setterArgumentType))),(n=>{var o={};return i.forEach(((r,e)=>{var t=r.fieldName,a=n[e],u=r.getter,c=r.getterContext,f=n[e+i.length],s=r.setter,l=r.setterContext;o[t]={read:n=>a.fromWireType(u(c,n)),write:(n,r)=>{var e=[];s(l,n,f.toWireType(e,r)),rn(e)}}})),[{name:r.name,fromWireType:function(n){var r={};for(var e in o)r[e]=o[e].read(n);return t(n),r},toWireType:function(n,r){for(var i in o)if(!(i in r))throw new TypeError('Missing field: \"'+i+'\"');var a=e();for(i in o)o[i].write(a,r[i]);return null!==n&&n.push(t,a),a},argPackAdvance:8,readValueFromPointer:en,destructorFunction:t}]}))}function mn(n,r,e,t,i){}function gn(n){switch(n){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(\"Unknown type size: \"+n)}}function yn(){for(var n=new Array(256),r=0;r<256;++r)n[r]=String.fromCharCode(r);_n=n}var _n=void 0;function wn(n){for(var r=\"\",e=n;m[e];)r+=_n[m[e++]];return r}var bn=void 0;function An(n){throw new bn(n)}function Tn(n,r,e={}){if(!(\"argPackAdvance\"in r))throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");var t=r.name;if(n||An('type \"'+t+'\" must have a positive integer typeid pointer'),on.hasOwnProperty(n)){if(e.ignoreDuplicateRegistrations)return;An(\"Cannot register type '\"+t+\"' twice\")}if(on[n]=r,delete an[n],tn.hasOwnProperty(n)){var i=tn[n];delete tn[n],i.forEach((n=>n()))}}function Cn(n,r,e,t,i){var o=gn(e);Tn(n,{name:r=wn(r),fromWireType:function(n){return!!n},toWireType:function(n,r){return r?t:i},argPackAdvance:8,readValueFromPointer:function(n){var t;if(1===e)t=h;else if(2===e)t=g;else{if(4!==e)throw new TypeError(\"Unknown boolean type size: \"+r);t=_}return this.fromWireType(t[n>>o])},destructorFunction:null})}function Pn(){this.allocated=[void 0],this.freelist=[],this.get=function(n){return this.allocated[n]},this.allocate=function(n){let r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=n,r},this.free=function(n){this.allocated[n]=void 0,this.freelist.push(n)}}var En=new Pn;function Wn(n){n>=En.reserved&&0==--En.get(n).refcount&&En.free(n)}function jn(){for(var n=0,r=En.reserved;r(n||An(\"Cannot use deleted val. handle = \"+n),En.get(n).value),toHandle:n=>{switch(n){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return En.allocate({refcount:1,value:n})}}};function Rn(n,r){Tn(n,{name:r=wn(r),fromWireType:function(n){var r=Fn.toValue(n);return Wn(n),r},toWireType:function(n,r){return Fn.toHandle(r)},argPackAdvance:8,readValueFromPointer:en,destructorFunction:null})}function Sn(n,r){switch(r){case 2:return function(n){return this.fromWireType(b[n>>2])};case 3:return function(n){return this.fromWireType(A[n>>3])};default:throw new TypeError(\"Unknown float type: \"+n)}}function xn(n,r,e){var t=gn(e);Tn(n,{name:r=wn(r),fromWireType:function(n){return n},toWireType:function(n,r){return r},argPackAdvance:8,readValueFromPointer:Sn(r,t),destructorFunction:null})}function Un(n,r,e,t,i,o){var a=r.length;a<2&&An(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");for(var u=null!==r[1]&&null!==e,c=!1,f=1;f>2]);return e}function Dn(n,r,e){i.hasOwnProperty(n)||pn(\"Replacing nonexistant public symbol\"),void 0!==i[n].overloadTable&&void 0!==e?i[n].overloadTable[e]=r:(i[n]=r,i[n].argCount=e)}function zn(n,r,e){var t=i[\"dynCall_\"+n];return e&&e.length?t.apply(null,[r].concat(e)):t.call(null,r)}function Vn(n,r,e){return n.includes(\"j\")?zn(n,r,e):J(r).apply(null,e)}function Mn(n,r){var e=[];return function(){return e.length=0,Object.assign(e,arguments),Vn(n,r,e)}}function Bn(n,r){function e(){return n.includes(\"j\")?Mn(n,r):J(r)}n=wn(n);var t=e();return\"function\"!=typeof t&&An(\"unknown function pointer with signature \"+n+\": \"+r),t}var qn=void 0;function Nn(n){var r=xr(n),e=wn(r);return Sr(r),e}function Ln(n,r){var e=[],t={};function i(n){t[n]||on[n]||(an[n]?an[n].forEach(i):(e.push(n),t[n]=!0))}throw r.forEach(i),new qn(n+\": \"+e.map(Nn).join([\", \"]))}function Gn(n,r,e,t,i,o,a){var u=Hn(r,e);n=wn(n),i=Bn(t,i),On(n,(function(){Ln(\"Cannot call \"+n+\" due to unbound types\",u)}),r-1),vn([],u,(function(e){var t=[e[0],null].concat(e.slice(1));return Dn(n,Un(n,t,null,i,o),r-1),[]}))}function Xn(n,r,e){switch(r){case 0:return e?function(n){return h[n]}:function(n){return m[n]};case 1:return e?function(n){return g[n>>1]}:function(n){return y[n>>1]};case 2:return e?function(n){return _[n>>2]}:function(n){return w[n>>2]};default:throw new TypeError(\"Unknown integer type: \"+n)}}function Zn(n,r,e,t,i){r=wn(r);var o=gn(e),a=n=>n;if(0===t){var u=32-8*e;a=n=>n<>>u}var c=r.includes(\"unsigned\"),f=(n,r)=>{};Tn(n,{name:r,fromWireType:a,toWireType:c?function(n,r){return f(r,this.name),r>>>0}:function(n,r){return f(r,this.name),r},argPackAdvance:8,readValueFromPointer:Xn(r,o,0!==t),destructorFunction:null})}function $n(n,r,e){var t=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function i(n){var r=w,e=r[n>>=2],i=r[n+1];return new t(r.buffer,i,e)}Tn(n,{name:e=wn(e),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})}function Jn(n,r,e,t){if(!(t>0))return 0;for(var i=e,o=e+t-1,a=0;a=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&n.charCodeAt(++a)),u<=127){if(e>=o)break;r[e++]=u}else if(u<=2047){if(e+1>=o)break;r[e++]=192|u>>6,r[e++]=128|63&u}else if(u<=65535){if(e+2>=o)break;r[e++]=224|u>>12,r[e++]=128|u>>6&63,r[e++]=128|63&u}else{if(e+3>=o)break;r[e++]=240|u>>18,r[e++]=128|u>>12&63,r[e++]=128|u>>6&63,r[e++]=128|63&u}}return r[e]=0,e-i}function Kn(n,r,e){return Jn(n,m,r,e)}function Qn(n){for(var r=0,e=0;e=55296&&t<=57343?(r+=4,++e):r+=3}return r}var Yn=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function nr(n,r,e){for(var t=r+e,i=r;n[i]&&!(i>=t);)++i;if(i-r>16&&n.buffer&&Yn)return Yn.decode(n.subarray(r,i));for(var o=\"\";r>10,56320|1023&f)}}else o+=String.fromCharCode((31&a)<<6|u)}else o+=String.fromCharCode(a)}return o}function rr(n,r){return n?nr(m,n,r):\"\"}function er(n,r){var e=\"std::string\"===(r=wn(r));Tn(n,{name:r,fromWireType:function(n){var r,t=w[n>>2],i=n+4;if(e)for(var o=i,a=0;a<=t;++a){var u=i+a;if(a==t||0==m[u]){var c=rr(o,u-o);void 0===r?r=c:(r+=String.fromCharCode(0),r+=c),o=u+1}}else{var f=new Array(t);for(a=0;a>2]=t,e&&i)Kn(r,a,t+1);else if(i)for(var u=0;u255&&(Sr(a),An(\"String has UTF-16 code units that do not fit in 8 bits\")),m[a+u]=c}else for(u=0;u>1,i=t+r/2;!(t>=i)&&y[t];)++t;if((e=t<<1)-n>32&&tr)return tr.decode(m.subarray(n,e));for(var o=\"\",a=0;!(a>=r/2);++a){var u=g[n+2*a>>1];if(0==u)break;o+=String.fromCharCode(u)}return o}function or(n,r,e){if(void 0===e&&(e=2147483647),e<2)return 0;for(var t=r,i=(e-=2)<2*n.length?e/2:n.length,o=0;o>1]=a,r+=2}return g[r>>1]=0,r-t}function ar(n){return 2*n.length}function ur(n,r){for(var e=0,t=\"\";!(e>=r/4);){var i=_[n+4*e>>2];if(0==i)break;if(++e,i>=65536){var o=i-65536;t+=String.fromCharCode(55296|o>>10,56320|1023&o)}else t+=String.fromCharCode(i)}return t}function cr(n,r,e){if(void 0===e&&(e=2147483647),e<4)return 0;for(var t=r,i=t+e-4,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&n.charCodeAt(++o)),_[r>>2]=a,(r+=4)+4>i)break}return _[r>>2]=0,r-t}function fr(n){for(var r=0,e=0;e=55296&&t<=57343&&++e,r+=4}return r}function sr(n,r,e){var t,i,o,a,u;e=wn(e),2===r?(t=ir,i=or,a=ar,o=()=>y,u=1):4===r&&(t=ur,i=cr,a=fr,o=()=>w,u=2),Tn(n,{name:e,fromWireType:function(n){for(var e,i=w[n>>2],a=o(),c=n+4,f=0;f<=i;++f){var s=n+4+f*r;if(f==i||0==a[s>>u]){var l=t(c,s-c);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),c=s+r}}return Sr(n),e},toWireType:function(n,t){\"string\"!=typeof t&&An(\"Cannot pass non-string to C++ string type \"+e);var o=a(t),c=Rr(4+o+r);return w[c>>2]=o>>u,i(t,c+4,o+r),null!==n&&n.push(Sr,c),c},argPackAdvance:8,readValueFromPointer:en,destructorFunction:function(n){Sr(n)}})}function lr(n,r,e,t,i,o){nn[n]={name:wn(r),rawConstructor:Bn(e,t),rawDestructor:Bn(i,o),fields:[]}}function dr(n,r,e,t,i,o,a,u,c,f){nn[n].fields.push({fieldName:wn(r),getterReturnType:e,getter:Bn(t,i),getterContext:o,setterArgumentType:a,setter:Bn(u,c),setterContext:f})}function pr(n,r){Tn(n,{isVoid:!0,name:r=wn(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(n,r){}})}function vr(n){n>4&&(En.get(n).refcount+=1)}var hr={};function mr(n){var r=hr[n];return void 0===r?wn(n):r}function gr(n){return Fn.toHandle(mr(n))}function yr(n,r){var e=on[n];return void 0===e&&An(r+\" has unknown type \"+Nn(n)),e}function _r(n,r){var e=(n=yr(n,\"_emval_take_value\")).readValueFromPointer(r);return Fn.toHandle(e)}function wr(){z(\"\")}function br(n,r,e){m.copyWithin(n,r,r+e)}function Ar(){return 2147483648}function Tr(n){var r=d.buffer;try{return d.grow(n-r.byteLength+65535>>>16),P(),1}catch(e){}}function Cr(n){var r=m.length;n>>>=0;var e=Ar();if(n>e)return!1;let t=(n,r)=>n+(r-n%r)%r;for(var i=1;i<=4;i*=2){var o=r*(1+.2/i);if(o=Math.min(o,n+100663296),Tr(Math.min(e,t(Math.max(n,o),65536))))return!0}return!1}function Pr(n){return 52}function Er(n,r,e,t,i){return 70}var Wr=[null,[],[]];function jr(n,r){var e=Wr[n];0===r||10===r?((1===n?p:v)(nr(e,0)),e.length=0):e.push(r)}function kr(n,r,e,t){for(var i=0,o=0;o>2],u=w[r+4>>2];r+=8;for(var c=0;c>2]=i,0}dn=i.InternalError=ln(Error,\"InternalError\"),yn(),bn=i.BindingError=ln(Error,\"BindingError\"),kn(),qn=i.UnboundTypeError=ln(Error,\"UnboundTypeError\");var Fr={__call_sighandler:K,__cxa_throw:Y,_embind_finalize_value_object:hn,_embind_register_bigint:mn,_embind_register_bool:Cn,_embind_register_emval:Rn,_embind_register_float:xn,_embind_register_function:Gn,_embind_register_integer:Zn,_embind_register_memory_view:$n,_embind_register_std_string:er,_embind_register_std_wstring:sr,_embind_register_value_object:lr,_embind_register_value_object_field:dr,_embind_register_void:pr,_emval_decref:Wn,_emval_incref:vr,_emval_new_cstring:gr,_emval_take_value:_r,abort:wr,emscripten_memcpy_big:br,emscripten_resize_heap:Cr,fd_close:Pr,fd_seek:Er,fd_write:kr};X();var Rr=function(){return(Rr=i.asm.malloc).apply(null,arguments)},Sr=function(){return(Sr=i.asm.free).apply(null,arguments)},xr=function(){return(xr=i.asm.__getTypeName).apply(null,arguments)};i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm._embind_initialize_bindings).apply(null,arguments)};var Ur,Ir=function(){return(Ir=i.asm.__cxa_is_pointer_type).apply(null,arguments)};function Or(){function n(){Ur||(Ur=!0,i.calledRun=!0,C||(F(),r(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),R()))}I>0||(k(),I>0||(i.setStatus?(i.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){i.setStatus(\"\")}),1),n()}),1)):n()))}if(i.dynCall_vij=function(){return(i.dynCall_vij=i.asm.dynCall_vij).apply(null,arguments)},i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.dynCall_jiji).apply(null,arguments)},O=function n(){Ur||Or(),Ur||(O=n)},i.preInit)for(\"function\"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Or(),n.ready},e.exports=i;var a=o.exports;const u=r({__proto__:null,default:n(a)},[a]);export{u as i};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as r}from\"./_commonjsHelpers.js\";function e(r,e){for(var f=0;fi[e]})}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:\"Module\"}))}var f,i,a,n={exports:{}};n.exports,f=n,i=function(){function r(r){const e=r.locateFile,i={};var a=void 0!==a?a:{};const n=(()=>{let r;return{resolve:e=>r(e),promise:new Promise((e=>r=e))}})(),t=()=>n.promise;a.locateFile=e,a.onRuntimeInitialized=()=>{n.resolve(i)},i.Module=a,i.whenLoaded=t;var o,b={};for(o in a)a.hasOwnProperty(o)&&(b[o]=a[o]);var k,u,c,s,A,l=\"object\"==typeof window,v=\"function\"==typeof importScripts,d=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,h=\"\";function p(r){return a.locateFile?a.locateFile(r,h):h+r}d?(h=v?require(\"path\").dirname(h)+\"/\":__dirname+\"/\",k=function(r,e){var f=dr(r);return f?e?f:f.toString():(s||(s=require(\"fs\")),A||(A=require(\"path\")),r=A.normalize(r),s.readFileSync(r,e?null:\"utf8\"))},c=function(r){var e=k(r,!0);return e.buffer||(e=new Uint8Array(e)),_(e.buffer),e},u=function(r,e,f){var i=dr(r);i&&e(i),s||(s=require(\"fs\")),A||(A=require(\"path\")),r=A.normalize(r),s.readFile(r,(function(r,i){r?f(r):e(i.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\\\/g,\"/\"),process.argv.slice(2),f.exports=a,process.on(\"uncaughtException\",(function(r){if(!(r instanceof _r))throw r})),process.on(\"unhandledRejection\",X),a.inspect=function(){return\"[Emscripten Module object]\"}):(l||v)&&(v?h=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(h=document.currentScript.src),h=0!==h.indexOf(\"blob:\")?h.substr(0,h.lastIndexOf(\"/\")+1):\"\",k=function(r){try{var e=new XMLHttpRequest;return e.open(\"GET\",r,!1),e.send(null),e.responseText}catch(w){var f=dr(r);if(f)return Ar(f);throw w}},v&&(c=function(r){try{var e=new XMLHttpRequest;return e.open(\"GET\",r,!1),e.responseType=\"arraybuffer\",e.send(null),new Uint8Array(e.response)}catch(w){var f=dr(r);if(f)return f;throw w}}),u=function(r,e,f){var i=new XMLHttpRequest;i.open(\"GET\",r,!0),i.responseType=\"arraybuffer\",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var a=dr(r);a?e(a.buffer):f()}},i.onerror=f,i.send(null)});var m=a.print||console.log.bind(console),w=a.printErr||console.warn.bind(console);for(o in b)b.hasOwnProperty(o)&&(a[o]=b[o]);b=null,a.arguments&&a.arguments,a.thisProgram&&a.thisProgram,a.quit&&a.quit;var y,g=0,E=function(r){g=r},C=function(){return g};a.wasmBinary&&(y=a.wasmBinary),a.noExitRuntime;var R,M={Memory:function(r){this.buffer=new ArrayBuffer(65536*r.initial)},Module:function(r){},Instance:function(r,e){this.exports=function(r){function e(r){return r.set=function(r,e){this[r]=e},r.get=function(r){return this[r]},r}for(var f,i=new Uint8Array(123),a=25;a>=0;--a)i[48+a]=52+a,i[65+a]=a,i[97+a]=26+a;function n(r,e,f){for(var a,n,t=0,o=e,b=f.length,k=e+(3*b>>2)-(\"=\"==f[b-2])-(\"=\"==f[b-1]);t>4,o>2),o>>0<=244){if(3&(e=(n=b[614])>>>(f=(u=r>>>0<11?16:r+11&-8)>>>3|0)|0)){r=(a=b[2504+(e=(i=f+(1&(-1^e))|0)<<3)>>2])+8|0,(0|(f=b[a+8>>2]))!=(0|(e=e+2496|0))?(b[f+12>>2]=e,b[e+8>>2]=f):(d=2456,h=Jr(i)&n,b[d>>2]=h),e=i<<3,b[a+4>>2]=3|e,b[4+(e=e+a|0)>>2]=1|b[e+4>>2];break r}if((s=b[616])>>>0>=u>>>0)break c;if(e){f=r=(e=(0-(r=(0-(r=2<>>12&16,f|=r=(e=e>>>r|0)>>>5&8,f|=r=(e=e>>>r|0)>>>2&4,t=b[2504+(r=(f=((f|=r=(e=e>>>r|0)>>>1&2)|(r=(e=e>>>r|0)>>>1&1))+(e>>>r|0)|0)<<3)>>2],(0|(e=b[t+8>>2]))!=(0|(r=r+2496|0))?(b[e+12>>2]=r,b[r+8>>2]=e):(n=Jr(f)&n,b[614]=n),r=t+8|0,b[t+4>>2]=3|u,a=(e=f<<3)-u|0,b[4+(i=t+u|0)>>2]=1|a,b[e+t>>2]=a,s&&(f=2496+((e=s>>>3|0)<<3)|0,t=b[619],(e=1<>2]:(b[614]=e|n,e=f),b[f+8>>2]=t,b[e+12>>2]=t,b[t+12>>2]=f,b[t+8>>2]=e),b[619]=i,b[616]=a;break r}if(!(o=b[615]))break c;for(f=r=(e=(o&0-o)-1|0)>>>12&16,f|=r=(e=e>>>r|0)>>>5&8,f|=r=(e=e>>>r|0)>>>2&4,e=b[2760+(((f|=r=(e=e>>>r|0)>>>1&2)|(r=(e=e>>>r|0)>>>1&1))+(e>>>r|0)<<2)>>2],i=(-8&b[e+4>>2])-u|0,f=e;(r=b[f+16>>2])||(r=b[f+20>>2]);)i=(a=(f=(-8&b[r+4>>2])-u|0)>>>0>>0)?f:i,e=a?r:e,f=r;if((c=e+u|0)>>>0<=e>>>0)break u;if(A=b[e+24>>2],(0|(a=b[e+12>>2]))!=(0|e)){r=b[e+8>>2],b[r+12>>2]=a,b[a+8>>2]=r;break e}if(!(r=b[(f=e+20|0)>>2])){if(!(r=b[e+16>>2]))break k;f=e+16|0}for(;t=f,a=r,(r=b[(f=r+20|0)>>2])||(f=a+16|0,r=b[a+16>>2]););b[t>>2]=0;break e}if(u=-1,!(r>>>0>4294967231)&&(u=-8&(r=r+11|0),c=b[615])){i=0-u|0,n=0,u>>>0<256||(n=31,u>>>0>16777215||(r=r>>>8|0,r<<=t=r+1048320>>>16&8,n=28+((r=((r<<=f=r+520192>>>16&4)<<(e=r+245760>>>16&2)>>>15|0)-(e|f|t)|0)<<1|u>>>r+21&1)|0));s:{A:{if(f=b[2760+(n<<2)>>2])for(r=0,e=u<<(31==(0|n)?0:25-(n>>>1|0)|0);;){if(!((t=(-8&b[f+4>>2])-u|0)>>>0>=i>>>0||(a=f,i=t))){i=0,r=f;break A}if(t=b[f+20>>2],f=b[16+((e>>>29&4)+f|0)>>2],r=t?(0|t)==(0|f)?r:t:r,e<<=1,!f)break}else r=0;if(!(r|a)){if(a=0,!(r=(0-(r=2<>>12&16,f|=r=(e=e>>>r|0)>>>5&8,f|=r=(e=e>>>r|0)>>>2&4,r=b[2760+(((f|=r=(e=e>>>r|0)>>>1&2)|(r=(e=e>>>r|0)>>>1&1))+(e>>>r|0)<<2)>>2]}if(!r)break s}for(;i=(f=(e=(-8&b[r+4>>2])-u|0)>>>0>>0)?e:i,a=f?r:a,r=(e=b[r+16>>2])||b[r+20>>2];);}if(!(!a|b[616]-u>>>0<=i>>>0)){if((o=a+u|0)>>>0<=a>>>0)break u;if(n=b[a+24>>2],(0|a)!=(0|(e=b[a+12>>2]))){r=b[a+8>>2],b[r+12>>2]=e,b[e+8>>2]=r;break f}if(!(r=b[(f=a+20|0)>>2])){if(!(r=b[a+16>>2]))break b;f=a+16|0}for(;t=f,e=r,(r=b[(f=r+20|0)>>2])||(f=e+16|0,r=b[e+16>>2]););b[t>>2]=0;break f}}}if((f=b[616])>>>0>=u>>>0){i=b[619],(e=f-u|0)>>>0>=16?(b[616]=e,r=i+u|0,b[619]=r,b[r+4>>2]=1|e,b[f+i>>2]=e,b[i+4>>2]=3|u):(b[619]=0,b[616]=0,b[i+4>>2]=3|f,b[4+(r=f+i|0)>>2]=1|b[r+4>>2]),r=i+8|0;break r}if((o=b[617])>>>0>u>>>0){e=o-u|0,b[617]=e,r=(f=b[620])+u|0,b[620]=r,b[r+4>>2]=1|e,b[f+4>>2]=3|u,r=f+8|0;break r}if(r=0,e=c=u+47|0,b[732]?f=b[734]:(b[735]=-1,b[736]=-1,b[733]=4096,b[734]=4096,b[732]=l+12&-16^1431655768,b[737]=0,b[725]=0,f=4096),(f=(t=e+f|0)&(a=0-f|0))>>>0<=u>>>0)break r;if((i=b[724])&&i>>>0<(n=(e=b[722])+f|0)>>>0|e>>>0>=n>>>0)break r;if(4&k[2900])break n;c:{s:{if(i=b[620])for(r=2904;;){if(i>>>0<(e=b[r>>2])+b[r+4>>2]>>>0&&e>>>0<=i>>>0)break s;if(!(r=b[r+8>>2]))break}if(-1==(0|(e=Qr(0))))break t;if(n=f,(r=(i=b[733])-1|0)&e&&(n=(f-e|0)+(r+e&0-i)|0),n>>>0<=u>>>0|n>>>0>2147483646)break t;if((i=b[724])&&i>>>0<(a=(r=b[722])+n|0)>>>0|r>>>0>=a>>>0)break t;if((0|e)!=(0|(r=Qr(n))))break c;break a}if((n=a&t-o)>>>0>2147483646)break t;if((0|(e=Qr(n)))==(b[r>>2]+b[r+4>>2]|0))break o;r=e}if(!(-1==(0|r)|u+48>>>0<=n>>>0)){if((e=(e=b[734])+(c-n|0)&0-e)>>>0>2147483646){e=r;break a}if(-1!=(0|Qr(e))){n=e+n|0,e=r;break a}Qr(0-n|0);break t}if(e=r,-1!=(0|r))break a;break t}E()}a=0;break e}e=0;break f}if(-1!=(0|e))break a}b[725]=4|b[725]}if(f>>>0>2147483646)break i;if(-1==(0|(e=Qr(f)))|-1==(0|(r=Qr(0)))|r>>>0<=e>>>0)break i;if((n=r-e|0)>>>0<=u+40>>>0)break i}r=b[722]+n|0,b[722]=r,r>>>0>v[723]&&(b[723]=r);a:{n:{t:{if(t=b[620]){for(r=2904;;){if(((i=b[r>>2])+(f=b[r+4>>2])|0)==(0|e))break t;if(!(r=b[r+8>>2]))break}break n}for((r=b[618])>>>0<=e>>>0&&r||(b[618]=e),r=0,b[727]=n,b[726]=e,b[622]=-1,b[623]=b[732],b[729]=0;f=2496+(i=r<<3)|0,b[i+2504>>2]=f,b[i+2508>>2]=f,32!=(0|(r=r+1|0)););f=(i=n-40|0)-(r=e+8&7?-8-e&7:0)|0,b[617]=f,r=r+e|0,b[620]=r,b[r+4>>2]=1|f,b[4+(e+i|0)>>2]=40,b[621]=b[736];break a}if(!(8&k[r+12|0]|i>>>0>t>>>0|e>>>0<=t>>>0)){b[r+4>>2]=f+n,f=(r=t+8&7?-8-t&7:0)+t|0,b[620]=f,r=(e=b[617]+n|0)-r|0,b[617]=r,b[f+4>>2]=1|r,b[4+(e+t|0)>>2]=40,b[621]=b[736];break a}}v[618]>e>>>0&&(b[618]=e),f=e+n|0,r=2904;n:{t:{o:{b:{k:{u:{for(;;){if((0|f)!=b[r>>2]){if(r=b[r+8>>2])continue;break u}break}if(!(8&k[r+12|0]))break k}for(r=2904;;){if((f=b[r>>2])>>>0<=t>>>0&&(a=f+b[r+4>>2]|0)>>>0>t>>>0)break b;r=b[r+8>>2]}}if(b[r>>2]=e,b[r+4>>2]=b[r+4>>2]+n,b[4+(c=(e+8&7?-8-e&7:0)+e|0)>>2]=3|u,f=(n=f+(f+8&7?-8-f&7:0)|0)-(o=u+c|0)|0,(0|t)==(0|n)){b[620]=o,r=b[617]+f|0,b[617]=r,b[o+4>>2]=1|r;break t}if(b[619]==(0|n)){b[619]=o,r=b[616]+f|0,b[616]=r,b[o+4>>2]=1|r,b[r+o>>2]=r;break t}if(1==(3&(r=b[n+4>>2]))){t=-8&r;k:if(r>>>0<=255){if(i=b[n+8>>2],r=r>>>3|0,(0|(e=b[n+12>>2]))==(0|i)){d=2456,h=b[614]&Jr(r),b[d>>2]=h;break k}b[i+12>>2]=e,b[e+8>>2]=i}else{if(u=b[n+24>>2],(0|n)==(0|(e=b[n+12>>2])))if((i=b[(r=n+20|0)>>2])||(i=b[(r=n+16|0)>>2])){for(;a=r,(i=b[(r=(e=i)+20|0)>>2])||(r=e+16|0,i=b[e+16>>2]););b[a>>2]=0}else e=0;else r=b[n+8>>2],b[r+12>>2]=e,b[e+8>>2]=r;if(u){i=b[n+28>>2];u:{if(b[(r=2760+(i<<2)|0)>>2]==(0|n)){if(b[r>>2]=e,e)break u;d=2460,h=b[615]&Jr(i),b[d>>2]=h;break k}if(b[u+(b[u+16>>2]==(0|n)?16:20)>>2]=e,!e)break k}b[e+24>>2]=u,(r=b[n+16>>2])&&(b[e+16>>2]=r,b[r+24>>2]=e),(r=b[n+20>>2])&&(b[e+20>>2]=r,b[r+24>>2]=e)}}n=t+n|0,f=f+t|0}if(b[n+4>>2]=-2&b[n+4>>2],b[o+4>>2]=1|f,b[f+o>>2]=f,f>>>0<=255){e=2496+((r=f>>>3|0)<<3)|0,(f=b[614])&(r=1<>2]:(b[614]=r|f,r=e),b[e+8>>2]=o,b[r+12>>2]=o,b[o+12>>2]=e,b[o+8>>2]=r;break t}if(r=31,f>>>0<=16777215&&(r=f>>>8|0,r<<=a=r+1048320>>>16&8,r=28+((r=((r<<=i=r+520192>>>16&4)<<(e=r+245760>>>16&2)>>>15|0)-(e|i|a)|0)<<1|f>>>r+21&1)|0),b[o+28>>2]=r,b[o+16>>2]=0,b[o+20>>2]=0,a=2760+(r<<2)|0,(i=b[615])&(e=1<>>1|0)|0),e=b[a>>2];;){if(i=e,(-8&b[e+4>>2])==(0|f))break o;if(e=r>>>29|0,r<<=1,!(e=b[16+(a=i+(4&e)|0)>>2]))break}b[a+16>>2]=o,b[o+24>>2]=i}else b[615]=e|i,b[a>>2]=o,b[o+24>>2]=a;b[o+12>>2]=o,b[o+8>>2]=o;break t}for(f=(i=n-40|0)-(r=e+8&7?-8-e&7:0)|0,b[617]=f,r=r+e|0,b[620]=r,b[r+4>>2]=1|f,b[4+(e+i|0)>>2]=40,b[621]=b[736],b[(f=(r=(a+(a-39&7?39-a&7:0)|0)-47|0)>>>0>>0?t:r)+4>>2]=27,r=b[729],b[f+16>>2]=b[728],b[f+20>>2]=r,r=b[727],b[f+8>>2]=b[726],b[f+12>>2]=r,b[728]=f+8,b[727]=n,b[726]=e,b[729]=0,r=f+24|0;b[r+4>>2]=7,e=r+8|0,r=r+4|0,e>>>0>>0;);if((0|f)==(0|t))break a;if(b[f+4>>2]=-2&b[f+4>>2],a=f-t|0,b[t+4>>2]=1|a,b[f>>2]=a,a>>>0<=255){e=2496+((r=a>>>3|0)<<3)|0,(f=b[614])&(r=1<>2]:(b[614]=r|f,r=e),b[e+8>>2]=t,b[r+12>>2]=t,b[t+12>>2]=e,b[t+8>>2]=r;break a}if(r=31,b[t+16>>2]=0,b[t+20>>2]=0,a>>>0<=16777215&&(r=a>>>8|0,r<<=i=r+1048320>>>16&8,r=28+((r=((r<<=f=r+520192>>>16&4)<<(e=r+245760>>>16&2)>>>15|0)-(e|f|i)|0)<<1|a>>>r+21&1)|0),b[t+28>>2]=r,i=2760+(r<<2)|0,(f=b[615])&(e=1<>>1|0)|0),e=b[i>>2];;){if(f=e,(0|a)==(-8&b[e+4>>2]))break n;if(e=r>>>29|0,r<<=1,!(e=b[16+(i=f+(4&e)|0)>>2]))break}b[i+16>>2]=t,b[t+24>>2]=f}else b[615]=e|f,b[i>>2]=t,b[t+24>>2]=i;b[t+12>>2]=t,b[t+8>>2]=t;break a}r=b[i+8>>2],b[r+12>>2]=o,b[i+8>>2]=o,b[o+24>>2]=0,b[o+12>>2]=i,b[o+8>>2]=r}r=c+8|0;break r}r=b[f+8>>2],b[r+12>>2]=t,b[f+8>>2]=t,b[t+24>>2]=0,b[t+12>>2]=f,b[t+8>>2]=r}if(!((r=b[617])>>>0<=u>>>0)){e=r-u|0,b[617]=e,r=(f=b[620])+u|0,b[620]=r,b[r+4>>2]=1|e,b[f+4>>2]=3|u,r=f+8|0;break r}}b[613]=48,r=0;break r}f:if(n){f=b[a+28>>2];i:{if(b[(r=2760+(f<<2)|0)>>2]==(0|a)){if(b[r>>2]=e,e)break i;c=Jr(f)&c,b[615]=c;break f}if(b[n+(b[n+16>>2]==(0|a)?16:20)>>2]=e,!e)break f}b[e+24>>2]=n,(r=b[a+16>>2])&&(b[e+16>>2]=r,b[r+24>>2]=e),(r=b[a+20>>2])&&(b[e+20>>2]=r,b[r+24>>2]=e)}f:if(i>>>0<=15)r=i+u|0,b[a+4>>2]=3|r,b[4+(r=r+a|0)>>2]=1|b[r+4>>2];else if(b[a+4>>2]=3|u,b[o+4>>2]=1|i,b[i+o>>2]=i,i>>>0<=255)e=2496+((r=i>>>3|0)<<3)|0,(f=b[614])&(r=1<>2]:(b[614]=r|f,r=e),b[e+8>>2]=o,b[r+12>>2]=o,b[o+12>>2]=e,b[o+8>>2]=r;else{r=31,i>>>0<=16777215&&(r=i>>>8|0,r<<=t=r+1048320>>>16&8,r=28+((r=((r<<=f=r+520192>>>16&4)<<(e=r+245760>>>16&2)>>>15|0)-(e|f|t)|0)<<1|i>>>r+21&1)|0),b[o+28>>2]=r,b[o+16>>2]=0,b[o+20>>2]=0,f=2760+(r<<2)|0;i:{if((e=1<>>1|0)|0),u=b[f>>2];;){if((-8&b[(e=u)+4>>2])==(0|i))break i;if(f=r>>>29|0,r<<=1,!(u=b[16+(f=e+(4&f)|0)>>2]))break}b[f+16>>2]=o,b[o+24>>2]=e}else b[615]=e|c,b[f>>2]=o,b[o+24>>2]=f;b[o+12>>2]=o,b[o+8>>2]=o;break f}r=b[e+8>>2],b[r+12>>2]=o,b[e+8>>2]=o,b[o+24>>2]=0,b[o+12>>2]=e,b[o+8>>2]=r}r=a+8|0;break r}e:if(A){f=b[e+28>>2];f:{if(b[(r=2760+(f<<2)|0)>>2]==(0|e)){if(b[r>>2]=a,a)break f;d=2460,h=Jr(f)&o,b[d>>2]=h;break e}if(b[(b[A+16>>2]==(0|e)?16:20)+A>>2]=a,!a)break e}b[a+24>>2]=A,(r=b[e+16>>2])&&(b[a+16>>2]=r,b[r+24>>2]=a),(r=b[e+20>>2])&&(b[a+20>>2]=r,b[r+24>>2]=a)}i>>>0<=15?(r=i+u|0,b[e+4>>2]=3|r,b[4+(r=r+e|0)>>2]=1|b[r+4>>2]):(b[e+4>>2]=3|u,b[c+4>>2]=1|i,b[i+c>>2]=i,s&&(f=2496+((r=s>>>3|0)<<3)|0,a=b[619],(r=1<>2]:(b[614]=r|n,r=f),b[f+8>>2]=a,b[r+12>>2]=a,b[a+12>>2]=f,b[a+8>>2]=r),b[619]=c,b[616]=i),r=e+8|0}return U=l+16|0,0|r}function D(r,e,f,i,a,t){r|=0,e|=0,f|=0,i|=0,a|=0,t|=0;for(var u=0,c=0,s=0,A=0,l=0,v=m(0),h=0,w=m(0),y=m(0),g=0,S=0,P=0,x=0,T=0,U=0,F=0,D=0;(s=b[2032+(u=c<<2)>>2])&&(b[s>>2]=0),(s=b[2032+(4|u)>>2])&&(b[s>>2]=0),(s=b[2032+(8|u)>>2])&&(b[s>>2]=0),(u=b[2032+(12|u)>>2])&&(b[u>>2]=0),100!=(0|(c=c+4|0)););if((c=b[608])||(c=O(16),b[608]=c),b[c+8>>2]=t,b[c+4>>2]=0,b[c+12>>2]=i,b[c>>2]=a,(c=b[609])||((a=O(1900))?(b[a+100>>2]=12,b[a+96>>2]=13,b[a+92>>2]=14,b[a+88>>2]=15,o[a+80>>1]=0,b[a+52>>2]=0,b[a+56>>2]=100130,b[a+16>>2]=0,b[a+20>>2]=0,b[a>>2]=0,b[a+1896>>2]=0,b[a+1736>>2]=8,b[a+1732>>2]=11,b[a+1728>>2]=6,b[a+1724>>2]=5,b[a+1720>>2]=4,b[a+1716>>2]=3,b[a+104>>2]=16,b[a+76>>2]=17,b[a+12>>2]=18,b[a+24>>2]=0):a=0,b[609]=a,wr(a,100107,34),wr(b[609],100100,35),wr(b[609],100102,36),wr(b[609],100105,37),wr(b[609],100103,38),wr(b[609],100104,39),b[b[609]+56>>2]=100130,a=b[609],d[a+16>>2]=0,d[a+24>>2]=1,d[a+20>>2]=0,c=b[609]),a=0,t=b[608],b[c>>2]&&cr(c,0),b[c+112>>2]=0,b[c>>2]=1,n[c+108|0]=0,b[c+1896>>2]=t,b[c+8>>2]=0,(0|f)>0)for(t=0;;){if(g=b[(t<<2)+e>>2],u=b[609],1!=b[u>>2]&&cr(u,1),b[u>>2]=2,b[u+4>>2]=0,b[u+112>>2]>=1&&(n[u+108|0]=1),c=0,(0|g)>0)for(;;){l=S=(p(a+c|0,i)<<2)+r|0,s=b[609],2!=b[s>>2]&&cr(s,2);r:{e:{f:{if(k[s+108|0]){if(u=Rr(),b[s+8>>2]=u,!u)break f;if((0|(u=b[s+112>>2]))>=1)for(P=116+(s+(u<<4)|0)|0,A=s+116|0,u=b[s+4>>2];;){D=b[A+12>>2];i:{if(!u){if(!(u=br(b[s+8>>2])))break f;if(tr(u,b[u+4>>2]))break i;break f}if(!ir(u))break f;u=b[u+12>>2]}if(h=b[u+16>>2],b[h+12>>2]=D,d[h+16>>2]=d[A>>2],v=d[A+4>>2],b[h+24>>2]=0,d[h+20>>2]=v,b[u+28>>2]=1,b[b[u+4>>2]+28>>2]=-1,b[s+4>>2]=u,!(P>>>0>(A=A+16|0)>>>0))break}n[s+108|0]=0,b[s+112>>2]=0,b[s+4>>2]=0}A=(T=+(v=(x=+(v=d[l+4>>2]))<-1e37?m(-9999999933815813e21):v))>1e37,h=(F=+(w=(U=+(w=d[l>>2]))<-1e37?m(-9999999933815813e21):w))>1e37,((u=+(y=d[l+8>>2])<-1e37)|(l=+(y=u?m(-9999999933815813e21):y)>1e37)|x<-1e37|T>1e37||F>1e37||U<-1e37)&&(11==(0|(u=b[s+1732>>2]))?be[b[s+12>>2]](100155):be[0|u](100155,b[s+1896>>2])),v=A?m(9999999933815813e21):v,w=h?m(9999999933815813e21):w;i:{if(!b[s+8>>2]){if((0|(A=b[s+112>>2]))<=99){d[124+(u=s+(A<<4)|0)>>2]=l?m(9999999933815813e21):y,d[u+120>>2]=v,d[u+116>>2]=w,b[u+128>>2]=S,b[s+112>>2]=A+1;break r}if(u=Rr(),b[s+8>>2]=u,!u)break i;if((0|(u=b[s+112>>2]))>=1)for(h=116+(s+(u<<4)|0)|0,A=s+116|0,u=b[s+4>>2];;){P=b[A+12>>2];a:{if(!u){if(!(u=br(b[s+8>>2])))break i;if(tr(u,b[u+4>>2]))break a;break i}if(!ir(u))break i;u=b[u+12>>2]}if(l=b[u+16>>2],b[l+12>>2]=P,d[l+16>>2]=d[A>>2],y=d[A+4>>2],b[l+24>>2]=0,d[l+20>>2]=y,b[u+28>>2]=1,b[b[u+4>>2]+28>>2]=-1,b[s+4>>2]=u,!(h>>>0>(A=A+16|0)>>>0))break}n[s+108|0]=0,b[s+112>>2]=0}a:{n:{if(!(u=b[s+4>>2])){if(!(u=br(b[s+8>>2])))break a;if(tr(u,b[u+4>>2]))break n;break a}if(!ir(u))break a;u=b[u+12>>2]}A=b[u+16>>2],d[A+16>>2]=w,b[A+12>>2]=S,b[A+24>>2]=0,d[A+20>>2]=v,b[u+28>>2]=1,b[b[u+4>>2]+28>>2]=-1,b[s+4>>2]=u;break r}if(11!=(0|(u=b[s+1732>>2])))break e;be[b[s+12>>2]](100902);break r}if(11!=(0|(u=b[s+1732>>2])))break e;be[b[s+12>>2]](100902);break r}if(11==(0|(u=b[s+1732>>2]))){be[b[s+12>>2]](100902);break r}}be[0|u](100902,b[s+1896>>2])}if((0|g)==(0|(c=c+1|0)))break}if(u=b[609],2!=b[u>>2]&&cr(u,2),b[u>>2]=1,a=a+g|0,(0|(t=t+1|0))==(0|f))break}f=b[609],r=0,e=O(40),b[e>>2]=0,a=Br(s=f+1740|0,1,e,4),t=0|R();r:{e:{f:{i:{a:{n:for(;;){t:{o:{b:{k:{u:{c:{s:{if(r){if(11!=(0|(r=b[f+1732>>2]))){if(e=b[f+1896>>2],b[611]=0,M(0|r,100902,0|e),r=b[611],b[611]=0,e=-1,!r)break c;if(!(i=b[612]))break c;if(e=Hr(b[r>>2],a,t))break s;break a}if(r=b[f+12>>2],b[611]=0,_(0|r,100902),r=b[611],b[611]=0,e=-1,!r)break k;if(!(i=b[612]))break k;if(e=Hr(b[r>>2],a,t))break u;break a}if(1==b[f>>2])break t;if(b[611]=0,M(19,0|f,1),r=b[611],b[611]=0,e=-1,!r)break o;if(!(i=b[612]))break o;if(e=Hr(b[r>>2],a,t))break b;break a}C(0|i)}if(r=0|R(),1==(0|e))continue;break r}C(0|i)}if(r=0|R(),1==(0|e))continue;break r}C(0|i)}if(r=0|R(),1==(0|e))continue}b[f>>2]=0;t:{o:{b:{if(!b[f+8>>2]){if(!(k[f+80|0]|16!=b[f+104>>2])){if(b[611]=0,u=0|I(20,0|f),r=b[611],b[611]=0,e=-1,r&&(i=b[612])){if(!(e=Hr(b[r>>2],a,t)))break a;C(0|i)}if(r=0|R(),1==(0|e))continue;if(u){b[f+1896>>2]=0;break r}}if(b[611]=0,i=0|B(21),r=b[611],b[611]=0,e=-1,r&&(c=b[612])){if(!(e=Hr(b[r>>2],a,t)))break i;C(0|c)}if(r=0|R(),1==(0|e))continue;if(b[f+8>>2]=i,!i)break b;if((0|(r=b[f+112>>2]))>=1)for(A=116+(f+(r<<4)|0)|0,i=f+116|0,e=b[f+4>>2];;){g=b[i+12>>2];k:{u:{c:{s:{A:{l:{if(!e){if(r=b[f+8>>2],b[611]=0,e=0|I(22,0|r),r=b[611],b[611]=0,c=-1,!r)break A;if(!(u=b[612]))break A;if(c=Hr(b[r>>2],a,t))break l;break f}if(b[611]=0,l=0|I(23,0|e),r=b[611],b[611]=0,c=-1,!r)break c;if(!(u=b[612]))break c;if(c=Hr(b[r>>2],a,t))break s;break f}C(0|u)}if(r=0|R(),1!=(0|c))break u;continue n}C(0|u)}if(r=0|R(),1==(0|c))continue n;if(!l)break b;e=b[e+12>>2];break k}if(!e)break b;if(r=b[e+4>>2],b[611]=0,l=0|j(24,0|e,0|r),r=b[611],b[611]=0,c=-1,r&&(u=b[612])){if(!(c=Hr(b[r>>2],a,t)))break f;C(0|u)}if(r=0|R(),1==(0|c))continue n;if(!l)break b}if(r=b[e+16>>2],b[r+12>>2]=g,d[r+16>>2]=d[i>>2],v=d[i+4>>2],b[r+24>>2]=0,d[r+20>>2]=v,b[e+28>>2]=1,b[b[e+4>>2]+28>>2]=-1,b[f+4>>2]=e,!(A>>>0>(i=i+16|0)>>>0))break}n[f+108|0]=0,b[f+112>>2]=0}if(b[611]=0,K(f),r=b[611],b[611]=0,e=-1,!r)break t;if(!(i=b[612]))break t;if(e=Hr(b[r>>2],a,t))break o;break a}if(b[611]=0,M(26,0|s,1),e=b[611],b[611]=0,e&&(r=b[612])){if(!Hr(b[e>>2],a,t))break e;C(0|r)}r=0|R();continue}C(0|i)}if(r=0|R(),1!=(0|e)){if(b[611]=0,u=0|I(27,0|f),r=b[611],b[611]=0,e=-1,r&&(i=b[612])){if(!(e=Hr(b[r>>2],a,t)))break a;C(0|i)}if(r=0|R(),1!=(0|e)){t:{o:{b:{k:{u:{c:{s:{A:{l:{v:{d:{if(!u){if(b[611]=0,M(26,0|s,1),e=b[611],b[611]=0,!e)break v;if(!(r=b[612]))break v;if(Hr(b[e>>2],a,t))break d;break e}if(e=b[f+8>>2],k[f+60|0])break c;if(k[f+81|0]){if(b[611]=0,c=0|L(28,0|e,1,1),r=b[611],b[611]=0,i=-1,!r)break s;if(!(u=b[612]))break s;if(i=Hr(b[r>>2],a,t))break l;break f}if(b[611]=0,c=0|I(29,0|e),r=b[611],b[611]=0,i=-1,!r)break s;if(!(u=b[612]))break s;if(i=Hr(b[r>>2],a,t))break A;break f}C(0|r)}r=0|R();continue}C(0|u);break s}C(0|u)}if(r=0|R(),1==(0|i))continue;s:{A:{l:{v:{d:{h:{p:{if(!c){if(b[611]=0,M(26,0|s,1),e=b[611],b[611]=0,!e)break h;if(!(r=b[612]))break h;if(Hr(b[e>>2],a,t))break p;break e}if(!(15!=b[f+88>>2]|12!=b[f+100>>2]|13!=b[f+96>>2]|14!=b[f+92>>2]||3!=b[f+1716>>2]|6!=b[f+1728>>2]|5!=b[f+1724>>2]||4!=b[f+1720>>2]))break s;if(k[f+81|0]){if(b[611]=0,M(30,0|f,0|e),r=b[611],b[611]=0,i=-1,!r)break v;if(!(c=b[612]))break v;if(i=Hr(b[r>>2],a,t))break d;break i}if(b[611]=0,M(31,0|f,0|e),r=b[611],b[611]=0,i=-1,!r)break A;if(!(c=b[612]))break A;if(i=Hr(b[r>>2],a,t))break l;break i}C(0|r)}r=0|R();continue}C(0|c)}if(r=0|R(),1==(0|i))continue;break s}C(0|c)}if(r=0|R(),1==(0|i))continue}if(16!=b[f+104>>2]){if(b[611]=0,nr(e),r=b[611],b[611]=0,i=-1,!r)break k;if(!(c=b[612]))break k;if(i=Hr(b[r>>2],a,t))break u;break i}}if(b[611]=0,Pr(e),r=b[611],b[611]=0,e=-1,!r)break o;if(!(i=b[612]))break o;if(e=Hr(b[r>>2],a,t))break b;break a}C(0|c)}if(r=0|R(),1!=(0|i))break t;continue}C(0|i)}if(r=0|R(),1==(0|e))continue;b[f+8>>2]=0,b[f+1896>>2]=0;break r}if(r=b[f+104>>2],b[611]=0,_(0|r,0|e),r=b[611],b[611]=0,e=-1,r&&(i=b[612])){if(!(e=Hr(b[r>>2],a,t)))break a;C(0|i)}if(r=0|R(),1!=(0|e))break}}}b[f+1896>>2]=0,b[f+8>>2]=0;break r}Zr(r,i),E()}Zr(r,c),E()}Zr(r,u),E()}Zr(e,r),E()}return Y(a),b[b[608]+4>>2]}function H(r,e){var f=m(0),i=m(0),a=0,t=m(0),o=m(0),u=0,c=0,s=m(0),A=0,l=0,v=0,p=m(0),w=m(0),y=m(0),C=0,R=0,M=0,I=0,_=0,S=0,P=0,x=0,L=0,j=m(0),B=0,T=m(0);U=u=U-144|0,L=b[b[b[e+4>>2]+8>>2]>>2],P=b[L>>2],M=b[P+16>>2],_=b[b[P+4>>2]+16>>2],S=b[e>>2],I=b[b[S+4>>2]+16>>2],C=b[S+16>>2],pr(I,b[r+72>>2],C)>m(0)&&(f=d[I+28>>2],i=d[I+32>>2],a=b[r+72>>2],t=d[a+28>>2],o=d[a+32>>2],s=d[C+28>>2],h[u+40>>3]=d[C+32>>2],h[u+32>>3]=s,h[u+24>>3]=o,h[u+16>>3]=t,h[u+8>>3]=i,h[u>>3]=f,Gr(1098,u));r:{e:{f:if((0|C)!=(0|M)&&!((w=(f=d[C+32>>2])<=(i=d[I+32>>2])?f:i)>((i=d[M+32>>2])>=(t=d[_+32>>2])?i:t))){i:{if(!(!(f<=i)|(t=d[C+28>>2])!=(o=d[M+28>>2]))||tm(0)))break i;break f}if(pr(I,M,C)>2])<(i=d[C+28>>2])|(d[A+32>>2]<=d[l+32>>2]?f==i:0)?(c=l,l=A):c=A,(f=d[a+28>>2])>(i=d[v+28>>2])|(d[v+32>>2]<=d[a+32>>2]?f==i:0)?(f=i,A=a,a=v):A=v,f>(i=d[l+28>>2])|(d[l+32>>2]<=d[a+32>>2]?f==i:0)?(i=f,v=A,R=a,A=c,a=l):(v=c,R=l),c=u;i:if((o=d[A+28>>2])>i|(d[R+32>>2]<=d[A+32>>2]?i==o:0))if(p=d[v+28>>2],!(d[A+32>>2]<=d[v+32>>2])|o!=p&&!(p>o))if(i=pr(a,R,A),f=pr(a,v,A),l=m(i-f)>2],s=d[v+28>>2],f=m(m(o+s)*m(.5)),i==m(0))break i;f=m(o+m(m(t/m(t+i))*m(s-o)))}else f=d[v+28>>2],f=m(f+m(m(i/m(t+i))*m(d[R+28>>2]-f)));else{if(f=m(0),s=m(o-i),t=m(i-d[a+28>>2]),(w=m(s+t))>m(0)&&(f=d[((l=t>2],f=m(m(d[R+32>>2]-f)+m(m((l?t:s)/w)*m(f-d[(l?A:a)+32>>2])))),j=m(-f),w=f,p=m(p-o),(t=m(s+p))>m(0)&&(y=d[((l=s>2],y=m(m(d[A+32>>2]-y)+m(m((l?s:p)/t)*m(y-d[(l?v:R)+32>>2])))),l=m(f+y)>2]=f,(f=d[a+32>>2])<(i=d[A+32>>2])|(d[a+28>>2]<=d[A+28>>2]?f==i:0)?(c=A,A=a):c=a,(i=d[v+32>>2])>(f=d[R+32>>2])|(d[R+28>>2]<=d[v+28>>2]?f==i:0)?(i=f,a=v,v=R):a=R,(f=d[A+32>>2])>2]<=d[v+28>>2]?f==i:0)?(R=a,l=v,a=c,v=A):(R=c,l=A);i:{a:if((o=d[l+32>>2])<(s=d[a+32>>2])|(d[l+28>>2]<=d[a+28>>2]?o==s:0)){if(y=d[R+32>>2],!(!(d[a+28>>2]<=d[R+28>>2])|s!=y)||y>s){if(f=m(0),i=m(0),p=m(s-o),t=m(o-d[v+32>>2]),(w=m(p+t))>m(0)&&(i=d[((c=t>2],i=m(m(d[l+28>>2]-i)+m(m((c?t:p)/w)*m(i-d[(c?a:v)+28>>2])))),T=m(-i),w=i,y=m(y-s),(t=m(p+y))>m(0)&&(j=d[a+28>>2],f=d[((a=p>2],f=m(m(j-f)+m(m((a?p:y)/t)*m(f-d[(a?R:l)+28>>2])))),a=m(i+f)>2]=o+m(p*m(i/m(i+f)));break i}d[u+88>>2]=s+m(m(o-s)*m(f/m(i+f)));break i}if(f=m(0),i=m(0),t=m(s-o),p=d[v+32>>2],w=m(o-p),m(t+w)>m(0)&&(i=d[l+28>>2],i=m(m(w*m(i-d[a+28>>2]))+m(t*m(i-d[v+28>>2])))),w=m(-i),t=i,s=m(s-y),p=m(y-p),m(s+p)>m(0)&&(f=d[R+28>>2],f=m(m(p*m(f-d[a+28>>2]))+m(s*m(f-d[v+28>>2])))),a=m(i-f)>2]=m(o+y)*m(.5);break i}d[u+88>>2]=o+m(m(y-o)*m(i/m(i+f)));break i}d[u+88>>2]=y+m(m(o-y)*m(f/m(i+f)));break i}d[u+88>>2]=m(o+s)*m(.5)}f=d[u+84>>2],c=b[r+72>>2];i:{if(f<(t=d[c+28>>2]))i=d[c+32>>2];else{if(f!=t)break i;if(!((i=d[c+32>>2])>=d[u+88>>2]))break i}d[u+88>>2]=i,d[u+84>>2]=t,f=t}A=a=C,(i=t=d[a+28>>2])<(o=d[M+28>>2])||t==o&&(i=t,A=C,d[a+32>>2]<=d[M+32>>2])||(i=o,A=M),a=A;i:{if(f>i)o=d[a+32>>2];else{if(f!=i)break i;if(!((o=d[a+32>>2])<=d[u+88>>2]))break i}d[u+88>>2]=o,d[u+84>>2]=i,t=d[C+28>>2],f=i}if(d[M+28>>2]!=f|d[u+88>>2]!=d[M+32>>2]&&(d[u+88>>2]!=d[C+32>>2]||f!=t)){i:{f=d[c+28>>2];a:{if(d[I+32>>2]!=d[c+32>>2]||f!=d[I+28>>2]){if(pr(I,c,u+56|0)>=m(0))break a;c=b[r+72>>2],f=d[c+28>>2]}if(d[_+32>>2]==d[c+32>>2]&&f==d[_+28>>2])break i;if(!(pr(_,c,u+56|0)<=m(0)))break i}if((0|(a=b[r+72>>2]))==(0|_)){if(!ir(b[S+4>>2]))break r;if(!tr(b[P+4>>2],S))break r;for(a=b[b[e>>2]+16>>2];e=b[b[b[e+4>>2]+4>>2]>>2],A=b[e>>2],(0|a)==b[A+16>>2];);if(c=e,k[e+15|0]&&(c=0,(a=er(b[b[b[b[b[e+4>>2]+8>>2]>>2]>>2]+4>>2],b[A+12>>2]))&&rr(b[e>>2])&&(b[e>>2]=a,n[e+15|0]=0,b[a+24>>2]=e,c=b[b[b[e+4>>2]+4>>2]>>2])),!c)break r;a=b[b[b[c+4>>2]+8>>2]>>2],e=b[a>>2],mr(r,a,L),B=1,ar(r,c,b[b[e+4>>2]+12>>2],e,e,1);break f}if((0|a)==(0|I)){if(!ir(b[P+4>>2]))break r;if(!tr(b[S+12>>2],b[b[P+4>>2]+12>>2]))break r;for(c=b[b[b[e>>2]+4>>2]+16>>2],a=e;a=b[b[b[a+4>>2]+4>>2]>>2],(0|c)==b[b[b[a>>2]+4>>2]+16>>2];);c=b[b[b[b[b[b[a+4>>2]+8>>2]>>2]>>2]+4>>2]+8>>2],b[e>>2]=b[b[P+4>>2]+12>>2],B=1,ar(r,a,b[mr(r,e,0)+8>>2],b[b[S+4>>2]+8>>2],c,1);break f}if(pr(I,a,u+56|0)>=m(0)){if(n[e+14|0]=1,n[b[b[b[e+4>>2]+4>>2]>>2]+14|0]=1,!ir(b[S+4>>2]))break r;c=b[S+16>>2],a=b[r+72>>2],d[c+28>>2]=d[a+28>>2],d[c+32>>2]=d[a+32>>2]}else a=b[r+72>>2];if(!(pr(_,a,u+56|0)<=m(0)))break f;if(n[L+14|0]=1,n[e+14|0]=1,!ir(b[P+4>>2]))break r;e=b[P+16>>2],r=b[r+72>>2],d[e+28>>2]=d[r+28>>2],d[e+32>>2]=d[r+32>>2];break f}if(!ir(b[S+4>>2]))break r;if(!ir(b[P+4>>2]))break r;if(!tr(b[b[P+4>>2]+12>>2],S))break r;if(a=b[S+16>>2],d[a+28>>2]=d[u+84>>2],d[a+32>>2]=d[u+88>>2],c=or(b[r+68>>2],a),a=b[S+16>>2],b[a+36>>2]=c,2147483647==(0|c))break e;b[u+112>>2]=b[C+12>>2],b[u+116>>2]=b[I+12>>2],b[u+120>>2]=b[M+12>>2],b[u+124>>2]=b[_+12>>2],b[a+24>>2]=0,b[a+16>>2]=0,b[a+20>>2]=0,f=d[a+28>>2],w=(i=m(d[I+28>>2]-f))>2],t=m(d[I+32>>2]-i),o=m(w+(t>2]-f))>2]-i),s=m(w+(t>2]=t,o=m(.5*+s/x),d[u+100>>2]=o,s=m(m(m(d[C+16>>2]*t)+m(d[I+16>>2]*o))+m(0)),d[a+16>>2]=s,y=m(m(m(d[C+20>>2]*t)+m(d[I+20>>2]*o))+m(0)),d[a+20>>2]=y,o=m(m(m(d[C+24>>2]*t)+m(d[I+24>>2]*o))+m(0)),d[a+24>>2]=o,w=(t=m(d[M+28>>2]-f))>2]-i),t=m(w+(t>2]-f))>2]-i),f=m(w+(f>2]=f,i=m(.5*+t/x),d[u+108>>2]=i,t=m(s+m(m(d[M+16>>2]*f)+m(d[_+16>>2]*i))),d[a+16>>2]=t,s=m(y+m(m(d[M+20>>2]*f)+m(d[_+20>>2]*i))),d[a+20>>2]=s,f=m(o+m(m(d[M+24>>2]*f)+m(d[_+24>>2]*i))),d[a+24>>2]=f,d[u+140>>2]=f,d[u+136>>2]=s,d[u+132>>2]=t,b[a+12>>2]=0,a=a+12|0,8==(0|(c=b[r+1736>>2]))?be[b[r+76>>2]](u+132|0,u+112|0,u+96|0,a):be[0|c](u+132|0,u+112|0,u+96|0,a,b[r+1896>>2]),b[a>>2]|k[r+60|0]||(11==(0|(a=b[r+1732>>2]))?be[b[r+12>>2]](100156):be[0|a](100156,b[r+1896>>2]),n[r+60|0]=1),n[L+14|0]=1,n[e+14|0]=1,n[b[b[b[e+4>>2]+4>>2]>>2]+14|0]=1}else G(r,e)}return U=u+144|0,B}Kr(b[r+68>>2]),b[r+68>>2]=0}Zr(r+1740|0,1),E()}function Q(r){r|=0;var e=0,f=0,i=0,a=0,t=0,o=0,k=0,u=0,c=m(0),s=m(0),A=0,l=0,v=0,h=0,w=0,y=0,g=0,C=0,R=0,M=0;U=t=U-48|0,n[r+60|0]=0;r:{if(f=b[r+8>>2],(0|(e=b[f+64>>2]))!=(0|(k=f- -64|0)))for(;;){f=b[e+12>>2],a=b[e>>2],o=b[e+16>>2],i=b[b[e+4>>2]+16>>2];e:{if(!(d[o+28>>2]!=d[i+28>>2]|d[o+32>>2]!=d[i+32>>2]|b[f+12>>2]==(0|e))){b[t+24>>2]=0,b[t+28>>2]=0,b[t+16>>2]=0,b[t+20>>2]=0,i=b[287],b[t+8>>2]=b[286],b[t+12>>2]=i,i=b[285],b[t>>2]=b[284],b[t+4>>2]=i,i=b[f+16>>2],b[t+16>>2]=b[i+12>>2],b[t+20>>2]=b[o+12>>2],d[t+36>>2]=d[i+16>>2],d[t+40>>2]=d[i+20>>2],d[t+44>>2]=d[i+24>>2],b[i+12>>2]=0,i=i+12|0,8==(0|(o=b[r+1736>>2]))?be[b[r+76>>2]](t+36|0,t+16|0,t,i):be[0|o](t+36|0,t+16|0,t,i,b[r+1896>>2]),b[i>>2]||(b[i>>2]=b[t+16>>2]);f:{if(tr(f,e)){if(!rr(e))break f;i=b[f+12>>2];break e}break r}break r}i=f,f=e}if(b[i+12>>2]==(0|f)){if((0|f)!=(0|i)&&(a=b[a+4>>2]!=(0|i)&&(0|i)!=(0|a)?a:b[a>>2],!rr(i)))break r;if(e=(0|f)==(0|a)|b[a+4>>2]==(0|f)?b[a>>2]:a,!rr(f))break r}else e=a;if((0|e)==(0|k))break}a=r,(e=O(28))?(i=e,(f=O(28))?(b[f+8>>2]=0,b[f+12>>2]=32,o=O(132),b[f>>2]=o,o?(k=O(264),b[f+4>>2]=k,k?(b[f+24>>2]=9,b[f+16>>2]=0,b[f+20>>2]=0,b[o+4>>2]=1,b[k+8>>2]=0):(Y(o),Y(f),f=0)):(Y(f),f=0)):f=0,b[i>>2]=f,f?(i=O(128),b[e+4>>2]=i,i?(b[e+24>>2]=9,b[e+20>>2]=0,b[e+12>>2]=0,b[e+16>>2]=32):(Y(b[f+4>>2]),Y(b[f>>2]),Y(f),Y(e),e=0)):(Y(e),e=0)):e=0,v=e,b[a+68>>2]=e;e:if(e){f:{f=b[r+8>>2];i:{if((0|(e=b[f>>2]))!=(0|f))for(;;){if(a=or(v,e),b[e+36>>2]=a,2147483647==(0|a))break i;if((0|f)==(0|(e=b[e>>2])))break}if(U=y=U-400|0,a=O(4+(e=(w=b[v+12>>2])<<2)|0),b[v+8>>2]=a,U=y+400|0,a){if(!((o=(e+a|0)-4|0)>>>0>>0)){if(f=b[v+4>>2],i=1+((k=(w<<2)-4|0)>>>2|0)&7)for(e=a;b[e>>2]=f,e=e+4|0,f=f+4|0,i=i-1|0;);else e=a;if(!(k>>>0<28))for(;b[e>>2]=f,b[e+28>>2]=f+28,b[e+24>>2]=f+24,b[e+20>>2]=f+20,b[e+16>>2]=f+16,b[e+12>>2]=f+12,b[e+8>>2]=f+8,b[e+4>>2]=f+4,f=f+32|0,o>>>0>=(e=e+32|0)>>>0;);}for(b[y+4>>2]=o,b[y>>2]=a,g=2016473283,u=1;;){if((A=b[((u<<3)+y|0)-4>>2])>>>0>(k=b[(h<<3)+y>>2])+40>>>0)for(;;){for(g=p(g,1539415821)+1|0,R=b[(e=((g>>>0)%(1+(A-k>>2)>>>0)<<2)+k|0)>>2],b[e>>2]=b[k>>2],b[k>>2]=R,i=A+4|0,f=k-4|0;;){a=i,l=b[f+4>>2],o=f,e=f+4|0,i=b[l>>2],c=d[i+28>>2],C=b[R>>2],u=e;a:if(!(c<(s=d[C+28>>2]))){for(;;){if(f=e,u=e,d[i+32>>2]<=d[C+32>>2]&&c==s)break a;if(e=f+4|0,o=f,l=b[f+4>>2],i=b[l>>2],s>(c=d[i+28>>2]))break}u=e}f=u,u=b[(i=a-4|0)>>2],e=b[u>>2];a:if(!(s<(c=d[e+28>>2])))for(;;){if(!(!(d[C+32>>2]<=d[e+32>>2])|c!=s))break a;if(a=i,u=b[(i=i-4|0)>>2],e=b[u>>2],s<(c=d[e+28>>2]))break}if(b[f>>2]=u,b[i>>2]=l,!(f>>>0>>0))break}if(e=b[f>>2],b[f>>2]=l,b[i>>2]=e,(f-k|0)<(A-i|0)?(e=a,i=A,A=o):(e=k,i=o,k=a),b[4+(f=(h<<3)+y|0)>>2]=i,b[f>>2]=e,h=h+1|0,!(k+40>>>0>>0))break}if(u=h,A>>>0>=(a=k+4|0)>>>0)for(;;){i=b[a>>2],f=e=a;a:if(!(k>>>0>=e>>>0))for(;;){if(o=b[i>>2],c=d[o+28>>2],h=b[(f=e-4|0)>>2],l=b[h>>2],c<(s=d[l+28>>2])){f=e;break a}if(!(!(d[o+32>>2]<=d[l+32>>2])|c!=s)){f=e;break a}if(b[e>>2]=h,!(k>>>0<(e=f)>>>0))break}if(b[f>>2]=i,!(A>>>0>=(a=a+4|0)>>>0))break}if(h=u-1|0,!((0|u)>=1))break}if(b[v+20>>2]=1,b[v+16>>2]=w,v=b[v>>2],(0|(a=b[v+8>>2]))>=1)for(A=b[v+4>>2],k=b[v>>2],f=a;;){for(i=f,u=A+((h=b[k+(f<<2)>>2])<<3)|0,e=f;(0|a)<=(0|(f=e<<1))||(l=b[A+(b[k+((o=1|f)<<2)>>2]<<3)>>2],c=d[l+28>>2],w=b[A+(b[k+(f<<2)>>2]<<3)>>2],s=d[w+28>>2],!(d[l+32>>2]<=d[w+32>>2])|c!=s&&!(c(0|a)||(o=b[u>>2],c=d[o+28>>2],l=b[k+(f<<2)>>2],g=b[(w=A+(l<<3)|0)>>2],c<(s=d[g+28>>2])|(d[o+32>>2]<=d[g+32>>2]?c==s:0)));)b[k+(e<<2)>>2]=l,b[w+4>>2]=e,e=f;if(b[k+(e<<2)>>2]=h,b[u+4>>2]=e,f=i-1|0,!((0|i)>1))break}b[v+20>>2]=1,e=1}else e=0;if(e)break f}Kr(b[r+68>>2]),b[r+68>>2]=0;break e}if(f=r- -64|0,(e=O(20))?(b[e+16>>2]=10,b[e+12>>2]=r,b[e>>2]=0,b[e+8>>2]=e,b[e+4>>2]=e):e=0,b[f>>2]=e,!e)break r;if(Sr(r,m(-3999999973526325e22)),Sr(r,m(3999999973526325e22)),f=Ir(b[r+68>>2]))for(;;){f:if(e=xr(b[r+68>>2]))for(;;){if(d[e+28>>2]!=d[f+28>>2]|d[e+32>>2]!=d[f+32>>2])break f;if(a=b[Ir(b[r+68>>2])+8>>2],i=b[f+8>>2],b[t+24>>2]=0,b[t+28>>2]=0,b[t+16>>2]=0,b[t+20>>2]=0,e=b[287],b[t+8>>2]=b[286],b[t+12>>2]=e,e=b[285],b[t>>2]=b[284],b[t+4>>2]=e,e=b[i+16>>2],b[t+16>>2]=b[e+12>>2],b[t+20>>2]=b[b[a+16>>2]+12>>2],d[t+36>>2]=d[e+16>>2],d[t+40>>2]=d[e+20>>2],d[t+44>>2]=d[e+24>>2],b[e+12>>2]=0,e=e+12|0,8==(0|(o=b[r+1736>>2]))?be[b[r+76>>2]](t+36|0,t+16|0,t,e):be[0|o](t+36|0,t+16|0,t,e,b[r+1896>>2]),b[e>>2]||(b[e>>2]=b[t+16>>2]),!tr(i,a))break r;if(!(e=xr(b[r+68>>2])))break}if(z(r,f),!(f=Ir(b[r+68>>2])))break}if(e=b[b[b[(a=r- -64|0)>>2]+4>>2]>>2],f=b[e>>2],b[r+72>>2]=b[f+16>>2],b[f+24>>2]=0,Vr(b[e+4>>2]),Y(e),f=b[a>>2],e=b[b[f+4>>2]>>2])for(;b[b[e>>2]+24>>2]=0,Vr(b[e+4>>2]),Y(e),f=b[a>>2],e=b[b[f+4>>2]>>2];);if((0|f)!=(0|(e=b[f+4>>2])))for(;Y(e),(0|f)!=(0|(e=b[e+4>>2])););if(Y(f),Kr(b[r+68>>2]),M=1,r=b[r+8>>2],(0|(f=b[r+40>>2]))!=(0|(a=r+40|0)))for(;;){if(r=b[f+8>>2],f=b[f>>2],(0|r)==b[b[r+12>>2]+12>>2]&&(e=b[r+8>>2],b[e+28>>2]=b[e+28>>2]+b[r+28>>2],e=b[e+4>>2],b[e+28>>2]=b[e+28>>2]+b[b[r+4>>2]+28>>2],!rr(r))){M=0;break e}if((0|f)==(0|a))break}}return U=t+48|0,0|M}Zr(r+1740|0,1),E()}function W(r,e,f,i,a,t){var u=0,c=0,s=0,A=0,l=0,v=0,d=0,m=0,w=0,y=0,g=0,E=0,C=0,R=0,M=0,I=0,_=0;U=c=U-80|0,b[c+76>>2]=e,M=c+55|0,C=c+56|0,e=0;r:{e:for(;;){(0|w)<0||((2147483647-w|0)<(0|e)?(b[613]=61,w=-1):w=e+w|0);f:{i:{a:{if(l=b[c+76>>2],u=k[0|(e=l)])for(;;){n:{t:if(u&=255){if(37!=(0|u))break n;for(u=e;;){if(37!=k[e+1|0])break t;if(s=e+2|0,b[c+76>>2]=s,u=u+1|0,v=k[e+2|0],e=s,37!=(0|v))break}}else u=e;if(e=u-l|0,r&&yr(r,l,e),e)continue e;g=-1,u=1,s=c,e=b[c+76>>2],36!=k[e+2|0]|n[b[c+76>>2]+1|0]-48>>>0>=10||(g=n[e+1|0]-48|0,R=1,u=3),e=u+e|0,b[s+76>>2]=e,y=0;t:if((s=(A=n[0|e])-32|0)>>>0>31)u=e;else if(u=e,75913&(s=1<>2]=u,y|=s,(s=(A=n[e+1|0])-32|0)>>>0>=32)break t;if(e=u,!(75913&(s=1<>2]}else{if(s=c,n[u+1|0]-48>>>0>=10||(e=b[c+76>>2],36!=k[e+2|0])){if(R)break a;R=0,d=0,r&&(e=b[f>>2],b[f>>2]=e+4,d=b[e>>2]),e=b[c+76>>2]+1|0}else b[((n[e+1|0]<<2)+a|0)-192>>2]=10,d=b[((n[e+1|0]<<3)+i|0)-384>>2],R=1,e=e+3|0;if(b[s+76>>2]=e,(0|d)>-1)break t;d=0-d|0,y|=8192}v=-1;t:if(46==k[0|e])if(42!=k[e+1|0])b[c+76>>2]=e+1,v=Wr(c+76|0),e=b[c+76>>2];else{if(!(n[e+2|0]-48>>>0>=10)&&(e=b[c+76>>2],36==k[e+3|0])){b[((n[e+2|0]<<2)+a|0)-192>>2]=10,v=b[((n[e+2|0]<<3)+i|0)-384>>2],e=e+4|0,b[c+76>>2]=e;break t}if(R)break a;r?(e=b[f>>2],b[f>>2]=e+4,v=b[e>>2]):v=0,e=b[c+76>>2]+2|0,b[c+76>>2]=e}for(u=0;;){if(E=u,m=-1,n[0|e]-65>>>0>57)break r;if(A=e+1|0,b[c+76>>2]=A,u=n[0|e],e=A,!((u=k[1103+(u+p(E,58)|0)|0])-1>>>0<8))break}t:{o:{if(19!=(0|u)){if(!u)break r;if((0|g)>=0){b[(g<<2)+a>>2]=u,u=b[4+(e=(g<<3)+i|0)>>2],b[c+64>>2]=b[e>>2],b[c+68>>2]=u;break o}if(!r)break f;hr(c- -64|0,u,f),A=b[c+76>>2];break t}if((0|g)>-1)break r}if(e=0,!r)continue e}s=-65537&y,u=8192&y?s:y,m=0,g=1024,y=C;t:{o:{b:{k:{u:{c:{s:{A:{l:{v:{d:{h:{p:{m:{w:{switch(e=n[A-1|0],(e=E&&3==(15&e)?-33&e:e)-88|0){case 11:break t;case 9:case 13:case 14:case 15:break o;case 27:break s;case 12:case 17:break v;case 23:break d;case 0:case 32:break h;case 24:break p;case 22:break m;case 29:break w;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break i}switch(e-65|0){case 0:case 4:case 5:case 6:break o;case 2:break u;case 1:case 3:break i}if(83==(0|e))break c;break i}A=b[c+64>>2],s=b[c+68>>2],g=1024;break l}e=0;m:switch(255&E){case 0:case 1:case 6:b[b[c+64>>2]>>2]=w;continue e;case 2:u=b[c+64>>2],b[u>>2]=w,b[u+4>>2]=w>>31;continue e;case 3:o[b[c+64>>2]>>1]=w;continue e;case 4:n[b[c+64>>2]]=w;continue e;case 7:break m;default:continue e}u=b[c+64>>2],b[u>>2]=w,b[u+4>>2]=w>>31;continue e}v=v>>>0>8?v:8,u|=8,e=120}if(l=C,I=32&e,(s=E=b[c+68>>2])|(A=b[c+64>>2]))for(;n[0|(l=l-1|0)]=I|k[1632+(15&A)|0],_=!s&A>>>0>15|0!=(0|s),E=s,s=s>>>4|0,A=(15&E)<<28|A>>>4,_;);if(!(b[c+64>>2]|b[c+68>>2])|!(8&u))break A;g=1024+(e>>>4|0)|0,m=2;break A}if(e=C,(s=l=b[c+68>>2])|(A=b[c+64>>2]))for(;n[0|(e=e-1|0)]=7&A|48,E=!s&A>>>0>7|0!=(0|s),l=s,s=s>>>3|0,A=(7&l)<<29|A>>>3,E;);if(l=e,!(8&u))break A;v=(0|(e=C-l|0))<(0|v)?v:e+1|0;break A}s=e=b[c+68>>2],A=b[c+64>>2],(0|e)<-1||(0|e)<=-1?(s=0-(s+(0!=(0|A))|0)|0,A=0-A|0,b[c+64>>2]=A,b[c+68>>2]=s,m=1,g=1024):2048&u?(m=1,g=1025):g=(m=1&u)?1026:1024}l=jr(A,s,C)}if(u=(0|v)>-1?-65537&u:u,s=e=b[c+68>>2],!(v|0!=(0|(A=b[c+64>>2]))|0!=(0|e))){v=0,l=C;break i}v=(0|(e=!(s|A)+(C-l|0)|0))<(0|v)?v:e;break i}y=0!=(0|(e=v));s:{A:{l:{v:if(!(!(3&(u=l=(u=b[c+64>>2])||1071))|!e))for(;;){if(!k[0|u])break l;if(y=0!=(0|(e=e-1|0)),!(3&(u=u+1|0)))break v;if(!e)break}if(!y)break A}l:if(!(!k[0|u]|e>>>0<4))for(;;){if((-1^(A=b[u>>2]))&A-16843009&-2139062144)break l;if(u=u+4|0,!((e=e-4|0)>>>0>3))break}if(e)for(;;){if(A=u,!k[0|u])break s;if(u=u+1|0,!(e=e-1|0))break}}A=0}y=A||v+l|0,u=s,v=A?A-l|0:v;break i}if(s=b[c+64>>2],v)break k;e=0,Dr(r,32,d,0,u);break b}b[c+12>>2]=0,b[c+8>>2]=b[c+64>>2],b[c+64>>2]=c+8,v=-1,s=c+8|0}e=0;k:{for(;;){if(!(l=b[s>>2]))break k;if(!((A=(0|(l=Cr(c+4|0,l)))<0)|l>>>0>v-e>>>0)){if(s=s+4|0,v>>>0>(e=e+l|0)>>>0)continue;break k}break}if(m=-1,A)break r}if(Dr(r,32,d,e,u),e)for(s=0,A=b[c+64>>2];;){if(!(l=b[A>>2]))break b;if((0|(s=(l=Cr(c+4|0,l))+s|0))>(0|e))break b;if(yr(r,c+4|0,l),A=A+4|0,!(e>>>0>s>>>0))break}else e=0}Dr(r,32,d,e,8192^u),e=(0|e)<(0|d)?d:e;continue e}e=0|be[0|t](r,h[c+64>>3],d,v,u,e);continue e}n[c+55|0]=b[c+64>>2],v=1,l=M,u=s;break i}s=e+1|0,b[c+76>>2]=s,u=k[e+1|0],e=s}if(m=w,r)break r;if(!R)break f;for(e=1;;){if(r=b[(e<<2)+a>>2]){if(hr((e<<3)+i|0,r,f),m=1,10!=(0|(e=e+1|0)))continue;break r}break}if(m=1,e>>>0>=10)break r;for(;;){if(b[(e<<2)+a>>2])break a;if(10==(0|(e=e+1|0)))break}break r}m=-1;break r}Dr(r,32,e=(0|(s=(v=(0|(A=y-l|0))>(0|v)?A:v)+m|0))>(0|d)?s:d,s,u),yr(r,g,m),Dr(r,48,e,s,65536^u),Dr(r,48,v,A,0),yr(r,l,A),Dr(r,32,e,s,8192^u);continue}break}m=0}return U=c+80|0,m}function q(r,e,f,i,a,t){r|=0,e=+e,f|=0,i|=0,a|=0,t|=0;var o=0,c=0,s=0,l=0,v=0,d=0,h=0,m=0,y=0,g=0,E=0,C=0,R=0,M=0,I=0,_=0,S=0,P=0,x=0,L=0,j=0;U=l=U-560|0,b[l+44>>2]=0,A(+e),o=0|u(1),u(0),(0|o)<-1||(0|o)<=-1?(I=1,_=1034,A(+(e=-e)),o=0|u(1),u(0)):2048&a?(I=1,_=1037):(_=(I=1&a)?1040:1035,j=!I);r:if(2146435072!=(2146435072&o)){R=l+16|0;e:{f:{i:{if(e=Tr(e,l+44|0),0!=(e+=e)){if(o=b[l+44>>2],b[l+44>>2]=o-1,97!=(0|(S=32|t)))break i;break e}if(97==(0|(S=32|t)))break e;v=b[l+44>>2],h=(0|i)<0?6:i;break f}v=o-29|0,b[l+44>>2]=v,e*=268435456,h=(0|i)<0?6:i}for(c=E=(0|v)<0?l+48|0:l+336|0;o=e<4294967296&e>=0?~~e>>>0:0,b[(i=c)>>2]=o,c=c+4|0,0!=(e=1e9*(e-+(o>>>0))););if((0|v)<1)i=v,o=c,s=E;else for(s=E,i=v;;){if(C=(0|i)<29?i:29,!(s>>>0>(o=c-4|0)>>>0)){for(i=C,y=0;g=o,m=0,x=y,y=b[o>>2],d=31&i,(63&i)>>>0>=32?(L=y<>>32-d,d=y<>>0>(y=x+d|0)>>>0?m+1|0:m,x=g,g=Or(y=sr(d=y,m,1e9),F,1e9,0),b[x>>2]=d-g,s>>>0<=(o=o-4|0)>>>0;);(i=y)&&(b[(s=s-4|0)>>2]=i)}for(;s>>>0<(o=c)>>>0&&!b[(c=o-4|0)>>2];);if(i=b[l+44>>2]-C|0,b[l+44>>2]=i,c=o,!((0|i)>0))break}if(c=(h+25|0)/9|0,(0|i)<=-1)for(C=c+1|0,P=102==(0|S);;){y=(0|i)<-9?9:0-i|0;f:if(o>>>0>s>>>0){for(g=1e9>>>y|0,d=-1<>2],b[c>>2]=x+(i>>>y|0),i=p(g,i&d),(c=c+4|0)>>>0>>0;);if(s=b[s>>2]?s:s+4|0,!i)break f;b[o>>2]=i,o=o+4|0}else s=b[s>>2]?s:s+4|0;if(i=b[l+44>>2]+y|0,b[l+44>>2]=i,o=(0|C)>2?c+(C<<2)|0:o,!((0|i)<0))break}if(c=0,!(o>>>0<=s>>>0||(c=p(E-s>>2,9),i=10,(d=b[s>>2])>>>0<10)))for(;c=c+1|0,d>>>0>=(i=p(i,10))>>>0;);if((0|(i=(h-(102==(0|S)?0:c)|0)-(103==(0|S)&0!=(0|h))|0))<(p(o-E>>2,9)-9|0)){if(m=(((d=(0|(g=i+9216|0))/9|0)<<2)+((0|v)<0?l+48|4:l+340|0)|0)-4096|0,i=10,(0|(g=g-p(d,9)|0))<=7)for(;i=p(i,10),8!=(0|(g=g+1|0)););if(C=(g=b[m>>2])-p(i,d=(g>>>0)/(i>>>0)|0)|0,((0|(v=m+4|0))!=(0|o)||C)&&(e=(0|o)==(0|v)?1:1.5,M=(v=i>>>1|0)>>>0>C>>>0?.5:(0|v)==(0|C)?e:1.5,e=1&d?9007199254740994:9007199254740992,45!=k[0|_]|j||(M=-M,e=-e),v=g-C|0,b[m>>2]=v,e+M!=e)){if(i=i+v|0,b[m>>2]=i,i>>>0>=1e9)for(;b[m>>2]=0,(m=m-4|0)>>>0>>0&&(b[(s=s-4|0)>>2]=0),i=b[m>>2]+1|0,b[m>>2]=i,i>>>0>999999999;);if(c=p(E-s>>2,9),i=10,!((v=b[s>>2])>>>0<10))for(;c=c+1|0,v>>>0>=(i=p(i,10))>>>0;);}o=(i=m+4|0)>>>0>>0?i:o}for(;d=o,!(v=o>>>0<=s>>>0)&&!b[(o=d-4|0)>>2];);if(103==(0|S)){if(h=((i=(0|(o=h||1))>(0|c)&(0|c)>-5)?-1^c:-1)+o|0,t=(i?-1:-2)+t|0,!(y=8&a)){if(o=-9,!v&&(v=b[d-4>>2])&&(g=10,o=0,!((v>>>0)%10|0))){for(;i=o,o=o+1|0,!((v>>>0)%((g=p(g,10))>>>0)|0););o=-1^i}i=p(d-E>>2,9),70!=(-33&t)?(y=0,h=(0|(i=(0|(i=((i+c|0)+o|0)-9|0))>0?i:0))>(0|h)?h:i):(y=0,h=(0|(i=(0|(i=(i+o|0)-9|0))>0?i:0))>(0|h)?h:i)}}else y=8&a;if(C=0!=(h|y),i=r,v=f,70==(0|(g=-33&t)))t=(0|c)>0?c:0;else{if((R-(o=jr((o=c>>31)+c^o,0,R))|0)<=1)for(;n[0|(o=o-1|0)]=48,(R-o|0)<2;);n[0|(P=o-2|0)]=t,n[o-1|0]=(0|c)<0?45:43,t=R-P|0}Dr(i,32,v,m=1+(t+(C+(h+I|0)|0)|0)|0,a),yr(r,_,I),Dr(r,48,f,m,65536^a);f:{i:{a:{if(70==(0|g)){for(i=l+16|8,c=l+16|9,s=t=s>>>0>E>>>0?E:s;;){o=jr(b[s>>2],0,c);n:if((0|t)==(0|s))(0|o)==(0|c)&&(n[l+24|0]=48,o=i);else{if(l+16>>>0>=o>>>0)break n;for(;n[0|(o=o-1|0)]=48,l+16>>>0>>0;);}if(yr(r,o,c-o|0),!(E>>>0>=(s=s+4|0)>>>0))break}if(o=0,!C)break i;if(yr(r,1069,1),(0|h)<1|s>>>0>=d>>>0)break a;for(;;){if((o=jr(b[s>>2],0,c))>>>0>l+16>>>0)for(;n[0|(o=o-1|0)]=48,l+16>>>0>>0;);if(yr(r,o,(0|h)<9?h:9),o=h-9|0,d>>>0<=(s=s+4|0)>>>0)break i;if(i=(0|h)>9,h=o,!i)break}break i}n:if(!((0|h)<0))for(t=s>>>0>>0?d:s+4|0,v=l+16|9,i=l+16|8,c=s;;){(0|v)==(0|(o=jr(b[c>>2],0,v)))&&(n[l+24|0]=48,o=i);t:if((0|c)==(0|s))yr(r,o,1),o=o+1|0,!y&&(0|h)<=0||yr(r,1069,1);else{if(l+16>>>0>=o>>>0)break t;for(;n[0|(o=o-1|0)]=48,l+16>>>0>>0;);}if(yr(r,d=o,(0|(o=v-o|0))<(0|h)?o:h),h=h-o|0,t>>>0<=(c=c+4|0)>>>0)break n;if(!((0|h)>-1))break}Dr(r,48,h+18|0,18,0),yr(r,P,R-P|0);break f}o=h}Dr(r,48,o+9|0,9,0)}break r}if(E=(v=32&t)?_+9|0:_,!(i>>>0>11)&&(o=12-i|0)){for(M=8;M*=16,o=o-1|0;);e=45!=k[0|E]?e+M-M:-(M+(-e-M))}for((0|R)==(0|(o=jr((c=(o=b[l+44>>2])>>31)^o+c,0,R)))&&(n[l+15|0]=48,o=l+15|0),h=2|I,c=b[l+44>>2],n[0|(d=o-2|0)]=t+15,n[o-1|0]=(0|c)<0?45:43,o=8&a,s=l+16|0;t=s,y=v,c=w(e)<2147483648?~~e:-2147483648,n[0|s]=y|k[c+1632|0],e=16*(e-+(0|c)),!(o||(0|i)>0|0!=e)|1!=((s=t+1|0)-(l+16|0)|0)||(n[t+1|0]=46,s=t+2|0),0!=e;);Dr(t=r,32,o=f,m=(v=!i|((s-l|0)-18|0)>=(0|i)?(R-(d+(l+16|0)|0)|0)+s|0:2+((i+R|0)-d|0)|0)+h|0,a),yr(r,E,h),Dr(r,48,f,m,65536^a),yr(r,l+16|0,i=s-(l+16|0)|0),Dr(r,48,v-((t=i)+(i=R-d|0)|0)|0,0,0),yr(r,d,i)}else Dr(r,32,f,m=I+3|0,-65537&a),yr(r,_,I),i=32&t,yr(r,e!=e?i?1053:1061:i?1057:1065,3);return Dr(r,32,f,m,8192^a),U=l+560|0,0|((0|f)>(0|m)?f:m)}function z(r,e){var f=0,i=0,a=0,t=0,o=0,u=m(0),c=0,s=m(0),A=0,l=0,v=0;U=o=U+-64|0,b[r+72>>2]=e,f=a=b[e+8>>2];r:{e:{f:{for(;;){if(i=b[f+24>>2])break f;if((0|a)==(0|(f=b[f+8>>2])))break}for(b[o>>2]=b[a+4>>2],a=f=b[r- -64>>2];a=b[a+4>>2],(i=b[a>>2])&&!(0|be[b[f+16>>2]](b[f+12>>2],o,i)););if(i=b[a>>2],a=b[b[b[i+4>>2]+8>>2]>>2],c=b[a>>2],t=b[i>>2],pr(b[b[t+4>>2]+16>>2],e,b[t+16>>2])==m(0)){if(u=d[e+28>>2],a=b[i>>2],f=b[a+16>>2],!(u!=d[f+28>>2]|d[f+32>>2]!=d[e+32>>2])){if(i=b[e+8>>2],b[o+40>>2]=0,b[o+44>>2]=0,b[o+32>>2]=0,b[o+36>>2]=0,e=b[287],b[o+24>>2]=b[286],b[o+28>>2]=e,e=b[285],b[o+16>>2]=b[284],b[o+20>>2]=e,b[o+32>>2]=b[f+12>>2],b[o+36>>2]=b[b[i+16>>2]+12>>2],d[o+52>>2]=d[f+16>>2],d[o+56>>2]=d[f+20>>2],d[o+60>>2]=d[f+24>>2],b[f+12>>2]=0,e=f+12|0,8==(0|(f=b[r+1736>>2]))?be[b[r+76>>2]](o+52|0,o+32|0,o+16|0,e):be[0|f](o+52|0,o+32|0,o+16|0,e,b[r+1896>>2]),b[e>>2]||(b[e>>2]=b[o+32>>2]),tr(a,i))break e;break r}if(t=b[a+4>>2],f=b[t+16>>2],d[f+32>>2]!=d[e+32>>2]||u!=d[f+28>>2]){if(!ir(t))break r;if(k[i+15|0]){if(!rr(b[a+8>>2]))break r;n[i+15|0]=0}if(!tr(b[e+8>>2],a))break r;z(r,e);break e}for(;i=b[b[b[i+4>>2]+4>>2]>>2],(0|f)==b[b[b[i>>2]+4>>2]+16>>2];);if(a=b[b[b[i+4>>2]+8>>2]>>2],c=b[a>>2],t=b[c+4>>2],f=b[t+8>>2],k[a+15|0]){if(b[c+24>>2]=0,Vr(b[a+4>>2]),Y(a),!rr(t))break r;t=b[b[f+4>>2]+12>>2]}if(!tr(b[e+8>>2],t))break r;A=b[t+8>>2],t=f,e=f,a=b[b[f+4>>2]+16>>2],u=d[a+28>>2],c=b[f+16>>2],u<(s=d[c+28>>2])|(d[a+32>>2]<=d[c+32>>2]?u==s:0)||(e=0),ar(r,i,A,t,e,1);break e}if(l=k[i+12|0],c=b[c+4>>2],A=b[c+16>>2],u=d[A+28>>2],v=b[b[t+4>>2]+16>>2],f=i,u<(s=d[v+28>>2])||u==s&&(f=i,d[A+32>>2]<=d[v+32>>2])||(f=a),k[f+15|0]||l){i:{if((0|f)==(0|i)){if(a=er(b[b[e+8>>2]+4>>2],b[t+12>>2]))break i;break r}if(!(a=er(b[b[c+8>>2]+4>>2],b[e+8>>2])))break r;a=b[a+4>>2]}if(k[f+15|0]){if(rr(b[f>>2])){b[f>>2]=a,n[f+15|0]=0,b[a+24>>2]=f,z(r,e);break e}break r}if(!(f=O(16)))break r;if(b[f>>2]=a,i=Fr(b[r- -64>>2],b[i+4>>2],f),b[f+4>>2]=i,!i)break r;n[f+13|0]=0,n[f+14|0]=0,n[f+15|0]=0,b[a+24>>2]=f,t=b[r+56>>2],a=b[b[f>>2]+28>>2]+b[b[b[i+4>>2]>>2]+8>>2]|0,b[f+8>>2]=a;i:{a:switch(t-100130|0){case 0:i=1&a;break i;case 1:i=0!=(0|a);break i;case 2:i=(0|a)>0;break i;case 3:i=a>>>31|0;break i;case 4:break a;default:break i}i=a+1>>>0>2}n[f+12|0]=i,z(r,e);break e}ar(f=r,i,r=b[e+8>>2],r,0,1);break e}for(e=b[b[i>>2]+16>>2];i=b[b[b[i+4>>2]+4>>2]>>2],f=b[i>>2],(0|e)==b[f+16>>2];);if(k[i+15|0]){if(!(e=er(b[b[b[b[b[i+4>>2]+8>>2]>>2]>>2]+4>>2],b[f+12>>2])))break r;if(!rr(b[i>>2]))break r;if(b[i>>2]=e,n[i+15|0]=0,b[e+24>>2]=i,!(i=b[b[b[i+4>>2]+4>>2]>>2]))break r}if(e=b[b[b[i+4>>2]+8>>2]>>2],f=b[e>>2],e=mr(r,e,0),(0|f)!=(0|(a=b[e+8>>2])))ar(r,i,a,f,f,1);else{if(a=b[i>>2],A=b[b[b[i+4>>2]+8>>2]>>2],c=b[A>>2],b[b[a+4>>2]+16>>2]!=b[b[c+4>>2]+16>>2]&&H(r,i),v=1,t=b[r+72>>2],u=d[t+28>>2],l=b[a+16>>2],!(u!=d[l+28>>2]|d[l+32>>2]!=d[t+32>>2])){if(!tr(b[b[f+4>>2]+12>>2],a))break r;for(f=b[b[i>>2]+16>>2];i=b[b[b[i+4>>2]+4>>2]>>2],t=b[i>>2],(0|f)==b[t+16>>2];);if(k[i+15|0]){if(!(f=er(b[b[b[b[b[i+4>>2]+8>>2]>>2]>>2]+4>>2],b[t+12>>2])))break r;if(!rr(b[i>>2]))break r;if(b[i>>2]=f,n[i+15|0]=0,b[f+24>>2]=i,!(i=b[b[b[i+4>>2]+4>>2]>>2]))break r}t=b[b[b[i+4>>2]+8>>2]>>2],f=b[t>>2],mr(r,t,A),t=b[r+72>>2],u=d[t+28>>2],v=0}f:{if(s=u,l=b[c+16>>2],s!=(u=d[l+28>>2])|d[l+32>>2]!=d[t+32>>2]){if(v)break f}else{if(!tr(e,b[b[c+4>>2]+12>>2]))break r;e=mr(r,A,0)}ar(r,i,b[e+8>>2],f,f,1);break e}if(f=b[a+16>>2],s=d[f+28>>2],!(d[l+32>>2]<=d[f+32>>2])|u!=s&&!(s>u)||(a=b[b[c+4>>2]+12>>2]),!(e=er(b[b[e+8>>2]+4>>2],a)))break r;ar(r,i,e,f=b[e+8>>2],f,0),n[b[b[e+4>>2]+24>>2]+15|0]=1,X(r,i)}}return void(U=o- -64|0)}Zr(r+1740|0,1),E()}function K(r){r|=0;var e=0,f=0,i=0,a=m(0),n=m(0),t=0,o=0,k=m(0),u=m(0),c=m(0),s=m(0),A=0,l=m(0),v=0,h=m(0),p=m(0),w=m(0),y=m(0),g=m(0),E=m(0),C=m(0),R=0,M=0,I=m(0),_=m(0),S=0,P=0,x=0,L=0,j=0,B=0,T=0,F=0;v=b[r+8>>2],e=U-80|0,n=d[r+16>>2],d[e+8>>2]=n,p=d[r+20>>2],d[e+12>>2]=p,w=d[r+24>>2],d[e+16>>2]=w;r:if(S=n==m(0)&p==m(0)&w==m(0)){if(b[e+76>>2]=-42943038,b[e+68>>2]=-42943038,b[e+72>>2]=-42943038,b[e+64>>2]=2104540610,b[e+56>>2]=2104540610,b[e+60>>2]=2104540610,P=(0|(A=b[v>>2]))==(0|v))h=m(-19999999867631625e21),k=m(19999999867631625e21),u=m(19999999867631625e21),l=m(-19999999867631625e21),c=m(19999999867631625e21),s=m(-19999999867631625e21);else{for(y=m(19999999867631625e21),g=m(-19999999867631625e21),E=m(-19999999867631625e21),C=m(19999999867631625e21),I=m(-19999999867631625e21),_=m(19999999867631625e21),h=m(-19999999867631625e21),k=m(19999999867631625e21),s=m(-19999999867631625e21),c=m(19999999867631625e21),l=m(-19999999867631625e21),u=m(19999999867631625e21),f=A;h=(i=(a=d[f+24>>2])>h)?a:h,g=i?a:g,k=(R=a>2])>s)?a:s,E=t?a:E,c=(M=a>2])>l)?a:l,I=o?a:I,x=o?f:x,u=(o=a>2])););b[e+20>>2]=L,d[e+56>>2]=_,d[e+68>>2]=I,b[e+32>>2]=x,d[e+60>>2]=C,b[e+24>>2]=F,d[e+72>>2]=E,b[e+36>>2]=T,d[e+64>>2]=y,b[e+28>>2]=B,d[e+76>>2]=g,b[e+40>>2]=j}if(f=2,i=(t=m(s-c)>m(l-u))<<2,i=m(h-k)>m(d[i+(e+68|0)>>2]-d[i+(e+56|0)>>2])?2:t,d[(t=i<<2)+(e+56|0)>>2]>=d[t+(e+68|0)>>2])b[e+8>>2]=0,b[e+12>>2]=0;else{if(f=b[(i<<=2)+(e+20|0)>>2],i=b[i+(e+32|0)>>2],g=d[i+16>>2],c=m(d[f+16>>2]-g),d[e+44>>2]=c,E=d[i+20>>2],s=m(d[f+20>>2]-E),d[e+48>>2]=s,C=d[i+24>>2],a=m(d[f+24>>2]-C),d[e+52>>2]=a,!P){for(y=m(0),f=A;k=m(d[f+20>>2]-E),u=m(d[f+16>>2]-g),h=m(m(c*k)-m(s*u)),l=m(d[f+24>>2]-C),k=m(m(s*l)-m(a*k)),u=m(m(a*u)-m(c*l)),(l=m(m(h*h)+m(m(k*k)+m(u*u))))>y&&(w=h,p=u,y=l,n=k),(0|v)!=(0|(f=b[f>>2])););if(d[e+16>>2]=w,d[e+12>>2]=p,d[e+8>>2]=n,!(y<=m(0)))break r}b[e+16>>2]=0,b[e+8>>2]=0,b[e+12>>2]=0,f=(s(c>2],f=(a(n>2]=1065353216,w=d[e+16>>2],n=d[e+8>>2],p=d[e+12>>2]}else A=b[v>>2];if(i=(p(n>2],f=r+28|0,i=(w(n>2]=0,b[(o=(i+1>>>0)%3<<2)+f>>2]=1065353216,b[(i=(i+2>>>0)%3<<2)+f>>2]=0,b[(f=r+40|0)+t>>2]=0,e=d[t+(e+8|0)>>2]>m(0),d[f+o>>2]=m(e?-0:0),d[f+i>>2]=m(e?1:-1),!(i=(0|v)==(0|A)))for(f=A;e=b[f+20>>2],b[f+28>>2]=b[f+16>>2],b[f+32>>2]=e,(0|v)!=(0|(f=b[f>>2])););if(S&&(0|(e=b[v+40>>2]))!=(0|(t=v+40|0))){for(n=m(0);;){if(o=b[e+8>>2],b[(f=o)+28>>2]>=1)for(;R=b[f+16>>2],M=b[b[f+4>>2]+16>>2],n=m(n+m(m(d[R+28>>2]-d[M+28>>2])*m(d[R+32>>2]+d[M+32>>2]))),(0|o)!=(0|(f=b[f+12>>2])););if((0|t)==(0|(e=b[e>>2])))break}if(n>2]=-d[A+32>>2],(0|(A=b[A>>2]))!=(0|v););d[r+40>>2]=-d[r+40>>2],d[r+44>>2]=-d[r+44>>2],d[r+48>>2]=-d[r+48>>2]}}}function Y(r){var e=0,f=0,i=0,a=0,n=0,t=0,o=0,k=0,u=0;r:if(r|=0){n=(i=r-8|0)+(r=-8&(e=b[r-4>>2]))|0;e:if(!(1&e)){if(!(3&e))break r;if((i=i-(e=b[i>>2])|0)>>>0>2])))return b[616]=r,b[n+4>>2]=-2&e,b[i+4>>2]=1|r,void(b[r+i>>2]=r)}else{if(e>>>0<=255){if(a=b[i+8>>2],e=e>>>3|0,(0|(f=b[i+12>>2]))==(0|a)){k=2456,u=b[614]&Jr(e),b[k>>2]=u;break e}b[a+12>>2]=f,b[f+8>>2]=a;break e}if(o=b[i+24>>2],(0|i)==(0|(e=b[i+12>>2])))if((f=b[(a=i+20|0)>>2])||(f=b[(a=i+16|0)>>2])){for(;t=a,(f=b[(a=(e=f)+20|0)>>2])||(a=e+16|0,f=b[e+16>>2]););b[t>>2]=0}else e=0;else f=b[i+8>>2],b[f+12>>2]=e,b[e+8>>2]=f;if(!o)break e;a=b[i+28>>2];f:{if(b[(f=2760+(a<<2)|0)>>2]==(0|i)){if(b[f>>2]=e,e)break f;k=2460,u=b[615]&Jr(a),b[k>>2]=u;break e}if(b[o+(b[o+16>>2]==(0|i)?16:20)>>2]=e,!e)break e}if(b[e+24>>2]=o,(f=b[i+16>>2])&&(b[e+16>>2]=f,b[f+24>>2]=e),!(f=b[i+20>>2]))break e;b[e+20>>2]=f,b[f+24>>2]=e}}if(!(i>>>0>=n>>>0)&&1&(e=b[n+4>>2])){e:{if(!(2&e)){if(b[620]==(0|n)){if(b[620]=i,r=b[617]+r|0,b[617]=r,b[i+4>>2]=1|r,b[619]!=(0|i))break r;return b[616]=0,void(b[619]=0)}if(b[619]==(0|n))return b[619]=i,r=b[616]+r|0,b[616]=r,b[i+4>>2]=1|r,void(b[r+i>>2]=r);r=(-8&e)+r|0;f:if(e>>>0<=255){if(a=b[n+8>>2],e=e>>>3|0,(0|(f=b[n+12>>2]))==(0|a)){k=2456,u=b[614]&Jr(e),b[k>>2]=u;break f}b[a+12>>2]=f,b[f+8>>2]=a}else{if(o=b[n+24>>2],(0|n)==(0|(e=b[n+12>>2])))if((f=b[(a=n+20|0)>>2])||(f=b[(a=n+16|0)>>2])){for(;t=a,(f=b[(a=(e=f)+20|0)>>2])||(a=e+16|0,f=b[e+16>>2]););b[t>>2]=0}else e=0;else f=b[n+8>>2],b[f+12>>2]=e,b[e+8>>2]=f;if(o){a=b[n+28>>2];i:{if(b[(f=2760+(a<<2)|0)>>2]==(0|n)){if(b[f>>2]=e,e)break i;k=2460,u=b[615]&Jr(a),b[k>>2]=u;break f}if(b[o+(b[o+16>>2]==(0|n)?16:20)>>2]=e,!e)break f}b[e+24>>2]=o,(f=b[n+16>>2])&&(b[e+16>>2]=f,b[f+24>>2]=e),(f=b[n+20>>2])&&(b[e+20>>2]=f,b[f+24>>2]=e)}}if(b[i+4>>2]=1|r,b[r+i>>2]=r,b[619]!=(0|i))break e;return void(b[616]=r)}b[n+4>>2]=-2&e,b[i+4>>2]=1|r,b[r+i>>2]=r}if(r>>>0<=255)return e=2496+((r=r>>>3|0)<<3)|0,(f=b[614])&(r=1<>2]:(b[614]=r|f,r=e),b[e+8>>2]=i,b[r+12>>2]=i,b[i+12>>2]=e,void(b[i+8>>2]=r);a=31,b[i+16>>2]=0,b[i+20>>2]=0,r>>>0<=16777215&&(e=r>>>8|0,e<<=t=e+1048320>>>16&8,a=28+((e=((e<<=a=e+520192>>>16&4)<<(f=e+245760>>>16&2)>>>15|0)-(f|a|t)|0)<<1|r>>>e+21&1)|0),b[i+28>>2]=a,t=2760+(a<<2)|0;e:{f:{if((f=b[615])&(e=1<>>1|0)|0),e=b[t>>2];;){if(f=e,(-8&b[e+4>>2])==(0|r))break f;if(e=a>>>29|0,a<<=1,!(e=b[16+(t=f+(4&e)|0)>>2]))break}b[t+16>>2]=i,b[i+24>>2]=f}else b[615]=e|f,b[t>>2]=i,b[i+24>>2]=t;b[i+12>>2]=i,b[i+8>>2]=i;break e}r=b[f+8>>2],b[r+12>>2]=i,b[f+8>>2]=i,b[i+24>>2]=0,b[i+12>>2]=f,b[i+8>>2]=r}r=b[622]-1|0,b[622]=r||-1}}}function N(r,e){e|=0;var f=0,i=0,a=0,t=0,o=0,u=0,c=0,s=0,A=0,l=0,v=0,d=0,h=0,p=0,m=0,w=0,y=0;if(U=u=U-16|0,b[84+(r|=0)>>2]=0,(0|(s=b[e+40>>2]))!=(0|(h=e+40|0)))for(e=s;n[e+20|0]=0,(0|h)!=(0|(e=b[e>>2])););if((0|s)!=(0|h)){for(;;){if(!(k[s+20|0]|!k[s+21|0])){if(o=b[s+8>>2],k[r+80|0])e=1,f=1;else{a=0,i=0,e=0,t=b[(f=o)+20>>2];r:if(k[t+21|0])for(;;){if(k[(e=t)+20|0]){e=i;break r}if(n[e+20|0]=1,b[e+16>>2]=i,a=a+1|0,i=e,f=b[f+8>>2],t=b[f+20>>2],!k[t+21|0])break}i=b[o+4>>2],t=b[i+20>>2];r:{e:if(!k[t+21|0]|k[t+20|0]){if(m=o,!e)break r}else for(f=e;;){if(n[(e=t)+20|0]=1,b[e+16>>2]=f,a=a+1|0,m=b[i+12>>2],i=b[m+4>>2],t=b[i+20>>2],!k[t+21|0])break e;if(f=e,k[t+20|0])break}for(;n[e+20|0]=0,e=b[e+16>>2];);}w=(0|a)>1,t=0,f=0,e=0,v=b[o+12>>2],i=b[(c=v)+20>>2];r:if(k[i+21|0])for(;;){if(k[(e=i)+20|0]){e=f;break r}if(n[e+20|0]=1,b[e+16>>2]=f,t=t+1|0,f=e,c=b[c+8>>2],i=b[c+20>>2],!k[i+21|0])break}p=w?a:1,i=b[v+4>>2],a=b[i+20>>2];r:{e:if(!k[a+21|0]|k[a+20|0]){if(!e)break r}else for(f=e;;){if(n[(e=a)+20|0]=1,b[e+16>>2]=f,t=t+1|0,v=b[i+12>>2],i=b[v+4>>2],a=b[i+20>>2],!k[a+21|0])break e;if(f=e,k[a+20|0])break}for(;n[e+20|0]=0,e=b[e+16>>2];);}y=(0|t)>(0|p),a=0,f=0,e=0,d=b[b[o+8>>2]+4>>2],i=b[(c=d)+20>>2];r:if(k[i+21|0])for(;;){if(k[(e=i)+20|0]){e=f;break r}if(n[e+20|0]=1,b[e+16>>2]=f,a=a+1|0,f=e,c=b[c+8>>2],i=b[c+20>>2],!k[i+21|0])break}A=y?t:p,i=b[d+4>>2],t=b[i+20>>2];r:{e:if(!k[t+21|0]|k[t+20|0]){if(!e)break r}else for(f=e;;){if(n[(e=t)+20|0]=1,b[e+16>>2]=f,a=a+1|0,d=b[i+12>>2],i=b[d+4>>2],t=b[i+20>>2],!k[t+21|0])break e;if(f=e,k[t+20|0])break}for(;n[e+20|0]=0,e=b[e+16>>2];);}kr(u,o),c=b[u+8>>2],p=b[u+4>>2],l=b[u>>2],kr(u,b[o+12>>2]),t=b[u+8>>2],i=b[u+4>>2],f=b[u>>2],kr(u,b[b[o+8>>2]+4>>2]),e=a,(0|(e=(l=(0|(e=(A=(0|(e=(a=(0|a)>(0|A))?e:A))<(0|l))?l:e))<(0|f))?f:e))>=(0|(f=b[u>>2]))?(o=l?i:A?p:a?d:y?v:w?m:o,f=l?t:A?c:a||w|y?2:1):(o=b[u+4>>2],e=f,f=b[u+8>>2])}be[0|f](r,o,e)}if((0|h)==(0|(s=b[s>>2])))break}if(a=b[r+84>>2]){for(3==(0|(e=b[r+1716>>2]))?be[b[r+88>>2]](4):be[0|e](4,b[r+1896>>2]),t=-1;;){for(e=b[a+8>>2];k[r+80|0]&&(0|(f=!(o=k[b[b[e+4>>2]+20>>2]+21|0])))!=(0|t)&&(4==(0|(i=b[r+1720>>2]))?be[b[r+92>>2]](!o):be[0|i](!o,b[r+1896>>2]),t=f),5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[e+16>>2]+12>>2]):be[0|f](b[b[e+16>>2]+12>>2],b[r+1896>>2]),(0|(e=b[e+12>>2]))!=b[a+8>>2];);if(!(a=b[a+16>>2]))break}6==(0|(e=b[r+1728>>2]))?be[b[r+100>>2]]():be[0|e](b[r+1896>>2]),b[r+84>>2]=0}}U=u+16|0}function V(r,e){var f=0,i=0,a=0,n=0,t=0,o=0,k=0,u=0;n=r+e|0;r:{e:if(!(1&(f=b[r+4>>2]))){if(!(3&f))break r;e=(f=b[r>>2])+e|0;f:{if((0|(r=r-f|0))!=b[619]){if(f>>>0<=255){if(a=b[r+8>>2],f=f>>>3|0,(0|(i=b[r+12>>2]))!=(0|a))break f;k=2456,u=b[614]&Jr(f),b[k>>2]=u;break e}if(o=b[r+24>>2],(0|(f=b[r+12>>2]))==(0|r))if((i=b[(a=r+20|0)>>2])||(i=b[(a=r+16|0)>>2])){for(;t=a,(i=b[(a=(f=i)+20|0)>>2])||(a=f+16|0,i=b[f+16>>2]););b[t>>2]=0}else f=0;else i=b[r+8>>2],b[i+12>>2]=f,b[f+8>>2]=i;if(!o)break e;a=b[r+28>>2];i:{if(b[(i=2760+(a<<2)|0)>>2]==(0|r)){if(b[i>>2]=f,f)break i;k=2460,u=b[615]&Jr(a),b[k>>2]=u;break e}if(b[o+(b[o+16>>2]==(0|r)?16:20)>>2]=f,!f)break e}if(b[f+24>>2]=o,(i=b[r+16>>2])&&(b[f+16>>2]=i,b[i+24>>2]=f),!(i=b[r+20>>2]))break e;b[f+20>>2]=i,b[i+24>>2]=f;break e}if(3!=(3&(f=b[n+4>>2])))break e;return b[616]=e,b[n+4>>2]=-2&f,b[r+4>>2]=1|e,void(b[n>>2]=e)}b[a+12>>2]=i,b[i+8>>2]=a}e:{if(!(2&(f=b[n+4>>2]))){if(b[620]==(0|n)){if(b[620]=r,e=b[617]+e|0,b[617]=e,b[r+4>>2]=1|e,b[619]!=(0|r))break r;return b[616]=0,void(b[619]=0)}if(b[619]==(0|n))return b[619]=r,e=b[616]+e|0,b[616]=e,b[r+4>>2]=1|e,void(b[r+e>>2]=e);e=(-8&f)+e|0;f:if(f>>>0<=255){if(a=b[n+8>>2],f=f>>>3|0,(0|(i=b[n+12>>2]))==(0|a)){k=2456,u=b[614]&Jr(f),b[k>>2]=u;break f}b[a+12>>2]=i,b[i+8>>2]=a}else{if(o=b[n+24>>2],(0|n)==(0|(f=b[n+12>>2])))if((a=b[(i=n+20|0)>>2])||(a=b[(i=n+16|0)>>2])){for(;t=i,(a=b[(i=(f=a)+20|0)>>2])||(i=f+16|0,a=b[f+16>>2]););b[t>>2]=0}else f=0;else i=b[n+8>>2],b[i+12>>2]=f,b[f+8>>2]=i;if(o){a=b[n+28>>2];i:{if(b[(i=2760+(a<<2)|0)>>2]==(0|n)){if(b[i>>2]=f,f)break i;k=2460,u=b[615]&Jr(a),b[k>>2]=u;break f}if(b[o+(b[o+16>>2]==(0|n)?16:20)>>2]=f,!f)break f}b[f+24>>2]=o,(i=b[n+16>>2])&&(b[f+16>>2]=i,b[i+24>>2]=f),(i=b[n+20>>2])&&(b[f+20>>2]=i,b[i+24>>2]=f)}}if(b[r+4>>2]=1|e,b[r+e>>2]=e,b[619]!=(0|r))break e;return void(b[616]=e)}b[n+4>>2]=-2&f,b[r+4>>2]=1|e,b[r+e>>2]=e}if(e>>>0<=255)return f=2496+((e=e>>>3|0)<<3)|0,(i=b[614])&(e=1<>2]:(b[614]=e|i,e=f),b[f+8>>2]=r,b[e+12>>2]=r,b[r+12>>2]=f,void(b[r+8>>2]=e);a=31,b[r+16>>2]=0,b[r+20>>2]=0,e>>>0<=16777215&&(f=e>>>8|0,f<<=t=f+1048320>>>16&8,a=28+((f=((f<<=a=f+520192>>>16&4)<<(i=f+245760>>>16&2)>>>15|0)-(i|a|t)|0)<<1|e>>>f+21&1)|0),b[r+28>>2]=a,t=2760+(a<<2)|0;e:{if((i=b[615])&(f=1<>>1|0)|0),f=b[t>>2];;){if(i=f,(-8&b[f+4>>2])==(0|e))break e;if(f=a>>>29|0,a<<=1,!(f=b[16+(t=i+(4&f)|0)>>2]))break}b[t+16>>2]=r,b[r+24>>2]=i}else b[615]=f|i,b[t>>2]=r,b[r+24>>2]=t;return b[r+12>>2]=r,void(b[r+8>>2]=r)}e=b[i+8>>2],b[e+12>>2]=r,b[i+8>>2]=r,b[r+24>>2]=0,b[r+12>>2]=i,b[r+8>>2]=e}}function G(r,e){var f=0,i=0,a=0,t=m(0),o=0,k=0,u=m(0),c=0,s=0,A=0,l=0,v=0,h=0,p=0,w=0,y=0,g=0,C=0,R=0,M=0,I=0;U=a=U-48|0;r:{A=b[e>>2],k=b[A+16>>2],u=d[k+28>>2],f=b[b[b[e+4>>2]+8>>2]>>2],v=b[f>>2],i=b[v+16>>2],t=d[i+28>>2];e:{if(!(!(d[k+32>>2]<=d[i+32>>2])|u!=t)||u>2]+16>>2],k,i)>m(0))break e;if(k=b[A+16>>2],i=b[v+16>>2],d[k+32>>2]!=d[i+32>>2]||d[k+28>>2]!=d[i+28>>2]){if(!ir(b[v+4>>2]))break r;if(!tr(A,b[b[v+4>>2]+12>>2]))break r;g=1,n[f+14|0]=1,n[e+14|0]=1;break e}if(g=1,(0|i)==(0|k))break e;if(o=b[r+68>>2],(0|(e=b[k+36>>2]))>=0){if(h=b[o>>2],c=b[h>>2],k=e,s=b[h+4>>2],e=b[4+(C=s+(e<<3)|0)>>2],y=b[h+8>>2],w=b[c+(y<<2)>>2],b[c+(e<<2)>>2]=w,b[4+(R=(w<<3)+s|0)>>2]=e,M=y-1|0,b[h+8>>2]=M,(0|e)<(0|y)){f:{if((0|e)<2||(f=b[(b[c+(e<<1&-4)>>2]<<3)+s>>2],t=d[f+28>>2],p=b[(w<<3)+s>>2],t<(u=d[p+28>>2])||!(!(d[f+32>>2]<=d[p+32>>2])|u!=t)))for(I=(w<<3)+s|0;;){if((0|M)<=(0|(f=e<<1))||(l=b[(b[c+((i=1|f)<<2)>>2]<<3)+s>>2],u=d[l+28>>2],o=b[(b[c+(f<<2)>>2]<<3)+s>>2],t=d[o+28>>2],!(d[l+32>>2]<=d[o+32>>2])|u!=t&&!(u=(0|y)){f=e;break f}if(p=b[I>>2],u=d[p+28>>2],l=b[c+(f<<2)>>2],i=b[(o=(l<<3)+s|0)>>2],u<(t=d[i+28>>2])){f=e;break f}if(!(!(d[p+32>>2]<=d[i+32>>2])|u!=t)){f=e;break f}b[c+(e<<2)>>2]=l,b[o+4>>2]=e,e=f}for(;;){if(l=b[c+((f=e>>1)<<2)>>2],i=b[(o=(l<<3)+s|0)>>2],(t=d[i+28>>2])>2]<=d[p+32>>2])|u!=t)){f=e;break f}if(b[c+(e<<2)>>2]=l,b[o+4>>2]=e,!((e=f)>>>0>1))break}}b[c+(f<<2)>>2]=w,b[R+4>>2]=f}b[C>>2]=0,b[C+4>>2]=b[h+16>>2],b[h+16>>2]=k}else{b[b[o+4>>2]+((-1^e)<<2)>>2]=0;f:if(!((0|(e=b[o+12>>2]))<1))for(k=b[o+8>>2];;){if(b[b[k+((f=e-1|0)<<2)>>2]>>2])break f;if(b[o+12>>2]=f,i=(0|e)>1,e=f,!i)break}}if(f=b[b[v+4>>2]+12>>2],b[a+24>>2]=0,b[a+28>>2]=0,b[a+16>>2]=0,b[a+20>>2]=0,e=b[287],b[a+8>>2]=b[286],b[a+12>>2]=e,e=b[285],b[a>>2]=b[284],b[a+4>>2]=e,e=b[f+16>>2],b[a+16>>2]=b[e+12>>2],b[a+20>>2]=b[b[A+16>>2]+12>>2],d[a+36>>2]=d[e+16>>2],d[a+40>>2]=d[e+20>>2],d[a+44>>2]=d[e+24>>2],b[e+12>>2]=0,i=e+12|0,8==(0|(e=b[r+1736>>2]))?be[b[r+76>>2]](a+36|0,a+16|0,a,i):be[0|e](a+36|0,a+16|0,a,i,b[r+1896>>2]),b[i>>2]||(b[i>>2]=b[a+16>>2]),tr(f,A))break e;break r}if(!(pr(b[b[A+4>>2]+16>>2],i,k)>2]+4>>2]>>2]+14|0]=1,!ir(b[A+4>>2]))break r;if(!tr(b[b[v+4>>2]+12>>2],A))break r}}return U=a+48|0,g}Zr(r+1740|0,1),E()}function J(r){r|=0;var e=0,f=0,i=m(0),a=m(0),n=m(0),t=m(0),o=m(0),u=m(0),c=0,s=0,A=0,l=m(0),v=m(0),h=0,p=m(0),w=m(0),y=m(0),g=m(0),E=m(0),C=0,R=0,M=m(0),I=m(0),_=m(0);r:{e:if(!((0|(A=b[r+112>>2]))<3)){if(c=(R=r+116|0)+(A<<4)|0,t=d[r+24>>2],o=d[r+16>>2],u=d[r+20>>2],t!=m(0)||o!=m(0)|u!=m(0))p=d[r+124>>2],n=m(d[r+140>>2]-p),w=d[r+120>>2],l=m(d[r+136>>2]-w),y=d[r+116>>2],v=m(d[r+132>>2]-y);else{for(f=r+148|0,t=m(0),u=m(0),o=m(0),e=r+132|0,y=d[r+116>>2],i=v=m(d[e>>2]-y),w=d[r+120>>2],a=l=m(d[r+136>>2]-w),p=d[r+124>>2],g=n=m(d[r+140>>2]-p);E=m(d[e+20>>2]-w),M=m(d[f>>2]-y),I=m(m(i*E)-m(a*M)),_=m(d[e+24>>2]-p),a=m(m(a*_)-m(g*E)),i=m(m(g*M)-m(i*_)),m(m(t*I)+m(m(o*a)+m(u*i)))>=m(0)?(u=m(u+i),o=m(o+a),t=m(t+I)):(u=m(u-i),o=m(o-a),t=m(t-I)),i=M,a=E,g=_,c>>>0>(f=(e=f)+16|0)>>>0;);if((0|A)<3)break e}for(f=r+148|0,e=h=r+132|0;;){i=n,n=l,C=e,a=v,l=m(d[e+20>>2]-w),v=m(d[(e=f)>>2]-y),E=m(t*m(m(a*l)-m(n*v))),g=n,n=m(d[C+24>>2]-p);f:if((i=m(E+m(m(o*m(m(g*n)-m(i*l)))+m(u*m(m(i*v)-m(a*n))))))!=m(0)){if(i>m(0)){if(f=0,C=(0|s)<0,s=1,!C)break f;break r}if(f=0,C=(0|s)>0,s=-1,C)break r}if(!(c>>>0>(f=e+16|0)>>>0))break}switch(f=0,0|s){case 2:break r;case 0:break e}f=1;f:{i:switch(b[r+56>>2]-100132|0){case 0:if((0|s)>=0)break f;break e;case 2:break r;case 1:break i;default:break f}if((0|s)>0)break e}3==(0|(e=b[r+1716>>2]))?be[b[r+88>>2]](k[r+81|0]?2:(0|A)<4?4:6):be[0|e](k[r+81|0]?2:(0|A)<4?4:6,b[r+1896>>2]),5==(0|(e=b[r+1724>>2]))?be[b[r+96>>2]](b[r+128>>2]):be[0|e](b[r+128>>2],b[r+1896>>2]);f:if((0|s)<=0){if(R>>>0>=(e=c-16|0)>>>0)break f;for(;5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[c-4>>2]):be[0|f](b[c-4>>2],b[r+1896>>2]),c=e,R>>>0<(e=e-16|0)>>>0;);}else if(!((0|A)<2))for(;5==(0|(e=b[r+1724>>2]))?be[b[r+96>>2]](b[h+12>>2]):be[0|e](b[h+12>>2],b[r+1896>>2]),(h=h+16|0)>>>0>>0;);6==(0|(e=b[r+1728>>2]))?be[b[r+100>>2]]():be[0|e](b[r+1896>>2])}f=1}return 0|f}function Z(r,e){var f=0,i=0,a=0,n=0,t=0,o=0,k=0,u=0,c=0,s=0,A=0,l=0,v=0;if(!r)return O(e);if(e>>>0>=4294967232)return b[613]=48,0;t=e>>>0<11?16:e+11&-8,a=-8&(u=b[4+(n=r-8|0)>>2]);r:if(3&u){o=a+n|0;e:if(a>>>0>=t>>>0){if((i=a-t|0)>>>0<16)break e;b[n+4>>2]=1&u|t|2,b[4+(f=n+t|0)>>2]=3|i,b[o+4>>2]=1|b[o+4>>2],V(f,i)}else if(b[620]!=(0|o))if(b[619]!=(0|o)){if(2&(i=b[o+4>>2]))break r;if((c=a+(-8&i)|0)>>>0>>0)break r;A=c-t|0;f:if(i>>>0<=255){if(a=b[o+8>>2],f=i>>>3|0,(0|(i=b[o+12>>2]))==(0|a)){l=2456,v=b[614]&Jr(f),b[l>>2]=v;break f}b[a+12>>2]=i,b[i+8>>2]=a}else{if(s=b[o+24>>2],(0|(k=b[o+12>>2]))==(0|o))if((f=b[(a=o+20|0)>>2])||(f=b[(a=o+16|0)>>2])){for(;i=a,k=f,(f=b[(a=f+20|0)>>2])||(a=k+16|0,f=b[k+16>>2]););b[i>>2]=0}else k=0;else f=b[o+8>>2],b[f+12>>2]=k,b[k+8>>2]=f;if(s){i=b[o+28>>2];i:{if(b[(f=2760+(i<<2)|0)>>2]==(0|o)){if(b[f>>2]=k,k)break i;l=2460,v=b[615]&Jr(i),b[l>>2]=v;break f}if(b[(b[s+16>>2]==(0|o)?16:20)+s>>2]=k,!k)break f}b[k+24>>2]=s,(f=b[o+16>>2])&&(b[k+16>>2]=f,b[f+24>>2]=k),(f=b[o+20>>2])&&(b[k+20>>2]=f,b[f+24>>2]=k)}}A>>>0<=15?(b[n+4>>2]=1&u|c|2,b[4+(f=n+c|0)>>2]=1|b[f+4>>2]):(b[n+4>>2]=1&u|t|2,b[4+(i=n+t|0)>>2]=3|A,b[4+(f=n+c|0)>>2]=1|b[f+4>>2],V(i,A))}else{if((i=a+b[616]|0)>>>0>>0)break r;(f=i-t|0)>>>0>=16?(b[n+4>>2]=1&u|t|2,b[4+(a=n+t|0)>>2]=1|f,b[(i=i+n|0)>>2]=f,b[i+4>>2]=-2&b[i+4>>2]):(b[n+4>>2]=i|1&u|2,b[4+(f=i+n|0)>>2]=1|b[f+4>>2],f=0,a=0),b[619]=a,b[616]=f}else{if((a=a+b[617]|0)>>>0<=t>>>0)break r;b[n+4>>2]=1&u|t|2,f=a-t|0,b[4+(i=n+t|0)>>2]=1|f,b[617]=f,b[620]=i}f=n}else{if(t>>>0<256)break r;if(a>>>0>=t+4>>>0&&(f=n,a-t>>>0<=b[734]<<1>>>0))break r;f=0}return f?f+8|0:(n=O(e))?(fr(n,r,e>>>0>(f=(3&(f=b[r-4>>2])?-4:-8)+(-8&f)|0)>>>0?f:e),Y(r),n):0}function X(r,e){var f=0,i=0,a=0,t=0,o=0,u=0,c=m(0),s=0,A=m(0);for(i=b[b[b[e+4>>2]+8>>2]>>2];;){r:{if(k[i+14|0])for(;i=b[b[b[(e=i)+4>>2]+8>>2]>>2],k[i+14|0];);e:{f:{i:{a:{if(k[e+14|0])f=e;else{if(!(f=b[b[b[e+4>>2]+4>>2]>>2]))break a;if(i=e,!k[f+14|0])break a}n[f+14|0]=0,a=b[f>>2],e=b[b[a+4>>2]+16>>2],o=b[i>>2];n:if((0|e)!=b[b[o+4>>2]+16>>2]){c=d[e+28>>2],s=b[b[b[f+4>>2]+8>>2]>>2],t=b[s>>2],u=b[b[t+4>>2]+16>>2],A=d[u+28>>2];t:{if(!(!(d[e+32>>2]<=d[u+32>>2])|c!=A)||c>2])>2]+4>>2]>>2]+14|0]=1,!(e=ir(a)))break e;if(tr(b[t+4>>2],e))break t;break r}if(pr(u,e,b[t+16>>2])>m(0)){e=f;break n}if(n[s+14|0]=1,n[f+14|0]=1,!(e=ir(t)))break r;if(!tr(b[a+12>>2],b[t+4>>2]))break r;e=b[e+4>>2]}if(n[b[e+20>>2]+21|0]=k[f+12|0],k[i+15|0]){if(b[b[i>>2]+24>>2]=0,Vr(b[i+4>>2]),Y(i),!rr(o))break r;i=b[b[b[f+4>>2]+8>>2]>>2],o=b[i>>2],e=f}else if(k[f+15|0]){if(b[b[f>>2]+24>>2]=0,Vr(b[f+4>>2]),Y(f),!rr(a))break r;e=b[b[b[i+4>>2]+4>>2]>>2],a=b[e>>2]}else e=f}else e=f;if(b[a+16>>2]==b[o+16>>2])break f;if(f=b[b[a+4>>2]+16>>2],t=b[b[o+4>>2]+16>>2],k[i+15|0]|k[e+15|0]|(0|f)==(0|t))break i;if(u=f,(0|(f=b[r+72>>2]))!=(0|t)&&(0|u)!=(0|f))break i;if(!H(r,e))break f}return}G(r,e)}if(b[a+16>>2]!=b[o+16>>2])continue;if(t=b[a+4>>2],f=b[o+4>>2],b[t+16>>2]!=b[f+16>>2])continue;if(b[o+28>>2]=b[o+28>>2]+b[a+28>>2],b[f+28>>2]=b[f+28>>2]+b[t+28>>2],b[b[e>>2]+24>>2]=0,Vr(b[e+4>>2]),Y(e),!rr(a))break r;e=b[b[b[i+4>>2]+4>>2]>>2];continue}}break}Zr(r+1740|0,1),E()}function $(r){r|=0;var e=0,f=0,i=0,a=m(0),n=m(0),t=0,o=0,u=0,c=0;if((0|(e=b[r+40>>2]))!=(0|(u=r+40|0)))for(;;){if(r=b[e>>2],k[e+21|0]){for(e=e+8|0;e=b[e>>2],f=b[b[e+4>>2]+16>>2],a=d[f+28>>2],i=b[e+16>>2],n=d[i+28>>2],!(!(d[f+32>>2]<=d[i+32>>2])|a!=n)||a>2]+4|0;for(;!(!(d[i+32>>2]<=d[f+32>>2])|a!=n)||a>n;)e=b[e+12>>2],i=b[e+16>>2],n=d[i+28>>2],f=b[b[e+4>>2]+16>>2],a=d[f+28>>2];r:{e:if((0|(i=b[b[e+8>>2]+4>>2]))!=b[e+12>>2])for(;;){if(t=b[i+16>>2],n=d[t+28>>2],!(d[f+32>>2]<=d[t+32>>2])|a!=n&&!(n>a)){f:if(b[i+12>>2]!=(0|e))for(;;){if(f=b[b[e+8>>2]+4>>2],t=b[f+16>>2],a=d[t+28>>2],o=b[b[f+4>>2]+16>>2],!(a<(n=d[o+28>>2])|(d[t+32>>2]<=d[o+32>>2]?a==n:0))){if(!(pr(b[b[e+4>>2]+16>>2],b[e+16>>2],t)>=m(0)))break f;f=b[b[e+8>>2]+4>>2]}if(e=er(e,f),f=0,!e)break r;if((0|(e=b[e+4>>2]))==b[i+12>>2])break}e=b[e+12>>2]}else{f:if((0|(f=b[i+12>>2]))!=(0|e))for(t=i+12|0;;){if(o=b[b[f+4>>2]+16>>2],a=d[o+28>>2],c=b[f+16>>2],!(a<(n=d[c+28>>2])|(d[o+32>>2]<=d[c+32>>2]?a==n:0))){if(!(pr(b[i+16>>2],b[b[i+4>>2]+16>>2],o)<=m(0)))break f;f=b[t>>2]}if(i=er(f,i),f=0,!i)break r;if(t=(i=b[i+4>>2])+12|0,(0|(f=b[i+12>>2]))==(0|e))break}i=b[b[i+8>>2]+4>>2]}if(b[e+12>>2]==(0|i))break e;f=b[b[e+4>>2]+16>>2],a=d[f+28>>2]}if(f=b[i+12>>2],b[f+12>>2]!=(0|e))for(;;){if(i=er(f,i),f=0,!i)break r;if(i=b[i+4>>2],f=b[i+12>>2],b[f+12>>2]==(0|e))break}f=1}if(!f)return 0}if((0|u)==(0|(e=r)))break}return 1}function rr(r){var e=0,f=0,i=0,a=0,t=0,o=0;if(a=b[r+4>>2],(0|(o=b[a+20>>2]))!=(0|(f=b[r+20>>2]))){for(e=i=b[f+8>>2];b[e+20>>2]=o,(0|i)!=(0|(e=b[e+12>>2])););e=b[f>>2],i=b[f+4>>2],b[e+4>>2]=i,b[i>>2]=e,Y(f)}if((0|(i=b[r+8>>2]))!=(0|r)){if(t=b[r+4>>2],e=b[t+12>>2],b[b[t+20>>2]+8>>2]=e,b[b[r+16>>2]+8>>2]=i,t=b[e+8>>2],b[b[i+4>>2]+12>>2]=e,b[b[t+4>>2]+12>>2]=r,b[r+8>>2]=t,b[e+8>>2]=i,(0|f)==(0|o)){if(!(f=O(24)))return 0;for(e=b[r+20>>2],i=b[e+4>>2],b[f+4>>2]=i,b[i>>2]=f,b[f>>2]=e,b[e+4>>2]=f,b[f+12>>2]=0,b[f+16>>2]=0,b[f+8>>2]=r,n[f+20|0]=0,n[f+21|0]=k[e+21|0],e=r;b[e+20>>2]=f,(0|(e=b[e+12>>2]))!=(0|r););}}else{for(f=b[r+16>>2],e=i=b[f+8>>2];b[e+16>>2]=0,(0|i)!=(0|(e=b[e+8>>2])););e=b[f>>2],i=b[f+4>>2],b[e+4>>2]=i,b[i>>2]=e,Y(f)}if((0|(e=b[a+8>>2]))!=(0|a))f=b[b[a+4>>2]+12>>2],b[b[r+20>>2]+8>>2]=f,b[b[a+16>>2]+8>>2]=e,i=b[f+8>>2],b[b[e+4>>2]+12>>2]=f,b[b[i+4>>2]+12>>2]=a,b[a+8>>2]=i,b[f+8>>2]=e;else{for(f=b[a+16>>2],e=i=b[f+8>>2];b[e+16>>2]=0,(0|i)!=(0|(e=b[e+8>>2])););for(e=b[f>>2],i=b[f+4>>2],b[e+4>>2]=i,b[i>>2]=e,Y(f),f=b[a+20>>2],e=a=b[f+8>>2];b[e+20>>2]=0,(0|a)!=(0|(e=b[e+12>>2])););e=b[f>>2],a=b[f+4>>2],b[e+4>>2]=a,b[a>>2]=e,Y(f)}return e=b[r+4>>2],e=b[(r=r>>>0>e>>>0?e:r)>>2],f=b[b[r+4>>2]>>2],b[b[e+4>>2]>>2]=f,b[b[f+4>>2]>>2]=e,Y(r),1}function er(r,e){var f=0,i=0,a=0,t=0,o=0,u=0,c=0,s=0;if(i=0,f=O(64)){if(u=b[r+4>>2],t=b[(i=r>>>0>u>>>0?u:r)+4>>2],a=b[t>>2],b[f+32>>2]=a,b[b[a+4>>2]>>2]=f,b[f>>2]=i,o=f+32|0,b[t>>2]=o,b[f+16>>2]=0,b[f+20>>2]=0,b[f+12>>2]=o,b[f+4>>2]=o,b[f+24>>2]=0,b[f+28>>2]=0,b[f+48>>2]=0,b[f+52>>2]=0,b[f+44>>2]=f,b[f+40>>2]=o,b[f+36>>2]=f,b[f+56>>2]=0,b[f+60>>2]=0,b[f+8>>2]=f,(0|(c=b[r+20>>2]))!=(0|(t=b[e+20>>2]))){for(i=a=b[t+8>>2];b[i+20>>2]=c,(0|a)!=(0|(i=b[i+12>>2])););i=b[t>>2],a=b[t+4>>2],b[i+4>>2]=a,b[a>>2]=i,Y(t),u=b[r+4>>2],a=b[f+8>>2],i=b[r+20>>2]}else a=f,i=t;if(r=b[r+12>>2],s=b[r+8>>2],b[b[a+4>>2]+12>>2]=r,b[b[s+4>>2]+12>>2]=f,b[f+8>>2]=s,b[r+8>>2]=a,r=b[e+8>>2],a=b[f+40>>2],b[b[a+4>>2]+12>>2]=e,b[b[r+4>>2]+12>>2]=o,b[f+40>>2]=r,b[e+8>>2]=a,b[f+16>>2]=b[u+16>>2],e=b[e+16>>2],r=i,b[f+52>>2]=r,b[f+48>>2]=e,b[f+20>>2]=r,b[r+8>>2]=o,i=f,(0|t)==(0|c)&&(i=0,e=O(24))){for(i=b[r+4>>2],b[e+4>>2]=i,b[i>>2]=e,b[e>>2]=r,b[r+4>>2]=e,b[e+12>>2]=0,b[e+16>>2]=0,b[e+8>>2]=f,n[e+20|0]=0,n[e+21|0]=k[r+21|0],i=f;b[i+20>>2]=e,(0|(i=b[i+12>>2]))!=(0|f););i=f}}return i}function fr(r,e,f){var i=0,a=0;if(f>>>0>=512)T(0|r,0|e,0|f);else{i=r+f|0;r:if(3&(r^e))if(i>>>0<4)f=r;else if((a=i-4|0)>>>0>>0)f=r;else for(f=r;n[0|f]=k[0|e],n[f+1|0]=k[e+1|0],n[f+2|0]=k[e+2|0],n[f+3|0]=k[e+3|0],e=e+4|0,a>>>0>=(f=f+4|0)>>>0;);else{e:if(3&r)if((0|f)<1)f=r;else for(f=r;;){if(n[0|f]=k[0|e],e=e+1|0,!(3&(f=f+1|0)))break e;if(!(f>>>0>>0))break}else f=r;if(!((r=-4&i)>>>0<64||(a=r+-64|0)>>>0>>0))for(;b[f>>2]=b[e>>2],b[f+4>>2]=b[e+4>>2],b[f+8>>2]=b[e+8>>2],b[f+12>>2]=b[e+12>>2],b[f+16>>2]=b[e+16>>2],b[f+20>>2]=b[e+20>>2],b[f+24>>2]=b[e+24>>2],b[f+28>>2]=b[e+28>>2],b[f+32>>2]=b[e+32>>2],b[f+36>>2]=b[e+36>>2],b[f+40>>2]=b[e+40>>2],b[f+44>>2]=b[e+44>>2],b[f+48>>2]=b[e+48>>2],b[f+52>>2]=b[e+52>>2],b[f+56>>2]=b[e+56>>2],b[f+60>>2]=b[e+60>>2],e=e- -64|0,a>>>0>=(f=f- -64|0)>>>0;);if(r>>>0<=f>>>0)break r;for(;b[f>>2]=b[e>>2],e=e+4|0,r>>>0>(f=f+4|0)>>>0;);}if(f>>>0>>0)for(;n[0|f]=k[0|e],e=e+1|0,(0|i)!=(0|(f=f+1|0)););}}function ir(r){var e=0,f=0,i=0,a=0,n=0,t=0;if(n=r|=0,r=0,(e=O(64))&&(i=b[n+4>>2],a=b[(f=i>>>0>>0?i:n)+4>>2],t=b[a>>2],b[e+32>>2]=t,b[b[t+4>>2]>>2]=e,b[e>>2]=f,f=e+32|0,b[a>>2]=f,b[e+16>>2]=0,b[e+20>>2]=0,b[e+12>>2]=f,b[e+4>>2]=f,b[e+24>>2]=0,b[e+28>>2]=0,b[e+48>>2]=0,b[e+52>>2]=0,b[e+40>>2]=f,b[e+36>>2]=e,b[e+56>>2]=0,b[e+60>>2]=0,b[e+8>>2]=e,a=b[n+12>>2],t=b[a+8>>2],b[e+44>>2]=a,b[b[t+4>>2]+12>>2]=e,b[e+8>>2]=t,b[a+8>>2]=e,a=b[i+16>>2],b[e+16>>2]=a,i=O(40))){for(r=b[a+4>>2],b[i+4>>2]=r,b[r>>2]=i,b[i>>2]=a,b[a+4>>2]=i,b[i+12>>2]=0,b[i+8>>2]=f,r=f;b[r+16>>2]=i,(0|f)!=(0|(r=b[r+8>>2])););r=b[n+20>>2],b[e+20>>2]=r,b[e+52>>2]=r,r=e}return r?(e=b[r+4>>2],r=b[n+4>>2],f=b[b[r+4>>2]+12>>2],i=b[f+8>>2],a=b[r+8>>2],b[b[a+4>>2]+12>>2]=f,b[b[i+4>>2]+12>>2]=r,b[r+8>>2]=i,b[f+8>>2]=a,f=b[e+8>>2],i=b[r+8>>2],b[b[i+4>>2]+12>>2]=e,b[b[f+4>>2]+12>>2]=r,b[r+8>>2]=f,b[e+8>>2]=i,b[r+16>>2]=b[e+16>>2],f=b[e+4>>2],b[b[f+16>>2]+8>>2]=f,b[f+20>>2]=b[r+20>>2],b[e+28>>2]=b[n+28>>2],b[f+28>>2]=b[r+28>>2],0|e):0}function ar(r,e,f,i,a,t){var o=0,k=0,u=0,c=0,s=0;c=e+4|0,u=r- -64|0;r:{for(;;){if(k=b[f+4>>2],!(o=O(16)))break r;if(b[o>>2]=k,s=Fr(b[u>>2],b[e+4>>2],o),b[o+4>>2]=s,!s)break r;if(n[o+13|0]=0,n[o+14|0]=0,n[o+15|0]=0,b[k+24>>2]=o,(0|i)==(0|(f=b[f+8>>2])))break}if(o=b[b[b[e+4>>2]+8>>2]>>2],f=b[b[o>>2]+4>>2],a=a||b[f+8>>2],b[f+16>>2]==b[a+16>>2])for(u=0;;){if(i=e,e=o,(0|(o=a))!=b[(a=f)+8>>2]){if(!tr(b[b[a+4>>2]+12>>2],a))break r;if(!tr(b[b[o+4>>2]+12>>2],a))break r}k=b[i+8>>2]-b[a+28>>2]|0,b[e+8>>2]=k;e:{f:switch(b[r+56>>2]-100130|0){case 0:f=1&k;break e;case 1:f=0!=(0|k);break e;case 2:f=(0|k)>0;break e;case 3:f=k>>>31|0;break e;case 4:break f;default:break e}f=k+1>>>0>2}if(n[e+12|0]=f,n[i+14|0]=1,u&&G(r,i)&&(b[a+28>>2]=b[a+28>>2]+b[o+28>>2],f=b[a+4>>2],b[f+28>>2]=b[f+28>>2]+b[b[o+4>>2]+28>>2],b[b[i>>2]+24>>2]=0,Vr(b[c>>2]),Y(i),!rr(o)))break r;if(c=e+4|0,u=1,o=b[b[b[e+4>>2]+8>>2]>>2],f=b[b[o>>2]+4>>2],b[f+16>>2]!=b[a+16>>2])break}return n[e+14|0]=1,void(t&&X(r,e))}Zr(r+1740|0,1),E()}function nr(r){var e=0,f=0,i=0,a=0,n=0,t=0,o=0,u=0,c=0;if((0|(a=b[40+(r|=0)>>2]))!=(0|(o=r+40|0)))for(;;){if(c=b[a>>2],!k[a+21|0]){for(u=b[a+8>>2],r=b[u+12>>2];;){if(b[r+20>>2]=0,t=b[r+12>>2],e=b[r+4>>2],!b[e+20>>2]){if(i=b[r+16>>2],(0|(f=b[r+8>>2]))!=(0|r))b[i+8>>2]=f,i=b[e+12>>2],n=b[i+8>>2],b[b[f+4>>2]+12>>2]=i,b[b[n+4>>2]+12>>2]=r,b[r+8>>2]=n,b[i+8>>2]=f;else{for(e=f=b[i+8>>2];b[e+16>>2]=0,(0|f)!=(0|(e=b[e+8>>2])););e=b[i>>2],f=b[i+4>>2],b[e+4>>2]=f,b[f>>2]=e,Y(i),e=b[r+4>>2]}if(i=b[e+16>>2],(0|(f=b[e+8>>2]))!=(0|e))b[i+8>>2]=f,i=b[b[e+4>>2]+12>>2],n=b[i+8>>2],b[b[f+4>>2]+12>>2]=i,b[b[n+4>>2]+12>>2]=e,b[e+8>>2]=n,b[i+8>>2]=f;else{for(e=f=b[i+8>>2];b[e+16>>2]=0,(0|f)!=(0|(e=b[e+8>>2])););e=b[i>>2],f=b[i+4>>2],b[e+4>>2]=f,b[f>>2]=e,Y(i),e=b[r+4>>2]}i=b[(e=r>>>0>e>>>0?e:r)>>2],f=b[b[e+4>>2]>>2],b[b[i+4>>2]>>2]=f,b[b[f+4>>2]>>2]=i,Y(e)}if(e=(0|r)!=(0|u),r=t,!e)break}r=b[a>>2],t=b[a+4>>2],b[r+4>>2]=t,b[t>>2]=r,Y(a)}if((0|o)==(0|(a=c)))break}}function tr(r,e){var f=0,i=0,a=0,t=0,o=0,u=0;if((0|(r|=0))!=(0|(e|=0))){if((0|(i=b[e+16>>2]))!=(0|(o=b[r+16>>2]))){for(f=a=b[i+8>>2];b[f+16>>2]=o,(0|a)!=(0|(f=b[f+8>>2])););f=b[i>>2],a=b[i+4>>2],b[f+4>>2]=a,b[a>>2]=f,Y(i)}if((0|(u=b[r+20>>2]))!=(0|(a=b[e+20>>2]))){for(f=t=b[a+8>>2];b[f+20>>2]=u,(0|t)!=(0|(f=b[f+12>>2])););f=b[a>>2],t=b[a+4>>2],b[f+4>>2]=t,b[t>>2]=f,Y(a)}if(f=b[r+8>>2],t=b[e+8>>2],b[b[t+4>>2]+12>>2]=r,b[b[f+4>>2]+12>>2]=e,b[e+8>>2]=f,b[r+8>>2]=t,(0|i)==(0|o)){if(!(i=O(40)))return 0;for(f=b[r+16>>2],o=b[f+4>>2],b[i+4>>2]=o,b[o>>2]=i,b[i>>2]=f,b[f+4>>2]=i,b[i+12>>2]=0,b[i+8>>2]=e,f=e;b[f+16>>2]=i,(0|(f=b[f+8>>2]))!=(0|e););b[b[r+16>>2]+8>>2]=r}if((0|a)==(0|u)){if(!(i=O(24)))return 0;for(f=b[r+20>>2],a=b[f+4>>2],b[i+4>>2]=a,b[a>>2]=i,b[i>>2]=f,b[f+4>>2]=i,b[i+12>>2]=0,b[i+16>>2]=0,b[i+8>>2]=e,n[i+20|0]=0,n[i+21|0]=k[f+21|0],f=e;b[f+20>>2]=i,(0|(f=b[f+12>>2]))!=(0|e););b[b[r+20>>2]+8>>2]=r}}return 1}function or(r,e){var f=0,i=0,a=0,n=0,t=0,o=0,k=m(0),u=0,c=0,s=m(0);if(b[r+20>>2]){i=e,f=b[r>>2],r=b[f+8>>2]+1|0,b[f+8>>2]=r;r:{if(!((0|(e=b[f+12>>2]))>=r<<1)){if(b[f+12>>2]=e<<1,a=b[f+4>>2],e=Z(n=b[f>>2],e<<3|4),b[f>>2]=e,!e){b[f>>2]=n,a=2147483647;break r}if(e=Z(b[f+4>>2],8+(b[f+12>>2]<<3)|0),b[f+4>>2]=e,!e){b[f+4>>2]=a,a=2147483647;break r}}if(n=b[f+4>>2],a=r,(e=b[f+16>>2])&&(b[f+16>>2]=b[4+(n+(e<<3)|0)>>2],a=e),t=b[f>>2],b[t+(r<<2)>>2]=a,b[(o=n+(a<<3)|0)>>2]=i,b[o+4>>2]=r,b[f+20>>2]){e:if(r>>>0<2)e=r;else for(k=d[i+28>>2];;){if(f=b[((e=r>>1)<<2)+t>>2],c=b[(u=n+(f<<3)|0)>>2],(s=d[c+28>>2])>2]<=d[i+32>>2])|k!=s)){e=r;break e}if(b[(r<<2)+t>>2]=f,b[u+4>>2]=r,!((r=e)>>>0>1))break}b[(e<<2)+t>>2]=a,b[o+4>>2]=e}}return a}if(i=(f=b[r+12>>2])+1|0,b[r+12>>2]=i,a=b[r+4>>2],(0|(n=i))<(0|(i=b[r+16>>2])))i=a;else if(b[r+16>>2]=i<<1,i=Z(a,i<<3),b[r+4>>2]=i,!i)return b[r+4>>2]=a,2147483647;return b[(f<<2)+i>>2]=e,-1^f}function br(r){r|=0;var e=0,f=0,i=0,a=0,t=0,o=0,u=0;t=O(40),o=O(40);r:{if(!(i=O(24))||!t|!o){if(t&&Y(t),o&&Y(o),!i)break r;return Y(i),0}if(!(e=O(64)))return 0;for(f=b[r+68>>2],a=b[(f=f>>>0<(a=r- -64|0)>>>0?f:a)+4>>2],u=b[a>>2],b[e+32>>2]=u,b[b[u+4>>2]>>2]=e,b[e>>2]=f,f=a,a=e+32|0,b[f>>2]=a,b[e+16>>2]=0,b[e+20>>2]=0,b[e+12>>2]=a,b[e+4>>2]=a,b[e+24>>2]=0,b[e+28>>2]=0,b[e+48>>2]=0,b[e+52>>2]=0,b[e+44>>2]=e,b[e+40>>2]=a,b[e+36>>2]=e,b[e+56>>2]=0,b[e+60>>2]=0,b[e+8>>2]=e,f=b[r+4>>2],b[t+4>>2]=f,b[f>>2]=t,b[t+12>>2]=0,b[t+8>>2]=e,f=e;b[f+16>>2]=t,(0|(f=b[f+8>>2]))!=(0|e););for(b[o+4>>2]=t,b[t>>2]=o,b[o>>2]=r,b[r+4>>2]=o,b[o+12>>2]=0,b[o+8>>2]=a,f=a;b[f+16>>2]=o,(0|a)!=(0|(f=b[f+8>>2])););for(f=b[r+44>>2],b[i+4>>2]=f,b[f>>2]=i,b[i>>2]=r+40,b[r+44>>2]=i,b[i+12>>2]=0,b[i+16>>2]=0,b[i+8>>2]=e,n[i+20|0]=0,n[i+21|0]=k[r+61|0],f=e;b[f+20>>2]=i,(0|(f=b[f+12>>2]))!=(0|e););}return 0|e}function kr(r,e){var f=0,i=0,a=0,t=0,o=0,u=0;b[r+8>>2]=b[283],f=b[282],b[r>>2]=b[281],b[r+4>>2]=f,f=b[e+20>>2];r:if(k[f+21|0]){a=e;e:{f:{for(;;){if(k[f+20|0])break r;if(n[f+20|0]=1,b[f+16>>2]=i,a=b[b[a+12>>2]+4>>2],i=b[a+20>>2],k[i+21|0]){if(k[i+20|0])break f;if(n[i+20|0]=1,b[i+16>>2]=f,t=t+2|0,a=b[a+8>>2],f=b[a+20>>2],k[f+21|0])continue;break r}break}t|=1;break e}t|=1}i=f}else a=e;o=b[e+4>>2],f=b[o+20>>2];r:if(!(!k[f+21|0]|k[f+20|0])){e:{f:{for(;;){if(n[f+20|0]=1,b[f+16>>2]=i,e=b[o+12>>2],o=b[e+4>>2],i=b[o+20>>2],k[i+21|0]){if(k[i+20|0])break f;if(n[i+20|0]=1,b[i+16>>2]=f,u=u+2|0,e=b[b[o+8>>2]+4>>2],o=b[e+4>>2],f=b[o+20>>2],!k[f+21|0])break r;if(!k[f+20|0])continue;break r}break}u|=1;break e}u|=1}i=f}f=t+u|0,b[r>>2]=f;r:{if(1&t){if(!(1&u))break r;b[r>>2]=f-1,e=e+8|0}else e=a+4|0;e=b[e>>2]}if(b[r+4>>2]=e,i)for(;n[i+20|0]=0,i=b[i+16>>2];);}function ur(r,e,f){e|=0,f|=0,3==(0|(f=b[1716+(r|=0)>>2]))?be[b[r+88>>2]](5):be[0|f](5,b[r+1896>>2]),5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[e+16>>2]+12>>2]):be[0|f](b[b[e+16>>2]+12>>2],b[r+1896>>2]),5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[b[e+4>>2]+16>>2]+12>>2]):be[0|f](b[b[b[e+4>>2]+16>>2]+12>>2],b[r+1896>>2]),f=b[e+20>>2];r:if(k[f+21|0])for(;;){if(k[f+20|0])break r;if(n[f+20|0]=1,e=b[b[e+12>>2]+4>>2],5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[e+16>>2]+12>>2]):be[0|f](b[b[e+16>>2]+12>>2],b[r+1896>>2]),f=b[e+20>>2],!k[f+21|0]|k[f+20|0])break r;if(n[f+20|0]=1,e=b[e+8>>2],5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[b[e+4>>2]+16>>2]+12>>2]):be[0|f](b[b[b[e+4>>2]+16>>2]+12>>2],b[r+1896>>2]),f=b[e+20>>2],!k[f+21|0])break}6==(0|(e=b[r+1728>>2]))?be[b[r+100>>2]]():be[0|e](b[r+1896>>2])}function cr(r,e){e|=0;var f=0;if((0|(f=b[(r|=0)>>2]))!=(0|e))for(;;){r:if(e>>>0>f>>>0){e:switch(0|f){case 0:11==(0|(f=b[r+1732>>2]))?be[b[r+12>>2]](100151):be[0|f](100151,b[r+1896>>2]),b[r>>2]&&cr(r,0),b[r+112>>2]=0,f=1,b[r>>2]=1,n[r+108|0]=0,b[r+1896>>2]=0,b[r+8>>2]=0;break r;case 1:break e;default:break r}if(11==(0|(f=b[r+1732>>2]))?be[b[r+12>>2]](100152):be[0|f](100152,b[r+1896>>2]),1!=b[r>>2]&&cr(r,1),b[r>>2]=2,b[r+4>>2]=0,f=2,b[r+112>>2]<1)break r;n[r+108|0]=1}else{e:switch(f-1|0){case 1:11==(0|(f=b[r+1732>>2]))?be[b[r+12>>2]](100154):be[0|f](100154,b[r+1896>>2]),2!=b[r>>2]&&cr(r,2),f=1,b[r>>2]=1;break r;case 0:break e;default:break r}11==(0|(f=b[r+1732>>2]))?be[b[r+12>>2]](100153):be[0|f](100153,b[r+1896>>2]),(f=b[r+8>>2])&&Pr(f),f=0,b[r+8>>2]=0,b[r>>2]=0,b[r+4>>2]=0}if((0|e)==(0|f))break}}function sr(r,e,f){var i=0,a=0,n=0,t=0,o=0,b=0,k=0,u=0,c=0;r:{e:{f:{i:{a:{n:{t:{o:{b:{k:{if(a=e,e){if(!(i=f))break k;break b}r=(r>>>0)/(f>>>0)|0,F=0;break r}if(!r)break o;break t}if(!(i-1&i))break n;b=0-(o=(y(i)+33|0)-y(a)|0)|0;break i}r=(a>>>0)/0|0,F=0;break r}if((i=32-y(a)|0)>>>0<31)break a;break f}if(1==(0|i))break e;f=31&(i=i?31-y(i-1^i)|0:32),(63&i)>>>0>=32?(a=0,r=e>>>f|0):(a=e>>>f|0,r=((1<>>f),F=a;break r}o=i+1|0,b=63-i|0}if(i=e,n=31&(a=63&o),a>>>0>=32?(a=0,n=i>>>n|0):(a=i>>>n|0,n=((1<>>n),i=31&(b&=63),b>>>0>=32?(e=r<>>32-i|e<>>31)-(u=f&(t=b-((a=a<<1|n>>>31)+(i>>>0>>0)|0)>>31))|0,a=a-(k>>>0>>0)|0,e=e<<1|r>>>31,r=c|r<<1,c=t&=1,o=o-1|0;);F=e<<1|r>>>31,r=t|r<<1;break r}r=0,e=0}F=e}return r}function Ar(r,e,f){e|=0,f|=0;var i=0,a=0,n=0,t=0,o=0,k=0,u=0;U=a=U-32|0,n=b[28+(r|=0)>>2],b[a+16>>2]=n,i=b[r+20>>2],b[a+28>>2]=f,b[a+24>>2]=e,e=i-n|0,b[a+20>>2]=e,n=e+f|0,u=2,e=a+16|0;r:{e:{(i=0|S(b[r+60>>2],a+16|0,2,a+12|0))?(b[613]=i,i=-1):i=0;f:{if(!i)for(;;){if((0|(i=b[a+12>>2]))==(0|n))break f;if((0|i)<=-1)break e;if(t=i-((o=(t=b[e+4>>2])>>>0>>0)?t:0)|0,b[(k=(o<<3)+e|0)>>2]=t+b[k>>2],b[(k=(o?12:4)+e|0)>>2]=b[k>>2]-t,n=n-i|0,e=o?e+8|0:e,u=u-o|0,(i=0|S(b[r+60>>2],0|e,0|u,a+12|0))?(b[613]=i,i=-1):i=0,i)break}if(-1!=(0|n))break e}e=b[r+44>>2],b[r+28>>2]=e,b[r+20>>2]=e,b[r+16>>2]=e+b[r+48>>2],r=f;break r}b[r+28>>2]=0,b[r+16>>2]=0,b[r+20>>2]=0,b[r>>2]=32|b[r>>2],r=0,2!=(0|u)&&(r=f-b[e+4>>2]|0)}return U=a+32|0,0|r}function lr(r){var e=0,f=0,i=0,a=0,n=0,t=0,o=m(0),k=0,u=m(0),c=0,s=0,A=0,l=0,v=0,h=0;if(a=b[r+4>>2],f=b[r>>2],i=b[f+4>>2],v=b[(e=a+(i<<3)|0)>>2],!((0|(n=b[r+8>>2]))<1)&&(c=b[(n<<2)+f>>2],b[f+4>>2]=c,b[4+(s=(c<<3)+a|0)>>2]=1,b[e>>2]=0,b[e+4>>2]=b[r+16>>2],A=n-1|0,b[r+8>>2]=A,b[r+16>>2]=i,1!=(0|n))){for(h=(c<<3)+a|0,e=1;(0|A)<=(0|(r=e<<1))||(t=b[(b[((i=1|r)<<2)+f>>2]<<3)+a>>2],o=d[t+28>>2],k=b[(b[(r<<2)+f>>2]<<3)+a>>2],u=d[k+28>>2],!(d[t+32>>2]<=d[k+32>>2])|o!=u&&!(o=(0|n)||(i=b[h>>2],o=d[i+28>>2],t=b[(r<<2)+f>>2],l=b[(k=(t<<3)+a|0)>>2],o<(u=d[l+28>>2])|(d[i+32>>2]<=d[l+32>>2]?o==u:0)));)b[(e<<2)+f>>2]=t,b[k+4>>2]=e,e=r;b[(e<<2)+f>>2]=c,b[s+4>>2]=e}return v}function vr(r,e,f){e|=0,f|=0,3==(0|(f=b[1716+(r|=0)>>2]))?be[b[r+88>>2]](6):be[0|f](6,b[r+1896>>2]),5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[e+16>>2]+12>>2]):be[0|f](b[b[e+16>>2]+12>>2],b[r+1896>>2]),5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[b[e+4>>2]+16>>2]+12>>2]):be[0|f](b[b[b[e+4>>2]+16>>2]+12>>2],b[r+1896>>2]),f=b[e+20>>2];r:if(k[f+21|0])for(;;){if(k[f+20|0])break r;if(n[f+20|0]=1,e=b[e+8>>2],5==(0|(f=b[r+1724>>2]))?be[b[r+96>>2]](b[b[b[e+4>>2]+16>>2]+12>>2]):be[0|f](b[b[b[e+4>>2]+16>>2]+12>>2],b[r+1896>>2]),f=b[e+20>>2],!k[f+21|0])break}6==(0|(e=b[r+1728>>2]))?be[b[r+100>>2]]():be[0|e](b[r+1896>>2])}function dr(r,e,f){var i=0,a=0;if(f&&(n[(i=r+f|0)-1|0]=e,n[0|r]=e,!(f>>>0<3||(n[i-2|0]=e,n[r+1|0]=e,n[i-3|0]=e,n[r+2|0]=e,f>>>0<7||(n[i-4|0]=e,n[r+3|0]=e,f>>>0<9||(i=(i=r)+(r=0-r&3)|0,a=p(255&e,16843009),b[i>>2]=a,b[(e=(r=f-r&-4)+i|0)-4>>2]=a,r>>>0<9||(b[i+8>>2]=a,b[i+4>>2]=a,b[e-8>>2]=a,b[e-12>>2]=a,r>>>0<25||(b[i+24>>2]=a,b[i+20>>2]=a,b[i+16>>2]=a,b[i+12>>2]=a,b[e-16>>2]=a,b[e-20>>2]=a,b[e-24>>2]=a,b[e-28>>2]=a,(f=r-(e=4&i|24)|0)>>>0<32))))))))for(a=Or(a,0,1,1),r=F,e=e+i|0;b[e+24>>2]=a,i=r,b[e+28>>2]=i,b[e+16>>2]=a,b[e+20>>2]=i,b[e+8>>2]=a,b[e+12>>2]=i,b[e>>2]=a,b[e+4>>2]=i,e=e+32|0,(f=f-32|0)>>>0>31;);}function hr(r,e,f){r:if(!(e>>>0>20)){e:switch(e-9|0){case 0:return e=b[f>>2],b[f>>2]=e+4,void(b[r>>2]=b[e>>2]);case 1:return e=b[f>>2],b[f>>2]=e+4,e=b[e>>2],b[r>>2]=e,void(b[r+4>>2]=e>>31);case 2:return e=b[f>>2],b[f>>2]=e+4,b[r>>2]=b[e>>2],void(b[r+4>>2]=0);case 3:return e=b[f>>2]+7&-8,b[f>>2]=e+8,f=b[e+4>>2],b[r>>2]=b[e>>2],void(b[r+4>>2]=f);case 4:return e=b[f>>2],b[f>>2]=e+4,e=o[e>>1],b[r>>2]=e,void(b[r+4>>2]=e>>31);case 5:return e=b[f>>2],b[f>>2]=e+4,b[r>>2]=l[e>>1],void(b[r+4>>2]=0);case 6:return e=b[f>>2],b[f>>2]=e+4,e=n[0|e],b[r>>2]=e,void(b[r+4>>2]=e>>31);case 7:return e=b[f>>2],b[f>>2]=e+4,b[r>>2]=k[0|e],void(b[r+4>>2]=0);case 8:return e=b[f>>2]+7&-8,b[f>>2]=e+8,void(h[r>>3]=h[e>>3]);case 9:break e;default:break r}be[0](r,f)}}function pr(r,e,f){var i=m(0),a=m(0),n=0,t=0,o=m(0),k=m(0),u=0,c=m(0),s=m(0);U=t=U+-64|0,u=(i=d[e+28>>2])>(a=d[r+28>>2]);r:{e:{if(!(!(d[r+32>>2]<=d[e+32>>2])|i!=a)||u){if((o=d[f+28>>2])>i|(d[e+32>>2]<=d[f+32>>2]?i==o:0))break r;if(n=1,u)break e}n=0,i==a&&(n=d[r+32>>2]<=d[e+32>>2])}u=n,n=1,(o=d[f+28>>2])>i||(n=0,i==o&&(n=d[e+32>>2]<=d[f+32>>2])),k=d[r+32>>2],c=d[e+32>>2],s=d[f+32>>2],h[t+40>>3]=o,h[t+24>>3]=i,h[t+48>>3]=s,h[t+32>>3]=c,h[t+16>>3]=k,h[t+8>>3]=a,b[t+4>>2]=n,b[t>>2]=u,Gr(1092,t),o=d[f+28>>2],a=d[r+28>>2],i=d[e+28>>2]}return k=m(0),U=t- -64|0,a=m(i-a),i=m(o-i),m(a+i)>m(0)&&(k=a,a=d[e+32>>2],k=m(m(k*m(a-d[f+32>>2]))+m(i*m(a-d[r+32>>2])))),k}function mr(r,e,f){var i=0,a=0,t=0,o=0;i=b[e>>2];r:{if((0|e)!=(0|f))for(;;){if(n[e+15|0]=0,o=b[e+4>>2],t=b[b[o+8>>2]>>2],a=b[t>>2],b[a+16>>2]!=b[i+16>>2]){if(!k[t+15|0])return r=k[e+12|0],f=b[i+20>>2],b[f+8>>2]=i,n[f+21|0]=r,b[i+24>>2]=0,Vr(o),Y(e),i;if(!(a=er(b[b[i+8>>2]+4>>2],b[a+4>>2])))break r;if(!rr(b[t>>2]))break r;b[t>>2]=a,n[t+15|0]=0,b[a+24>>2]=t}if(b[i+8>>2]!=(0|a)){if(!tr(b[b[a+4>>2]+12>>2],a))break r;if(!tr(i,a))break r}if(a=k[e+12|0],i=b[e>>2],o=b[i+20>>2],b[o+8>>2]=i,n[o+21|0]=a,b[i+24>>2]=0,Vr(b[e+4>>2]),Y(e),i=b[t>>2],(0|f)==(0|(e=t)))break}return i}Zr(r+1740|0,1),E()}function wr(r,e,f){switch(e-100100|0){case 0:return void(b[r+88>>2]=f||15);case 6:return void(b[r+1716>>2]=f||3);case 4:return n[r+80|0]=0!=(0|f),void(b[r+92>>2]=f||14);case 10:return n[r+80|0]=0!=(0|f),void(b[r+1720>>2]=f||4);case 1:return void(b[r+96>>2]=f||13);case 7:return void(b[r+1724>>2]=f||5);case 2:return void(b[r+100>>2]=f||12);case 8:return void(b[r+1728>>2]=f||6);case 3:return void(b[r+12>>2]=f||18);case 9:return void(b[r+1732>>2]=f||11);case 5:return void(b[r+76>>2]=f||17);case 11:return void(b[r+1736>>2]=f||8);case 12:return void(b[r+104>>2]=f||16)}11==(0|(e=b[r+1732>>2]))?be[b[r+12>>2]](100900):be[0|e](100900,b[r+1896>>2])}function yr(r,e,f){var i=0,a=0,t=0;if(!(32&k[0|r]))r:{a=e,i=f;e:{if(!(r=b[(e=r)+16>>2])){if(r=k[e+74|0],n[e+74|0]=r-1|r,8&(r=b[e>>2])?(b[e>>2]=32|r,r=-1):(b[e+4>>2]=0,b[e+8>>2]=0,r=b[e+44>>2],b[e+28>>2]=r,b[e+20>>2]=r,b[e+16>>2]=r+b[e+48>>2],r=0),r)break e;r=b[e+16>>2]}if(r-(t=b[e+20>>2])>>>0>>0){be[b[e+36>>2]](e,a,f);break r}f:if(!(n[e+75|0]<0)){for(r=f;;){if(i=r,!r)break f;if(10==k[a+(r=i-1|0)|0])break}if(be[b[e+36>>2]](e,a,i)>>>0>>0)break e;a=i+a|0,f=f-i|0,t=b[e+20>>2]}fr(t,a,f),b[e+20>>2]=b[e+20>>2]+f}}}function gr(r,e,f,i){var a=0,t=0;U=a=U-208|0,b[a+204>>2]=f,dr(a+160|0,0,40),b[a+200>>2]=b[a+204>>2],(0|W(0,e,a+200|0,a+80|0,a+160|0,i))<0||(b[r+76>>2],f=b[r>>2],n[r+74|0]<=0&&(b[r>>2]=-33&f),t=32&f,b[r+48>>2]?W(r,e,a+200|0,a+80|0,a+160|0,i):(b[r+48>>2]=80,b[r+16>>2]=a+80,b[r+28>>2]=a,b[r+20>>2]=a,f=b[r+44>>2],b[r+44>>2]=a,W(r,e,a+200|0,a+80|0,a+160|0,i),f&&(be[b[r+36>>2]](r,0,0),b[r+48>>2]=0,b[r+44>>2]=f,b[r+28>>2]=0,b[r+16>>2]=0,b[r+20>>2]=0)),b[r>>2]=b[r>>2]|t),U=a+208|0}function Er(r,e){r|=0;var f=0,i=0,a=0;if((0|(f=b[40+(e|=0)>>2]))!=(0|(i=e+40|0)))for(;;){if(k[f+21|0]){for(3==(0|(e=b[r+1716>>2]))?be[b[r+88>>2]](2):be[0|e](2,b[r+1896>>2]),e=b[f+8>>2];5==(0|(a=b[r+1724>>2]))?be[b[r+96>>2]](b[b[e+16>>2]+12>>2]):be[0|a](b[b[e+16>>2]+12>>2],b[r+1896>>2]),(0|(e=b[e+12>>2]))!=b[f+8>>2];);6==(0|(e=b[r+1728>>2]))?be[b[r+100>>2]]():be[0|e](b[r+1896>>2])}if((0|i)==(0|(f=b[f>>2])))break}}function Cr(r,e){if(!r)return 0;r:{e:{if(r){if(e>>>0<=127)break e;if(b[b[493]>>2]){if(e>>>0<=2047){n[r+1|0]=63&e|128,n[0|r]=e>>>6|192,r=2;break r}if(!(57344!=(-8192&e)&&e>>>0>=55296)){n[r+2|0]=63&e|128,n[0|r]=e>>>12|224,n[r+1|0]=e>>>6&63|128,r=3;break r}if(e-65536>>>0<=1048575){n[r+3|0]=63&e|128,n[0|r]=e>>>18|240,n[r+2|0]=e>>>6&63|128,n[r+1|0]=e>>>12&63|128,r=4;break r}}else if(57216==(-128&e))break e;b[613]=25,r=-1}else r=1;break r}n[0|r]=e,r=1}return r}function Rr(){var r=0,e=0,f=0;return(r=O(128))?(b[r+8>>2]=0,b[r+12>>2]=0,e=r+40|0,b[r+44>>2]=e,b[r+48>>2]=0,b[r+52>>2]=0,b[r+40>>2]=e,o[r+54>>1]=0,o[r+56>>1]=0,o[r+58>>1]=0,o[r+60>>1]=0,b[r+72>>2]=0,b[r+76>>2]=0,e=r+96|0,b[r+68>>2]=e,f=r- -64|0,b[r+64>>2]=f,b[r+80>>2]=0,b[r+84>>2]=0,b[r+88>>2]=0,b[r+92>>2]=0,b[r+104>>2]=0,b[r+108>>2]=0,b[r+100>>2]=f,b[r+96>>2]=e,b[r+112>>2]=0,b[r+116>>2]=0,b[r+120>>2]=0,b[r+124>>2]=0,b[r>>2]=r,b[r+4>>2]=r,0|r):0}function Mr(r,e,f){r|=0,e|=0,f|=0;var i=0,a=0,n=m(0),t=m(0);return f=b[f>>2],i=b[b[f+4>>2]+16>>2],e=b[e>>2],(0|(a=b[b[e+4>>2]+16>>2]))==(0|(r=b[r+72>>2]))?(0|r)==(0|i)?(e=b[e+16>>2],n=d[e+28>>2],f=b[f+16>>2],t=d[f+28>>2],!(!(d[e+32>>2]<=d[f+32>>2])|n!=t)||n=m(0)|0):pr(i,r,b[f+16>>2])<=m(0)|0:(e=b[e+16>>2],(0|r)==(0|i)?pr(a,r,e)>=m(0)|0:Ur(a,r,e)>=Ur(b[b[f+4>>2]+16>>2],r,b[f+16>>2])|0)}function Ir(r){var e=0,f=0,i=0,a=0,n=0,t=m(0),o=m(0),k=0;if(!(e=b[r+12>>2]))return lr(b[r>>2]);if(n=b[r+8>>2],i=b[b[(n+(e<<2)|0)-4>>2]>>2],f=b[r>>2],b[f+8>>2]&&(a=b[b[f+4>>2]+(b[b[f>>2]+4>>2]<<3)>>2],t=d[a+28>>2],o=d[i+28>>2],!(!(d[a+32>>2]<=d[i+32>>2])|t!=o)||t>2]=f,i;if(a=e<<2,e=k=e-1|0,b[b[(a+n|0)-8>>2]>>2])break}return b[r+12>>2]=k,i}function _r(r,e,f){e|=0,f|=0;var i=0,a=0,n=0,t=0;n=1;r:if((0|(i=b[64+(r|=0)>>2]))!=(0|(a=r- -64|0))){if(t=0-e|0,!f)for(;;)if(r=k[b[i+20>>2]+21|0],b[i+28>>2]=(0|r)==k[b[b[i+4>>2]+20>>2]+21|0]?0:r?e:t,(0|a)==(0|(i=b[i>>2])))break r;for(;;){if(r=b[i>>2],(0|(f=k[b[i+20>>2]+21|0]))==k[b[b[i+4>>2]+20>>2]+21|0]){if(!rr(i)){n=0;break r}}else b[i+28>>2]=f?e:t;if((0|a)==(0|(i=r)))break}}return 0|n}function Sr(r,e){var f=0,i=0,a=0;(f=O(16))&&(a=br(b[r+8>>2]))&&(i=b[a+16>>2],d[i+32>>2]=e,b[i+28>>2]=2112929218,i=b[b[a+4>>2]+16>>2],d[i+32>>2]=e,b[i+28>>2]=-34554430,b[r+72>>2]=i,n[f+15|0]=0,n[f+12|0]=0,b[f+8>>2]=0,b[f>>2]=a,n[f+13|0]=1,n[f+14|0]=0,i=f,f=Fr(a=b[r+64>>2],a,f),b[i+4>>2]=f,f)||(Zr(r+1740|0,1),E())}function Pr(r){var e=0,f=0,i=0;if((0|(e=b[40+(r|=0)>>2]))!=(0|(f=r+40|0)))for(;i=b[e>>2],Y(e),(0|f)!=(0|(e=i)););if((0|(e=b[r>>2]))!=(0|r))for(;i=b[e>>2],Y(e),(0|(e=i))!=(0|r););if((0|(e=b[r+64>>2]))!=(0|(f=r- -64|0)))for(;i=b[e>>2],Y(e),(0|f)!=(0|(e=i)););Y(r)}function xr(r){var e=0,f=m(0),i=m(0);if(!(e=b[r+12>>2]))return r=b[r>>2],b[b[r+4>>2]+(b[b[r>>2]+4>>2]<<3)>>2];e=b[b[(b[r+8>>2]+(e<<2)|0)-4>>2]>>2],r=b[r>>2];r:{if(b[r+8>>2]){if(r=b[b[r+4>>2]+(b[b[r>>2]+4>>2]<<3)>>2],(f=d[r+28>>2])<(i=d[e+28>>2]))break r;if(f==i&&d[r+32>>2]<=d[e+32>>2])break r}r=e}return r}function Lr(r,e,f,i){r|=0,e|=0,f|=0,i|=0,f=0;r:{if(e=b[520]){if(!((f=b[e>>2])>>>0<100001)){e=O(12);break r}}else e=O(1200008),b[e+4>>2]=12,b[e>>2]=0,b[520]=e;b[e>>2]=f+1,e=8+(p(f,12)+e|0)|0}d[e>>2]=d[r>>2],d[e+4>>2]=d[r+4>>2],d[e+8>>2]=d[r+8>>2],b[i>>2]=e}function jr(r,e,f){var i=0,a=0,t=0;if(e>>>0<1)i=r;else for(;i=sr(r,e,10),t=a=F,a=Or(i,a,10,0),n[0|(f=f-1|0)]=r-a|48,a=e>>>0>9,r=i,e=t,a;);if(i)for(;r=(i>>>0)/10|0,n[0|(f=f-1|0)]=i-p(r,10)|48,e=i>>>0>9,i=r,e;);return f}function Br(r,e,f,i){var a=0,n=0,t=0;if(n=b[610]+1|0,b[610]=n,b[r>>2]=n,i)for(;;){if(!b[(t=(a<<3)+f|0)>>2])return b[t>>2]=n,b[4+(r=(a<<3)+f|0)>>2]=e,b[r+8>>2]=0,C(0|i),f;if((0|(a=a+1|0))==(0|i))break}return a=r,r=i<<1,e=Br(a,e,Z(f,i<<4|8),r),C(0|r),e}function Tr(r,e){var f=0,i=0,a=0;if(A(+r),f=0|u(1),i=0|u(0),a=f,2047!=(0|(f=f>>>20&2047))){if(!f)return f=e,0==r?e=0:(r=Tr(0x10000000000000000*r,e),e=b[e>>2]+-64|0),b[f>>2]=e,r;b[e>>2]=f-1022,c(0,0|i),c(1,-2146435073&a|1071644672),r=+s()}return r}function Ur(r,e,f){var i=m(0),a=m(0),n=m(0),t=m(0),o=m(0);return i=d[e+28>>2],a=m(i-d[r+28>>2]),i=m(d[f+28>>2]-i),(n=m(a+i))>m(0)?(o=d[e+32>>2],t=d[((e=i>a)?r:f)+32>>2],i=m(m(o-t)+m(m((e?a:i)/n)*m(t-d[(e?f:r)+32>>2])))):i=m(0),i}function Fr(r,e,f){for(var i=0;e=b[e+8>>2],(i=b[e>>2])&&!(0|be[b[r+16>>2]](b[r+12>>2],i,f)););return(r=O(12))?(b[r>>2]=f,b[r+4>>2]=b[e+4>>2],b[b[e+4>>2]+8>>2]=r,b[r+8>>2]=e,b[e+4>>2]=r,r):0}function Or(r,e,f,i){var a=0,n=0,t=0,o=0,b=0,k=0;return k=p(a=f>>>16|0,n=r>>>16|0),a=(65535&(n=((b=p(t=65535&f,o=65535&r))>>>16|0)+p(n,t)|0))+p(a,o)|0,F=(p(e,f)+k|0)+p(r,i)+(n>>>16)+(a>>>16)|0,65535&b|a<<16}function Dr(r,e,f,i,a){var n=0;if(U=n=U-256|0,!(73728&a|(0|f)<=(0|i))){if(dr(n,255&e,(i=(f=f-i|0)>>>0<256)?f:256),!i)for(;yr(r,n,256),(f=f-256|0)>>>0>255;);yr(r,n,f)}U=n+256|0}function Hr(r,e,f){var i=0,a=0;r:if(f)for(;;){if(!(a=b[(i<<3)+e>>2]))break r;if((0|r)==(0|a))return b[4+((i<<3)+e|0)>>2];if((0|(i=i+1|0))==(0|f))break}return 0}function Qr(r){var e=0,f=0;return(r=(e=b[412])+(f=r+3&-4)|0)>>>0<=e>>>0&&f||r>>>0>ke()<<16>>>0&&!(0|P(0|r))?(b[613]=48,-1):(b[412]=r,e)}function Wr(r){var e=0,f=0,i=0;if(n[b[r>>2]]-48>>>0<10)for(;e=b[r>>2],i=n[0|e],b[r>>2]=e+1,f=(p(f,10)+i|0)-48|0,n[e+1|0]-48>>>0<10;);return f}function qr(r,e){r|=0;var f=0,i=0;(0|(f=b[4+(e|=0)>>2]))>2]&&(i=b[e>>2]+(p(b[e+12>>2],f)<<2)|0,d[i>>2]=d[r>>2],d[i+4>>2]=d[r+4>>2],b[e+4>>2]=f+1)}function zr(r,e){r|=0,e|=0;var f=m(0),i=m(0);if((f=d[r+28>>2])<(i=d[e+28>>2]))r=1;else{if(f!=i)return 0;r=d[r+32>>2]<=d[e+32>>2]}return 0|r}function Kr(r){var e=0;(e=b[r>>2])&&(Y(b[e+4>>2]),Y(b[e>>2]),Y(e)),(e=b[r+8>>2])&&Y(e),(e=b[r+4>>2])&&Y(e),Y(r)}function Yr(r){r|=0;var e=0;U=e=U-16|0,b[e>>2]=r,U=r=U-16|0,b[r+12>>2]=e,gr(b[288],1078,e,0),U=r+16|0,U=e+16|0}function Nr(r,e,f){r|=0,e=b[20+(e|=0)>>2],b[e+16>>2]=b[r+84>>2],b[r+84>>2]=e,n[e+20|0]=1}function Vr(r){var e=0;e=b[r+4>>2],b[e+8>>2]=b[r+8>>2],b[b[r+8>>2]+4>>2]=e,Y(r)}function Gr(r,e){var f=0;U=f=U-16|0,b[f+12>>2]=e,gr(b[288],r,e,43),U=f+16|0}function Jr(r){var e=0;return(-1>>>(e=31&r)&-2)<>>r}function Zr(r,e){r|=0,e|=0,b[611]||(b[612]=e,b[611]=r),x()}function Xr(r,e){r|=0,e|=0,b[611]||(b[612]=e,b[611]=r)}function $r(r,e,f,i){return F=0,0}function re(r,e,f,i,a){}function ee(r,e,f,i){}function fe(r){return 0}function ie(r,e){}function ae(){return 0|U}function ne(r){U=r|=0}function te(r){}function oe(){}f=k,t();var be=e([null,Nr,vr,ie,ie,ie,te,ur,re,zr,Mr,ie,oe,te,te,te,te,ee,te,cr,J,Rr,br,ir,tr,K,Zr,Q,_r,$,Er,N,nr,Pr,qr,te,oe,Lr,Yr,te,fe,Ar,$r,q]);function ke(){return a.byteLength/65536|0}function ue(r){r|=0;var e=0|ke(),t=e+r|0;if(e=i);)++a;if(a-e>16&&r.subarray&&L)return L.decode(r.subarray(e,a));for(var n=\"\";e>10,56320|1023&k)}}else n+=String.fromCharCode((31&t)<<6|o)}else n+=String.fromCharCode(t)}return n}function B(r,e){return r?j(P,r,e):\"\"}function T(r,e){return r%e>0&&(r+=e-r%e),r}function U(r){S=r,a.HEAP8=new Int8Array(r),a.HEAP16=new Int16Array(r),a.HEAP32=x=new Int32Array(r),a.HEAPU8=P=new Uint8Array(r),a.HEAPU16=new Uint16Array(r),a.HEAPU32=new Uint32Array(r),a.HEAPF32=new Float32Array(r),a.HEAPF64=new Float64Array(r)}var F,O=a.INITIAL_MEMORY||4194304;(R=a.wasmMemory?a.wasmMemory:new M.Memory({initial:O/65536,maximum:32768}))&&(S=R.buffer),O=S.byteLength,U(S);var D=[],H=[],Q=[];function W(){if(a.preRun)for(\"function\"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)K(a.preRun.shift());tr(D)}function q(){tr(H)}function z(){if(a.postRun)for(\"function\"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)N(a.postRun.shift());tr(Q)}function K(r){D.unshift(r)}function Y(r){H.unshift(r)}function N(r){Q.unshift(r)}var V=0,G=null;function J(r){V++,a.monitorRunDependencies&&a.monitorRunDependencies(V)}function Z(r){if(V--,a.monitorRunDependencies&&a.monitorRunDependencies(V),0==V&&G){var e=G;G=null,e()}}function X(r){throw a.onAbort&&a.onAbort(r),w(r+=\"\"),I=!0,r=\"abort(\"+r+\"). Build with -s ASSERTIONS=1 for more info.\",new M.RuntimeError(r)}a.preloadedImages={},a.preloadedAudios={};var $,rr=\"data:application/octet-stream;base64,\";function er(r){return r.startsWith(rr)}function fr(r){return r.startsWith(\"file://\")}function ir(r){try{if(r==$&&y)return new Uint8Array(y);var e=dr(r);if(e)return e;if(c)return c(r);throw\"both async and sync fetching of the wasm failed\"}catch(w){X(w)}}function ar(){if(!y&&(l||v)){if(\"function\"==typeof fetch&&!fr($))return fetch($,{credentials:\"same-origin\"}).then((function(r){if(!r.ok)throw\"failed to load wasm binary file at '\"+$+\"'\";return r.arrayBuffer()})).catch((function(){return ir($)}));if(u)return new Promise((function(r,e){u($,(function(e){r(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ir($)}))}function nr(){var r={a:hr};function e(r,e){var f=r.exports;a.asm=f,F=a.asm.q,Y(a.asm.n),Z()}function f(r){e(r.instance)}function i(e){return ar().then((function(e){return M.instantiate(e,r)})).then(e,(function(r){w(\"failed to asynchronously prepare wasm: \"+r),X(r)}))}function n(){return y||\"function\"!=typeof M.instantiateStreaming||er($)||fr($)||\"function\"!=typeof fetch?i(f):fetch($,{credentials:\"same-origin\"}).then((function(e){return M.instantiateStreaming(e,r).then(f,(function(r){return w(\"wasm streaming compile failed: \"+r),w(\"falling back to ArrayBuffer instantiation\"),i(f)}))}))}if(J(),a.instantiateWasm)try{return a.instantiateWasm(r,e)}catch(t){return w(\"Module.instantiateWasm callback failed with error: \"+t),!1}return n(),{}}function tr(r){for(;r.length>0;){var e=r.shift();if(\"function\"!=typeof e){var f=e.func;\"number\"==typeof f?void 0===e.arg?F.get(f)():F.get(f)(e.arg):f(void 0===e.arg?null:e.arg)}else e(a)}}function or(){throw\"longjmp\"}function br(r,e,f){P.copyWithin(r,e,e+f)}function kr(r){try{return R.grow(r-S.byteLength+65535>>>16),U(R.buffer),1}catch(e){}}function ur(r){var e=P.length,f=2147483648;if((r>>>=0)>f)return!1;for(var i=1;i<=4;i*=2){var a=e*(1+.2/i);if(a=Math.min(a,r+100663296),kr(Math.min(f,T(Math.max(r,a),65536))))return!0}return!1}er($=\"libtess-asm.wasm\")||($=p($));var cr={mappings:{},buffers:[null,[],[]],printChar:function(r,e){var f=cr.buffers[r];0===e||10===e?((1===r?m:w)(j(f,0)),f.length=0):f.push(e)},varargs:void 0,get:function(){return cr.varargs+=4,x[cr.varargs-4>>2]},getStr:function(r){return B(r)},get64:function(r,e){return r}};function sr(r,e,f,i){for(var a=0,n=0;n>2],o=x[e+(8*n+4)>>2],b=0;b>2]=a,0}function Ar(r){for(var e=[],f=0;f255&&(i&=255),e.push(String.fromCharCode(i))}return e.join(\"\")}var lr=\"function\"==typeof atob?atob:function(r){var e,f,i,a,n,t,o=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",b=\"\",k=0;r=r.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");do{e=o.indexOf(r.charAt(k++))<<2|(a=o.indexOf(r.charAt(k++)))>>4,f=(15&a)<<4|(n=o.indexOf(r.charAt(k++)))>>2,i=(3&n)<<6|(t=o.indexOf(r.charAt(k++))),b+=String.fromCharCode(e),64!==n&&(b+=String.fromCharCode(f)),64!==t&&(b+=String.fromCharCode(i))}while(k0||(W(),V>0||(a.setStatus?(a.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){a.setStatus(\"\")}),1),e()}),1)):e()))}if(G=function r(){pr||Sr(),pr||(G=r)},a.run=Sr,a.preInit)for(\"function\"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();Sr();let Pr=null,xr=null,Lr=null,jr=null;const Br=i.Module,Tr=2,Ur=4e3;let Fr=0;const Or=(r,e,f)=>{Pr||(Pr=Br._triangulate);let i=Br.HEAPF32;const a=Br.HEAP32.BYTES_PER_ELEMENT,n=2,t=i.BYTES_PER_ELEMENT;f>Fr&&(Fr=f,Lr&&(Br._free(Lr),Lr=0),xr&&(Br._free(xr),xr=0)),Lr||(Lr=Br._malloc(f*t)),jr||(jr=Br._malloc(Ur*a));const o=f*Tr;xr||(xr=Br._malloc(o*t)),i=Br.HEAPF32,i.set(r,Lr/t),Br.HEAP32.set(e,jr/a);const b=o/n,k=Pr(Lr,jr,Math.min(e.length,Ur),n,xr,b),u=k*n;i=Br.HEAPF32;const c=i.slice(xr/t,xr/t+u),s={};return s.buffer=c,s.vertexCount=k,s};return i.triangulate=Or,i.whenLoaded()}return{load:r}},void 0!==(a=i())&&(f.exports=a);var t=n.exports;const o=e({__proto__:null,default:r(t)},[t]);export{o as l};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{g as n}from\"./_commonjsHelpers.js\";function t(n,t){for(var e=0;er[t]})}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:\"Module\"}))}var e,r,o={exports:{}};o.exports,e=o,void 0!==(r=function(){function n(n){const t=n.locateFile,r={};var o=void 0!==o?o:{};const i=(()=>{let n;return{resolve:t=>n(t),promise:new Promise((t=>n=t))}})(),a=()=>i.promise;o.locateFile=t,o.onRuntimeInitialized=()=>{i.resolve(r)},r.Module=o,r.whenLoaded=a;var u,s={};for(u in o)o.hasOwnProperty(u)&&(s[u]=o[u]);var f,c,l,p,m,h=\"object\"==typeof window,d=\"function\"==typeof importScripts,y=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,g=\"\";function v(n){return o.locateFile?o.locateFile(n,g):g+n}y?(g=d?require(\"path\").dirname(g)+\"/\":__dirname+\"/\",f=function(n,t){return p||(p=require(\"fs\")),m||(m=require(\"path\")),n=m.normalize(n),p.readFileSync(n,t?null:\"utf8\")},l=function(n){var t=f(n,!0);return t.buffer||(t=new Uint8Array(t)),j(t.buffer),t},c=function(n,t,e){p||(p=require(\"fs\")),m||(m=require(\"path\")),n=m.normalize(n),p.readFile(n,(function(n,r){n?e(n):t(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\\\/g,\"/\"),process.argv.slice(2),e.exports=o,process.on(\"uncaughtException\",(function(n){if(!(n instanceof Pn))throw n})),process.on(\"unhandledRejection\",Q),o.inspect=function(){return\"[Emscripten Module object]\"}):(h||d)&&(d?g=self.location.href:\"undefined\"!=typeof document&&document.currentScript&&(g=document.currentScript.src),g=0!==g.indexOf(\"blob:\")?g.substr(0,g.lastIndexOf(\"/\")+1):\"\",f=function(n){var t=new XMLHttpRequest;return t.open(\"GET\",n,!1),t.send(null),t.responseText},d&&(l=function(n){var t=new XMLHttpRequest;return t.open(\"GET\",n,!1),t.responseType=\"arraybuffer\",t.send(null),new Uint8Array(t.response)}),c=function(n,t,e){var r=new XMLHttpRequest;r.open(\"GET\",n,!0),r.responseType=\"arraybuffer\",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):e()},r.onerror=e,r.send(null)});var w=o.print||console.log.bind(console),b=o.printErr||console.warn.bind(console);for(u in s)s.hasOwnProperty(u)&&(o[u]=s[u]);s=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram,o.quit&&o.quit;var A,_,E=0,R=function(n){E=n},P=function(){return E};o.wasmBinary&&(A=o.wasmBinary),o.noExitRuntime,\"object\"!=typeof WebAssembly&&Q(\"no native wasm support detected\");var S=!1;function j(n,t){n||Q(\"Assertion failed: \"+t)}var T,x,I,H,M=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0;function F(n,t,e){for(var r=t+e,o=t;n[o]&&!(o>=r);)++o;if(o-t>16&&n.subarray&&M)return M.decode(n.subarray(t,o));for(var i=\"\";t>10,56320|1023&f)}}else i+=String.fromCharCode((31&a)<<6|u)}else i+=String.fromCharCode(a)}return i}function q(n,t){return n?F(x,n,t):\"\"}function C(n,t){return n%t>0&&(n+=t-n%t),n}function O(n){T=n,o.HEAP8=new Int8Array(n),o.HEAP16=new Int16Array(n),o.HEAP32=I=new Int32Array(n),o.HEAPU8=x=new Uint8Array(n),o.HEAPU16=new Uint16Array(n),o.HEAPU32=new Uint32Array(n),o.HEAPF32=new Float32Array(n),o.HEAPF64=new Float64Array(n)}o.INITIAL_MEMORY;var W=[],U=[],L=[];function k(){if(o.preRun)for(\"function\"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)z(o.preRun.shift());on(W)}function B(){on(U)}function D(){if(o.postRun)for(\"function\"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)G(o.postRun.shift());on(L)}function z(n){W.unshift(n)}function N(n){U.unshift(n)}function G(n){L.unshift(n)}var X=0,Y=null;function J(n){X++,o.monitorRunDependencies&&o.monitorRunDependencies(X)}function K(n){if(X--,o.monitorRunDependencies&&o.monitorRunDependencies(X),0==X&&Y){var t=Y;Y=null,t()}}function Q(n){throw o.onAbort&&o.onAbort(n),b(n+=\"\"),S=!0,n=\"abort(\"+n+\"). Build with -s ASSERTIONS=1 for more info.\",new WebAssembly.RuntimeError(n)}o.preloadedImages={},o.preloadedAudios={};var V,Z=\"data:application/octet-stream;base64,\";function $(n){return n.startsWith(Z)}function nn(n){return n.startsWith(\"file://\")}function tn(n){try{if(n==V&&A)return new Uint8Array(A);if(l)return l(n);throw\"both async and sync fetching of the wasm failed\"}catch(b){Q(b)}}function en(){if(!A&&(h||d)){if(\"function\"==typeof fetch&&!nn(V))return fetch(V,{credentials:\"same-origin\"}).then((function(n){if(!n.ok)throw\"failed to load wasm binary file at '\"+V+\"'\";return n.arrayBuffer()})).catch((function(){return tn(V)}));if(c)return new Promise((function(n,t){c(V,(function(t){n(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return tn(V)}))}function rn(){var n={a:hn};function t(n,t){var e=n.exports;o.asm=e,O((_=o.asm.m).buffer),H=o.asm.q,N(o.asm.n),K()}function e(n){t(n.instance)}function r(t){return en().then((function(t){return WebAssembly.instantiate(t,n)})).then(t,(function(n){b(\"failed to asynchronously prepare wasm: \"+n),Q(n)}))}function i(){return A||\"function\"!=typeof WebAssembly.instantiateStreaming||$(V)||nn(V)||\"function\"!=typeof fetch?r(e):fetch(V,{credentials:\"same-origin\"}).then((function(t){return WebAssembly.instantiateStreaming(t,n).then(e,(function(n){return b(\"wasm streaming compile failed: \"+n),b(\"falling back to ArrayBuffer instantiation\"),r(e)}))}))}if(J(),o.instantiateWasm)try{return o.instantiateWasm(n,t)}catch(a){return b(\"Module.instantiateWasm callback failed with error: \"+a),!1}return i(),{}}function on(n){for(;n.length>0;){var t=n.shift();if(\"function\"!=typeof t){var e=t.func;\"number\"==typeof e?void 0===t.arg?H.get(e)():H.get(e)(t.arg):e(void 0===t.arg?null:t.arg)}else t(o)}}function an(){throw\"longjmp\"}function un(n,t,e){x.copyWithin(n,t,t+e)}function sn(n){try{return _.grow(n-T.byteLength+65535>>>16),O(_.buffer),1}catch(t){}}function fn(n){var t=x.length,e=2147483648;if((n>>>=0)>e)return!1;for(var r=1;r<=4;r*=2){var o=t*(1+.2/r);if(o=Math.min(o,n+100663296),sn(Math.min(e,C(Math.max(n,o),65536))))return!0}return!1}$(V=\"libtess.wasm\")||(V=v(V));var cn={mappings:{},buffers:[null,[],[]],printChar:function(n,t){var e=cn.buffers[n];0===t||10===t?((1===n?w:b)(F(e,0)),e.length=0):e.push(t)},varargs:void 0,get:function(){return cn.varargs+=4,I[cn.varargs-4>>2]},getStr:function(n){return q(n)},get64:function(n,t){return n}};function ln(n,t,e,r){for(var o=0,i=0;i>2],u=I[t+(8*i+4)>>2],s=0;s>2]=o,0}function pn(){return P()}function mn(n){R(n)}var hn={h:an,l:un,g:fn,f:ln,b:pn,k:_n,d:An,j:En,i:Rn,e:bn,c:wn,a:mn};rn(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.n).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.o).apply(null,arguments)},o._free=function(){return(o._free=o.asm.p).apply(null,arguments)},o._triangulate=function(){return(o._triangulate=o.asm.r).apply(null,arguments)};var dn,yn=o.stackSave=function(){return(yn=o.stackSave=o.asm.s).apply(null,arguments)},gn=o.stackRestore=function(){return(gn=o.stackRestore=o.asm.t).apply(null,arguments)},vn=o._setThrew=function(){return(vn=o._setThrew=o.asm.u).apply(null,arguments)};function wn(n,t,e){var r=yn();try{H.get(n)(t,e)}catch(o){if(gn(r),o!==o+0&&\"longjmp\"!==o)throw o;vn(1,0)}}function bn(n,t){var e=yn();try{H.get(n)(t)}catch(r){if(gn(e),r!==r+0&&\"longjmp\"!==r)throw r;vn(1,0)}}function An(n,t){var e=yn();try{return H.get(n)(t)}catch(r){if(gn(e),r!==r+0&&\"longjmp\"!==r)throw r;vn(1,0)}}function _n(n){var t=yn();try{return H.get(n)()}catch(e){if(gn(t),e!==e+0&&\"longjmp\"!==e)throw e;vn(1,0)}}function En(n,t,e){var r=yn();try{return H.get(n)(t,e)}catch(o){if(gn(r),o!==o+0&&\"longjmp\"!==o)throw o;vn(1,0)}}function Rn(n,t,e,r){var o=yn();try{return H.get(n)(t,e,r)}catch(i){if(gn(o),i!==i+0&&\"longjmp\"!==i)throw i;vn(1,0)}}function Pn(n){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+n+\")\",this.status=n}function Sn(n){function t(){dn||(dn=!0,o.calledRun=!0,S||(B(),o.onRuntimeInitialized&&o.onRuntimeInitialized(),D()))}X>0||(k(),X>0||(o.setStatus?(o.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){o.setStatus(\"\")}),1),t()}),1)):t()))}if(Y=function n(){dn||Sn(),dn||(Y=n)},o.run=Sn,o.preInit)for(\"function\"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();Sn();let jn=null,Tn=null,xn=null,In=null;const Hn=r.Module,Mn=2,Fn=4e3;let qn=0;const Cn=(n,t,e)=>{jn||(jn=Hn._triangulate);let r=Hn.HEAPF32;const o=Hn.HEAP32.BYTES_PER_ELEMENT,i=2,a=r.BYTES_PER_ELEMENT;e>qn&&(qn=e,xn&&(Hn._free(xn),xn=0),Tn&&(Hn._free(Tn),Tn=0)),xn||(xn=Hn._malloc(e*a)),In||(In=Hn._malloc(Fn*o));const u=e*Mn;Tn||(Tn=Hn._malloc(u*a)),r=Hn.HEAPF32,r.set(n,xn/a),Hn.HEAP32.set(t,In/o);const s=u/i,f=jn(xn,In,Math.min(t.length,Fn),i,Tn,s),c=f*i;r=Hn.HEAPF32;const l=r.slice(Tn/a,Tn/a+c),p={};return p.buffer=l,p.vertexCount=f,p};return r.triangulate=Cn,r.whenLoaded()}return{load:n}}())&&(e.exports=r);var i=o.exports;const a=t({__proto__:null,default:n(i)},[i]);export{a as l};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{a as t}from\"./tslib.es6.js\";function e(t){return Number(t)!==t}function i(t){return{}.toString.call(t)}function s(t){if(null!=t&&!l(t)){let i=Number(t);return e(i)&&h(t)&&\"\"!=t?s(t.replace(/[^0-9.\\-]+/g,\"\")):i}return t}function r(t){if(o(t))return new Date(t);if(l(t))return new Date(t);{let e=Number(t);return l(e)?new Date(e):new Date(t)}}function n(t){if(e(t))return\"NaN\";if(t===1/0)return\"Infinity\";if(t===-1/0)return\"-Infinity\";if(0===t&&1/t==-1/0)return\"-0\";let i=t<0;t=Math.abs(t);let s,r=/^([0-9]+)(?:\\.([0-9]+))?(?:e[\\+\\-]([0-9]+))?$/.exec(\"\"+t),n=r[1],o=r[2]||\"\";if(void 0===r[3])s=\"\"===o?n:n+\".\"+o;else{let e=+r[3];if(t<1){s=\"0.\"+a(\"0\",e-1)+n+o}else{let t=e-o.length;s=0===t?n+o:t<0?n+o.slice(0,t)+\".\"+o.slice(t):n+o+a(\"0\",t)}}return i?\"-\"+s:s}function a(t,e){return new Array(e+1).join(t)}function o(t){return\"[object Date]\"===i(t)}function h(t){return\"string\"==typeof t}function l(t){return\"number\"==typeof t&&Number(t)==t}function d(t){return\"object\"==typeof t&&null!==t}const u=\"__§§§__\",p=\"__§§§§__\";function c(t,e){const i=t.length;for(let s=0;s0;)--i,e(t[i],i)}function b(t,e){const i=t.length;for(let s=0;s0;)if(--i,e(t[i],i))return i;return-1}function S(t,e){const i=O(t,e);if(-1!==i)return t[i]}function j(t,e){const i=T(t,e);if(-1!==i)return t[i]}function E(t,e){let i=0,s=t.length,r=!1;for(;i>1,a=e(t[n]);a<0?i=n+1:0===a?(r=!0,i=n+1):s=n}return{found:r,index:r?i-1:i}}function C(t,e){let i=0,s=t.length,r=!1;for(;i>1,a=e(t[n]);a<0?i=n+1:0===a?(r=!0,s=n):s=n}return{found:r,index:i}}function M(t,e){let i=t.length;for(;i>0;)--i,e(t[i])||t.splice(i,1)}class A{constructor(){Object.defineProperty(this,\"_disposed\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class B{constructor(t){Object.defineProperty(this,\"_disposed\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_dispose\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class I extends A{constructor(){super(...arguments),Object.defineProperty(this,\"_disposers\",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){m(this._disposers,(t=>{t.dispose()}))}}class H extends A{constructor(t){super(),Object.defineProperty(this,\"_disposers\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){m(this._disposers,(t=>{t.dispose()}))}get disposers(){return this._disposers}}class L extends B{constructor(){super(...arguments),Object.defineProperty(this,\"_counter\",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new B((()=>{--this._counter,0===this._counter&&this.dispose()}))}}class N{constructor(){Object.defineProperty(this,\"_listeners\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_killed\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_disabled\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_iterating\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_enabled\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_disposed\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{m(t,(t=>{t.disposer.dispose()}))}finally{this._killed=null,this._iterating=null}}}hasListeners(){return 0!==this._listeners.length}hasListenersByType(t){return g(this._listeners,(e=>(null===e.type||e.type===t)&&!e.killed))}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(0===this._iterating){const e=this._listeners.indexOf(t);if(-1===e)throw new Error(\"Invalid state: could not remove listener\");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,i,s){if(this._disposed)throw new Error(\"EventDispatcher is disposed\");this._eachListener((r=>{r.once!==t||r.type!==e||void 0!==i&&r.callback!==i||r.context!==s||r.disposer.dispose()}))}isEnabled(t){if(this._disposed)throw new Error(\"EventDispatcher is disposed\");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&void 0===this._disabled[t]}removeType(t){if(this._disposed)throw new Error(\"EventDispatcher is disposed\");this._eachListener((e=>{e.type===t&&e.disposer.dispose()}))}has(t,e,i){return-1!==O(this._listeners,(s=>!0!==s.once&&s.type===t&&(void 0===e||s.callback===e)&&s.context===i))}_shouldDispatch(t){if(this._disposed)throw new Error(\"EventDispatcher is disposed\");const e=this._disabled[t];return l(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{m(this._listeners,t)}finally{--this._iterating,0===this._iterating&&0!==this._killed.length&&(m(this._killed,(t=>{this._removeListener(t)})),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener((i=>{i.killed||null!==i.type&&i.type!==t||i.dispatch(t,e)}))}_on(t,e,i,s,r,n){if(this._disposed)throw new Error(\"EventDispatcher is disposed\");this._removeExistingListener(t,e,i,s);const a={type:e,callback:i,context:s,shouldClone:r,dispatch:n,killed:!1,once:t,disposer:new B((()=>{a.killed=!0,this._removeListener(a)}))};return this._listeners.push(a),a}onAll(t,e,i=!0){return this._on(!1,null,t,e,i,((i,s)=>t.call(e,s))).disposer}on(t,e,i,s=!0){return this._on(!1,t,e,i,s,((t,s)=>e.call(i,s))).disposer}once(t,e,i,s=!0){const r=this._on(!0,t,e,i,s,((t,s)=>{r.disposer.dispose(),e.call(i,s)}));return r.disposer}off(t,e,i){this._removeExistingListener(!1,t,e,i)}copyFrom(t){if(this._disposed)throw new Error(\"EventDispatcher is disposed\");if(t===this)throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");const e=[];return m(t._listeners,(t=>{!t.killed&&t.shouldClone&&(null===t.type?e.push(this.onAll(t.callback,t.context)):t.once?e.push(this.once(t.type,t.callback,t.context)):e.push(this.on(t.type,t.callback,t.context)))})),new H(e)}}function R(t,e){if(!(t>=0&&t=0&&t{this.push(t)}))}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),m(t,(t=>{this._values.push(t),this._onPush(t)}))}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{t.dispose()})),super._onClear(t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&m(this._values,(t=>{t.dispose()})))}}class V extends W{constructor(t,e){super(),Object.defineProperty(this,\"template\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"make\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}}class U extends F{constructor(t){super(),Object.defineProperty(this,\"_disposed\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_container\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_events\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll((t=>{if(\"clear\"===t.type)m(t.oldValues,(t=>{this._onRemoved(t)}));else if(\"push\"===t.type)this._onInserted(t.newValue);else if(\"setIndex\"===t.type)this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if(\"insertIndex\"===t.type)this._onInserted(t.newValue,t.index);else if(\"removeIndex\"===t.type)this._onRemoved(t.oldValue);else{if(\"moveIndex\"!==t.type)throw new Error(\"Unknown IListEvent type\");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}}))}_onInserted(t,e){t._setParent(this._container,!0);const i=this._container._childrenDisplay;void 0===e?i.addChild(t._display):i.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),m(this.values,(t=>{t.dispose()})))}}class K{constructor(t){Object.defineProperty(this,\"_value\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+\"%\"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,i){return t instanceof K?t:new K(e===i?0:100*Math.min(Math.max(1/(i-e)*(t-e),0),1))}}function z(t){return new K(t)}const G=z(0),Y=z(100),X=z(50);function $(t){return Object.keys(t)}function Z(t,e){return $(t).sort(e)}function J(t){return Object.assign({},t)}function q(t,e){$(t).forEach((i=>{e(i,t[i])}))}function Q(t,e){for(let i in t)if(tt(t,i)&&!e(i,t[i]))break}function tt(t,e){return{}.hasOwnProperty.call(t,e)}function et(t){t.parentNode&&t.parentNode.removeChild(t)}function it(t,e,i,s){return t.addEventListener(e,i,s||!1),new B((()=>{t.removeEventListener(e,i,s||!1)}))}function st(t){return it(window,\"resize\",(e=>{t()}))}function rt(t){switch(t){case\"touchevents\":return window.hasOwnProperty(\"TouchEvent\");case\"pointerevents\":return window.hasOwnProperty(\"PointerEvent\");case\"mouseevents\":return window.hasOwnProperty(\"MouseEvent\");case\"wheelevents\":return window.hasOwnProperty(\"WheelEvent\");case\"keyboardevents\":return window.hasOwnProperty(\"KeyboardEvent\")}return!1}function nt(t){return t.pointerId||0}function at(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let t=document.createElement(\"button\");t.style.position=\"fixed\",t.style.top=\"0px\",t.style.left=\"-10000px\",document.body.appendChild(t),t.focus(),t.blur(),document.body.removeChild(t)}}function ot(t){t&&t.focus()}function ht(t){if(rt(\"pointerevents\"))return t;if(rt(\"touchevents\"))switch(t){case\"pointerover\":case\"pointerdown\":return\"touchstart\";case\"pointerout\":case\"pointerleave\":case\"pointerup\":return\"touchend\";case\"pointermove\":return\"touchmove\";case\"click\":return\"click\";case\"dblclick\":return\"dblclick\"}else if(rt(\"mouseevents\"))switch(t){case\"pointerover\":return\"mouseover\";case\"pointerout\":return\"mouseout\";case\"pointerleave\":return\"mouseleave\";case\"pointerdown\":return\"mousedown\";case\"pointermove\":return\"mousemove\";case\"pointerup\":return\"mouseup\";case\"click\":return\"click\";case\"dblclick\":return\"dblclick\"}return t}function lt(t){if(\"undefined\"!=typeof Touch&&t instanceof Touch)return!0;if(\"undefined\"!=typeof PointerEvent&&t instanceof PointerEvent&&null!=t.pointerType)switch(t.pointerType){case\"touch\":case\"pen\":case 2:return!0;case\"mouse\":case 4:return!1;default:return!(t instanceof MouseEvent)}else if(null!=t.type&&t.type.match(/^mouse/))return!1;return!0}function dt(t,e,i){t.style[e]=i}function ut(t,e){return t.style[e]}function pt(t){if(t.composedPath){const e=t.composedPath();return 0===e.length?null:e[0]}return t.target}function ct(t,e){let i=e;for(;;){if(t===i)return!0;if(null===i.parentNode){if(null==i.host)return!1;i=i.host}else i=i.parentNode}}function gt(t,e){return t.target&&ct(e.root.dom,t.target)}function _t(t,e){t.style.pointerEvents=e?\"auto\":\"none\"}function mt(){return/apple/i.test(navigator.vendor)&&\"ontouchend\"in document}function ft(){return mt()?1:void 0}function bt(t,e){return l(t)?t:null!=t&&l(t.value)&&l(e)?e*t.value:0}function vt(t){let e=(\"\"+t).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function yt(t,e=0,i=\"0\"){return\"string\"!=typeof t&&(t=t.toString()),e>t.length?Array(e-t.length+1).join(i)+t:t}function wt(t){return t.replace(/^[\\s]*/,\"\")}function Pt(t){return t.replace(/[\\s]*$/,\"\")}function Dt(t){return wt(Pt(t))}function xt(t){if(void 0===t)return\"string\";let e=(t=(t=(t=t.toLowerCase().replace(/^\\[[^\\]]*\\]/,\"\")).replace(/\\[[^\\]]+\\]/,\"\")).trim()).match(/\\/(date|number|duration)$/);return e?e[1]:\"number\"===t?\"number\":\"date\"===t?\"date\":\"duration\"===t?\"duration\":t.match(/[#0]/)?\"number\":t.match(/[ymwdhnsqaxkzgtei]/)?\"date\":\"string\"}function kt(t){return t.replace(/\\/(date|number|duration)$/i,\"\")}function Ot(t){return t?t.replace(/<[^>]*>/g,\"\"):t}function Tt(t){return t.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,\"\\\\$&\")}function St(t,e=!1){const i=new Date(t.getFullYear(),0,0),s=t.getTime()-i.getTime()+60*(i.getTimezoneOffset()-t.getTimezoneOffset())*1e3,r=864e5;return Math.floor(s/r)}function jt(t,e=!1){const i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),s=i.getUTCDay()||7;i.setUTCDate(i.getUTCDate()+4-s);const r=new Date(Date.UTC(i.getUTCFullYear(),0,1));return Math.ceil(((i.getTime()-r.getTime())/864e5+1)/7)}function Et(t,e=!1){const i=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),s=i.getUTCDay()||7;i.setUTCDate(i.getUTCDate()+4-s);return new Date(Date.UTC(i.getUTCFullYear(),0,1)).getFullYear()}function Ct(t,e=!1){const i=jt(new Date(t.getFullYear(),t.getMonth(),1),e);let s=jt(t,e);return 1==s&&(s=53),s-i+1}function Mt(t,e,i=1,s=!1){let r=new Date(e,0,4,0,0,0,0);return s&&r.setUTCFullYear(e),7*t+i-((r.getDay()||7)+3)}function At(t,e){return t>12?t-=12:0===t&&(t=12),null!=e?t+(e-1):t}function Bt(t,e=!1,i=!1,s=!1,r){if(s)return e?\"Coordinated Universal Time\":\"UTC\";if(r){const i=t.toLocaleString(\"en-US\",{timeZone:r});return Dt(t.toLocaleString(\"en-US\",{timeZone:r,timeZoneName:e?\"long\":\"short\"}).substr(i.length))}let n=t.toLocaleString(\"UTC\"),a=t.toLocaleString(\"UTC\",{timeZoneName:e?\"long\":\"short\"}).substr(n.length);return!1===i&&(a=a.replace(/ (standard|daylight|summer|winter) /i,\" \")),a}function It(t){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),i=new Date(e.toLocaleString(\"en-US\",{timeZone:\"UTC\"}));return(new Date(e.toLocaleString(\"en-US\",{timeZone:t})).getTime()-i.getTime())/6e4*-1}function Ht(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(t){let e,i,s,r=t.h,n=t.s,a=t.l;if(0==n)e=i=s=a;else{let t=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t},o=a<.5?a*(1+n):a+n-a*n,h=2*a-o;e=t(h,o,r+1/3),i=t(h,o,r),s=t(h,o,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}}function Nt(t){let e=t.r/255,i=t.g/255,s=t.b/255,r=Math.max(e,i,s),n=Math.min(e,i,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let t=r-n;switch(o=h>.5?t/(2-r-n):t/(r+n),r){case e:a=(i-s)/t+(i0?255-t:t;return Math.round(i*e)}function Wt(t,e){if(t){let i=Ft(Math.min(Math.max(t.r,t.g,t.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(t.r+i))),g:Math.max(0,Math.min(255,Math.round(t.g+i))),b:Math.max(0,Math.min(255,Math.round(t.b+i))),a:t.a}}return t}function Vt(t){return(299*t.r+587*t.g+114*t.b)/1e3>=128}function Ut(t,e){if(void 0===t||1==e)return t;let i=Nt(t);return i.s=e,Lt(i)}function Kt(t,e={r:255,g:255,b:255},i={r:255,g:255,b:255}){let s=e,r=i;return Vt(i)&&(s=i,r=e),Vt(t)?r:s}function zt(t,e){return t||(t=[]),[...t,...e].filter(((t,e,i)=>i.indexOf(t)===e))}function Gt(t,e){return!!e&&(t.left==e.left&&(t.right==e.right&&(t.top==e.top&&t.bottom==e.bottom)))}function Yt(t){return\"#\"===t[0]&&(t=t.substr(1)),3==t.length&&(t=t[0].repeat(2)+t[1].repeat(2)+t[2].repeat(2)),parseInt(t,16)}function Xt(t){let e=(t=t.replace(/[ ]/g,\"\")).match(/^rgb\\(([0-9]*),([0-9]*),([0-9]*)\\)/i);if(e)e.push(\"1\");else if(e=t.match(/^rgba\\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\\)/i),!e)return 0;let i=\"\";for(let s=1;s<=3;s++){let t=parseInt(e[s]).toString(16);1==t.length&&(t=\"0\"+t),i+=t}return Yt(i)}function $t(t){return Zt.fromAny(t)}class Zt{constructor(t){Object.defineProperty(this,\"_hex\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return\"rgba(\"+this.r+\", \"+this.g+\", \"+this.b+\", \"+t+\")\"}toCSSHex(){return\"#\"+yt(this.r.toString(16),2)+yt(this.g.toString(16),2)+yt(this.b.toString(16),2)}toHSL(t=1){return Nt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,i){const s=Lt({h:t,s:e,l:i});return this.fromRGB(s.r,s.g,s.b)}toString(){return this.toCSSHex()}static fromHex(t){return new Zt(t)}static fromRGB(t,e,i){return new Zt((0|i)+(e<<8)+(t<<16))}static fromString(t){return new Zt(Yt(t))}static fromCSS(t){return new Zt(Xt(t))}static fromAny(t){if(h(t)){if(\"#\"==t[0])return Zt.fromString(t);if(\"rgb\"==t.substr(0,3))return Zt.fromCSS(t)}else{if(l(t))return Zt.fromHex(t);if(t instanceof Zt)return Zt.fromHex(t.hex)}throw new Error(\"Unknown color syntax: \"+t)}static alternative(t,e,i){const s=Kt({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(s.r,s.g,s.b)}static interpolate(t,e,i,s=\"rgb\"){if(\"hsl\"==s){const s=e.toHSL(),r=i.toHSL();return Zt.fromHSL(qt(t,s.h,r.h),qt(t,s.s,r.s),qt(t,s.l,r.l))}return Zt.fromRGB(qt(t,e.r,i.r),qt(t,e.g,i.g),qt(t,e.b,i.b))}static lighten(t,e){const i=Rt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}static brighten(t,e){const i=Wt({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}static saturate(t,e){const i=Ut({r:t.r,g:t.g,b:t.b},e);return Zt.fromRGB(i.r,i.g,i.b)}}function Jt(e){return t(this,void 0,void 0,(function*(){if(void 0!==e){const t=[];q(e,((e,i)=>{t.push(i.waitForStop())})),yield Promise.all(t)}}))}function qt(t,e,i){return e+t*(i-e)}function Qt(t,e,i){return t>=1?i:e}function te(t,e,i){return new K(qt(t,e.percent,i.percent))}function ee(t,e,i){return Zt.interpolate(t,e,i)}function ie(t,e){return\"number\"==typeof t&&\"number\"==typeof e?qt:t instanceof K&&e instanceof K?te:t instanceof Zt&&e instanceof Zt?ee:Qt}const se=Math.PI,re=se/180,ne=180/se;function ae(t,e,i){if(!l(e)||e<=0){let e=Math.round(t);return i&&e-t==.5&&e--,e}{let i=Math.pow(10,e);return Math.round(t*i)/i}}function oe(t,e){if(!l(e)||e<=0)return Math.ceil(t);{let i=Math.pow(10,e);return Math.ceil(t*i)/i}}function he(t,e,i){return Math.min(Math.max(t,e),i)}function le(t){return Math.sin(re*t)}function de(t){return Math.cos(re*t)}function ue(t){return(t%=360)<0&&(t+=360),t}function pe(t,e,i,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(ce(r,i)),l.push(ce(r,s));let d=Math.min(90*Math.floor(i/90),90*Math.floor(s/90)),u=Math.max(90*Math.ceil(i/90),90*Math.ceil(s/90));for(let p=d;p<=u;p+=90)p>=i&&p<=s&&l.push(ce(r,p));for(let p=0;po&&(o=t.x),t.y>h&&(h=t.y)}return{left:t+n,top:e+a,right:t+o,bottom:e+h}}function ce(t,e){return{x:t*de(e),y:t*le(e)}}function ge(t){const e=t.length;if(e>0){let i=t[0],s=i.left,r=i.top,n=i.right,a=i.bottom;if(e>1)for(let o=1;o{this._userSettings[t]=!0}))}get(t,e){const i=this._settings[t];return void 0!==i?i:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){$(t).forEach((e=>{this.set(e,t[e])}))}_eachSetting(t){q(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup(\"default\");this._eachSetting(((i,s)=>{t[i]||(t[i]=!0,this!==e&&(i in e._settings||(e._settings[i]=this._entity.get(i))),this._entity.set(i,s))}))}applyAnimate(t){null==t&&(t=this._settings.stateAnimationDuration),null==t&&(t=this.get(\"stateAnimationDuration\",this._entity.get(\"stateAnimationDuration\",0)));let e=this._settings.stateAnimationEasing;null==e&&(e=this.get(\"stateAnimationEasing\",this._entity.get(\"stateAnimationEasing\",me)));const i=this._entity.states.lookup(\"default\"),s={stateAnimationEasing:!0,stateAnimationDuration:!0},r={};return this._eachSetting(((n,a)=>{if(!s[n]){s[n]=!0,this!=i&&(n in i._settings||(i._settings[n]=this._entity.get(n)));const o=this._entity.animate({key:n,to:a,duration:t,easing:e});o&&(r[n]=o)}})),r}}class ve{constructor(t){Object.defineProperty(this,\"_states\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_entity\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const i=this._states[t];if(i)return i.setAll(e),i;{const i=new be(this._entity,e);return this._states[t]=i,i}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let i;const s=this._states[t];return s&&(i=s.applyAnimate(e)),this._entity._applyStateAnimated(t,e),i}}class ye{constructor(){Object.defineProperty(this,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:\"5.4.8\"}),Object.defineProperty(this,\"licenses\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"entitiesById\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"rootElements\",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const we=new ye;function Pe(t){we.licenses.push(t)}function De(t,e){return t===e?0:t{y(i,e)&&this._entity._markDirtyKey(t)}))}remove(t){const e=this._callbacks[t];void 0!==e&&(delete this._callbacks[t],0!==e.length&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const i=this._callbacks[t];if(void 0!==i)for(let s=0,r=i.length;s{if(this._stopped)t();else{const e=()=>{i.dispose(),t()},i=this.events.on(\"stopped\",e)}}))}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){null!==this._oldTime&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let Se=0;class je{constructor(t){Object.defineProperty(this,\"uid\",{enumerable:!0,configurable:!0,writable:!0,value:++Se}),Object.defineProperty(this,\"_settings\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_privateSettings\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_settingEvents\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_privateSettingEvents\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_prevSettings\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_prevPrivateSettings\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_animatingSettings\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_animatingPrivateSettings\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_playingAnimations\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_disposed\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_userProperties\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=t}_checkDirty(){$(this._settings).forEach((t=>{this._userProperties[t]=!0,this._markDirtyKey(t)}))}resetUserSettings(){this._userProperties={}}_runAnimation(t){return!this.isDisposed()&&(q(this._animatingSettings,((e,i)=>{if(i._stopped)this._stopAnimation(e);else if(i._playing){i._run(t);const s=i.percentage;s>=1?i._checkEnded()?this.set(e,i._value(1)):(i._reset(t),this._set(e,i._value(1))):this._set(e,i._value(s))}})),q(this._animatingPrivateSettings,((e,i)=>{if(i._stopped)this._stopAnimationPrivate(e);else if(i._playing){i._run(t);const s=i.percentage;s>=1?i._checkEnded()?this.setPrivate(e,i._value(1)):(i._reset(t),this._setPrivate(e,i._value(1))):this._setPrivate(e,i._value(s))}})),0!==this._playingAnimations)}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let i=this._settingEvents[t];return void 0===i&&(i=this._settingEvents[t]=[]),i.push(e),new B((()=>{y(i,e),0===i.length&&delete this._settingEvents[t]}))}onPrivate(t,e){let i=this._privateSettingEvents[t];return void 0===i&&(i=this._privateSettingEvents[t]=[]),i.push(e),new B((()=>{y(i,e),0===i.length&&delete this._privateSettingEvents[t]}))}getRaw(t,e){const i=this._settings[t];return void 0!==i?i:e}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const i=this._settingEvents[t];void 0!==i&&m(i,(i=>{i(e,this,t)}))}_sendPrivateKeyEvent(t,e){const i=this._privateSettingEvents[t];void 0!==i&&m(i,(i=>{i(e,this,t)}))}_setRaw(t,e,i){this._prevSettings[t]=e,this._sendKeyEvent(t,i)}setRaw(t,e){const i=this._settings[t];this._settings[t]=e,i!==e&&this._setRaw(t,i,e)}_set(t,e){const i=this._settings[t];this._settings[t]=e,i!==e&&(this._setRaw(t,i,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(--this._playingAnimations,delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){m($(this._settings),(t=>{this.remove(t)}))}getPrivate(t,e){const i=this._privateSettings[t];return void 0!==i?i:e}_setPrivateRaw(t,e,i){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,i)}setPrivateRaw(t,e){const i=this._privateSettings[t];this._privateSettings[t]=e,i!==e&&this._setPrivateRaw(t,i,e)}_setPrivate(t,e){const i=this._privateSettings[t];this._privateSettings[t]=e,i!==e&&(this._setPrivateRaw(t,i,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(--this._playingAnimations,e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){q(t,((t,e)=>{this.set(t,e)}))}animate(t){const e=t.key,i=t.to,s=t.duration||0,r=t.loops||1,n=void 0===t.from?this.get(e):t.from,a=void 0===t.easing?_e:t.easing;if(0===s)this.set(e,i);else{if(void 0!==n&&n!==i){this.set(e,n);const t=this._animatingSettings[e]=new Te(this,n,i,s,a,r,this._animationTime());return++this._playingAnimations,this._startAnimation(),t}this.set(e,i)}const o=new Te(this,n,i,s,a,r,null);return o.stop(),o}animatePrivate(t){const e=t.key,i=t.to,s=t.duration||0,r=t.loops||1,n=void 0===t.from?this.getPrivate(e):t.from,a=void 0===t.easing?_e:t.easing;if(0===s)this.setPrivate(e,i);else{if(void 0!==n&&n!==i){this.setPrivate(e,n);const t=this._animatingPrivateSettings[e]=new Te(this,n,i,s,a,r,this._animationTime());return++this._playingAnimations,this._startAnimation(),t}this.setPrivate(e,i)}const o=new Te(this,n,i,s,a,r,null);return o.stop(),o}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Ee extends je{constructor(t,e,i,s=[]){if(super(e),Object.defineProperty(this,\"_root\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_user_id\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"states\",{enumerable:!0,configurable:!0,writable:!0,value:new ve(this)}),Object.defineProperty(this,\"adapters\",{enumerable:!0,configurable:!0,writable:!0,value:new Oe(this)}),Object.defineProperty(this,\"events\",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,\"_userPrivateProperties\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_dirty\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_dirtyPrivate\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_template\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_templates\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_internalTemplates\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_defaultThemes\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_templateDisposers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_disposers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_runSetup\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"_disposerProperties\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error(\"You cannot use `new Class()`, instead use `Class.new()`\");this._root=t,this._internalTemplates=s,e.id&&this._registerId(e.id)}static new(t,e,i){const s=new this(t,e,!0);return s._template=i,s._afterNew(),s}static _new(t,e,i=[]){const s=new this(t,e,!0,i);return s._afterNew(),s}_afterNew(){this._checkDirty();let t=!1;const e=this._template;e&&(t=!0,e._setObjectTemplate(this)),m(this._internalTemplates,(e=>{t=!0,e._setObjectTemplate(this)})),t&&this._applyTemplates(!1),this.states.create(\"default\",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const t=this._template;t&&t._setObjectTemplate(this),m(this._internalTemplates,(t=>{t._setObjectTemplate(this)})),this.states.create(\"default\",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new N}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(t,e){t in this._settings||super.set(t,e)}_setRawDefault(t,e){t in this._settings||super.setRaw(t,e)}_clearDirty(){$(this._dirty).forEach((t=>{this._dirty[t]=!1})),$(this._dirtyPrivate).forEach((t=>{this._dirtyPrivate[t]=!1}))}isDirty(t){return!!this._dirty[t]}isPrivateDirty(t){return!!this._dirtyPrivate[t]}_markDirtyKey(t){this._dirty[t]=!0,super._markDirtyKey(t)}_markDirtyPrivateKey(t){this._dirtyPrivate[t]=!0,super._markDirtyKey(t)}isType(t){return-1!==this.classNames.indexOf(t)}_pushPropertyDisposer(t,e){let i=this._disposerProperties[t];return void 0===i&&(i=this._disposerProperties[t]=[]),i.push(e),e}_disposeProperty(t){const e=this._disposerProperties[t];void 0!==e&&(m(e,(t=>{t.dispose()})),delete this._disposerProperties[t])}set template(t){const e=this._template;e!==t&&(this._template=t,e&&e._removeObjectTemplate(this),t&&t._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(t){}_applyStateAnimated(t,e){}get(t,e){const i=this.adapters.fold(t,this._settings[t]);return void 0!==i?i:e}isUserSetting(t){return this._userProperties[t]||!1}set(t,e){return this._userProperties[t]=!0,super.set(t,e)}setRaw(t,e){this._userProperties[t]=!0,super.setRaw(t,e)}_setSoft(t,e){return this._userProperties[t]?e:super.set(t,e)}remove(t){delete this._userProperties[t],this._removeTemplateProperty(t)}setPrivate(t,e){return this._userPrivateProperties[t]=!0,super.setPrivate(t,e)}setPrivateRaw(t,e){this._userPrivateProperties[t]=!0,super.setPrivateRaw(t,e)}removePrivate(t){delete this._userPrivateProperties[t],this._removeTemplatePrivateProperty(t)}_setTemplateProperty(t,e,i){if(!this._userProperties[e]){t===this._findTemplateByKey(e)&&super.set(e,i)}}_setTemplatePrivateProperty(t,e,i){if(!this._userPrivateProperties[e]){t===this._findTemplateByPrivateKey(e)&&super.setPrivate(e,i)}}_removeTemplateProperty(t){if(!this._userProperties[t]){const e=this._findTemplateByKey(t);e?super.set(t,e._settings[t]):super.remove(t)}}_removeTemplatePrivateProperty(t){if(!this._userPrivateProperties[t]){const e=this._findTemplateByPrivateKey(t);e?super.setPrivate(t,e._privateSettings[t]):super.removePrivate(t)}}_walkParents(t){t(this._root._rootContainer),t(this)}_applyStateByKey(t){const e=this.states.create(t,{}),i={};this._eachTemplate((s=>{const r=s.states.lookup(t);r&&r._apply(e,i)})),q(e._settings,(t=>{i[t]||e._userSettings[t]||e.remove(t)}))}_applyTemplate(t,e){this._templateDisposers.push(t._apply(this,e)),q(t._settings,((t,i)=>{e.settings[t]||this._userProperties[t]||(e.settings[t]=!0,super.set(t,i))})),q(t._privateSettings,((t,i)=>{e.privateSettings[t]||this._userPrivateProperties[t]||(e.privateSettings[t]=!0,super.setPrivate(t,i))})),this._runSetup&&t.setup&&(this._runSetup=!1,t.setup(this))}_findStaticTemplate(t){if(this._template&&t(this._template))return this._template}_eachTemplate(t){this._findStaticTemplate((e=>(t(e),!1))),f(this._internalTemplates,t),m(this._templates,t)}_applyTemplates(t=!0){t&&this._disposeTemplates();const e={settings:{},privateSettings:{},states:{}};this._eachTemplate((t=>{this._applyTemplate(t,e)})),t&&(q(this._settings,(t=>{this._userProperties[t]||e.settings[t]||super.remove(t)})),q(this._privateSettings,(t=>{this._userPrivateProperties[t]||e.privateSettings[t]||super.removePrivate(t)})))}_findTemplate(t){const e=this._findStaticTemplate(t);if(void 0===e){const e=j(this._internalTemplates,t);return void 0===e?S(this._templates,t):e}return e}_findTemplateByKey(t){return this._findTemplate((e=>t in e._settings))}_findTemplateByPrivateKey(t){return this._findTemplate((e=>t in e._privateSettings))}_disposeTemplates(){m(this._templateDisposers,(t=>{t.dispose()})),this._templateDisposers.length=0}_removeTemplates(){m(this._templates,(t=>{t._removeObjectTemplate(this)})),this._templates.length=0}_applyThemes(){let t=!1;const e=[];let i=[];const s=new Set,r=this.get(\"themeTagsSelf\");return r&&m(r,(t=>{s.add(t)})),this._walkParents((r=>{r===this._root._rootContainer&&(t=!0),r._defaultThemes.length>0&&e.push(r._defaultThemes);const n=r.get(\"themes\");n&&i.push(n);const a=r.get(\"themeTags\");a&&m(a,(t=>{s.add(t)}))})),i=e.concat(i),this._removeTemplates(),t&&f(this.classNames,(t=>{const e=[];m(i,(i=>{m(i,(i=>{const r=i._lookupRules(t);r&&f(r,(t=>{if(t.tags.every((t=>s.has(t)))){const i=C(e,(e=>{const i=De(t.tags.length,e.tags.length);return 0===i?xe(t.tags,e.tags,De):i}));e.splice(i.index,0,t)}}))}))})),m(e,(t=>{this._templates.push(t.template),t.template._setObjectTemplate(this)}))})),this._applyTemplates(),t&&(this._runSetup=!1),t}_changed(){}_beforeChanged(){if(this.isDirty(\"id\")){const t=this.get(\"id\");t&&this._registerId(t);const e=this._prevSettings.id;e&&delete we.entitiesById[e]}}_registerId(t){if(we.entitiesById[t]&&we.entitiesById[t]!==this)throw new Error('An entity with id \"'+t+'\" already exists.');we.entitiesById[t]=this}_afterChanged(){}addDisposer(t){return this._disposers.push(t),t}_dispose(){super._dispose();const t=this._template;t&&t._removeObjectTemplate(this),m(this._internalTemplates,(t=>{t._removeObjectTemplate(this)})),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach((t=>{t.dispose()})),q(this._disposerProperties,((t,e)=>{m(e,(t=>{t.dispose()}))}));const e=this.get(\"id\");e&&delete we.entitiesById[e]}setTimeout(t,e){const i=setTimeout((()=>{this.removeDispose(s),t()}),e),s=new B((()=>{clearTimeout(i)}));return this._disposers.push(s),s}removeDispose(t){if(!this.isDisposed()){let e=c(this._disposers,t);e>-1&&this._disposers.splice(e,1)}t.dispose()}hasTag(t){return-1!==c(this.get(\"themeTags\",[]),t)}addTag(t){if(!this.hasTag(t)){const e=this.get(\"themeTags\",[]);e.push(t),this.set(\"themeTags\",e)}}removeTag(t){if(this.hasTag(t)){const e=this.get(\"themeTags\",[]);v(e,t),this.set(\"themeTags\",e)}}_t(t,e,...i){return this._root.language.translate(t,e,...i)}get root(){return this._root}}Object.defineProperty(Ee,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Entity\"}),Object.defineProperty(Ee,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:[\"Entity\"]});class Ce{constructor(t,e,i){Object.defineProperty(this,\"_settings\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_name\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_template\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=i}get(t,e){const i=this._settings[t];return void 0!==i?i:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){$(t).forEach((e=>{this._settings[e]=t[e]})),this._template._stateChanged(this._name)}_apply(t,e){q(this._settings,((i,s)=>{e[i]||t._userSettings[i]||(e[i]=!0,t.setRaw(i,s))}))}}class Me{constructor(t){Object.defineProperty(this,\"_template\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_states\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}lookup(t){return this._states[t]}create(t,e){const i=this._states[t];if(i)return i.setAll(e),i;{const i=new Ce(t,this._template,e);return this._states[t]=i,this._template._stateChanged(t),i}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){q(this._states,((i,s)=>{let r=e.states[i];null==r&&(r=e.states[i]={});const n=t.states.create(i,{});s._apply(n,r)}))}}class Ae{constructor(){Object.defineProperty(this,\"_callbacks\",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let i=this._callbacks[t];return void 0===i&&(i=this._callbacks[t]=[]),i.push(e),new B((()=>{y(i,e),0===i.length&&delete this._callbacks[t]}))}remove(t){void 0!==this._callbacks[t]&&delete this._callbacks[t]}_apply(t){const e=[];return q(this._callbacks,((i,s)=>{m(s,(s=>{e.push(t.adapters.add(i,s))}))})),new H(e)}}class Be{constructor(t,e){if(Object.defineProperty(this,\"_settings\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_privateSettings\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_settingEvents\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_privateSettingEvents\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_entities\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"states\",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,\"adapters\",{enumerable:!0,configurable:!0,writable:!0,value:new Ae}),Object.defineProperty(this,\"events\",{enumerable:!0,configurable:!0,writable:!0,value:new N}),Object.defineProperty(this,\"setup\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error(\"You cannot use `new Class()`, instead use `Class.new()`\");this._settings=t}static new(t){return new Be(t,!0)}get entities(){return this._entities}get(t,e){const i=this._settings[t];return void 0!==i?i:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach((i=>{i._setTemplateProperty(this,t,e)})))}remove(t){t in this._settings&&(delete this._settings[t],this._entities.forEach((e=>{e._removeTemplateProperty(t)})))}removeAll(){q(this._settings,((t,e)=>{this.remove(t)}))}getPrivate(t,e){const i=this._privateSettings[t];return void 0!==i?i:e}setPrivateRaw(t,e){return this._privateSettings[t]=e,e}setPrivate(t,e){return this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach((i=>{i._setTemplatePrivateProperty(this,t,e)}))),e}removePrivate(t){t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach((e=>{e._removeTemplatePrivateProperty(t)})))}setAll(t){q(t,((t,e)=>{this.set(t,e)}))}on(t,e){let i=this._settingEvents[t];return void 0===i&&(i=this._settingEvents[t]=[]),i.push(e),new B((()=>{y(i,e),0===i.length&&delete this._settingEvents[t]}))}onPrivate(t,e){let i=this._privateSettingEvents[t];return void 0===i&&(i=this._privateSettingEvents[t]=[]),i.push(e),new B((()=>{y(i,e),0===i.length&&delete this._privateSettingEvents[t]}))}_apply(t,e){const i=[];return q(this._settingEvents,((e,s)=>{m(s,(s=>{i.push(t.on(e,s))}))})),q(this._privateSettingEvents,((e,s)=>{m(s,(s=>{i.push(t.onPrivate(e,s))}))})),this.states._apply(t,e),i.push(this.adapters._apply(t)),i.push(t.events.copyFrom(this.events)),new H(i)}_setObjectTemplate(t){this._entities.push(t)}_removeObjectTemplate(t){v(this._entities,t)}_stateChanged(t){this._entities.forEach((e=>{e._applyStateByKey(t)}))}}class Ie extends N{constructor(t){super(),Object.defineProperty(this,\"_sprite\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_rendererDisposers\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_dispatchParents\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set(\"interactive\",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[t];if(void 0===i){const s=this._sprite._display.on(t,(t=>{e.call(this,t)}));i=this._rendererDisposers[t]=new L((()=>{delete this._rendererDisposers[t],s.dispose()}))}return i.increment()}_on(t,e,i,s,r,n){const a=super._on(t,e,i,s,r,n),o=Ie.RENDERER_EVENTS[e];return void 0!==o&&(a.disposer=new H([a.disposer,this._onRenderer(e,o)])),a}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=i}}}Object.defineProperty(Ie,\"RENDERER_EVENTS\",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(t){this.isEnabled(\"click\")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent(\"click\",t))&&this.dispatch(\"click\",this._makePointerEvent(\"click\",t))},rightclick:function(t){this.isEnabled(\"rightclick\")&&this.dispatch(\"rightclick\",this._makePointerEvent(\"rightclick\",t))},middleclick:function(t){this.isEnabled(\"middleclick\")&&this.dispatch(\"middleclick\",this._makePointerEvent(\"middleclick\",t))},dblclick:function(t){this.dispatchParents(\"dblclick\",this._makePointerEvent(\"dblclick\",t))},pointerover:function(t){this.isEnabled(\"pointerover\")&&this.dispatch(\"pointerover\",this._makePointerEvent(\"pointerover\",t))},pointerout:function(t){this.isEnabled(\"pointerout\")&&this.dispatch(\"pointerout\",this._makePointerEvent(\"pointerout\",t))},pointerdown:function(t){this.dispatchParents(\"pointerdown\",this._makePointerEvent(\"pointerdown\",t))},pointerup:function(t){this.isEnabled(\"pointerup\")&&this.dispatch(\"pointerup\",this._makePointerEvent(\"pointerup\",t))},globalpointerup:function(t){this.isEnabled(\"globalpointerup\")&&this.dispatch(\"globalpointerup\",this._makePointerEvent(\"globalpointerup\",t))},globalpointermove:function(t){this.isEnabled(\"globalpointermove\")&&this.dispatch(\"globalpointermove\",this._makePointerEvent(\"globalpointermove\",t))},wheel:function(t){this.dispatchParents(\"wheel\",{type:\"wheel\",target:this._sprite,originalEvent:t.event,point:t.point})}}});class He extends Ee{constructor(){super(...arguments),Object.defineProperty(this,\"_adjustedLocalBounds\",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,\"_localBounds\",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,\"_parent\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_dataItem\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_templateField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_sizeDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_isDragging\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dragEvent\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_dragPoint\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_isHidden\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_isShowing\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_isHiding\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_isDown\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_downPoint\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_downPoints\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_toggleDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_dragDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_hoverDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_focusDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipMoveDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipPointerDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_statesHandled\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw(\"visible\",!0),super._afterNew()}_markDirtyKey(t){super._markDirtyKey(t),\"x\"!=t&&\"y\"!=t&&\"dx\"!=t&&\"dy\"!=t||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),\"x\"!=t&&\"y\"!=t||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new Ie(this)}_processTemplateField(){let t;const e=this.get(\"templateField\");if(e){const i=this.dataItem;if(i){const s=i.dataContext;s&&(t=s[e],t instanceof Be||!t||(t=Be.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const i=\"dataitemchanged\";t!=e&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get(\"width\")instanceof K||this.get(\"height\")instanceof K?P(t._percentageSizeChildren,this):y(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get(\"x\")instanceof K||this.get(\"y\")instanceof K?P(t._percentagePositionChildren,this):y(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get(\"centerX\");null!=e&&(this._display.pivot.x=t.left+bt(e,t.right-t.left));const i=this.get(\"centerY\");null!=i&&(this._display.pivot.y=t.top+bt(i,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty(\"tooltip\")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty(\"layer\")||this.isDirty(\"layerMargin\"))&&(this._display.setLayer(this.get(\"layer\"),this.get(\"layerMargin\")),this.markDirtyLayer()),this.isDirty(\"tooltipPosition\")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),\"pointer\"==this.get(\"tooltipPosition\")&&(this.isHover()&&(this._tooltipMoveDp=this.events.on(\"globalpointermove\",(t=>{this.showTooltip(t.point)}))),this._tooltipPointerDp=new H([this.events.on(\"pointerover\",(()=>{this._tooltipMoveDp=this.events.on(\"globalpointermove\",(t=>{this.showTooltip(t.point)}))})),this.events.on(\"pointerout\",(()=>{const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0)}))]))}}_handleStates(){this._statesHandled||(this.isDirty(\"active\")&&(this.get(\"active\")?(this.states.applyAnimate(\"active\"),this.set(\"ariaChecked\",!0)):(this.isHidden()||this.states.applyAnimate(\"default\"),this.set(\"ariaChecked\",!1)),this.markDirtyAccessibility()),this.isDirty(\"disabled\")&&(this.get(\"disabled\")?(this.states.applyAnimate(\"disabled\"),this.set(\"ariaChecked\",!1)):(this.isHidden()||this.states.applyAnimate(\"default\"),this.set(\"ariaChecked\",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty(\"draggable\")){const i=this.get(\"draggable\");i?(this.set(\"interactive\",!0),this._dragDp=new H([e.on(\"pointerdown\",(t=>{this.dragStart(t)})),e.on(\"globalpointermove\",(t=>{this.dragMove(t)})),e.on(\"globalpointerup\",(t=>{this.dragStop(t)}))])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!i}if(this.isDirty(\"tooltipText\")||this.isDirty(\"tooltipHTML\")||this.isDirty(\"showTooltipOn\")){const t=this.get(\"tooltipText\"),i=this.get(\"tooltipHTML\"),s=this.get(\"showTooltipOn\",\"hover\");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(t||i)&&(\"click\"==s?(this._tooltipDp=new H([e.on(\"click\",(()=>{this.setTimeout((()=>this.showTooltip()),10)})),it(document,\"click\",(t=>{this.hideTooltip()}))]),this._disposers.push(this._tooltipDp)):\"always\"==s||(this._tooltipDp=new H([e.on(\"pointerover\",(()=>{this.showTooltip()})),e.on(\"pointerout\",(()=>{this.hideTooltip()}))]),this._disposers.push(this._tooltipDp)))}if(this.isDirty(\"toggleKey\")){let t=this.get(\"toggleKey\");t&&\"none\"!=t?this._toggleDp=e.on(\"click\",(()=>{this._isDragging||this.set(t,!this.get(t))})):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty(\"opacity\")&&(t.alpha=Math.max(0,this.get(\"opacity\",1))),this.isDirty(\"rotation\")&&(this.markDirtyBounds(),t.angle=this.get(\"rotation\",0)),this.isDirty(\"scale\")&&(this.markDirtyBounds(),t.scale=this.get(\"scale\",0)),(this.isDirty(\"centerX\")||this.isDirty(\"centerY\"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty(\"visible\")||this.isPrivateDirty(\"visible\")||this.isDirty(\"forceHidden\"))&&(this.get(\"visible\")&&this.getPrivate(\"visible\")&&!this.get(\"forceHidden\")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get(\"focusable\")&&this.markDirtyAccessibility()),this.isDirty(\"width\")||this.isDirty(\"height\")){this.markDirtyBounds(),this._addPercentageSizeChildren();const t=this.parent;t&&(this.isDirty(\"width\")&&this.get(\"width\")instanceof K||this.isDirty(\"height\")&&this.get(\"height\")instanceof K)&&(t.markDirty(),t._prevWidth=0),this._sizeDirty=!0}if((this.isDirty(\"maxWidth\")||this.isDirty(\"maxHeight\")||this.isPrivateDirty(\"width\")||this.isPrivateDirty(\"height\")||this.isDirty(\"minWidth\")||this.isDirty(\"minHeight\")||this.isPrivateDirty(\"maxWidth\")||this.isPrivateDirty(\"maxHeight\")||this.isPrivateDirty(\"minWidth\")||this.isPrivateDirty(\"minHeight\"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty(\"wheelable\")){const e=this.get(\"wheelable\");e&&this.set(\"interactive\",!0),t.wheelable=!!e}if((this.isDirty(\"tabindexOrder\")||this.isDirty(\"focusableGroup\"))&&(this.get(\"focusable\")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty(\"filter\")&&(t.filter=this.get(\"filter\")),this.isDirty(\"cursorOverStyle\")&&(t.cursorOverStyle=this.get(\"cursorOverStyle\")),this.isDirty(\"hoverOnFocus\")&&(this.get(\"hoverOnFocus\")?this._focusDp=new H([e.on(\"focus\",(()=>{this.showTooltip()})),e.on(\"blur\",(()=>{this.hideTooltip()}))]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty(\"focusable\")&&(this.get(\"focusable\")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),this.isPrivateDirty(\"focusable\")&&this.markDirtyAccessibility(),(this.isDirty(\"role\")||this.isDirty(\"ariaLive\")||this.isDirty(\"ariaChecked\")||this.isDirty(\"ariaHidden\")||this.isDirty(\"ariaOrientation\")||this.isDirty(\"ariaValueNow\")||this.isDirty(\"ariaValueMin\")||this.isDirty(\"ariaValueMax\")||this.isDirty(\"ariaValueText\")||this.isDirty(\"ariaLabel\")||this.isDirty(\"ariaControls\"))&&this.markDirtyAccessibility(),this.isDirty(\"exportable\")&&(t.exportable=this.get(\"exportable\")),this.isDirty(\"interactive\")){const t=this.events;this.get(\"interactive\")?this._hoverDp=new H([t.on(\"click\",(t=>{lt(t.originalEvent)&&(this.getPrivate(\"touchHovering\")||this.setTimeout((()=>{this._handleOver(),(this.get(\"tooltipText\")||this.get(\"tooltipHTML\"))&&this.showTooltip(),this.setPrivateRaw(\"touchHovering\",!0),this.events.dispatch(\"pointerover\",{type:\"pointerover\",target:t.target,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}),10))})),t.on(\"globalpointerup\",(t=>{lt(t.originalEvent)&&this.getPrivate(\"touchHovering\")&&(this._handleOut(),(this.get(\"tooltipText\")||this.get(\"tooltipHTML\"))&&this.hideTooltip(),this.setPrivateRaw(\"touchHovering\",!1),this.events.dispatch(\"pointerout\",{type:\"pointerout\",target:t.target,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})),this._isDown&&this._handleUp(t)})),t.on(\"pointerover\",(()=>{this._handleOver()})),t.on(\"pointerout\",(()=>{this._handleOut()})),t.on(\"pointerdown\",(t=>{this._handleDown(t)}))]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty(\"forceInactive\")&&(this._display.inactive=this.get(\"forceInactive\",!1)),\"always\"==this.get(\"showTooltipOn\")&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e=\"dragstop\";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get(\"active\")&&this.states.lookup(\"hoverActive\")?this.states.applyAnimate(\"hoverActive\"):this.get(\"disabled\")&&this.states.lookup(\"hoverDisabled\")?this.states.applyAnimate(\"hoverDisabled\"):this.states.applyAnimate(\"hover\"),this.get(\"draggable\")&&this._isDown&&this.states.lookup(\"down\")&&this.states.applyAnimate(\"down\"))}_handleOut(){this.isHidden()||(this.get(\"active\")&&this.states.lookup(\"active\")?this.states.applyAnimate(\"active\"):this.get(\"disabled\")&&this.states.lookup(\"disabled\")?this.states.applyAnimate(\"disabled\"):(this.states.lookup(\"hover\")||this.states.lookup(\"hoverActive\"))&&this.states.applyAnimate(\"default\"),this.get(\"draggable\")&&this._isDown&&this.states.lookup(\"down\")&&this.states.applyAnimate(\"down\"))}_handleUp(t){if(!this.isHidden()){this.get(\"active\")&&this.states.lookup(\"active\")?this.states.applyAnimate(\"active\"):this.get(\"disabled\")&&this.states.lookup(\"disabled\")?this.states.applyAnimate(\"disabled\"):this.states.lookup(\"down\")&&(this.isHover()?this.states.applyAnimate(\"hover\"):this.states.applyAnimate(\"default\")),this._downPoint=void 0;const e=nt(t.originalEvent);delete this._downPoints[e],0==$(this._downPoints).length&&(this._isDown=!1)}}_hasMoved(t){const e=nt(t.originalEvent),i=this._downPoints[e];if(i){const e=Math.abs(i.x-t.point.x),s=Math.abs(i.y-t.point.y);return e>5||s>5}return!1}_hasDown(){return $(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get(\"draggable\")&&e._handleDown(t),this.get(\"interactive\")&&!this.isHidden()){this.states.lookup(\"down\")&&this.states.applyAnimate(\"down\"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const e=nt(t.originalEvent);this._downPoints[e]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let i=0,s=this.parent;for(;null!=s;)i+=s.get(\"rotation\",0),s=s.parent;let r=t.point.x-e.point.x,n=t.point.y-e.point.y;const a=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const e=\"dragstart\";a.isEnabled(e)&&a.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let e=this._dragPoint;this.set(\"x\",e.x+r*de(i)+n*le(i)),this.set(\"y\",e.y+n*de(i)-r*le(i));const s=\"dragged\";a.isEnabled(s)&&a.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(r,n)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const e=\"dragstart\";a.isEnabled(e)&&a.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get(\"isMeasured\")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&\"absolute\"!=this.get(\"position\")&&(null==e.get(\"width\")||null==e.get(\"height\")||e.get(\"layout\"))&&e.markDirtyBounds(),this.get(\"focusable\")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get(\"visible\")&&this.getPrivate(\"visible\")&&!this.get(\"forceHidden\")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const t=\"boundschanged\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(t){let e=this.get(\"minWidth\",this.getPrivate(\"minWidth\")),i=this.get(\"minHeight\",this.getPrivate(\"minHeight\"));l(e)&&t.right-t.left0?t.right=t.left+s:t.left=t.right+s),l(r)&&(r>0?t.bottom=t.top+r:t.top=t.bottom+r)}_removeParent(t){t&&(t.children.removeValue(this),y(t._percentageSizeChildren,this),y(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(t){const e=this.getTooltip(),i=this.get(\"tooltipText\"),s=this.get(\"tooltipHTML\");if((i||s)&&e){const r=this.get(\"tooltipPosition\"),n=this.getPrivate(\"tooltipTarget\",this);\"fixed\"!=r&&t||(this._display._setMatrix(),t=this.toGlobal(n._getTooltipPoint())),e.set(\"pointTo\",t),e.set(\"tooltipTarget\",n),e.get(\"x\")||e.set(\"x\",t.x),e.get(\"y\")||e.set(\"y\",t.y),i&&e.label.set(\"text\",i),s&&e.label.set(\"html\",s);const a=this.dataItem;if(a&&e.label._setDataItem(a),\"always\"==this.get(\"showTooltipOn\")&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const o=e.show();return this.setPrivateRaw(\"showingTooltip\",!0),o}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get(\"tooltipTarget\")==this.getPrivate(\"tooltipTarget\",this)||this.get(\"tooltip\")==t)){let e=t.get(\"keepTargetHover\")&&0==t.get(\"stateAnimationDuration\",0)?400:void 0;const i=t.hide(e);return this.setPrivateRaw(\"showingTooltip\",!1),i}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,i=0;return this.get(\"isMeasured\")?(e=t.left+bt(this.get(\"tooltipX\",0),t.right-t.left),i=t.top+bt(this.get(\"tooltipY\",0),t.bottom-t.top)):(e=bt(this.get(\"tooltipX\",0),this.width()),i=bt(this.get(\"tooltipY\",0),this.height())),{x:e,y:i}}return{x:0,y:0}}getTooltip(){let t=this.get(\"tooltip\");if(t)return t;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get(\"dx\",0),i=this.get(\"dy\",0),s=this.get(\"x\"),r=this.getPrivate(\"x\"),n=0,a=0;const o=this.get(\"position\");s instanceof K&&(s=t?t.innerWidth()*s.value+t.get(\"paddingLeft\",0):0),l(s)?n=s+e:null!=r?n=r:t&&\"relative\"==o&&(n=t.get(\"paddingLeft\",0)+e);let h=this.get(\"y\"),d=this.getPrivate(\"y\");h instanceof K&&(h=t?t.innerHeight()*h.value+t.get(\"paddingTop\",0):0),l(h)?a=h+i:null!=d?a=d:t&&\"relative\"==o&&(a=t.get(\"paddingTop\",0)+i);const u=this._display;if(u.x!=n||u.y!=a){u.invalidateBounds(),u.x=n,u.y=a;const t=\"positionchanged\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}this.getPrivate(\"showingTooltip\")&&this.showTooltip()}x(){let t=this.get(\"x\"),e=this.getPrivate(\"x\");const i=this.parent;return i?t instanceof K?bt(t,i.innerWidth())+i.get(\"paddingLeft\",0):l(t)?t:null!=e?e:i.get(\"paddingLeft\",this._display.x):this._display.x}y(){let t=this.getPrivate(\"y\");if(null!=t)return t;let e=this.get(\"y\");const i=this.parent;return i?e instanceof K?bt(e,i.innerHeight())+i.get(\"paddingTop\",0):l(e)?e:null!=t?t:i.get(\"paddingTop\",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get(\"tooltip\");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),i=this.y();return{left:t.left+e,right:t.right+e,top:t.top+i,bottom:t.bottom+i}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),i=this.toGlobal({x:t.right,y:t.top}),s=this.toGlobal({x:t.right,y:t.bottom}),r=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,i.x,s.x,r.x),top:Math.min(e.y,i.y,s.y,r.y),right:Math.max(e.x,i.x,s.x,r.x),bottom:Math.max(e.y,i.y,s.y,r.y)}}_onShow(t){}_onHide(t){}appear(e,i){return t(this,void 0,void 0,(function*(){return yield this.hide(0),i?new Promise(((t,s)=>{this.setTimeout((()=>{t(this.show(e))}),i)})):this.show(e)}))}show(e){return t(this,void 0,void 0,(function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup(\"default\").get(\"visible\")&&this.set(\"visible\",!0),this._onShow(e);const t=this.states.applyAnimate(\"default\",e);yield Jt(t),this._isShowing=!1}}))}hide(e){return t(this,void 0,void 0,(function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup(\"hidden\");t||(t=this.states.create(\"hidden\",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate(\"hidden\",e);yield Jt(i),this._isHiding=!1}}))}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get(\"visible\")||!this.getPrivate(\"visible\")||this.get(\"forceHidden\"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get(\"opacity\",1);return this._parent?this._parent.compositeOpacity()*t:t}width(){let t=this.get(\"width\"),e=this.get(\"maxWidth\",this.getPrivate(\"maxWidth\")),i=this.get(\"minWidth\",this.getPrivate(\"minWidth\")),s=this.getPrivate(\"width\"),r=0;if(l(s))r=s;else if(null==t)this._adjustedLocalBounds&&(r=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof K){const e=this.parent;r=e?e.innerWidth()*t.value:this._root.width()*t.value}else l(t)&&(r=t);return l(i)&&(r=Math.max(i,r)),l(e)&&(r=Math.min(e,r)),r}maxWidth(){let t=this.get(\"maxWidth\",this.getPrivate(\"maxWidth\"));if(l(t))return t;{let t=this.get(\"width\");if(l(t))return t}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get(\"maxHeight\",this.getPrivate(\"maxHeight\"));if(l(t))return t;{let t=this.get(\"height\");if(l(t))return t}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get(\"height\"),e=this.get(\"maxHeight\",this.getPrivate(\"maxHeight\")),i=this.get(\"minHeight\",this.getPrivate(\"minHeight\")),s=this.getPrivate(\"height\"),r=0;if(l(s))r=s;else if(null==t)this._adjustedLocalBounds&&(r=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof K){const e=this.parent;r=e?e.innerHeight()*t.value:this._root.height()*t.value}else l(t)&&(r=t);return l(i)&&(r=Math.max(i,r)),l(e)&&(r=Math.min(e,r)),r}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const i=this._parent;t!==i&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(i),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get(\"numberFormatter\",this._root.numberFormatter)}getDateFormatter(){return this.get(\"dateFormatter\",this._root.dateFormatter)}getDurationFormatter(){return this.get(\"durationFormatter\",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return Z(this._downPoints,((t,e)=>t>e?1:t0&&(this._backgroundDisplay.beginFill(s,r),this._backgroundDisplay.drawRect(0,0,e,i),this._backgroundDisplay.endFill()),this._display.angle=this.get(\"rotation\",0),this._draw(),this._pattern=this._root._renderer.createPattern(this._display,this._backgroundDisplay,t,e,i)}}}Object.defineProperty(Le,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Pattern\"}),Object.defineProperty(Le,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([Le.className])});class Ne extends Le{constructor(){super(...arguments),Object.defineProperty(this,\"_image\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty(\"src\")&&this._load()}_draw(){super._draw();const t=this._image;if(t){const e=this.get(\"width\",100),i=this.get(\"height\",100),s=this.get(\"fit\",\"image\");let r=0,n=0;\"pattern\"==s?(r=e,n=i):(r=t.width,n=t.height,\"image\"==s&&(this.set(\"width\",r),this.set(\"height\",n)));let a=0,o=0;this.get(\"centered\",!0)&&(a=e/2-r/2,o=i/2-n/2),this._display.image(t,r,n,a,o)}}_load(){const t=this.get(\"src\");if(t){const e=new Image;e.src=t,e.decode().then((()=>{this._image=e,this._draw(),this.events.isEnabled(\"loaded\")&&this.events.dispatch(\"loaded\",{type:\"loaded\",target:this})})).catch((t=>{}))}}}var Re;Object.defineProperty(Ne,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"PicturePattern\"}),Object.defineProperty(Ne,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([Ne.className])}),function(t){t.ADD=\"lighter\",t.COLOR=\"color\",t.COLOR_BURN=\"color-burn\",t.COLOR_DODGE=\"color-dodge\",t.DARKEN=\"darken\",t.DIFFERENCE=\"difference\",t.DST_OVER=\"destination-over\",t.EXCLUSION=\"exclusion\",t.HARD_LIGHT=\"hard-light\",t.HUE=\"hue\",t.LIGHTEN=\"lighten\",t.LUMINOSITY=\"luminosity\",t.MULTIPLY=\"multiply\",t.NORMAL=\"source-over\",t.OVERLAY=\"overlay\",t.SATURATION=\"saturation\",t.SCREEN=\"screen\",t.SOFT_LIGHT=\"soft-light\",t.SRC_ATOP=\"source-atop\",t.XOR=\"xor\"}(Re||(Re={}));const Fe=[\"fill\",\"fillOpacity\",\"stroke\",\"strokeWidth\",\"strokeOpacity\",\"fillPattern\",\"strokePattern\",\"fillGradient\",\"strokeGradient\",\"strokeDasharray\",\"strokeDashoffset\"];class We extends He{constructor(){super(...arguments),Object.defineProperty(this,\"_display\",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,\"_clear\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty(\"draw\")||this.isDirty(\"svgPath\"))&&this.markDirtyBounds(),(this.isDirty(\"fill\")||this.isDirty(\"stroke\")||this.isDirty(\"visible\")||this.isDirty(\"forceHidden\")||this.isDirty(\"scale\")||this.isDirty(\"fillGradient\")||this.isDirty(\"strokeGradient\")||this.isDirty(\"fillPattern\")||this.isDirty(\"strokePattern\")||this.isDirty(\"fillOpacity\")||this.isDirty(\"strokeOpacity\")||this.isDirty(\"strokeWidth\")||this.isDirty(\"draw\")||this.isDirty(\"blendMode\")||this.isDirty(\"strokeDasharray\")||this.isDirty(\"strokeDashoffset\")||this.isDirty(\"svgPath\")||this.isDirty(\"lineJoin\")||this.isDirty(\"shadowColor\")||this.isDirty(\"shadowBlur\")||this.isDirty(\"shadowOffsetX\")||this.isDirty(\"shadowOffsetY\"))&&(this._clear=!0),this._display.crisp=this.get(\"crisp\",!1),this.isDirty(\"fillGradient\")){const t=this.get(\"fillGradient\");if(t){this._display.isMeasured=!0;const e=t.get(\"target\");e&&(this._disposers.push(e.events.on(\"boundschanged\",(()=>{this._markDirtyKey(\"fill\")}))),this._disposers.push(e.events.on(\"positionchanged\",(()=>{this._markDirtyKey(\"fill\")}))))}}if(this.isDirty(\"strokeGradient\")){const t=this.get(\"strokeGradient\");if(t){this._display.isMeasured=!0;const e=t.get(\"target\");e&&(this._disposers.push(e.events.on(\"boundschanged\",(()=>{this._markDirtyKey(\"stroke\")}))),this._disposers.push(e.events.on(\"positionchanged\",(()=>{this._markDirtyKey(\"stroke\")}))))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get(\"strokeDasharray\");l(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get(\"strokeDashoffset\");e&&this._display.setLineDashOffset(e);const i=this.get(\"blendMode\",Re.NORMAL);this._display.blendMode=i;const s=this.get(\"draw\");s&&s(this._display,this);const r=this.get(\"svgPath\");null!=r&&this._display.svgPath(r)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get(\"fill\"),e=this.get(\"fillGradient\"),i=this.get(\"fillPattern\"),s=this.get(\"fillOpacity\"),r=this.get(\"stroke\"),n=this.get(\"strokeGradient\"),a=this.get(\"strokePattern\"),o=this.get(\"shadowColor\"),h=this.get(\"shadowBlur\"),l=this.get(\"shadowOffsetX\"),d=this.get(\"shadowOffsetY\"),u=this.get(\"shadowOpacity\");if(o&&(h||l||d)&&this._display.shadow(o,h,l,d,u),i){let e=!1;!t||i.get(\"fill\")&&!i.get(\"fillInherited\")||(i.set(\"fill\",t),i.set(\"fillInherited\",!0),e=!0),!r||i.get(\"color\")&&!i.get(\"colorInherited\")||(i.set(\"color\",r),i.set(\"colorInherited\",!0),e=!0),e&&i._changed();const n=i.pattern;n&&(this._display.beginFill(n,s),this._display.endFill(),i instanceof Ne&&i.events.once(\"loaded\",(()=>{this._clear=!0,this.markDirty()})))}else if(e){if(t){const i=e.get(\"stops\",[]);i.length&&m(i,(e=>{e.color&&!e.colorInherited||!t||(e.color=t,e.colorInherited=!0),(null==e.opacity||e.opacityInherited)&&(e.opacity=s,e.opacityInherited=!0)}))}const i=e.getFill(this);i&&(this._display.beginFill(i,s),this._display.endFill())}else t&&(this._display.beginFill(t,s),this._display.endFill());if(r||n||a){const t=this.get(\"strokeOpacity\");let e=this.get(\"strokeWidth\",1);this.get(\"nonScalingStroke\")&&(e/=this.get(\"scale\",1)),this.get(\"crisp\")&&(e/=this._root._renderer.resolution);const i=this.get(\"lineJoin\");if(a){let s=!1;!r||a.get(\"color\")&&!a.get(\"colorInherited\")||(a.set(\"color\",r),a.set(\"colorInherited\",!0),s=!0),s&&a._changed();const n=a.pattern;n&&(this._display.lineStyle(e,n,t,i),this._display.endStroke(),a instanceof Ne&&a.events.once(\"loaded\",(()=>{this._clear=!0,this.markDirty()})))}else if(n){const s=n.get(\"stops\",[]);s.length&&m(s,(e=>{e.color&&!e.colorInherited||!r||(e.color=r,e.colorInherited=!0),(null==e.opacity||e.opacityInherited)&&(e.opacity=t,e.opacityInherited=!0)}));const a=n.getFill(this);a&&(this._display.lineStyle(e,a,t,i),this._display.endStroke())}else r&&(this._display.lineStyle(e,r,t,i),this._display.endStroke())}this.getPrivate(\"showingTooltip\")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(We,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Graphics\"}),Object.defineProperty(We,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([We.className])});class Ve extends We{_beforeChanged(){super._beforeChanged(),(this.isDirty(\"width\")||this.isDirty(\"height\")||this.isPrivateDirty(\"width\")||this.isPrivateDirty(\"height\"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get(\"draw\")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function Ue(t,e){t.get(\"reverseChildren\",!1)?t.children.eachReverse(e):t.children.each(e)}Object.defineProperty(Ve,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Rectangle\"}),Object.defineProperty(Ve,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:We.classNames.concat([Ve.className])});class Ke extends Ee{}Object.defineProperty(Ke,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Layout\"}),Object.defineProperty(Ke,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Ee.classNames.concat([Ke.className])});class ze extends Ke{updateContainer(t){let e=t.get(\"paddingLeft\",0),i=t.innerWidth(),s=0;Ue(t,(t=>{if(t.isVisible()&&\"relative\"==t.get(\"position\")){let e=t.get(\"width\");if(e instanceof K){s+=e.value;let r=i*e.value,n=t.get(\"minWidth\",t.getPrivate(\"minWidth\",-1/0));n>r&&(i-=n,s-=e.value);let a=t.get(\"maxWidth\",t.getPrivate(\"maxWidth\",1/0));r>a&&(i-=a,s-=e.value)}else l(e)||(e=t.width()),i-=e+t.get(\"marginLeft\",0)+t.get(\"marginRight\",0)}})),(i<=0||i==1/0)&&(i=.1),Ue(t,(t=>{if(t.isVisible()&&\"relative\"==t.get(\"position\")){let e=t.get(\"width\");if(e instanceof K){let r=i*e.value/s-t.get(\"marginLeft\",0)-t.get(\"marginRight\",0),n=t.get(\"minWidth\",t.getPrivate(\"minWidth\",-1/0)),a=t.get(\"maxWidth\",t.getPrivate(\"maxWidth\",1/0));r=Math.min(Math.max(n,r),a),t.setPrivate(\"width\",r)}else t._prevSettings.width instanceof K&&t.setPrivate(\"width\",void 0)}}));let r=e;Ue(t,(t=>{if(\"relative\"==t.get(\"position\"))if(t.isVisible()){let e=t.adjustedLocalBounds(),i=t.get(\"marginLeft\",0),s=t.get(\"marginRight\",0),n=t.get(\"maxWidth\"),a=e.left,o=e.right;n&&o-a>n&&(o=a+n);let h=r+i-a;t.setPrivate(\"x\",h),r=h+o+s}else t.setPrivate(\"x\",void 0)}))}}Object.defineProperty(ze,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"HorizontalLayout\"}),Object.defineProperty(ze,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Ke.classNames.concat([ze.className])});class Ge extends Ke{updateContainer(t){let e=t.get(\"paddingTop\",0),i=t.innerHeight(),s=0;Ue(t,(t=>{if(t.isVisible()&&\"relative\"==t.get(\"position\")){let e=t.get(\"height\");if(e instanceof K){s+=e.value;let r=i*e.value,n=t.get(\"minHeight\",t.getPrivate(\"minHeight\",-1/0));n>r&&(i-=n,s-=e.value);let a=t.get(\"maxHeight\",t.getPrivate(\"maxHeight\",1/0));r>a&&(i-=a,s-=e.value)}else l(e)||(e=t.height()),i-=e+t.get(\"marginTop\",0)+t.get(\"marginBottom\",0)}})),(i<=0||i==1/0)&&(i=.1),Ue(t,(t=>{if(t.isVisible()&&\"relative\"==t.get(\"position\")){let e=t.get(\"height\");if(e instanceof K){let r=i*e.value/s-t.get(\"marginTop\",0)-t.get(\"marginBottom\",0),n=t.get(\"minHeight\",t.getPrivate(\"minHeight\",-1/0)),a=t.get(\"maxHeight\",t.getPrivate(\"maxHeight\",1/0));r=Math.min(Math.max(n,r),a),t.setPrivate(\"height\",r)}else t._prevSettings.height instanceof K&&t.setPrivate(\"height\",void 0)}}));let r=e;Ue(t,(t=>{if(\"relative\"==t.get(\"position\"))if(t.isVisible()){let e=t.adjustedLocalBounds(),i=t.get(\"marginTop\",0),s=e.top,n=e.bottom,a=t.get(\"maxHeight\");a&&n-s>a&&(n=s+a);let o=t.get(\"marginBottom\",0),h=r+i-s;t.setPrivate(\"y\",h),r=h+n+o}else t.setPrivate(\"y\",void 0)}))}}Object.defineProperty(Ge,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"VerticalLayout\"}),Object.defineProperty(Ge,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Ke.classNames.concat([Ge.className])});class Ye extends Ke{_afterNew(){this._setRawDefault(\"maxColumns\",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get(\"paddingLeft\",0),i=t.get(\"paddingRight\",0),s=t.get(\"paddingTop\",0),r=t.maxWidth()-e-i,n=r,a=1;Ue(t,(t=>{if(t.get(\"visible\")&&t.getPrivate(\"visible\")&&!t.get(\"forceHidden\")&&\"absolute\"!=t.get(\"position\")){let e=t.width();ea&&(a=e)}})),n=he(n,1,r),a=he(a,1,r);let o=1;o=this.get(\"fixedWidthGrid\")?r/a:r/n,o=Math.max(1,Math.floor(o)),o=Math.min(this.get(\"maxColumns\",Number.MAX_VALUE),o);let h=this.getColumnWidths(t,o,a,r),l=s,d=0,u=0;o=h.length;let p=e;Ue(t,(t=>{if(\"relative\"==t.get(\"position\")&&t.isVisible()){const i=t.get(\"marginTop\",0),s=t.get(\"marginBottom\",0);let r=t.adjustedLocalBounds(),n=t.get(\"marginLeft\",0),a=t.get(\"marginRight\",0),c=p+n-r.left,g=l+i-r.top;t.setPrivate(\"x\",c),t.setPrivate(\"y\",g),p+=h[d]+a,u=Math.max(u,t.height()+i+s),d++,d>=o&&(d=0,p=e,l+=u)}}))}getColumnWidths(t,e,i,s){let r=0,n=[],a=0;return Ue(t,(s=>{let r=s.adjustedLocalBounds();\"absolute\"!=s.get(\"position\")&&s.isVisible()&&(this.get(\"fixedWidthGrid\")?n[a]=i:n[a]=Math.max(0|n[a],r.right-r.left+s.get(\"marginLeft\",0)+s.get(\"marginRight\",0)),a{r+=t})),r>s?e>2?(e-=1,this.getColumnWidths(t,e,i,s)):[s]:n}}Object.defineProperty(Ye,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"GridLayout\"}),Object.defineProperty(Ye,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Ke.classNames.concat([Ye.className])});class Xe{static escape(t){return t.replace(/\\[\\[/g,this.prefix+\"1\").replace(/([^\\/\\]]{1})\\]\\]/g,\"$1\"+this.prefix+\"2\").replace(/\\]\\]/g,this.prefix+\"2\").replace(/\\{\\{/g,this.prefix+\"3\").replace(/\\}\\}/g,this.prefix+\"4\").replace(/\\'\\'/g,this.prefix+\"5\")}static unescape(t){return t.replace(new RegExp(this.prefix+\"1\",\"g\"),\"[[\").replace(new RegExp(this.prefix+\"2\",\"g\"),\"]]\").replace(new RegExp(this.prefix+\"3\",\"g\"),\"{{\").replace(new RegExp(this.prefix+\"4\",\"g\"),\"}}\").replace(new RegExp(this.prefix+\"5\",\"g\"),\"''\")}static cleanUp(t){return t.replace(/\\[\\[/g,\"[\").replace(/\\]\\]/g,\"]\").replace(/\\{\\{/g,\"{\").replace(/\\}\\}/g,\"}\").replace(/\\'\\'/g,\"'\")}static chunk(t,e=!1,i=!1){let s=[];t=this.escape(t);let r=e?t.split(\"'\"):[t];for(let n=0;n{t.dispose()})),this.getPrivate(\"htmlElement\")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty(\"interactiveChildren\")&&(this._display.interactiveChildren=this.get(\"interactiveChildren\",!1)),this.isDirty(\"layout\")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each((t=>{t.removePrivate(\"x\"),t.removePrivate(\"y\")}))),(this.isDirty(\"paddingTop\")||this.isDirty(\"paddingBottom\")||this.isDirty(\"paddingLeft\")||this.isDirty(\"paddingRight\"))&&this.children.each((t=>{t.markDirtyPosition()})),this.isDirty(\"maskContent\")){const t=this._childrenDisplay;let e=this._contentMask;this.get(\"maskContent\")?e||(e=Ve.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),m(this._percentageSizeChildren,(t=>{t._updateSize()})),m(this._percentagePositionChildren,(t=>{t.markDirtyPosition(),t._updateSize()})),this.updateBackground()}updateBackground(){const t=this.get(\"background\");let e=this._localBounds;if(e&&!this.isHidden()){let i=e.left,s=e.top,r=e.right-i,n=e.bottom-s,a=this.get(\"maxWidth\"),o=this.get(\"maxHeight\");o&&n>o&&(n=o),a&&r>a&&(r=a);let h=this.width(),l=this.height();t&&(t.setAll({width:r,height:n,x:i,y:s}),this._display.interactive&&(t._display.interactive=!0));const d=this._contentMask;d&&d.setAll({width:h+1,height:l+1});const u=this.get(\"verticalScrollbar\");if(u){u.set(\"height\",l),u.set(\"x\",h-u.width()-u.get(\"marginRight\",0)),u.set(\"end\",u.get(\"start\",0)+l/this._contentHeight);const t=u.get(\"background\");t&&t.setAll({width:u.width(),height:l});let e=!0;this._contentHeight<=l&&(e=!1),u.setPrivate(\"visible\",e)}}}_applyThemes(){return!!super._applyThemes()&&(this.eachChildren((t=>{t._applyThemes()})),!0)}_applyState(t){super._applyState(t),this.get(\"setStateOnChildren\")&&this.eachChildren((e=>{e.states.apply(t)}))}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get(\"setStateOnChildren\")&&this.eachChildren((i=>{i.states.applyAnimate(t,e)}))}innerWidth(){return this.width()-this.get(\"paddingRight\",0)-this.get(\"paddingLeft\",0)}innerHeight(){return this.height()-this.get(\"paddingTop\",0)-this.get(\"paddingBottom\",0)}_getBounds(){let t=this.get(\"width\"),e=this.get(\"height\"),i=this.getPrivate(\"width\"),s=this.getPrivate(\"height\"),r={left:0,top:0,right:this.width(),bottom:this.height()},n=this.get(\"layout\"),a=!1,o=!1;if((n instanceof ze||n instanceof Ye)&&(a=!0),n instanceof Ge&&(o=!0),null==t&&null==i||null==e&&null==s||this.get(\"verticalScrollbar\")){let t=Number.MAX_VALUE,e=t,i=-t,s=t,n=-t;const h=this.get(\"paddingLeft\",0),l=this.get(\"paddingTop\",0),d=this.get(\"paddingRight\",0),u=this.get(\"paddingBottom\",0);this.children.each((t=>{if(\"absolute\"!=t.get(\"position\")&&t.get(\"isMeasured\")){let r=t.adjustedLocalBounds(),h=t.x(),l=t.y(),d=h+r.left,u=h+r.right,p=l+r.top,c=l+r.bottom;a&&(d-=t.get(\"marginLeft\",0),u+=t.get(\"marginRight\",0)),o&&(p-=t.get(\"marginTop\",0),c+=t.get(\"marginBottom\",0)),di&&(i=u),pn&&(n=c)}})),e==t&&(e=0),i==-t&&(i=0),s==t&&(s=0),n==-t&&(n=0),r.left=e-h,r.top=s-l,r.right=i+d,r.bottom=n+u}else;this._contentWidth=r.right-r.left,this._contentHeight=r.bottom-r.top,l(t)&&(r.left=0,r.right=t),l(i)&&(r.left=0,r.right=i),l(e)&&(r.top=0,r.bottom=e),l(s)&&(r.top=0,r.bottom=s),this._localBounds=r}_updateBounds(){const t=this.get(\"layout\");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let i=this.get(\"layout\"),s=!1,r=!1;i&&((i instanceof ze||i instanceof Ye)&&(s=!0),i instanceof Ge&&(r=!0)),m(this._percentageSizeChildren,(i=>{if(!s){let e=i.get(\"width\");e instanceof K&&i.setPrivate(\"width\",e.value*t)}if(!r){let t=i.get(\"height\");t instanceof K&&i.setPrivate(\"height\",t.value*e)}})),m(this._percentagePositionChildren,(t=>{t.markDirtyPosition(),t.markDirtyBounds()})),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty(\"html\")){const t=this.get(\"html\");t&&\"\"!==t?this._root._setHTMLContent(this,$e(this,this.get(\"html\",\"\"))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty(\"verticalScrollbar\")){const t=this.get(\"verticalScrollbar\");if(t){t._setParent(this),t.startGrip.setPrivate(\"visible\",!1),t.endGrip.setPrivate(\"visible\",!1),this.set(\"maskContent\",!0),this.set(\"paddingRight\",t.width()+t.get(\"marginRight\",0)+t.get(\"marginLeft\",0));let e=this.get(\"background\");e||(e=this.set(\"background\",Ve.new(this._root,{themeTags:[\"background\"],fillOpacity:0,fill:this._root.interfaceColors.get(\"alternativeBackground\")}))),this._vsbd0=this.events.on(\"wheel\",(e=>{const i=e.originalEvent;if(!gt(i,this))return;i.preventDefault();let s=i.deltaY/5e3;const r=t.get(\"start\",0),n=t.get(\"end\",1);r+s<=0&&(s=-r),n+s>=1&&(s=1-n),r+s>=0&&n+s<=1&&(t.set(\"start\",r+s),t.set(\"end\",n+s))})),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on(\"rangechanged\",(()=>{let e=this._contentHeight;const i=this._childrenDisplay,s=this._contentMask;i.y=-t.get(\"start\")*e,i.markDirtyLayer(),s&&(s._display.y=-i.y,i.mask=s._display)})),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const t=this._prevSettings.verticalScrollbar;if(t){this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose();this._childrenDisplay.y=0,this.setPrivate(\"height\",void 0),this.set(\"maskContent\",!1),this.set(\"paddingRight\",void 0)}}}if(this.isDirty(\"background\")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get(\"background\");e instanceof He&&(e.set(\"isMeasured\",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty(\"mask\")){const t=this.get(\"mask\"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const e=t.parent;e&&e.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each((t=>{t._processTemplateField()}))}walkChildren(t){this.children.each((e=>{e instanceof Qe&&e.walkChildren(t),t(e)}))}eachChildren(t){const e=this.get(\"background\");e&&t(e);const i=this.get(\"verticalScrollbar\");i&&t(i);const s=this.get(\"mask\");s&&t(s),this.children.values.forEach((e=>{t(e)}))}allChildren(){const t=[];return this.eachChildren((e=>{t.push(e)})),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const i=this.get(\"html\",\"\");i&&\"\"!==i&&e&&this._root._setHTMLContent(this,$e(this,i))}}Object.defineProperty(Qe,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Container\"}),Object.defineProperty(Qe,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([Qe.className])});class ti extends He{constructor(){super(...arguments),Object.defineProperty(this,\"textStyle\",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,\"_display\",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText(\"\",this.textStyle)}),Object.defineProperty(this,\"_textStyles\",{enumerable:!0,configurable:!0,writable:!0,value:[\"textAlign\",\"fontFamily\",\"fontSize\",\"fontStyle\",\"fontWeight\",\"fontStyle\",\"fontVariant\",\"textDecoration\",\"shadowColor\",\"shadowBlur\",\"shadowOffsetX\",\"shadowOffsetY\",\"shadowOpacity\",\"lineHeight\",\"baselineRatio\",\"direction\",\"textBaseline\",\"oversizedBehavior\",\"breakWords\",\"ellipsis\",\"minScale\"]}),Object.defineProperty(this,\"_originalScale\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get(\"text\"))super._updateBounds();else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty(\"opacity\")){let t=this.get(\"opacity\",1);this._display.alpha=t}if((this.isDirty(\"text\")||this.isDirty(\"populateText\"))&&(this._display.text=this._getText(),this.markDirtyBounds(),\"tooltip\"==this.get(\"role\")&&this._root.updateTooltip(this)),this.isPrivateDirty(\"tooltipElement\")){this.getPrivate(\"tooltipElement\")&&this._disposers.push(new B((()=>{this._root._removeTooltipElement(this)})))}if(this.isDirty(\"width\")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty(\"oversizedBehavior\")&&(t.oversizedBehavior=this.get(\"oversizedBehavior\",\"none\"),this.markDirtyBounds()),this.isDirty(\"breakWords\")&&(t.breakWords=this.get(\"breakWords\",!1),this.markDirtyBounds()),this.isDirty(\"ellipsis\")&&(t.ellipsis=this.get(\"ellipsis\"),this.markDirtyBounds()),this.isDirty(\"ignoreFormatting\")&&(t.ignoreFormatting=this.get(\"ignoreFormatting\",!1),this.markDirtyBounds()),this.isDirty(\"minScale\")&&(t.minScale=this.get(\"minScale\",0),this.markDirtyBounds()),this.isDirty(\"fill\")){let e=this.get(\"fill\");e&&(t.fill=e)}if(this.isDirty(\"fillOpacity\")){let e=this.get(\"fillOpacity\",1);e&&(t.fillOpacity=e)}(this.isDirty(\"maxWidth\")||this.isPrivateDirty(\"maxWidth\"))&&(t.maxWidth=this.get(\"maxWidth\",this.getPrivate(\"maxWidth\")),this.markDirtyBounds()),(this.isDirty(\"maxHeight\")||this.isPrivateDirty(\"maxHeight\"))&&(t.maxHeight=this.get(\"maxHeight\",this.getPrivate(\"maxHeight\")),this.markDirtyBounds()),m(this._textStyles,(e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())})),t.fontSize=this.get(\"fontSize\"),t.fontFamily=this.get(\"fontFamily\"),this._display.style=t,this.isDirty(\"role\")&&\"tooltip\"==this.get(\"role\")&&this._root.updateTooltip(this)}_getText(){const t=this.get(\"text\",\"\");return this.get(\"populateText\")?$e(this,t):t}markDirtyText(){this._display.text=this._getText(),\"tooltip\"==this.get(\"role\")&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get(\"populateText\")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(ti,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Text\"}),Object.defineProperty(ti,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:He.classNames.concat([ti.className])});class ei extends Qe{constructor(){super(...arguments),Object.defineProperty(this,\"_text\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_textKeys\",{enumerable:!0,configurable:!0,writable:!0,value:[\"text\",\"fill\",\"fillOpacity\",\"textAlign\",\"fontFamily\",\"fontSize\",\"fontStyle\",\"fontWeight\",\"fontStyle\",\"fontVariant\",\"textDecoration\",\"shadowColor\",\"shadowBlur\",\"shadowOffsetX\",\"shadowOffsetY\",\"shadowOpacity\",\"lineHeight\",\"baselineRatio\",\"direction\",\"textBaseline\",\"oversizedBehavior\",\"breakWords\",\"ellipsis\",\"minScale\",\"populateText\",\"role\",\"ignoreFormatting\"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),m(this._textKeys,(t=>{const e=this.get(t);null!=e&&this._text.set(t,e)})),\"\"!==this.get(\"html\",\"\")&&this._text.set(\"text\",\"\"),this.onPrivate(\"maxWidth\",(()=>{this._setMaxDimentions()})),this.onPrivate(\"maxHeight\",(()=>{this._setMaxDimentions()}))}_makeText(){this._text=this.children.push(ti.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),m(this._textKeys,(t=>{this._text.set(t,this.get(t))})),this.isDirty(\"maxWidth\")&&this._setMaxDimentions(),this.isDirty(\"maxHeight\")&&this._setMaxDimentions(),this.isDirty(\"rotation\")&&this._setMaxDimentions(),\"\"!==this.get(\"html\",\"\")?this._text.set(\"text\",\"\"):this._text.set(\"text\",this.get(\"text\")),this.isDirty(\"textAlign\")||this.isDirty(\"width\")){const t=this.get(\"textAlign\");let e;null!=this.get(\"width\")?e=\"right\"==t?Y:\"center\"==t?X:0:\"left\"==t||\"start\"==t?e=this.get(\"paddingLeft\"):\"right\"!=t&&\"end\"!=t||(e=-this.get(\"paddingRight\")),this.text.set(\"x\",e)}}_setMaxDimentions(){const t=this.get(\"rotation\"),e=90==t||270==t||-90==t,i=this.get(\"maxWidth\",this.getPrivate(\"maxWidth\",1/0));l(i)?this.text.set(e?\"maxHeight\":\"maxWidth\",i-this.get(\"paddingLeft\",0)-this.get(\"paddingRight\",0)):this.text.set(e?\"maxHeight\":\"maxWidth\",void 0);const s=this.get(\"maxHeight\",this.getPrivate(\"maxHeight\",1/0));l(s)?this.text.set(e?\"maxWidth\":\"maxHeight\",s-this.get(\"paddingTop\",0)-this.get(\"paddingBottom\",0)):this.text.set(e?\"maxWidth\":\"maxHeight\",void 0)}_setDataItem(t){super._setDataItem(t),this._markDirtyKey(\"text\"),this.text.get(\"populateText\")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(ei,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Label\"}),Object.defineProperty(ei,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:Qe.classNames.concat([ei.className])});class ii{constructor(t,e){if(Object.defineProperty(this,\"_root\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_rules\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error(\"You cannot use `new Class()`, instead use `Class.new()`\")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let i=this._rules[t];i||(i=this._rules[t]=[]),e.sort(De);const{index:s,found:r}=E(i,(t=>{const i=De(t.tags.length,e.length);return 0===i?xe(t.tags,e,De):i}));if(r)return i[s].template;{const t=Be.new({});return i.splice(s,0,{tags:e,template:t}),t}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ge as $,I as A,c as B,Zt as C,B as D,Ee as E,dt as F,L as G,ht as H,pt as I,y as J,D as K,P as L,H as M,Re as N,b as O,u as P,K as Q,z as R,ue as S,Xe as T,ut as U,A as V,_t as W,pe as X,ne as Y,Dt as Z,N as _,d as a,ze as a0,Ye as a1,we as a2,Qe as a3,Y as a4,Ve as a5,$t as a6,We as a7,at as a8,ot as a9,e as aA,vt as aB,oe as aC,V as aD,Be as aE,Gt as aF,je as aG,S as aH,te as aI,re as aJ,le as aK,de as aL,Fe as aM,ge as aN,$ as aa,De as ab,et as ac,v as ad,Ot as ae,$e as af,ti as ag,ft as ah,Pe as ai,he as aj,zt as ak,ei as al,ii as am,fe as an,X as ao,me as ap,G as aq,ae as ar,W as as,gt as at,w as au,ke as av,lt as aw,F as ax,Ht as ay,bt as az,J as b,kt as c,p as d,m as e,q as f,l as g,It as h,h as i,Bt as j,M as k,At as l,St as m,n,st as o,yt as p,Ct as q,jt as r,Et as s,Mt as t,s as u,Tt as v,Q as w,_ as x,rt as y,it as z};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{a7 as t,aj as e,a3 as i,ak as s,al as o,z as r,ad as l,M as a,C as n,Q as h}from\"./Theme.js\";class p extends t{_beforeChanged(){super._beforeChanged(),(this.isDirty(\"pointerBaseWidth\")||this.isDirty(\"cornerRadius\")||this.isDirty(\"pointerLength\")||this.isDirty(\"pointerX\")||this.isDirty(\"pointerY\")||this.isDirty(\"width\")||this.isDirty(\"height\"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let s=this.get(\"cornerRadius\",8);s=e(s,0,Math.min(t/2,i/2));let o=this.get(\"pointerX\",0),r=this.get(\"pointerY\",0),l=this.get(\"pointerBaseWidth\",15)/2,a=0,n=0,h=0,p=(o-a)*(i-n)-(r-n)*(t-a),u=(o-h)*(0-i)-(r-i)*(t-h);const g=this._display;if(g.moveTo(s,0),p>0&&u>0){let i=Math.round(e(o,s+l,t-l-s));r=e(r,-1/0,0),g.lineTo(i-l,0),g.lineTo(o,r),g.lineTo(i+l,0)}if(g.lineTo(t-s,0),g.arcTo(t,0,t,s,s),p>0&&u<0){let a=Math.round(e(r,s+l,i-l-s));o=e(o,t,1/0),g.lineTo(t,s),g.lineTo(t,Math.max(a-l,s)),g.lineTo(o,r),g.lineTo(t,a+l)}if(g.lineTo(t,i-s),g.arcTo(t,i,t-s,i,s),p<0&&u<0){let a=Math.round(e(o,s+l,t-l-s));r=e(r,i,1/0),g.lineTo(t-s,i),g.lineTo(a+l,i),g.lineTo(o,r),g.lineTo(a-l,i)}if(g.lineTo(s,i),g.arcTo(0,i,0,i-s,s),p<0&&u>0){let t=Math.round(e(r,s+l,i-s-l));o=e(o,-1/0,0),g.lineTo(0,i-s),g.lineTo(0,t+l),g.lineTo(o,r),g.lineTo(0,Math.max(t-l,s))}g.lineTo(0,s),g.arcTo(0,0,s,0,s),g.closePath()}}}}Object.defineProperty(p,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"PointedRectangle\"}),Object.defineProperty(p,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:t.classNames.concat([p.className])});class u extends i{constructor(t,e,i,s=[]){super(t,e,i,s),Object.defineProperty(this,\"_fx\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_fy\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_label\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_fillDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_strokeDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_labelDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_w\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_h\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_keepHoverDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_htmlContentHovered\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=s(this._settings.themeTags,[\"tooltip\"]),super._afterNew(),this.set(\"background\",p.new(this._root,{themeTags:[\"tooltip\",\"background\"]})),this._label=this.children.push(o.new(this._root,{})),this._disposers.push(this._label.events.on(\"boundschanged\",(()=>{this._updateBackground()}))),this._disposers.push(this.on(\"bounds\",(()=>{this._updateBackground()}))),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate(\"htmlElement\",(t=>{t&&(r(t,\"pointerover\",(t=>{this._htmlContentHovered=!0})),r(t,\"pointerout\",(t=>{this._htmlContentHovered=!1})))}))),this._root._tooltips.push(this)}get label(){return this._label}dispose(){super.dispose(),l(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty(\"pointerOrientation\")||this.isPrivateDirty(\"minWidth\")||this.isPrivateDirty(\"minHeight\"))&&this.get(\"background\")._markDirtyKey(\"width\");null!=this.get(\"labelText\")&&this.label.set(\"text\",this.get(\"labelText\"));null!=this.get(\"labelHTML\")&&this.label.set(\"html\",this.get(\"labelHTML\"))}_changed(){if(super._changed(),(this.isDirty(\"pointTo\")||this.isDirty(\"pointerOrientation\"))&&this._updateBackground(),this.isDirty(\"tooltipTarget\")&&this.updateBackgroundColor(),this.isDirty(\"keepTargetHover\")){if(this.get(\"keepTargetHover\")){const t=this.get(\"background\");this._keepHoverDp=new a([t.events.on(\"pointerover\",(t=>{let e=this.get(\"tooltipTarget\");e&&(e.parent&&e.parent.getPrivate(\"tooltipTarget\")==e&&(e=e.parent),e.hover())})),t.events.on(\"pointerout\",(t=>{let e=this.get(\"tooltipTarget\");e&&(e.parent&&e.parent.getPrivate(\"tooltipTarget\")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())}))]),this.label.onPrivate(\"htmlElement\",(e=>{this._keepHoverDp&&e&&this._keepHoverDp.disposers.push(r(e,\"pointerleave\",(e=>{const i=this.root._renderer.getEvent(e);t.events.dispatch(\"pointerout\",{type:\"pointerout\",originalEvent:i.event,point:i.point,simulated:!1,target:t})})))}))}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get(\"tooltipTarget\");const e=this.get(\"background\");let i,s;t&&e&&(i=t.get(\"fill\"),s=t.get(\"stroke\"),null==i&&(i=s),this.get(\"getFillFromSprite\")&&(this._fillDp&&this._fillDp.dispose(),null!=i&&e.set(\"fill\",i),this._fillDp=t.on(\"fill\",(t=>{null!=t&&(e.set(\"fill\",t),this._updateTextColor(t))})),this._disposers.push(this._fillDp)),this.get(\"getStrokeFromSprite\")&&(this._strokeDp&&this._strokeDp.dispose(),null!=i&&e.set(\"stroke\",i),this._strokeDp=t.on(\"fill\",(t=>{null!=t&&e.set(\"stroke\",t)})),this._disposers.push(this._strokeDp)),this.get(\"getLabelFillFromSprite\")&&(this._labelDp&&this._labelDp.dispose(),null!=i&&this.label.set(\"fill\",i),this._labelDp=t.on(\"fill\",(t=>{null!=t&&this.label.set(\"fill\",t)})),this._disposers.push(this._labelDp))),this._updateTextColor(i)}_updateTextColor(t){this.get(\"autoTextColor\")&&(null==t&&(t=this.get(\"background\").get(\"fill\")),null==t&&(t=this._root.interfaceColors.get(\"background\")),t instanceof n&&this.label.set(\"fill\",n.alternative(t,this._root.interfaceColors.get(\"alternativeText\"),this._root.interfaceColors.get(\"text\"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,s=.5,o=this.get(\"centerX\");o instanceof h&&(i=o.value);let r=this.get(\"centerY\");r instanceof h&&(s=r.value);let l=t.width(),a=t.height(),n=this.parent,u=0,g=0;if(n){u=n.x(),g=n.y();const t=n.get(\"layerMargin\");t&&(u+=t.left||0,g+=t.top||0,l+=(t.left||0)+(t.right||0),a+=(t.top||0)+(t.bottom||0))}const d=this.get(\"bounds\",{left:-u,top:-g,right:l-u,bottom:a-g});this._updateBounds();let c=this.width(),b=this.height();0===c&&(c=this._w),0===b&&(b=this._h);let _=this.get(\"pointTo\",{x:l/2,y:a/2}),f=_.x,m=_.y,v=this.get(\"pointerOrientation\"),T=this.get(\"background\"),y=0,D=0,k=0;T instanceof p&&(y=T.get(\"pointerLength\",0),D=T.get(\"strokeWidth\",0)/2,k=D,T.set(\"width\",c),T.set(\"height\",b));let w=0,x=0,P=d.right-d.left,C=d.bottom-d.top;\"horizontal\"==v||\"left\"==v||\"right\"==v?(D=0,\"horizontal\"==v?f>d.left+P/2?(f-=c*(1-i)+y,k*=-1):f+=c*i+y:\"left\"==v?f+=c*(1-i)+y:(f-=c*i+y,k*=-1)):(k=0,\"vertical\"==v?m>d.top+b/2+y?m-=b*(1-s)+y:(m+=b*s+y,D*=-1):\"down\"==v?m-=b*(1-s)+y:(m+=b*s+y,D*=-1)),f=e(f,d.left+c*i,d.left+P-c*(1-i))+k,m=e(m,d.top+b*s,d.top+C-b*(1-s))-D,w=_.x-f+c*i+k,x=_.y-m+b*s-D,this._fx=f,this._fy=m;const O=this.get(\"animationDuration\",0);if(O>0&&this.get(\"visible\")&&this.get(\"opacity\")>.1){const t=this.get(\"animationEasing\");this.animate({key:\"x\",to:f,duration:O,easing:t}),this.animate({key:\"y\",to:m,duration:O,easing:t})}else this.set(\"x\",f),this.set(\"y\",m);T instanceof p&&(T.set(\"pointerX\",w),T.set(\"pointerY\",x)),c>0&&(this._w=c),b>0&&(this._h=b)}}}Object.defineProperty(u,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Tooltip\"}),Object.defineProperty(u,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:i.classNames.concat([u.className])});export{u as T};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{am as e,C as t,an as o,ao as a,a4 as i,a1 as n,ap as r}from\"./Theme.js\";function l(e,t,o,a){e.set(t,o.get(a)),o.on(a,(o=>{e.set(t,o)}))}class s extends e{setupDefaultRules(){super.setupDefaultRules();const e=this._root.language,s=this._root.interfaceColors,d=this._root.horizontalLayout,c=this._root.verticalLayout,u=this.rule.bind(this);u(\"InterfaceColors\").setAll({stroke:t.fromHex(15066597),fill:t.fromHex(15987699),primaryButton:t.fromHex(6788316),primaryButtonHover:t.fromHex(6779356),primaryButtonDown:t.fromHex(6872182),primaryButtonActive:t.fromHex(6872182),primaryButtonText:t.fromHex(16777215),primaryButtonStroke:t.fromHex(16777215),secondaryButton:t.fromHex(14277081),secondaryButtonHover:t.fromHex(10724259),secondaryButtonDown:t.fromHex(9276813),secondaryButtonActive:t.fromHex(15132390),secondaryButtonText:t.fromHex(0),secondaryButtonStroke:t.fromHex(16777215),grid:t.fromHex(0),background:t.fromHex(16777215),alternativeBackground:t.fromHex(0),text:t.fromHex(0),alternativeText:t.fromHex(16777215),disabled:t.fromHex(11382189),positive:t.fromHex(5288704),negative:t.fromHex(11730944)});{const e=u(\"ColorSet\");e.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[t.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),e.setPrivate(\"currentStep\",0),e.setPrivate(\"currentPass\",0)}u(\"Entity\").setAll({stateAnimationDuration:0,stateAnimationEasing:o(r)}),u(\"Component\").setAll({interpolationDuration:0,interpolationEasing:o(r)}),u(\"Sprite\").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:\"relative\",tooltipX:a,tooltipY:a,tooltipPosition:\"fixed\",isMeasured:!0}),u(\"Sprite\").states.create(\"default\",{visible:!0,opacity:1}),u(\"Container\").setAll({interactiveChildren:!0,setStateOnChildren:!1}),u(\"Graphics\").setAll({strokeWidth:1}),u(\"Chart\").setAll({width:i,height:i,interactiveChildren:!1}),u(\"Sprite\",[\"horizontal\",\"center\"]).setAll({centerX:a,x:a}),u(\"Sprite\",[\"vertical\",\"center\"]).setAll({centerY:a,y:a}),u(\"Container\",[\"horizontal\",\"layout\"]).setAll({layout:d}),u(\"Container\",[\"vertical\",\"layout\"]).setAll({layout:c}),u(\"Pattern\").setAll({repetition:\"repeat\",width:50,height:50,rotation:0,fillOpacity:1}),u(\"LinePattern\").setAll({gap:6,colorOpacity:1,width:49,height:49}),u(\"RectanglePattern\").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),u(\"CirclePattern\").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),u(\"LinearGradient\").setAll({rotation:90}),u(\"Legend\").setAll({fillField:\"fill\",strokeField:\"stroke\",nameField:\"name\",layout:n.new(this._root,{}),layer:30,clickTarget:\"itemContainer\"}),u(\"Container\",[\"legend\",\"item\",\"itemcontainer\"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:e.translate(\"Press ENTER to toggle\"),role:\"checkbox\"});{const e=u(\"Rectangle\",[\"legend\",\"item\",\"background\"]);e.setAll({fillOpacity:0}),l(e,\"fill\",s,\"background\")}u(\"Container\",[\"legend\",\"marker\"]).setAll({setStateOnChildren:!0,centerY:a,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),u(\"RoundedRectangle\",[\"legend\",\"marker\",\"rectangle\"]).setAll({width:i,height:i,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const e=u(\"RoundedRectangle\",[\"legend\",\"marker\",\"rectangle\"]).states.create(\"disabled\",{});l(e,\"fill\",s,\"disabled\"),l(e,\"stroke\",s,\"disabled\")}u(\"Label\",[\"legend\",\"label\"]).setAll({centerY:a,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0});l(u(\"Label\",[\"legend\",\"label\"]).states.create(\"disabled\",{}),\"fill\",s,\"disabled\");u(\"Label\",[\"legend\",\"value\",\"label\"]).setAll({centerY:a,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:i,populateText:!0});l(u(\"Label\",[\"legend\",\"value\",\"label\"]).states.create(\"disabled\",{}),\"fill\",s,\"disabled\");u(\"HeatLegend\").setAll({stepCount:1}),u(\"RoundedRectangle\",[\"heatlegend\",\"marker\"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),u(\"RoundedRectangle\",[\"vertical\",\"heatlegend\",\"marker\"]).setAll({height:i,width:15}),u(\"RoundedRectangle\",[\"horizontal\",\"heatlegend\",\"marker\"]).setAll({width:i,height:15}),u(\"HeatLegend\",[\"vertical\"]).setAll({height:i}),u(\"HeatLegend\",[\"horizontal\"]).setAll({width:i}),u(\"Label\",[\"heatlegend\",\"start\"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),u(\"Label\",[\"heatlegend\",\"end\"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const e=u(\"Label\");e.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',fontSize:\"1em\",populateText:!1}),l(e,\"fill\",s,\"text\")}u(\"RadialLabel\").setAll({textType:\"regular\",centerY:a,centerX:a,inside:!1,radius:0,baseRadius:i,orientation:\"auto\",textAlign:\"center\"}),u(\"RoundedRectangle\").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),u(\"PointedRectangle\").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),u(\"Slice\").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const e=u(\"Tick\");e.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:\"absolute\",crisp:!0}),l(e,\"stroke\",s,\"grid\")}u(\"Bullet\").setAll({locationX:.5,locationY:.5}),u(\"Tooltip\").setAll({position:\"absolute\",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:\"vertical\",centerX:a,centerY:a,animationEasing:o(r),exportable:!1}),u(\"Polygon\").setAll({animationEasing:o(r)});u(\"PointedRectangle\",[\"tooltip\",\"background\"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:t.fromHex(16777215)});{const e=u(\"Label\",[\"tooltip\"]);e.setAll({role:\"tooltip\",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),l(e,\"fill\",s,\"alternativeText\")}u(\"Button\").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),u(\"Button\").states.create(\"hover\",{}),u(\"Button\").states.create(\"down\",{stateAnimationDuration:0}),u(\"Button\").states.create(\"active\",{});{const e=u(\"RoundedRectangle\",[\"button\",\"background\"]);l(e,\"fill\",s,\"primaryButton\"),l(e,\"stroke\",s,\"primaryButtonStroke\")}l(u(\"RoundedRectangle\",[\"button\",\"background\"]).states.create(\"hover\",{}),\"fill\",s,\"primaryButtonHover\");l(u(\"RoundedRectangle\",[\"button\",\"background\"]).states.create(\"down\",{stateAnimationDuration:0}),\"fill\",s,\"primaryButtonDown\");l(u(\"RoundedRectangle\",[\"button\",\"background\"]).states.create(\"active\",{}),\"fill\",s,\"primaryButtonActive\");l(u(\"Graphics\",[\"button\",\"icon\"]),\"stroke\",s,\"primaryButtonText\");l(u(\"Label\",[\"button\"]),\"fill\",s,\"primaryButtonText\");u(\"Button\",[\"zoom\"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:i,role:\"button\",ariaLabel:e.translate(\"Zoom Out\"),layer:30});{const e=u(\"RoundedRectangle\",[\"background\",\"button\",\"zoom\"]);e.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),l(e,\"fill\",s,\"primaryButton\")}l(u(\"RoundedRectangle\",[\"background\",\"button\",\"zoom\"]).states.create(\"hover\",{}),\"fill\",s,\"primaryButtonHover\");l(u(\"RoundedRectangle\",[\"background\",\"button\",\"zoom\"]).states.create(\"down\",{stateAnimationDuration:0}),\"fill\",s,\"primaryButtonDown\");{const e=u(\"Graphics\",[\"icon\",\"button\",\"zoom\"]);e.setAll({crisp:!0,strokeOpacity:.7,draw:e=>{e.moveTo(0,0),e.lineTo(12,0)}}),l(e,\"stroke\",s,\"primaryButtonText\")}u(\"Button\",[\"resize\"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:a,centerY:a,position:\"absolute\",role:\"slider\",ariaValueMin:\"0\",ariaValueMax:\"100\",ariaLabel:e.translate(\"Use up and down arrows to move selection\")});{const e=u(\"RoundedRectangle\",[\"background\",\"resize\",\"button\"]);e.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),l(e,\"fill\",s,\"secondaryButton\"),l(e,\"stroke\",s,\"secondaryButtonStroke\")}l(u(\"RoundedRectangle\",[\"background\",\"resize\",\"button\"]).states.create(\"hover\",{}),\"fill\",s,\"secondaryButtonHover\");l(u(\"RoundedRectangle\",[\"background\",\"resize\",\"button\"]).states.create(\"down\",{stateAnimationDuration:0}),\"fill\",s,\"secondaryButtonDown\");{const e=u(\"Graphics\",[\"resize\",\"button\",\"icon\"]);e.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:e=>{e.moveTo(0,.5),e.lineTo(0,12.5),e.moveTo(4,.5),e.lineTo(4,12.5)}}),l(e,\"stroke\",s,\"secondaryButtonText\")}u(\"Button\",[\"resize\",\"vertical\"]).setAll({rotation:90,cursorOverStyle:\"ns-resize\"}),u(\"Button\",[\"resize\",\"horizontal\"]).setAll({cursorOverStyle:\"ew-resize\"}),u(\"Button\",[\"play\"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:e.translate(\"Play\"),toggleKey:\"active\"});{const e=u(\"RoundedRectangle\",[\"play\",\"background\"]);e.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),l(e,\"fill\",s,\"primaryButton\")}{const e=u(\"Graphics\",[\"play\",\"icon\"]);e.setAll({stateAnimationDuration:0,dx:1,draw:e=>{e.moveTo(0,-5),e.lineTo(8,0),e.lineTo(0,5),e.lineTo(0,-5)}}),l(e,\"fill\",s,\"primaryButtonText\")}u(\"Graphics\",[\"play\",\"icon\"]).states.create(\"default\",{stateAnimationDuration:0}),u(\"Graphics\",[\"play\",\"icon\"]).states.create(\"active\",{stateAnimationDuration:0,draw:e=>{e.moveTo(-4,-5),e.lineTo(-1,-5),e.lineTo(-1,5),e.lineTo(-4,5),e.lineTo(-4,-5),e.moveTo(4,-5),e.lineTo(1,-5),e.lineTo(1,5),e.lineTo(4,5),e.lineTo(4,-5)}}),u(\"Button\",[\"switch\"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:e.translate(\"Press ENTER to toggle\"),toggleKey:\"active\",width:40,height:24,layout:null});{const e=u(\"RoundedRectangle\",[\"switch\",\"background\"]);e.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),l(e,\"fill\",s,\"primaryButton\")}{const e=u(\"Circle\",[\"switch\",\"icon\"]);e.setAll({radius:8,centerY:0,centerX:0,dx:0}),l(e,\"fill\",s,\"primaryButtonText\")}u(\"Graphics\",[\"switch\",\"icon\"]).states.create(\"active\",{dx:16}),u(\"Scrollbar\").setAll({start:0,end:1,layer:30,animationEasing:o(r)}),u(\"Scrollbar\",[\"vertical\"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:i}),u(\"Scrollbar\",[\"horizontal\"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:i}),this.rule(\"Button\",[\"scrollbar\"]).setAll({exportable:!1});{const e=u(\"RoundedRectangle\",[\"scrollbar\",\"main\",\"background\"]);e.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),l(e,\"fill\",s,\"fill\")}{const e=u(\"RoundedRectangle\",[\"scrollbar\",\"thumb\"]);e.setAll({role:\"slider\",ariaLive:\"polite\",position:\"absolute\",draggable:!0}),l(e,\"fill\",s,\"secondaryButton\")}l(u(\"RoundedRectangle\",[\"scrollbar\",\"thumb\"]).states.create(\"hover\",{}),\"fill\",s,\"secondaryButtonHover\");l(u(\"RoundedRectangle\",[\"scrollbar\",\"thumb\"]).states.create(\"down\",{stateAnimationDuration:0}),\"fill\",s,\"secondaryButtonDown\");u(\"RoundedRectangle\",[\"scrollbar\",\"thumb\",\"vertical\"]).setAll({x:a,width:i,centerX:a,ariaLabel:e.translate(\"Use up and down arrows to move selection\")}),u(\"RoundedRectangle\",[\"scrollbar\",\"thumb\",\"horizontal\"]).setAll({y:a,centerY:a,height:i,ariaLabel:e.translate(\"Use left and right arrows to move selection\")});{const e=u(\"PointedRectangle\",[\"axis\",\"tooltip\",\"background\"]);e.setAll({cornerRadius:0}),l(e,\"fill\",s,\"alternativeBackground\")}u(\"Label\",[\"axis\",\"tooltip\"]).setAll({role:void 0}),u(\"Label\",[\"axis\",\"tooltip\",\"y\"]).setAll({textAlign:\"right\"}),u(\"Label\",[\"axis\",\"tooltip\",\"y\",\"opposite\"]).setAll({textAlign:\"left\"}),u(\"Label\",[\"axis\",\"tooltip\",\"x\"]).setAll({textAlign:\"center\"}),u(\"Tooltip\",[\"categoryaxis\"]).setAll({labelText:\"{category}\"}),u(\"Star\").setAll({spikes:5,innerRadius:5,radius:10}),u(\"Tooltip\",[\"stock\"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),u(\"PointedRectangle\",[\"tooltip\",\"stock\",\"axis\"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),u(\"Label\",[\"tooltip\",\"stock\"]).setAll({fontSize:\"0.8em\"}),u(\"SpriteResizer\").setAll({rotationStep:10});u(\"Container\",[\"resizer\",\"grip\"]).states.create(\"hover\",{});{const e=u(\"RoundedRectangle\",[\"resizer\",\"grip\"]);e.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),l(e,\"fill\",s,\"background\"),l(e,\"stroke\",s,\"alternativeBackground\")}{const e=u(\"RoundedRectangle\",[\"resizer\",\"grip\",\"outline\"]);e.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),e.states.create(\"hover\",{fillOpacity:.3}),l(e,\"fill\",s,\"alternativeBackground\")}u(\"RoundedRectangle\",[\"resizer\",\"grip\",\"left\"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),u(\"RoundedRectangle\",[\"resizer\",\"grip\",\"right\"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const e=u(\"Rectangle\",[\"resizer\",\"rectangle\"]);e.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),l(e,\"stroke\",s,\"alternativeBackground\")}}}export{s as D,l as s};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport\"../intl.js\";import{o as e,e as t,k as i,E as s,i as r,a,c as n,b as o,P as l,d as h,f as u,T as c,n as d,g as b,h as f,p,j as g,l as m,m as _,q as y,r as v,s as w,t as x,u as P,v as O,w as k,x as M,A as j,D as S,y as E,z as T,B as C,C as B,F as D,G as A,M as L,H as z,I as F,J as H,K as Y,L as I,N as R,O as U,Q as W,R as V,S as N,U as X,V as G,W as q,X as K,Y as Z,Z as J,_ as $,$ as Q,a0 as ee,a1 as te,a2 as ie,a3 as se,a4 as re,a5 as ae,a6 as ne,a7 as oe,a8 as le,a9 as he,aa as ue,ab as ce,ac as de,ad as be,ae as fe,af as pe,ag as ge,ah as me,ai as _e}from\"./Theme.js\";import{T as ye}from\"./Tooltip.js\";import{D as ve}from\"./DefaultTheme.js\";import{getLocale as we}from\"../intl/locale.js\";class xe{constructor(){Object.defineProperty(this,\"_observer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_targets\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver((e=>{t(e,(e=>{t(this._targets,(t=>{t.target===e.target&&t.callback()}))}))}))}addTarget(e,t){this._observer.observe(e,{box:\"border-box\"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),i(this._targets,(t=>t.target!==e))}}class Pe{constructor(){Object.defineProperty(this,\"_timer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"_targets\",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,i){if(null===this._timer){let e=null;const i=()=>{const s=Date.now();(null===e||s>e+Pe.delay)&&(e=s,t(this._targets,(e=>{let t=e.target.getBoundingClientRect();t.width===e.size.width&&t.height===e.size.height||(e.size=t,e.callback())}))),0===this._targets.length?this._timer=null:this._timer=requestAnimationFrame(i)};this._timer=requestAnimationFrame(i)}let s={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:i,size:s})}removeTarget(e){i(this._targets,(t=>t.target!==e)),0===this._targets.length&&null!==this._timer&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(Pe,\"delay\",{enumerable:!0,configurable:!0,writable:!0,value:200});let Oe=null;function ke(){return null===Oe&&(Oe=\"undefined\"!=typeof ResizeObserver?new xe:new Pe),Oe}class Me{constructor(t,i){Object.defineProperty(this,\"_sensor\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_element\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_listener\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_disposed\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=ke(),this._element=t,this._listener=e(i),this._sensor.addTarget(t,i)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class je extends s{}Object.defineProperty(je,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"InterfaceColors\"}),Object.defineProperty(je,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:s.classNames.concat([je.className])});class Se extends s{_setDefaults(){this._setDefault(\"negativeBase\",0),this._setDefault(\"numberFormat\",\"#,###.#####\"),this._setDefault(\"smallNumberThreshold\",1);const e=\"_big_number_suffix_\",t=\"_small_number_suffix_\",i=\"_byte_suffix_\";this._setDefault(\"bigNumberPrefixes\",[{number:1e3,suffix:this._t(e+\"3\")},{number:1e6,suffix:this._t(e+\"6\")},{number:1e9,suffix:this._t(e+\"9\")},{number:1e12,suffix:this._t(e+\"12\")},{number:1e15,suffix:this._t(e+\"15\")},{number:1e18,suffix:this._t(e+\"18\")},{number:1e21,suffix:this._t(e+\"21\")},{number:1e24,suffix:this._t(e+\"24\")}]),this._setDefault(\"smallNumberPrefixes\",[{number:1e-24,suffix:this._t(t+\"24\")},{number:1e-21,suffix:this._t(t+\"21\")},{number:1e-18,suffix:this._t(t+\"18\")},{number:1e-15,suffix:this._t(t+\"15\")},{number:1e-12,suffix:this._t(t+\"12\")},{number:1e-9,suffix:this._t(t+\"9\")},{number:1e-6,suffix:this._t(t+\"6\")},{number:.001,suffix:this._t(t+\"3\")}]),this._setDefault(\"bytePrefixes\",[{number:1,suffix:this._t(i+\"B\")},{number:1024,suffix:this._t(i+\"KB\")},{number:1048576,suffix:this._t(i+\"MB\")},{number:1073741824,suffix:this._t(i+\"GB\")},{number:1099511627776,suffix:this._t(i+\"TB\")},{number:0x4000000000000,suffix:this._t(i+\"PB\")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let s;(null==t||r(t)&&\"number\"===t.toLowerCase())&&(t=this.get(\"numberFormat\",\"\"));let h=Number(e);if(a(t))try{return this.get(\"intlLocales\")?new Intl.NumberFormat(this.get(\"intlLocales\"),t).format(h):new Intl.NumberFormat(void 0,t).format(h)}catch(u){return\"Invalid\"}else{t=n(t);let e,r=this.parseFormat(t,this._root.language);e=h>this.get(\"negativeBase\")?r.positive:h{if(t.parsed)return;let i=t.source;\"number\"===i.toLowerCase()&&(i=this.get(\"numberFormat\",\"#,###.#####\"));let s=c.chunk(i,!0);for(let r=0;r=0?e.toExponential(t.decimals.passive).split(\"e\"):e.toExponential().split(\"e\"),e=Number(i[0]),r=\"e\"+i[1],t.modSpacing&&(r=\" \"+r)}else if(0===t.decimals.passive)e=Math.round(e);else if(t.decimals.passive>0){let i=Math.pow(10,t.decimals.passive);e=Math.round(e*i)/i}let n=\"\",o=d(e).split(\".\"),l=o[0];if(l.length0){let e=[],i=l.split(\"\").reverse().join(\"\");for(let s=0,r=l.length;s<=r;s+=t.thousands.interval){let r=i.substr(s,t.thousands.interval).split(\"\").reverse().join(\"\");\"\"!==r&&e.unshift(r)}l=e.join(t.thousands.separator)}n+=l,1===o.length&&o.push(\"\");let h=o[1];return h.length{switch(e.type){case\"year\":i=+e.value;break;case\"month\":s=+e.value-1;break;case\"day\":r=+e.value;break;case\"hour\":a=+e.value;break;case\"minute\":n=+e.value;break;case\"second\":o=+e.value;break;case\"fractionalSecond\":l=+e.value;break;case\"weekday\":switch(e.value){case\"Sun\":h=0;break;case\"Mon\":h=1;break;case\"Tue\":h=2;break;case\"Wed\":h=3;break;case\"Thu\":h=4;break;case\"Fri\":h=5;break;case\"Sat\":h=6}}})),24===a&&(a=0),{year:i,month:s,day:r,hour:a,minute:n,second:o,millisecond:l,weekday:h}}function Te(e,t){const{year:i,month:s,day:r,hour:a,minute:n,second:o,millisecond:l}=Ee(e,t);return Date.UTC(i,s,r,a,n,o,l)}class Ce{constructor(e,t){if(Object.defineProperty(this,\"_utc\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_dtf\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"name\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error(\"You cannot use `new Class()`, instead use `Class.new()`\");this.name=e,this._utc=new Intl.DateTimeFormat(\"UTC\",{hour12:!1,timeZone:\"UTC\",year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",weekday:\"short\",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat(\"UTC\",{hour12:!1,timeZone:e,year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",weekday:\"short\",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),s=new Date(e);s.setUTCMinutes(s.getUTCMinutes()-(t-i));const r=s.getTimezoneOffset();return i!=r&&s.setUTCMinutes(s.getUTCMinutes()+r-i),s}offsetUTC(e){return(Te(this._utc,e)-Te(this._dtf,e))/6e4}parseDate(e){return Ee(this._dtf,e)}}class Be extends s{_setDefaults(){this._setDefault(\"capitalize\",!0),this._setDefault(\"dateFormat\",\"yyyy-MM-dd\"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){let i;void 0!==t&&\"\"!==t||(t=this.get(\"dateFormat\",\"yyyy-MM-dd\"));let s=e;if(a(t))try{const e=this.get(\"intlLocales\");return e?new Intl.DateTimeFormat(e,t).format(s):new Intl.DateTimeFormat(void 0,t).format(s)}catch(o){return\"Invalid\"}let r=this.parseFormat(t);const n=this._root.timezone;return n&&!this._root.utc&&(s=n.convertLocal(s)),b(s.getTime())?(i=this.applyFormat(s,r),this.get(\"capitalize\")&&(i=i.replace(/^.{1}/,i.substr(0,1).toUpperCase())),i):\"Invalid date\"}applyFormat(e,t){let i,s,r,a,n,o,h,u,c=t.template,d=e.getTime();this._root.utc?(i=e.getUTCFullYear(),s=e.getUTCMonth(),r=e.getUTCDay(),a=e.getUTCDate(),n=e.getUTCHours(),o=e.getUTCMinutes(),h=e.getUTCSeconds(),u=e.getUTCMilliseconds()):(i=e.getFullYear(),s=e.getMonth(),r=e.getDay(),a=e.getDate(),n=e.getHours(),o=e.getMinutes(),h=e.getSeconds(),u=e.getMilliseconds());for(let b=0,x=t.parts.length;b=12?this._t(\"PM\"):this._t(\"AM\");break;case\"aa\":x=n>=12?this._t(\"P.M.\"):this._t(\"A.M.\");break;case\"aaa\":x=n>=12?this._t(\"P\"):this._t(\"A\");break;case\"h\":x=m(n).toString();break;case\"hh\":x=p(m(n),2,\"0\");break;case\"H\":x=n.toString();break;case\"HH\":x=p(n,2,\"0\");break;case\"K\":x=m(n,0).toString();break;case\"KK\":x=p(m(n,0),2,\"0\");break;case\"k\":x=(n+1).toString();break;case\"kk\":x=p(n+1,2,\"0\");break;case\"m\":x=o.toString();break;case\"mm\":x=p(o,2,\"0\");break;case\"s\":x=h.toString();break;case\"ss\":x=p(h,2,\"0\");break;case\"S\":case\"SS\":case\"SSS\":x=Math.round(u/1e3*Math.pow(10,t.parts[b].length)).toString();break;case\"x\":x=d.toString();break;case\"n\":case\"nn\":case\"nnn\":x=p(u,t.parts[b].length,\"0\");break;case\"z\":x=g(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case\"zz\":x=g(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case\"zzz\":x=g(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case\"zzzz\":x=g(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case\"Z\":case\"ZZ\":let c=this._root.utc?\"UTC\":this._root.timezone;c instanceof Ce&&(c=c.name);const P=c?f(c):e.getTimezoneOffset();let O=Math.abs(P)/60,k=Math.floor(O),M=60*O-60*k;this._root.utc&&(k=0,M=0),\"Z\"==t.parts[b]?(x=\"GMT\",x+=P>0?\"-\":\"+\",x+=p(k,2)+\":\"+p(M,2)):(x=P>0?\"-\":\"+\",x+=p(k,2)+p(M,2));break;case\"i\":x=e.toISOString();break;case\"I\":x=e.toUTCString()}c=c.replace(l,x)}return c}parseFormat(e){let t={template:\"\",parts:[]},i=c.chunk(e,!0);for(let s=0;s-1&&(l.year=parseInt(d[o.year])),o.year3>-1){let e=parseInt(d[o.year3]);e+=1e3,l.year=e}if(o.year2>-1){let e=parseInt(d[o.year2]);e+=e>50?1e3:2e3,l.year=e}if(o.year1>-1){let e=parseInt(d[o.year1]);e=10*Math.floor((new Date).getFullYear()/10)+e,l.year=e}if(o.monthLong>-1&&(l.month=this.resolveMonth(d[o.monthLong])),o.monthShort>-1&&(l.month=this.resolveShortMonth(d[o.monthShort])),o.month>-1&&(l.month=parseInt(d[o.month])-1),o.week>-1&&-1===o.day&&(l.month=0,l.day=x(parseInt(d[o.week]),l.year,1,this._root.utc)),o.day>-1&&(l.day=parseInt(d[o.day])),o.yearDay>-1&&(l.month=0,l.day=parseInt(d[o.yearDay])),o.hourBase0>-1&&(l.hour=parseInt(d[o.hourBase0])),o.hourBase1>-1&&(l.hour=parseInt(d[o.hourBase1])-1),o.hour12Base0>-1){let e=parseInt(d[o.hour12Base0]);11==e&&(e=0),o.am>-1&&!this.isAm(d[o.am])&&(e+=12),l.hour=e}if(o.hour12Base1>-1){let e=parseInt(d[o.hour12Base1]);12==e&&(e=0),o.am>-1&&!this.isAm(d[o.am])&&(e+=12),l.hour=e}if(o.minute>-1&&(l.minute=parseInt(d[o.minute])),o.second>-1&&(l.second=parseInt(d[o.second])),o.millisecond>-1){let e=parseInt(d[o.millisecond]);2==o.millisecondDigits?e*=10:1==o.millisecondDigits&&(e*=100),l.millisecond=e}if(o.timestamp>-1){l.timestamp=parseInt(d[o.timestamp]);const e=new Date(l.timestamp);l.year=e.getUTCFullYear(),l.month=e.getUTCMonth(),l.day=e.getUTCDate(),l.hour=e.getUTCHours(),l.minute=e.getUTCMinutes(),l.second=e.getUTCSeconds(),l.millisecond=e.getUTCMilliseconds()}o.zone>-1&&(l.offset=this.resolveTimezoneOffset(new Date(l.year,l.month,l.day),d[o.zone])),o.iso>-1&&(l.year=P(d[o.iso+0]),l.month=P(d[o.iso+1])-1,l.day=P(d[o.iso+2]),l.hour=P(d[o.iso+3]),l.minute=P(d[o.iso+4]),l.second=P(d[o.iso+5]),l.millisecond=P(d[o.iso+6]),\"Z\"==d[o.iso+7]||\"z\"==d[o.iso+7]?l.utc=!0:\"\"!=d[o.iso+7]&&(l.offset=this.resolveTimezoneOffset(new Date(l.year,l.month,l.day),d[o.iso+7]))),i=l.utc?new Date(Date.UTC(l.year,l.month,l.day,l.hour,l.minute,l.second,l.millisecond)):new Date(l.year,l.month,l.day,l.hour,l.minute+l.offset,l.second,l.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/),s=i[1],r=i[2],a=i[3],n=60*parseInt(r)+parseInt(a);return\"+\"==s&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList([\"AM\",\"A.M.\",\"A\"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get(\"negativeBase\")?a.positive:o{if(t.parsed)return;let i=t.source,s=[];s=t.source.match(/^\\[([^\\]]*)\\]/),s&&s.length&&\"\"!==s[0]&&(i=t.source.substr(s[0].length),t.color=s[1]);let r=c.chunk(i,!0);for(let a=0;a{if(e==t||i){if(s/r<=1)return i||(i=e),!1;i=e}return!0})),i}getMilliseconds(e,t){return t||(t=this.get(\"baseUnit\")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const Ae={firstDayOfWeek:1,_decimalSeparator:\".\",_thousandSeparator:\",\",_percentPrefix:null,_percentSuffix:\"%\",_big_number_suffix_3:\"k\",_big_number_suffix_6:\"M\",_big_number_suffix_9:\"G\",_big_number_suffix_12:\"T\",_big_number_suffix_15:\"P\",_big_number_suffix_18:\"E\",_big_number_suffix_21:\"Z\",_big_number_suffix_24:\"Y\",_small_number_suffix_3:\"m\",_small_number_suffix_6:\"μ\",_small_number_suffix_9:\"n\",_small_number_suffix_12:\"p\",_small_number_suffix_15:\"f\",_small_number_suffix_18:\"a\",_small_number_suffix_21:\"z\",_small_number_suffix_24:\"y\",_byte_suffix_B:\"B\",_byte_suffix_KB:\"KB\",_byte_suffix_MB:\"MB\",_byte_suffix_GB:\"GB\",_byte_suffix_TB:\"TB\",_byte_suffix_PB:\"PB\",_date:\"yyyy-MM-dd\",_date_millisecond:\"mm:ss SSS\",_date_millisecond_full:\"HH:mm:ss SSS\",_date_second:\"HH:mm:ss\",_date_second_full:\"HH:mm:ss\",_date_minute:\"HH:mm\",_date_minute_full:\"HH:mm - MMM dd, yyyy\",_date_hour:\"HH:mm\",_date_hour_full:\"HH:mm - MMM dd, yyyy\",_date_day:\"MMM dd\",_date_day_full:\"MMM dd, yyyy\",_date_week:\"ww\",_date_week_full:\"MMM dd, yyyy\",_date_month:\"MMM\",_date_month_full:\"MMM, yyyy\",_date_year:\"yyyy\",_duration_millisecond:\"SSS\",_duration_millisecond_second:\"ss.SSS\",_duration_millisecond_minute:\"mm:ss SSS\",_duration_millisecond_hour:\"hh:mm:ss SSS\",_duration_millisecond_day:\"d'd' mm:ss SSS\",_duration_millisecond_week:\"d'd' mm:ss SSS\",_duration_millisecond_month:\"M'm' dd'd' mm:ss SSS\",_duration_millisecond_year:\"y'y' MM'm' dd'd' mm:ss SSS\",_duration_second:\"ss\",_duration_second_minute:\"mm:ss\",_duration_second_hour:\"hh:mm:ss\",_duration_second_day:\"d'd' hh:mm:ss\",_duration_second_week:\"d'd' hh:mm:ss\",_duration_second_month:\"M'm' dd'd' hh:mm:ss\",_duration_second_year:\"y'y' MM'm' dd'd' hh:mm:ss\",_duration_minute:\"mm\",_duration_minute_hour:\"hh:mm\",_duration_minute_day:\"d'd' hh:mm\",_duration_minute_week:\"d'd' hh:mm\",_duration_minute_month:\"M'm' dd'd' hh:mm\",_duration_minute_year:\"y'y' MM'm' dd'd' hh:mm\",_duration_hour:\"hh'h'\",_duration_hour_day:\"d'd' hh'h'\",_duration_hour_week:\"d'd' hh'h'\",_duration_hour_month:\"M'm' dd'd' hh'h'\",_duration_hour_year:\"y'y' MM'm' dd'd' hh'h'\",_duration_day:\"d'd'\",_duration_day_week:\"d'd'\",_duration_day_month:\"M'm' dd'd'\",_duration_day_year:\"y'y' MM'm' dd'd'\",_duration_week:\"w'w'\",_duration_week_month:\"w'w'\",_duration_week_year:\"w'w'\",_duration_month:\"M'm'\",_duration_month_year:\"y'y' MM'm'\",_duration_year:\"y'y'\",_era_ad:\"AD\",_era_bc:\"BC\",A:\"\",P:\"\",AM:\"\",PM:\"\",\"A.M.\":\"\",\"P.M.\":\"\",January:\"\",February:\"\",March:\"\",April:\"\",May:\"\",June:\"\",July:\"\",August:\"\",September:\"\",October:\"\",November:\"\",December:\"\",Jan:\"\",Feb:\"\",Mar:\"\",Apr:\"\",\"May(short)\":\"May\",Jun:\"\",Jul:\"\",Aug:\"\",Sep:\"\",Oct:\"\",Nov:\"\",Dec:\"\",Sunday:\"\",Monday:\"\",Tuesday:\"\",Wednesday:\"\",Thursday:\"\",Friday:\"\",Saturday:\"\",Sun:\"\",Mon:\"\",Tue:\"\",Wed:\"\",Thu:\"\",Fri:\"\",Sat:\"\",_dateOrd:function(e){let t=\"th\";if(e<11||e>13)switch(e%10){case 1:t=\"st\";break;case 2:t=\"nd\";break;case 3:t=\"rd\"}return t},\"Zoom Out\":\"\",Play:\"\",Stop:\"\",Legend:\"\",\"Press ENTER to toggle\":\"\",Loading:\"\",Home:\"\",Chart:\"\",\"Serial chart\":\"\",\"X/Y chart\":\"\",\"Pie chart\":\"\",\"Gauge chart\":\"\",\"Radar chart\":\"\",\"Sankey diagram\":\"\",\"Flow diagram\":\"\",\"Chord diagram\":\"\",\"TreeMap chart\":\"\",\"Force directed tree\":\"\",\"Sliced chart\":\"\",Series:\"\",\"Candlestick Series\":\"\",\"OHLC Series\":\"\",\"Column Series\":\"\",\"Line Series\":\"\",\"Pie Slice Series\":\"\",\"Funnel Series\":\"\",\"Pyramid Series\":\"\",\"X/Y Series\":\"\",Map:\"\",\"Press ENTER to zoom in\":\"\",\"Press ENTER to zoom out\":\"\",\"Use arrow keys to zoom in and out\":\"\",\"Use plus and minus keys on your keyboard to zoom in and out\":\"\",Export:\"\",Image:\"\",Data:\"\",Print:\"\",\"Press ENTER or use arrow keys to navigate\":\"\",\"Press ENTER to open\":\"\",\"Press ENTER to print.\":\"\",\"Press ENTER to export as %1.\":\"\",\"(Press ESC to close this message)\":\"\",\"Image Export Complete\":\"\",\"Export operation took longer than expected. Something might have gone wrong.\":\"\",\"Saved from\":\"\",PNG:\"\",JPG:\"\",GIF:\"\",SVG:\"\",PDF:\"\",JSON:\"\",CSV:\"\",XLSX:\"\",HTML:\"\",\"Use TAB to select grip buttons or left and right arrows to change selection\":\"\",\"Use left and right arrows to move selection\":\"\",\"Use left and right arrows to move left selection\":\"\",\"Use left and right arrows to move right selection\":\"\",\"Use TAB select grip buttons or up and down arrows to change selection\":\"\",\"Use up and down arrows to move selection\":\"\",\"Use up and down arrows to move lower selection\":\"\",\"Use up and down arrows to move upper selection\":\"\",\"From %1 to %2\":\"\",\"From %1\":\"\",\"To %1\":\"\",\"No parser available for file: %1\":\"\",\"Error parsing file: %1\":\"\",\"Unable to load file: %1\":\"\",\"Invalid date\":\"\",Close:\"\",Minimize:\"\"};class Le extends s{_setDefaults(){this.setPrivate(\"defaultLocale\",Ae),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate(\"defaultLocale\"));let s=e,r=t[e];if(null===r)s=\"\";else if(null!=r)r&&(s=r);else if(t!==this.getPrivate(\"defaultLocale\"))return this.translate(e,this.getPrivate(\"defaultLocale\"),...i);if(i.length)for(let a=i.length,n=0;n{this.setTranslationAny(e,i,t)}))}translateEmpty(e,t,...i){let s=this.translate(e,t,...i);return s==e?\"\":s}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate(\"defaultLocale\")?this.translateFunc(e,this.getPrivate(\"defaultLocale\")):()=>\"\"}translateAll(e,t){return this.isDefault()?e:M(e,(e=>this.translate(e,t)))}isDefault(){return this.getPrivate(\"defaultLocale\")===this._root.locale}}class ze{constructor(e=1,t=0,i=0,s=1,r=0,a=0){Object.defineProperty(this,\"a\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"b\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"c\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"d\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"tx\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"ty\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=s,this.tx=r,this.ty=a}setTransform(e,t,i,s,r,a=1){this.a=Math.cos(r)*a,this.b=Math.sin(r)*a,this.c=-Math.sin(r)*a,this.d=Math.cos(r)*a,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,s=this.c,r=this.d;this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*r,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*r,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*r+this.ty}prepend(e){const t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){const t=this.a,i=this.c;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Fe=function(){function e(e,t){var i=[],s=!0,r=!1,a=void 0;try{for(var n,o=e[Symbol.iterator]();!(s=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(l){r=!0,a=l}finally{try{!s&&o.return&&o.return()}finally{if(r)throw a}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}}(),He=2*Math.PI,Ye=function(e,t,i,s,r,a,n){var o=e.x,l=e.y;return{x:s*(o*=t)-r*(l*=i)+a,y:r*o+s*l+n}},Ie=function(e,t){var i=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),s=Math.cos(e),r=Math.sin(e),a=Math.cos(e+t),n=Math.sin(e+t);return[{x:s-r*i,y:r+s*i},{x:a+n*i,y:n-a*i},{x:a,y:n}]},Re=function(e,t,i,s){var r=e*i+t*s;return r>1&&(r=1),r<-1&&(r=-1),(e*s-t*i<0?-1:1)*Math.acos(r)},Ue=function(e,t,i,s,r,a,n,o,l,h,u,c){var d=Math.pow(r,2),b=Math.pow(a,2),f=Math.pow(u,2),p=Math.pow(c,2),g=d*b-d*p-b*f;g<0&&(g=0),g/=d*p+b*f;var m=(g=Math.sqrt(g)*(n===o?-1:1))*r/a*c,_=g*-a/r*u,y=h*m-l*_+(e+i)/2,v=l*m+h*_+(t+s)/2,w=(u-m)/r,x=(c-_)/a,P=(-u-m)/r,O=(-c-_)/a,k=Re(1,0,w,x),M=Re(w,x,P,O);return 0===o&&M>0&&(M-=He),1===o&&M<0&&(M+=He),[y,v,k,M]},We=function(e){var t=e.px,i=e.py,s=e.cx,r=e.cy,a=e.rx,n=e.ry,o=e.xAxisRotation,l=void 0===o?0:o,h=e.largeArcFlag,u=void 0===h?0:h,c=e.sweepFlag,d=void 0===c?0:c,b=[];if(0===a||0===n)return[];var f=Math.sin(l*He/360),p=Math.cos(l*He/360),g=p*(t-s)/2+f*(i-r)/2,m=-f*(t-s)/2+p*(i-r)/2;if(0===g&&0===m)return[];a=Math.abs(a),n=Math.abs(n);var _=Math.pow(g,2)/Math.pow(a,2)+Math.pow(m,2)/Math.pow(n,2);_>1&&(a*=Math.sqrt(_),n*=Math.sqrt(_));var y=Ue(t,i,s,r,a,n,u,d,f,p,g,m),v=Fe(y,4),w=v[0],x=v[1],P=v[2],O=v[3],k=Math.abs(O)/(He/4);Math.abs(1-k)<1e-7&&(k=1);var M=Math.max(Math.ceil(k),1);O/=M;for(var j=0;j1){const t=/^([01])([01])(.*)$/.exec(s);null!==t&&(e.splice(i,0,t[1]),++i,e.splice(i,0,t[2]),++i,t[3].length>0?e[i]=t[3]:e.splice(i,1))}if(++i,s=e[i],s.length>1){const t=/^([01])(.+)$/.exec(s);null!==t&&(e.splice(i,0,t[1]),++i,e[i]=t[2])}}}function qe(e){if(0===e||1===e)return e;throw new Error(\"Flag must be 0 or 1\")}function Ke(e){const t=[0,0,0];for(let i=0;i<24;i++)t[i%3]<<=1,t[i%3]|=1&e,e>>=1;return(0|t[2])+(t[1]<<8)+(t[0]<<16)}function Ze(e,t){for(;(!e.interactive||t(e))&&e._parent;)e=e._parent}function Je(e,t,i){return T(e,z(t),(e=>{const t=F(e);let s=e.touches;s?(0==s.length&&(s=e.changedTouches),i(Y(s),t)):i([e],t)}))}function $e(e){const t=document.createElement(\"canvas\");t.width=1,t.height=1;const i=t.getContext(\"2d\",{willReadFrequently:!0});i.drawImage(e,0,0,1,1);try{return i.getImageData(0,0,1,1),!1}catch(s){return console.warn('Image \"'+e.src+'\" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function Qe(e){e.width=0,e.height=0,e.style.width=\"0px\",e.style.height=\"0px\"}class et{constructor(){Object.defineProperty(this,\"_x\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_y\",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class tt extends G{constructor(e){super(),Object.defineProperty(this,\"_layer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"mask\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"visible\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"exportable\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"interactive\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"inactive\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"wheelable\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"cancelTouch\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"isMeasured\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"buttonMode\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"alpha\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"compoundAlpha\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"angle\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"scale\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"crisp\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"pivot\",{enumerable:!0,configurable:!0,writable:!0,value:new et}),Object.defineProperty(this,\"filter\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"cursorOverStyle\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_replacedCursorStyle\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_localMatrix\",{enumerable:!0,configurable:!0,writable:!0,value:new ze}),Object.defineProperty(this,\"_matrix\",{enumerable:!0,configurable:!0,writable:!0,value:new ze}),Object.defineProperty(this,\"_uMatrix\",{enumerable:!0,configurable:!0,writable:!0,value:new ze}),Object.defineProperty(this,\"_renderer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_parent\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_localBounds\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_bounds\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_colorId\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){if(null==e)this._layer=void 0;else{const i=!0;this._layer=this._renderer.getLayer(e,i),this._layer.visible=i,this._layer.margin=t,t&&q(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost()}}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return void 0===this._colorId&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(){return 0==this.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(){return this._isInteractive()}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){if(!this._localBounds){const e=1e7;this._localBounds={left:e,top:e,right:-e,bottom:-e},this._addBounds(this._localBounds)}return this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),s=t.apply({x:e.right,y:e.top}),r=t.apply({x:e.right,y:e.bottom}),a=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,s.x,r.x,a.x),top:Math.min(i.y,s.y,r.y,a.y),right:Math.max(i.x,s.x,r.x,a.x),bottom:Math.max(i.y,s.y,r.y,a.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new S((()=>{}))}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let s=i.tx*t,r=i.ty*t;this.crisp&&(s=Math.floor(s)+.5,r=Math.floor(r)+.5),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,s,r)}_transformMargin(e,t,i){const s=this._matrix;e.setTransform(s.a*t,s.b*t,s.c*t,s.d*t,(s.tx+i.left)*t,(s.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(!1!==this.exportable||!this._renderer._omitTainted)){this._setMatrix();const i=this._renderer.resolution,s=this._renderer.layers,r=this._renderer._ghostLayer,a=r.context,n=this.mask;n&&n._setMatrix(),t(s,(e=>{if(e){const t=e.context;t.save(),n&&(n._transformLayer(t,i,e),n._runPath(t),t.clip()),t.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(t,i,e),this.filter&&(t.filter=this.filter)}})),a.save(),n&&this._isInteractiveMask()&&(n._transformMargin(a,i,r.margin),n._runPath(a),a.clip()),this._transformMargin(a,i,r.margin),this._render(e),a.restore(),t(s,(e=>{e&&e.context.restore()}))}}_render(e){if(!1===this.exportable){(this._layer||e).tainted=!0}}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some((e=>e.value===this))}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class it extends tt{constructor(){super(...arguments),Object.defineProperty(this,\"interactiveChildren\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"_childLayers\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_children\",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(){return this.interactiveChildren||super._isInteractiveMask()}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,H(this._children,e)}_render(e){super._render(e);const i=this._renderer;this.interactive&&this.interactiveChildren&&++i._forceInteractive;const s=this._layer||e;t(this._children,(e=>{e.compoundAlpha=this.compoundAlpha*this.alpha,e.render(s)})),this.interactive&&this.interactiveChildren&&--i._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),I(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&t(this._childLayers,(e=>e.dirty=!0))}_dispose(){super._dispose(),this._childLayers&&t(this._childLayers,(e=>{e.dirty=!0}))}}function st(e,t){e.left=Math.min(e.left,t.x),e.top=Math.min(e.top,t.y),e.right=Math.max(e.right,t.x),e.bottom=Math.max(e.bottom,t.y)}class rt{colorize(e,t){}path(e){}addBounds(e){}}class at extends rt{colorize(e,t){e.beginPath()}}class nt extends rt{constructor(e){super(),Object.defineProperty(this,\"color\",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=void 0!==t?t:this.color}}class ot extends rt{constructor(e){super(),Object.defineProperty(this,\"clearShadow\",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor=\"\",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class lt extends rt{colorize(e,t){e.stroke()}}class ht extends rt{constructor(e,t,i){super(),Object.defineProperty(this,\"width\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"color\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"lineJoin\",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=void 0!==t?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ut extends rt{constructor(e){super(),Object.defineProperty(this,\"dash\",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class ct extends rt{constructor(e){super(),Object.defineProperty(this,\"dashOffset\",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class dt extends rt{constructor(e,t,i,s){super(),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"width\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"height\",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,s=t+this.width,r=i+this.height;st(e,{x:t,y:i}),st(e,{x:s,y:i}),st(e,{x:t,y:r}),st(e,{x:s,y:r})}}class bt extends rt{constructor(e,t,i){super(),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"radius\",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){st(e,{x:this.x-this.radius,y:this.y-this.radius}),st(e,{x:this.x+this.radius,y:this.y+this.radius})}}class ft extends rt{constructor(e,t,i,s){super(),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"radiusX\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"radiusY\",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){st(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),st(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class pt extends rt{constructor(e,t,i,s,r,a){super(),Object.defineProperty(this,\"cx\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"cy\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"radius\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"startAngle\",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,\"endAngle\",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,\"anticlockwise\",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=K(this.cx,this.cy,this.startAngle*Z,this.endAngle*Z,this.radius);st(e,{x:t.left,y:t.top}),st(e,{x:t.right,y:t.bottom})}}class gt extends rt{constructor(e,t,i,s,r){super(),Object.defineProperty(this,\"x1\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"y1\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"x2\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"y2\",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,\"radius\",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class mt extends rt{constructor(e,t){super(),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){st(e,{x:this.x,y:this.y})}}class _t extends rt{constructor(e,t){super(),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){st(e,{x:this.x,y:this.y})}}class yt extends rt{path(e){e.closePath()}}class vt extends rt{constructor(e,t,i,s,r,a){super(),Object.defineProperty(this,\"cpX\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"cpY\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"cpX2\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"cpY2\",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,\"toX\",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,\"toY\",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){st(e,{x:this.cpX,y:this.cpY}),st(e,{x:this.cpX2,y:this.cpY2}),st(e,{x:this.toX,y:this.toY})}}class wt extends rt{constructor(e,t,i,s){super(),Object.defineProperty(this,\"cpX\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"cpY\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"toX\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"toY\",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){st(e,{x:this.cpX,y:this.cpY}),st(e,{x:this.toX,y:this.toY})}}class xt extends rt{constructor(e,t,i,s,r){super(),Object.defineProperty(this,\"color\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"blur\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"offsetX\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"offsetY\",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,\"opacity\",{enumerable:!0,configurable:!0,writable:!0,value:r})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class Pt extends rt{constructor(e,t,i,s,r){super(),Object.defineProperty(this,\"image\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"width\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"height\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"x\",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,\"y\",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){st(e,{x:this.x,y:this.y}),st(e,{x:this.width,y:this.height})}}class Ot extends tt{constructor(){super(...arguments),Object.defineProperty(this,\"_operations\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"blendMode\",{enumerable:!0,configurable:!0,writable:!0,value:R.NORMAL}),Object.defineProperty(this,\"_hasShadows\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_fillAlpha\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_strokeAlpha\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof B?this._pushOp(new nt(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new nt(e))):this._pushOp(new nt(\"rgba(0, 0, 0, \"+t+\")\"))}endFill(){this._pushOp(new ot(this._hasShadows))}endStroke(){this._pushOp(new lt)}beginPath(){this._pushOp(new at)}lineStyle(e=0,t,i=1,s){this._strokeAlpha=i,t?t instanceof B?this._pushOp(new ht(e,t.toCSS(i),s)):this._pushOp(new ht(e,t,s)):this._pushOp(new ht(e,\"rgba(0, 0, 0, \"+i+\")\",s))}setLineDash(e){this._pushOp(new ut(e||[]))}setLineDashOffset(e=0){this._pushOp(new ct(e))}drawRect(e,t,i,s){this._pushOp(new dt(e,t,i,s))}drawCircle(e,t,i){this._pushOp(new bt(e,t,i))}drawEllipse(e,t,i,s){this._pushOp(new ft(e,t,i,s))}arc(e,t,i,s,r,a=!1){this._pushOp(new pt(e,t,i,s,r,a))}arcTo(e,t,i,s,r){this._pushOp(new gt(e,t,i,s,r))}lineTo(e,t){this._pushOp(new mt(e,t))}moveTo(e,t){this._pushOp(new _t(e,t))}bezierCurveTo(e,t,i,s,r,a){this._pushOp(new vt(e,t,i,s,r,a))}quadraticCurveTo(e,t,i,s){this._pushOp(new wt(e,t,i,s))}closePath(){this._pushOp(new yt)}shadow(e,t=0,i=0,s=0,r){this._hasShadows=!0,this._pushOp(new xt(r?e.toCSS(r):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,s))}image(e,t,i,s,r){this._pushOp(new Pt(e,t,i,s,r))}svgPath(e){let i=0,s=0,r=null,a=null,n=null,o=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,h=/[\\u0009\\u0020\\u000A\\u000C\\u000D]*([\\+\\-]?[0-9]*\\.?[0-9]+(?:[eE][\\+\\-]?[0-9]+)?)[\\u0009\\u0020\\u000A\\u000C\\u000D]*,?/g;let u;for(;null!==(u=l.exec(e));){const e=u[1],l=u[2],c=[];for(;null!==(u=h.exec(l));)c.push(u[1]);switch(\"S\"!==e&&\"s\"!==e&&\"C\"!==e&&\"c\"!==e&&(r=null,a=null),\"Q\"!==e&&\"q\"!==e&&\"T\"!==e&&\"t\"!==e&&(n=null,o=null),e){case\"M\":Xe(e,c.length,2),i=+c[0],s=+c[1],this.moveTo(i,s);for(let e=2;e{this.bezierCurveTo(e.x1,e.y1,e.x2,e.y2,e.x,e.y),i=e.x,s=e.y}))}break;case\"Z\":case\"z\":Ve(e,c.length,0),this.closePath()}}}_runPath(e){e.beginPath(),t(this._operations,(t=>{t.path(e)}))}_render(e){super._render(e);const i=this._layer||e,s=i.dirty,r=this._isInteractive();if(s||r){const e=i.context,a=this._renderer._ghostLayer.context;let n;s&&(e.globalCompositeOperation=this.blendMode,e.beginPath()),r&&(a.beginPath(),n=this._getColorId()),t(this._operations,(t=>{s&&(t.path(e),t.colorize(e,void 0)),r&&(t.path(a),t.colorize(a,n))}))}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const i=this.mask;i&&(i._setMatrix(),i._transform(e,1),i._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),t(this._operations,(t=>{t.path(e),t.colorize(e,void 0)})),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&t(this._operations,(t=>{t.addBounds(e)}))}}class kt extends tt{constructor(e,t,i){super(e),Object.defineProperty(this,\"text\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"style\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"resolution\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"textVisible\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"_textInfo\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_originalScale\",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const s=e.context,r=this._renderer._ghostLayer.context,a=this.style;let n=this._getFontStyle(void 0,i);s.font=n,this._isInteractive()&&!t&&(r.font=n),a.fill&&(a.fill instanceof B?s.fillStyle=a.fill.toCSS(null!=a.fillOpacity?a.fillOpacity:1):s.fillStyle=a.fill),a.shadowColor&&(e.context.shadowColor=a.shadowColor.toCSS(a.shadowOpacity||1)),a.shadowBlur&&(e.context.shadowBlur=a.shadowBlur),a.shadowOffsetX&&(e.context.shadowOffsetX=a.shadowOffsetX),a.shadowOffsetY&&(e.context.shadowOffsetY=a.shadowOffsetY),this._shared(s),this._isInteractive()&&!t&&(r.fillStyle=this._getColorId(),this._shared(r))}_getFontStyle(e,t=!1){const i=this.style;let s=[];return e&&e.fontVariant?s.push(e.fontVariant):i.fontVariant&&s.push(i.fontVariant),t||(e&&e.fontWeight?s.push(e.fontWeight):i.fontWeight&&s.push(i.fontWeight)),e&&e.fontStyle?s.push(e.fontStyle):i.fontStyle&&s.push(i.fontStyle),e&&e.fontSize?(b(e.fontSize)&&(e.fontSize=e.fontSize+\"px\"),s.push(e.fontSize)):i.fontSize&&(b(i.fontSize)&&(i.fontSize=i.fontSize+\"px\"),s.push(i.fontSize)),e&&e.fontFamily?s.push(e.fontFamily):i.fontFamily?s.push(i.fontFamily):s.length&&s.push(\"Arial\"),s.join(\" \")}_render(e){const i=this._layer||e;if(this._textInfo||this._measure(i),this.textVisible){const e=this._isInteractive(),s=i.context,r=i.dirty,a=this._renderer._ghostLayer.context;s.save(),a.save(),this._prerender(i),t(this._textInfo,((i,n)=>{t(i.textChunks,((t,n)=>{if(t.style&&(s.save(),a.save(),s.font=t.style,this._isInteractive()&&(a.font=t.style)),t.fill&&(s.save(),s.fillStyle=t.fill.toCSS()),r&&s.fillText(t.text,t.offsetX,i.offsetY+t.offsetY),\"underline\"==t.textDecoration||\"line-through\"==t.textDecoration){let e,r=1,a=1,n=t.height,o=t.offsetX;switch(this.style.textAlign){case\"right\":case\"end\":o-=t.width;break;case\"center\":o-=t.width/2}if(t.style){switch(c.getTextStyle(t.style).fontWeight){case\"bolder\":case\"bold\":case\"700\":case\"800\":case\"900\":r=2}}n&&(a=n/20),e=\"line-through\"==t.textDecoration?r+i.offsetY+t.offsetY-t.height/2:r+1.5*a+i.offsetY+t.offsetY,s.save(),s.beginPath(),t.fill?s.strokeStyle=t.fill.toCSS():this.style.fill&&this.style.fill instanceof B&&(s.strokeStyle=this.style.fill.toCSS()),s.lineWidth=r*a,s.moveTo(o,e),s.lineTo(o+t.width,e),s.stroke(),s.restore()}e&&this.interactive&&a.fillText(t.text,t.offsetX,i.offsetY+t.offsetY),t.fill&&s.restore(),t.style&&(s.restore(),a.restore())}))})),s.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure(this.getLayer());st(e,{x:t.left,y:t.top}),st(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const i=e.context,s=this._renderer._ghostLayer.context,r=\"rtl\"==this.style.direction;this._textInfo=[];const a=this.style.oversizedBehavior,n=this.style.maxWidth,o=b(n)&&\"truncate\"==a,l=b(n)&&(\"wrap\"==a||\"wrap-no-break\"==a);i.save(),s.save(),this._prerender(e,!0,this._ignoreFontWeight());const h=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 \",u=this.text.toString().replace(/\\r/g,\"\").split(/\\n/);let d,f=!0,p=0,g=0,m=0;t(u,((e,t)=>{let r;for(r=\"\"==e?[{type:\"value\",text:\"\"}]:c.chunk(e,!1,this.style.ignoreFormatting);r.length>0;){let e={offsetY:m,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const t=this._measureText(h,i),a=t.actualBoundingBoxAscent+t.actualBoundingBoxDescent;let u;e.height=a,e.ascent=t.actualBoundingBoxAscent;let b,_,y,v=this.style.textDecoration,w=!1,x=!0,O=[];U(r,((t,a)=>{if(\"format\"==t.type)if(\"[/]\"==t.text)f||(i.restore(),s.restore(),f=!0),b=void 0,d=void 0,_=void 0,v=this.style.textDecoration,y=void 0,u=t.text;else{f||(i.restore(),s.restore());let r=c.getTextStyle(t.text);const a=this._getFontStyle(r);i.save(),s.save(),i.font=a,d=a,u=t.text,r.textDecoration&&(v=r.textDecoration),r.fill&&(b=r.fill),r.width&&(_=P(r.width)),r.verticalAlign&&(y=r.verticalAlign),f=!1;const n=this._measureText(h,i),o=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent;o>e.height&&(e.height=o),n.actualBoundingBoxAscent>e.ascent&&(e.ascent=n.actualBoundingBoxAscent)}else if(\"value\"==t.type&&!w){const s=this._measureText(t.text,i);let h=s.actualBoundingBoxLeft+s.actualBoundingBoxRight;if(o){let s=x||this.style.breakWords||!1;const r=this.style.ellipsis||\"\",a=this._measureText(r,i),o=a.actualBoundingBoxLeft+a.actualBoundingBoxRight;if(e.width+h>n){const a=n-e.width-o;t.text=this._truncateText(i,t.text,a,s),t.text+=r,w=!0}}else if(l&&e.width+h>n){const s=n-e.width,o=this._truncateText(i,t.text,s,!1,x&&\"wrap-no-break\"!=this.style.oversizedBehavior);if(\"\"==o)return this.textVisible=!0,!1;O=r.slice(a+1),J(o)!=J(t.text)&&(O.unshift({type:\"value\",text:t.text.substr(o.length)}),u&&O.unshift({type:\"format\",text:u})),t.text=J(o),r=[],w=!0}let c=1,f=1;if(d&&_&&_>h){const e=h/_;switch(this.style.textAlign){case\"right\":case\"end\":c=e;break;case\"center\":c=e,f=e;break;default:f=e}h=_}const p=s.actualBoundingBoxAscent+s.actualBoundingBoxDescent;p>e.height&&(e.height=p),s.actualBoundingBoxAscent>e.ascent&&(e.ascent=s.actualBoundingBoxAscent),e.width+=h,e.left+=s.actualBoundingBoxLeft/c,e.right+=s.actualBoundingBoxRight/f,e.textChunks.push({style:d,fill:b,text:t.text,width:h,height:p,left:s.actualBoundingBoxLeft,right:s.actualBoundingBoxRight,ascent:s.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:v,verticalAlign:y}),x=!1}return!0})),this.style.lineHeight instanceof W?(e.height*=this.style.lineHeight.value,e.ascent*=this.style.lineHeight.value):(e.height*=this.style.lineHeight||1.2,e.ascent*=this.style.lineHeight||1.2),p{let s=0;t(e.textChunks,(t=>{if(t.offsetX=s+t.left-e.left,t.offsetY+=e.height-e.height*(this.style.baselineRatio||.19),s+=t.width,t.verticalAlign)switch(t.verticalAlign){case\"super\":t.offsetY-=e.height/2-t.height/2;break;case\"sub\":t.offsetY+=t.height/2}}))}));const _={left:r?-g:-p,top:0,right:r?p:g,bottom:m};if(\"none\"!==a){const e=this._fitRatio(_);if(e<1)if(\"fit\"==a)b(this.style.minScale)&&ei&&\"\"!=t);return t}_measureText(e,t){let i=t.measureText(e),s={};if(null==i.actualBoundingBoxAscent){const t=document.createElement(\"div\");t.innerText=e,t.style.visibility=\"hidden\",t.style.position=\"absolute\",t.style.top=\"-1000000px;\",t.style.fontFamily=this.style.fontFamily||\"\",t.style.fontSize=this.style.fontSize+\"\",document.body.appendChild(t);const r=t.getBoundingClientRect();document.body.removeChild(t);const a=r.height,n=i.width;s={actualBoundingBoxAscent:a,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:n,fontBoundingBoxAscent:a,fontBoundingBoxDescent:0,width:n}}else s={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const r=i.width;switch(this.style.textAlign){case\"right\":case\"end\":s.actualBoundingBoxLeft=r,s.actualBoundingBoxRight=0;break;case\"center\":s.actualBoundingBoxLeft=r/2,s.actualBoundingBoxRight=r/2;break;default:s.actualBoundingBoxLeft=0,s.actualBoundingBoxRight=r}return s}}class Mt{constructor(){Object.defineProperty(this,\"fill\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fillOpacity\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"textAlign\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fontFamily\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fontSize\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fontWeight\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fontStyle\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fontVariant\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"textDecoration\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowColor\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowBlur\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowOffsetX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowOffsetY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowOpacity\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"lineHeight\",{enumerable:!0,configurable:!0,writable:!0,value:V(120)}),Object.defineProperty(this,\"baselineRatio\",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,\"direction\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"textBaseline\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"oversizedBehavior\",{enumerable:!0,configurable:!0,writable:!0,value:\"none\"}),Object.defineProperty(this,\"breakWords\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"ellipsis\",{enumerable:!0,configurable:!0,writable:!0,value:\"…\"}),Object.defineProperty(this,\"maxWidth\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"maxHeight\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"minScale\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"ignoreFormatting\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class jt extends kt{constructor(){super(...arguments),Object.defineProperty(this,\"textType\",{enumerable:!0,configurable:!0,writable:!0,value:\"circular\"}),Object.defineProperty(this,\"radius\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"startAngle\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"inside\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"orientation\",{enumerable:!0,configurable:!0,writable:!0,value:\"auto\"}),Object.defineProperty(this,\"kerning\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_textReversed\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){if(\"circular\"===this.textType)this._renderCircular(e);else super._render(e)}_renderCircular(e){if(this.textVisible){const i=this._layer||e;this._prerender(i);const s=this._isInteractive(),r=i.context,a=i.dirty,n=this._renderer._ghostLayer.context;r.save(),s&&n.save(),this._textInfo||this._measure(i);let o=this.radius||0,l=this.startAngle||0,h=0,u=this.orientation,c=\"auto\"==u?\"auto\":\"inward\"==u;const d=this.inside,b=this.style.textAlign||\"left\",f=this.kerning||0;let p=\"left\"==b?1:-1;const g=!this._textReversed;if(\"auto\"==c){let e=0,i=0;t(this._textInfo,((t,i)=>{const s=l+t.width/(o-t.height)/2*-p;s>e&&(e=s)})),i=\"left\"==b?(e+h/2)*Z:\"right\"==b?(e-h/2)*Z:l*Z,i=N(i),c=i>=270||i<=90}1==c&&g&&(this._textInfo.reverse(),this._textReversed=!0),t(this._textInfo,((e,i)=>{const u=e.height;d||(o+=u),(-1==p&&c||1==p&&!c)&&g&&e.textChunks.reverse();let m=l;h=0,\"center\"==b&&(m+=e.width/(o-u)/2*-p,h=m-l),m+=Math.PI*(c?0:1),r.save(),s&&n.save(),r.rotate(m),s&&n.rotate(m);let _=0;t(e.textChunks,((e,t)=>{const i=e.text,l=e.width;_=l/2/(o-u)*p,r.rotate(_),s&&n.rotate(_),e.style&&(r.save(),n.save(),r.font=e.style,s&&(n.font=e.style)),e.fill&&(r.save(),r.fillStyle=e.fill.toCSS()),r.textBaseline=\"middle\",r.textAlign=\"center\",s&&(n.textBaseline=\"middle\",n.textAlign=\"center\"),a&&r.fillText(i,0,(c?1:-1)*(0-o+u/2)),s&&n.fillText(i,0,(c?1:-1)*(0-o+u/2)),e.fill&&r.restore(),e.style&&(r.restore(),n.restore()),_=(l/2+f)/(o-u)*p,r.rotate(_),s&&n.rotate(_)})),r.restore(),s&&n.restore(),d&&(o-=u)})),r.restore(),s&&n.restore()}}_measure(e){return\"circular\"===this.textType?this._measureCircular(e):super._measure(e)}_measureCircular(e){const i=e.context,s=this._renderer._ghostLayer.context,r=\"rtl\"==this.style.direction,a=this.style.oversizedBehavior,n=this.style.maxWidth,o=b(n)&&\"truncate\"==a,l=this.style.ellipsis||\"\";let h;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,i.save(),s.save(),this._prerender(e,!0);const u=this.text.toString().replace(/\\r/g,\"\").split(/\\n/);let d=!0,f=0,p=0;return t(u,((e,a)=>{let u,b,g,m=c.chunk(e,!1,this.style.ignoreFormatting),_={offsetY:p,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};t(m,((e,t)=>{if(\"format\"==e.type){if(\"[/]\"==e.text)d||(i.restore(),s.restore(),d=!0),b=void 0,u=void 0,g=void 0;else{let t=c.getTextStyle(e.text);const r=this._getFontStyle(t);i.save(),s.save(),i.font=r,u=r,t.fill&&(b=t.fill),t.width&&(g=P(t.width)),d=!1}o&&(h=this._measureText(l,i))}else if(\"value\"==e.type){const t=e.text.match(/./gu)||[];r&&t.reverse();for(let e=0;ec&&(c=g);const d=a.actualBoundingBoxAscent+a.actualBoundingBoxDescent;if(d>_.height&&(_.height=d),a.actualBoundingBoxAscent>_.ascent&&(_.ascent=a.actualBoundingBoxAscent),_.width+=c,_.left+=a.actualBoundingBoxLeft,_.right+=a.actualBoundingBoxRight,_.textChunks.push({style:u,fill:b,text:s,width:c,height:d+a.actualBoundingBoxDescent,left:a.actualBoundingBoxLeft,right:a.actualBoundingBoxRight,ascent:a.actualBoundingBoxAscent,offsetX:0,offsetY:d,textDecoration:void 0}),f+=c,o){h||(h=this._measureText(l,i));const e=h.actualBoundingBoxLeft+h.actualBoundingBoxRight;if(f+=e,f+e>n){1==_.textChunks.length?this.textVisible=!1:(_.width+=e,_.left+=h.actualBoundingBoxLeft,_.right+=h.actualBoundingBoxRight,_.textChunks.push({style:u,fill:b,text:l,width:e,height:d+h.actualBoundingBoxDescent,left:h.actualBoundingBoxLeft,right:h.actualBoundingBoxRight,ascent:h.actualBoundingBoxAscent,offsetX:0,offsetY:d,textDecoration:void 0}));break}}if(r)break}}})),this.style.lineHeight instanceof W?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),p+=_.height})),d||(i.restore(),s.restore()),\"hide\"==a&&f>n&&(this.textVisible=!1),t(this._textInfo,(e=>{t(e.textChunks,(t=>{t.offsetY+=Math.round((e.height-t.height+(e.ascent-t.ascent))/2)}))})),i.restore(),s.restore(),{left:0,top:0,right:0,bottom:0}}}class St extends tt{constructor(e,t){super(e),Object.defineProperty(this,\"width\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"height\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"image\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"tainted\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowColor\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowBlur\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowOffsetX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowOffsetY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"shadowOpacity\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_imageMask\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&Qe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){const t=this._layer||e;if(void 0===this.tainted&&(this.tainted=$e(this.image),t.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(t.dirty){this.shadowColor&&(t.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(t.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(t.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(t.context.shadowOffsetY=this.shadowOffsetY);const e=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;t.context.drawImage(this.image,0,0,e,i)}if(this.interactive&&this._isInteractive()){const e=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(e,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(void 0===this._imageMask){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,s=document.createElement(\"canvas\");s.width=t,s.height=i;const r=s.getContext(\"2d\");r.imageSmoothingEnabled=!1,r.fillStyle=this._getColorId(),r.fillRect(0,0,t,i),$e(e)||(r.globalCompositeOperation=\"destination-in\",r.drawImage(e,0,0,t,i)),this._imageMask=s}return this._imageMask}}class Et{constructor(e,t,i,s){Object.defineProperty(this,\"event\",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,\"originalPoint\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"point\",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,\"bbox\",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,\"id\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"simulated\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"native\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),E(\"touchevents\")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class Tt extends j{constructor(i){if(super(),Object.defineProperty(this,\"view\",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement(\"div\")}),Object.defineProperty(this,\"_layerDom\",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement(\"div\")}),Object.defineProperty(this,\"layers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_dirtyLayers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"defaultLayer\",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,\"_ghostLayer\",{enumerable:!0,configurable:!0,writable:!0,value:new Ct}),Object.defineProperty(this,\"_patternCanvas\",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement(\"canvas\")}),Object.defineProperty(this,\"_patternContext\",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext(\"2d\")}),Object.defineProperty(this,\"_realWidth\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_realHeight\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_calculatedWidth\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_calculatedHeight\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"resolution\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"interactionsEnabled\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"_listeners\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_events\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_colorId\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_colorMap\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_forceInteractive\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_omitTainted\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_hovering\",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,\"_dragging\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_mousedown\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_lastPointerMoveEvent\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"tapToActivate\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"tapToActivateTimeout\",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,\"_touchActive\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_touchActiveTimeout\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=i??window.devicePixelRatio,this.view.style.position=\"absolute\",this.view.setAttribute(\"aria-hidden\",\"true\"),this.view.appendChild(this._layerDom),this._disposers.push(new S((()=>{u(this._events,((e,t)=>{t.disposer.dispose()})),t(this.layers,(e=>{Qe(e.view),e.exportableView&&Qe(e.exportableView)})),Qe(this._ghostLayer.view),Qe(this._patternCanvas)}))),this._disposers.push(e((()=>{null==i&&(this.resolution=window.devicePixelRatio)}))),E(\"touchevents\")){const e=e=>{0!==this._dragging.length&&U(this._dragging,(t=>!t.value.shouldCancelTouch()||(e.preventDefault(),!1))),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(T(window,\"touchstart\",e,{passive:!1})),this._disposers.push(T(this.view,\"touchstart\",e,{passive:!1})),this._disposers.push(T(this.view,\"touchmove\",(()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()}),{passive:!0})),this._disposers.push(T(window,\"click\",(e=>{this._touchActive=!1}),{passive:!0})),this._disposers.push(T(this.view,\"click\",(e=>{window.setTimeout((()=>{this._touchActive=!0,this._delayTouchDeactivate()}),100)}),{passive:!0}))}E(\"wheelevents\")&&this._disposers.push(T(this.view,\"wheel\",(e=>{let t=!1;this._hovering.forEach((e=>{if(e.wheelable)return t=!0,!1})),t&&e.preventDefault()}),{passive:!1}))}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout((()=>{this._touchActive=!1}),this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,s){return this.defaultLayer.context.createLinearGradient(e,t,i,s)}createRadialGradient(e,t,i,s,r,a){return this.defaultLayer.context.createRadialGradient(e,t,i,s,r,a)}createPattern(e,t,i,s,r){return this._patternCanvas.width=s,this._patternCanvas.height=r,this._patternContext.clearRect(0,0,s,r),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new it(this)}makeGraphics(){return new Ot(this)}makeText(e,t){return new kt(this,e,t)}makeTextStyle(){return new Mt}makeRadialText(e,t){return new jt(this,e,t)}makePicture(e){return new St(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,i,s,r){this._realWidth=e,this._realHeight=i,this._calculatedWidth=s,this._calculatedHeight=r,t(this.layers,(e=>{e&&(e.dirty=!0,this.resizeLayer(e))})),this.resizeGhost(),this.view.style.width=s+\"px\",this.view.style.height=r+\"px\"}createDetachedLayer(e=!1){const t=document.createElement(\"canvas\"),i=t.getContext(\"2d\",{willReadFrequently:e}),s=new Bt(t,i);return t.style.position=\"absolute\",t.style.top=\"0px\",t.style.left=\"0px\",s}getLayerByOrder(e){const t=this.layers,i=t.length;for(let s=0;se.order>t.order?1:e.order{e&&e.dirty&&e.visible&&(this._dirtyLayers.push(e),e.clear())})),this._ghostLayer.clear(),e.render(this.defaultLayer),this._ghostLayer.context.restore(),t(this.layers,(e=>{if(e){const t=e.context;t.beginPath(),t.moveTo(0,0),t.stroke()}})),t(this._dirtyLayers,(e=>{e.context.restore(),e.dirty=!1})),this._hovering.size&&this._lastPointerMoveEvent){const{events:e,target:i,native:s}=this._lastPointerMoveEvent;t(e,(e=>{this._dispatchGlobalMousemove(e,i,s)}))}}paintId(e){const t=Ke(++this._colorId),i=B.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){void 0!==e._colorId&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),s=e.clientX||0,r=e.clientY||0,a=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,o={x:s-i.left,y:r-i.top},l={x:(s-(t?i.left:0))*a,y:(r-(t?i.top:0))*n};return new Et(e,o,l,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(0===t.width||0===t.height||e.xt.right||e.yt.bottom)return;if(!i||!this._layerDom.contains(i))return;const s=this._ghostLayer.getImageData(e,t);if(0===s.data[0]&&0===s.data[1]&&0===s.data[2])return!1;const r=B.fromRGB(s.data[0],s.data[1],s.data[2]).toCSS();return this._colorMap[r]}_withEvents(e,t){const s=this._events[e];if(void 0!==s){s.dispatching=!0;try{t(s)}finally{s.dispatching=!1,s.cleanup&&(s.cleanup=!1,i(s.callbacks,(e=>!e.disposed)),0===s.callbacks.length&&(s.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,i){this.interactionsEnabled&&this._withEvents(e,(e=>{t(e.callbacks,(e=>{e.disposed||e.callback.call(e.context,i)}))}))}_dispatchEvent(e,i,s){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,(e=>{t(e.callbacks,(e=>{e.disposed||e.object!==i||(e.callback.call(e.context,s),r=!0)}))})),r}_dispatchMousedown(e,t){const i=e.button;if(0!=i&&2!=i&&1!=i&&void 0!==i)return;const s=this.getEvent(e),r=this._getHitTarget(s.originalPoint,s.bbox,t);if(r){const e=s.id;let t=!1;Ze(r,(i=>{const r={id:e,value:i};if(this._mousedown.push(r),!t&&this._dispatchEvent(\"pointerdown\",i,s)){t=!0;this._dragging.some((t=>t.value===i&&t.id===e))||this._dragging.push(r)}return!0}))}}_dispatchGlobalMousemove(e,t,i){const s=this.getEvent(e),r=this._getHitTarget(s.originalPoint,s.bbox,t);s.native=i,r?(this._hovering.forEach((e=>{e.contains(r)||(this._hovering.delete(e),e.cursorOverStyle&&D(document.body,\"cursor\",e._replacedCursorStyle),this._dispatchEvent(\"pointerout\",e,s))})),s.native&&Ze(r,(e=>(this._hovering.has(e)||(this._hovering.add(e),e.cursorOverStyle&&(e._replacedCursorStyle=X(document.body,\"cursor\"),D(document.body,\"cursor\",e.cursorOverStyle)),this._dispatchEvent(\"pointerover\",e,s)),!0)))):(this._hovering.forEach((e=>{e.cursorOverStyle&&D(document.body,\"cursor\",e._replacedCursorStyle),this._dispatchEvent(\"pointerout\",e,s)})),this._hovering.clear()),this._dispatchEventAll(\"globalpointermove\",s)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll(\"globalpointerup\",i)}_dispatchDragMove(e){if(0!==this._dragging.length){const t=this.getEvent(e),i=t.id;this._dragging.forEach((e=>{e.id===i&&this._dispatchEvent(\"pointermove\",e.value,t)}))}}_dispatchDragEnd(e,t){const i=e.button;let s;if(0==i||void 0===i)s=\"click\";else if(2==i)s=\"rightclick\";else{if(1!=i)return;s=\"middleclick\"}const r=this.getEvent(e),a=r.id;if(0!==this._mousedown.length){const e=this._getHitTarget(r.originalPoint,r.bbox,t);e&&this._mousedown.forEach((t=>{t.id===a&&t.value.contains(e)&&this._dispatchEvent(s,t.value,r)})),this._mousedown.length=0}0!==this._dragging.length&&(this._dragging.forEach((e=>{e.id===a&&this._dispatchEvent(\"pointerup\",e.value,r)})),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),s=this._getHitTarget(i.originalPoint,i.bbox,t);s&&Ze(s,(e=>!this._dispatchEvent(\"dblclick\",e,i)))}_dispatchWheel(e,t){const i=this.getEvent(e),s=this._getHitTarget(i.originalPoint,i.bbox,t);s&&Ze(s,(e=>!this._dispatchEvent(\"wheel\",e,i)))}_makeSharedEvent(e,t){if(void 0===this._listeners[e]){const i=t();this._listeners[e]=new A((()=>{delete this._listeners[e],i.dispose()}))}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,s=null;function r(){s=null,i=!1}return new L([new S((()=>{null!==s&&clearTimeout(s),r()})),T(this.view,z(e),(e=>{i=!0,null!==s&&clearTimeout(s),s=window.setTimeout(r,0)})),Je(window,e,((e,r)=>{null!==s&&(clearTimeout(s),s=null),t(e,r,i),i=!1}))])}_initEvent(e){switch(e){case\"globalpointermove\":case\"pointerover\":case\"pointerout\":return this._makeSharedEvent(\"pointermove\",(()=>{const e=(e,i,s)=>{this._lastPointerMoveEvent={events:e,target:i,native:s},t(e,(e=>{this._dispatchGlobalMousemove(e,i,s)}))};return new L([this._onPointerEvent(\"pointerdown\",e),this._onPointerEvent(\"pointermove\",e)])}));case\"globalpointerup\":return this._makeSharedEvent(\"pointerup\",(()=>{const e=this._onPointerEvent(\"pointerup\",((e,i,s)=>{t(e,(e=>{this._dispatchGlobalMouseup(e,s)})),this._lastPointerMoveEvent={events:e,target:i,native:s}})),i=this._onPointerEvent(\"pointercancel\",((e,i,s)=>{t(e,(e=>{this._dispatchGlobalMouseup(e,s)})),this._lastPointerMoveEvent={events:e,target:i,native:s}}));return new S((()=>{e.dispose(),i.dispose()}))}));case\"click\":case\"rightclick\":case\"middleclick\":case\"pointerdown\":case\"pointermove\":case\"pointerup\":return this._makeSharedEvent(\"pointerdown\",(()=>{const e=this._onPointerEvent(\"pointerdown\",((e,i)=>{t(e,(e=>{this._dispatchMousedown(e,i)}))})),i=this._onPointerEvent(\"pointermove\",(e=>{t(e,(e=>{this._dispatchDragMove(e)}))})),s=this._onPointerEvent(\"pointerup\",((e,i)=>{t(e,(e=>{this._dispatchDragEnd(e,i)}))})),r=this._onPointerEvent(\"pointercancel\",((e,i)=>{t(e,(e=>{this._dispatchDragEnd(e,i)}))}));return new S((()=>{e.dispose(),i.dispose(),s.dispose(),r.dispose()}))}));case\"dblclick\":return this._makeSharedEvent(\"dblclick\",(()=>this._onPointerEvent(\"dblclick\",((e,i)=>{t(e,(e=>{this._dispatchDoubleClick(e,i)}))}))));case\"wheel\":return this._makeSharedEvent(\"wheel\",(()=>T(window,z(\"wheel\"),(e=>{this._dispatchWheel(e,F(e))}),{passive:!1})))}}_addEvent(e,t,i,s){let r=this._events[t];void 0===r&&(r=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const a={object:e,context:s,callback:i,disposed:!1};return r.callbacks.push(a),new S((()=>{a.disposed=!0,r.dispatching?r.cleanup=!0:(H(r.callbacks,a),0===r.callbacks.length&&(r.disposer.dispose(),delete this._events[t]))}))}getCanvas(e,i){this.render(e),i||(i={});let s=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(i.minWidth&&i.minWidth>r){let e=i.minWidth/r;e>s&&(s=e*this.resolution)}if(i.minHeight&&i.minHeight>a){let e=i.minHeight/a;e>s&&(s=e*this.resolution)}if(i.maxWidth&&i.maxWidtha){let e=i.maxHeight/a;e{if(e&&e.visible&&(e.tainted||o)){d=!0,e.exportableView=e.view,e.exportableContext=e.context,e.view=document.createElement(\"canvas\"),e.view.style.position=\"fixed\",e.view.style.top=\"-10000px\",this.view.appendChild(e.view),n.push(e.view);let t=0,i=0;e.margin&&(t+=e.margin.left||0+e.margin.right||0,i+=e.margin.top||0+e.margin.bottom||0),e.view.width=r+t,e.view.height=a+i,e.context=e.view.getContext(\"2d\"),e.dirty=!0,e.scale=s}})),d&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),t(this.layers,(e=>{if(e&&e.visible){let t=0,i=0;e.margin&&(t=-(e.margin.left||0)*this.resolution,i=-(e.margin.top||0)*this.resolution),h.drawImage(e.view,t,i),e.exportableView&&(e.view=e.exportableView,e.exportableView=void 0),e.exportableContext&&(e.context=e.exportableContext,e.exportableContext=void 0),u{e.style.position=\"\",e.style.top=\"\",this.view.removeChild(e)})),l}}class Ct{constructor(){Object.defineProperty(this,\"view\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"context\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"margin\",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,\"_width\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_height\",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=document.createElement(\"canvas\"),this.context=this.view.getContext(\"2d\",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position=\"absolute\",this.view.style.top=\"0px\",this.view.style.left=\"0px\"}resize(e,t,i,s,r){e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,s+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+\"px\",this.view.style.top=-this.margin.top+\"px\",this._width=Math.floor(e*r),this._height=Math.floor(t*r),this.view.width=this._width,this.view.style.width=i+\"px\",this.view.height=this._height,this.view.style.height=s+\"px\"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,t(e,(e=>{e.margin&&(this.margin.left=Math.max(this.margin.left,e.margin.left),this.margin.right=Math.max(this.margin.right,e.margin.right),this.margin.top=Math.max(this.margin.top,e.margin.top),this.margin.bottom=Math.max(this.margin.bottom,e.margin.bottom))}))}clear(){this.context.save(),this.context.fillStyle=\"#000\",this.context.fillRect(0,0,this._width,this._height)}}class Bt{constructor(e,t){Object.defineProperty(this,\"view\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"context\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"tainted\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"margin\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"order\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"visible\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"width\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"height\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"scale\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"dirty\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"exportableView\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"exportableContext\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_width\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_height\",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,s,r){null!=this.width&&(e=this.width,i=this.width),null!=this.height&&(t=this.height,s=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,s+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+\"px\",this.view.style.top=-this.margin.top+\"px\"):(this.view.style.left=\"0px\",this.view.style.top=\"0px\"),this._width=Math.floor(e*r),this._height=Math.floor(t*r),this.view.width=this._width,this.view.style.width=i+\"px\",this.view.height=this._height,this.view.style.height=s+\"px\"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Dt(e,t){null==e?requestAnimationFrame(t):setTimeout((()=>{requestAnimationFrame(t)}),1e3/e)}class At{constructor(e,i={},s){if(Object.defineProperty(this,\"dom\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_inner\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_settings\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_isDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_isDirtyParents\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dirty\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_dirtyParents\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_dirtyBounds\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_dirtyPositions\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_ticker\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"_tickers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_updateTick\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"events\",{enumerable:!0,configurable:!0,writable:!0,value:new $}),Object.defineProperty(this,\"animationTime\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"_animations\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_renderer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_rootContainer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"tooltipContainer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipContainerSettings\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltip\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"language\",{enumerable:!0,configurable:!0,writable:!0,value:Le.new(this,{})}),Object.defineProperty(this,\"locale\",{enumerable:!0,configurable:!0,writable:!0,value:Ae}),Object.defineProperty(this,\"utc\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"timezone\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fps\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"numberFormatter\",{enumerable:!0,configurable:!0,writable:!0,value:Se.new(this,{})}),Object.defineProperty(this,\"dateFormatter\",{enumerable:!0,configurable:!0,writable:!0,value:Be.new(this,{})}),Object.defineProperty(this,\"durationFormatter\",{enumerable:!0,configurable:!0,writable:!0,value:De.new(this,{})}),Object.defineProperty(this,\"tabindex\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_tabindexes\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_a11yD\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_focusElementDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_focusElementContainer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_focusedSprite\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_isShift\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_keyboardDragPoint\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipElementContainer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_readerAlertElement\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_logo\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipDiv\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"nonce\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"interfaceColors\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"verticalLayout\",{enumerable:!0,configurable:!0,writable:!0,value:Q.new(this,{})}),Object.defineProperty(this,\"horizontalLayout\",{enumerable:!0,configurable:!0,writable:!0,value:ee.new(this,{})}),Object.defineProperty(this,\"gridLayout\",{enumerable:!0,configurable:!0,writable:!0,value:te.new(this,{})}),Object.defineProperty(this,\"_paused\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"autoResize\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"_fontHash\",{enumerable:!0,configurable:!0,writable:!0,value:\"\"}),Object.defineProperty(this,\"_isDisposed\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_disposers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_resizeSensorDisposer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltips\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_htmlElementContainer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_htmlEnabledContainers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!s)throw new Error(\"You cannot use `new Class()`, instead use `Class.new()`\");let r,a;if(this._settings=i,0==i.accessible&&(this._a11yD=!0),null==i.useSafeResolution&&(i.useSafeResolution=!0),i.useSafeResolution&&(r=me()),this._renderer=new Tt(r),a=e instanceof HTMLElement?e:document.getElementById(e),t(ie.rootElements,(e=>{if(e.dom===a)throw new Error(\"You cannot have multiple Roots on the same DOM node\")})),this.interfaceColors=je.new(this,{}),null===a)throw new Error(\"Could not find HTML element with id `\"+e+\"`\");this.dom=a;let n=document.createElement(\"div\");n.style.position=\"relative\",n.style.width=\"100%\",n.style.height=\"100%\",a.appendChild(n);const o=i.tooltipContainerBounds;o&&(this._tooltipContainerSettings=o),this._inner=n,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new At(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(se.new(this,{interactive:!0,interactiveChildren:!1,position:\"absolute\",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:V(100),centerY:re,tooltipText:\"Created using amCharts 5\",tooltipX:re,cursorOverStyle:\"pointer\",background:ae.new(this,{fill:ne(4671320),fillOpacity:0,tooltipY:5})})),t=ye.new(this,{pointerOrientation:\"horizontal\",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get(\"background\").setAll({fill:this.interfaceColors.get(\"background\"),stroke:this.interfaceColors.get(\"grid\"),strokeOpacity:.3}),e.set(\"tooltip\",t),e.events.on(\"click\",(()=>{window.open(\"https://www.amcharts.com/\",\"_blank\")})),e.states.create(\"hover\",{});e.children.push(oe.new(this,{stroke:ne(13421772),strokeWidth:3,svgPath:\"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6\"})).states.create(\"hover\",{stroke:ne(3976191)});e.children.push(oe.new(this,{stroke:ne(8947848),strokeWidth:3,svgPath:\"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0\"})).states.create(\"hover\",{stroke:ne(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;!1!==e.accessible&&(e.focusable&&(this._inner.setAttribute(\"focusable\",\"true\"),this._inner.setAttribute(\"tabindex\",this.tabindex+\"\")),e.ariaLabel&&this._inner.setAttribute(\"aria-label\",e.ariaLabel));const t=this._renderer,i=this._getRealSize(),s=this._getCalculatedSize(i),r=Math.floor(s.width),a=Math.floor(s.height),n=Math.floor(i.width),o=Math.floor(i.height),l=se.new(this,{visible:!0,width:r,height:a});this._rootContainer=l,this._rootContainer._defaultThemes.push(ve.new(this));const h=l.children.push(se.new(this,{visible:!0,width:re,height:re}));this.container=h,t.resize(n,o,r,a),this._inner.appendChild(t.view),this._initResizeSensor();const u=document.createElement(\"div\");if(this._htmlElementContainer=u,u.className=\"am5-html-container\",u.style.position=\"absolute\",u.style.pointerEvents=\"none\",this._tooltipContainerSettings||(u.style.overflow=\"hidden\"),this._inner.appendChild(u),!0!==this._a11yD){const e=document.createElement(\"div\");e.className=\"am5-reader-container\",e.setAttribute(\"role\",\"alert\"),e.style.position=\"absolute\",e.style.width=\"1px\",e.style.height=\"1px\",e.style.overflow=\"hidden\",e.style.clip=\"rect(1px, 1px, 1px, 1px)\",this._readerAlertElement=e,this._inner.appendChild(this._readerAlertElement);const i=document.createElement(\"div\");i.className=\"am5-focus-container\",i.style.position=\"absolute\",i.style.pointerEvents=\"none\",i.style.top=\"0px\",i.style.left=\"0px\",i.style.overflow=\"hidden\",i.style.width=r+\"px\",i.style.height=a+\"px\",i.setAttribute(\"role\",\"graphics-document\"),q(i,!1),this._focusElementContainer=i,this._inner.appendChild(this._focusElementContainer);const s=document.createElement(\"div\");this._tooltipElementContainer=s,s.className=\"am5-tooltip-container\",this._inner.appendChild(s),E(\"keyboardevents\")&&(this._disposers.push(T(window,\"keydown\",(e=>{16==e.keyCode?this._isShift=!0:9==e.keyCode&&(this._isShift=e.shiftKey)}))),this._disposers.push(T(window,\"keyup\",(e=>{16==e.keyCode&&(this._isShift=!1)}))),this._disposers.push(T(i,\"click\",(()=>{const e=this._focusedSprite;if(e){const i=t.getEvent(new MouseEvent(\"click\"));e.events.dispatch(\"click\",{type:\"click\",originalEvent:i.event,point:i.point,simulated:!0,target:e})}}))),this._disposers.push(T(i,\"keydown\",(e=>{const i=this._focusedSprite;if(i){27==e.keyCode&&(le(),this._focusedSprite=void 0);let s=0,r=0;switch(e.keyCode){case 13:e.preventDefault();const a=t.getEvent(new MouseEvent(\"click\"));return void i.events.dispatch(\"click\",{type:\"click\",originalEvent:a.event,point:a.point,simulated:!0,target:i});case 37:s=-6;break;case 39:s=6;break;case 38:r=-6;break;case 40:r=6;break;default:return}if(0!=s||0!=r){if(e.preventDefault(),!i.isDragging()){this._keyboardDragPoint={x:0,y:0};const e=t.getEvent(new MouseEvent(\"mousedown\",{clientX:0,clientY:0}));i.events.isEnabled(\"pointerdown\")&&i.events.dispatch(\"pointerdown\",{type:\"pointerdown\",originalEvent:e.event,point:e.point,simulated:!0,target:i})}const a=this._keyboardDragPoint;a.x+=s,a.y+=r;const n=t.getEvent(new MouseEvent(\"mousemove\",{clientX:a.x,clientY:a.y}),!1);i.events.isEnabled(\"globalpointermove\")&&i.events.dispatch(\"globalpointermove\",{type:\"globalpointermove\",originalEvent:n.event,point:n.point,simulated:!0,target:i})}}}))),this._disposers.push(T(i,\"keyup\",(e=>{if(this._focusedSprite){const i=this._focusedSprite,s=e.keyCode;switch(s){case 37:case 39:case 38:case 40:if(i.isDragging()){const e=this._keyboardDragPoint,s=t.getEvent(new MouseEvent(\"mouseup\",{clientX:e.x,clientY:e.y}));return i.events.isEnabled(\"globalpointerup\")&&i.events.dispatch(\"globalpointerup\",{type:\"globalpointerup\",originalEvent:s.event,point:s.point,simulated:!0,target:i}),void(this._keyboardDragPoint=void 0)}if(i.get(\"focusableGroup\")){const e=i.get(\"focusableGroup\"),t=this._tabindexes.filter((t=>t.get(\"focusableGroup\")==e&&!1!==t.getPrivate(\"focusable\")));let r=t.indexOf(i);const a=t.length-1;r+=39==s||40==s?1:-1,r<0?r=a:r>a&&(r=0),he(t[r].getPrivate(\"focusElement\").dom)}}}}))))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Me(this.dom,(()=>{this.autoResize&&this.resize()})),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),s=Math.floor(t.height);if(i>0&&s>0){const t=Math.floor(e.width),r=Math.floor(e.height),a=this._htmlElementContainer;if(a.style.width=i+\"px\",a.style.height=s+\"px\",!0!==this._a11yD){const e=this._focusElementContainer;e.style.width=i+\"px\",e.style.height=s+\"px\"}this._renderer.resize(t,r,i,s);const n=this._rootContainer;n.setPrivate(\"width\",i),n.setPrivate(\"height\",s),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){t(this._tickers,(t=>{t(e)}))}_runAnimations(e){i(this._animations,(t=>t._runAnimation(e)))}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,ue(this._dirtyParents).forEach((t=>{const i=this._dirtyParents[t];delete this._dirtyParents[t],i.isDisposed()||(e[i.uid]=i,i._prepareChildren())}));ue(e).forEach((t=>{e[t]._updateChildren()}));const t=[];ue(this._dirty).forEach((e=>{const i=this._dirty[e];i.isDisposed()?delete this._dirty[i.uid]:(t.push(i),i._beforeChanged())})),t.forEach((e=>{e._changed(),delete this._dirty[e.uid],e._clearDirty()})),this._isDirty=!1;const i={},s=[];ue(this._dirtyBounds).forEach((e=>{const t=this._dirtyBounds[e];delete this._dirtyBounds[e],t.isDisposed()||(i[t.uid]=t.depth(),s.push(t))})),this._positionHTMLElements(),s.sort(((e,t)=>ce(i[t.uid],i[e.uid]))),s.forEach((e=>{e._updateBounds()}));const r=this._dirtyPositions;ue(r).forEach((e=>{const t=r[e];delete r[e],t.isDisposed()||t._updatePosition()})),t.forEach((e=>{e._afterChanged()}))}_renderFrame(e){return!this._updateTick||(this.events.isEnabled(\"framestarted\")&&this.events.dispatch(\"framestarted\",{type:\"framestarted\",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e),this._runAnimations(e),this._runDirties(),this._render(),this._positionHTMLElements(),this.events.isEnabled(\"frameended\")&&this.events.dispatch(\"frameended\",{type:\"frameended\",target:this,timestamp:e}),0===this._tickers.length&&0===this._animations.length&&!this._isDirty)}_runTicker(e,t){if(!this.isDisposed()){this.animationTime=e;this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Dt(this.fps,this._ticker))}}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const e=performance.now();if(e>=t){this.animationTime=null;break}this.animationTime=e;if(this._renderFrame(e)){this.animationTime=null;break}}}}_startTicker(){null===this._ticker&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Dt(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){void 0===this._dirty[e.uid]&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){void 0===this._dirtyParents[e.uid]&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){void 0===this._dirtyBounds[e.uid]&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){void 0===this._dirtyPositions[e.uid]&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){-1===this._animations.indexOf(e)&&(this._animations.push(e),this._startTicker())}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once(\"frameended\",(()=>{this._isDirty=!0,this._startTicker()}))}eachFrame(e){return this._tickers.push(e),this._startTicker(),new S((()=>{H(this._tickers,e)}))}markDirtyGlobal(e){e||(e=this.container),e.walkChildren((e=>{e instanceof se&&this.markDirtyGlobal(e),e.markDirty(),e.markDirtyBounds()}))}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),t(this._disposers,(e=>{e.dispose()})),this._inner&&de(this._inner),be(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){!0!==this._a11yD&&(this._readerAlertElement.innerHTML=fe(e))}setThemes(e){this._rootContainer.set(\"themes\",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(se.new(this,{position:\"absolute\",isMeasured:!1,width:re,height:re,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=ye.new(this,{});this.container.set(\"tooltip\",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){1!=this._a11yD&&(e.get(\"focusable\")?I(this._tabindexes,e):be(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){1!=this._a11yD&&(be(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(1==this._a11yD)return;this._tabindexes.sort(((e,t)=>{const i=e.get(\"tabindexOrder\",0),s=t.get(\"tabindexOrder\",0);return i==s?0:i>s?1:-1}));const e=[];t(this._tabindexes,((t,i)=>{t.getPrivate(\"focusElement\")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const s=t.get(\"focusableGroup\");s&&!1!==t.getPrivate(\"focusable\")&&(-1!==e.indexOf(s)?t.getPrivate(\"focusElement\").dom.setAttribute(\"tabindex\",\"-1\"):e.push(s))}))}_updateCurrentFocus(){1!=this._a11yD&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(1==this._a11yD)return;if(t||(t=e.getPrivate(\"focusElement\").dom),!t)return;const i=e.get(\"role\");i?t.setAttribute(\"role\",i):t.removeAttribute(\"role\");const s=e.get(\"ariaLabel\");if(s){const i=pe(e,s);t.setAttribute(\"aria-label\",i)}else t.removeAttribute(\"aria-label\");const r=e.get(\"ariaLive\");r?t.setAttribute(\"aria-live\",r):t.removeAttribute(\"aria-live\");const a=e.get(\"ariaChecked\");null!=a?t.setAttribute(\"aria-checked\",a?\"true\":\"false\"):t.removeAttribute(\"aria-checked\"),e.get(\"ariaHidden\")?t.setAttribute(\"aria-hidden\",\"true\"):t.removeAttribute(\"aria-hidden\");const n=e.get(\"ariaOrientation\");n?t.setAttribute(\"aria-orientation\",n):t.removeAttribute(\"aria-orientation\");const o=e.get(\"ariaValueNow\");o?t.setAttribute(\"aria-valuenow\",o):t.removeAttribute(\"aria-valuenow\");const l=e.get(\"ariaValueMin\");l?t.setAttribute(\"aria-valuemin\",l):t.removeAttribute(\"aria-valuemin\");const h=e.get(\"ariaValueMax\");h?t.setAttribute(\"aria-valuemax\",h):t.removeAttribute(\"aria-valuemax\");const u=e.get(\"ariaValueText\");u?t.setAttribute(\"aria-valuetext\",u):t.removeAttribute(\"aria-valuetext\");const c=e.get(\"ariaControls\");c?t.setAttribute(\"aria-controls\",c):t.removeAttribute(\"aria-controls\"),e.get(\"visible\")&&0!==e.get(\"opacity\")&&\"tooltip\"!=e.get(\"role\")&&!e.isHidden()&&!1!==e.getPrivate(\"focusable\")?(\"-1\"!=t.getAttribute(\"tabindex\")&&t.setAttribute(\"tabindex\",\"\"+this.tabindex),t.removeAttribute(\"aria-hidden\")):(t.removeAttribute(\"tabindex\"),t.setAttribute(\"aria-hidden\",\"true\"))}_makeFocusElement(e,t){if(t.getPrivate(\"focusElement\")||1==this._a11yD)return;const i=document.createElement(\"div\");\"tooltip\"!=t.get(\"role\")&&(i.tabIndex=this.tabindex),i.style.position=\"absolute\",q(i,!1);const s=[];t.setPrivate(\"focusElement\",{dom:i,disposers:s}),this._decorateFocusElement(t),s.push(T(i,\"focus\",(t=>{this._handleFocus(t,e)}))),s.push(T(i,\"blur\",(t=>{this._handleBlur(t,e)}))),this._moveFocusElement(e,t)}_removeFocusElement(e){if(1==this._a11yD)return;be(this._tabindexes,e);const i=e.getPrivate(\"focusElement\");if(i){this._focusElementContainer.removeChild(i.dom),t(i.disposers,(e=>{e.dispose()}))}}_hideFocusElement(e){if(1==this._a11yD)return;e.getPrivate(\"focusElement\").dom.style.display=\"none\"}_moveFocusElement(e,t){if(1==this._a11yD)return;const i=this._focusElementContainer,s=t.getPrivate(\"focusElement\").dom;if(s===this._focusElementContainer.children[e])return;const r=this._focusElementContainer.children[e+1];r?i.insertBefore(s,r):i.append(s)}_positionFocusElement(e){if(1==this._a11yD||null==e)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,s=t.top==t.bottom?e.height():t.bottom-t.top,r=t.left-2,a=t.top-2;i<0&&(r+=i,i=Math.abs(i)),s<0&&(a+=s,s=Math.abs(s));const n=e.getPrivate(\"focusElement\").dom;n.style.top=a+\"px\",n.style.left=r+\"px\",n.style.width=i+4+\"px\",n.style.height=s+4+\"px\"}_handleFocus(e,t){if(1==this._a11yD)return;const i=this._tabindexes[t];i.isVisibleDeep()?(this._positionFocusElement(i),this._focusedSprite=i,i.events.isEnabled(\"focus\")&&i.events.dispatch(\"focus\",{type:\"focus\",originalEvent:e,target:i})):this._focusNext(e.target,this._isShift?-1:1)}_focusNext(e,t){if(1==this._a11yD)return;const i=Array.from(document.querySelectorAll([\"a[href]\",\"area[href]\",\"button:not([disabled])\",\"details\",\"input:not([disabled])\",\"iframe:not([disabled])\",\"select:not([disabled])\",\"textarea:not([disabled])\",'[contentEditable=\"\"]','[contentEditable=\"true\"]','[contentEditable=\"TRUE\"]','[tabindex]:not([tabindex^=\"-\"])'].join(\",\")));let s=i.indexOf(e)+t;s<0?s=i.length-1:s>=i.length&&(s=0),i[s].focus()}_handleBlur(e,t){if(1==this._a11yD)return;const i=this._focusedSprite;i&&i.events.isEnabled(\"blur\")&&i.events.dispatch(\"blur\",{type:\"blur\",originalEvent:e,target:i}),this._focusedSprite=void 0}updateTooltip(e){if(1==this._a11yD)return;const t=fe(e._getText());let i=e.getPrivate(\"tooltipElement\");\"tooltip\"==e.get(\"role\")&&\"\"!=t?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t)):i&&(i.remove(),e.removePrivate(\"tooltipElement\"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement(\"div\");return i.style.position=\"absolute\",i.style.width=\"1px\",i.style.height=\"1px\",i.style.overflow=\"hidden\",i.style.clip=\"rect(1px, 1px, 1px, 1px)\",q(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate(\"tooltipElement\",i),i}_removeTooltipElement(e){if(1==this._a11yD)return;const t=e.getPrivate(\"tooltipElement\");if(t){const e=t.parentElement;e&&e.removeChild(t)}}_invalidateAccessibility(e){if(1==this._a11yD)return;this._focusElementDirty=!0;const t=e.getPrivate(\"focusElement\");e.get(\"focusable\")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),s=i.width/t.width,r=i.height/t.height;return{x:(e.x-t.left)*s,y:(e.y-t.top)*r}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),s=i.width/t.width,r=i.height/t.height;return{x:e.x/s+t.left,y:e.y/r+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t=\"\";u(e,((e,i)=>{r(e)&&e.match(/^font/)&&(t+=i)}));const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof se?e.children.each((e=>{this._invalidateLabelBounds(e)})):e instanceof ge&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const i=this._renderer.getEvent(t);e.events.dispatch(\"click\",{type:\"click\",originalEvent:i.event,point:i.point,simulated:!1,target:e})})))),this._positionHTMLElement(e),t.append(i),I(this._htmlEnabledContainers,e),i}_positionHTMLElements(){t(this._htmlEnabledContainers,(e=>{this._positionHTMLElement(e)}))}_positionHTMLElement(e){const i=e.getPrivate(\"htmlElement\");if(i){t([\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\",\"minWidth\",\"minHeight\",\"maxWidth\",\"maxHeight\"],(t=>{const s=e.get(t);i.style[t]=s?s+\"px\":\"\"}));const s=e.compositeOpacity();setTimeout((()=>{i.style.opacity=s+\"\"}),10);const r=e.isVisibleDeep();r&&(i.style.display=\"block\");const a=e.globalBounds();i.style.top=a.top+\"px\",i.style.left=a.left+\"px\";const n=e.get(\"width\"),o=e.get(\"height\");let l=0,h=0;if(n&&(l=e.width()),o&&(h=e.height()),n&&o)e.removePrivate(\"minWidth\"),e.removePrivate(\"minHeight\");else{i.style.position=\"fixed\",i.style.width=\"\",i.style.height=\"\";const t=i.getBoundingClientRect();i.style.position=\"absolute\",l=t.width,h=t.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate(\"minWidth\",l),e.setPrivate(\"minHeight\",h)}l>0&&(i.style.minWidth=l+\"px\"),h>0&&(i.style.minHeight=h+\"px\"),r&&0!=s||(i.style.display=\"none\")}}_setHTMLContent(e,t){let i=e.getPrivate(\"htmlElement\");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate(\"htmlElement\");t&&this._htmlElementContainer.removeChild(t),be(this._htmlEnabledContainers,e)}}_e(\"AM5C241025748\");const Lt=\"en-us\",zt=new Map([[\"ar\",()=>import(\"./ar.js\")],[\"bg-bg\",()=>import(\"./bg_BG.js\")],[\"bs-ba\",()=>import(\"./bs_BA.js\")],[\"ca-es\",()=>import(\"./ca_ES.js\")],[\"cs-cz\",()=>import(\"./cs_CZ.js\")],[\"da-dk\",()=>import(\"./da_DK.js\")],[\"de-de\",()=>import(\"./de_DE.js\")],[\"de-ch\",()=>import(\"./de_CH.js\")],[\"el-gr\",()=>import(\"./el_GR.js\")],[\"en-us\",()=>import(\"./en_US.js\")],[\"en-ca\",()=>import(\"./en_CA.js\")],[\"es-es\",()=>import(\"./es_ES.js\")],[\"et-ee\",()=>import(\"./et_EE.js\")],[\"fi-fi\",()=>import(\"./fi_FI.js\")],[\"fr-fr\",()=>import(\"./fr_FR.js\")],[\"he-il\",()=>import(\"./he_IL.js\")],[\"hr-hr\",()=>import(\"./hr_HR.js\")],[\"hu-hu\",()=>import(\"./hu_HU.js\")],[\"id-id\",()=>import(\"./id_ID.js\")],[\"it-it\",()=>import(\"./it_IT.js\")],[\"ja-jp\",()=>import(\"./ja_JP.js\")],[\"ko-kr\",()=>import(\"./ko_KR.js\")],[\"lt-lt\",()=>import(\"./lt_LT.js\")],[\"lv-lv\",()=>import(\"./lv_LV.js\")],[\"nb-no\",()=>import(\"./nb_NO.js\")],[\"nl-nl\",()=>import(\"./nl_NL.js\")],[\"pl-pl\",()=>import(\"./pl_PL.js\")],[\"pt-br\",()=>import(\"./pt_BR.js\")],[\"pt-pt\",()=>import(\"./pt_PT.js\")],[\"ro-ro\",()=>import(\"./ro_RO.js\")],[\"ru-ru\",()=>import(\"./ru_RU.js\")],[\"sk-sk\",()=>import(\"./sk_SK.js\")],[\"sl-sl\",()=>import(\"./sl_SL.js\")],[\"sr-rs\",()=>import(\"./sr_RS.js\")],[\"sv-se\",()=>import(\"./sv_SE.js\")],[\"th-th\",()=>import(\"./th_TH.js\")],[\"tr-tr\",()=>import(\"./tr_TR.js\")],[\"uk-ua\",()=>import(\"./uk_UA.js\")],[\"vi-vn\",()=>import(\"./vi_VN.js\")],[\"zh-cn\",()=>import(\"./zh_Hans.js\")],[\"zh-hk\",()=>import(\"./zh_Hant.js\")],[\"zh-tw\",()=>import(\"./zh_Hant.js\")]]);function Ft(e){const t=e.split(\"-\")[0].toLowerCase();let i=null;for(const s of zt.keys())if(s.startsWith(t)){i=s;break}return i}function Ht(e){return e?zt.has(e.toLowerCase())?e.toLowerCase():Ft(e)||Lt:Lt}async function Yt(e,t=we()){const i=At.new(e);return i.locale=(await zt.get(Ht(t))()).default,i}export{Se as N,Yt as c};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{am as e,C as t,M as i,ad as a,a4 as n,R as r}from\"./Theme.js\";class s extends e{setupDefaultRules(){super.setupDefaultRules(),this.rule(\"InterfaceColors\").setAll({stroke:t.fromHex(0),fill:t.fromHex(2829099),primaryButton:t.lighten(t.fromHex(6788316),-.2),primaryButtonHover:t.lighten(t.fromHex(6779356),-.2),primaryButtonDown:t.lighten(t.fromHex(6872181),-.2),primaryButtonActive:t.lighten(t.fromHex(6872182),-.2),primaryButtonText:t.fromHex(16777215),primaryButtonStroke:t.lighten(t.fromHex(6788316),-.2),secondaryButton:t.fromHex(3881787),secondaryButtonHover:t.lighten(t.fromHex(3881787),.1),secondaryButtonDown:t.lighten(t.fromHex(3881787),.15),secondaryButtonActive:t.lighten(t.fromHex(3881787),.2),secondaryButtonText:t.fromHex(12303291),secondaryButtonStroke:t.lighten(t.fromHex(3881787),-.2),grid:t.fromHex(12303291),background:t.fromHex(0),alternativeBackground:t.fromHex(16777215),text:t.fromHex(16777215),alternativeText:t.fromHex(0),disabled:t.fromHex(11382189),positive:t.fromHex(5288704),negative:t.fromHex(11730944)})}}const l=s;class o extends e{constructor(){super(...arguments),Object.defineProperty(this,\"responsiveRules\",{enumerable:!0,configurable:!0,writable:!0,value:[]})}static widthXXS(e,t){return e<=o.XXS}static widthXS(e,t){return e<=o.XS}static widthS(e,t){return e<=o.S}static widthM(e,t){return e<=o.M}static widthL(e,t){return e<=o.L}static widthXL(e,t){return e<=o.XL}static widthXXL(e,t){return e<=o.XXL}static heightXXS(e,t){return t<=o.XXS}static heightXS(e,t){return t<=o.XS}static heightS(e,t){return t<=o.S}static heightM(e,t){return t<=o.M}static heightL(e,t){return t<=o.L}static heightXL(e,t){return t<=o.XL}static heightXXL(e,t){return t<=o.XXL}static isXXS(e,t){return e<=o.XXS&&t<=o.XXS}static isXS(e,t){return e<=o.XS&&t<=o.XS}static isS(e,t){return e<=o.S&&t<=o.S}static isM(e,t){return e<=o.M&&t<=o.M}static isL(e,t){return e<=o.L&&t<=o.L}static isXL(e,t){return e<=o.XL&&t<=o.XL}static isXXL(e,t){return e<=o.XXL&&t<=o.XXL}static maybeXXS(e,t){return e<=o.XXS||t<=o.XXS}static maybeXS(e,t){return e<=o.XS||t<=o.XS}static maybeS(e,t){return e<=o.S||t<=o.S}static maybeM(e,t){return e<=o.M||t<=o.M}static maybeL(e,t){return e<=o.L||t<=o.L}static maybeXL(e,t){return e<=o.XL||t<=o.XL}static maybeXXL(e,t){return e<=o.XXL||t<=o.XXL}static newEmpty(e){return new this(e,!0)}addRule(e){return e.name&&!e.template&&(e.template=this.rule(e.name,e.tags)),e._dp=new i([this._root._rootContainer.onPrivate(\"width\",(t=>{this._isUsed()&&this._applyRule(e)})),this._root._rootContainer.onPrivate(\"height\",(t=>{this._isUsed()&&this._applyRule(e)}))]),this.responsiveRules.push(e),this._applyRule(e),e}removeRule(e){a(this.responsiveRules,e),e._dp&&e._dp.dispose()}_isUsed(){return-1!==this._root._rootContainer.get(\"themes\").indexOf(this)}_applyRule(e){const t=this._root._rootContainer.getPrivate(\"width\"),i=this._root._rootContainer.getPrivate(\"height\"),a=e.relevant.call(e,t,i),n=e.applied;a?n||(e.applied=!0,e.template&&e.settings&&e.template.setAll(e.settings),e.applying&&e.applying.call(e)):n&&(e.applied=!1,e.template&&e.template.removeAll(),e.removing&&e.removing.call(e))}setupDefaultRules(){super.setupDefaultRules();const e=e=>this.addRule(e);e({name:\"Chart\",relevant:o.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),e({name:\"Chart\",relevant:o.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),e({name:\"Bullet\",relevant:o.isXS,settings:{forceHidden:!0}}),e({name:\"Legend\",relevant:o.isXS,settings:{forceHidden:!0}}),e({name:\"HeatLegend\",tags:[\"vertical\"],relevant:o.widthXS,settings:{forceHidden:!0}}),e({name:\"HeatLegend\",tags:[\"horizontal\"],relevant:o.heightXS,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"heatlegend\",\"start\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"heatlegend\",\"end\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"Button\",tags:[\"resize\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"AxisRendererX\",relevant:o.heightXS,settings:{inside:!0}}),e({name:\"AxisRendererY\",relevant:o.widthXS,settings:{inside:!0}}),e({name:\"AxisRendererXLabel\",relevant:o.heightXS,settings:{minPosition:.1,maxPosition:.9}}),e({name:\"AxisLabel\",tags:[\"y\"],relevant:o.widthXS,settings:{centerY:n,maxPosition:.9}}),e({name:\"AxisLabel\",tags:[\"x\"],relevant:o.heightXXS,settings:{forceHidden:!0}}),e({name:\"AxisLabel\",tags:[\"y\"],relevant:o.widthXXS,settings:{forceHidden:!0}}),e({name:\"AxisTick\",tags:[\"x\"],relevant:o.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),e({name:\"AxisTick\",tags:[\"y\"],relevant:o.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),e({name:\"Grid\",relevant:o.maybeXXS,settings:{forceHidden:!0}}),e({name:\"RadialLabel\",tags:[\"radial\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"RadialLabel\",tags:[\"circular\"],relevant:o.maybeS,settings:{inside:!0}}),e({name:\"AxisTick\",relevant:o.maybeS,settings:{inside:!0}}),e({name:\"RadialLabel\",tags:[\"circular\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"AxisTick\",tags:[\"circular\"],relevant:o.maybeXS,settings:{inside:!0}}),e({name:\"PieChart\",relevant:o.maybeXS,settings:{radius:r(99)}}),e({name:\"PieChart\",relevant:o.widthM,settings:{radius:r(99)}}),e({name:\"RadialLabel\",tags:[\"pie\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"RadialLabel\",tags:[\"pie\"],relevant:o.widthM,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"pie\"],relevant:o.maybeXS,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"pie\"],relevant:o.widthM,settings:{forceHidden:!0}}),e({name:\"FunnelSeries\",relevant:o.widthM,settings:{alignLabels:!1}}),e({name:\"Label\",tags:[\"funnel\",\"vertical\"],relevant:o.widthL,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"funnel\",\"vertical\"],relevant:o.widthL,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"funnel\",\"horizontal\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"funnel\",\"horizontal\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"PyramidSeries\",relevant:o.widthM,settings:{alignLabels:!1}}),e({name:\"Label\",tags:[\"pyramid\",\"vertical\"],relevant:o.widthL,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"pyramid\",\"vertical\"],relevant:o.widthL,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"pyramid\",\"horizontal\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"pyramid\",\"horizontal\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"PictorialStackedSeries\",relevant:o.widthM,settings:{alignLabels:!1}}),e({name:\"Label\",tags:[\"pictorial\",\"vertical\"],relevant:o.widthL,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"pictorial\",\"vertical\"],relevant:o.widthL,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"pictorial\",\"horizontal\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"Tick\",tags:[\"pictorial\",\"horizontal\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"flow\",\"horizontal\"],relevant:o.widthS,settings:{forceHidden:!0}}),e({name:\"Label\",tags:[\"flow\",\"vertical\"],relevant:o.heightS,settings:{forceHidden:!0}}),e({name:\"Chord\",relevant:o.maybeXS,settings:{radius:r(99)}}),e({name:\"Label\",tags:[\"hierarchy\",\"node\"],relevant:o.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(o,\"XXS\",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(o,\"XS\",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(o,\"S\",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(o,\"M\",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(o,\"L\",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(o,\"XL\",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(o,\"XXL\",{enumerable:!0,configurable:!0,writable:!0,value:1e3});const d=o;export{l as d,d as r};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{a5 as e,g as s,az as t,aj as i,a3 as a,ak as r}from\"./Theme.js\";class n extends e{_beforeChanged(){super._beforeChanged(),(this.isDirty(\"cornerRadiusTL\")||this.isDirty(\"cornerRadiusTR\")||this.isDirty(\"cornerRadiusBR\")||this.isDirty(\"cornerRadiusBL\"))&&(this._clear=!0)}_draw(){let e=this.width(),a=this.height(),r=e,n=a,o=r/Math.abs(e),h=n/Math.abs(a);if(s(r)&&s(n)){let e=Math.min(r,n)/2,s=t(this.get(\"cornerRadiusTL\",8),e),a=t(this.get(\"cornerRadiusTR\",8),e),c=t(this.get(\"cornerRadiusBR\",8),e),l=t(this.get(\"cornerRadiusBL\",8),e),d=Math.min(Math.abs(r/2),Math.abs(n/2));s=i(s,0,d),a=i(a,0,d),c=i(c,0,d),l=i(l,0,d);const b=this._display;b.moveTo(s*o,0),b.lineTo(r-a*o,0),a>0&&b.arcTo(r,0,r,a*h,a),b.lineTo(r,n-c*h),c>0&&b.arcTo(r,n,r-c*o,n,c),b.lineTo(l*o,n),l>0&&b.arcTo(0,n,0,n-l*h,l),b.lineTo(0,s*h),s>0&&b.arcTo(0,0,s*o,0,s),b.closePath()}}}Object.defineProperty(n,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"RoundedRectangle\"}),Object.defineProperty(n,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:e.classNames.concat([n.className])});class o extends a{_afterNew(){this._settings.themeTags=r(this._settings.themeTags,[\"button\"]),super._afterNew(),this._settings.background||this.set(\"background\",n.new(this._root,{themeTags:r(this._settings.themeTags,[\"background\"])}))}_prepareChildren(){if(super._prepareChildren(),this.isDirty(\"icon\")){const e=this._prevSettings.icon,s=this.get(\"icon\");s!==e&&(this._disposeProperty(\"icon\"),e&&e.dispose(),s&&this.children.push(s),this._prevSettings.icon=s)}if(this.isDirty(\"label\")){const e=this._prevSettings.label,s=this.get(\"label\");s!==e&&(this._disposeProperty(\"label\"),e&&e.dispose(),s&&this.children.push(s),this._prevSettings.label=s)}}}Object.defineProperty(o,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Button\"}),Object.defineProperty(o,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:a.classNames.concat([o.className])});export{o as B,n as R};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{E as e,C as t}from\"./Theme.js\";class s extends e{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty(\"colors\")&&this.reset()}generateColors(){this.setPrivate(\"currentPass\",this.getPrivate(\"currentPass\",0)+1);const e=this.getPrivate(\"currentPass\"),s=this.get(\"colors\",[this.get(\"baseColor\",t.fromHex(16711680))]);this.getPrivate(\"numColors\")||this.setPrivate(\"numColors\",s.length);const r=this.getPrivate(\"numColors\"),a=0,i=this.get(\"passOptions\"),o=this.get(\"reuse\");for(let n=a;n1;)a-=1;let o=r.s+(i.saturation||0)*e;o>1&&(o=1),o<0&&(o=0);let l=r.l+(i.lightness||0)*e;for(;l>1;)l-=1;s.push(t.fromHSL(a,o,l))}}getIndex(e){const s=this.get(\"colors\",[]),r=this.get(\"saturation\");return e>=s.length?(this.generateColors(),this.getIndex(e)):null!=r?t.saturate(s[e],r):s[e]}next(){let e=this.getPrivate(\"currentStep\",this.get(\"startIndex\",0));return this.setPrivate(\"currentStep\",e+this.get(\"step\",1)),this.getIndex(e)}reset(){this.setPrivate(\"currentStep\",this.get(\"startIndex\",0)),this.setPrivate(\"currentPass\",0)}}Object.defineProperty(s,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"ColorSet\"}),Object.defineProperty(s,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:e.classNames.concat([s.className])});export{s as C};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{a3 as t,ak as s,a7 as e,at as i,g as a,am as h,a6 as n}from\"../../../chunks/Theme.js\";export{d as DarkThemeAm5,r as ResponsiveThemeAm5}from\"../../../chunks/Responsive.js\";import{R as o,B as u}from\"../../../chunks/Button.js\";export{T as TooltipAm5}from\"../../../chunks/Tooltip.js\";export{C as ColorSetAm5}from\"../../../chunks/ColorSet.js\";class p extends t{constructor(){super(...arguments),Object.defineProperty(this,\"thumb\",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,\"startGrip\",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,\"endGrip\",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,\"_thumbBusy\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_startDown\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_endDown\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_thumbDown\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_gripDown\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=s(this._settings.themeTags,[\"scrollbar\",this._settings.orientation]),this._settings.background||(this._settings.background=o.new(this._root,{themeTags:s(this._settings.themeTags,[\"main\",\"background\"])}))}_makeButton(){return this.children.push(u.new(this._root,{themeTags:[\"resize\",\"button\",this.get(\"orientation\")],icon:e.new(this._root,{themeTags:[\"icon\"]})}))}_makeThumb(){return this.children.push(o.new(this._root,{themeTags:[\"thumb\",this.get(\"orientation\")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on(\"stopped\",(()=>{this.setPrivateRaw(\"isBusy\",!1),this._thumbBusy=!1})))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,s=this.endGrip,e=this.thumb,a=this.get(\"background\");a&&this._disposers.push(a.events.on(\"click\",(t=>{this.setPrivateRaw(\"isBusy\",!0);const s=this._display.toLocal(t.point),i=this.width(),a=this.height(),h=this.get(\"orientation\");let r,n,o;r=\"vertical\"==h?(s.y-e.height()/2)/a:(s.x-e.width()/2)/i,\"vertical\"==h?(n=r*a,o=\"y\"):(n=r*i,o=\"x\");const u=this.get(\"animationDuration\",0);u>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:o,to:n,duration:u,easing:this.get(\"animationEasing\")}))):(this.thumb.set(o,n),this._root.events.once(\"frameended\",(()=>{this.setPrivateRaw(\"isBusy\",!1)})))}))),this._disposers.push(e.events.on(\"dblclick\",(t=>{if(!i(t.originalEvent,this))return;const s=this.get(\"animationDuration\",0),e=this.get(\"animationEasing\");this.animate({key:\"start\",to:0,duration:s,easing:e}),this.animate({key:\"end\",to:1,duration:s,easing:e})}))),this._disposers.push(t.events.on(\"pointerdown\",(()=>{this.setPrivateRaw(\"isBusy\",!0),this._startDown=!0,this._gripDown=\"start\"}))),this._disposers.push(s.events.on(\"pointerdown\",(()=>{this.setPrivateRaw(\"isBusy\",!0),this._endDown=!0,this._gripDown=\"end\"}))),this._disposers.push(e.events.on(\"pointerdown\",(()=>{this.setPrivateRaw(\"isBusy\",!0),this._thumbDown=!0,this._gripDown=void 0}))),this._disposers.push(t.events.on(\"globalpointerup\",(()=>{this._startDown&&this.setPrivateRaw(\"isBusy\",!1),this._startDown=!1}))),this._disposers.push(s.events.on(\"globalpointerup\",(()=>{this._endDown&&this.setPrivateRaw(\"isBusy\",!1),this._endDown=!1}))),this._disposers.push(e.events.on(\"globalpointerup\",(()=>{this._thumbDown&&this.setPrivateRaw(\"isBusy\",!1),this._thumbDown=!1}))),this._disposers.push(t.on(\"x\",(()=>{this._updateThumb()}))),this._disposers.push(s.on(\"x\",(()=>{this._updateThumb()}))),this._disposers.push(t.on(\"y\",(()=>{this._updateThumb()}))),this._disposers.push(s.on(\"y\",(()=>{this._updateThumb()}))),this._disposers.push(e.events.on(\"positionchanged\",(()=>{this._updateGripsByThumb()}))),\"vertical\"==this.get(\"orientation\")?(t.set(\"x\",0),s.set(\"x\",0),this._disposers.push(e.adapters.add(\"y\",(t=>Math.max(Math.min(Number(t),this.height()-e.height()),0)))),this._disposers.push(e.adapters.add(\"x\",(t=>this.width()/2))),this._disposers.push(t.adapters.add(\"x\",(t=>this.width()/2))),this._disposers.push(s.adapters.add(\"x\",(t=>this.width()/2))),this._disposers.push(t.adapters.add(\"y\",(t=>Math.max(Math.min(Number(t),this.height()),0)))),this._disposers.push(s.adapters.add(\"y\",(t=>Math.max(Math.min(Number(t),this.height()),0))))):(t.set(\"y\",0),s.set(\"y\",0),this._disposers.push(e.adapters.add(\"x\",(t=>Math.max(Math.min(Number(t),this.width()-e.width()),0)))),this._disposers.push(e.adapters.add(\"y\",(t=>this.height()/2))),this._disposers.push(t.adapters.add(\"y\",(t=>this.height()/2))),this._disposers.push(s.adapters.add(\"y\",(t=>this.height()/2))),this._disposers.push(t.adapters.add(\"x\",(t=>Math.max(Math.min(Number(t),this.width()),0)))),this._disposers.push(s.adapters.add(\"x\",(t=>Math.max(Math.min(Number(t),this.width()),0)))))}_updateChildren(){super._updateChildren(),(this.isDirty(\"end\")||this.isDirty(\"start\")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty(\"start\")||this.isDirty(\"end\")){const t=\"rangechanged\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get(\"start\",0),end:this.get(\"end\",1),grip:this._gripDown})}}updateGrips(){const t=this.startGrip,s=this.endGrip,e=this.get(\"orientation\"),i=this.height(),a=this.width();\"vertical\"==e?(t.set(\"y\",i*this.get(\"start\",0)),s.set(\"y\",i*this.get(\"end\",1))):(t.set(\"x\",a*this.get(\"start\",0)),s.set(\"x\",a*this.get(\"end\",1)));const h=this.getPrivate(\"positionTextFunction\"),r=Math.round(100*this.get(\"start\",0)),n=Math.round(100*this.get(\"end\",0));let o,u;h?(o=h.call(this,this.get(\"start\",0)),u=h.call(this,this.get(\"end\",0))):(o=r+\"%\",u=n+\"%\"),t.set(\"ariaLabel\",this._t(\"From %1\",void 0,o)),t.set(\"ariaValueNow\",\"\"+r),t.set(\"ariaValueText\",r+\"%\"),t.set(\"ariaValueMin\",\"0\"),t.set(\"ariaValueMax\",\"100\"),s.set(\"ariaLabel\",this._t(\"To %1\",void 0,u)),s.set(\"ariaValueNow\",\"\"+n),s.set(\"ariaValueText\",n+\"%\"),s.set(\"ariaValueMin\",\"0\"),s.set(\"ariaValueMax\",\"100\")}_updateThumb(){const t=this.thumb,s=this.startGrip,e=this.endGrip,i=this.height(),h=this.width();let r=s.x(),n=e.x(),o=s.y(),u=e.y(),d=0,p=1;\"vertical\"==this.get(\"orientation\")?a(o)&&a(u)&&(this._thumbBusy||t.isDragging()||(t.set(\"height\",u-o),t.set(\"y\",o)),d=o/i,p=u/i):a(r)&&a(n)&&(this._thumbBusy||t.isDragging()||(t.set(\"width\",n-r),t.set(\"x\",r)),d=r/h,p=n/h),!this.getPrivate(\"isBusy\")||this.get(\"start\")==d&&this.get(\"end\")==p||(this.set(\"start\",d),this.set(\"end\",p));const l=this.getPrivate(\"positionTextFunction\"),m=Math.round(100*this.get(\"start\",0)),g=Math.round(100*this.get(\"end\",0));let b,c;l?(b=l.call(this,this.get(\"start\",0)),c=l.call(this,this.get(\"end\",0))):(b=m+\"%\",c=g+\"%\"),t.set(\"ariaLabel\",this._t(\"From %1 to %2\",void 0,b,c)),t.set(\"ariaValueNow\",\"\"+m),t.set(\"ariaValueText\",m+\"%\")}_updateGripsByThumb(){const t=this.thumb,s=this.startGrip,e=this.endGrip;if(\"vertical\"==this.get(\"orientation\")){const i=t.height();s.set(\"y\",t.y()),e.set(\"y\",t.y()+i)}else{const i=t.width();s.set(\"x\",t.x()),e.set(\"x\",t.x()+i)}}}Object.defineProperty(p,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Scrollbar\"}),Object.defineProperty(p,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:t.classNames.concat([p.className])});const l=class extends h{setupDefaultRules(){super.setupDefaultRules(),this.rule(\"Component\").setAll({interpolationDuration:600}),this.rule(\"Hierarchy\").set(\"animationDuration\",600),this.rule(\"Scrollbar\").set(\"animationDuration\",600),this.rule(\"Tooltip\").set(\"animationDuration\",300),this.rule(\"MapChart\").set(\"animationDuration\",1e3),this.rule(\"MapChart\").set(\"wheelDuration\",300),this.rule(\"Entity\").setAll({stateAnimationDuration:600}),this.rule(\"Sprite\").states.create(\"default\",{stateAnimationDuration:600}),this.rule(\"Tooltip\",[\"axis\"]).setAll({animationDuration:200}),this.rule(\"WordCloud\").set(\"animationDuration\",500),this.rule(\"Polygon\").set(\"animationDuration\",600),this.rule(\"ArcDiagram\").set(\"animationDuration\",600)}},m=[\"#2888B8\",\"#EB7028\",\"#48A375\",\"#9370B1\",\"#e55035\",\"#3d9ccc\",\"#DC7B04\",\"#b87bb0\",\"#3fa681\",\"#EE6386\"].map((t=>n(t)));export{l as AnimatedThemeAm5,p as ScrollbarAm5,h as ThemeAm5,n as colorAm5,m as esriChartColorSet};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{a as e}from\"./tslib.es6.js\";import{ax as t,aG as s,a3 as i,e as a,aa as l,g as r,a4 as n,aH as o,C as h,Q as u,aI as d,al as c,x as m,a7 as p,as as b}from\"./Theme.js\";class f extends t{constructor(){super(...arguments),Object.defineProperty(this,\"processor\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class g extends s{constructor(e,t,s){super(s),Object.defineProperty(this,\"component\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"dataContext\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"bullets\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"open\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"close\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw(\"visible\",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw(\"visible\",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get(\"visible\")}}class _ extends i{constructor(){super(...arguments),Object.defineProperty(this,\"_data\",{enumerable:!0,configurable:!0,writable:!0,value:new f}),Object.defineProperty(this,\"_dataItems\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_mainDataItems\",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,\"valueFields\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"fields\",{enumerable:!0,configurable:!0,writable:!0,value:[\"id\"]}),Object.defineProperty(this,\"_valueFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_valueFieldsF\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_fields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_fieldsF\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_valuesDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dataChanged\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dataGrouped\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"inited\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll((e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,\"clear\"===e.type)a(t,(e=>{e.dispose()})),t.length=0,this._onDataClear();else if(\"push\"===e.type){const s=new g(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(\"setIndex\"===e.type){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&0==s.bullets.length&&(s.bullets=void 0),l(i).forEach((e=>{s.animate({key:e,to:i[e],duration:this.get(\"interpolationDuration\",0),easing:this.get(\"interpolationEasing\")})})),s.dataContext=e.newValue}else if(\"insertIndex\"===e.type){const s=new g(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(\"removeIndex\"===e.type){t[e.index].dispose(),t.splice(e.index,1)}else{if(\"moveIndex\"!==e.type)throw new Error(\"Unknown IStreamEvent type\");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()})))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},a(this.valueFields,(e=>{this.get(e+\"Field\")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+\"Field\",workingKey:e+\"Working\"})}))),this.fields&&(this._fields=[],this._fieldsF={},a(this.fields,(e=>{this.get(e+\"Field\")&&(this._fields.push(e),this._fieldsF[e]=e+\"Field\")})))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&a(this._valueFields,(s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]})),this._fields&&a(this._fields,(s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]})),t}makeDataItem(e){let t=new g(this,void 0,e);return this.processDataItem(t),t}pushDataItem(e){const t=this.makeDataItem(e);return this._mainDataItems.push(t),t}disposeDataItem(e){}showDataItem(t,s){return e(this,void 0,void 0,(function*(){t.set(\"visible\",!0)}))}hideDataItem(t,s){return e(this,void 0,void 0,(function*(){t.set(\"visible\",!1)}))}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e=\"datavalidated\";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function v(e){return new Promise(((t,s)=>{setTimeout(t,e)}))}Object.defineProperty(_,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Component\"}),Object.defineProperty(_,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:i.classNames.concat([_.className])});let y={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function w(e,t){return null==t&&(t=1),y[e]*t}function I(e,t,s,i,a,l,n){if(!n||a){let n=0;switch(a||\"millisecond\"==t||(n=e.getTimezoneOffset(),e.setUTCMinutes(e.getUTCMinutes()-n)),t){case\"day\":let t=e.getUTCDate();if(s>1){if(l){l=I(l,\"day\",1);let t=e.getTime()-l.getTime(),i=Math.floor(t/w(\"day\")/s),a=w(\"day\",i*s);e.setTime(l.getTime()+a-n*w(\"minute\"))}}else e.setUTCDate(t);e.setUTCHours(0,0,0,0);break;case\"second\":let a=e.getUTCSeconds();s>1&&(a=Math.floor(a/s)*s),e.setUTCSeconds(a,0);break;case\"millisecond\":if(1==s)return e;let o=e.getUTCMilliseconds();o=Math.floor(o/s)*s,e.setUTCMilliseconds(o);break;case\"hour\":let h=e.getUTCHours();s>1&&(h=Math.floor(h/s)*s),e.setUTCHours(h,0,0,0);break;case\"minute\":let u=e.getUTCMinutes();s>1&&(u=Math.floor(u/s)*s),e.setUTCMinutes(u,0,0);break;case\"month\":let d=e.getUTCMonth();s>1&&(d=Math.floor(d/s)*s),e.setUTCMonth(d,1),e.setUTCHours(0,0,0,0);break;case\"year\":let c=e.getUTCFullYear();s>1&&(c=Math.floor(c/s)*s),e.setUTCFullYear(c,0,1),e.setUTCHours(0,0,0,0);break;case\"week\":let m=e.getUTCDate(),p=e.getUTCDay();r(i)||(i=1),m=p>=i?m-p+i:m-(7+p)+i,e.setUTCDate(m),e.setUTCHours(0,0,0,0)}if(!a&&\"millisecond\"!=t&&(e.setUTCMinutes(e.getUTCMinutes()+n),\"day\"==t||\"week\"==t||\"month\"==t||\"year\"==t)){let t=e.getTimezoneOffset();if(t!=n){let s=t-n;e.setUTCMinutes(e.getUTCMinutes()+s)}}return e}{if(isNaN(e.getTime()))return e;let o=n.offsetUTC(e),h=e.getTimezoneOffset(),u=n.parseDate(e),d=u.year,c=u.month,m=u.day,p=u.hour,b=u.minute,f=u.second,g=u.millisecond,_=u.weekday;switch(t){case\"day\":if(s>1&&l){l=I(l,\"day\",1,i,a,void 0,n);let t=e.getTime()-l.getTime(),r=Math.floor(t/w(\"day\")/s),o=w(\"day\",r*s);e.setTime(l.getTime()+o),u=n.parseDate(e),d=u.year,c=u.month,m=u.day}p=0,b=o-h,f=0,g=0;break;case\"second\":b+=o-h,s>1&&(f=Math.floor(f/s)*s),g=0;break;case\"millisecond\":b+=o-h,s>1&&(g=Math.floor(g/s)*s);break;case\"hour\":s>1&&(p=Math.floor(p/s)*s),b=o-h,f=0,g=0;break;case\"minute\":s>1&&(b=Math.floor(b/s)*s),b+=o-h,f=0,g=0;break;case\"month\":s>1&&(c=Math.floor(c/s)*s),m=1,p=0,b=o-h,f=0,g=0;break;case\"year\":s>1&&(d=Math.floor(d/s)*s),c=0,m=1,p=0,b=o-h,f=0,g=0;break;case\"week\":r(i)||(i=1),m=_>=i?m-_+i:m-(7+_)+i,p=0,b=o-h,f=0,g=0}let v=(e=new Date(d,c,m,p,b,f,g)).getTimezoneOffset();return v!=h&&e.setTime(e.getTime()+6e4*(h-v)),e}}class D extends _{constructor(){super(...arguments),Object.defineProperty(this,\"_aggregatesCalculated\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_selectionAggregatesCalculated\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dataProcessed\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_psi\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_pei\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"chart\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"bullets\",{enumerable:!0,configurable:!0,writable:!0,value:new t}),Object.defineProperty(this,\"bulletsContainer\",{enumerable:!0,configurable:!0,writable:!0,value:i.new(this._root,{width:n,height:n,position:\"absolute\"})})}_afterNew(){this.valueFields.push(\"value\"),super._afterNew(),this.setPrivate(\"customData\",{}),this._disposers.push(this.bullets.events.onAll((e=>{if(\"clear\"===e.type)this._handleBullets(this.dataItems);else if(\"push\"===e.type)this._handleBullets(this.dataItems);else if(\"setIndex\"===e.type)this._handleBullets(this.dataItems);else if(\"insertIndex\"===e.type)this._handleBullets(this.dataItems);else if(\"removeIndex\"===e.type)this._handleBullets(this.dataItems);else{if(\"moveIndex\"!==e.type)throw new Error(\"Unknown IListEvent type\");this._handleBullets(this.dataItems)}})))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate(\"startIndex\",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate(\"endIndex\",e),e)}_handleBullets(e){a(e,(e=>{const t=e.bullets;t&&(a(t,(e=>{e.dispose()})),e.bullets=void 0)})),this.markDirtyValues()}getDataItemById(e){return o(this.dataItems,(t=>t.get(\"id\")==e))}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each((t=>{this._makeBullet(e,t)})))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);if(i){let t=i.get(\"sprite\");t&&(t._setDataItem(e),t.setRaw(\"position\",\"absolute\"),this.bulletsContainer.children.push(t)),i._index=s,i.series=this,e.bullets.push(i)}return i}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty(\"heatRules\")&&(this._valuesDirty=!0),this.isPrivateDirty(\"baseValueSeries\")){const e=this.getPrivate(\"baseValueSeries\");e&&this._disposers.push(e.onPrivate(\"startIndex\",(()=>{this.markDirtyValues()})))}if(this.get(\"calculateAggregates\")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0)),this._psi==e&&this._pei==t||this._selectionAggregatesCalculated||(0===e&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty(\"tooltip\")){let e=this.get(\"tooltip\");e&&(e.hide(0),e.set(\"tooltipTarget\",this))}if(this.isDirty(\"fill\")||this.isDirty(\"stroke\")){let e;const t=this.get(\"legendDataItem\");if(t&&(e=t.get(\"markerRectangle\"),e&&this.isVisible())){if(this.isDirty(\"stroke\")){let t=this.get(\"stroke\");e.set(\"stroke\",t)}if(this.isDirty(\"fill\")){let t=this.get(\"fill\");e.set(\"fill\",t)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let e=this.startIndex(),t=this.endIndex();t{i[e]=0,l[e]=0,r[e]=0})),a(s,(s=>{let a=s+\"Change\",m=s+\"ChangePercent\",p=s+\"ChangePrevious\",b=s+\"ChangePreviousPercent\",f=s+\"ChangeSelection\",g=s+\"ChangeSelectionPercent\",_=\"valueY\";\"valueX\"!=s&&\"openValueX\"!=s&&\"lowValueX\"!=s&&\"highValueX\"!=s||(_=\"valueX\");const v=this.getPrivate(\"baseValueSeries\");for(let y=e;yw||null==n[s])&&(n[s]=w),(o[s]{this.setPrivate(e+\"AverageSelection\",d[e]),this.setPrivate(e+\"CountSelection\",r[e]),this.setPrivate(e+\"SumSelection\",i[e]),this.setPrivate(e+\"AbsoluteSumSelection\",l[e]),this.setPrivate(e+\"LowSelection\",n[e]),this.setPrivate(e+\"HighSelection\",o[e]),this.setPrivate(e+\"OpenSelection\",h[e]),this.setPrivate(e+\"CloseSelection\",u[e])})),0===e&&t===this.dataItems.length&&a(s,(e=>{this.setPrivate(e+\"Average\",d[e]),this.setPrivate(e+\"Count\",r[e]),this.setPrivate(e+\"Sum\",i[e]),this.setPrivate(e+\"AbsoluteSum\",l[e]),this.setPrivate(e+\"Low\",n[e]),this.setPrivate(e+\"High\",o[e]),this.setPrivate(e+\"Open\",h[e]),this.setPrivate(e+\"Close\",u[e])}))}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty(\"visible\")&&this.bulletsContainer.set(\"visible\",this.get(\"visible\"));const e=this.get(\"heatRules\");if(this._valuesDirty&&e&&e.length>0&&a(e,(e=>{const t=e.minValue||this.getPrivate(e.dataField+\"Low\")||0,s=e.maxValue||this.getPrivate(e.dataField+\"High\")||0;a(e.target._entities,(i=>{const a=i.dataItem.get(e.dataField);if(r(a))if(e.customFunction)e.customFunction.call(this,i,t,s,a);else{let l,n;l=e.logarithmic?(Math.log(a)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(t)*Math.LOG10E):(a-t)/(s-t),!r(a)||r(l)&&Math.abs(l)!=1/0||(l=.5),r(e.min)?n=e.min+(e.max-e.min)*l:e.min instanceof h?n=h.interpolate(l,e.min,e.max):e.min instanceof u&&(n=d(l,e.min,e.max)),i.set(e.key,n)}else e.neutral&&i.set(e.key,e.neutral)}))})),this.get(\"visible\")&&this.bullets.length>0){let e=this.dataItems.length,t=this.startIndex(),s=this.endIndex();s0&&t--;for(let i=0;i{this._positionBullet(e);const t=e.get(\"sprite\");e.get(\"dynamic\")&&(t&&(t._markDirtyKey(\"fill\"),t.markDirtySize()),t instanceof i&&t.walkChildren((e=>{e._markDirtyKey(\"fill\"),e.markDirtySize(),e instanceof c&&e.text.markDirtyText()}))),t instanceof c&&t.get(\"populateText\")&&t.text.markDirtyText()}))}_hideBullets(e){e.bullets&&a(e.bullets,(e=>{let t=e.get(\"sprite\");t&&t.setPrivate(\"visible\",!1)}))}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&a(t,(e=>{e.dispose()}))}_getItemReaderLabel(){return\"\"}showDataItem(t,s){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return e(this,void 0,void 0,(function*(){const e=[i.showDataItem.call(this,t,s)],l=t.bullets;l&&a(l,(t=>{e.push(t.get(\"sprite\").show(s))})),yield Promise.all(e)}))}hideDataItem(t,s){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return e(this,void 0,void 0,(function*(){const e=[i.hideDataItem.call(this,t,s)],l=t.bullets;l&&a(l,(t=>{e.push(t.get(\"sprite\").hide(s))})),yield Promise.all(e)}))}_sequencedShowHide(t,s){return e(this,void 0,void 0,(function*(){if(this.get(\"sequencedInterpolation\"))if(r(s)||(s=this.get(\"interpolationDuration\",0)),s>0){const i=this.startIndex(),a=this.endIndex();yield Promise.all(m(this.dataItems,((l,r)=>e(this,void 0,void 0,(function*(){let e=s||0;(ra+10)&&(e=0);let n=this.get(\"sequencedDelay\",0)+e/(a-i);yield v(n*(r-i)),t?yield this.showDataItem(l,e):yield this.hideDataItem(l,e)})))))}else yield Promise.all(m(this.dataItems,(e=>t?this.showDataItem(e,0):this.hideDataItem(e,0))))}))}updateLegendValue(e){if(e){const t=e.get(\"legendDataItem\");if(t){const s=t.get(\"valueLabel\");if(s){const t=s.text;let i=\"\";s._setDataItem(e),i=this.get(\"legendValueText\",t.get(\"text\",\"\")),s.set(\"text\",i),t.markDirtyText()}const i=t.get(\"label\");if(i){const t=i.text;let s=\"\";i._setDataItem(e),s=this.get(\"legendLabelText\",t.get(\"text\",\"\")),i.set(\"text\",s),t.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function x(e,t){for(let s=0,i=t.length;s0){let t=i[0];if(t.length>0){let s=t[0];e.moveTo(s.x,s.y);for(let t=0,a=i.length;t0){let t=e[0];this._display.moveTo(t.x,t.y),x(this._display,[[e]])}else if(t)x(this._display,t);else if(!this.get(\"draw\")){let e=this.width(),t=this.height();this._display.moveTo(0,0),this._display.lineTo(e,t)}}}}function k(e){return function(){return e}}Object.defineProperty(P,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Line\"}),Object.defineProperty(P,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:p.classNames.concat([P.className])});const T=Math.PI,M=2*T,O=1e-6,$=M-O;function j(e){this._+=e[0];for(let t=1,s=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return j;const s=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;tO)if(Math.abs(u*n-o*h)>O&&a){let c=s-l,m=i-r,p=n*n+o*o,b=c*c+m*m,f=Math.sqrt(p),g=Math.sqrt(d),_=a*Math.tan((T-Math.acos((p+d-b)/(2*f*g)))/2),v=_/g,y=_/f;Math.abs(v-1)>O&&this._append`L${e+v*h},${t+v*u}`,this._append`A${a},${a},0,0,${+(u*c>h*m)},${this._x1=e+y*n},${this._y1=t+y*o}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,s,i,a,l){if(e=+e,t=+t,l=!!l,(s=+s)<0)throw new Error(`negative radius: ${s}`);let r=s*Math.cos(i),n=s*Math.sin(i),o=e+r,h=t+n,u=1^l,d=l?i-a:a-i;null===this._x1?this._append`M${o},${h}`:(Math.abs(this._x1-o)>O||Math.abs(this._y1-h)>O)&&this._append`L${o},${h}`,s&&(d<0&&(d=d%M+M),d>$?this._append`A${s},${s},0,1,${u},${e-r},${t-n}A${s},${s},0,1,${u},${this._x1=o},${this._y1=h}`:d>O&&this._append`A${s},${s},0,${+(d>=T)},${u},${this._x1=e+s*Math.cos(a)},${this._y1=t+s*Math.sin(a)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function V(e){let t=3;return e.digits=function(s){if(!arguments.length)return t;if(null==s)t=null;else{const e=Math.floor(s);if(!(e>=0))throw new RangeError(`invalid digits: ${s}`);t=e}return e},()=>new F(t)}class N extends i{constructor(){super(...arguments),Object.defineProperty(this,\"chartContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(i.new(this._root,{width:n,height:n,interactiveChildren:!1}))}),Object.defineProperty(this,\"bulletsContainer\",{enumerable:!0,configurable:!0,writable:!0,value:i.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:\"absolute\",width:n,height:n})})}}Object.defineProperty(N,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Chart\"}),Object.defineProperty(N,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:i.classNames.concat([N.className])});class U extends N{constructor(){super(...arguments),Object.defineProperty(this,\"seriesContainer\",{enumerable:!0,configurable:!0,writable:!0,value:i.new(this._root,{width:n,height:n,isMeasured:!1})}),Object.defineProperty(this,\"series\",{enumerable:!0,configurable:!0,writable:!0,value:new b})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll((t=>{if(\"clear\"===t.type){a(t.oldValues,(e=>{this._removeSeries(e)}));const e=this.get(\"colors\");e&&e.reset()}else if(\"push\"===t.type)e.moveValue(t.newValue),this._processSeries(t.newValue);else if(\"setIndex\"===t.type)e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(\"insertIndex\"===t.type)e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(\"removeIndex\"===t.type)this._removeSeries(t.oldValue);else{if(\"moveIndex\"!==t.type)throw new Error(\"Unknown IListEvent type\");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}})))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(U,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"SerialChart\"}),Object.defineProperty(U,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([U.className])});class B extends P{}Object.defineProperty(B,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Tick\"}),Object.defineProperty(B,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:P.classNames.concat([B.className])});export{_ as C,g as D,U as S,B as T,D as a,k as c,I as r,V as w};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{a as e}from\"../../../chunks/tslib.es6.js\";import{w as t,c as i,S as s,a,T as r}from\"../../../chunks/Tick.js\";import{ag as l,aJ as n,al as o,az as h,S as c,aK as u,aL as d,ao as g,Q as p,a7 as y,g as b,am as m,a4 as f,R as _,a3 as x,e as v,aM as w,X as k,aN as D,aD as R,aE as A,ak as P}from\"../../../chunks/Theme.js\";import{C as T}from\"../../../chunks/ColorSet.js\";import{s as L}from\"../../../chunks/DefaultTheme.js\";class N extends l{constructor(){super(...arguments),Object.defineProperty(this,\"_display\",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText(\"\",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty(\"textType\")&&(this._display.textType=this.get(\"textType\"),this.markDirtyBounds()),this.isDirty(\"radius\")&&(this._display.radius=this.get(\"radius\"),this.markDirtyBounds()),this.isDirty(\"startAngle\")&&(this._display.startAngle=(this.get(\"startAngle\",0)+90)*n,this.markDirtyBounds()),this.isDirty(\"inside\")&&(this._display.inside=this.get(\"inside\"),this.markDirtyBounds()),this.isDirty(\"orientation\")&&(this._display.orientation=this.get(\"orientation\"),this.markDirtyBounds()),this.isDirty(\"kerning\")&&(this._display.kerning=this.get(\"kerning\"),this.markDirtyBounds())}}Object.defineProperty(N,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"RadialText\"}),Object.defineProperty(N,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:l.classNames.concat([N.className])});class C extends o{constructor(){super(...arguments),Object.defineProperty(this,\"_flipped\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push(\"textType\",\"kerning\"),super._afterNew()}_makeText(){this._text=this.children.push(N.new(this._root,{}))}baseRadius(){const e=this.getPrivate(\"radius\",0),t=this.getPrivate(\"innerRadius\",0),i=this.get(\"baseRadius\",0);return t+h(i,e-t)}radius(){const e=this.get(\"inside\",!1);return this.baseRadius()+this.get(\"radius\",0)*(e?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty(\"baseRadius\")||this.isPrivateDirty(\"radius\")||this.isPrivateDirty(\"innerRadius\")||this.isDirty(\"labelAngle\")||this.isDirty(\"radius\")||this.isDirty(\"inside\")||this.isDirty(\"orientation\")||this.isDirty(\"textType\")){const e=this.get(\"textType\",\"adjusted\"),t=this.get(\"inside\",!1),i=this.get(\"orientation\");let s=c(this.get(\"labelAngle\",0));this._text.set(\"startAngle\",this.get(\"labelAngle\",0)),this._text.set(\"inside\",t);const a=u(s),r=d(s);let l=this.baseRadius(),n=this.radius();if(this._display.angle=0,\"circular\"==e)this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this._text.set(\"orientation\",i),this._text.set(\"radius\",n);else{0==l&&(s=0,n=0);let t=n*r,o=n*a;\"radial\"==e?(this.setRaw(\"x\",t),this.setRaw(\"y\",o),s<90||s>270||\"auto\"!=i?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):\"adjusted\"==e?(this.setRaw(\"centerX\",g),this.setRaw(\"centerY\",g),this.setRaw(\"x\",t),this.setRaw(\"y\",o)):\"regular\"==e&&(this.setRaw(\"x\",t),this.setRaw(\"y\",o))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const e=this.get(\"textType\",\"regular\"),t=this.get(\"inside\",!1);let i=0,s=0,a=this.get(\"labelAngle\",0),r=this.localBounds(),l=r.right-r.left,n=r.bottom-r.top;if(\"radial\"==e){if(this._flipped){let e=this.get(\"centerX\");e instanceof p&&(l*=1-2*e.value),i=l*d(a),s=l*u(a)}}else t||\"adjusted\"!=e||(i=l/2*d(a),s=n/2*u(a));this.setRaw(\"dx\",i),this.setRaw(\"dy\",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(C,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"RadialLabel\"}),Object.defineProperty(C,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:o.classNames.concat([C.className])});const j=Math.abs,S=Math.atan2,O=Math.cos,I=Math.max,M=Math.min,B=Math.sin,F=Math.sqrt,X=1e-12,H=Math.PI,Y=H/2,V=2*H;function z(e){return e>1?0:e<-1?H:Math.acos(e)}function W(e){return e>=1?Y:e<=-1?-Y:Math.asin(e)}function U(e){return e.innerRadius}function K(e){return e.outerRadius}function q(e){return e.startAngle}function E(e){return e.endAngle}function J(e){return e&&e.padAngle}function G(e,t,i,s,a,r,l,n){var o=i-e,h=s-t,c=l-a,u=n-r,d=u*o-c*h;if(!(d*dN*N+C*C&&(D=A,R=P),{cx:D,cy:R,x01:-c,y01:-u,x11:D*(a/v-1),y11:R*(a/v-1)}}function Z(){var e=U,s=K,a=i(0),r=null,l=q,n=E,o=J,h=null,c=t(u);function u(){var t,i,u=+e.apply(this,arguments),d=+s.apply(this,arguments),g=l.apply(this,arguments)-Y,p=n.apply(this,arguments)-Y,y=j(p-g),b=p>g;if(h||(h=t=c()),dX)if(y>V-X)h.moveTo(d*O(g),d*B(g)),h.arc(0,0,d,g,p,!b),u>X&&(h.moveTo(u*O(p),u*B(p)),h.arc(0,0,u,p,g,b));else{var m,f,_=g,x=p,v=g,w=p,k=y,D=y,R=o.apply(this,arguments)/2,A=R>X&&(r?+r.apply(this,arguments):F(u*u+d*d)),P=M(j(d-u)/2,+a.apply(this,arguments)),T=P,L=P;if(A>X){var N=W(A/u*B(R)),C=W(A/d*B(R));(k-=2*N)>X?(v+=N*=b?1:-1,w-=N):(k=0,v=w=(g+p)/2),(D-=2*C)>X?(_+=C*=b?1:-1,x-=C):(D=0,_=x=(g+p)/2)}var I=d*O(_),U=d*B(_),K=u*O(w),q=u*B(w);if(P>X){var E,J=d*O(x),Z=d*B(x),$=u*O(v),ee=u*B(v);if(yX?L>X?(m=Q($,ee,I,U,d,L,b),f=Q(J,Z,K,q,d,L,b),h.moveTo(m.cx+m.x01,m.cy+m.y01),LX&&k>X?T>X?(m=Q(K,q,J,Z,u,-T,b),f=Q(I,U,$,ee,u,-T,b),h.lineTo(m.cx+m.x01,m.cy+m.y01),T=360&&0==r&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty(\"radius\")||this.isDirty(\"arc\")||this.isDirty(\"innerRadius\")||this.isDirty(\"startAngle\")||this.isDirty(\"dRadius\")||this.isDirty(\"dInnerRadius\")||this.isDirty(\"cornerRadius\"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let e=this.get(\"startAngle\",0),t=this.get(\"arc\",0);const i=this._generator;t<0&&(e+=t,t*=-1),t>.1&&i.cornerRadius(this.get(\"cornerRadius\",0)),i.context(this._display);let s=this.get(\"radius\",0),a=this.get(\"innerRadius\",0);s+=this.get(\"dRadius\",0),a+=this.get(\"dInnerRadius\",0),a<0&&(a=s+a),i({innerRadius:a,outerRadius:s,startAngle:(e+90)*n,endAngle:(e+t+90)*n});let r=e+t/2;this.ix=d(r),this.iy=u(r)}if(this.isDirty(\"shiftRadius\")){const e=this.get(\"shiftRadius\",0);this.setRaw(\"dx\",this.ix*e),this.setRaw(\"dy\",this.iy*e),this.markDirtyPosition()}}}Object.defineProperty($,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Slice\"}),Object.defineProperty($,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:y.classNames.concat([$.className])});class ee extends m{setupDefaultRules(){super.setupDefaultRules();const e=this._root.interfaceColors,t=this.rule.bind(this);t(\"PercentSeries\").setAll({legendLabelText:\"{category}\",legendValueText:\"{valuePercentTotal.formatNumber('0.00p')}\",colors:T.new(this._root,{}),width:f,height:f}),t(\"PieChart\").setAll({radius:_(80),startAngle:-90,endAngle:270}),t(\"PieSeries\").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),t(\"PieSeries\").states.create(\"hidden\",{endAngle:-90,opacity:0}),t(\"Slice\",[\"pie\"]).setAll({position:\"absolute\",isMeasured:!1,x:0,y:0,toggleKey:\"active\",tooltipText:\"{category}: {valuePercentTotal.formatNumber('0.00p')}\",strokeWidth:1,strokeOpacity:1,role:\"figure\",lineJoin:\"round\"}),t(\"Slice\",[\"pie\"]).states.create(\"active\",{shiftRadius:20,scale:1}),t(\"Slice\",[\"pie\"]).states.create(\"hoverActive\",{scale:1.04}),t(\"Slice\",[\"pie\"]).states.create(\"hover\",{scale:1.04}),t(\"RadialLabel\",[\"pie\"]).setAll({textType:\"aligned\",radius:10,text:\"{category}: {valuePercentTotal.formatNumber('0.00p')}\",paddingTop:5,paddingBottom:5,populateText:!0}),t(\"Tick\",[\"pie\"]).setAll({location:1}),t(\"SlicedChart\").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),t(\"FunnelSeries\").setAll({startLocation:0,endLocation:1,orientation:\"vertical\",alignLabels:!0,sequencedInterpolation:!0}),t(\"FunnelSlice\").setAll({interactive:!0,expandDistance:0}),t(\"FunnelSlice\").states.create(\"hover\",{expandDistance:.15}),t(\"Label\",[\"funnel\"]).setAll({populateText:!0,text:\"{category}: {valuePercentTotal.formatNumber('0.00p')}\",centerY:g}),t(\"Label\",[\"funnel\",\"horizontal\"]).setAll({centerX:0,centerY:g,rotation:-90}),t(\"Label\",[\"funnel\",\"vertical\"]).setAll({centerY:g,centerX:0}),t(\"Tick\",[\"funnel\"]).setAll({location:1}),t(\"FunnelSlice\",[\"funnel\",\"link\"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),t(\"FunnelSlice\",[\"funnel\",\"link\",\"vertical\"]).setAll({height:10}),t(\"FunnelSlice\",[\"funnel\",\"link\",\"horizontal\"]).setAll({width:10}),t(\"PyramidSeries\").setAll({valueIs:\"area\"}),t(\"FunnelSlice\",[\"pyramid\",\"link\"]).setAll({fillOpacity:.5}),t(\"FunnelSlice\",[\"pyramid\",\"link\",\"vertical\"]).setAll({height:0}),t(\"FunnelSlice\",[\"pyramid\",\"link\",\"horizontal\"]).setAll({width:0}),t(\"FunnelSlice\",[\"pyramid\"]).setAll({interactive:!0,expandDistance:0}),t(\"FunnelSlice\",[\"pyramid\"]).states.create(\"hover\",{expandDistance:.15}),t(\"Label\",[\"pyramid\"]).setAll({populateText:!0,text:\"{category}: {valuePercentTotal.formatNumber('0.00p')}\",centerY:g}),t(\"Label\",[\"pyramid\",\"horizontal\"]).setAll({centerX:0,centerY:g,rotation:-90}),t(\"Label\",[\"pyramid\",\"vertical\"]).setAll({centerY:g,centerX:0}),t(\"Tick\",[\"pyramid\"]).setAll({location:1}),t(\"FunnelSlice\",[\"pictorial\"]).setAll({interactive:!0,tooltipText:\"{category}: {valuePercentTotal.formatNumber('0.00p')}\"}),t(\"Label\",[\"pictorial\"]).setAll({populateText:!0,text:\"{category}: {valuePercentTotal.formatNumber('0.00p')}\",centerY:g}),t(\"Label\",[\"pictorial\",\"horizontal\"]).setAll({centerX:0,centerY:g,rotation:-90}),t(\"Label\",[\"pictorial\",\"vertical\"]).setAll({centerY:g,centerX:0}),t(\"FunnelSlice\",[\"pictorial\",\"link\"]).setAll({fillOpacity:.5,width:0,height:0}),t(\"Tick\",[\"pictorial\"]).setAll({location:.5});{const i=t(\"Graphics\",[\"pictorial\",\"background\"]);i.setAll({fillOpacity:.2}),L(i,\"fill\",e,\"alternativeBackground\")}}}class te extends s{_afterNew(){this._defaultThemes.push(ee.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(e){super._processSeries(e),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(te,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"PercentChart\"}),Object.defineProperty(te,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:s.classNames.concat([te.className])});class ie extends a{constructor(){super(...arguments),Object.defineProperty(this,\"slicesContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(x.new(this._root,{position:\"absolute\",isMeasured:!1}))}),Object.defineProperty(this,\"labelsContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(x.new(this._root,{position:\"absolute\",isMeasured:!1}))}),Object.defineProperty(this,\"ticksContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(x.new(this._root,{position:\"absolute\",isMeasured:!1}))}),Object.defineProperty(this,\"_lLabels\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_rLabels\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_hLabels\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"slices\",{enumerable:!0,configurable:!0,writable:!0,value:this._makeSlices()}),Object.defineProperty(this,\"labels\",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLabels()}),Object.defineProperty(this,\"ticks\",{enumerable:!0,configurable:!0,writable:!0,value:this._makeTicks()})}makeSlice(e){const t=this.slicesContainer.children.push(this.slices.make());return t.on(\"fill\",(()=>{this.updateLegendMarker(e)})),t.on(\"stroke\",(()=>{this.updateLegendMarker(e)})),t._setDataItem(e),e.set(\"slice\",t),this.slices.push(t),t}makeLabel(e){const t=this.labelsContainer.children.push(this.labels.make());return t._setDataItem(e),e.set(\"label\",t),this.labels.push(t),t}_shouldMakeBullet(e){return null!=e.get(\"value\")}makeTick(e){const t=this.ticksContainer.children.push(this.ticks.make());return t._setDataItem(e),e.set(\"tick\",t),this.ticks.push(t),t}_afterNew(){this.fields.push(\"category\",\"fill\"),super._afterNew()}_onDataClear(){const e=this.get(\"colors\");e&&e.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let e=0,t=0,i=0,s=1/0,a=0;v(this._dataItems,(i=>{let s=i.get(\"valueWorking\",0);e+=s,t+=Math.abs(s)})),v(this._dataItems,(e=>{let r=e.get(\"valueWorking\",0);r>i&&(i=r),rsuper.show}});return e(this,void 0,void 0,(function*(){let e=[];e.push(i.show.call(this,t)),e.push(this._sequencedShowHide(!0,t)),yield Promise.all(e)}))}hide(t){const i=Object.create(null,{hide:{get:()=>super.hide}});return e(this,void 0,void 0,(function*(){let e=[];e.push(i.hide.call(this,t)),e.push(this._sequencedShowHide(!1,t)),yield Promise.all(e)}))}_updateChildren(){super._updateChildren(),this._valuesDirty&&v(this._dataItems,(e=>{e.get(\"label\").text.markDirtyText()})),(this.isDirty(\"legendLabelText\")||this.isDirty(\"legendValueText\"))&&v(this._dataItems,(e=>{this.updateLegendValue(e)})),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),v(this.dataItems,(e=>{this._updateTick(e)}))}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(e){if(super.processDataItem(e),null==e.get(\"fill\")){let t=this.get(\"colors\");t&&e.setRaw(\"fill\",t.next())}}showDataItem(t,i){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return e(this,void 0,void 0,(function*(){const e=[s.showDataItem.call(this,t,i)];b(i)||(i=this.get(\"stateAnimationDuration\",0));const a=this.get(\"stateAnimationEasing\");let r=t.get(\"value\");const l=t.animate({key:\"valueWorking\",to:r,duration:i,easing:a});l&&e.push(l.waitForStop());const n=t.get(\"tick\");n&&e.push(n.show(i));const o=t.get(\"label\");o&&e.push(o.show(i));const h=t.get(\"slice\");h&&e.push(h.show(i)),h.get(\"active\")&&h.states.applyAnimate(\"active\"),yield Promise.all(e)}))}hideDataItem(t,i){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return e(this,void 0,void 0,(function*(){const e=[s.hideDataItem.call(this,t,i)],a=this.states.create(\"hidden\",{});b(i)||(i=a.get(\"stateAnimationDuration\",this.get(\"stateAnimationDuration\",0)));const r=a.get(\"stateAnimationEasing\",this.get(\"stateAnimationEasing\")),l=t.animate({key:\"valueWorking\",to:0,duration:i,easing:r});l&&e.push(l.waitForStop());const n=t.get(\"tick\");n&&e.push(n.hide(i));const o=t.get(\"label\");o&&e.push(o.hide(i));const h=t.get(\"slice\");h.hideTooltip(),h&&e.push(h.hide(i)),yield Promise.all(e)}))}disposeDataItem(e){super.disposeDataItem(e);let t=e.get(\"label\");t&&(this.labels.removeValue(t),t.dispose());let i=e.get(\"tick\");i&&(this.ticks.removeValue(i),i.dispose());let s=e.get(\"slice\");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(e){const t=e.get(\"slice\");t&&!t.isHidden()&&t.hover()}unhoverDataItem(e){const t=e.get(\"slice\");t&&t.unhover()}updateLegendMarker(e){if(e){const t=e.get(\"slice\");if(t){const i=e.get(\"legendDataItem\");if(i){const e=i.get(\"markerRectangle\");v(w,(i=>{null!=t.get(i)&&e.set(i,t.get(i))}))}}}}_arrangeDown(e){if(e){let t=this._getNextDown();e.sort(((e,t)=>e.y>t.y?1:e.y{const i=e.label.adjustedLocalBounds();let s=i.top;e.y+se.yt.y?-1:0)),v(e,(e=>{const i=e.label.adjustedLocalBounds();let s=i.bottom;e.y+s>t&&(e.y=t-s),e.label.set(\"y\",e.y),t=e.y+i.top}))}}_arrangeRight(e){if(e){let t=0;e.sort(((e,t)=>e.y>t.y?1:e.y{const i=e.label.adjustedLocalBounds();let s=i.left;e.y+se.yt.y?-1:0)),v(e,(e=>{const i=e.label.adjustedLocalBounds();let s=i.right;e.y+s>t&&(e.y=t-s),e.label.set(\"x\",e.y),t=e.y+i.left}))}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(e){}_dispose(){super._dispose();const e=this.chart;e&&e.series.removeValue(this)}}Object.defineProperty(ie,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"PercentSeries\"}),Object.defineProperty(ie,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:a.classNames.concat([ie.className])});class se extends te{constructor(){super(...arguments),Object.defineProperty(this,\"_maxRadius\",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:g,y:g})}_prepareChildren(){super._prepareChildren();const e=this.chartContainer,t=e.innerWidth(),i=e.innerHeight(),s=this.get(\"startAngle\",0),a=this.get(\"endAngle\",0),r=this.get(\"innerRadius\");let l=k(0,0,s,a,1);const n=t/(l.right-l.left),o=i/(l.bottom-l.top);let c={left:0,right:0,top:0,bottom:0};if(r instanceof p){let e=r.value,l=Math.min(n,o);e=Math.max(l*e,l-Math.min(i,t))/l,c=k(0,0,s,a,e),this.setPrivateRaw(\"irModifyer\",e/r.value)}l=D([l,c]);const u=this._maxRadius;this._maxRadius=Math.min(n,o);const d=h(this.get(\"radius\",0),this._maxRadius);this.seriesContainer.setAll({dy:-d*(l.bottom+l.top)/2,dx:-d*(l.right+l.left)/2}),(this.isDirty(\"startAngle\")||this.isDirty(\"endAngle\")||u!=this._maxRadius)&&this.series.each((e=>{e._markDirtyKey(\"startAngle\")})),(this.isDirty(\"innerRadius\")||this.isDirty(\"radius\"))&&this.series.each((e=>{e._markDirtyKey(\"innerRadius\")}))}radius(e){let t=h(this.get(\"radius\",0),this._maxRadius),i=h(this.get(\"innerRadius\",0),t);if(e){let s=this.series.indexOf(e),a=this.series.length,r=e.get(\"radius\");return null!=r?i+h(r,t-i):i+(t-i)/a*(s+1)}return t}innerRadius(e){const t=this.radius();let i=h(this.get(\"innerRadius\",0),t);if(i<0&&(i=t+i),e){let s=this.series.indexOf(e),a=this.series.length,r=e.get(\"innerRadius\");return null!=r?i+h(r,t-i):i+(t-i)/a*s}return i}}Object.defineProperty(se,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"PieChart\"}),Object.defineProperty(se,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([se.className])});class ae extends ie{_makeSlices(){return new R(A.new({}),(()=>$._new(this._root,{themeTags:P(this.slices.template.get(\"themeTags\",[]),[\"pie\",\"series\"])},[this.slices.template])))}_makeLabels(){return new R(A.new({}),(()=>C._new(this._root,{themeTags:P(this.labels.template.get(\"themeTags\",[]),[\"pie\",\"series\"])},[this.labels.template])))}_makeTicks(){return new R(A.new({}),(()=>r._new(this._root,{themeTags:P(this.ticks.template.get(\"themeTags\",[]),[\"pie\",\"series\"])},[this.ticks.template])))}processDataItem(e){super.processDataItem(e);const t=this.makeSlice(e);t.on(\"scale\",(()=>{this._updateTick(e)})),t.on(\"shiftRadius\",(()=>{this._updateTick(e)})),t.events.on(\"positionchanged\",(()=>{this._updateTick(e)}));const i=this.makeLabel(e);i.events.on(\"positionchanged\",(()=>{this._updateTick(e)})),this.makeTick(e),t.events.on(\"positionchanged\",(()=>{i.markDirty()}))}_getNextUp(){const e=this.chart;return e?e._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const e=this.chart;return e?-e._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const e=this.chart;if(e){if(this.isDirty(\"alignLabels\")){let e=this.labels.template;if(this.get(\"alignLabels\"))e.set(\"textType\",\"aligned\");else{let t=e.get(\"textType\");null!=t&&\"aligned\"!=t||e.set(\"textType\",\"adjusted\")}}if(this._valuesDirty||this.isDirty(\"radius\")||this.isDirty(\"innerRadius\")||this.isDirty(\"startAngle\")||this.isDirty(\"endAngle\")||this.isDirty(\"alignLabels\")){this.markDirtyBounds();const t=this.get(\"startAngle\",e.get(\"startAngle\",-90)),i=this.get(\"endAngle\",e.get(\"endAngle\",270))-t;let s=t;const a=e.radius(this);this.setPrivateRaw(\"radius\",a);let r=e.innerRadius(this)*e.getPrivate(\"irModifyer\",1);r<0&&(r=a+r),v(this._dataItems,(e=>{this.updateLegendValue(e);let t=i*e.get(\"valuePercentTotal\")/100;const l=e.get(\"slice\");if(l){l.set(\"radius\",a),l.set(\"innerRadius\",r),l.set(\"startAngle\",s),l.set(\"arc\",t);const i=e.get(\"fill\");l._setDefault(\"fill\",i),l._setDefault(\"stroke\",i)}let n=c(s+t/2);const o=e.get(\"label\");if(o&&(o.setPrivate(\"radius\",a),o.setPrivate(\"innerRadius\",r),o.set(\"labelAngle\",n),\"aligned\"==o.get(\"textType\"))){let e=a+o.get(\"radius\",0),t=a*u(n);n>90&&n<=270?(o.isHidden()||o.isHiding()||this._lLabels.push({label:o,y:t}),e*=-1,e-=this.labelsContainer.get(\"paddingLeft\",0),o.set(\"centerX\",f),o.setPrivateRaw(\"left\",!0)):(o.isHidden()||o.isHiding()||this._rLabels.push({label:o,y:t}),e+=this.labelsContainer.get(\"paddingRight\",0),o.set(\"centerX\",0),o.setPrivateRaw(\"left\",!1)),o.set(\"x\",e),o.set(\"y\",a*u(n))}s+=t,this._updateTick(e)}))}}}_updateTick(e){const t=e.get(\"tick\"),i=e.get(\"label\"),s=e.get(\"slice\"),a=t.get(\"location\",1);if(t&&i&&s){const e=(s.get(\"shiftRadius\",0)+s.get(\"radius\",0))*s.get(\"scale\",1)*a,r=i.get(\"labelAngle\",0),l=d(r),n=u(r),o=this.labelsContainer,h=o.get(\"paddingLeft\",0),c=o.get(\"paddingRight\",0);let g=0,p=0;if(g=i.x(),p=i.y(),\"circular\"==i.get(\"textType\")){const e=i.radius()-i.get(\"paddingBottom\",0),t=i.get(\"labelAngle\",0);g=e*d(t),p=e*u(t)}let y=-c;i.getPrivate(\"left\")&&(y=h),t.set(\"points\",[{x:s.x()+e*l,y:s.y()+e*n},{x:g+y,y:p},{x:g,y:p}])}}_positionBullet(e){const t=e.get(\"sprite\");if(t){const i=t.dataItem.get(\"slice\");if(i){const s=i.get(\"innerRadius\",0),a=i.get(\"radius\",0),r=i.get(\"startAngle\",0)+i.get(\"arc\",0)*e.get(\"locationX\",.5),l=s+(a-s)*e.get(\"locationY\",.5);t.setAll({x:d(r)*l,y:u(r)*l})}}}}Object.defineProperty(ae,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"PieSeries\"}),Object.defineProperty(ae,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:ie.classNames.concat([ae.className])});export{se as PieChartAm5,ae as PieSeriesAm5};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{am as e,a4 as t,ao as i,g as s,K as a,b as o,ar as n,R as r,as as l,a3 as h,a7 as d,a5 as c,C as u,ad as g,at as p,aa as m,f as _,e as b,au as x,av as f,Q as v,ak as y,y as w,z as P,aw as k,ax as A,J as D,ay as T,az as M,aA as C,M as S,aB as O,aj as X,aC as Y,al as L,aD as F,aE as R,aF as I,a6 as j}from\"./Theme.js\";import{C as V}from\"./ColorSet.js\";import{s as E}from\"./DefaultTheme.js\";import{w as G,c as N,r as z,S as W,a as U,D as B,C as H,T as Z}from\"./Tick.js\";import{B as K}from\"./Button.js\";import{a as q}from\"./tslib.es6.js\";function J(e){return\"object\"==typeof e&&\"length\"in e?e:Array.from(e)}function Q(e){this._context=e}function $(e){return new Q(e)}function ee(e){return e[0]}function te(e){return e[1]}function ie(e,t){var i=N(!0),s=null,a=$,o=null,n=G(r);function r(r){var l,h,d,c=(r=J(r)).length,u=!1;for(null==s&&(o=a(d=n())),l=0;l<=c;++l)!(l=c;--u)r.point(b[u],x[u]);r.lineEnd(),r.areaEnd()}_&&(b[d]=+e(g,d,h),x[d]=+t(g,d,h),r.point(s?+s(g,d,h):b[d],i?+i(g,d,h):x[d]))}if(p)return r=null,p+\"\"||null}function d(){return ie().defined(a).curve(n).context(o)}return e=\"function\"==typeof e?e:void 0===e?ee:N(+e),t=\"function\"==typeof t?t:N(void 0===t?0:+t),i=\"function\"==typeof i?i:void 0===i?te:N(+i),h.x=function(t){return arguments.length?(e=\"function\"==typeof t?t:N(+t),s=null,h):e},h.x0=function(t){return arguments.length?(e=\"function\"==typeof t?t:N(+t),h):e},h.x1=function(e){return arguments.length?(s=null==e?null:\"function\"==typeof e?e:N(+e),h):s},h.y=function(e){return arguments.length?(t=\"function\"==typeof e?e:N(+e),i=null,h):t},h.y0=function(e){return arguments.length?(t=\"function\"==typeof e?e:N(+e),h):t},h.y1=function(e){return arguments.length?(i=null==e?null:\"function\"==typeof e?e:N(+e),h):i},h.lineX0=h.lineY0=function(){return d().x(e).y(t)},h.lineY1=function(){return d().x(e).y(i)},h.lineX1=function(){return d().x(s).y(t)},h.defined=function(e){return arguments.length?(a=\"function\"==typeof e?e:N(!!e),h):a},h.curve=function(e){return arguments.length?(n=e,null!=o&&(r=n(o)),h):n},h.context=function(e){return arguments.length?(null==e?o=r=null:r=n(o=e),h):o},h}Q.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};class ae extends e{setupDefaultRules(){super.setupDefaultRules();const e=this._root.interfaceColors,l=this._root.language,h=this.rule.bind(this);h(\"XYChart\").setAll({colors:V.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),h(\"XYSeries\").setAll({legendLabelText:\"{name}\"}),h(\"XYChart\",[\"scrollbar\",\"chart\"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:V.new(this._root,{saturation:0})});{const t=h(\"Graphics\",[\"scrollbar\",\"overlay\"]);t.setAll({fillOpacity:.5}),E(t,\"fill\",e,\"background\")}h(\"RoundedRectangle\",[\"xy\",\"scrollbar\",\"thumb\"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),h(\"RoundedRectangle\",[\"xy\",\"scrollbar\",\"thumb\"]).states.create(\"hover\",{fillOpacity:.4}),h(\"RoundedRectangle\",[\"xy\",\"scrollbar\",\"chart\",\"background\"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),h(\"RoundedRectangle\",[\"xy\",\"scrollbar\",\"chart\",\"background\",\"resize\",\"button\"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),h(\"AxisRendererX\",[\"xy\",\"chart\",\"scrollbar\"]).setAll({strokeOpacity:0,inside:!0}),h(\"AxisRendererY\",[\"xy\",\"chart\",\"scrollbar\"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),h(\"AxisLabel\",[\"xy\",\"scrollbar\",\"x\"]).setAll({opacity:.5,centerY:t,minPosition:.01,maxPosition:.99,fontSize:\"0.8em\"}),h(\"AxisLabel\",[\"category\"]).setAll({text:\"{category}\",populateText:!0}),h(\"AxisLabel\",[\"x\"]).setAll({centerY:0}),h(\"AxisLabel\",[\"x\",\"inside\"]).setAll({centerY:t}),h(\"AxisLabel\",[\"x\",\"inside\",\"opposite\"]).setAll({centerY:0}),h(\"AxisLabel\",[\"x\",\"opposite\"]).setAll({centerY:t}),h(\"AxisLabel\",[\"y\"]).setAll({centerX:t}),h(\"AxisLabel\",[\"y\",\"inside\"]).setAll({centerX:0}),h(\"AxisLabel\",[\"y\",\"inside\",\"opposite\"]).setAll({centerX:t}),h(\"AxisLabel\",[\"y\",\"opposite\"]).setAll({centerX:0}),h(\"AxisLabel\",[\"xy\",\"scrollbar\",\"y\"]).setAll({visible:!1}),h(\"Grid\",[\"xy\",\"scrollbar\",\"y\"]).setAll({visible:!1}),h(\"Grid\",[\"xy\",\"scrollbar\",\"x\"]).setAll({opacity:.5}),h(\"XYCursor\").setAll({behavior:\"none\",layer:30,exportable:!1,snapToSeriesBy:\"xy\",moveThreshold:1});{const t=h(\"Grid\",[\"cursor\",\"x\"]);t.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:l.translate(\"Use left and right arrows to move selection\")}),E(t,\"stroke\",e,\"alternativeBackground\")}{const t=h(\"Grid\",[\"cursor\",\"y\"]);t.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:l.translate(\"Use up and down arrows to move selection\")}),E(t,\"stroke\",e,\"alternativeBackground\")}{const t=h(\"Graphics\",[\"cursor\",\"selection\"]);t.setAll({fillOpacity:.15}),E(t,\"fill\",e,\"alternativeBackground\")}h(\"Axis\").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),h(\"AxisLabel\").setAll({location:.5,multiLocation:0,centerX:i,centerY:i,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),h(\"Container\",[\"axis\",\"header\"]).setAll({layer:30}),h(\"Rectangle\",[\"axis\",\"header\",\"background\"]).setAll({crisp:!0});{const t=h(\"AxisRenderer\");t.setAll({crisp:!0,strokeOpacity:0}),E(t,\"stroke\",e,\"grid\")}h(\"AxisRendererX\").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:t}),h(\"AxisRendererY\").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:t});{const t=h(\"Rectangle\",[\"axis\",\"thumb\"]);t.setAll({fillOpacity:0}),E(t,\"fill\",e,\"alternativeBackground\"),t.states.create(\"hover\",{fillOpacity:.1})}h(\"Rectangle\",[\"axis\",\"thumb\",\"x\"]).setAll({cursorOverStyle:\"ew-resize\"}),h(\"Rectangle\",[\"axis\",\"thumb\",\"y\"]).setAll({cursorOverStyle:\"ns-resize\"});{const t=h(\"Grid\");t.setAll({location:0,strokeOpacity:.15,crisp:!0}),E(t,\"stroke\",e,\"grid\")}h(\"Grid\",[\"base\"]).setAll({strokeOpacity:.3});{const t=h(\"Graphics\",[\"axis\",\"fill\"]);t.setAll({visible:!1,isMeasured:!1,position:\"absolute\",fillOpacity:.05}),E(t,\"fill\",e,\"alternativeBackground\")}h(\"Graphics\",[\"axis\",\"fill\",\"range\"]).setAll({isMeasured:!0}),h(\"Graphics\",[\"series\",\"fill\",\"range\"]).setAll({visible:!1,isMeasured:!0}),h(\"Grid\",[\"series\",\"range\"]).setAll({visible:!1}),h(\"AxisTick\",[\"series\",\"range\"]).setAll({visible:!1}),h(\"AxisLabel\",[\"series\",\"range\"]).setAll({visible:!1});{const t=h(\"AxisTick\");t.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:\"absolute\",visible:!1}),E(t,\"stroke\",e,\"grid\")}h(\"CategoryAxis\").setAll({startLocation:0,endLocation:1,fillRule:(e,t)=>{const i=e.get(\"axisFill\");i&&(s(t)&&t%2!=0?i.setPrivate(\"visible\",!1):i.setPrivate(\"visible\",!0))}});const d=[{timeUnit:\"millisecond\",count:1},{timeUnit:\"millisecond\",count:5},{timeUnit:\"millisecond\",count:10},{timeUnit:\"millisecond\",count:50},{timeUnit:\"millisecond\",count:100},{timeUnit:\"millisecond\",count:500},{timeUnit:\"second\",count:1},{timeUnit:\"second\",count:5},{timeUnit:\"second\",count:10},{timeUnit:\"second\",count:30},{timeUnit:\"minute\",count:1},{timeUnit:\"minute\",count:5},{timeUnit:\"minute\",count:10},{timeUnit:\"minute\",count:15},{timeUnit:\"minute\",count:30},{timeUnit:\"hour\",count:1},{timeUnit:\"hour\",count:3},{timeUnit:\"hour\",count:6},{timeUnit:\"hour\",count:12},{timeUnit:\"day\",count:1},{timeUnit:\"day\",count:2},{timeUnit:\"day\",count:3},{timeUnit:\"day\",count:4},{timeUnit:\"day\",count:5},{timeUnit:\"week\",count:1},{timeUnit:\"month\",count:1},{timeUnit:\"month\",count:2},{timeUnit:\"month\",count:3},{timeUnit:\"month\",count:6},{timeUnit:\"year\",count:1},{timeUnit:\"year\",count:2},{timeUnit:\"year\",count:5},{timeUnit:\"year\",count:10},{timeUnit:\"year\",count:50},{timeUnit:\"year\",count:100},{timeUnit:\"year\",count:200},{timeUnit:\"year\",count:500},{timeUnit:\"year\",count:1e3},{timeUnit:\"year\",count:2e3},{timeUnit:\"year\",count:5e3},{timeUnit:\"year\",count:1e4},{timeUnit:\"year\",count:1e5}],c={millisecond:l.translate(\"_date_millisecond\"),second:l.translate(\"_date_second\"),minute:l.translate(\"_date_minute\"),hour:l.translate(\"_date_hour\"),day:l.translate(\"_date_day\"),week:l.translate(\"_date_day\"),month:l.translate(\"_date_month\"),year:l.translate(\"_date_year\")},u={millisecond:l.translate(\"_date_millisecond\"),second:l.translate(\"_date_second\"),minute:l.translate(\"_date_minute\"),hour:l.translate(\"_date_day\"),day:l.translate(\"_date_day\"),week:l.translate(\"_date_day\"),month:l.translate(\"_date_month\")+\" \"+l.translate(\"_date_year\"),year:l.translate(\"_date_year\")},g={millisecond:l.translate(\"_date_millisecond_full\"),second:l.translate(\"_date_second_full\"),minute:l.translate(\"_date_minute_full\"),hour:l.translate(\"_date_hour_full\"),day:l.translate(\"_date_day_full\"),week:l.translate(\"_date_week_full\"),month:l.translate(\"_date_month_full\"),year:l.translate(\"_date_year\")};h(\"CategoryDateAxis\").setAll({markUnitChange:!0,gridIntervals:a(d),dateFormats:o(c),periodChangeDateFormats:o(u)}),h(\"DateAxis\").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:a(d),dateFormats:o(c),periodChangeDateFormats:o(u),tooltipDateFormats:g,groupIntervals:[{timeUnit:\"millisecond\",count:1},{timeUnit:\"millisecond\",count:10},{timeUnit:\"millisecond\",count:100},{timeUnit:\"second\",count:1},{timeUnit:\"second\",count:10},{timeUnit:\"minute\",count:1},{timeUnit:\"minute\",count:10},{timeUnit:\"hour\",count:1},{timeUnit:\"day\",count:1},{timeUnit:\"week\",count:1},{timeUnit:\"month\",count:1},{timeUnit:\"year\",count:1}],fillRule:e=>{const t=e.get(\"axisFill\");if(t){const i=e.component,s=e.get(\"value\"),a=e.get(\"endValue\"),o=i.intervalDuration(),n=i.getPrivate(\"baseInterval\"),r=i.getPrivate(\"gridInterval\",n);let l=i.getPrivate(\"min\",0);if(l=z(new Date(l),r.timeUnit,r.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),null!=s&&null!=a){const e=Math.round(Math.round((s-l)/o))/2;e==Math.round(e)?t.setPrivate(\"visible\",!0):t.setPrivate(\"visible\",!1)}}}}),h(\"GaplessDateAxis\").setAll({fillRule:e=>{const t=e.get(\"axisFill\");if(t){const i=e.get(\"index\");let a=!1;s(i)&&i%2!=0||(a=!0),t.setPrivate(\"visible\",a)}}}),h(\"ValueAxis\").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:e=>{const t=e.get(\"axisFill\");if(t){const i=e.component,a=e.get(\"value\"),o=i.getPrivate(\"step\");s(a)&&s(o)&&(n(a/o/2,5)==Math.round(a/o/2)?t.setPrivate(\"visible\",!1):t.setPrivate(\"visible\",!0))}}}),h(\"DurationAxis\").setAll({baseUnit:\"second\"}),h(\"XYSeries\").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:\"open\",openValueYGrouped:\"open\",valueXGrouped:\"close\",valueYGrouped:\"close\",seriesTooltipTarget:\"series\"}),h(\"BaseColumnSeries\").setAll({adjustBulletPosition:!0}),h(\"ColumnSeries\").setAll({clustered:!0}),h(\"RoundedRectangle\",[\"series\",\"column\"]).setAll({position:\"absolute\",isMeasured:!1,width:r(70),height:r(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:\"figure\"}),h(\"LineSeries\").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),h(\"Graphics\",[\"series\",\"stroke\"]).setAll({position:\"absolute\",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),h(\"Graphics\",[\"series\",\"fill\"]).setAll({visible:!1,fillOpacity:0,position:\"absolute\",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),h(\"Graphics\",[\"line\",\"series\",\"legend\",\"marker\",\"stroke\"]).setAll({draw:(e,t)=>{const i=t.parent;if(i){const t=i.height(),s=i.width();e.moveTo(0,t/2),e.lineTo(s,t/2)}}});{const t=h(\"Graphics\",[\"line\",\"series\",\"legend\",\"marker\",\"stroke\"]).states.create(\"disabled\",{});E(t,\"stroke\",e,\"disabled\")}h(\"Graphics\",[\"line\",\"series\",\"legend\",\"marker\",\"fill\"]).setAll({draw:(e,t)=>{const i=t.parent;if(i){const t=i.height(),s=i.width();e.moveTo(0,0),e.lineTo(s,0),e.lineTo(s,t),e.lineTo(0,t),e.lineTo(0,0)}}});{const t=h(\"Graphics\",[\"line\",\"series\",\"legend\",\"marker\",\"fill\"]).states.create(\"disabled\",{});E(t,\"stroke\",e,\"disabled\")}h(\"SmoothedXYLineSeries\").setAll({tension:.5}),h(\"SmoothedXLineSeries\").setAll({tension:.5}),h(\"SmoothedYLineSeries\").setAll({tension:.5}),h(\"Candlestick\").setAll({position:\"absolute\",isMeasured:!1,width:r(50),height:r(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:\"figure\"}),h(\"OHLC\").setAll({width:r(80),height:r(80)}),h(\"CandlestickSeries\").setAll({lowValueXGrouped:\"low\",lowValueYGrouped:\"low\",highValueXGrouped:\"high\",highValueYGrouped:\"high\",openValueXGrouped:\"open\",openValueYGrouped:\"open\",valueXGrouped:\"close\",valueYGrouped:\"close\"});{const t=h(\"Rectangle\",[\"column\",\"autocolor\"]).states.create(\"riseFromOpen\",{});E(t,\"fill\",e,\"positive\"),E(t,\"stroke\",e,\"positive\")}{const t=h(\"Rectangle\",[\"column\",\"autocolor\"]).states.create(\"dropFromOpen\",{});E(t,\"fill\",e,\"negative\"),E(t,\"stroke\",e,\"negative\")}h(\"Rectangle\",[\"column\",\"autocolor\",\"pro\"]).states.create(\"riseFromOpen\",{fillOpacity:0}),h(\"Rectangle\",[\"column\",\"autocolor\",\"pro\"]).states.create(\"dropFromOpen\",{fillOpacity:1});{const t=h(\"Rectangle\",[\"column\",\"autocolor\",\"pro\"]).states.create(\"riseFromPrevious\",{});E(t,\"fill\",e,\"positive\"),E(t,\"stroke\",e,\"positive\")}{const t=h(\"Rectangle\",[\"column\",\"autocolor\",\"pro\"]).states.create(\"dropFromPrevious\",{});E(t,\"fill\",e,\"negative\"),E(t,\"stroke\",e,\"negative\")}}}class oe extends W{constructor(){super(...arguments),Object.defineProperty(this,\"xAxes\",{enumerable:!0,configurable:!0,writable:!0,value:new l}),Object.defineProperty(this,\"yAxes\",{enumerable:!0,configurable:!0,writable:!0,value:new l}),Object.defineProperty(this,\"topAxesContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(h.new(this._root,{width:t,layout:this._root.verticalLayout}))}),Object.defineProperty(this,\"yAxesAndPlotContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(h.new(this._root,{width:t,height:t,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,\"bottomAxesContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(h.new(this._root,{width:t,layout:this._root.verticalLayout}))}),Object.defineProperty(this,\"leftAxesContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(h.new(this._root,{height:t,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,\"plotsContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(h.new(this._root,{width:t,height:t,maskContent:!1}))}),Object.defineProperty(this,\"plotContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(h.new(this._root,{width:t,height:t}))}),Object.defineProperty(this,\"topPlotContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(h.new(this._root,{width:t,height:t}))}),Object.defineProperty(this,\"gridContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(h.new(this._root,{width:t,height:t,isMeasured:!1}))}),Object.defineProperty(this,\"topGridContainer\",{enumerable:!0,configurable:!0,writable:!0,value:h.new(this._root,{width:t,height:t,isMeasured:!1})}),Object.defineProperty(this,\"rightAxesContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(h.new(this._root,{height:t,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,\"axisHeadersContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(h.new(this._root,{}))}),Object.defineProperty(this,\"zoomOutButton\",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(K.new(this._root,{themeTags:[\"zoom\"],icon:d.new(this._root,{themeTags:[\"button\",\"icon\"]})}))}),Object.defineProperty(this,\"_movePoint\",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,\"_wheelDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_otherCharts\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_movePoints\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_downStartX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_downEndX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_downStartY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_downEndY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(ae.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const e=this._root;let t=this._root.verticalLayout;const i=this.zoomOutButton;i.events.on(\"click\",(()=>{this.zoomOut()})),i.hide(0),i.states.lookup(\"default\").set(\"opacity\",1),this.chartContainer.set(\"layout\",t);const s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set(\"interactive\",!0),s.set(\"interactiveChildren\",!1),s.set(\"background\",c.new(e,{themeTags:[\"xy\",\"background\"],fill:u.fromHex(0),fillOpacity:0})),this._disposers.push(s.events.on(\"pointerdown\",(e=>{this._handlePlotDown(e)}))),this._disposers.push(s.events.on(\"globalpointerup\",(e=>{this._handlePlotUp(e)}))),this._disposers.push(s.events.on(\"globalpointermove\",(e=>{this._handlePlotMove(e)}))),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty(\"pinchZoomX\")||this.isDirty(\"pinchZoomY\")||this.get(\"panX\")||this.get(\"panY\"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get(\"pinchZoomX\")||this.get(\"pinchZoomY\")||this.get(\"panX\")||this.get(\"panY\")))}_maskGrid(){this.gridContainer.set(\"maskContent\",!0),this.topGridContainer.set(\"maskContent\",!0)}_removeSeries(e){e._unstack(),e._posXDp&&e._posXDp.dispose(),e._posYDp&&e._posYDp.dispose(),e.set(\"baseAxis\",void 0);const t=e.get(\"xAxis\");t&&(g(t.series,e),t.markDirtyExtremes());const i=e.get(\"yAxis\");i&&(g(i.series,e),i.markDirtyExtremes());const s=this.get(\"cursor\");if(s){const t=s.get(\"snapToSeries\");t&&g(t,e)}super._removeSeries(e)}handleWheel(e){const t=this.get(\"wheelX\"),i=this.get(\"wheelY\"),s=this.plotContainer,a=e.originalEvent;if(!p(a,this))return;a.preventDefault();const o=s.toLocal(e.point),n=this.get(\"wheelStep\",.2),r=a.deltaY/100,l=a.deltaX/100,h=this.get(\"wheelZoomPositionX\"),d=this.get(\"wheelZoomPositionY\");\"zoomX\"!==t&&\"zoomXY\"!==t||0==l||this.xAxes.each((e=>{if(e.get(\"zoomX\")){let t=e.get(\"start\"),i=e.get(\"end\"),a=e.fixPosition(o.x/s.width());null!=h&&(a=h);let r=t-n*(i-t)*l*a,d=i+n*(i-t)*l*(1-a);1/(d-r){if(e.get(\"zoomX\")){let t=e.get(\"start\"),i=e.get(\"end\"),a=e.fixPosition(o.x/s.width());null!=h&&(a=h);let l=t-n*(i-t)*r*a,d=i+n*(i-t)*r*(1-a);1/(d-l){if(e.get(\"zoomY\")){let t=e.get(\"start\"),i=e.get(\"end\"),a=e.fixPosition(o.y/s.height());null!=d&&(a=d);let r=t-n*(i-t)*l*a,h=i+n*(i-t)*l*(1-a);1/(h-r){if(e.get(\"zoomY\")){let t=e.get(\"start\"),i=e.get(\"end\"),a=e.fixPosition(o.y/s.height());null!=d&&(a=d);let l=t-n*(i-t)*r*a,h=i+n*(i-t)*r*(1-a);1/(h-l){if(e.get(\"panX\")){let t=e.get(\"start\"),i=e.get(\"end\"),s=this._getWheelSign(e)*n*(i-t)*l,a=t+s,o=i+s,r=this._fixWheel(a,o);a=r[0],o=r[1],this._handleWheelAnimation(e.zoom(a,o))}})),\"panX\"!==i&&\"panXY\"!==i||0==r||this.xAxes.each((e=>{if(e.get(\"panX\")){let t=e.get(\"start\"),i=e.get(\"end\"),s=this._getWheelSign(e)*n*(i-t)*r,a=t+s,o=i+s,l=this._fixWheel(a,o);a=l[0],o=l[1],this._handleWheelAnimation(e.zoom(a,o))}})),\"panY\"!==t&&\"panXY\"!==t||0==l||this.yAxes.each((e=>{if(e.get(\"panY\")){let t=e.get(\"start\"),i=e.get(\"end\"),s=this._getWheelSign(e)*n*(i-t)*l,a=t+s,o=i+s,r=this._fixWheel(a,o);a=r[0],o=r[1],this._handleWheelAnimation(e.zoom(a,o))}})),\"panY\"!==i&&\"panXY\"!==i||0==r||this.yAxes.each((e=>{if(e.get(\"panY\")){let t=e.get(\"start\"),i=e.get(\"end\"),s=this._getWheelSign(e)*n*(i-t)*r,a=t-s,o=i-s,l=this._fixWheel(a,o);a=l[0],o=l[1],this._handleWheelAnimation(e.zoom(a,o))}}))}_handleSetWheel(){const e=this.get(\"wheelX\"),t=this.get(\"wheelY\"),i=this.plotContainer;\"none\"!==e||\"none\"!==t?(this._wheelDp=i.events.on(\"wheel\",(i=>{const s=i.originalEvent;(\"none\"!==e&&0!=Math.abs(s.deltaX)||\"none\"!==t&&0!=Math.abs(s.deltaY))&&this.handleWheel(i)})),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(e){let t=1;return e.get(\"renderer\").get(\"inversed\")&&(t=-1),t}_fixWheel(e,t){const i=t-e;return e<0&&(t=(e=0)+i),t>1&&(e=(t=1)-i),[e,t]}_handlePlotDown(e){const t=e.originalEvent;if(2==t.button)return;const i=this.plotContainer;let s=i.toLocal(e.point);if(this.get(\"pinchZoomX\")||this.get(\"pinchZoomY\")){if(t.pointerId&&m(i._downPoints).length>0){const e=this.xAxes.getIndex(0),t=this.yAxes.getIndex(0);e&&(this._downStartX=e.get(\"start\",0),this._downEndX=e.get(\"end\",1)),t&&(this._downStartY=t.get(\"start\",0),this._downEndY=t.get(\"end\",1))}}if((this.get(\"panX\")||this.get(\"panY\"))&&s.x>=0&&s.y>=0&&s.x<=i.width()&&s.y<=this.height()){this._downPoint={x:t.clientX,y:t.clientY};const i=this.get(\"panX\"),s=this.get(\"panY\");i&&this.xAxes.each((e=>{e._panStart=e.get(\"start\"),e._panEnd=e.get(\"end\")})),s&&this.yAxes.each((e=>{e._panStart=e.get(\"start\"),e._panEnd=e.get(\"end\")}));const a=\"panstarted\";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this,originalEvent:e.originalEvent})}}_handleWheelAnimation(e){e?e.events.on(\"stopped\",(()=>{this._dispatchWheelAnimation()})):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const e=\"wheelended\";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this})}_handlePlotUp(e){const t=this._downPoint;if(t&&(this.get(\"panX\")||this.get(\"panY\"))){let i=this.plotContainer.toLocal(e.point);if(i.x==t.x&&i.y==t.y){const t=\"pancancelled\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent})}const s=\"panended\";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:e.originalEvent})}this._downPoint=void 0,this.xAxes.each((e=>{e._isPanning=!1})),this.yAxes.each((e=>{e._isPanning=!1}))}_handlePlotMove(e){const t=this.plotContainer;if(this.get(\"pinchZoomX\")||this.get(\"pinchZoomY\")){const i=e.pointerId;if(i&&(this._movePoints[i]=e.point,m(t._downPoints).length>1))return void this._handlePinch()}let i=this._downPoint;if(i){i=t.toLocal(this._root.documentPointToRoot(i));let s=t.toLocal(e.point);const a=this.get(\"panX\"),o=this.get(\"panY\");if(a){let e=this.get(\"scrollbarX\");e&&e.events.disableType(\"rangechanged\"),this.xAxes.each((e=>{if(e.get(\"panX\")){e._isPanning=!0;let a=e._panStart,o=e._panEnd,n=(o-a)*(i.x-s.x)/t.width();e.get(\"renderer\").get(\"inversed\")&&(n*=-1);let r=a+n,l=o+n;l-r<1+2*e.get(\"maxDeviation\",1)&&(e.set(\"start\",r),e.set(\"end\",l))}})),e&&e.events.enableType(\"rangechanged\")}if(o){let e=this.get(\"scrollbarY\");e&&e.events.disableType(\"rangechanged\"),this.yAxes.each((e=>{if(e.get(\"panY\")){e._isPanning=!0;let a=e._panStart,o=e._panEnd,n=(o-a)*(i.y-s.y)/t.height();e.get(\"renderer\").get(\"inversed\")&&(n*=-1);let r=a-n,l=o-n;l-r<1+2*e.get(\"maxDeviation\",1)&&(e.set(\"start\",r),e.set(\"end\",l))}})),e&&e.events.enableType(\"rangechanged\")}}}_handlePinch(){const e=this.plotContainer;let t=0,i=[],s=[];if(_(e._downPoints,((e,a)=>{i[t]=a;let o=this._movePoints[e];o&&(s[t]=o),t++})),i.length>1&&s.length>1){const t=e.width(),a=e.height();let o=i[0],n=i[1],r=s[0],l=s[1];if(o&&n&&r&&l){if(r=e.toLocal(r),l=e.toLocal(l),o=e.toLocal(o),n=e.toLocal(n),this.get(\"pinchZoomX\")){const e=this._downStartX,i=this._downEndX;if(null!=e&&null!=i){o.x>n.x&&([o,n]=[n,o],[r,l]=[l,r]);let s=e+o.x/t*(i-e),a=e+n.x/t*(i-e),h=e+r.x/t*(i-e),d=e+l.x/t*(i-e),c=Math.max(.001,a-s)/Math.max(.001,d-h),u=e*c+s-h*c,g=i*c+a-d*c;this.xAxes.each((e=>{let t=e.fixPosition(u),i=e.fixPosition(g);e.zoom(t,i,0)}))}}if(this.get(\"pinchZoomY\")){const e=this._downStartY,t=this._downEndY;if(null!=e&&null!=t){o.y{let t=e.fixPosition(u),i=e.fixPosition(g);e.zoom(t,i,0)}))}}}}}_handleCursorPosition(){const e=this.get(\"cursor\");if(e){const t=e.getPrivate(\"point\");let i=e.get(\"snapToSeries\");if(e._downPoint&&(i=void 0),i&&t){const s=e.get(\"snapToSeriesBy\"),a=[];b(i,(e=>{if(!e.isHidden()&&!e.isHiding())if(\"x!\"!=s&&\"y!\"!=s){const t=e.startIndex(),i=e.endIndex();for(let s=t;s{const i=e.get(\"point\");if(i){let a=0;a=\"x\"==s||\"x!\"==s?Math.abs(t.x-i.x):\"y\"==s||\"y!\"==s?Math.abs(t.y-i.y):Math.hypot(t.x-i.x,t.y-i.y),a{const t=e.get(\"tooltip\");t&&t._setDataItem(void 0)})),o){let t=o.component;t.showDataItemTooltip(o);const i=o.get(\"point\");i&&e.handleMove(t.toGlobal({x:i.x-t.x(),y:i.y-t.y()}),!0)}}}}_updateCursor(){let e=this.get(\"cursor\");e&&e.updateCursor()}_addCursor(e){this.plotContainer.children.push(e)}_prepareChildren(){if(super._prepareChildren(),this.series.each((e=>{this._colorize(e)})),(this.isDirty(\"wheelX\")||this.isDirty(\"wheelY\"))&&this._handleSetWheel(),this.isDirty(\"cursor\")){const e=this._prevSettings.cursor,t=this.get(\"cursor\");t!==e&&(this._disposeProperty(\"cursor\"),e&&e.dispose(),t&&(t._setChart(this),this._addCursor(t),this._pushPropertyDisposer(\"cursor\",t.events.on(\"selectended\",(()=>{this._handleCursorSelectEnd()})))),this._prevSettings.cursor=t)}if(this.isDirty(\"scrollbarX\")){const e=this._prevSettings.scrollbarX,t=this.get(\"scrollbarX\");t!==e&&(this._disposeProperty(\"scrollbarX\"),e&&e.dispose(),t&&(t.parent||this.topAxesContainer.children.push(t),this._pushPropertyDisposer(\"scrollbarX\",t.events.on(\"rangechanged\",(e=>{this._handleScrollbar(this.xAxes,e.start,e.end,e.grip)}))),t.setPrivate(\"positionTextFunction\",(e=>{const t=this.xAxes.getIndex(0);return t&&t.getTooltipText(e,!1)||\"\"}))),this._prevSettings.scrollbarX=t)}if(this.isDirty(\"scrollbarY\")){const e=this._prevSettings.scrollbarY,t=this.get(\"scrollbarY\");t!==e&&(this._disposeProperty(\"scrollbarY\"),e&&e.dispose(),t&&(t.parent||this.rightAxesContainer.children.push(t),this._pushPropertyDisposer(\"scrollbarY\",t.events.on(\"rangechanged\",(e=>{this._handleScrollbar(this.yAxes,e.start,e.end,e.grip)}))),t.setPrivate(\"positionTextFunction\",(e=>{const t=this.yAxes.getIndex(0);return t&&t.getTooltipText(e,!1)||\"\"}))),this._prevSettings.scrollbarY=t)}this._handleZoomOut()}_processSeries(e){super._processSeries(e);const t=e.get(\"xAxis\"),i=e.get(\"yAxis\");x(t.series,e),x(i.series,e),e._posXDp=e.addDisposer(t.events.on(\"positionchanged\",(()=>{e._fixPosition()}))),e._posXDp=e.addDisposer(i.events.on(\"positionchanged\",(()=>{e._fixPosition()}))),e.get(\"baseAxis\")||(i.isType(\"CategoryAxis\")||i.isType(\"DateAxis\")?e.set(\"baseAxis\",i):e.set(\"baseAxis\",t)),e.get(\"stacked\")&&(e._markDirtyKey(\"stacked\"),b(e.dataItems,(e=>{e.set(\"stackToItemY\",void 0),e.set(\"stackToItemX\",void 0)}))),e._markDirtyAxes(),i.markDirtyExtremes(),t.markDirtyExtremes(),this._colorize(e)}_colorize(e){const t=this.get(\"colors\");if(t&&null==e.get(\"fill\")){const i=t.next();e._setSoft(\"stroke\",i),e._setSoft(\"fill\",i)}}_handleCursorSelectEnd(){const e=this.get(\"cursor\"),t=e.get(\"behavior\"),i=e.getPrivate(\"downPositionX\",0),s=e.getPrivate(\"downPositionY\",0),a=Math.min(1,Math.max(0,e.getPrivate(\"positionX\",.5))),o=Math.min(1,Math.max(0,e.getPrivate(\"positionY\",.5)));this.xAxes.each((e=>{if(\"zoomX\"===t||\"zoomXY\"===t){let t=e.toAxisPosition(i),s=e.toAxisPosition(a);e.zoom(t,s)}e.setPrivate(\"updateScrollbar\",!0)})),this.yAxes.each((e=>{if(\"zoomY\"===t||\"zoomXY\"===t){let t=e.toAxisPosition(s),i=e.toAxisPosition(o);e.zoom(t,i)}e.setPrivate(\"updateScrollbar\",!0)}))}_handleScrollbar(e,t,i,s){e.each((e=>{let a=e.fixPosition(t),o=e.fixPosition(i),n=e.zoom(a,o,void 0,s);const r=\"updateScrollbar\";e.setPrivateRaw(r,!1),n?n.events.on(\"stopped\",(()=>{e.setPrivateRaw(r,!0)})):e.setPrivateRaw(r,!0)}))}_processAxis(e,t){return e.events.onAll((e=>{if(\"clear\"===e.type)b(e.oldValues,(e=>{this._removeAxis(e)}));else if(\"push\"===e.type)t.children.push(e.newValue),e.newValue.processChart(this);else if(\"setIndex\"===e.type)t.children.setIndex(e.index,e.newValue),e.newValue.processChart(this);else if(\"insertIndex\"===e.type)t.children.insertIndex(e.index,e.newValue),e.newValue.processChart(this);else if(\"removeIndex\"===e.type)this._removeAxis(e.oldValue);else{if(\"moveIndex\"!==e.type)throw new Error(\"Unknown IListEvent type\");t.children.moveValue(e.value,e.newIndex),e.value.processChart(this)}}))}_removeAxis(e){if(!e.isDisposed()){const t=e.parent;t&&t.children.removeValue(e);const i=e.gridContainer,s=i.parent;s&&s.children.removeValue(i);const a=e.topGridContainer,o=a.parent;o&&o.children.removeValue(a)}}_updateChartLayout(){const e=this.leftAxesContainer.width(),t=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set(\"paddingLeft\",e),i.set(\"paddingRight\",t);const s=this.topAxesContainer;s.set(\"paddingLeft\",e),s.set(\"paddingRight\",t)}processAxis(e){this.get(\"cursor\")&&(this.addDisposer(e.on(\"start\",(()=>{this._updateCursor()}))),this.addDisposer(e.on(\"end\",(()=>{this._updateCursor()}))))}_handleAxisSelection(e,t){let i=e.fixPosition(e.get(\"start\",0)),s=e.fixPosition(e.get(\"end\",1));if(i>s&&([i,s]=[s,i]),-1!=this.xAxes.indexOf(e)){if(t||e.getPrivate(\"updateScrollbar\")){let e=this.get(\"scrollbarX\");!e||e.getPrivate(\"isBusy\")&&!t||(e.setRaw(\"start\",i),e.setRaw(\"end\",s),e.updateGrips())}}else if(-1!=this.yAxes.indexOf(e)&&(t||e.getPrivate(\"updateScrollbar\"))){let e=this.get(\"scrollbarY\");!e||e.getPrivate(\"isBusy\")&&!t||(e.setRaw(\"start\",i),e.setRaw(\"end\",s),e.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let e=this.zoomOutButton;if(e&&e.parent){let t=!1;this.xAxes.each((e=>{0==e.get(\"start\")&&1==e.get(\"end\")||(t=!0)})),this.yAxes.each((e=>{0==e.get(\"start\")&&1==e.get(\"end\")||(t=!0)})),t?e.isHidden()&&e.show():e.hide()}}inPlot(e){const t=this.plotContainer,i=this.getPrivate(\"otherCharts\",this._otherCharts),s=t.toGlobal(e);if(e.x>=-.5&&e.y>=-.5&&e.x<=t.width()+.5&&e.y<=t.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){const e=i[a];if(e!=this){const t=e.plotContainer,i=this._root.rootPointToDocument(s),a=e._root.documentPointToRoot(i),o=t.toLocal(a);if(o.x>=-.1&&o.y>=-.1&&o.x<=t.width()+.1&&o.y<=t.height()+.1)return!0}}return!1}arrangeTooltips(){const e=this.plotContainer,t=e.width(),i=e.height(),a=this.height();let o=e._display.toGlobal({x:0,y:0}),n=e._display.toGlobal({x:t,y:i});const r=[];let l,h,d=0,c=1/0,u=this._movePoint,g=this.get(\"maxTooltipDistance\"),p=this.get(\"maxTooltipDistanceBy\",\"xy\");s(g)&&this.series.each((e=>{if(!e.isHidden()){const t=e.get(\"tooltip\");if(t){let i=t.get(\"pointTo\");if(i){let t=Math.hypot(u.x-i.x,u.y-i.y);\"x\"==p?t=Math.abs(u.x-i.x):\"y\"==p&&(t=Math.abs(u.y-i.y)),t{const t=e.get(\"tooltip\");if(t){let i=!1,s=t.get(\"pointTo\");if(s){if(g>=0){let s=t.get(\"pointTo\");if(s&&e!=l){let e=Math.hypot(h.x-s.x,h.y-s.y);\"x\"==p?e=Math.abs(h.x-s.x):\"y\"==p&&(e=Math.abs(h.y-s.y)),e>g&&(i=!0)}}else-1==g&&e!=l&&(i=!0);this.inPlot(this._tooltipToLocal(s))&&t.dataItem?i||(d+=s.y):i=!0,i||e.isHidden()||e.isHiding()?t.hide(0):(t.show(),r.push(t),m.push(e))}}})),this.setPrivate(\"tooltipSeries\",m),this.get(\"arrangeTooltips\")){const e=this._root.tooltipContainer,t=r.length;if(d/t>i/2+o.y){r.sort(((e,t)=>f(t.get(\"pointTo\").y,e.get(\"pointTo\").y)));let t=n.y;if(b(r,(i=>{let s=i.height(),a=i.get(\"centerY\");a instanceof v&&(s*=a.value),s+=i.get(\"marginBottom\",0),i.set(\"bounds\",{left:o.x,top:o.y,right:n.x,bottom:t}),i.setPrivate(\"customData\",{left:o.x,top:o.y,right:n.x,bottom:t}),t=Math.min(t-s,i._fy-s),i.parent==e&&e.children.moveValue(i,0)})),t<0){r.reverse();let e=t;b(r,(i=>{let s=i.get(\"bounds\");if(s){let a=s.top-t,o=s.bottom-t;af(e.get(\"pointTo\").y,t.get(\"pointTo\").y)));let t=0;if(b(r,(i=>{let s=i.height(),r=i.get(\"centerY\");r instanceof v&&(s*=r.value),s+=i.get(\"marginBottom\",0),i.set(\"bounds\",{left:o.x,top:t,right:n.x,bottom:Math.max(o.y+a,t+s)}),i.parent==e&&e.children.moveValue(i,0),t=Math.max(t+s,i._fy+s)})),t>a){r.reverse();let e=a;b(r,(i=>{let s=i.get(\"bounds\");if(s){let o=s.top-(a-t),n=s.bottom-(a-t);n>e&&(n=e,o=n-i.height()),i.set(\"bounds\",{left:s.left,top:o,right:s.right,bottom:n}),e=n-i.height()-i.get(\"marginBottom\",0)}}))}}}}_tooltipToLocal(e){return this.plotContainer.toLocal(e)}zoomOut(){this.xAxes.each((e=>{e.setPrivate(\"updateScrollbar\",!0),e.zoom(0,1)})),this.yAxes.each((e=>{e.setPrivate(\"updateScrollbar\",!0),e.zoom(0,1)}))}}Object.defineProperty(oe,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"XYChart\"}),Object.defineProperty(oe,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:W.classNames.concat([oe.className])});class ne extends d{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty(\"width\")||this.isPrivateDirty(\"height\"))&&(this._clear=!0)}}Object.defineProperty(ne,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Grid\"}),Object.defineProperty(ne,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:d.classNames.concat([ne.className])});class re extends h{constructor(){super(...arguments),Object.defineProperty(this,\"lineX\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(ne.new(this._root,{themeTags:[\"x\"]}))}),Object.defineProperty(this,\"lineY\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(ne.new(this._root,{themeTags:[\"y\"]}))}),Object.defineProperty(this,\"selection\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(d.new(this._root,{themeTags:[\"selection\",\"cursor\"],layer:30}))}),Object.defineProperty(this,\"_movePoint\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_lastPoint\",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,\"_tooltipX\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_tooltipY\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"chart\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_toX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_toY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=y(this._settings.themeTags,[\"xy\",\"cursor\"]),super._afterNew(),this.setAll({width:t,height:t,isMeasured:!0,position:\"absolute\"}),this.states.create(\"hidden\",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw(\"visible\",!1),this._disposers.push(this.setTimeout((()=>{this.setPrivate(\"visible\",!0)}),500)),this._disposers.push(this.lineX.events.on(\"positionchanged\",(()=>{this._handleXLine()}))),this._disposers.push(this.lineY.events.on(\"positionchanged\",(()=>{this._handleYLine()}))),this._disposers.push(this.lineX.events.on(\"focus\",(e=>this._handleLineFocus(e.target)))),this._disposers.push(this.lineX.events.on(\"blur\",(e=>this._handleLineBlur(e.target)))),this._disposers.push(this.lineY.events.on(\"focus\",(e=>this._handleLineFocus(e.target)))),this._disposers.push(this.lineY.events.on(\"blur\",(e=>this._handleLineBlur(e.target)))),w(\"keyboardevents\")&&this._disposers.push(P(document,\"keydown\",(e=>{this._handleLineMove(e.keyCode)})))}_setUpTouch(){const e=this.chart;e&&(e.plotContainer._display.cancelTouch=\"none\"!=this.get(\"behavior\"))}_handleXLine(){let e=this.lineX.x(),t=!0;(e<0||e>this.width())&&(t=!1),this.lineX.setPrivate(\"visible\",t)}_handleYLine(){let e=this.lineY.y(),t=!0;(e<0||e>this.height())&&(t=!1),this.lineY.setPrivate(\"visible\",t)}_handleLineMove(e){let t=\"\",i=0,s=.1;const a=this.chart;this._root.focused(this.lineX)?(a&&a.xAxes.length&&(s=a.xAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate(\"positionX\",0),t=\"positionX\",37==e?i-=s:39==e&&(i+=s)):this._root.focused(this.lineY)&&(a&&a.yAxes.length&&(s=a.yAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate(\"positionY\",0),t=\"positionY\",38==e?i-=s:40==e&&(i+=s)),i<0?i=0:i>1&&(i=1),\"\"!=t&&this.set(t,i)}_handleLineFocus(e){this.setAll({positionX:this.getPrivate(\"positionX\"),positionY:this.getPrivate(\"positionY\"),alwaysShow:!0})}_handleLineBlur(e){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty(\"xAxis\")){this._tooltipX=!1;const e=this.get(\"xAxis\");if(e){const t=e.get(\"tooltip\");t&&(this._tooltipX=!0,this._disposers.push(t.on(\"pointTo\",(()=>{this._updateXLine(t)}))))}}if(this.isDirty(\"yAxis\")){this._tooltipY=!1;const e=this.get(\"yAxis\");if(e){const t=e.get(\"tooltip\");t&&(this._tooltipY=!0,this._disposers.push(t.on(\"pointTo\",(()=>{this._updateYLine(t)}))))}}}_handleSyncWith(){const e=this.chart;if(e){const t=this.get(\"syncWith\"),i=[];t&&b(t,(e=>{const t=e.chart;t&&i.push(t)})),e._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty(\"positionX\")||this.isDirty(\"positionY\")){const e=this.get(\"positionX\"),t=this.get(\"positionY\");null==e&&null==t?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get(\"positionX\",0),this.get(\"positionY\",0))),this.handleMove())}}_updateXLine(e){let t=n(this._display.toLocal(e.get(\"pointTo\",{x:0,y:0})).x,2);this._toX!=t&&(this.lineX.animate({key:\"x\",to:t,duration:e.get(\"animationDuration\",0),easing:e.get(\"animationEasing\")}),this._toX=t)}_updateYLine(e){let t=n(this._display.toLocal(e.get(\"pointTo\",{x:0,y:0})).y,2);this._toY!=t&&(this.lineY.animate({key:\"y\",to:t,duration:e.get(\"animationDuration\",0),easing:e.get(\"animationEasing\")}),this._toY=t)}_drawLines(){this.lineX.set(\"draw\",(e=>{e.moveTo(0,0),e.lineTo(0,this.height())})),this.lineY.set(\"draw\",(e=>{e.moveTo(0,0),e.lineTo(this.width(),0)}))}updateCursor(){this.get(\"alwaysShow\")&&(this._movePoint=this.toGlobal(this._getPoint(this.get(\"positionX\",0),this.get(\"positionY\",0)))),this.handleMove()}_setChart(e){this.chart=e,this._handleSyncWith();const t=e.plotContainer;this.events.on(\"boundschanged\",(()=>{this._disposers.push(this.setTimeout((()=>{this.updateCursor()}),50))})),w(\"touchevents\")&&(this._disposers.push(t.events.on(\"click\",(e=>{k(e.originalEvent)&&this._handleMove(e)}))),this._setUpTouch()),this._disposers.push(t.events.on(\"pointerdown\",(e=>{this._handleCursorDown(e)}))),this._disposers.push(t.events.on(\"globalpointerup\",(e=>{this._handleCursorUp(e),e.native||this.isHidden()||this._handleMove(e)}))),this._disposers.push(t.events.on(\"globalpointermove\",(e=>{(this.get(\"syncWith\")||0!=m(t._downPoints).length||e.native||!this.isHidden())&&this._handleMove(e)})));const i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(e){const t=this.chart;return!!t&&t.inPlot(e)}_handleCursorDown(e){if(2==e.originalEvent.button)return;const t=e.point;let i=this._display.toLocal(t);const s=this.chart;if(this.selection.set(\"draw\",(()=>{})),s&&this._inPlot(i)){if(this._downPoint=i,\"none\"!=this.get(\"behavior\")){this.selection.show();const t=\"selectstarted\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent})}let t=this._getPosition(i).x,s=this._getPosition(i).y;this.setPrivate(\"downPositionX\",t),this.setPrivate(\"downPositionY\",s)}}_handleCursorUp(e){if(this._downPoint){const t=this.get(\"behavior\",\"none\");if(\"none\"!=t){\"z\"===t.charAt(0)&&this.selection.hide();const i=e.point;let s=this._display.toLocal(i);const a=this._downPoint,o=this.get(\"moveThreshold\",1);if(s&&a){let i=!1;if(\"zoomX\"!==t&&\"zoomXY\"!==t&&\"selectX\"!==t&&\"selectXY\"!==t||Math.abs(s.x-a.x)>o&&(i=!0),\"zoomY\"!==t&&\"zoomXY\"!==t&&\"selectY\"!==t&&\"selectXY\"!==t||Math.abs(s.y-a.y)>o&&(i=!0),i){const t=\"selectended\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent})}else{const t=\"selectcancelled\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent})}}}}this._downPoint=void 0}_handleMove(e){if(this.getPrivate(\"visible\")){const t=this.chart;if(t&&m(t.plotContainer._downPoints).length>1)return void this.set(\"forceHidden\",!0);this.set(\"forceHidden\",!1);const i=e.point,s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate(\"lastPoint\",i),this.handleMove({x:i.x,y:i.y},!1,e.originalEvent)}}_getPosition(e){return{x:e.x/this.width(),y:e.y/this.height()}}handleMove(e,t,i){e||(e=this._movePoint);const a=this.get(\"alwaysShow\");if(!e)return void this.hide(0);this._movePoint=e;let o=this._display.toLocal(e),n=this.chart;if(n&&(this._inPlot(o)||this._downPoint)){if(n._movePoint=e,this.isHidden()){this.show();\"z\"==this.get(\"behavior\",\"\").charAt(0)&&this.selection.set(\"draw\",(()=>{}))}let r=o.x,l=o.y,h=this._getPosition(o);this.setPrivate(\"point\",o);let d=this.get(\"snapToSeries\");this._downPoint&&(d=void 0);let c=this.get(\"positionX\"),u=h.x;s(c)&&(u=c);let g=this.get(\"positionY\"),p=h.y;s(g)&&(p=g),this.setPrivate(\"positionX\",u),this.setPrivate(\"positionY\",p);const m=this._getPoint(u,p);if(r=m.x,l=m.y,n.xAxes.each((e=>{e._handleCursorPosition(u,d),a&&e.handleCursorShow()})),n.yAxes.each((e=>{e._handleCursorPosition(p,d),a&&e.handleCursorShow()})),!t){n._handleCursorPosition();const t=\"cursormoved\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,point:e,originalEvent:i})}this._updateLines(r,l),n.arrangeTooltips()}else if(!this._downPoint&&!a){this.hide(0);const e=\"cursorhidden\";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this})}this._downPoint&&\"none\"!=this.get(\"behavior\")&&this._updateSelection(o)}_getPoint(e,t){return{x:this.width()*e,y:this.height()*t}}_updateLines(e,t){this._tooltipX||this.lineX.set(\"x\",e),this._tooltipY||this.lineY.set(\"y\",t),this._drawLines()}_updateSelection(e){const t=this.selection,i=this.get(\"behavior\"),s=this.width(),a=this.height();e.x<0&&(e.x=0),e.x>s&&(e.x=s),e.y<0&&(e.y=0),e.y>a&&(e.y=a),t.set(\"draw\",(t=>{const o=this._downPoint;o&&(\"zoomXY\"===i||\"selectXY\"===i?(t.moveTo(o.x,o.y),t.lineTo(o.x,e.y),t.lineTo(e.x,e.y),t.lineTo(e.x,o.y),t.lineTo(o.x,o.y)):\"zoomX\"===i||\"selectX\"===i?(t.moveTo(o.x,0),t.lineTo(o.x,a),t.lineTo(e.x,a),t.lineTo(e.x,0),t.lineTo(o.x,0)):\"zoomY\"!==i&&\"selectY\"!==i||(t.moveTo(0,o.y),t.lineTo(s,o.y),t.lineTo(s,e.y),t.lineTo(0,e.y),t.lineTo(0,o.y)))}))}_onHide(){if(this.isHidden()){let e=this.chart;e&&(e.xAxes.each((e=>{e.handleCursorHide()})),e.yAxes.each((e=>{e.handleCursorHide()})),e.series.each((e=>{e.handleCursorHide()})))}super._onHide()}_onShow(){if(!this.isHidden()){let e=this.chart;e&&(e.xAxes.each((e=>{e.handleCursorShow()})),e.yAxes.each((e=>{e.handleCursorShow()})))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}function le(e,t){return null==e?t:null==t?e:te?t:e}Object.defineProperty(re,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"XYCursor\"}),Object.defineProperty(re,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:h.classNames.concat([re.className])});class de extends U{constructor(){super(...arguments),Object.defineProperty(this,\"_xField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_yField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_xOpenField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_yOpenField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_xLowField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_xHighField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_yLowField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_yHighField\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_axesDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_stackDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_selectionProcessed\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dataSets\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_mainContainerMask\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_x\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_y\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"mainContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{}))}),Object.defineProperty(this,\"axisRanges\",{enumerable:!0,configurable:!0,writable:!0,value:new A}),Object.defineProperty(this,\"_skipped\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_couldStackTo\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_reallyStackedTo\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_stackedSeries\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"_aLocationX0\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_aLocationX1\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"_aLocationY0\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_aLocationY1\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"_showBullets\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"valueXFields\",{enumerable:!0,configurable:!0,writable:!0,value:[\"valueX\",\"openValueX\",\"lowValueX\",\"highValueX\"]}),Object.defineProperty(this,\"valueYFields\",{enumerable:!0,configurable:!0,writable:!0,value:[\"valueY\",\"openValueY\",\"lowValueY\",\"highValueY\"]}),Object.defineProperty(this,\"_valueXFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_valueYFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_valueXShowFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_valueYShowFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"__valueXShowFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"__valueYShowFields\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_emptyDataItem\",{enumerable:!0,configurable:!0,writable:!0,value:new B(this,void 0,{})}),Object.defineProperty(this,\"_dataSetId\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipFieldX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_tooltipFieldY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_posXDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_posYDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this.fields.push(\"categoryX\",\"categoryY\",\"openCategoryX\",\"openCategoryY\"),this.valueFields.push(\"valueX\",\"valueY\",\"openValueX\",\"openValueY\",\"lowValueX\",\"lowValueY\",\"highValueX\",\"highValueY\"),this._setRawDefault(\"vcx\",1),this._setRawDefault(\"vcy\",1),this._setRawDefault(\"valueXShow\",\"valueXWorking\"),this._setRawDefault(\"valueYShow\",\"valueYWorking\"),this._setRawDefault(\"openValueXShow\",\"openValueXWorking\"),this._setRawDefault(\"openValueYShow\",\"openValueYWorking\"),this._setRawDefault(\"lowValueXShow\",\"lowValueXWorking\"),this._setRawDefault(\"lowValueYShow\",\"lowValueYWorking\"),this._setRawDefault(\"highValueXShow\",\"highValueXWorking\"),this._setRawDefault(\"highValueYShow\",\"highValueYWorking\"),this._setRawDefault(\"lowValueXGrouped\",\"low\"),this._setRawDefault(\"lowValueYGrouped\",\"low\"),this._setRawDefault(\"highValueXGrouped\",\"high\"),this._setRawDefault(\"highValueYGrouped\",\"high\"),super._afterNew(),this.set(\"maskContent\",!0),this._disposers.push(this.axisRanges.events.onAll((e=>{if(\"clear\"===e.type)b(e.oldValues,(e=>{this._removeAxisRange(e)}));else if(\"push\"===e.type)this._processAxisRange(e.newValue);else if(\"setIndex\"===e.type)this._processAxisRange(e.newValue);else if(\"insertIndex\"===e.type)this._processAxisRange(e.newValue);else if(\"removeIndex\"===e.type)this._removeAxisRange(e.oldValue);else{if(\"moveIndex\"!==e.type)throw new Error(\"Unknown IStreamEvent type\");this._processAxisRange(e.value)}}))),this.states.create(\"hidden\",{opacity:1,visible:!1}),this._makeFieldNames()}_processAxisRange(e){const t=h.new(this._root,{});e.container=t,this.children.push(t),e.series=this;const i=e.axisDataItem;i.setRaw(\"isRange\",!0);const s=i.component;if(s){s._processAxisRange(i,[\"range\",\"series\"]);const e=i.get(\"bullet\");if(e){const t=e.get(\"sprite\");t&&t.setPrivate(\"visible\",!1)}const a=i.get(\"axisFill\");a&&t.set(\"mask\",a),s._seriesAxisRanges.push(i)}}_removeAxisRange(e){const t=e.axisDataItem,i=t.component;i.disposeDataItem(t),g(i._seriesAxisRanges,t);const s=e.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&b(this.valueXFields,(e=>{if(this.get(e+\"Field\")){this._valueXFields.push(e);let t=this.get(e+\"Show\");this.__valueXShowFields.push(t),-1!=t.indexOf(\"Working\")?this._valueXShowFields.push(t.split(\"Working\")[0]):this._valueXShowFields.push(t)}})),this.valueYFields&&b(this.valueYFields,(e=>{if(this.get(e+\"Field\")){this._valueYFields.push(e);let t=this.get(e+\"Show\");this.__valueYShowFields.push(t),-1!=t.indexOf(\"Working\")?this._valueYShowFields.push(t.split(\"Working\")[0]):this._valueYShowFields.push(t)}}))}_dispose(){super._dispose();const e=this.chart;e&&e.series.removeValue(this),D(this.get(\"xAxis\").series,this),D(this.get(\"yAxis\").series,this)}_min(e,t){let i=le(this.getPrivate(e),t);this.setPrivate(e,i)}_max(e,t){let i=he(this.getPrivate(e),t);this.setPrivate(e,i)}_shouldMakeBullet(e){const t=this.get(\"xAxis\"),i=this.get(\"yAxis\"),s=this.get(\"baseAxis\");if(!t.inited||!i.inited)return!1;const a=this.get(\"minBulletDistance\",0);if(a>0){let e=this.startIndex(),o=this.endIndex()-e;if(t==s){if(t.get(\"renderer\").axisLength()/o{b(this._valueXShowFields,(e=>{let t=i.get(e);null!=t&&(o&&(t+=this.getStackedXValue(i,e)),this._min(\"minX\",t),this._max(\"maxX\",t))})),b(this._valueYShowFields,(e=>{let t=i.get(e);null!=t&&(o&&(t+=this.getStackedYValue(i,e)),this._min(\"minY\",t),this._max(\"maxY\",t))})),e.processSeriesDataItem(i,this._valueXFields),t.processSeriesDataItem(i,this._valueYFields)})),e._seriesValuesDirty=!0,t._seriesValuesDirty=!0,this.get(\"ignoreMinMax\")||((this.isPrivateDirty(\"minX\")||this.isPrivateDirty(\"maxX\"))&&e.markDirtyExtremes(),(this.isPrivateDirty(\"minY\")||this.isPrivateDirty(\"maxY\"))&&t.markDirtyExtremes()),this._markStakedDirtyStack(),this.get(\"tooltipDataItem\")||this.updateLegendValue(void 0)),(this.isDirty(\"vcx\")||this.isDirty(\"vcy\"))&&this._markStakedDirtyStack(),this._dataGrouped||(e._groupSeriesData(this),t._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty(\"startIndex\")||this.isPrivateDirty(\"endIndex\")||this.isDirty(\"vcx\")||this.isDirty(\"vcy\")||this._stackDirty){let s=this.startIndex(),a=this.endIndex(),o=this.get(\"minBulletDistance\",0);if(o>0&&i&&(i.get(\"renderer\").axisLength()/(a-s)>o?this._showBullets=!0:this._showBullets=!1),(this._psi!=s||this._pei!=a||this.isDirty(\"vcx\")||this.isDirty(\"vcy\")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const o=this.get(\"vcx\",1),n=this.get(\"vcy\",1),r=this.get(\"stacked\",!1),l=this.getPrivate(\"outOfSelection\");if(i===e||!i)if(t._calculateTotals(),this.setPrivateRaw(\"selectionMinY\",void 0),this.setPrivateRaw(\"selectionMaxY\",void 0),l)t.markDirtySelectionExtremes();else for(let e=s;e0){let e=this._mainContainerMask;null==e&&(e=this.children.push(d.new(this._root,{})),this._mainContainerMask=e,e.set(\"draw\",((t,i)=>{const s=this.parent;if(s){const e=this._root.container.width(),a=this._root.container.height();t.moveTo(-e,-a),t.lineTo(-e,2*a),t.lineTo(2*e,2*a),t.lineTo(2*e,-a),t.lineTo(-e,-a),this.axisRanges.each((e=>{const a=e.axisDataItem.get(\"axisFill\");if(s&&a){let e=a.get(\"draw\");e&&e(t,i)}}))}this.mainContainer._display.mask=e._display}))),e.markDirty(),e._markDirtyKey(\"fill\")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const e=this.chart;if(e){const t=e.series.indexOf(this);if(this._couldStackTo=[],t>0){let i;for(let s=t-1;s>=0&&(i=e.series.getIndex(s),i.get(\"xAxis\")!==this.get(\"xAxis\")||i.get(\"yAxis\")!==this.get(\"yAxis\")||i.className!==this.className||(this._couldStackTo.push(i),i.get(\"stacked\")));s--);}this._stackDataItems()}}_unstack(){_(this._reallyStackedTo,((e,t)=>{delete t._stackedSeries[this.uid]})),this._reallyStackedTo={},b(this.dataItems,(e=>{e.setRaw(\"stackToItemY\",void 0),e.setRaw(\"stackToItemX\",void 0)}))}_stackDataItems(){const e=this.get(\"baseAxis\"),t=this.get(\"xAxis\"),i=this.get(\"yAxis\");let a,o;e===t?(a=\"valueY\",o=\"stackToItemY\"):e===i&&(a=\"valueX\",o=\"stackToItemX\");let n=this._couldStackTo.length,r=0;const l=this.get(\"stackToNegative\");this._reallyStackedTo={},b(this.dataItems,(e=>{for(let t=0;t=0&&t>=0){e.setRaw(o,n),this._reallyStackedTo[i.uid]=i,i._stackedSeries[this.uid]=this;break}if(h<0&&t<0){e.setRaw(o,n),this._reallyStackedTo[i.uid]=i,i._stackedSeries[this.uid]=this;break}}}else if(s(h)&&s(t)){e.setRaw(o,n),this._reallyStackedTo[i.uid]=i,i._stackedSeries[this.uid]=this;break}}}r++}))}processXSelectionDataItem(e,t,i){b(this.__valueXShowFields,(s=>{let a=e.get(s);null!=a&&(i&&(a+=this.getStackedXValueWorking(e,s)),this._min(\"selectionMinX\",a),this._max(\"selectionMaxX\",a*t))}))}processYSelectionDataItem(e,t,i){b(this.__valueYShowFields,(s=>{let a=e.get(s);null!=a&&(i&&(a+=this.getStackedYValueWorking(e,s)),this._min(\"selectionMinY\",a),this._max(\"selectionMaxY\",a*t))}))}getStackedYValueWorking(e,t){const i=e.get(\"stackToItemY\");if(i){const e=i.component;return i.get(t,0)*e.get(\"vcy\",1)+this.getStackedYValueWorking(i,t)}return 0}getStackedXValueWorking(e,t){const i=e.get(\"stackToItemX\");if(i){const e=i.component;return i.get(t,0)*e.get(\"vcx\",1)+this.getStackedXValueWorking(i,t)}return 0}getStackedYValue(e,t){const i=e.get(\"stackToItemY\");return i?i.get(t,0)+this.getStackedYValue(i,t):0}getStackedXValue(e,t){const i=e.get(\"stackToItemX\");return i?i.get(t,0)+this.getStackedXValue(i,t):0}createLegendMarker(e){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(e){let t=e.get(\"sprite\");if(t){let i=t.dataItem,s=e.get(\"locationX\",i.get(\"locationX\",.5)),a=e.get(\"locationY\",i.get(\"locationY\",.5)),o=this.get(\"xAxis\"),n=this.get(\"yAxis\");const r=o.getDataItemPositionX(i,this._xField,s,this.get(\"vcx\",1)),l=n.getDataItemPositionY(i,this._yField,a,this.get(\"vcy\",1));let h=this.getPoint(r,l),d=i.get(\"left\",h.x),c=i.get(\"right\",h.x),u=i.get(\"top\",h.y),g=i.get(\"bottom\",h.y);if(this._shouldShowBullet(r,l)){e.getPrivate(\"hidden\")?t.setPrivate(\"visible\",!1):t.setPrivate(\"visible\",!0);let i=c-d,o=g-u;t.isType(\"Label\")&&(t.setPrivate(\"maxWidth\",Math.abs(i)),t.setPrivate(\"maxHeight\",Math.abs(o)));let n=d+i*s,r=g-o*a;t.set(\"x\",n),t.set(\"y\",r)}else t.setPrivate(\"visible\",!1)}}_shouldShowBullet(e,t){return this._showBullets}setDataSet(e){if(this._dataSets[e]){this._handleDataSetChange(),this._dataItems=this._dataSets[e],this._markDataSetDirty(),this._dataSetId=e;const t=\"datasetchanged\";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,id:e})}}resetGrouping(){_(this._dataSets,((e,t)=>{t!=this._mainDataItems&&b(t,(e=>{this.disposeDataItem(e)}))})),this._dataSets={},this._dataItems=this.mainDataItems}_handleDataSetChange(){this.bullets.length>0&&b(this._dataItems,(e=>{let t=e.bullets;t&&b(t,(e=>{if(e){let t=e.get(\"sprite\");t&&t.setPrivate(\"visible\",!1)}}))})),this._selectionProcessed=!1}show(e){const t=Object.create(null,{show:{get:()=>super.show}});return q(this,void 0,void 0,(function*(){this._fixVC();let i=[];i.push(t.show.call(this,e).then((()=>{this._isShowing=!1;let e=this.get(\"xAxis\"),t=this.get(\"yAxis\"),i=this.get(\"baseAxis\");t!==i&&t.markDirtySelectionExtremes(),e!==i&&e.markDirtySelectionExtremes()}))),i.push(this.bulletsContainer.show(e)),i.push(this._sequencedShowHide(!0,e)),yield Promise.all(i)}))}hide(e){const t=Object.create(null,{hide:{get:()=>super.hide}});return q(this,void 0,void 0,(function*(){this._fixVC();let i=[];i.push(t.hide.call(this,e).then((()=>{this._isHiding=!1}))),i.push(this.bulletsContainer.hide(e)),i.push(this._sequencedShowHide(!1,e)),yield Promise.all(i)}))}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return q(this,void 0,void 0,(function*(){const a=[i.showDataItem.call(this,e,t)];s(t)||(t=this.get(\"stateAnimationDuration\",0));const o=this.get(\"stateAnimationEasing\");b(this._valueFields,(i=>{a.push(e.animate({key:i+\"Working\",to:e.get(i),duration:t,easing:o}).waitForStop())})),yield Promise.all(a)}))}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return q(this,void 0,void 0,(function*(){const a=[i.hideDataItem.call(this,e,t)],o=this.states.create(\"hidden\",{});s(t)||(t=o.get(\"stateAnimationDuration\",this.get(\"stateAnimationDuration\",0)));const n=o.get(\"stateAnimationEasing\",this.get(\"stateAnimationEasing\")),r=this.get(\"xAxis\"),l=this.get(\"yAxis\"),h=this.get(\"baseAxis\"),d=this.get(\"stacked\");if(h!==r&&h||b(this._valueYFields,(i=>{let o=l.getPrivate(\"min\"),r=l.baseValue();s(o)&&o>r&&(r=o),d&&(r=0),null!=e.get(i)&&a.push(e.animate({key:i+\"Working\",to:r,duration:t,easing:n}).waitForStop())})),h===l||!h){let i=r.getPrivate(\"min\"),o=r.baseValue();s(i)&&i>o&&(o=i),d&&(o=0),b(this._valueXFields,(i=>{null!=e.get(i)&&a.push(e.animate({key:i+\"Working\",to:o,duration:t,easing:n}).waitForStop())}))}yield Promise.all(a)}))}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const e=this._stackedSeries;e&&_(e,((e,t)=>{t._stackDirty||t._markDirtyStack()}))}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(e){this.updateLegendMarker(e),this.updateLegendValue(e);const t=this.get(\"tooltip\");if(t)if(this.isHidden())this.hideTooltip();else if(t._setDataItem(e),e){let i=this.get(\"locationX\",0),s=this.get(\"locationY\",1),a=e.get(\"locationX\",i),o=e.get(\"locationY\",s);const n=this.get(\"xAxis\"),r=this.get(\"yAxis\"),l=this.get(\"vcx\",1),h=this.get(\"vcy\",1),d=n.getDataItemPositionX(e,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*a,l),c=r.getDataItemPositionY(e,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*o,h),u=this.getPoint(d,c);let g=!0;if(b(this._valueFields,(t=>{null==e.get(t)&&(g=!1)})),g){const i=this.chart;i&&i.inPlot(u)?(t.label.text.markDirtyText(),t.set(\"tooltipTarget\",this._getTooltipTarget(e)),t.set(\"pointTo\",this._display.toGlobal({x:u.x,y:u.y}))):t._setDataItem(void 0)}else t._setDataItem(void 0)}}hideTooltip(){const e=this.get(\"tooltip\");return e&&e.set(\"tooltipTarget\",this),super.hideTooltip()}_getTooltipTarget(e){if(\"bullet\"==this.get(\"seriesTooltipTarget\")){const t=e.bullets;if(t&&t.length>0){const e=t[0].get(\"sprite\");if(e)return e}}return this}updateLegendValue(e){const t=this.get(\"legendDataItem\");if(t){const i=t.get(\"label\");if(i){let t=\"\";e?(i._setDataItem(e),t=this.get(\"legendLabelText\",i.get(\"text\",this.get(\"name\",\"\")))):(i._setDataItem(this._emptyDataItem),t=this.get(\"legendRangeLabelText\",this.get(\"legendLabelText\",i.get(\"text\",this.get(\"name\",\"\"))))),i.set(\"text\",t)}const s=t.get(\"valueLabel\");if(s){let t=\"\";e?(s._setDataItem(e),t=this.get(\"legendValueText\",s.get(\"text\",\"\"))):(s._setDataItem(this._emptyDataItem),t=this.get(\"legendRangeValueText\",s.get(\"text\",\"\"))),s.set(\"text\",t)}}}_getItemReaderLabel(){let e=\"X: {\"+this._xField;return this.get(\"xAxis\").isType(\"DateAxis\")&&(e+=\".formatDate()\"),e+=\"}; Y: {\"+this._yField,this.get(\"yAxis\").isType(\"DateAxis\")&&(e+=\".formatDate()\"),e+=\"}\",e}getPoint(e,t){let i=this.get(\"xAxis\").get(\"renderer\").positionToCoordinate(e),s=this.get(\"yAxis\").get(\"renderer\").positionToCoordinate(t),a=999999999;return s<-a&&(s=-a),s>a&&(s=a),i<-a&&(i=-a),i>a&&(i=a),{x:i,y:s}}_shouldInclude(e){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get(\"xAxis\")._markDirtyKey(\"start\"),this.get(\"yAxis\")._markDirtyKey(\"start\"),this.resetExtremes()}resetExtremes(){this.setPrivate(\"selectionMinX\",void 0),this.setPrivate(\"selectionMaxX\",void 0),this.setPrivate(\"selectionMinY\",void 0),this.setPrivate(\"selectionMaxY\",void 0),this.setPrivate(\"minX\",void 0),this.setPrivate(\"minY\",void 0),this.setPrivate(\"maxX\",void 0),this.setPrivate(\"maxY\",void 0)}createAxisRange(e){return this.axisRanges.push({axisDataItem:e})}get mainDataItems(){return this._mainDataItems}}Object.defineProperty(de,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"XYSeries\"}),Object.defineProperty(de,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([de.className])});class ce extends H{constructor(){super(...arguments),Object.defineProperty(this,\"_series\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"_isPanning\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"labelsContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{}))}),Object.defineProperty(this,\"gridContainer\",{enumerable:!0,configurable:!0,writable:!0,value:h.new(this._root,{width:t,height:t})}),Object.defineProperty(this,\"topGridContainer\",{enumerable:!0,configurable:!0,writable:!0,value:h.new(this._root,{width:t,height:t})}),Object.defineProperty(this,\"bulletsContainer\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{isMeasured:!1,width:t,height:t,position:\"absolute\"}))}),Object.defineProperty(this,\"chart\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_rangesDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_panStart\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_panEnd\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"_sAnimation\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_eAnimation\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_skipSync\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"axisRanges\",{enumerable:!0,configurable:!0,writable:!0,value:new A}),Object.defineProperty(this,\"_seriesAxisRanges\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"ghostLabel\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_cursorPosition\",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,\"_snapToSeries\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_seriesValuesDirty\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"axisHeader\",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(h.new(this._root,{themeTags:[\"axis\",\"header\"],position:\"absolute\",background:c.new(this._root,{themeTags:[\"header\",\"background\"],fill:this._root.interfaceColors.get(\"background\")})}))}),Object.defineProperty(this,\"_bullets\",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_dispose(){this.gridContainer.dispose(),this.topGridContainer.dispose(),this.bulletsContainer.dispose(),this.labelsContainer.dispose(),this.axisHeader.dispose(),super._dispose()}_afterNew(){super._afterNew(),this.setPrivate(\"updateScrollbar\",!0),this._disposers.push(this.axisRanges.events.onAll((e=>{if(\"clear\"===e.type)b(e.oldValues,(e=>{this.disposeDataItem(e)}));else if(\"push\"===e.type)this._processAxisRange(e.newValue,[\"range\"]);else if(\"setIndex\"===e.type)this._processAxisRange(e.newValue,[\"range\"]);else if(\"insertIndex\"===e.type)this._processAxisRange(e.newValue,[\"range\"]);else if(\"removeIndex\"===e.type)this.disposeDataItem(e.oldValue);else{if(\"moveIndex\"!==e.type)throw new Error(\"Unknown IStreamEvent type\");this._processAxisRange(e.value,[\"range\"])}})));const e=this.get(\"renderer\");e&&(e.axis=this,e.processAxis()),this.children.push(e),this.ghostLabel=e.makeLabel(new B(this,void 0,{}),[]),this.ghostLabel.adapters.disable(\"text\"),this.ghostLabel.setAll({opacity:0,tooltipText:void 0,tooltipHTML:void 0,interactive:!1}),this.ghostLabel.events.disable()}_updateFinals(e,t){}zoom(e,t,i,a){if(this._updateFinals(e,t),this.get(\"start\")!==e||this.get(\"end\")!=t){let o=this._sAnimation,n=this._eAnimation,r=this.get(\"maxDeviation\",.5)*Math.min(1,t-e);e<-r&&(e=-r),t>1+r&&(t=1+r),e>t&&([e,t]=[t,e]),s(i)||(i=this.get(\"interpolationDuration\",0)),a||(a=\"end\");let l=this.getPrivate(\"maxZoomFactor\",this.get(\"maxZoomFactor\",100)),h=l;1===t&&0!==e&&(a=ethis.get(\"end\")?\"end\":\"start\");let d=this.get(\"minZoomCount\"),c=this.get(\"maxZoomCount\");s(d)&&(l=h/d);let u=1;if(s(c)&&(u=h/c),\"start\"===a?(c>0&&1/(t-e)l&&(t=e+1/l),t>1&&t-e<1/l&&(e=t-1/l)):(c>0&&1/(t-e)l&&(e=t-1/l),e<0&&t-e<1/l&&(t=e+1/l)),1/(t-e)>l&&(t=e+1/l),1/(t-e)>l&&(e=t-1/l),null!=c&&null!=d&&e==this.get(\"start\")&&t==this.get(\"end\")){const e=this.chart;e&&e._handleAxisSelection(this,!0)}if((o&&o.playing&&o.to==e||this.get(\"start\")==e)&&(n&&n.playing&&n.to==t||this.get(\"end\")==t))return;if(i>0){let s,a,o=this.get(\"interpolationEasing\");if(this.get(\"start\")!=e&&(s=this.animate({key:\"start\",to:e,duration:i,easing:o})),this.get(\"end\")!=t&&(a=this.animate({key:\"end\",to:t,duration:i,easing:o})),this._sAnimation=s,this._eAnimation=a,s)return s;if(a)return a}else this.set(\"start\",e),this.set(\"end\",t),this._root.events.once(\"frameended\",(()=>{this._markDirtyKey(\"start\"),this._root._markDirty()}))}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(e,t){e.setRaw(\"isRange\",!0),this._createAssets(e,t),this._rangesDirty=!0,this._prepareDataItem(e);const i=e.get(\"above\"),s=this.topGridContainer,a=e.get(\"grid\");i&&a&&s.children.moveValue(a);const o=e.get(\"axisFill\");i&&o&&s.children.moveValue(o)}_prepareDataItem(e,t){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each((e=>{this._prepareDataItem(e)})),b(this._seriesAxisRanges,(e=>{this._prepareDataItem(e)}))}_prepareChildren(){if(super._prepareChildren(),this.get(\"fixAxisSize\")?this.ghostLabel.set(\"visible\",!0):this.ghostLabel.set(\"visible\",!1),this.isDirty(\"start\")||this.isDirty(\"end\")){this.chart._updateCursor();let e=this.get(\"start\",0),t=this.get(\"end\",1),i=this.get(\"maxDeviation\",.5)*Math.min(1,t-e);if(e<-i){let s=e+i;e=-i,this.setRaw(\"start\",e),this.isDirty(\"end\")&&this.setRaw(\"end\",t-s)}if(t>1+i){let s=t-1-i;t=1+i,this.setRaw(\"end\",t),this.isDirty(\"start\")&&this.setRaw(\"start\",e-s)}}const e=this.get(\"renderer\");if(e._start=this.get(\"start\"),e._end=this.get(\"end\"),e._inversed=e.get(\"inversed\",!1),e._axisLength=e.axisLength()/(e._end-e._start),e._updateLC(),this.isDirty(\"tooltip\")){const t=this.get(\"tooltip\");if(t){const i=e.get(\"themeTags\");t.addTag(\"axis\"),t.addTag(this.className.toLowerCase()),t._applyThemes(),i&&(t.set(\"themeTags\",y(t.get(\"themeTags\"),i)),t.label._applyThemes())}}}_updateTooltipBounds(){const e=this.get(\"tooltip\");e&&this.get(\"renderer\").updateTooltipBounds(e)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(e){this.chart=e;this.get(\"renderer\").chart=e,e.gridContainer.children.push(this.gridContainer),e.topGridContainer.children.push(this.topGridContainer),e.axisHeadersContainer.children.push(this.axisHeader),this.on(\"start\",(()=>{e._handleAxisSelection(this)})),this.on(\"end\",(()=>{e._handleAxisSelection(this)})),e.plotContainer.onPrivate(\"width\",(()=>{this.markDirtySize()})),e.plotContainer.onPrivate(\"height\",(()=>{this.markDirtySize()})),e.processAxis(this)}hideDataItem(e){return this._toggleDataItem(e,!1),super.hideDataItem(e)}showDataItem(e){return this._toggleDataItem(e,!0),super.showDataItem(e)}_toggleDataItem(e,t){const i=e.get(\"label\");i&&i.setPrivate(\"visible\",t);const s=e.get(\"grid\");s&&s.setPrivate(\"visible\",t);const a=e.get(\"tick\");a&&a.setPrivate(\"visible\",t);const o=e.get(\"axisFill\");o&&o.setPrivate(\"visible\",t);const n=e.get(\"bullet\");if(n){const e=n.get(\"sprite\");e&&e.setPrivate(\"visible\",t)}}_createAssets(e,t){const i=this.get(\"renderer\");e.get(\"label\")||i.makeLabel(e,t),e.get(\"grid\")||i.makeGrid(e,t),e.get(\"tick\")||i.makeTick(e,t),e.get(\"axisFill\")||i.makeAxisFill(e,t),this._processBullet(e)}_processBullet(e){let t=e.get(\"bullet\"),i=this.get(\"bullet\");if(t||!i||e.get(\"isRange\")||(t=i(this._root,this,e)),t){t.axis=this;const i=t.get(\"sprite\");i&&(i._setDataItem(e),e.setRaw(\"bullet\",t),i.parent||this.bulletsContainer.children.push(i))}}_afterChanged(){super._afterChanged();const e=this.chart;e&&(e._updateChartLayout(),e.axisHeadersContainer.markDirtySize()),this.get(\"renderer\")._updatePositions()}disposeDataItem(e){super.disposeDataItem(e);const t=this.get(\"renderer\"),i=e.get(\"label\");i&&(t.labels.removeValue(i),i.dispose());const s=e.get(\"tick\");s&&(t.ticks.removeValue(s),s.dispose());const a=e.get(\"grid\");a&&(t.grid.removeValue(a),a.dispose());const o=e.get(\"axisFill\");o&&(t.axisFills.removeValue(o),o.dispose());const n=e.get(\"bullet\");n&&n.dispose()}_updateGhost(){this.setPrivate(\"cellWidth\",this.getCellWidthPosition()*this.get(\"renderer\").axisLength());const e=this.ghostLabel;if(!e.isHidden()){const t=e.localBounds(),i=t.right-t.left;let s=e.get(\"text\");b(this.dataItems,(e=>{const t=e.get(\"label\");if(t&&!t.isHidden()){const e=t.localBounds();e.right-e.left>i&&(s=t.text._getText())}})),e.set(\"text\",s)}let t=this.get(\"start\",0),i=this.get(\"end\",1);this.get(\"renderer\").updateLabel(e,t+.5*(i-t))}_handleCursorPosition(e,t){e=this.get(\"renderer\").toAxisPosition(e),this._cursorPosition=e,this._snapToSeries=t,this.updateTooltip()}updateTooltip(){const e=this._snapToSeries;let t=this._cursorPosition;const i=this.get(\"tooltip\"),a=this.get(\"renderer\");s(t)&&(b(this.series,(i=>{if(i.get(\"baseAxis\")===this){const s=this.getSeriesItem(i,t,this.get(\"tooltipLocation\"));i.setRaw(\"tooltipDataItem\",s),e&&-1!=e.indexOf(i)?(i.updateLegendMarker(s),i.updateLegendValue(s)):i.showDataItemTooltip(s)}})),i&&(a.updateTooltipBounds(i),this.get(\"snapTooltip\")&&(t=this.roundAxisPosition(t,this.get(\"tooltipLocation\",.5))),C(t)?i.hide(0):(this.setPrivateRaw(\"tooltipPosition\",t),this._updateTooltipText(i,t),a.positionTooltip(i,t),tthis.get(\"end\")?i.hide(0):i.show(0))))}_updateTooltipText(e,t){e.label.set(\"text\",this.getTooltipText(t))}roundAxisPosition(e,t){return e}handleCursorShow(){let e=this.get(\"tooltip\");e&&e.show()}handleCursorHide(){let e=this.get(\"tooltip\");e&&e.hide()}processSeriesDataItem(e,t){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(e){const t=this.get(\"renderer\");return t.toAxisPosition(e/t.axisLength())}toAxisPosition(e){return this.get(\"renderer\").toAxisPosition(e)}toGlobalPosition(e){return this.get(\"renderer\").toGlobalPosition(e)}fixPosition(e){return this.get(\"renderer\").fixPosition(e)}shouldGap(e,t,i,s){return!1}createAxisRange(e){return this.axisRanges.push(e)}_groupSeriesData(e){}getCellWidthPosition(){return.05}}Object.defineProperty(ce,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"Axis\"}),Object.defineProperty(ce,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([ce.className])});class ue extends ce{constructor(){super(...arguments),Object.defineProperty(this,\"_dirtyExtremes\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_dirtySelectionExtremes\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"_deltaMinMax\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"_minReal\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_maxReal\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_baseValue\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_syncDp\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_minLogAdjusted\",{enumerable:!0,configurable:!0,writable:!0,value:1})}markDirtyExtremes(){this._dirtyExtremes=!0,this.markDirty()}markDirtySelectionExtremes(){this._dirtySelectionExtremes=!0,this.markDirty()}_afterNew(){this._settings.themeTags=y(this._settings.themeTags,[\"axis\"]),this.setPrivateRaw(\"name\",\"value\"),this.addTag(\"value\"),super._afterNew()}_prepareChildren(){if(super._prepareChildren(),this.isDirty(\"syncWithAxis\")){this._prevSettings.syncWithAxis&&this._syncDp&&this._syncDp.dispose();let e=this.get(\"syncWithAxis\");e&&(this._syncDp=new S([e.onPrivate(\"selectionMinFinal\",(()=>{this._dirtySelectionExtremes=!0})),e.onPrivate(\"selectionMaxFinal\",(()=>{this._dirtySelectionExtremes=!0}))]))}(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||this.isPrivateDirty(\"width\")||this.isPrivateDirty(\"height\")||this.isDirty(\"min\")||this.isDirty(\"max\")||this.isDirty(\"extraMin\")||this.isDirty(\"extraMax\")||this.isDirty(\"logarithmic\")||this.isDirty(\"treatZeroAs\")||this.isDirty(\"baseValue\")||this.isDirty(\"strictMinMax\")||this.isDirty(\"strictMinMaxSelection\")||this.isDirty(\"maxPrecision\")||this.isDirty(\"numberFormat\"))&&(this._getMinMax(),this.ghostLabel.set(\"text\",\"\"),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get(\"autoZoom\",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty(\"start\")||this.isDirty(\"end\")||this.isPrivateDirty(\"min\")||this.isPrivateDirty(\"selectionMax\")||this.isPrivateDirty(\"selectionMin\")||this.isPrivateDirty(\"max\")||this.isPrivateDirty(\"step\")||this.isPrivateDirty(\"width\")||this.isPrivateDirty(\"height\")||this.isDirty(\"logarithmic\"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(e){const t=this.get(\"numberFormat\"),i=this.getNumberFormatter();let s=\"\";return s=t?i.format(e,t):i.format(e,void 0,this.getPrivate(\"stepDecimalPlaces\")),s}_prepareAxisItems(){const e=this.getPrivate(\"min\"),t=this.getPrivate(\"max\");if(s(e)&&s(t)){const t=this.get(\"logarithmic\"),i=this.getPrivate(\"step\"),s=this.getPrivate(\"selectionMin\"),a=this.getPrivate(\"selectionMax\")+i;let o=s-i,r=0,l=1,h=e;if(t){if(o=this._minLogAdjusted,o2&&(o=Math.pow(10,Math.log(h)*Math.LOG10E-5))}let d=-1/0;for(;o2?o=Math.pow(10,Math.log(h)*Math.LOG10E+r-5):o+=i,d==o)break;let a=Math.pow(10,Math.floor(Math.log(Math.abs(i))*Math.LOG10E));if(a<1){let e=Math.round(Math.abs(Math.log(Math.abs(a))*Math.LOG10E))+2;o=n(o,e)}r++,d=o}for(let e=r;e{e.inited&&e._markDirtyAxes()})),this._updateGhost()}}_prepareDataItem(e,t){let i=this.get(\"renderer\"),a=e.get(\"value\"),o=e.get(\"endValue\"),n=this.valueToPosition(a),r=n,l=this.valueToPosition(a+this.getPrivate(\"step\"));s(o)&&(r=this.valueToPosition(o),l=r),e.get(\"isRange\")&&null==o&&(l=n),i.updateLabel(e.get(\"label\"),n,r,t);const h=e.get(\"grid\");if(i.updateGrid(h,n,r),h&&(a==this.get(\"baseValue\",0)?(h.addTag(\"base\"),h._applyThemes()):h.hasTag(\"base\")&&(h.removeTag(\"base\"),h._applyThemes())),i.updateTick(e.get(\"tick\"),n,r,t),i.updateFill(e.get(\"axisFill\"),n,l),this._processBullet(e),i.updateBullet(e.get(\"bullet\"),n,r),!e.get(\"isRange\")){const t=this.get(\"fillRule\");t&&t(e)}}_handleRangeChange(){let e=this.positionToValue(this.get(\"start\",0)),t=this.positionToValue(this.get(\"end\",1));const i=this.get(\"renderer\").gridCount();let s=this._adjustMinMax(e,t,i,!0),a=O(s.step);this.setPrivateRaw(\"stepDecimalPlaces\",a),e=n(e,a),t=n(t,a),s=this._adjustMinMax(e,t,i,!0);let o=s.step;e=s.min,t=s.max,this.getPrivate(\"selectionMin\")===e&&this.getPrivate(\"selectionMax\")===t&&this.getPrivate(\"step\")===o||(this.setPrivateRaw(\"selectionMin\",e),this.setPrivateRaw(\"selectionMax\",t),this.setPrivateRaw(\"step\",o))}positionToValue(e){const t=this.getPrivate(\"min\"),i=this.getPrivate(\"max\");return this.get(\"logarithmic\")?Math.pow(Math.E,(e*(Math.log(i)*Math.LOG10E-Math.log(t)*Math.LOG10E)+Math.log(t)*Math.LOG10E)/Math.LOG10E):e*(i-t)+t}valueToPosition(e){const t=this.getPrivate(\"min\"),i=this.getPrivate(\"max\");if(this.get(\"logarithmic\")){if(e<=0){let t=this.get(\"treatZeroAs\");s(t)&&(e=t)}return(Math.log(e)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(t)*Math.LOG10E)}return(e-t)/(i-t)}valueToFinalPosition(e){const t=this.getPrivate(\"minFinal\"),i=this.getPrivate(\"maxFinal\");if(this.get(\"logarithmic\")){if(e<=0){let t=this.get(\"treatZeroAs\");s(t)&&(e=t)}return(Math.log(e)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(t)*Math.LOG10E)}return(e-t)/(i-t)}getX(e,t,i){e=i+(e-i)*t;const s=this.valueToPosition(e);return this._settings.renderer.positionToCoordinate(s)}getY(e,t,i){e=i+(e-i)*t;const s=this.valueToPosition(e);return this._settings.renderer.positionToCoordinate(s)}getDataItemCoordinateX(e,t,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(e,t,i,s))}getDataItemPositionX(e,t,i,s){let a=e.get(t);if(e.get(\"stackToItemX\")){a=a*s+e.component.getStackedXValueWorking(e,t)}else a=this._baseValue+(a-this._baseValue)*s;return this.valueToPosition(a)}getDataItemCoordinateY(e,t,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(e,t,i,s))}getDataItemPositionY(e,t,i,s){let a=e.get(t);if(e.get(\"stackToItemY\")){a=a*s+e.component.getStackedYValueWorking(e,t)}else a=this._baseValue+(a-this._baseValue)*s;return this.valueToPosition(a)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const e=Math.min(this.getPrivate(\"minFinal\",-1/0),this.getPrivate(\"selectionMin\",-1/0)),t=Math.max(this.getPrivate(\"maxFinal\",1/0),this.getPrivate(\"selectionMax\",1/0));let i=this.get(\"baseValue\",0);return it&&(i=t),i}cellEndValue(e){return e}fixSmallStep(e){return 1+e===1?(e*=2,this.fixSmallStep(e)):e}_fixMin(e){return e}_fixMax(e){return e}_calculateTotals(){if(this.get(\"calculateTotals\")){let e=this.series[0];if(e){let t=e.startIndex();if(e.dataItems.length>0){t>0&&t--;let i,s,a=e.endIndex();a{if(!i.get(\"excludeFromTotal\")){let n=i.dataItems[e];if(n){let e=n.get(o)*i.get(s);C(e)||(t+=e,a+=Math.abs(e))}}})),b(this.series,(n=>{if(!n.get(\"excludeFromTotal\")){let r=n.dataItems[e];if(r){let e=r.get(o)*n.get(s);C(e)||(r.set(i+\"Total\",a),r.set(i+\"Sum\",t),r.set(i+\"TotalPercent\",e/a*100))}}}))}}}}}_getSelectionMinMax(){const e=this.getPrivate(\"minFinal\"),t=this.getPrivate(\"maxFinal\"),i=this.get(\"min\"),a=this.get(\"max\");let o=this.get(\"extraMin\",0),r=this.get(\"extraMax\",0);this.get(\"logarithmic\")&&(null==this.get(\"extraMin\")&&(o=.1),null==this.get(\"extraMax\")&&(r=.2));const l=this.get(\"renderer\").gridCount(),h=this.get(\"strictMinMaxSelection\"),d=this.get(\"strictMinMax\");if(s(e)&&s(t)){let c=t,u=e;if(b(this.series,(e=>{if(!e.get(\"ignoreMinMax\")){let t,i;const a=e.getPrivate(\"outOfSelection\");e.get(\"xAxis\")===this?a||(t=e.getPrivate(\"selectionMinX\",e.getPrivate(\"minX\")),i=e.getPrivate(\"selectionMaxX\",e.getPrivate(\"maxX\"))):e.get(\"yAxis\")===this&&(a||(t=e.getPrivate(\"selectionMinY\",e.getPrivate(\"minY\")),i=e.getPrivate(\"selectionMaxY\",e.getPrivate(\"maxY\")))),e.isHidden()||e.isShowing()||(s(t)&&(c=Math.min(c,t)),s(i)&&(u=Math.max(u,i)))}})),this.axisRanges.each((e=>{if(e.get(\"affectsMinMax\")){let t=e.get(\"value\");null!=t&&(c=Math.min(c,t),u=Math.max(u,t)),t=e.get(\"endValue\"),null!=t&&(c=Math.min(c,t),u=Math.max(u,t))}})),c>u&&([c,u]=[u,c]),s(i)?c=d?i:e:d&&s(this._minReal)&&(c=this._minReal),s(a)?u=d?a:t:d&&s(this._maxReal)&&(u=this._maxReal),c===u){c-=this._deltaMinMax,u+=this._deltaMinMax;let e=this._adjustMinMax(c,u,l,d);c=e.min,u=e.max}let g=c,p=u;c-=(u-c)*o,u+=(u-c)*r;let m=this._adjustMinMax(c,u,l);c=m.min,u=m.max,c=X(c,e,t),u=X(u,e,t),m=this._adjustMinMax(c,u,l,!0),d||(c=m.min,u=m.max);const _=this.get(\"syncWithAxis\");_&&(m=this._syncAxes(c,u,m.step,_.getPrivate(\"selectionMinFinal\",_.getPrivate(\"minFinal\",0)),_.getPrivate(\"selectionMaxFinal\",_.getPrivate(\"maxFinal\",1)),_.getPrivate(\"selectionStepFinal\",_.getPrivate(\"step\",1))),c=m.min,u=m.max),d&&(s(i)&&(c=Math.max(c,i)),s(a)&&(u=Math.min(u,a))),h&&(c=g-(u-c)*o,u=p+(u-c)*r),this.get(\"logarithmic\")&&(c<=0&&(c=g*(1-Math.min(o,.99))),ct&&(u=t));let x=Math.min(20,Math.ceil(Math.log(this.getPrivate(\"maxZoomFactor\",100)+1)/Math.LN10)+2),f=n(this.valueToFinalPosition(c),x),v=n(this.valueToFinalPosition(u),x);this.setPrivateRaw(\"selectionMinFinal\",c),this.setPrivateRaw(\"selectionMaxFinal\",u),this.setPrivateRaw(\"selectionStepFinal\",m.step),this.zoom(f,v)}}_getMinMax(){let e=this.get(\"min\"),t=this.get(\"max\"),i=1/0,a=-1/0,o=this.get(\"extraMin\",0),r=this.get(\"extraMax\",0);this.get(\"logarithmic\")&&(null==this.get(\"extraMin\")&&(o=.1),null==this.get(\"extraMax\")&&(r=.2));let l=1/0;if(b(this.series,(e=>{if(!e.get(\"ignoreMinMax\")){let t,o;if(e.get(\"xAxis\")===this?(t=e.getPrivate(\"minX\"),o=e.getPrivate(\"maxX\")):e.get(\"yAxis\")===this&&(t=e.getPrivate(\"minY\"),o=e.getPrivate(\"maxY\")),s(t)&&s(o)){i=Math.min(i,t),a=Math.max(a,o);let e=o-t;e<=0&&(e=Math.abs(o/100)),e{if(e.get(\"affectsMinMax\")){let t=e.get(\"value\");null!=t&&(i=Math.min(i,t),a=Math.max(a,t)),t=e.get(\"endValue\"),null!=t&&(i=Math.min(i,t),a=Math.max(a,t))}})),this.get(\"logarithmic\")){let e=this.get(\"treatZeroAs\");s(e)&&i<=0&&(i=e)}if(0===i&&0===a&&(a=.9,i=-.9),s(e)&&(i=e),s(t)&&(a=t),i===1/0||a===-1/0)return this.setPrivate(\"minFinal\",void 0),void this.setPrivate(\"maxFinal\",void 0);const h=i,d=a;let c=this.adapters.fold(\"min\",i),u=this.adapters.fold(\"max\",a);s(c)&&(i=c),s(u)&&(a=u),i=this._fixMin(i),a=this._fixMax(a),a-i<=1/Math.pow(10,15)&&(a-i!=0?this._deltaMinMax=(a-i)/2:this._getDelta(a),i-=this._deltaMinMax,a+=this._deltaMinMax),i-=(a-i)*o,a+=(a-i)*r,this.get(\"logarithmic\")&&(i<0&&h>=0&&(i=0),a>0&&d<=0&&(a=0)),this._minReal=i,this._maxReal=a;let g=this.get(\"strictMinMax\"),p=this.get(\"strictMinMaxSelection\",!1);p&&(g=p);let m=g;s(t)&&(m=!0);let _=this.get(\"renderer\").gridCount(),x=this._adjustMinMax(i,a,_,m);i=x.min,a=x.max,x=this._adjustMinMax(i,a,_,!0),i=x.min,a=x.max,g&&(i=s(e)?e:this._minReal,a=s(t)?t:this._maxReal,a-i<=1e-8&&(i-=this._deltaMinMax,a+=this._deltaMinMax),i-=(a-i)*o,a+=(a-i)*r),c=this.adapters.fold(\"min\",i),u=this.adapters.fold(\"max\",a),s(c)&&(i=c),s(u)&&(a=u),l==1/0&&(l=a-i);let f=Math.round(Math.abs(Math.log(Math.abs(a-i))*Math.LOG10E))+5;i=n(i,f),a=n(a,f);const v=this.get(\"syncWithAxis\");if(v&&(x=this._syncAxes(i,a,x.step,v.getPrivate(\"minFinal\",v.getPrivate(\"min\",0)),v.getPrivate(\"maxFinal\",v.getPrivate(\"max\",1)),v.getPrivate(\"step\",1)),i=x.min,a=x.max),this.setPrivateRaw(\"maxZoomFactor\",Math.max(1,Math.ceil((a-i)/l*this.get(\"maxZoomFactor\",100)))),this._fixZoomFactor(),this.get(\"logarithmic\")&&(this._minLogAdjusted=i,i=this._minReal,a=this._maxReal,i<=0&&(i=h*(1-Math.min(o,.99)))),s(i)&&s(a)&&(this.getPrivate(\"minFinal\")!==i||this.getPrivate(\"maxFinal\")!==a)){this.setPrivate(\"minFinal\",i),this.setPrivate(\"maxFinal\",a),this._saveMinMax(i,a);const e=this.get(\"interpolationDuration\",0),t=this.get(\"interpolationEasing\");this.animatePrivate({key:\"min\",to:i,duration:e,easing:t}),this.animatePrivate({key:\"max\",to:a,duration:e,easing:t})}}_fixZoomFactor(){}_getDelta(e){let t=Math.log(Math.abs(e))*Math.LOG10E,i=Math.pow(10,Math.floor(t));i/=10,this._deltaMinMax=i}_saveMinMax(e,t){}_adjustMinMax(e,t,i,a){i<=1&&(i=1),i=Math.round(i);let o=e,r=t,l=t-e;0===l&&(l=Math.abs(t));let h=Math.log(Math.abs(l))*Math.LOG10E,d=Math.pow(10,Math.floor(h));d/=10;let c=d;a&&(c=0),a?(e=Math.floor(e/d)*d,t=Math.ceil(t/d)*d):(e=Math.ceil(e/d)*d-c,t=Math.floor(t/d)*d+c),e<0&&o>=0&&(e=0),t>0&&r<=0&&(t=0),h=Math.log(Math.abs(l))*Math.LOG10E,d=Math.pow(10,Math.floor(h)),d/=100;let u=Math.ceil(l/i/d)*d,g=Math.pow(10,Math.floor(Math.log(Math.abs(u))*Math.LOG10E)),p=Math.ceil(u/g);p>5?p=10:p<=5&&p>2&&(p=5),u=Math.ceil(u/(g*p))*g*p;let m=this.get(\"maxPrecision\");if(s(m)){let e=Y(u,m);mo&&(e-=u),u=this.fixSmallStep(u),{min:e,max:t,step:u}}getTooltipText(e,t){const i=this.get(\"tooltipNumberFormat\",this.get(\"numberFormat\")),s=this.getNumberFormatter(),a=this.get(\"extraTooltipPrecision\",0),o=this.getPrivate(\"stepDecimalPlaces\",0)+a,r=n(this.positionToValue(e),o);return i?s.format(r,i):s.format(r,void 0,o)}getSeriesItem(e,t){let i,s,a=this.getPrivate(\"name\")+this.get(\"renderer\").getPrivate(\"letter\"),o=this.positionToValue(t);if(b(e.dataItems,((e,t)=>{const n=Math.abs(e.get(a)-o);(void 0===i||n500&&(s=!0),s)e=n,t=l,i=d;else{a/3==Math.round(a/3)?(n=e-o*a,e>=0&&n<0&&(n=0)):(l=t+o*a,l<=0&&l>0&&(l=0));let i=this._adjustMinMax(n,l,h,!0);n=i.min,l=i.max,d=i.step}}}return{min:e,max:t,step:i}}_checkSync(e,t,i,s){let a=(t-e)/i;for(let o=1;ope._new(this._root,{themeTags:y(this.ticks.template.get(\"themeTags\",[]),this.get(\"themeTags\",[]))},[this.ticks.template])))}),Object.defineProperty(this,\"grid\",{enumerable:!0,configurable:!0,writable:!0,value:new F(R.new({}),(()=>ne._new(this._root,{themeTags:y(this.grid.template.get(\"themeTags\",[]),this.get(\"themeTags\",[]))},[this.grid.template])))}),Object.defineProperty(this,\"axisFills\",{enumerable:!0,configurable:!0,writable:!0,value:new F(R.new({}),(()=>d._new(this._root,{themeTags:y(this.axisFills.template.get(\"themeTags\",[\"axis\",\"fill\"]),this.get(\"themeTags\",[]))},[this.axisFills.template])))}),Object.defineProperty(this,\"labels\",{enumerable:!0,configurable:!0,writable:!0,value:new F(R.new({}),(()=>ge._new(this._root,{themeTags:y(this.labels.template.get(\"themeTags\",[]),this.get(\"themeTags\",[]))},[this.labels.template])))}),Object.defineProperty(this,\"axis\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"thumb\",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(e,t){const i=this.ticks.make();return i._setDataItem(e),e.setRaw(\"tick\",i),i.set(\"themeTags\",y(i.get(\"themeTags\"),t)),this.axis.labelsContainer.children.push(i),this.ticks.push(i),i}makeGrid(e,t){const i=this.grid.make();return i._setDataItem(e),e.setRaw(\"grid\",i),i.set(\"themeTags\",y(i.get(\"themeTags\"),t)),this.axis.gridContainer.children.push(i),this.grid.push(i),i}makeAxisFill(e,t){const i=this.axisFills.make();return i._setDataItem(e),i.set(\"themeTags\",y(i.get(\"themeTags\"),t)),this.axis.gridContainer.children.push(i),e.setRaw(\"axisFill\",i),this.axisFills.push(i),i}makeLabel(e,t){const i=this.labels.make();return i.set(\"themeTags\",y(i.get(\"themeTags\"),t)),this.axis.labelsContainer.children.moveValue(i,0),i._setDataItem(e),e.setRaw(\"label\",i),this.labels.push(i),i}axisLength(){return 0}gridCount(){return this.axisLength()/this.get(\"minGridDistance\",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set(\"isMeasured\",!1);const e=this.thumb;e&&(this._disposers.push(e.events.on(\"pointerdown\",(e=>{this._handleThumbDown(e)}))),this._disposers.push(e.events.on(\"globalpointerup\",(e=>{this._handleThumbUp(e)}))),this._disposers.push(e.events.on(\"globalpointermove\",(e=>{this._handleThumbMove(e)}))))}_changed(){if(super._changed(),this.isDirty(\"pan\")){const e=this.thumb;if(e){const t=this.axis.labelsContainer,i=this.get(\"pan\");\"zoom\"==i?t.children.push(e):\"none\"==i&&t.children.removeValue(e)}}}_handleThumbDown(e){this._thumbDownPoint=this.toLocal(e.point);const t=this.axis;this._downStart=t.get(\"start\"),this._downEnd=t.get(\"end\")}_handleThumbUp(e){this._thumbDownPoint=void 0}_handleThumbMove(e){const t=this._thumbDownPoint;if(t){const i=this.toLocal(e.point),s=this._downStart,a=this._downEnd,o=this._getPan(i,t)*Math.min(1,a-s)/2;this.axis.zoom(s-o,a+o,0)}}_getPan(e,t){return 0}positionToCoordinate(e){return this._inversed?(this._end-e)*this._axisLength:(e-this._start)*this._axisLength}updateTooltipBounds(e){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(e){const t=this._start||0,i=this._end||1;return e*=i-t,e=this.get(\"inversed\")?i-e:t+e}toGlobalPosition(e){const t=this._start||0,i=this._end||1;return this.get(\"inversed\")?e=i-e:e-=t,e/=i-t}fixPosition(e){return this.get(\"inversed\")?1-e:e}_updateLC(){}toggleVisibility(e,t,i,s){let a=this.axis;const o=a.get(\"start\",0),n=a.get(\"end\",1);to+(n-o)*(s+1e-4)?e.setPrivate(\"visible\",!1):e.setPrivate(\"visible\",!0)}_positionTooltip(e,t){const i=this.chart;i&&(i.inPlot(t)?e.set(\"pointTo\",this._display.toGlobal(t)):e.hide())}processAxis(){}}Object.defineProperty(me,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"AxisRenderer\"}),Object.defineProperty(me,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:d.classNames.concat([me.className])});class _e extends me{constructor(){super(...arguments),Object.defineProperty(this,\"thumb\",{enumerable:!0,configurable:!0,writable:!0,value:c.new(this._root,{width:t,isMeasured:!1,themeTags:[\"axis\",\"x\",\"thumb\"]})})}_afterNew(){this._settings.themeTags=y(this._settings.themeTags,[\"renderer\",\"x\"]),super._afterNew(),this.setPrivateRaw(\"letter\",\"X\");const e=this.grid.template;e.set(\"height\",t),e.set(\"width\",0),e.set(\"draw\",((e,t)=>{e.moveTo(0,0),e.lineTo(0,t.height())})),this.set(\"draw\",((e,t)=>{e.moveTo(0,0),e.lineTo(t.width(),0)}))}_changed(){super._changed();const e=this.axis;e.ghostLabel.setPrivate(\"visible\",!this.get(\"inside\")),e.ghostLabel.set(\"x\",-1e3);const t=\"opposite\",i=\"inside\";if(this.isDirty(t)||this.isDirty(i)){const s=this.chart,a=e.children;if(this.get(i)?e.addTag(i):e.removeTag(i),s){if(this.get(t)){const i=s.topAxesContainer.children;-1==i.indexOf(e)&&i.insertIndex(0,e),e.addTag(t),a.moveValue(this)}else{const i=s.bottomAxesContainer.children;-1==i.indexOf(e)&&i.moveValue(e),e.removeTag(t),a.moveValue(this,0)}e.ghostLabel._applyThemes(),this.labels.each((e=>{e._applyThemes()})),this.root._markDirtyRedraw()}e.markDirtySize()}this.thumb.setPrivate(\"height\",e.labelsContainer.height())}_getPan(e,t){return(t.x-e.x)/this.width()}toAxisPosition(e){const t=this._start||0,i=this._end||1;return e=(e-=this._ls)*(i-t)/this._lc,e=this.get(\"inversed\")?i-e:t+e}toGlobalPosition(e){const t=this._start||0,i=this._end||1;return this.get(\"inversed\")?e=i-e:e-=t,e=e/(i-t)*this._lc,e+=this._ls}_updateLC(){const e=this.axis,t=e.parent;if(t){const i=t.innerWidth();this._lc=this.axisLength()/i,this._ls=(e.x()-t.get(\"paddingLeft\",0))/i}}_updatePositions(){const e=this.axis,t=e.x()-M(e.get(\"centerX\",0),e.width())-e.parent.get(\"paddingLeft\",0);e.gridContainer.set(\"x\",t),e.topGridContainer.set(\"x\",t),e.bulletsContainer.set(\"y\",this.y());const i=e.chart;if(i){const t=i.plotContainer,s=e.axisHeader;let a=e.get(\"marginLeft\",0),o=e.x()-a;const n=e.parent;n&&(o-=n.get(\"paddingLeft\",0)),s.children.length>0?(a=e.axisHeader.width(),e.set(\"marginLeft\",a+1)):s.set(\"width\",a),s.setAll({x:o,y:-1,height:t.height()+2})}}processAxis(){super.processAxis();const e=this.axis;e.set(\"width\",t);const i=this._root.verticalLayout;e.set(\"layout\",i),e.labelsContainer.set(\"width\",t),e.axisHeader.setAll({layout:i})}axisLength(){return this.axis.width()}positionToPoint(e){return{x:this.positionToCoordinate(e),y:0}}updateTick(e,i,a,o){if(e){s(i)||(i=0);let n=.5;n=s(o)&&o>1?e.get(\"multiLocation\",n):e.get(\"location\",n),s(a)&&a!=i&&(i+=(a-i)*n),e.set(\"x\",this.positionToCoordinate(i));let r=e.get(\"length\",0);const l=e.get(\"inside\",this.get(\"inside\",!1));this.get(\"opposite\")?(e.set(\"y\",t),l||(r*=-1)):(e.set(\"y\",0),l&&(r*=-1)),e.set(\"draw\",(e=>{e.moveTo(0,0),e.lineTo(0,r)})),this.toggleVisibility(e,i,e.get(\"minPosition\",0),e.get(\"maxPosition\",1))}}updateLabel(e,i,a,o){if(e){let n=.5;n=s(o)&&o>1?e.get(\"multiLocation\",n):e.get(\"location\",n),s(i)||(i=0);const r=e.get(\"inside\",this.get(\"inside\",!1));this.get(\"opposite\")?r?(e.set(\"position\",\"absolute\"),e.set(\"y\",0)):(e.set(\"position\",\"relative\"),e.set(\"y\",t)):r?(e.set(\"y\",0),e.set(\"position\",\"absolute\")):(e.set(\"y\",void 0),e.set(\"position\",\"relative\")),s(a)&&a!=i&&(i+=(a-i)*n),e.set(\"x\",this.positionToCoordinate(i)),this.toggleVisibility(e,i,e.get(\"minPosition\",0),e.get(\"maxPosition\",1))}}updateGrid(e,t,i){if(e){s(t)||(t=0);let a=e.get(\"location\",.5);s(i)&&i!=t&&(t+=(i-t)*a),e.set(\"x\",this.positionToCoordinate(t)),this.toggleVisibility(e,t,0,1)}}updateBullet(e,t,i){if(e){const a=e.get(\"sprite\");if(a){s(t)||(t=0);let o=e.get(\"location\",.5);s(i)&&i!=t&&(t+=(i-t)*o);let n=this.axis.roundAxisPosition(t,o),r=this.axis._bullets[n],l=-1;if(this.get(\"opposite\")&&(l=1),e.get(\"stacked\"))if(r){let e=r.get(\"sprite\");e&&a.set(\"y\",e.y()+e.height()*l)}else a.set(\"y\",0);this.axis._bullets[n]=e,a.set(\"x\",this.positionToCoordinate(t)),this.toggleVisibility(a,t,0,1)}}}updateFill(e,t,i){if(e){s(t)||(t=0),s(i)||(i=1);let a=this.positionToCoordinate(t),o=this.positionToCoordinate(i);this.fillDrawMethod(e,a,o)}}fillDrawMethod(e,t,i){e.set(\"draw\",(e=>{const s=this.axis.gridContainer.height(),a=this.width();ia||i<0||(e.moveTo(t,0),e.lineTo(i,0),e.lineTo(i,s),e.lineTo(t,s),e.lineTo(t,0))}))}positionTooltip(e,t){this._positionTooltip(e,{x:this.positionToCoordinate(t),y:0})}updateTooltipBounds(e){const t=this.get(\"inside\"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.x,o=0,n=this.axisLength(),r=i,l=\"up\";this.get(\"opposite\")?t?(l=\"up\",o=s.y,r=i):(l=\"down\",o=s.y-i,r=i):t?(l=\"down\",o=s.y-i,r=i):(l=\"up\",o=s.y,r=i);const h={left:a,right:a+n,top:o,bottom:o+r},d=e.get(\"bounds\");I(h,d)||(e.set(\"bounds\",h),e.set(\"pointerOrientation\",l))}}Object.defineProperty(_e,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"AxisRendererX\"}),Object.defineProperty(_e,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:me.classNames.concat([_e.className])});class be extends me{constructor(){super(...arguments),Object.defineProperty(this,\"_downY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"thumb\",{enumerable:!0,configurable:!0,writable:!0,value:c.new(this._root,{height:t,isMeasured:!1,themeTags:[\"axis\",\"y\",\"thumb\"]})})}_afterNew(){this._settings.themeTags=y(this._settings.themeTags,[\"renderer\",\"y\"]),this._settings.opposite&&this._settings.themeTags.push(\"opposite\"),super._afterNew(),this.setPrivateRaw(\"letter\",\"Y\");const e=this.grid.template;e.set(\"width\",t),e.set(\"height\",0),e.set(\"draw\",((e,t)=>{e.moveTo(0,0),e.lineTo(t.width(),0)})),this.set(\"draw\",((e,t)=>{e.moveTo(0,0),e.lineTo(0,t.height())}))}_getPan(e,t){return(e.y-t.y)/this.height()}_changed(){super._changed();const e=this.axis;e.ghostLabel.setPrivate(\"visible\",!this.get(\"inside\")),e.ghostLabel.set(\"y\",-1e3);const t=this.thumb,i=\"opposite\",s=\"inside\",a=this.chart;if(this.isDirty(i)||this.isDirty(s)){const t=e.children;if(this.get(s)?e.addTag(s):e.removeTag(s),a){if(this.get(i)){const s=a.rightAxesContainer.children;-1==s.indexOf(e)&&s.moveValue(e,0),e.addTag(i),t.moveValue(this,0)}else{const s=a.leftAxesContainer.children;-1==s.indexOf(e)&&s.moveValue(e),e.removeTag(i),t.moveValue(this)}e.ghostLabel._applyThemes(),this.labels.each((e=>{e._applyThemes()})),this.root._markDirtyRedraw()}e.markDirtySize()}const o=e.labelsContainer.width();a&&(this.get(i)?t.set(\"centerX\",0):t.set(\"centerX\",o)),t.setPrivate(\"width\",o)}processAxis(){super.processAxis();const e=this.axis;null==e.get(\"height\")&&e.set(\"height\",t);const i=this._root.horizontalLayout;e.set(\"layout\",i),e.labelsContainer.set(\"height\",t),e.axisHeader.set(\"layout\",i)}_updatePositions(){const e=this.axis,t=e.y()-M(e.get(\"centerY\",0),e.height());e.gridContainer.set(\"y\",t),e.topGridContainer.set(\"y\",t),e.bulletsContainer.set(\"x\",this.x());const i=e.chart;if(i){const t=i.plotContainer,s=e.axisHeader;let a=e.get(\"marginTop\",0);s.children.length>0?(a=e.axisHeader.height(),e.set(\"marginTop\",a+1)):s.set(\"height\",a),s.setAll({y:e.y()-a,x:-1,width:t.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(e){return{x:0,y:this.positionToCoordinate(e)}}updateLabel(e,t,i,a){if(e){s(t)||(t=0);let o=.5;o=s(a)&&a>1?e.get(\"multiLocation\",o):e.get(\"location\",o);const n=this.get(\"opposite\"),r=e.get(\"inside\",this.get(\"inside\",!1));n?(e.set(\"x\",0),r?e.set(\"position\",\"absolute\"):e.set(\"position\",\"relative\")):r?(e.set(\"x\",0),e.set(\"position\",\"absolute\")):(e.set(\"x\",void 0),e.set(\"position\",\"relative\")),s(i)&&i!=t&&(t+=(i-t)*o),e.set(\"y\",this.positionToCoordinate(t)),this.toggleVisibility(e,t,e.get(\"minPosition\",0),e.get(\"maxPosition\",1))}}updateGrid(e,t,i){if(e){s(t)||(t=0);let a=e.get(\"location\",.5);s(i)&&i!=t&&(t+=(i-t)*a),e.set(\"y\",this.positionToCoordinate(t)),this.toggleVisibility(e,t,0,1)}}updateTick(e,t,i,a){if(e){s(t)||(t=0);let o=.5;o=s(a)&&a>1?e.get(\"multiLocation\",o):e.get(\"location\",o),s(i)&&i!=t&&(t+=(i-t)*o),e.set(\"y\",this.positionToCoordinate(t));let n=e.get(\"length\",0);const r=e.get(\"inside\",this.get(\"inside\",!1));this.get(\"opposite\")?(e.set(\"x\",0),r&&(n*=-1)):r||(n*=-1),e.set(\"draw\",(e=>{e.moveTo(0,0),e.lineTo(n,0)})),this.toggleVisibility(e,t,e.get(\"minPosition\",0),e.get(\"maxPosition\",1))}}updateBullet(e,t,i){if(e){const a=e.get(\"sprite\");if(a){s(t)||(t=0);let o=e.get(\"location\",.5);s(i)&&i!=t&&(t+=(i-t)*o);let n=this.axis.roundAxisPosition(t,o),r=this.axis._bullets[n],l=1;if(this.get(\"opposite\")&&(l=-1),e.get(\"stacked\"))if(r){let e=r.get(\"sprite\");e&&a.set(\"x\",e.x()+e.width()*l)}else a.set(\"x\",0);this.axis._bullets[n]=e,a.set(\"y\",this.positionToCoordinate(t)),this.toggleVisibility(a,t,0,1)}}}updateFill(e,t,i){if(e){s(t)||(t=0),s(i)||(i=1);let a=this.positionToCoordinate(t),o=this.positionToCoordinate(i);this.fillDrawMethod(e,a,o)}}fillDrawMethod(e,t,i){e.set(\"draw\",(e=>{const s=this.axis.gridContainer.width(),a=this.height();ia||i<0||(e.moveTo(0,t),e.lineTo(s,t),e.lineTo(s,i),e.lineTo(0,i),e.lineTo(0,t))}))}positionToCoordinate(e){return this._inversed?(e-this._start)*this._axisLength:(this._end-e)*this._axisLength}positionTooltip(e,t){this._positionTooltip(e,{x:0,y:this.positionToCoordinate(t)})}updateTooltipBounds(e){const t=this.get(\"inside\"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.y,o=0,n=this.axisLength(),r=i,l=\"right\";this.get(\"opposite\")?t?(l=\"right\",o=s.x-i,r=i):(l=\"left\",o=s.x,r=i):t?(l=\"left\",o=s.x,r=i):(l=\"right\",o=s.x-i,r=i);const h={left:o,right:o+r,top:a,bottom:a+n},d=e.get(\"bounds\");I(h,d)||(e.set(\"bounds\",h),e.set(\"pointerOrientation\",l))}_updateLC(){const e=this.axis,t=e.parent;if(t){const i=t.innerHeight();this._lc=this.axisLength()/i,this._ls=e.y()/i}}toAxisPosition(e){const t=this._start||0,i=this._end||1;return e=(e-=this._ls)*(i-t)/this._lc,e=this.get(\"inversed\")?t+e:i-e}toGlobalPosition(e){const t=this._start||0,i=this._end||1;return this.get(\"inversed\")?e-=t:e=i-e,e=e/(i-t)*this._lc,e+=this._ls}fixPosition(e){return this.get(\"inversed\")?e:1-e}}Object.defineProperty(be,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"AxisRendererY\"}),Object.defineProperty(be,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:me.classNames.concat([be.className])});class xe extends de{constructor(){super(...arguments),Object.defineProperty(this,\"_endIndex\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_strokeGenerator\",{enumerable:!0,configurable:!0,writable:!0,value:ie()}),Object.defineProperty(this,\"_fillGenerator\",{enumerable:!0,configurable:!0,writable:!0,value:se()}),Object.defineProperty(this,\"_legendStroke\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_legendFill\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"strokes\",{enumerable:!0,configurable:!0,writable:!0,value:new F(R.new({}),(()=>d._new(this._root,{themeTags:y(this.strokes.template.get(\"themeTags\",[]),[\"line\",\"series\",\"stroke\"])},[this.strokes.template])))}),Object.defineProperty(this,\"fills\",{enumerable:!0,configurable:!0,writable:!0,value:new F(R.new({}),(()=>d._new(this._root,{themeTags:y(this.strokes.template.get(\"themeTags\",[]),[\"line\",\"series\",\"fill\"])},[this.fills.template])))}),Object.defineProperty(this,\"_fillTemplate\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_strokeTemplate\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"_previousPoint\",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,\"_dindex\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_sindex\",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0((function(e){return e[3]})),this._fillGenerator.x0((function(e){return e[2]})),this._fillGenerator.y1((function(e){return e[1]})),this._fillGenerator.x1((function(e){return e[0]})),super._afterNew()}makeStroke(e){const t=this.mainContainer.children.push(e.make());return e.push(t),t}makeFill(e){const t=this.mainContainer.children.push(e.make());return e.push(t),t}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let e=this.get(\"xAxis\"),t=this.get(\"yAxis\");if(this.isDirty(\"stroke\")){const e=this.get(\"stroke\");this.strokes.template.set(\"stroke\",e);const t=this._legendStroke;t&&t.states.lookup(\"default\").set(\"stroke\",e)}if(this.isDirty(\"fill\")){const e=this.get(\"fill\");this.fills.template.set(\"fill\",e);const t=this._legendFill;t&&t.states.lookup(\"default\").set(\"fill\",e)}if(this.isDirty(\"curveFactory\")){const e=this.get(\"curveFactory\");e&&(this._strokeGenerator.curve(e),this._fillGenerator.curve(e))}if(e.inited&&t.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty(\"vcx\")||this.isDirty(\"vcy\")||this._sizeDirty||this.isDirty(\"connect\")||this.isDirty(\"curveFactory\")){this.fills.each((e=>{e.setPrivate(\"visible\",!1)})),this.strokes.each((e=>{e.setPrivate(\"visible\",!1)})),this.axisRanges.each((e=>{let t=e.fills;t&&t.each((e=>{e.setPrivate(\"visible\",!1)}));let i=e.strokes;i&&i.each((e=>{e.setPrivate(\"visible\",!1)}))}));let e=this.startIndex(),t=this.strokes.template.get(\"templateField\"),i=this.fills.template.get(\"templateField\"),a=!0,o=!0;t&&(a=!1),i&&(o=!1);for(let l=e-1;l>=0;l--){let n=this.dataItems[l],r=!0,h=n.dataContext;if(t&&h[t]&&(a=!0),i&&h[i]&&(o=!0),b(this._valueFields,(e=>{s(n.get(e))||(r=!1)})),r&&a&&o){e=l;break}}let n=this.dataItems.length,r=this.endIndex();if(r{s(t.get(e))||(i=!1)})),i){r=e+1;break}}}if(e>0&&e--,this._endIndex=r,this._clearGraphics(),this._sindex=0,this._dindex=e,1==this.dataItems.length)this._startSegment(0);else for(;this._dindex0&&(F=!0);let I=!1;(y||f||v)&&(I=!0);const j={points:D,segments:A,stacked:y,getOpen:I,basePosX:w,basePosY:P,fillVisible:F,xField:m,yField:_,xOpenField:b,yOpenField:x,vcx:g,vcy:p,baseAxis:u,xAxis:d,yAxis:c,locationX:C,locationY:S,openLocationX:O,openLocationY:X,minDistance:Y};for(L=e;Le){i=L;break}l.template=s}}if(M){let s=t.dataContext[M];if(s){if(s instanceof R||(s=R.new(s)),this._fillTemplate=s,L>e){i=L;break}o.template=s}}if(!a){let e=this.dataItems[L+1];e&&u.shouldGap(t,e,s,k)&&(D=[],A.push(D),j.points=D)}}o.setRaw(\"userData\",[e,L]),l.setRaw(\"userData\",[e,L]),L===t&&this._endLine(D,A[0][0]),l&&this._drawStroke(l,A),o&&this._drawFill(o,A),this.axisRanges.each((t=>{const i=t.container,s=t.fills,a=this.makeFill(s);i&&i.children.push(a),a.setPrivate(\"visible\",!0),this._drawFill(a,A);const o=t.strokes,n=this.makeStroke(o);i&&i.children.push(n),n.setPrivate(\"visible\",!0),this._drawStroke(n,A),a.setRaw(\"userData\",[e,L]),n.setRaw(\"userData\",[e,L])}))}_getPoints(e,t){let i=t.points,s=e.get(\"locationX\",t.locationX),a=e.get(\"locationY\",t.locationY),o=t.xAxis.getDataItemPositionX(e,t.xField,s,t.vcx),n=t.yAxis.getDataItemPositionY(e,t.yField,a,t.vcy);if(this._shouldInclude(o)){const s=this.getPoint(o,n),a=[s.x,s.y];if(s.x+=this._x,s.y+=this._y,e.set(\"point\",s),t.fillVisible){let i=o,s=n;if(t.baseAxis===t.xAxis?s=t.basePosY:t.baseAxis===t.yAxis&&(i=t.basePosX),t.getOpen){let a=e.get(t.xOpenField),o=e.get(t.yOpenField);if(null!=a&&null!=o){let a=e.get(\"openLocationX\",t.openLocationX),o=e.get(\"openLocationY\",t.openLocationY);if(t.stacked){let n=e.get(\"stackToItemX\"),r=e.get(\"stackToItemY\");n?(i=t.xAxis.getDataItemPositionX(n,t.xField,a,n.component.get(\"vcx\")),C(i)&&(i=t.basePosX)):i=t.yAxis===t.baseAxis?t.basePosX:t.xAxis.getDataItemPositionX(e,t.xOpenField,a,t.vcx),r?(s=t.yAxis.getDataItemPositionY(r,t.yField,o,r.component.get(\"vcy\")),C(s)&&(s=t.basePosY)):s=t.xAxis===t.baseAxis?t.basePosY:t.yAxis.getDataItemPositionY(e,t.yOpenField,o,t.vcy)}else i=t.xAxis.getDataItemPositionX(e,t.xOpenField,a,t.vcx),s=t.yAxis.getDataItemPositionY(e,t.yOpenField,o,t.vcy)}}let r=this.getPoint(i,s);a[2]=r.x,a[3]=r.y}if(t.minDistance>0){const e=a[0],s=a[1],o=a[2],n=a[3],r=this._previousPoint,l=r[0],h=r[1],d=r[2],c=r[3];(Math.hypot(e-l,s-h)>t.minDistance||o&&n&&Math.hypot(o-d,n-c)>t.minDistance)&&(i.push(a),this._previousPoint=a)}else i.push(a)}}_endLine(e,t){}_drawStroke(e,t){e.get(\"visible\")&&!e.get(\"forceHidden\")&&e.set(\"draw\",(e=>{b(t,(t=>{this._strokeGenerator.context(e),this._strokeGenerator(t)}))}))}_drawFill(e,t){e.get(\"visible\")&&!e.get(\"forceHidden\")&&e.set(\"draw\",(e=>{b(t,(t=>{this._fillGenerator.context(e),this._fillGenerator(t)}))}))}_processAxisRange(e){super._processAxisRange(e),e.fills=new F(R.new({}),(()=>d._new(this._root,{themeTags:y(e.fills.template.get(\"themeTags\",[]),[\"line\",\"series\",\"fill\"])},[this.fills.template,e.fills.template]))),e.strokes=new F(R.new({}),(()=>d._new(this._root,{themeTags:y(e.strokes.template.get(\"themeTags\",[]),[\"line\",\"series\",\"stroke\"])},[this.strokes.template,e.strokes.template])))}createLegendMarker(e){const t=this.get(\"legendDataItem\");if(t){const e=t.get(\"marker\"),i=t.get(\"markerRectangle\");i&&i.setPrivate(\"visible\",!1),e.set(\"background\",c.new(e._root,{fillOpacity:0,fill:j(0)}));const s=e.children.push(d._new(e._root,{themeTags:[\"line\",\"series\",\"legend\",\"marker\",\"stroke\"],interactive:!1},[this.strokes.template]));this._legendStroke=s;const a=e.children.push(d._new(e._root,{themeTags:[\"line\",\"series\",\"legend\",\"marker\",\"fill\"]},[this.fills.template]));this._legendFill=a;const o=this._root.interfaceColors.get(\"disabled\");if(s.states.create(\"disabled\",{fill:o,stroke:o}),a.states.create(\"disabled\",{fill:o,stroke:o}),this.bullets.length>0){const t=this.bullets.getIndex(0);if(t){const i=t(e._root,this,new B(this,{legend:!0},{}));if(i){const t=i.get(\"sprite\");t instanceof d&&t.states.create(\"disabled\",{fill:o,stroke:o}),t&&(t.set(\"tooltipText\",void 0),t.set(\"tooltipHTML\",void 0),e.children.push(t),t.setAll({x:e.width()/2,y:e.height()/2}))}}}}}}Object.defineProperty(xe,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"LineSeries\"}),Object.defineProperty(xe,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:de.classNames.concat([xe.className])});export{_e as A,xe as L,ue as V,oe as X,be as a,re as b,de as c,ce as d};\n","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport{c as t,d as e}from\"../../../chunks/LineSeries.js\";export{A as AxisRendererXAm5,a as AxisRendererYAm5,L as LineSeriesAm5,V as ValueAxisAm5,X as XYChartAm5,b as XYCursorAm5}from\"../../../chunks/LineSeries.js\";import{e as i,Q as s,aA as o,g as n,aM as r,ak as h,aj as l,af as g,aD as d,aE as c}from\"../../../chunks/Theme.js\";import{a as m}from\"../../../chunks/tslib.es6.js\";import{R as p}from\"../../../chunks/Button.js\";class u extends t{constructor(){super(...arguments),Object.defineProperty(this,\"_ph\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"_pw\",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(t,e){return this.makeColumn(e,t)}_makeFieldNames(){super._makeFieldNames();const t=this.get(\"xAxis\"),e=this.get(\"yAxis\"),i=\"CategoryAxis\",s=\"ValueAxis\";t.isType(i)&&(this.get(\"openCategoryXField\")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get(\"openValueXField\")||(this._xOpenField=this._xField)),e.isType(i)&&(this.get(\"openCategoryYField\")||(this._yOpenField=this._yField)),e.isType(s)&&(this.get(\"openValueYField\")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const t=this.get(\"xAxis\"),e=this.get(\"yAxis\"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(t.inited&&e.inited)for(let o=s;o<=a;o++){let t=this.dataItems[o];this._createGraphics(t)}}_updateChildren(){const t=this.chart;t&&(this._ph=t.plotContainer.height(),this._pw=t.plotContainer.width());const e=this.get(\"xAxis\"),s=this.get(\"yAxis\"),a=this.get(\"baseAxis\"),o=this.columns.template;this.isDirty(\"fill\")&&null==o.get(\"fill\")&&o.set(\"fill\",this.get(\"fill\")),this.isDirty(\"stroke\")&&null==o.get(\"stroke\")&&o.set(\"stroke\",this.get(\"stroke\"));let n=0,r=0,h=0;i(a.series,(t=>{if(t instanceof u){const e=t.get(\"stacked\");e&&0==h&&r++,!e&&t.get(\"clustered\")&&r++}t===this&&(n=r-1),h++})),this.get(\"clustered\")||(n=0,r=1),0===r&&(r=1,n=0);const l=e.get(\"renderer\"),g=s.get(\"renderer\"),d=\"cellStartLocation\",c=\"cellEndLocation\",m=l.get(d,0),p=l.get(c,1),x=g.get(d,0),_=g.get(c,1);if(this._aLocationX0=m+n/r*(p-m),this._aLocationX1=m+(n+1)/r*(p-m),this._aLocationY0=x+n/r*(_-x),this._aLocationY1=x+(n+1)/r*(_-x),e.inited&&s.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty(\"vcx\")||this.isDirty(\"vcy\")||this._sizeDirty){const t=this.dataItems.length;let e=Math.max(0,this.startIndex()-2),i=Math.min(this.endIndex()+2,t-1);for(let a=0;a0&&e>0)for(let t=a-1;t>=0;t--){let e=this.dataItems[t];if(null!=e.get(\"valueX\")&&null!=e.get(\"valueY\")){s=e;break}}break}this._toggleColumn(t,!1)}for(let a=e;a<=i;a++){let t=this.dataItems[a];this._updateGraphics(t,s),null!=t.get(\"valueX\")&&null!=t.get(\"valueY\")&&(s=t)}for(let a=i+1;a{const i=e.container,s=t.get(\"rangeGraphics\",[]);t.set(\"rangeGraphics\",s);const a=this._makeGraphics(e.columns,t);s.push(a),a.setPrivate(\"list\",e.columns),i.children.push(a)}))}}_updateGraphics(t,e){let a=t.get(\"graphics\");const n=this._xField,r=this._yField,h=t.get(n),l=t.get(r);if(null!=h&&null!=l){const h=this._xOpenField,l=this._yOpenField,g=this.get(\"locationX\",t.get(\"locationX\",.5)),d=this.get(\"locationY\",t.get(\"locationY\",.5)),c=this.get(\"openLocationX\",t.get(\"openLocationX\",g)),m=this.get(\"openLocationY\",t.get(\"openLocationY\",d)),p=a.get(\"width\"),u=a.get(\"height\"),x=this.get(\"stacked\"),_=this.get(\"xAxis\"),I=this.get(\"yAxis\"),f=this.get(\"baseAxis\"),y=_.get(\"start\"),P=_.get(\"end\"),b=I.get(\"start\"),v=I.get(\"end\");let D,T,A,C,w=this.get(\"vcy\",1),k=this.get(\"vcx\",1),F=!1,M=!1;if(I.isType(\"CategoryAxis\")&&_.isType(\"CategoryAxis\")){let e=this._aLocationX0+c-.5,i=this._aLocationX1+g-.5;if(p instanceof s){let t=(i-e)*(1-p.value)/2;e+=t,i-=t}if(D=_.getDataItemPositionX(t,h,e,k),T=_.getDataItemPositionX(t,n,i,k),e=this._aLocationY0+m-.5,i=this._aLocationY1+d-.5,u instanceof s){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}A=I.getDataItemPositionY(t,l,e,w),C=I.getDataItemPositionY(t,r,i,w),t.setRaw(\"point\",{x:D+(T-D)/2,y:A+(C-A)/2})}else if(_===f){let e=this._aLocationX0+c-.5,i=this._aLocationX1+g-.5;if(p instanceof s){let t=(i-e)*(1-p.value)/2;e+=t,i-=t}if(D=_.getDataItemPositionX(t,h,e,k),T=_.getDataItemPositionX(t,n,i,k),A=I.getDataItemPositionY(t,r,d,w),this._yOpenField!==this._yField)C=I.getDataItemPositionY(t,l,m,w);else if(x){let e=t.get(\"stackToItemY\");C=e?I.getDataItemPositionY(e,r,m,e.component.get(\"vcy\")):I.basePosition()}else C=I.basePosition();t.setRaw(\"point\",{x:D+(T-D)/2,y:A}),M=!0}else if(I===f){let e=this._aLocationY0+m-.5,i=this._aLocationY1+d-.5;if(u instanceof s){let t=(i-e)*(1-u.value)/2;e+=t,i-=t}if(A=I.getDataItemPositionY(t,l,e,w),C=I.getDataItemPositionY(t,r,i,w),T=_.getDataItemPositionX(t,n,g,k),this._xOpenField!==this._xField)D=_.getDataItemPositionX(t,h,c,k);else if(x){let e=t.get(\"stackToItemX\");D=e?_.getDataItemPositionX(e,n,c,e.component.get(\"vcx\")):_.basePosition()}else D=_.basePosition();F=!0,t.setRaw(\"point\",{x:T,y:A+(C-A)/2})}this._updateSeriesGraphics(t,a,D,T,A,C,F,M),DP&&T>P||A=v&&C>v||o(D)||o(A)?this._toggleColumn(t,!1):this._toggleColumn(t,!0);let X=t.get(\"rangeGraphics\");X&&i(X,(e=>{this._updateSeriesGraphics(t,e,D,T,A,C,F,M)})),this._applyGraphicsStates(t,e)}}_updateSeriesGraphics(t,e,i,s,a,o,r,h){const l=e.get(\"width\"),g=e.get(\"height\"),d=e.get(\"maxWidth\"),c=e.get(\"maxHeight\"),m=this.getPoint(i,a),p=this.getPoint(s,o),u=t.get(\"point\");if(u){const t=this.getPoint(u.x,u.y);u.x=t.x+this._x,u.y=t.y+this._y}if(i=m.x,s=p.x,a=m.y,o=p.y,n(l)){const t=(s-i-l)/2;i+=t,s-=t}if(n(d)&&d{this._toggleColumn(t,!1)}))}_applyGraphicsStates(t,e){const i=t.get(\"graphics\"),s=i.states.lookup(\"dropFromOpen\"),a=i.states.lookup(\"riseFromOpen\"),o=i.states.lookup(\"dropFromPrevious\"),r=i.states.lookup(\"riseFromPrevious\");if(s||o||a||r){const i=this.get(\"xAxis\"),h=this.get(\"yAxis\"),l=this.get(\"baseAxis\");let g,d,c;l===i&&h.isType(\"ValueAxis\")?(g=t.get(this._yOpenField),d=t.get(this._yField),c=e.get(this._yField)):l===h&&i.isType(\"ValueAxis\")&&(g=t.get(this._xOpenField),d=t.get(this._xField),c=e.get(this._xField)),n(g)&&n(d)&&(d{const e=t.getPrivate(\"list\");e&&e.removeValue(t),t.dispose()}))}hideDataItem(t,e){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return m(this,void 0,void 0,(function*(){const a=[s.hideDataItem.call(this,t,e)],o=t.get(\"graphics\");o&&a.push(o.hide(e));const n=t.get(\"rangeGraphics\");n&&i(n,(t=>{a.push(t.hide(e))})),yield Promise.all(a)}))}_toggleColumn(t,e){const s=t.get(\"graphics\");s&&s.setPrivate(\"visible\",e);const a=t.get(\"rangeGraphics\");a&&i(a,(t=>{t.setPrivate(\"visible\",e)}));const o=t.bullets;o&&i(o,(t=>{t.setPrivate(\"hidden\",!e)}))}showDataItem(t,e){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return m(this,void 0,void 0,(function*(){const a=[s.showDataItem.call(this,t,e)],o=t.get(\"graphics\");o&&a.push(o.show(e));const n=t.get(\"rangeGraphics\");n&&i(n,(t=>{a.push(t.show(e))})),yield Promise.all(a)}))}updateLegendMarker(t){let e=this.get(\"legendDataItem\");if(this.get(\"useLastColorForLegendMarker\")&&!t){const e=this.dataItems[this.endIndex()-1];e&&(t=e)}if(e){let s=this.columns.template;if(t){let e=t.get(\"graphics\");e&&(s=e)}const a=e.get(\"markerRectangle\");a&&(e.get(\"itemContainer\").get(\"disabled\")||i(r,(t=>{a.set(t,s.get(t,this.get(t)))})))}}_getTooltipTarget(t){if(\"bullet\"==this.get(\"seriesTooltipTarget\"))return super._getTooltipTarget(t);let e=t.get(\"graphics\");return e||this}}Object.defineProperty(u,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"BaseColumnSeries\"}),Object.defineProperty(u,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:t.classNames.concat([u.className])});class x extends e{constructor(){super(...arguments),Object.defineProperty(this,\"_frequency\",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,\"_itemMap\",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=h(this._settings.themeTags,[\"axis\"]),this.fields.push(\"category\"),this.setPrivateRaw(\"name\",\"category\"),this.addTag(\"category\"),super._afterNew()}_prepareChildren(){super._prepareChildren();const t=this.dataItems.length;let e=0;this._valuesDirty&&(this._itemMap={},i(this.dataItems,(t=>{t.setRaw(\"index\",e),this._itemMap[t.get(\"category\")]=t,e++})),this.setPrivateRaw(\"maxZoomFactor\",t)),this.setPrivateRaw(\"startIndex\",Math.max(Math.round(this.get(\"start\",0)*t),0)),this.setPrivateRaw(\"endIndex\",Math.min(Math.round(this.get(\"end\",1)*t),t)),(this._sizeDirty||this._valuesDirty||this.isDirty(\"start\")||this.isDirty(\"end\")||this.isPrivateDirty(\"endIndex\")||this.isPrivateDirty(\"startIndex\")||this.isPrivateDirty(\"width\")||this.isPrivateDirty(\"height\"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){i(this.series,(t=>{let e=this.dataItems[this.startIndex()].get(\"category\"),s=this.dataItems[this.endIndex()-1].get(\"category\"),a=t.get(\"baseAxis\"),o=t.get(\"xAxis\"),n=t.get(\"yAxis\");if(o instanceof x&&n instanceof x)t._markDirtyAxes();else if(a===this){let r,h,l=n;if(o===a?(t.get(\"categoryXField\")&&(r=\"categoryX\"),t.get(\"openCategoryXField\")&&(h=\"openCategoryX\")):n===a&&(t.get(\"categoryYField\")&&(r=\"categoryY\"),t.get(\"openCategoryYField\")&&(h=\"openCategoryY\"),l=o),\"ValueAxis\"==l.className&&(r||h)){let a,o;for(let i=0,s=t.dataItems.length;i=0;e--){let i=t.dataItems[e];if(r&&i.get(r)===s){o=i;break}if(h&&i.get(h)===s){o=i;break}}let n=0,l=t.dataItems.length;a&&(n=t.dataItems.indexOf(a)),o&&(l=t.dataItems.indexOf(o)+1),t.setPrivate(\"startIndex\",n),t.setPrivate(\"endIndex\",l);let g=!1;for(let e=n;e{null!=s.get(t)&&(g=!0)})),i(t.__valueYShowFields,(t=>{null!=s.get(t)&&(g=!0)})),g)break}t.setPrivate(\"outOfSelection\",!g)}t._markDirtyAxes()}}))}_prepareAxisItems(){const t=this.get(\"renderer\"),e=this.dataItems.length;let i=this.startIndex();i>0&&i--;let s=this.endIndex();s0){let i=this.getPrivate(\"name\")+this.get(\"renderer\").getPrivate(\"letter\"),s=this.axisPositionToIndex(e),a=t.dataItems[s],o=this.dataItems[s],n=o.get(\"category\");if(a&&o&&a.get(i)===n)return a;for(let e=0,r=t.dataItems.length;ep._new(this._root,{position:\"absolute\",themeTags:h(this.columns.template.get(\"themeTags\",[]),[\"series\",\"column\"])},[this.columns.template])))})}makeColumn(t,e){const i=this.mainContainer.children.push(e.make());return i._setDataItem(t),e.push(i),i}_processAxisRange(t){super._processAxisRange(t),t.columns=new d(c.new({}),(()=>p._new(this._root,{position:\"absolute\",themeTags:h(t.columns.template.get(\"themeTags\",[]),[\"series\",\"column\"])},[this.columns.template,t.columns.template])))}}Object.defineProperty(_,\"className\",{enumerable:!0,configurable:!0,writable:!0,value:\"ColumnSeries\"}),Object.defineProperty(_,\"classNames\",{enumerable:!0,configurable:!0,writable:!0,value:u.classNames.concat([_.className])});export{x as CategoryAxisAm5,_ as ColumnSeriesAm5};\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { Build } from '@stencil/core/internal/client/index.js';\n\nconst CSS = {\n container: \"container\",\n containerBorderSelected: \"container--border-selected\",\n containerBorderUnselected: \"container--border-unselected\",\n contentContainer: \"content-container\",\n contentContainerSelectable: \"content-container--selectable\",\n contentContainerHasCenterContent: \"content-container--has-center-content\",\n nestedContainer: \"nested-container\",\n nestedContainerHidden: \"nested-container--hidden\",\n content: \"content\",\n customContent: \"custom-content\",\n actionsStart: \"actions-start\",\n contentStart: \"content-start\",\n label: \"label\",\n description: \"description\",\n contentEnd: \"content-end\",\n contentBottom: \"content-bottom\",\n actionsEnd: \"actions-end\",\n selectionContainer: \"selection-container\",\n openContainer: \"open-container\",\n dragContainer: \"drag-container\",\n};\nconst SLOTS = {\n actionsStart: \"actions-start\",\n contentStart: \"content-start\",\n content: \"content\",\n contentBottom: \"content-bottom\",\n contentEnd: \"content-end\",\n actionsEnd: \"actions-end\",\n};\n// Set to zero to extend until the end of the table section.\nconst MAX_COLUMNS = 0;\nconst ICONS = {\n selectedMultiple: \"check-circle-f\",\n selectedSingle: \"circle-f\",\n unselected: \"blank\",\n closedLTR: \"caret-right\",\n closedRTL: \"caret-left\",\n open: \"caret-down\",\n blank: \"blank\",\n close: \"x\",\n};\n\nconst listSelector = \"calcite-list\";\nconst listItemGroupSelector = \"calcite-list-item-group\";\nconst listItemSelector = \"calcite-list-item\";\nfunction getListItemChildren(slotEl) {\n const assignedElements = slotEl.assignedElements({ flatten: true });\n const listItemGroupChildren = assignedElements.filter((el) => el?.matches(listItemGroupSelector))\n .map((group) => Array.from(group.querySelectorAll(listItemSelector)))\n .reduce((previousValue, currentValue) => [...previousValue, ...currentValue], []);\n const listItemChildren = assignedElements.filter((el) => el?.matches(listItemSelector));\n const listItemListChildren = assignedElements.filter((el) => el?.matches(listSelector))\n .map((list) => Array.from(list.querySelectorAll(listItemSelector)))\n .reduce((previousValue, currentValue) => [...previousValue, ...currentValue], []);\n return [...listItemListChildren, ...listItemGroupChildren, ...listItemChildren];\n}\nfunction updateListItemChildren(listItemChildren) {\n listItemChildren.forEach((listItem) => {\n listItem.setPosition = listItemChildren.indexOf(listItem) + 1;\n listItem.setSize = listItemChildren.length;\n });\n}\nfunction getDepth(element, includeGroup = false) {\n if (!Build.isBrowser) {\n return 0;\n }\n const expression = includeGroup\n ? \"ancestor::calcite-list-item | ancestor::calcite-list-item-group\"\n : \"ancestor::calcite-list-item\";\n const result = document.evaluate(expression, element, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\n return result.snapshotLength;\n}\n\nexport { CSS as C, ICONS as I, MAX_COLUMNS as M, SLOTS as S, getDepth as a, getListItemChildren as g, updateListItemChildren as u };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\n/**!\n * Sortable 1.15.0\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nvar version = \"1.15.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nconst sortableComponentSet = new Set();\nconst CSS = {\n ghostClass: \"calcite-sortable--ghost\",\n chosenClass: \"calcite-sortable--chosen\",\n dragClass: \"calcite-sortable--drag\",\n};\n/**\n * Helper to keep track of a SortableComponent. This should be called in the `connectedCallback` lifecycle method as well as any other method necessary to rebuild the sortable instance.\n *\n * @param {SortableComponent} component - The sortable component.\n */\nfunction connectSortableComponent(component) {\n disconnectSortableComponent(component);\n sortableComponentSet.add(component);\n const dataIdAttr = \"id\";\n const { group, handleSelector: handle, dragSelector: draggable } = component;\n component.sortable = Sortable.create(component.el, {\n dataIdAttr,\n ...CSS,\n ...(!!draggable && { draggable }),\n ...(!!group && {\n group: {\n name: group,\n ...(!!component.canPull && {\n pull: (to, from, dragEl, { newIndex, oldIndex }) => component.canPull({ toEl: to.el, fromEl: from.el, dragEl, newIndex, oldIndex }),\n }),\n ...(!!component.canPut && {\n put: (to, from, dragEl, { newIndex, oldIndex }) => component.canPut({ toEl: to.el, fromEl: from.el, dragEl, newIndex, oldIndex }),\n }),\n },\n }),\n handle,\n onStart: () => {\n dragState.active = true;\n onDragStart();\n },\n onEnd: () => {\n dragState.active = false;\n onDragEnd();\n },\n onSort: ({ from: fromEl, item: dragEl, to: toEl, newIndex, oldIndex }) => {\n component.onDragSort({ fromEl, dragEl, toEl, newIndex, oldIndex });\n },\n });\n}\n/**\n * Helper to remove track of a SortableComponent. This should be called in the `disconnectedCallback` lifecycle method.\n *\n * @param {SortableComponent} component - The sortable component.\n */\nfunction disconnectSortableComponent(component) {\n sortableComponentSet.delete(component);\n component.sortable?.destroy();\n component.sortable = null;\n}\nconst dragState = { active: false };\n/**\n * Helper to determine if dragging is currently active.\n *\n * @param component The sortable component.\n * @returns {boolean} a boolean value.\n */\nfunction dragActive(component) {\n return component.dragEnabled && dragState.active;\n}\nfunction onDragStart() {\n Array.from(sortableComponentSet).forEach((component) => component.onDragStart());\n}\nfunction onDragEnd() {\n Array.from(sortableComponentSet).forEach((component) => component.onDragEnd());\n}\n\nexport { disconnectSortableComponent as a, connectSortableComponent as c, dragActive as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client/index.js';\nimport { e as slotChangeHasAssignedElement } from './dom.js';\n\nconst CSS = {\n container: \"container\",\n actionsStart: \"actions-start\",\n contentStart: \"content-start\",\n content: \"content\",\n contentEnd: \"content-end\",\n actionsEnd: \"actions-end\",\n};\nconst SLOTS = {\n actionsStart: \"actions-start\",\n contentStart: \"content-start\",\n contentEnd: \"content-end\",\n actionsEnd: \"actions-end\",\n};\n\nconst stackCss = \":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Stack = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n this.handleActionsStartSlotChange = (event) => {\n this.hasActionsStart = slotChangeHasAssignedElement(event);\n };\n this.handleActionsEndSlotChange = (event) => {\n this.hasActionsEnd = slotChangeHasAssignedElement(event);\n };\n this.handleContentStartSlotChange = (event) => {\n this.hasContentStart = slotChangeHasAssignedElement(event);\n };\n this.handleContentEndSlotChange = (event) => {\n this.hasContentEnd = slotChangeHasAssignedElement(event);\n };\n this.disabled = false;\n this.hasActionsStart = false;\n this.hasActionsEnd = false;\n this.hasContentStart = false;\n this.hasContentEnd = false;\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n renderActionsStart() {\n const { hasActionsStart } = this;\n return (h(\"div\", { class: CSS.actionsStart, hidden: !hasActionsStart, key: \"actions-start-container\" }, h(\"slot\", { name: SLOTS.actionsStart, onSlotchange: this.handleActionsStartSlotChange })));\n }\n renderActionsEnd() {\n const { hasActionsEnd } = this;\n return (h(\"div\", { class: CSS.actionsEnd, hidden: !hasActionsEnd, key: \"actions-end-container\" }, h(\"slot\", { name: SLOTS.actionsEnd, onSlotchange: this.handleActionsEndSlotChange })));\n }\n renderContentStart() {\n const { hasContentStart } = this;\n return (h(\"div\", { class: CSS.contentStart, hidden: !hasContentStart }, h(\"slot\", { name: SLOTS.contentStart, onSlotchange: this.handleContentStartSlotChange })));\n }\n renderDefaultContent() {\n return (h(\"div\", { class: CSS.content }, h(\"slot\", null)));\n }\n renderContentEnd() {\n const { hasContentEnd } = this;\n return (h(\"div\", { class: CSS.contentEnd, hidden: !hasContentEnd }, h(\"slot\", { name: SLOTS.contentEnd, onSlotchange: this.handleContentEndSlotChange })));\n }\n render() {\n return (h(Host, null, h(\"div\", { class: CSS.container }, this.renderActionsStart(), this.renderContentStart(), this.renderDefaultContent(), this.renderContentEnd(), this.renderActionsEnd())));\n }\n static get style() { return stackCss; }\n}, [1, \"calcite-stack\", {\n \"disabled\": [516],\n \"hasActionsStart\": [32],\n \"hasActionsEnd\": [32],\n \"hasContentStart\": [32],\n \"hasContentEnd\": [32]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-stack\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-stack\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Stack);\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { SLOTS as S, Stack as a, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto$1.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString$1 = objectProto$1.toString;\n\n/** Built-in value references. */\nvar symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag$1),\n tag = value[symToStringTag$1];\n\n try {\n value[symToStringTag$1] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString$1.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag$1] = tag;\n } else {\n delete value[symToStringTag$1];\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\n/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport { Symbol as S, isSymbol as a, baseGetTag as b, isObjectLike as c, debounce as d, freeGlobal as f, isObject as i, root as r };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { a as isSymbol, S as Symbol, i as isObject, b as baseGetTag, c as isObjectLike, r as root, f as freeGlobal } from './debounce.js';\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag$1 = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER$1 = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER$1 : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/** Used for built-in method references. */\nvar objectProto$3 = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;\n\n return value === proto;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/** `Object#toString` result references. */\nvar argsTag$1 = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag$1;\n}\n\n/** Used for built-in method references. */\nvar objectProto$2 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$2 = objectProto$2.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto$2.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\n/** Detect free variable `exports`. */\nvar freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;\n\n/** Built-in value references. */\nvar Buffer = moduleExports$1 ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$1 = objectProto$1.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty$1.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nconst filter = (data, value) => {\n const escapedValue = escapeRegExp(value);\n const regex = new RegExp(escapedValue, \"i\");\n if (data.length === 0) {\n console.warn(`No data was passed to the filter function.\n The data argument should be an array of objects`);\n }\n const find = (input, RE) => {\n if (input?.constant || input?.filterDisabled) {\n return true;\n }\n let found = false;\n forIn(input, (val) => {\n if (typeof val === \"function\" || val == null /* intentional == to catch undefined */) {\n return;\n }\n if (Array.isArray(val) || (typeof val === \"object\" && val !== null)) {\n if (find(val, RE)) {\n found = true;\n }\n }\n else if (RE.test(val)) {\n found = true;\n }\n });\n return found;\n };\n const result = data.filter((item) => {\n return find(item, regex);\n });\n return result;\n};\n\nexport { filter as f };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client/index.js';\nimport { b as getElementDir, C as CSS_UTILITY } from './dom.js';\n\nconst progressCss = \":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-app-z-index);inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:var(--calcite-app-z-index);background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Progress = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.type = \"determinate\";\n this.value = 0;\n this.label = undefined;\n this.text = undefined;\n this.reversed = false;\n }\n render() {\n const isDeterminate = this.type === \"determinate\";\n const barStyles = isDeterminate ? { width: `${this.value * 100}%` } : {};\n const dir = getElementDir(this.el);\n return (h(\"div\", { \"aria-label\": this.label || this.text, \"aria-valuemax\": 1, \"aria-valuemin\": 0, \"aria-valuenow\": this.value, role: \"progressbar\" }, h(\"div\", { class: \"track\" }, h(\"div\", { class: {\n bar: true,\n indeterminate: this.type === \"indeterminate\",\n [CSS_UTILITY.rtl]: dir === \"rtl\",\n reversed: this.reversed,\n }, style: barStyles })), this.text ? h(\"div\", { class: \"text\" }, this.text) : null));\n }\n get el() { return this; }\n static get style() { return progressCss; }\n}, [1, \"calcite-progress\", {\n \"type\": [513],\n \"value\": [2],\n \"label\": [1],\n \"text\": [1],\n \"reversed\": [516]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-progress\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-progress\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Progress);\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Progress as P, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client/index.js';\nimport { g as getSlotted, j as isPrimaryPointerButton, h as setRequestedIcon, b as getElementDir, C as CSS_UTILITY } from './dom.js';\nimport { s as submitForm, c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from './form.js';\nimport { c as connectInteractive, d as disconnectInteractive, u as updateHostInteraction } from './interactive.js';\nimport { n as numberKeys } from './key.js';\nimport { c as connectLabel, d as disconnectLabel, g as getLabelText } from './label2.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { n as numberStringFormatter, i as isValidNumber, p as parseNumberString, s as sanitizeNumberString, e as addLocalizedTrailingDecimalZeros, c as connectLocalized, d as disconnectLocalized, B as BigDecimal } from './locale.js';\nimport { c as createObserver } from './observers.js';\nimport { u as updateMessages, c as connectMessages, d as disconnectMessages, s as setUpMessages } from './t9n.js';\nimport { g as getIconScale } from './component.js';\nimport { d as defineCustomElement$2 } from './icon.js';\nimport { d as defineCustomElement$1 } from './progress.js';\n\nconst CSS = {\n loader: \"loader\",\n clearButton: \"clear-button\",\n editingEnabled: \"editing-enabled\",\n inlineChild: \"inline-child\",\n inputIcon: \"icon\",\n prefix: \"prefix\",\n suffix: \"suffix\",\n numberButtonWrapper: \"number-button-wrapper\",\n buttonItemHorizontal: \"number-button-item--horizontal\",\n wrapper: \"element-wrapper\",\n inputWrapper: \"wrapper\",\n actionWrapper: \"action-wrapper\",\n resizeIconWrapper: \"resize-icon-wrapper\",\n numberButtonItem: \"number-button-item\",\n};\nconst INPUT_TYPE_ICONS = {\n tel: \"phone\",\n password: \"lock\",\n email: \"email-address\",\n date: \"calendar\",\n time: \"clock\",\n search: \"search\",\n};\nconst SLOTS = {\n action: \"action\",\n};\n\nconst inputCss = \":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-ui-text-1)}calcite-icon{color:var(--calcite-ui-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-app-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}input.inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input.inline-child .editing-enabled{background-color:inherit}input.inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteInternalInputFocus = createEvent(this, \"calciteInternalInputFocus\", 6);\n this.calciteInternalInputBlur = createEvent(this, \"calciteInternalInputBlur\", 6);\n this.calciteInputInput = createEvent(this, \"calciteInputInput\", 7);\n this.calciteInputChange = createEvent(this, \"calciteInputChange\", 6);\n /** keep track of the rendered child type */\n this.childElType = \"input\";\n this.previousValueOrigin = \"initial\";\n this.mutationObserver = createObserver(\"mutation\", () => this.setDisabledAction());\n this.userChangedValue = false;\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n this.keyDownHandler = (event) => {\n if (this.readOnly || this.disabled) {\n return;\n }\n if (this.isClearable && event.key === \"Escape\") {\n this.clearInputValue(event);\n event.preventDefault();\n }\n if (event.key === \"Enter\" && !event.defaultPrevented) {\n if (submitForm(this)) {\n event.preventDefault();\n }\n }\n };\n this.clearInputValue = (nativeEvent) => {\n this.setValue({\n committing: true,\n nativeEvent,\n origin: \"user\",\n value: \"\",\n });\n };\n this.emitChangeIfUserModified = () => {\n if (this.previousValueOrigin === \"user\" && this.value !== this.previousEmittedValue) {\n this.calciteInputChange.emit();\n this.setPreviousEmittedValue(this.value);\n }\n };\n this.inputBlurHandler = () => {\n this.calciteInternalInputBlur.emit();\n this.emitChangeIfUserModified();\n };\n this.clickHandler = (event) => {\n if (this.disabled) {\n return;\n }\n const slottedActionEl = getSlotted(this.el, \"action\");\n if (event.target !== slottedActionEl) {\n this.setFocus();\n }\n };\n this.inputFocusHandler = () => {\n this.calciteInternalInputFocus.emit();\n };\n this.inputChangeHandler = () => {\n if (this.type === \"file\") {\n this.files = this.childEl.files;\n }\n };\n this.inputInputHandler = (nativeEvent) => {\n if (this.disabled || this.readOnly) {\n return;\n }\n this.setValue({\n nativeEvent,\n origin: \"user\",\n value: nativeEvent.target.value,\n });\n };\n this.inputKeyDownHandler = (event) => {\n if (this.disabled || this.readOnly) {\n return;\n }\n if (event.key === \"Enter\") {\n this.emitChangeIfUserModified();\n }\n };\n this.inputNumberInputHandler = (nativeEvent) => {\n if (this.disabled || this.readOnly) {\n return;\n }\n const value = nativeEvent.target.value;\n numberStringFormatter.numberFormatOptions = {\n locale: this.effectiveLocale,\n numberingSystem: this.numberingSystem,\n useGrouping: this.groupSeparator,\n };\n const delocalizedValue = numberStringFormatter.delocalize(value);\n if (nativeEvent.inputType === \"insertFromPaste\") {\n if (!isValidNumber(delocalizedValue)) {\n nativeEvent.preventDefault();\n }\n this.setValue({\n nativeEvent,\n origin: \"user\",\n value: parseNumberString(delocalizedValue),\n });\n this.childNumberEl.value = this.localizedValue;\n }\n else {\n this.setValue({\n nativeEvent,\n origin: \"user\",\n value: delocalizedValue,\n });\n }\n };\n this.inputNumberKeyDownHandler = (event) => {\n if (this.type !== \"number\" || this.disabled || this.readOnly) {\n return;\n }\n if (event.key === \"ArrowUp\") {\n /* prevent default behavior of moving cursor to the beginning of the input when holding down ArrowUp */\n event.preventDefault();\n this.nudgeNumberValue(\"up\", event);\n return;\n }\n if (event.key === \"ArrowDown\") {\n this.nudgeNumberValue(\"down\", event);\n return;\n }\n const supportedKeys = [\n ...numberKeys,\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Backspace\",\n \"Delete\",\n \"Enter\",\n \"Escape\",\n \"Tab\",\n ];\n if (event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n const isShiftTabEvent = event.shiftKey && event.key === \"Tab\";\n if (supportedKeys.includes(event.key) || isShiftTabEvent) {\n if (event.key === \"Enter\") {\n this.emitChangeIfUserModified();\n }\n return;\n }\n numberStringFormatter.numberFormatOptions = {\n locale: this.effectiveLocale,\n numberingSystem: this.numberingSystem,\n useGrouping: this.groupSeparator,\n };\n if (event.key === numberStringFormatter.decimal) {\n if (!this.value && !this.childNumberEl.value) {\n return;\n }\n if (this.value && this.childNumberEl.value.indexOf(numberStringFormatter.decimal) === -1) {\n return;\n }\n }\n if (/[eE]/.test(event.key)) {\n if (!this.value && !this.childNumberEl.value) {\n return;\n }\n if (this.value && !/[eE]/.test(this.childNumberEl.value)) {\n return;\n }\n }\n if (event.key === \"-\") {\n if (!this.value && !this.childNumberEl.value) {\n return;\n }\n if (this.value && this.childNumberEl.value.split(\"-\").length <= 2) {\n return;\n }\n }\n event.preventDefault();\n };\n this.nudgeNumberValue = (direction, nativeEvent) => {\n if ((nativeEvent instanceof KeyboardEvent && nativeEvent.repeat) || this.type !== \"number\") {\n return;\n }\n const inputMax = this.maxString ? parseFloat(this.maxString) : null;\n const inputMin = this.minString ? parseFloat(this.minString) : null;\n const valueNudgeDelayInMs = 150;\n this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent);\n if (this.nudgeNumberValueIntervalId) {\n window.clearInterval(this.nudgeNumberValueIntervalId);\n }\n let firstValueNudge = true;\n this.nudgeNumberValueIntervalId = window.setInterval(() => {\n if (firstValueNudge) {\n firstValueNudge = false;\n return;\n }\n this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent);\n }, valueNudgeDelayInMs);\n };\n this.numberButtonPointerUpAndOutHandler = () => {\n window.clearInterval(this.nudgeNumberValueIntervalId);\n };\n this.numberButtonPointerDownHandler = (event) => {\n if (!isPrimaryPointerButton(event)) {\n return;\n }\n event.preventDefault();\n const direction = event.target.dataset.adjustment;\n if (!this.disabled) {\n this.nudgeNumberValue(direction, event);\n }\n };\n this.hiddenInputChangeHandler = (event) => {\n if (event.target.name === this.name) {\n this.setValue({\n value: event.target.value,\n origin: \"direct\",\n });\n }\n event.stopPropagation();\n };\n this.setChildElRef = (el) => {\n this.childEl = el;\n };\n this.setChildNumberElRef = (el) => {\n this.childNumberEl = el;\n };\n this.setInputValue = (newInputValue) => {\n if (this.type === \"text\" && !this.childEl) {\n return;\n }\n if (this.type === \"number\" && !this.childNumberEl) {\n return;\n }\n this[`child${this.type === \"number\" ? \"Number\" : \"\"}El`].value = newInputValue;\n };\n this.setPreviousEmittedValue = (value) => {\n this.previousEmittedValue = this.normalizeValue(value);\n };\n this.setPreviousValue = (value) => {\n this.previousValue = this.normalizeValue(value);\n };\n this.setValue = ({ committing = false, nativeEvent, origin, previousValue, value, }) => {\n this.setPreviousValue(previousValue ?? this.value);\n this.previousValueOrigin = origin;\n if (this.type === \"number\") {\n numberStringFormatter.numberFormatOptions = {\n locale: this.effectiveLocale,\n numberingSystem: this.numberingSystem,\n useGrouping: this.groupSeparator,\n signDisplay: \"never\",\n };\n const isValueDeleted = this.previousValue?.length > value.length || this.value?.length > value.length;\n const hasTrailingDecimalSeparator = value.charAt(value.length - 1) === \".\";\n const sanitizedValue = hasTrailingDecimalSeparator && isValueDeleted ? value : sanitizeNumberString(value);\n const newValue = value && !sanitizedValue\n ? isValidNumber(this.previousValue)\n ? this.previousValue\n : \"\"\n : sanitizedValue;\n let newLocalizedValue = numberStringFormatter.localize(newValue);\n if (origin !== \"connected\" && !hasTrailingDecimalSeparator) {\n newLocalizedValue = addLocalizedTrailingDecimalZeros(newLocalizedValue, newValue, numberStringFormatter);\n }\n // adds localized trailing decimal separator\n this.localizedValue =\n hasTrailingDecimalSeparator && isValueDeleted\n ? `${newLocalizedValue}${numberStringFormatter.decimal}`\n : newLocalizedValue;\n this.userChangedValue = origin === \"user\" && this.value !== newValue;\n // don't sanitize the start of negative/decimal numbers, but\n // don't set value to an invalid number\n this.value = [\"-\", \".\"].includes(newValue) ? \"\" : newValue;\n }\n else {\n this.userChangedValue = origin === \"user\" && this.value !== value;\n this.value = value;\n }\n if (origin === \"direct\") {\n this.setInputValue(value);\n this.previousEmittedValue = value;\n }\n if (nativeEvent) {\n const calciteInputInputEvent = this.calciteInputInput.emit();\n if (calciteInputInputEvent.defaultPrevented) {\n this.value = this.previousValue;\n this.localizedValue =\n this.type === \"number\"\n ? numberStringFormatter.localize(this.previousValue)\n : this.previousValue;\n }\n else if (committing) {\n this.emitChangeIfUserModified();\n }\n }\n };\n this.inputKeyUpHandler = () => {\n window.clearInterval(this.nudgeNumberValueIntervalId);\n };\n this.alignment = \"start\";\n this.autofocus = false;\n this.clearable = false;\n this.disabled = false;\n this.form = undefined;\n this.groupSeparator = false;\n this.hidden = false;\n this.icon = undefined;\n this.iconFlipRtl = false;\n this.label = undefined;\n this.loading = false;\n this.numberingSystem = undefined;\n this.localeFormat = false;\n this.max = undefined;\n this.min = undefined;\n this.maxLength = undefined;\n this.minLength = undefined;\n this.name = undefined;\n this.numberButtonType = \"vertical\";\n this.placeholder = undefined;\n this.prefixText = undefined;\n this.readOnly = false;\n this.required = false;\n this.scale = \"m\";\n this.status = \"idle\";\n this.step = undefined;\n this.autocomplete = undefined;\n this.pattern = undefined;\n this.accept = undefined;\n this.multiple = false;\n this.inputMode = \"text\";\n this.enterKeyHint = undefined;\n this.suffixText = undefined;\n this.editingEnabled = false;\n this.type = \"text\";\n this.value = \"\";\n this.files = undefined;\n this.messages = undefined;\n this.messageOverrides = undefined;\n this.defaultMessages = undefined;\n this.effectiveLocale = \"\";\n this.localizedValue = undefined;\n this.slottedActionElDisabledInternally = false;\n }\n disabledWatcher() {\n this.setDisabledAction();\n }\n /** watcher to update number-to-string for max */\n maxWatcher() {\n this.maxString = this.max?.toString() || null;\n }\n /** watcher to update number-to-string for min */\n minWatcher() {\n this.minString = this.min?.toString() || null;\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n valueWatcher(newValue, previousValue) {\n if (!this.userChangedValue) {\n this.setValue({\n origin: \"direct\",\n previousValue,\n value: newValue == null || newValue == \"\"\n ? \"\"\n : this.type === \"number\"\n ? isValidNumber(newValue)\n ? newValue\n : this.previousValue || \"\"\n : newValue,\n });\n this.warnAboutInvalidNumberValue(newValue);\n }\n this.userChangedValue = false;\n }\n updateRequestedIcon() {\n this.requestedIcon = setRequestedIcon(INPUT_TYPE_ICONS, this.icon, this.type);\n }\n get isClearable() {\n return !this.isTextarea && (this.clearable || this.type === \"search\") && this.value?.length > 0;\n }\n get isTextarea() {\n return this.childElType === \"textarea\";\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n connectInteractive(this);\n connectLocalized(this);\n connectMessages(this);\n this.inlineEditableEl = this.el.closest(\"calcite-inline-editable\");\n if (this.inlineEditableEl) {\n this.editingEnabled = this.inlineEditableEl.editingEnabled || false;\n }\n connectLabel(this);\n connectForm(this);\n this.setPreviousEmittedValue(this.value);\n this.setPreviousValue(this.value);\n if (this.type === \"number\") {\n this.warnAboutInvalidNumberValue(this.value);\n this.setValue({\n origin: \"connected\",\n value: isValidNumber(this.value) ? this.value : \"\",\n });\n }\n this.mutationObserver?.observe(this.el, { childList: true });\n this.setDisabledAction();\n this.el.addEventListener(\"calciteInternalHiddenInputChange\", this.hiddenInputChangeHandler);\n }\n disconnectedCallback() {\n disconnectInteractive(this);\n disconnectLabel(this);\n disconnectForm(this);\n disconnectLocalized(this);\n disconnectMessages(this);\n this.mutationObserver?.disconnect();\n this.el.removeEventListener(\"calciteInternalHiddenInputChange\", this.hiddenInputChangeHandler);\n }\n async componentWillLoad() {\n setUpLoadableComponent(this);\n this.childElType = this.type === \"textarea\" ? \"textarea\" : \"input\";\n this.maxString = this.max?.toString();\n this.minString = this.min?.toString();\n this.requestedIcon = setRequestedIcon(INPUT_TYPE_ICONS, this.icon, this.type);\n await setUpMessages(this);\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n componentShouldUpdate(newValue, oldValue, property) {\n if (this.type === \"number\" && property === \"value\" && newValue && !isValidNumber(newValue)) {\n this.setValue({\n origin: \"reset\",\n value: oldValue,\n });\n return false;\n }\n return true;\n }\n componentDidRender() {\n updateHostInteraction(this);\n }\n //--------------------------------------------------------------------------\n //\n // Public Methods\n //\n //--------------------------------------------------------------------------\n /** Sets focus on the component. */\n async setFocus() {\n await componentFocusable(this);\n if (this.type === \"number\") {\n this.childNumberEl?.focus();\n }\n else {\n this.childEl?.focus();\n }\n }\n /** Selects the text of the component's `value`. */\n async selectText() {\n if (this.type === \"number\") {\n this.childNumberEl?.select();\n }\n else {\n this.childEl?.select();\n }\n }\n onLabelClick() {\n this.setFocus();\n }\n incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent) {\n const { value } = this;\n const adjustment = direction === \"up\" ? 1 : -1;\n const inputStep = this.step === \"any\" ? 1 : Math.abs(this.step || 1);\n const inputVal = new BigDecimal(value !== \"\" ? value : \"0\");\n const nudgedValue = inputVal.add(`${inputStep * adjustment}`);\n const nudgedValueBelowInputMin = () => typeof inputMin === \"number\" &&\n !isNaN(inputMin) &&\n nudgedValue.subtract(`${inputMin}`).isNegative;\n const nudgedValueAboveInputMax = () => typeof inputMax === \"number\" &&\n !isNaN(inputMax) &&\n !nudgedValue.subtract(`${inputMax}`).isNegative;\n const finalValue = nudgedValueBelowInputMin()\n ? `${inputMin}`\n : nudgedValueAboveInputMax()\n ? `${inputMax}`\n : nudgedValue.toString();\n this.setValue({\n committing: true,\n nativeEvent,\n origin: \"user\",\n value: finalValue,\n });\n }\n onFormReset() {\n this.setValue({\n origin: \"reset\",\n value: this.defaultValue,\n });\n }\n syncHiddenFormInput(input) {\n const { type } = this;\n input.type = type;\n if (type === \"number\") {\n input.min = this.min?.toString(10) ?? \"\";\n input.max = this.max?.toString(10) ?? \"\";\n }\n else if (type === \"text\") {\n if (this.minLength != null) {\n input.minLength = this.minLength;\n }\n if (this.maxLength != null) {\n input.maxLength = this.maxLength;\n }\n }\n }\n setDisabledAction() {\n const slottedActionEl = getSlotted(this.el, \"action\");\n if (!slottedActionEl) {\n return;\n }\n if (this.disabled) {\n if (slottedActionEl.getAttribute(\"disabled\") == null) {\n this.slottedActionElDisabledInternally = true;\n }\n slottedActionEl.setAttribute(\"disabled\", \"\");\n }\n else if (this.slottedActionElDisabledInternally) {\n slottedActionEl.removeAttribute(\"disabled\");\n this.slottedActionElDisabledInternally = false;\n }\n }\n normalizeValue(value) {\n return this.type === \"number\" ? (isValidNumber(value) ? value : \"\") : value;\n }\n warnAboutInvalidNumberValue(value) {\n if (this.type === \"number\" && value && !isValidNumber(value)) {\n console.warn(`The specified value \"${value}\" cannot be parsed, or is out of range.`);\n }\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n render() {\n const dir = getElementDir(this.el);\n const loader = (h(\"div\", { class: CSS.loader }, h(\"calcite-progress\", { label: this.messages.loading, type: \"indeterminate\" })));\n const inputClearButton = (h(\"button\", { \"aria-label\": this.messages.clear, class: CSS.clearButton, disabled: this.disabled || this.readOnly, onClick: this.clearInputValue, tabIndex: -1, type: \"button\" }, h(\"calcite-icon\", { icon: \"x\", scale: getIconScale(this.scale) })));\n const iconEl = (h(\"calcite-icon\", { class: CSS.inputIcon, flipRtl: this.iconFlipRtl, icon: this.requestedIcon, scale: getIconScale(this.scale) }));\n const isHorizontalNumberButton = this.numberButtonType === \"horizontal\";\n const numberButtonsHorizontalUp = (h(\"button\", { \"aria-hidden\": \"true\", class: {\n [CSS.numberButtonItem]: true,\n [CSS.buttonItemHorizontal]: isHorizontalNumberButton,\n }, \"data-adjustment\": \"up\", disabled: this.disabled || this.readOnly, onPointerDown: this.numberButtonPointerDownHandler, onPointerOut: this.numberButtonPointerUpAndOutHandler, onPointerUp: this.numberButtonPointerUpAndOutHandler, tabIndex: -1, type: \"button\" }, h(\"calcite-icon\", { icon: \"chevron-up\", scale: getIconScale(this.scale) })));\n const numberButtonsHorizontalDown = (h(\"button\", { \"aria-hidden\": \"true\", class: {\n [CSS.numberButtonItem]: true,\n [CSS.buttonItemHorizontal]: isHorizontalNumberButton,\n }, \"data-adjustment\": \"down\", disabled: this.disabled || this.readOnly, onPointerDown: this.numberButtonPointerDownHandler, onPointerOut: this.numberButtonPointerUpAndOutHandler, onPointerUp: this.numberButtonPointerUpAndOutHandler, tabIndex: -1, type: \"button\" }, h(\"calcite-icon\", { icon: \"chevron-down\", scale: getIconScale(this.scale) })));\n const numberButtonsVertical = (h(\"div\", { class: CSS.numberButtonWrapper }, numberButtonsHorizontalUp, numberButtonsHorizontalDown));\n const prefixText = h(\"div\", { class: CSS.prefix }, this.prefixText);\n const suffixText = h(\"div\", { class: CSS.suffix }, this.suffixText);\n const localeNumberInput = this.type === \"number\" ? (h(\"input\", { accept: this.accept, \"aria-label\": getLabelText(this), autocomplete: this.autocomplete, autofocus: this.autofocus ? true : null, defaultValue: this.defaultValue, disabled: this.disabled ? true : null, enterKeyHint: this.enterKeyHint, inputMode: this.inputMode, key: \"localized-input\", maxLength: this.maxLength, minLength: this.minLength, multiple: this.multiple, name: undefined, onBlur: this.inputBlurHandler, onFocus: this.inputFocusHandler, onInput: this.inputNumberInputHandler, onKeyDown: this.inputNumberKeyDownHandler, onKeyUp: this.inputKeyUpHandler, pattern: this.pattern, placeholder: this.placeholder || \"\", readOnly: this.readOnly, type: \"text\", value: this.localizedValue,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: this.setChildNumberElRef })) : null;\n const childEl = this.type !== \"number\"\n ? [\n h(this.childElType, { accept: this.accept, \"aria-label\": getLabelText(this), autocomplete: this.autocomplete, autofocus: this.autofocus ? true : null, class: {\n [CSS.editingEnabled]: this.editingEnabled,\n [CSS.inlineChild]: !!this.inlineEditableEl,\n }, defaultValue: this.defaultValue, disabled: this.disabled ? true : null, enterKeyHint: this.enterKeyHint, inputMode: this.inputMode, max: this.maxString, maxLength: this.maxLength, min: this.minString, minLength: this.minLength, multiple: this.multiple, name: this.name, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler, onFocus: this.inputFocusHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeyDownHandler, onKeyUp: this.inputKeyUpHandler, pattern: this.pattern, placeholder: this.placeholder || \"\", readOnly: this.readOnly, required: this.required ? true : null, step: this.step, tabIndex: this.disabled || (this.inlineEditableEl && !this.editingEnabled) ? -1 : null, type: this.type, value: this.value,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: this.setChildElRef }),\n this.isTextarea ? (h(\"div\", { class: CSS.resizeIconWrapper }, h(\"calcite-icon\", { icon: \"chevron-down\", scale: getIconScale(this.scale) }))) : null,\n ]\n : null;\n return (h(Host, { onClick: this.clickHandler, onKeyDown: this.keyDownHandler }, h(\"div\", { class: { [CSS.inputWrapper]: true, [CSS_UTILITY.rtl]: dir === \"rtl\" } }, this.type === \"number\" && this.numberButtonType === \"horizontal\" && !this.readOnly\n ? numberButtonsHorizontalDown\n : null, this.prefixText ? prefixText : null, h(\"div\", { class: CSS.wrapper }, localeNumberInput, childEl, this.isClearable ? inputClearButton : null, this.requestedIcon ? iconEl : null, this.loading ? loader : null), h(\"div\", { class: CSS.actionWrapper }, h(\"slot\", { name: SLOTS.action })), this.type === \"number\" && this.numberButtonType === \"vertical\" && !this.readOnly\n ? numberButtonsVertical\n : null, this.suffixText ? suffixText : null, this.type === \"number\" && this.numberButtonType === \"horizontal\" && !this.readOnly\n ? numberButtonsHorizontalUp\n : null, h(HiddenFormInputSlot, { component: this }))));\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"disabled\": [\"disabledWatcher\"],\n \"max\": [\"maxWatcher\"],\n \"min\": [\"minWatcher\"],\n \"messageOverrides\": [\"onMessagesChange\"],\n \"value\": [\"valueWatcher\"],\n \"icon\": [\"updateRequestedIcon\"],\n \"type\": [\"updateRequestedIcon\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return inputCss; }\n}, [1, \"calcite-input\", {\n \"alignment\": [513],\n \"autofocus\": [516],\n \"clearable\": [516],\n \"disabled\": [516],\n \"form\": [513],\n \"groupSeparator\": [516, \"group-separator\"],\n \"hidden\": [516],\n \"icon\": [520],\n \"iconFlipRtl\": [516, \"icon-flip-rtl\"],\n \"label\": [1],\n \"loading\": [516],\n \"numberingSystem\": [513, \"numbering-system\"],\n \"localeFormat\": [4, \"locale-format\"],\n \"max\": [514],\n \"min\": [514],\n \"maxLength\": [514, \"max-length\"],\n \"minLength\": [514, \"min-length\"],\n \"name\": [513],\n \"numberButtonType\": [513, \"number-button-type\"],\n \"placeholder\": [1],\n \"prefixText\": [1, \"prefix-text\"],\n \"readOnly\": [516, \"read-only\"],\n \"required\": [516],\n \"scale\": [513],\n \"status\": [513],\n \"step\": [520],\n \"autocomplete\": [1],\n \"pattern\": [1],\n \"accept\": [1],\n \"multiple\": [4],\n \"inputMode\": [1, \"input-mode\"],\n \"enterKeyHint\": [1, \"enter-key-hint\"],\n \"suffixText\": [1, \"suffix-text\"],\n \"editingEnabled\": [1540, \"editing-enabled\"],\n \"type\": [513],\n \"value\": [1025],\n \"files\": [16],\n \"messages\": [1040],\n \"messageOverrides\": [1040],\n \"defaultMessages\": [32],\n \"effectiveLocale\": [32],\n \"localizedValue\": [32],\n \"slottedActionElDisabledInternally\": [32],\n \"setFocus\": [64],\n \"selectText\": [64]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-input\", \"calcite-icon\", \"calcite-progress\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-input\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Input);\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n case \"calcite-progress\":\n if (!customElements.get(tagName)) {\n defineCustomElement$1();\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Input as I, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h, Fragment } from '@stencil/core/internal/client/index.js';\nimport { f as filter } from './filter2.js';\nimport { c as connectInteractive, u as updateHostInteraction, d as disconnectInteractive } from './interactive.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { u as updateMessages, s as setUpMessages, c as connectMessages, d as disconnectMessages } from './t9n.js';\nimport { d as defineCustomElement$3 } from './icon.js';\nimport { d as defineCustomElement$2 } from './input.js';\nimport { d as defineCustomElement$1 } from './progress.js';\nimport { d as debounce } from './debounce.js';\n\nconst CSS = {\n container: \"container\",\n searchIcon: \"search-icon\",\n};\nconst ICONS = {\n search: \"search\",\n close: \"x\",\n};\nconst DEBOUNCE_TIMEOUT = 250;\n\nconst filterCss = \":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Filter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteFilterChange = createEvent(this, \"calciteFilterChange\", 6);\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n this.filterDebounced = debounce((value, emit = false, onFilter) => this.updateFiltered(filter(this.items, value), emit, onFilter), DEBOUNCE_TIMEOUT);\n this.inputHandler = (event) => {\n const target = event.target;\n this.value = target.value;\n this.filterDebounced(target.value, true);\n };\n this.keyDownHandler = (event) => {\n if (event.key === \"Escape\") {\n this.clear();\n event.preventDefault();\n }\n if (event.key === \"Enter\") {\n event.preventDefault();\n }\n };\n this.clear = () => {\n this.value = \"\";\n this.filterDebounced(\"\", true);\n this.setFocus();\n };\n this.items = [];\n this.disabled = false;\n this.filteredItems = [];\n this.placeholder = undefined;\n this.scale = \"m\";\n this.value = \"\";\n this.messages = undefined;\n this.messageOverrides = undefined;\n this.effectiveLocale = undefined;\n this.defaultMessages = undefined;\n }\n watchItemsHandler() {\n this.filterDebounced(this.value);\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n valueHandler(value) {\n this.filterDebounced(value);\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n async componentWillLoad() {\n setUpLoadableComponent(this);\n this.updateFiltered(filter(this.items, this.value));\n await setUpMessages(this);\n }\n connectedCallback() {\n connectInteractive(this);\n connectLocalized(this);\n connectMessages(this);\n }\n componentDidRender() {\n updateHostInteraction(this);\n }\n disconnectedCallback() {\n disconnectInteractive(this);\n disconnectLocalized(this);\n disconnectMessages(this);\n this.filterDebounced.cancel();\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n // --------------------------------------------------------------------------\n //\n // Public Methods\n //\n // --------------------------------------------------------------------------\n /**\n * Performs a filter on the component.\n *\n * This method can be useful because filtering is delayed and asynchronous.\n *\n * @param {string} value - The filter text value.\n * @returns {Promise}\n */\n async filter(value = this.value) {\n return new Promise((resolve) => {\n this.value = value;\n this.filterDebounced(value, false, resolve);\n });\n }\n /** Sets focus on the component. */\n async setFocus() {\n await componentFocusable(this);\n this.el?.focus();\n }\n updateFiltered(filtered, emit = false, callback) {\n this.filteredItems = filtered;\n if (emit) {\n this.calciteFilterChange.emit();\n }\n callback?.();\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n render() {\n const { disabled, scale } = this;\n return (h(Fragment, null, h(\"div\", { class: CSS.container }, h(\"label\", null, h(\"calcite-input\", { clearable: true, disabled: disabled, icon: ICONS.search, label: this.messages.label, messageOverrides: { clear: this.messages.clear }, onCalciteInputInput: this.inputHandler, onKeyDown: this.keyDownHandler, placeholder: this.placeholder, scale: scale, type: \"text\", value: this.value,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => {\n this.textInput = el;\n } })))));\n }\n static get delegatesFocus() { return true; }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"items\": [\"watchItemsHandler\"],\n \"messageOverrides\": [\"onMessagesChange\"],\n \"value\": [\"valueHandler\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return filterCss; }\n}, [17, \"calcite-filter\", {\n \"items\": [16],\n \"disabled\": [516],\n \"filteredItems\": [1040],\n \"placeholder\": [1],\n \"scale\": [513],\n \"value\": [1025],\n \"messages\": [1040],\n \"messageOverrides\": [1040],\n \"effectiveLocale\": [32],\n \"defaultMessages\": [32],\n \"filter\": [64],\n \"setFocus\": [64]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-filter\", \"calcite-icon\", \"calcite-input\", \"calcite-progress\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-filter\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Filter);\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$3();\n }\n break;\n case \"calcite-input\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n case \"calcite-progress\":\n if (!customElements.get(tagName)) {\n defineCustomElement$1();\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Filter as F, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client/index.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { u as updateMessages, c as connectMessages, s as setUpMessages, d as disconnectMessages } from './t9n.js';\nimport { c as createObserver } from './observers.js';\nimport { w as slotChangeHasContent } from './dom.js';\nimport { d as defineCustomElement$1 } from './loader.js';\n\nconst CSS = {\n scrim: \"scrim\",\n content: \"content\",\n};\nconst BREAKPOINTS = {\n s: 72,\n // medium is assumed default.\n l: 480, // Greater than or equal to 480px.\n};\n\nconst scrimCss = \":host{position:absolute;inset:0px;z-index:var(--calcite-app-z-index-overlay);display:flex;block-size:100%;inline-size:100%;flex-direction:column;align-items:stretch}@keyframes calcite-scrim-fade-in{0%{--tw-bg-opacity:0}100%{--tw-text-opacity:1}}.scrim{position:absolute;inset:0px;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:center;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background, var(--calcite-scrim-background-internal))}.content{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Scrim = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.resizeObserver = createObserver(\"resize\", () => this.handleResize());\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n this.handleDefaultSlotChange = (event) => {\n this.hasContent = slotChangeHasContent(event);\n };\n this.storeLoaderEl = (el) => {\n this.loaderEl = el;\n this.handleResize();\n };\n this.loading = false;\n this.messages = undefined;\n this.messageOverrides = undefined;\n this.loaderScale = undefined;\n this.defaultMessages = undefined;\n this.effectiveLocale = \"\";\n this.hasContent = false;\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n connectLocalized(this);\n connectMessages(this);\n this.resizeObserver?.observe(this.el);\n }\n async componentWillLoad() {\n await setUpMessages(this);\n }\n disconnectedCallback() {\n disconnectLocalized(this);\n disconnectMessages(this);\n this.resizeObserver?.disconnect();\n }\n // --------------------------------------------------------------------------\n //\n // Render Method\n //\n // --------------------------------------------------------------------------\n render() {\n const { hasContent, loading, messages } = this;\n return (h(\"div\", { class: CSS.scrim }, loading ? (h(\"calcite-loader\", { label: messages.loading, scale: this.loaderScale,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: this.storeLoaderEl })) : null, h(\"div\", { class: CSS.content, hidden: !hasContent }, h(\"slot\", { onSlotchange: this.handleDefaultSlotChange }))));\n }\n getScale(size) {\n if (size < BREAKPOINTS.s) {\n return \"s\";\n }\n else if (size >= BREAKPOINTS.l) {\n return \"l\";\n }\n else {\n return \"m\";\n }\n }\n handleResize() {\n const { loaderEl, el } = this;\n if (!loaderEl) {\n return;\n }\n this.loaderScale = this.getScale(Math.min(el.clientHeight, el.clientWidth) ?? 0);\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"messageOverrides\": [\"onMessagesChange\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return scrimCss; }\n}, [1, \"calcite-scrim\", {\n \"loading\": [516],\n \"messages\": [1040],\n \"messageOverrides\": [1040],\n \"loaderScale\": [32],\n \"defaultMessages\": [32],\n \"effectiveLocale\": [32],\n \"hasContent\": [32]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-scrim\", \"calcite-loader\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-scrim\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Scrim);\n }\n break;\n case \"calcite-loader\":\n if (!customElements.get(tagName)) {\n defineCustomElement$1();\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Scrim as S, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client/index.js';\nimport { e as slotChangeHasAssignedElement, t as toAriaBoolean } from './dom.js';\nimport { c as connectInteractive, d as disconnectInteractive, u as updateHostInteraction } from './interactive.js';\nimport { c as createObserver } from './observers.js';\nimport { u as updateListItemChildren, g as getListItemChildren, M as MAX_COLUMNS } from './utils3.js';\nimport { d as dragActive, a as disconnectSortableComponent, c as connectSortableComponent } from './sortableComponent.js';\nimport { S as SLOTS$1, d as defineCustomElement$2 } from './stack.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { d as defineCustomElement$8 } from './filter.js';\nimport { d as defineCustomElement$7 } from './icon.js';\nimport { d as defineCustomElement$6 } from './input.js';\nimport { d as defineCustomElement$5 } from './loader.js';\nimport { d as defineCustomElement$4 } from './progress.js';\nimport { d as defineCustomElement$3 } from './scrim.js';\nimport { d as debounce } from './debounce.js';\n\nconst CSS = {\n container: \"container\",\n table: \"table\",\n scrim: \"scrim\",\n stack: \"stack\",\n tableContainer: \"table-container\",\n sticky: \"sticky-pos\",\n assistiveText: \"assistive-text\",\n};\nconst debounceTimeout = 0;\nconst SLOTS = {\n filterActionsStart: \"filter-actions-start\",\n filterActionsEnd: \"filter-actions-end\",\n};\n\nconst listCss = \":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}::slotted(calcite-list-item){--tw-shadow:0 -1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 -1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);margin-block-start:1px}::slotted(calcite-list-item:first-of-type){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}::slotted(calcite-list-item[data-filter]){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);margin-block-start:0px}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-app-z-index-sticky);background-color:var(--calcite-ui-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst listItemSelector = \"calcite-list-item\";\nconst listItemSelectorDirect = `:scope > calcite-list-item`;\nconst parentSelector = \"calcite-list-item-group, calcite-list-item\";\nconst List = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteListChange = createEvent(this, \"calciteListChange\", 6);\n this.calciteListFilter = createEvent(this, \"calciteListFilter\", 6);\n this.calciteListOrderChange = createEvent(this, \"calciteListOrderChange\", 6);\n this.calciteInternalListDefaultSlotChange = createEvent(this, \"calciteInternalListDefaultSlotChange\", 6);\n this.dragSelector = \"calcite-list-item\";\n this.enabledListItems = [];\n this.handleSelector = \"calcite-handle\";\n this.listItems = [];\n this.mutationObserver = createObserver(\"mutation\", () => this.updateListItems());\n this.handleDefaultSlotChange = (event) => {\n updateListItemChildren(getListItemChildren(event.target));\n if (this.parentListEl) {\n this.calciteInternalListDefaultSlotChange.emit();\n }\n };\n this.handleFilterActionsStartSlotChange = (event) => {\n this.hasFilterActionsStart = slotChangeHasAssignedElement(event);\n };\n this.handleFilterActionsEndSlotChange = (event) => {\n this.hasFilterActionsEnd = slotChangeHasAssignedElement(event);\n };\n this.setActiveListItem = () => {\n const { enabledListItems } = this;\n if (!enabledListItems.some((item) => item.active)) {\n if (enabledListItems[0]) {\n enabledListItems[0].active = true;\n }\n }\n };\n this.updateSelectedItems = (emit = false) => {\n this.selectedItems = this.enabledListItems.filter((item) => item.selected);\n if (emit) {\n this.calciteListChange.emit();\n }\n };\n this.updateFilteredItems = (emit = false) => {\n const { listItems, filteredData, filterText } = this;\n const values = filteredData.map((item) => item.value);\n const lastDescendantItems = listItems?.filter((listItem) => listItems.every((li) => li === listItem || !listItem.contains(li)));\n const filteredItems = listItems.filter((item) => !filterText || values.includes(item.value)) || [];\n const visibleParents = new WeakSet();\n lastDescendantItems.forEach((listItem) => this.filterElements({ el: listItem, filteredItems, visibleParents }));\n if (filteredItems.length > 0) {\n this.findAncestorOfFirstFilteredItem(filteredItems);\n }\n this.filteredItems = filteredItems;\n if (emit) {\n this.calciteListFilter.emit();\n }\n };\n this.setFilterEl = (el) => {\n this.filterEl = el;\n this.performFilter();\n };\n this.handleFilterChange = (event) => {\n event.stopPropagation();\n const { value } = event.currentTarget;\n this.filterText = value;\n this.updateFilteredData(true);\n };\n this.getItemData = () => {\n return this.listItems.map((item) => ({\n label: item.label,\n description: item.description,\n metadata: item.metadata,\n value: item.value,\n }));\n };\n this.updateListItems = debounce((emit = false) => {\n const { selectionAppearance, selectionMode, dragEnabled } = this;\n if (!!this.parentListEl) {\n const items = this.queryListItems(true);\n items.forEach((item) => {\n item.dragHandle = dragEnabled;\n });\n this.setUpSorting();\n return;\n }\n const items = this.queryListItems();\n items.forEach((item) => {\n item.selectionAppearance = selectionAppearance;\n item.selectionMode = selectionMode;\n });\n const dragItems = this.queryListItems(true);\n dragItems.forEach((item) => {\n item.dragHandle = dragEnabled;\n });\n this.listItems = items;\n if (this.filterEnabled) {\n this.dataForFilter = this.getItemData();\n if (this.filterEl) {\n this.filterEl.items = this.dataForFilter;\n }\n }\n this.updateFilteredItems(emit);\n this.enabledListItems = this.filteredItems.filter((item) => !item.disabled && !item.closed);\n this.setActiveListItem();\n this.updateSelectedItems(emit);\n this.setUpSorting();\n }, debounceTimeout);\n this.queryListItems = (direct = false) => {\n return Array.from(this.el.querySelectorAll(direct ? listItemSelectorDirect : listItemSelector));\n };\n this.focusRow = (focusEl) => {\n const { enabledListItems } = this;\n if (!focusEl) {\n return;\n }\n enabledListItems.forEach((listItem) => (listItem.active = listItem === focusEl));\n focusEl.setFocus();\n };\n this.isNavigable = (listItem) => {\n const parentListItemEl = listItem.parentElement?.closest(listItemSelector);\n if (!parentListItemEl) {\n return true;\n }\n return parentListItemEl.open && this.isNavigable(parentListItemEl);\n };\n this.handleListKeydown = (event) => {\n if (event.defaultPrevented || !!this.parentListEl) {\n return;\n }\n const { key } = event;\n const filteredItems = this.enabledListItems.filter((listItem) => this.isNavigable(listItem));\n const currentIndex = filteredItems.findIndex((listItem) => listItem.active);\n if (key === \"ArrowDown\") {\n event.preventDefault();\n const nextIndex = event.target === this.filterEl ? 0 : currentIndex + 1;\n if (filteredItems[nextIndex]) {\n this.focusRow(filteredItems[nextIndex]);\n }\n }\n else if (key === \"ArrowUp\") {\n event.preventDefault();\n if (currentIndex === 0 && this.filterEnabled) {\n this.filterEl?.setFocus();\n return;\n }\n const prevIndex = currentIndex - 1;\n if (filteredItems[prevIndex]) {\n this.focusRow(filteredItems[prevIndex]);\n }\n }\n else if (key === \"Home\") {\n event.preventDefault();\n const homeItem = filteredItems[0];\n if (homeItem) {\n this.focusRow(homeItem);\n }\n }\n else if (key === \"End\") {\n event.preventDefault();\n const endItem = filteredItems[filteredItems.length - 1];\n if (endItem) {\n this.focusRow(endItem);\n }\n }\n };\n this.findAncestorOfFirstFilteredItem = (filteredItems) => {\n this.ancestorOfFirstFilteredItem?.removeAttribute(\"data-filter\");\n filteredItems.forEach((item) => {\n item.removeAttribute(\"data-filter\");\n });\n this.ancestorOfFirstFilteredItem = this.getTopLevelAncestorItemElement(filteredItems[0]);\n filteredItems[0].setAttribute(\"data-filter\", \"0\");\n this.ancestorOfFirstFilteredItem?.setAttribute(\"data-filter\", \"0\");\n };\n this.getTopLevelAncestorItemElement = (el) => {\n let closestParent = el.parentElement.closest(\"calcite-list-item\");\n while (closestParent) {\n const closestListItemAncestor = closestParent.parentElement.closest(\"calcite-list-item\");\n if (closestListItemAncestor) {\n closestParent = closestListItemAncestor;\n }\n else {\n return closestParent;\n }\n }\n return null;\n };\n this.disabled = false;\n this.canPull = undefined;\n this.canPut = undefined;\n this.dragEnabled = false;\n this.group = undefined;\n this.filterEnabled = false;\n this.filteredItems = [];\n this.filteredData = [];\n this.filterPlaceholder = undefined;\n this.filterText = undefined;\n this.label = undefined;\n this.loading = false;\n this.openable = false;\n this.selectedItems = [];\n this.selectionMode = \"none\";\n this.selectionAppearance = \"icon\";\n this.assistiveText = undefined;\n this.dataForFilter = [];\n this.hasFilterActionsEnd = false;\n this.hasFilterActionsStart = false;\n }\n async handleFilterTextChange() {\n this.performFilter();\n }\n handleListItemChange() {\n this.updateListItems();\n }\n handleCalciteInternalFocusPreviousItem(event) {\n if (this.parentListEl) {\n return;\n }\n event.stopPropagation();\n const { enabledListItems } = this;\n const currentIndex = enabledListItems.findIndex((listItem) => listItem.active);\n const prevIndex = currentIndex - 1;\n if (enabledListItems[prevIndex]) {\n this.focusRow(enabledListItems[prevIndex]);\n }\n }\n handleCalciteInternalListItemActive(event) {\n if (!!this.parentListEl) {\n return;\n }\n event.stopPropagation();\n const target = event.target;\n const { listItems } = this;\n listItems.forEach((listItem) => {\n listItem.active = listItem === target;\n });\n }\n handleCalciteListItemSelect() {\n if (!!this.parentListEl) {\n return;\n }\n this.updateSelectedItems(true);\n }\n handleCalciteInternalHandleChange(event) {\n this.assistiveText = event.detail.message;\n event.stopPropagation();\n }\n handleCalciteHandleNudge(event) {\n if (!!this.parentListEl) {\n return;\n }\n this.handleNudgeEvent(event);\n }\n handleCalciteInternalListItemSelect(event) {\n if (!!this.parentListEl) {\n return;\n }\n event.stopPropagation();\n const target = event.target;\n const { listItems, selectionMode } = this;\n if (target.selected && (selectionMode === \"single\" || selectionMode === \"single-persist\")) {\n listItems.forEach((listItem) => (listItem.selected = listItem === target));\n }\n this.updateSelectedItems();\n }\n handleCalciteInternalListItemChange(event) {\n if (!!this.parentListEl) {\n return;\n }\n event.stopPropagation();\n this.updateListItems();\n }\n handleCalciteInternalListItemGroupDefaultSlotChange(event) {\n event.stopPropagation();\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n if (dragActive(this)) {\n return;\n }\n this.connectObserver();\n this.updateListItems();\n this.setUpSorting();\n connectInteractive(this);\n this.setParentList();\n }\n disconnectedCallback() {\n if (dragActive(this)) {\n return;\n }\n this.disconnectObserver();\n disconnectSortableComponent(this);\n disconnectInteractive(this);\n }\n componentWillLoad() {\n setUpLoadableComponent(this);\n }\n componentDidRender() {\n updateHostInteraction(this);\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n // --------------------------------------------------------------------------\n //\n // Public Methods\n //\n // --------------------------------------------------------------------------\n /**\n * Sets focus on the component's first focusable element.\n *\n * @returns {Promise}\n */\n async setFocus() {\n await componentFocusable(this);\n if (this.filterEnabled) {\n return this.filterEl?.setFocus();\n }\n return this.enabledListItems.find((listItem) => listItem.active)?.setFocus();\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n render() {\n const { loading, label, disabled, dataForFilter, filterEnabled, filterPlaceholder, filterText, hasFilterActionsStart, hasFilterActionsEnd, } = this;\n return (h(\"div\", { class: CSS.container }, this.dragEnabled ? (h(\"span\", { \"aria-live\": \"assertive\", class: CSS.assistiveText }, this.assistiveText)) : null, loading ? h(\"calcite-scrim\", { class: CSS.scrim, loading: loading }) : null, h(\"table\", { \"aria-busy\": toAriaBoolean(loading), \"aria-label\": label || \"\", class: CSS.table, onKeyDown: this.handleListKeydown, role: \"treegrid\" }, filterEnabled || hasFilterActionsStart || hasFilterActionsEnd ? (h(\"thead\", null, h(\"tr\", { class: { [CSS.sticky]: true } }, h(\"th\", { colSpan: MAX_COLUMNS }, h(\"calcite-stack\", { class: CSS.stack }, h(\"slot\", { name: SLOTS.filterActionsStart, onSlotchange: this.handleFilterActionsStartSlotChange, slot: SLOTS$1.actionsStart }), h(\"calcite-filter\", { \"aria-label\": filterPlaceholder, disabled: loading || disabled, items: dataForFilter, onCalciteFilterChange: this.handleFilterChange, placeholder: filterPlaceholder, value: filterText,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: this.setFilterEl }), h(\"slot\", { name: SLOTS.filterActionsEnd, onSlotchange: this.handleFilterActionsEndSlotChange, slot: SLOTS$1.actionsEnd })))))) : null, h(\"tbody\", { class: CSS.tableContainer }, h(\"slot\", { onSlotchange: this.handleDefaultSlotChange })))));\n }\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n connectObserver() {\n this.mutationObserver?.observe(this.el, { childList: true, subtree: true });\n }\n disconnectObserver() {\n this.mutationObserver?.disconnect();\n }\n setUpSorting() {\n const { dragEnabled } = this;\n if (!dragEnabled) {\n return;\n }\n connectSortableComponent(this);\n }\n onDragStart() {\n this.disconnectObserver();\n }\n onDragEnd() {\n this.connectObserver();\n }\n onDragSort(detail) {\n this.setParentList();\n this.updateListItems();\n this.calciteListOrderChange.emit(detail);\n }\n setParentList() {\n this.parentListEl = this.el.parentElement?.closest(\"calcite-list\");\n }\n filterElements({ el, filteredItems, visibleParents, }) {\n const hidden = !visibleParents.has(el) && !filteredItems.includes(el);\n el.hidden = hidden;\n const closestParent = el.parentElement.closest(parentSelector);\n if (!closestParent) {\n return;\n }\n if (!hidden) {\n visibleParents.add(closestParent);\n }\n this.filterElements({\n el: closestParent,\n filteredItems,\n visibleParents,\n });\n }\n updateFilteredData(emit = false) {\n const { filterEl } = this;\n if (!filterEl) {\n return;\n }\n if (filterEl.filteredItems) {\n this.filteredData = filterEl.filteredItems;\n }\n this.updateListItems(emit);\n }\n async performFilter() {\n const { filterEl, filterText } = this;\n if (!filterEl) {\n return;\n }\n filterEl.value = filterText;\n await filterEl.filter(filterText);\n this.updateFilteredData();\n }\n handleNudgeEvent(event) {\n const { direction } = event.detail;\n const composedPath = event.composedPath();\n const handle = composedPath.find((el) => el.tagName === \"CALCITE-HANDLE\");\n const sortItem = composedPath.find((el) => el.tagName === \"CALCITE-LIST-ITEM\");\n const parentEl = sortItem?.parentElement;\n if (!parentEl) {\n return;\n }\n const { enabledListItems } = this;\n const sameParentItems = enabledListItems.filter((item) => item.parentElement === parentEl);\n const lastIndex = sameParentItems.length - 1;\n const oldIndex = sameParentItems.indexOf(sortItem);\n let appendInstead = false;\n let newIndex;\n if (direction === \"up\") {\n if (oldIndex === 0) {\n appendInstead = true;\n newIndex = lastIndex;\n }\n else {\n newIndex = oldIndex - 1;\n }\n }\n else {\n if (oldIndex === lastIndex) {\n newIndex = 0;\n }\n else if (oldIndex === lastIndex - 1) {\n appendInstead = true;\n newIndex = lastIndex;\n }\n else {\n newIndex = oldIndex + 2;\n }\n }\n this.disconnectObserver();\n if (appendInstead) {\n parentEl.appendChild(sortItem);\n }\n else {\n parentEl.insertBefore(sortItem, sameParentItems[newIndex]);\n }\n this.updateListItems();\n this.connectObserver();\n this.calciteListOrderChange.emit({\n dragEl: sortItem,\n fromEl: parentEl,\n toEl: parentEl,\n newIndex,\n oldIndex,\n });\n handle.setFocus().then(() => {\n handle.activated = true;\n });\n }\n get el() { return this; }\n static get watchers() { return {\n \"filterText\": [\"handleFilterTextChange\"],\n \"filterEnabled\": [\"handleListItemChange\"],\n \"group\": [\"handleListItemChange\"],\n \"dragEnabled\": [\"handleListItemChange\"],\n \"selectionMode\": [\"handleListItemChange\"],\n \"selectionAppearance\": [\"handleListItemChange\"]\n }; }\n static get style() { return listCss; }\n}, [1, \"calcite-list\", {\n \"disabled\": [516],\n \"canPull\": [16],\n \"canPut\": [16],\n \"dragEnabled\": [516, \"drag-enabled\"],\n \"group\": [513],\n \"filterEnabled\": [516, \"filter-enabled\"],\n \"filteredItems\": [1040],\n \"filteredData\": [1040],\n \"filterPlaceholder\": [513, \"filter-placeholder\"],\n \"filterText\": [1537, \"filter-text\"],\n \"label\": [1],\n \"loading\": [516],\n \"openable\": [4],\n \"selectedItems\": [1040],\n \"selectionMode\": [513, \"selection-mode\"],\n \"selectionAppearance\": [513, \"selection-appearance\"],\n \"assistiveText\": [32],\n \"dataForFilter\": [32],\n \"hasFilterActionsEnd\": [32],\n \"hasFilterActionsStart\": [32],\n \"setFocus\": [64]\n }, [[0, \"calciteInternalFocusPreviousItem\", \"handleCalciteInternalFocusPreviousItem\"], [0, \"calciteInternalListItemActive\", \"handleCalciteInternalListItemActive\"], [0, \"calciteListItemSelect\", \"handleCalciteListItemSelect\"], [0, \"calciteInternalHandleChange\", \"handleCalciteInternalHandleChange\"], [0, \"calciteHandleNudge\", \"handleCalciteHandleNudge\"], [0, \"calciteInternalListItemSelect\", \"handleCalciteInternalListItemSelect\"], [0, \"calciteInternalListItemChange\", \"handleCalciteInternalListItemChange\"], [0, \"calciteInternalListItemGroupDefaultSlotChange\", \"handleCalciteInternalListItemGroupDefaultSlotChange\"]]]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-list\", \"calcite-filter\", \"calcite-icon\", \"calcite-input\", \"calcite-loader\", \"calcite-progress\", \"calcite-scrim\", \"calcite-stack\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-list\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, List);\n }\n break;\n case \"calcite-filter\":\n if (!customElements.get(tagName)) {\n defineCustomElement$8();\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$7();\n }\n break;\n case \"calcite-input\":\n if (!customElements.get(tagName)) {\n defineCustomElement$6();\n }\n break;\n case \"calcite-loader\":\n if (!customElements.get(tagName)) {\n defineCustomElement$5();\n }\n break;\n case \"calcite-progress\":\n if (!customElements.get(tagName)) {\n defineCustomElement$4();\n }\n break;\n case \"calcite-scrim\":\n if (!customElements.get(tagName)) {\n defineCustomElement$3();\n }\n break;\n case \"calcite-stack\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst CalciteList = List;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteList, defineCustomElement };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, forceUpdate, Build, h, Host } from '@stencil/core/internal/client/index.js';\nimport { t as toAriaBoolean } from './dom.js';\nimport { g as guid } from './guid.js';\nimport { c as connectInteractive, d as disconnectInteractive, u as updateHostInteraction } from './interactive.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { c as createObserver } from './observers.js';\nimport { g as getIconScale } from './component.js';\nimport { u as updateMessages, c as connectMessages, s as setUpMessages, d as disconnectMessages } from './t9n.js';\nimport { d as defineCustomElement$2 } from './icon.js';\nimport { d as defineCustomElement$1 } from './loader.js';\n\nconst CSS = {\n button: \"button\",\n buttonTextVisible: \"button--text-visible\",\n buttonCompact: \"button--compact\",\n indicatorText: \"indicator-text\",\n iconContainer: \"icon-container\",\n slotContainer: \"slot-container\",\n slotContainerHidden: \"slot-container--hidden\",\n textContainer: \"text-container\",\n textContainerVisible: \"text-container--visible\",\n indicatorWithIcon: \"indicator-with-icon\",\n indicatorWithoutIcon: \"indicator-without-icon\",\n};\nconst SLOTS = {\n tooltip: \"tooltip\",\n};\n\nconst actionCss = \":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;background-color:transparent;--calcite-action-indicator-color:var(--calcite-ui-brand)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.button{position:relative;margin:0px;display:flex;inline-size:auto;cursor:pointer;align-items:center;justify-content:flex-start;border-style:none;background-color:var(--calcite-ui-foreground-1);fill:var(--calcite-ui-text-3);font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-3);outline-color:transparent;text-align:unset;flex:1 0 auto}.button:hover{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}.button:focus{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}.button:active{background-color:var(--calcite-ui-foreground-3)}.button .icon-container{pointer-events:none;margin:0px;display:flex;align-items:center;justify-content:center;min-inline-size:1rem;min-block-size:1rem}.button .text-container{margin:0px;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5rem;opacity:0;transition-property:opacity;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:margin;transition-property:inline-size}.button .text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([scale=s]) .button{padding-inline:0.5rem;padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=s]) .button--text-visible .icon-container{margin-inline-end:0.5rem}:host([scale=m]) .button{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=m]) .button--text-visible .icon-container{margin-inline-end:0.75rem}:host([scale=l]) .button{padding:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=l]) .button--text-visible .icon-container{margin-inline-end:1rem}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.button--text-visible{inline-size:100%}:host([active]) .button,:host([active]) .button:hover,:host([active]) .button:focus,:host([active][loading]) .button{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([active]) .button:active{background-color:var(--calcite-ui-foreground-1)}:host([appearance=transparent]) .button{background-color:transparent}:host([appearance=transparent][active]) .button,:host([appearance=transparent]) .button:hover,:host([appearance=transparent]) .button:focus{background-color:var(--calcite-button-transparent-hover)}:host([appearance=transparent]) .button:active{background-color:var(--calcite-button-transparent-press)}:host([appearance=transparent][disabled]) .button{background-color:transparent}:host([loading][appearance=solid]) .button,:host([loading][appearance=solid]) .button:hover,:host([loading][appearance=solid]) .button:focus{background-color:var(--calcite-ui-foreground-1)}:host([loading][appearance=solid]) .button .text-container,:host([loading][appearance=solid]) .button:hover .text-container,:host([loading][appearance=solid]) .button:focus .text-container{opacity:var(--calcite-ui-opacity-disabled)}:host([loading]) calcite-loader[inline]{color:var(--calcite-ui-text-3);margin-inline-end:0px}:host([disabled]) .button,:host([disabled]) .button:hover,:host([disabled]) .button:focus{cursor:default;background-color:var(--calcite-ui-foreground-1);opacity:var(--calcite-ui-opacity-disabled)}:host([disabled][active]) .button,:host([disabled][active]) .button:hover,:host([disabled][active]) .button:focus{background-color:var(--calcite-ui-foreground-3);opacity:var(--calcite-ui-opacity-disabled)}:host([appearance=transparent]) .button{background-color:transparent;transition-property:box-shadow;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.indicator-with-icon{position:relative}.indicator-with-icon::after{content:\\\"\\\";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;inset-block-end:-0.275rem;inset-inline-end:-0.275rem;background-color:var(--calcite-action-indicator-color)}.indicator-without-icon{margin-inline:0.25rem;inline-size:1rem;position:relative}.indicator-without-icon::after{content:\\\"\\\";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;inset-block-end:-0.275rem;inset-inline-end:-0.275rem;background-color:var(--calcite-action-indicator-color)}.indicator-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Action = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.mutationObserver = createObserver(\"mutation\", () => forceUpdate(this));\n this.guid = `calcite-action-${guid()}`;\n this.indicatorId = `${this.guid}-indicator`;\n this.buttonId = `${this.guid}-button`;\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n this.handleTooltipSlotChange = (event) => {\n const tooltips = event.target\n .assignedElements({\n flatten: true,\n })\n .filter((el) => el?.matches(\"calcite-tooltip\"));\n const tooltip = tooltips[0];\n if (tooltip) {\n tooltip.referenceElement = this.buttonEl;\n }\n };\n this.active = false;\n this.alignment = undefined;\n this.appearance = \"solid\";\n this.compact = false;\n this.disabled = false;\n this.icon = undefined;\n this.iconFlipRtl = false;\n this.indicator = false;\n this.label = undefined;\n this.loading = false;\n this.scale = \"m\";\n this.text = undefined;\n this.textEnabled = false;\n this.messages = undefined;\n this.messageOverrides = undefined;\n this.effectiveLocale = \"\";\n this.defaultMessages = undefined;\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n // --------------------------------------------------------------------------\n //\n // Lifecycle\n //\n // --------------------------------------------------------------------------\n connectedCallback() {\n connectInteractive(this);\n connectLocalized(this);\n connectMessages(this);\n this.mutationObserver?.observe(this.el, { childList: true, subtree: true });\n }\n async componentWillLoad() {\n setUpLoadableComponent(this);\n if (Build.isBrowser) {\n await setUpMessages(this);\n }\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n disconnectedCallback() {\n disconnectInteractive(this);\n disconnectLocalized(this);\n disconnectMessages(this);\n this.mutationObserver?.disconnect();\n }\n componentDidRender() {\n updateHostInteraction(this);\n }\n // --------------------------------------------------------------------------\n //\n // Methods\n //\n // --------------------------------------------------------------------------\n /** Sets focus on the component. */\n async setFocus() {\n await componentFocusable(this);\n this.buttonEl?.focus();\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n renderTextContainer() {\n const { text, textEnabled } = this;\n const textContainerClasses = {\n [CSS.textContainer]: true,\n [CSS.textContainerVisible]: textEnabled,\n };\n return text ? (h(\"div\", { class: textContainerClasses, key: \"text-container\" }, text)) : null;\n }\n renderIndicatorText() {\n const { indicator, messages, indicatorId, buttonId } = this;\n return (h(\"div\", { \"aria-labelledby\": buttonId, \"aria-live\": \"polite\", class: CSS.indicatorText, id: indicatorId, role: \"region\" }, indicator ? messages.indicator : null));\n }\n renderIconContainer() {\n const { loading, icon, scale, el, iconFlipRtl, indicator } = this;\n const loaderScale = scale === \"l\" ? \"l\" : \"m\";\n const calciteLoaderNode = loading ? (h(\"calcite-loader\", { inline: true, label: this.messages.loading, scale: loaderScale })) : null;\n const calciteIconNode = icon ? (h(\"calcite-icon\", { class: { [CSS.indicatorWithIcon]: indicator }, flipRtl: iconFlipRtl, icon: icon, scale: getIconScale(this.scale) })) : null;\n const iconNode = calciteLoaderNode || calciteIconNode;\n const hasIconToDisplay = iconNode || el.children?.length;\n const slotContainerNode = (h(\"div\", { class: {\n [CSS.slotContainer]: true,\n [CSS.slotContainerHidden]: loading,\n } }, h(\"slot\", null)));\n return hasIconToDisplay ? (h(\"div\", { \"aria-hidden\": \"true\", class: CSS.iconContainer, key: \"icon-container\" }, iconNode, slotContainerNode)) : null;\n }\n render() {\n const { active, compact, disabled, icon, loading, textEnabled, label, text, indicator, indicatorId, buttonId, messages, } = this;\n const ariaLabel = `${label || text}${indicator ? ` (${messages.indicator})` : \"\"}`;\n const buttonClasses = {\n [CSS.button]: true,\n [CSS.buttonTextVisible]: textEnabled,\n [CSS.buttonCompact]: compact,\n };\n return (h(Host, null, h(\"button\", { \"aria-busy\": toAriaBoolean(loading), \"aria-controls\": indicator ? indicatorId : null, \"aria-disabled\": toAriaBoolean(disabled), \"aria-label\": ariaLabel, \"aria-pressed\": toAriaBoolean(active), class: buttonClasses, disabled: disabled, id: buttonId,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (buttonEl) => (this.buttonEl = buttonEl) }, this.renderIconContainer(), this.renderTextContainer(), !icon && indicator && h(\"div\", { class: CSS.indicatorWithoutIcon, key: \"indicator-no-icon\" })), h(\"slot\", { name: SLOTS.tooltip, onSlotchange: this.handleTooltipSlotChange }), this.renderIndicatorText()));\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"messageOverrides\": [\"onMessagesChange\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return actionCss; }\n}, [1, \"calcite-action\", {\n \"active\": [516],\n \"alignment\": [513],\n \"appearance\": [513],\n \"compact\": [516],\n \"disabled\": [516],\n \"icon\": [1],\n \"iconFlipRtl\": [516, \"icon-flip-rtl\"],\n \"indicator\": [516],\n \"label\": [1],\n \"loading\": [516],\n \"scale\": [513],\n \"text\": [1],\n \"textEnabled\": [516, \"text-enabled\"],\n \"messages\": [1040],\n \"messageOverrides\": [1040],\n \"effectiveLocale\": [32],\n \"defaultMessages\": [32],\n \"setFocus\": [64]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-action\", \"calcite-icon\", \"calcite-loader\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-action\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Action);\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n case \"calcite-loader\":\n if (!customElements.get(tagName)) {\n defineCustomElement$1();\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Action as A, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client/index.js';\nimport { t as toAriaBoolean } from './dom.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { c as connectMessages, s as setUpMessages, d as disconnectMessages, u as updateMessages } from './t9n.js';\nimport { d as defineCustomElement$1 } from './icon.js';\n\nconst CSS = {\n handle: \"handle\",\n handleActivated: \"handle--activated\",\n};\nconst ICONS = {\n drag: \"drag\",\n};\n\nconst handleCss = \":host{display:flex}.handle{display:flex;cursor:move;align-items:center;justify-content:center;align-self:stretch;border-style:none;background-color:transparent;outline-color:transparent;color:var(--calcite-ui-border-input);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle:hover{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.handle:focus{color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}.handle--activated{background-color:var(--calcite-ui-foreground-3);color:var(--calcite-ui-text-1)}.handle calcite-icon{color:inherit}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Handle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteHandleNudge = createEvent(this, \"calciteHandleNudge\", 6);\n this.calciteInternalHandleChange = createEvent(this, \"calciteInternalHandleChange\", 6);\n this.handleKeyDown = (event) => {\n switch (event.key) {\n case \" \":\n this.activated = !this.activated;\n event.preventDefault();\n break;\n case \"ArrowUp\":\n if (!this.activated) {\n return;\n }\n event.preventDefault();\n this.calciteHandleNudge.emit({ direction: \"up\" });\n break;\n case \"ArrowDown\":\n if (!this.activated) {\n return;\n }\n event.preventDefault();\n this.calciteHandleNudge.emit({ direction: \"down\" });\n break;\n }\n };\n this.handleBlur = () => {\n this.activated = false;\n };\n this.activated = false;\n this.dragHandle = undefined;\n this.messages = undefined;\n this.setPosition = undefined;\n this.setSize = undefined;\n this.label = undefined;\n this.messageOverrides = undefined;\n this.effectiveLocale = undefined;\n this.defaultMessages = undefined;\n }\n handleAriaTextChange() {\n const message = this.getAriaText(\"live\");\n if (message) {\n this.calciteInternalHandleChange.emit({\n message,\n });\n }\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n connectMessages(this);\n connectLocalized(this);\n }\n async componentWillLoad() {\n setUpLoadableComponent(this);\n await setUpMessages(this);\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n disconnectedCallback() {\n disconnectMessages(this);\n disconnectLocalized(this);\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n // --------------------------------------------------------------------------\n //\n // Methods\n //\n // --------------------------------------------------------------------------\n /** Sets focus on the component. */\n async setFocus() {\n await componentFocusable(this);\n this.handleButton?.focus();\n }\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n getAriaText(type) {\n const { setPosition, setSize, label, messages, activated } = this;\n if (!messages || !label || typeof setSize !== \"number\" || typeof setPosition !== \"number\") {\n return null;\n }\n const text = type === \"label\"\n ? activated\n ? messages.dragHandleChange\n : messages.dragHandleIdle\n : activated\n ? messages.dragHandleActive\n : messages.dragHandleCommit;\n const replacePosition = text.replace(\"{position}\", setPosition.toString());\n const replaceLabel = replacePosition.replace(\"{itemLabel}\", label);\n return replaceLabel.replace(\"{total}\", setSize.toString());\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n render() {\n return (\n // Needs to be a span because of https://github.com/SortableJS/Sortable/issues/1486\n h(\"span\", { \"aria-label\": this.getAriaText(\"label\"), \"aria-pressed\": toAriaBoolean(this.activated), class: { [CSS.handle]: true, [CSS.handleActivated]: this.activated }, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, role: \"button\", tabindex: \"0\", title: this.messages?.dragHandle,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => {\n this.handleButton = el;\n } }, h(\"calcite-icon\", { icon: ICONS.drag, scale: \"s\" })));\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"messages\": [\"handleAriaTextChange\"],\n \"label\": [\"handleAriaTextChange\"],\n \"activated\": [\"handleAriaTextChange\"],\n \"setPosition\": [\"handleAriaTextChange\"],\n \"setSize\": [\"handleAriaTextChange\"],\n \"messageOverrides\": [\"onMessagesChange\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return handleCss; }\n}, [1, \"calcite-handle\", {\n \"activated\": [1540],\n \"dragHandle\": [513, \"drag-handle\"],\n \"messages\": [16],\n \"setPosition\": [2, \"set-position\"],\n \"setSize\": [2, \"set-size\"],\n \"label\": [1],\n \"messageOverrides\": [16],\n \"effectiveLocale\": [32],\n \"defaultMessages\": [32],\n \"setFocus\": [64]\n }]);\nfunction defineCustomElement() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-handle\", \"calcite-icon\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-handle\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Handle);\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$1();\n }\n break;\n } });\n}\ndefineCustomElement();\n\nexport { Handle as H, defineCustomElement as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client/index.js';\nimport { e as slotChangeHasAssignedElement, b as getElementDir, t as toAriaBoolean } from './dom.js';\nimport { c as connectInteractive, u as updateHostInteraction, d as disconnectInteractive } from './interactive.js';\nimport { a as getDepth, C as CSS, I as ICONS, S as SLOTS, g as getListItemChildren, u as updateListItemChildren } from './utils3.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { u as updateMessages, c as connectMessages, s as setUpMessages, d as disconnectMessages } from './t9n.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { d as defineCustomElement$5 } from './action.js';\nimport { d as defineCustomElement$4 } from './handle.js';\nimport { d as defineCustomElement$3 } from './icon.js';\nimport { d as defineCustomElement$2 } from './loader.js';\n\nconst listItemCss = \":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;--calcite-list-item-icon-color:var(--calcite-ui-brand);--calcite-list-item-spacing-indent:1rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{box-sizing:border-box;display:flex;flex:1 1 0%;background-color:var(--calcite-ui-foreground-1);font-family:var(--calcite-sans-family);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.container *{box-sizing:border-box}.container:hover{cursor:pointer;background-color:var(--calcite-ui-foreground-2)}.container:active{background-color:var(--calcite-ui-foreground-1)}.container--border-selected{border-inline-start:4px solid var(--calcite-ui-brand)}.container--border-unselected{border-inline-start:4px solid transparent}.nested-container{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1)}.nested-container--hidden{display:none}.content-container{display:flex;flex:1 1 auto;align-items:stretch;padding:0px;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}tr,td{outline-color:transparent}tr:focus,td:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description,.content-bottom{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child,.content-bottom:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-ui-text-1)}.description{margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-bottom{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-inline:0.75rem;color:var(--calcite-list-item-icon-color)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.open-container,.selection-container{cursor:pointer}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}::slotted(calcite-list-item){border-width:0px;border-block-start-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst focusMap = new Map();\nconst listSelector = \"calcite-list\";\nconst ListItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteListItemSelect = createEvent(this, \"calciteListItemSelect\", 6);\n this.calciteListItemClose = createEvent(this, \"calciteListItemClose\", 6);\n this.calciteInternalListItemSelect = createEvent(this, \"calciteInternalListItemSelect\", 6);\n this.calciteInternalListItemActive = createEvent(this, \"calciteInternalListItemActive\", 6);\n this.calciteInternalFocusPreviousItem = createEvent(this, \"calciteInternalFocusPreviousItem\", 6);\n this.calciteInternalListItemChange = createEvent(this, \"calciteInternalListItemChange\", 6);\n this.closeClickHandler = () => {\n this.closed = true;\n this.calciteListItemClose.emit();\n };\n this.handleContentSlotChange = (event) => {\n this.hasCustomContent = slotChangeHasAssignedElement(event);\n };\n this.handleActionsStartSlotChange = (event) => {\n this.hasActionsStart = slotChangeHasAssignedElement(event);\n };\n this.handleActionsEndSlotChange = (event) => {\n this.hasActionsEnd = slotChangeHasAssignedElement(event);\n };\n this.handleContentStartSlotChange = (event) => {\n this.hasContentStart = slotChangeHasAssignedElement(event);\n };\n this.handleContentEndSlotChange = (event) => {\n this.hasContentEnd = slotChangeHasAssignedElement(event);\n };\n this.handleContentBottomSlotChange = (event) => {\n this.hasContentBottom = slotChangeHasAssignedElement(event);\n };\n this.handleDefaultSlotChange = (event) => {\n this.handleOpenableChange(event.target);\n };\n this.toggleOpen = () => {\n this.open = !this.open;\n };\n this.itemClicked = (event) => {\n if (event.defaultPrevented) {\n return;\n }\n this.toggleSelected();\n this.calciteInternalListItemActive.emit();\n };\n this.toggleSelected = () => {\n const { selectionMode, selected } = this;\n if (this.disabled) {\n return;\n }\n if (selectionMode === \"multiple\" || selectionMode === \"single\") {\n this.selected = !selected;\n }\n else if (selectionMode === \"single-persist\") {\n this.selected = true;\n }\n this.calciteListItemSelect.emit();\n };\n this.handleItemKeyDown = (event) => {\n if (event.defaultPrevented) {\n return;\n }\n const { key } = event;\n const composedPath = event.composedPath();\n const { containerEl, contentEl, actionsStartEl, actionsEndEl, open, openable } = this;\n const cells = [actionsStartEl, contentEl, actionsEndEl].filter(Boolean);\n const currentIndex = cells.findIndex((cell) => composedPath.includes(cell));\n if (key === \"Enter\" &&\n !composedPath.includes(actionsStartEl) &&\n !composedPath.includes(actionsEndEl)) {\n event.preventDefault();\n this.toggleSelected();\n }\n else if (key === \"ArrowRight\") {\n event.preventDefault();\n const nextIndex = currentIndex + 1;\n if (currentIndex === -1) {\n if (!open && openable) {\n this.open = true;\n this.focusCell(null);\n }\n else if (cells[0]) {\n this.focusCell(cells[0]);\n }\n }\n else if (cells[currentIndex] && cells[nextIndex]) {\n this.focusCell(cells[nextIndex]);\n }\n }\n else if (key === \"ArrowLeft\") {\n event.preventDefault();\n const prevIndex = currentIndex - 1;\n if (currentIndex === -1) {\n this.focusCell(null);\n if (open && openable) {\n this.open = false;\n }\n else {\n this.calciteInternalFocusPreviousItem.emit();\n }\n }\n else if (currentIndex === 0) {\n this.focusCell(null);\n containerEl.focus();\n }\n else if (cells[currentIndex] && cells[prevIndex]) {\n this.focusCell(cells[prevIndex]);\n }\n }\n };\n this.focusCellNull = () => {\n this.focusCell(null);\n };\n this.focusCell = (focusEl, saveFocusIndex = true) => {\n const { contentEl, actionsStartEl, actionsEndEl, parentListEl } = this;\n if (saveFocusIndex) {\n focusMap.set(parentListEl, null);\n }\n [actionsStartEl, contentEl, actionsEndEl].filter(Boolean).forEach((tableCell, cellIndex) => {\n const tabIndexAttr = \"tabindex\";\n if (tableCell === focusEl) {\n tableCell.setAttribute(tabIndexAttr, \"0\");\n saveFocusIndex && focusMap.set(parentListEl, cellIndex);\n }\n else {\n tableCell.removeAttribute(tabIndexAttr);\n }\n });\n focusEl?.focus();\n };\n this.active = false;\n this.closable = false;\n this.closed = false;\n this.description = undefined;\n this.disabled = false;\n this.dragHandle = false;\n this.label = undefined;\n this.metadata = undefined;\n this.open = false;\n this.setSize = null;\n this.setPosition = null;\n this.selected = false;\n this.value = undefined;\n this.selectionMode = null;\n this.selectionAppearance = null;\n this.messageOverrides = undefined;\n this.messages = undefined;\n this.effectiveLocale = \"\";\n this.defaultMessages = undefined;\n this.level = null;\n this.visualLevel = null;\n this.parentListEl = undefined;\n this.openable = false;\n this.hasActionsStart = false;\n this.hasActionsEnd = false;\n this.hasCustomContent = false;\n this.hasContentStart = false;\n this.hasContentEnd = false;\n this.hasContentBottom = false;\n }\n activeHandler(active) {\n if (!active) {\n this.focusCell(null, false);\n }\n }\n handleClosedChange() {\n this.emitCalciteInternalListItemChange();\n }\n handleDisabledChange() {\n this.emitCalciteInternalListItemChange();\n }\n handleSelectedChange() {\n this.calciteInternalListItemSelect.emit();\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n handleCalciteInternalListDefaultSlotChanges(event) {\n event.stopPropagation();\n this.handleOpenableChange(this.defaultSlotEl);\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n // --------------------------------------------------------------------------\n //\n // Lifecycle\n //\n // --------------------------------------------------------------------------\n connectedCallback() {\n connectInteractive(this);\n connectLocalized(this);\n connectMessages(this);\n const { el } = this;\n this.parentListEl = el.closest(listSelector);\n this.level = getDepth(el) + 1;\n this.visualLevel = getDepth(el, true);\n this.setSelectionDefaults();\n }\n async componentWillLoad() {\n setUpLoadableComponent(this);\n await setUpMessages(this);\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n componentDidRender() {\n updateHostInteraction(this);\n }\n disconnectedCallback() {\n disconnectInteractive(this);\n disconnectLocalized(this);\n disconnectMessages(this);\n }\n // --------------------------------------------------------------------------\n //\n // Public Methods\n //\n // --------------------------------------------------------------------------\n /** Sets focus on the component. */\n async setFocus() {\n await componentFocusable(this);\n const { containerEl, contentEl, actionsStartEl, actionsEndEl, parentListEl } = this;\n const focusIndex = focusMap.get(parentListEl);\n if (typeof focusIndex === \"number\") {\n const cells = [actionsStartEl, contentEl, actionsEndEl].filter(Boolean);\n if (cells[focusIndex]) {\n this.focusCell(cells[focusIndex]);\n }\n else {\n containerEl?.focus();\n }\n return;\n }\n containerEl?.focus();\n }\n // --------------------------------------------------------------------------\n //\n // Render Methods\n //\n // --------------------------------------------------------------------------\n renderSelected() {\n const { selected, selectionMode, selectionAppearance } = this;\n if (selectionMode === \"none\" || selectionAppearance === \"border\") {\n return null;\n }\n return (h(\"td\", { class: CSS.selectionContainer, key: \"selection-container\", onClick: this.itemClicked }, h(\"calcite-icon\", { icon: selected\n ? selectionMode === \"multiple\"\n ? ICONS.selectedMultiple\n : ICONS.selectedSingle\n : ICONS.unselected, scale: \"s\" })));\n }\n renderDragHandle() {\n return this.dragHandle ? (h(\"td\", { class: CSS.dragContainer, key: \"drag-handle-container\" }, h(\"calcite-handle\", { label: this.label, setPosition: this.setPosition, setSize: this.setSize }))) : null;\n }\n renderOpen() {\n const { el, open, openable, parentListEl } = this;\n const dir = getElementDir(el);\n const icon = openable\n ? open\n ? ICONS.open\n : dir === \"rtl\"\n ? ICONS.closedRTL\n : ICONS.closedLTR\n : ICONS.blank;\n const clickHandler = openable ? this.toggleOpen : this.itemClicked;\n return openable || parentListEl?.openable ? (h(\"td\", { class: CSS.openContainer, key: \"open-container\", onClick: clickHandler }, h(\"calcite-icon\", { icon: icon, key: icon, scale: \"s\" }))) : null;\n }\n renderActionsStart() {\n const { label, hasActionsStart } = this;\n return (h(\"td\", { \"aria-label\": label, class: CSS.actionsStart, hidden: !hasActionsStart, key: \"actions-start-container\", role: \"gridcell\",\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => (this.actionsStartEl = el) }, h(\"slot\", { name: SLOTS.actionsStart, onSlotchange: this.handleActionsStartSlotChange })));\n }\n renderActionsEnd() {\n const { label, hasActionsEnd, closable, messages } = this;\n return (h(\"td\", { \"aria-label\": label, class: CSS.actionsEnd, hidden: !(hasActionsEnd || closable), key: \"actions-end-container\", role: \"gridcell\",\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => (this.actionsEndEl = el) }, h(\"slot\", { name: SLOTS.actionsEnd, onSlotchange: this.handleActionsEndSlotChange }), closable ? (h(\"calcite-action\", { appearance: \"transparent\", icon: ICONS.close, key: \"close-action\", label: messages.close, onClick: this.closeClickHandler, text: messages.close })) : null));\n }\n renderContentStart() {\n const { hasContentStart } = this;\n return (h(\"div\", { class: CSS.contentStart, hidden: !hasContentStart }, h(\"slot\", { name: SLOTS.contentStart, onSlotchange: this.handleContentStartSlotChange })));\n }\n renderCustomContent() {\n const { hasCustomContent } = this;\n return (h(\"div\", { class: CSS.customContent, hidden: !hasCustomContent }, h(\"slot\", { name: SLOTS.content, onSlotchange: this.handleContentSlotChange })));\n }\n renderContentEnd() {\n const { hasContentEnd } = this;\n return (h(\"div\", { class: CSS.contentEnd, hidden: !hasContentEnd }, h(\"slot\", { name: SLOTS.contentEnd, onSlotchange: this.handleContentEndSlotChange })));\n }\n renderContentBottom() {\n const { hasContentBottom, visualLevel } = this;\n return (h(\"div\", { class: CSS.contentBottom, hidden: !hasContentBottom, style: { \"--calcite-list-item-spacing-indent-multiplier\": `${visualLevel}` } }, h(\"slot\", { name: SLOTS.contentBottom, onSlotchange: this.handleContentBottomSlotChange })));\n }\n renderDefaultContainer() {\n return (h(\"div\", { class: {\n [CSS.nestedContainer]: true,\n [CSS.nestedContainerHidden]: this.openable && !this.open,\n } }, h(\"slot\", { onSlotchange: this.handleDefaultSlotChange, ref: (el) => (this.defaultSlotEl = el) })));\n }\n renderContentProperties() {\n const { label, description, hasCustomContent } = this;\n return !hasCustomContent && (!!label || !!description) ? (h(\"div\", { class: CSS.content, key: \"content\" }, label ? (h(\"div\", { class: CSS.label, key: \"label\" }, label)) : null, description ? (h(\"div\", { class: CSS.description, key: \"description\" }, description)) : null)) : null;\n }\n renderContentContainer() {\n const { description, label, selectionMode, hasCustomContent } = this;\n const hasCenterContent = hasCustomContent || !!label || !!description;\n const content = [\n this.renderContentStart(),\n this.renderCustomContent(),\n this.renderContentProperties(),\n this.renderContentEnd(),\n ];\n return (h(\"td\", { \"aria-label\": label, class: {\n [CSS.contentContainer]: true,\n [CSS.contentContainerSelectable]: selectionMode !== \"none\",\n [CSS.contentContainerHasCenterContent]: hasCenterContent,\n }, key: \"content-container\", onClick: this.itemClicked, role: \"gridcell\",\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => (this.contentEl = el) }, content));\n }\n render() {\n const { openable, open, level, setPosition, setSize, active, label, selected, selectionAppearance, selectionMode, closed, visualLevel, } = this;\n const showBorder = selectionMode !== \"none\" && selectionAppearance === \"border\";\n const borderSelected = showBorder && selected;\n const borderUnselected = showBorder && !selected;\n return (h(Host, null, h(\"tr\", { \"aria-expanded\": openable ? toAriaBoolean(open) : null, \"aria-label\": label, \"aria-level\": level, \"aria-posinset\": setPosition, \"aria-selected\": toAriaBoolean(selected), \"aria-setsize\": setSize, class: {\n [CSS.container]: true,\n [CSS.containerBorderSelected]: borderSelected,\n [CSS.containerBorderUnselected]: borderUnselected,\n }, hidden: closed, onFocus: this.focusCellNull, onKeyDown: this.handleItemKeyDown, role: \"row\", style: { \"--calcite-list-item-spacing-indent-multiplier\": `${visualLevel}` }, tabIndex: active ? 0 : -1,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => (this.containerEl = el) }, this.renderDragHandle(), this.renderSelected(), this.renderOpen(), this.renderActionsStart(), this.renderContentContainer(), this.renderActionsEnd()), this.renderContentBottom(), this.renderDefaultContainer()));\n }\n // --------------------------------------------------------------------------\n //\n // Private Methods\n //\n // --------------------------------------------------------------------------\n emitCalciteInternalListItemChange() {\n this.calciteInternalListItemChange.emit();\n }\n setSelectionDefaults() {\n const { parentListEl, selectionMode, selectionAppearance } = this;\n if (!parentListEl) {\n return;\n }\n if (!selectionMode) {\n this.selectionMode = parentListEl.selectionMode;\n }\n if (!selectionAppearance) {\n this.selectionAppearance = parentListEl.selectionAppearance;\n }\n }\n handleOpenableChange(slotEl) {\n if (!slotEl) {\n return;\n }\n const { parentListEl } = this;\n const listItemChildren = getListItemChildren(slotEl);\n updateListItemChildren(listItemChildren);\n const openable = !!listItemChildren.length;\n if (openable && parentListEl && !parentListEl.openable) {\n parentListEl.openable = true;\n }\n this.openable = openable;\n if (!openable) {\n this.open = false;\n }\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"active\": [\"activeHandler\"],\n \"closed\": [\"handleClosedChange\"],\n \"disabled\": [\"handleDisabledChange\"],\n \"selected\": [\"handleSelectedChange\"],\n \"messageOverrides\": [\"onMessagesChange\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return listItemCss; }\n}, [1, \"calcite-list-item\", {\n \"active\": [4],\n \"closable\": [516],\n \"closed\": [1540],\n \"description\": [1],\n \"disabled\": [516],\n \"dragHandle\": [4, \"drag-handle\"],\n \"label\": [1],\n \"metadata\": [16],\n \"open\": [1540],\n \"setSize\": [2, \"set-size\"],\n \"setPosition\": [2, \"set-position\"],\n \"selected\": [1540],\n \"value\": [8],\n \"selectionMode\": [1025, \"selection-mode\"],\n \"selectionAppearance\": [1025, \"selection-appearance\"],\n \"messageOverrides\": [1040],\n \"messages\": [1040],\n \"effectiveLocale\": [32],\n \"defaultMessages\": [32],\n \"level\": [32],\n \"visualLevel\": [32],\n \"parentListEl\": [32],\n \"openable\": [32],\n \"hasActionsStart\": [32],\n \"hasActionsEnd\": [32],\n \"hasCustomContent\": [32],\n \"hasContentStart\": [32],\n \"hasContentEnd\": [32],\n \"hasContentBottom\": [32],\n \"setFocus\": [64]\n }, [[0, \"calciteInternalListItemGroupDefaultSlotChange\", \"handleCalciteInternalListDefaultSlotChanges\"], [0, \"calciteInternalListDefaultSlotChange\", \"handleCalciteInternalListDefaultSlotChanges\"]]]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-list-item\", \"calcite-action\", \"calcite-handle\", \"calcite-icon\", \"calcite-loader\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-list-item\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, ListItem);\n }\n break;\n case \"calcite-action\":\n if (!customElements.get(tagName)) {\n defineCustomElement$5();\n }\n break;\n case \"calcite-handle\":\n if (!customElements.get(tagName)) {\n defineCustomElement$4();\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$3();\n }\n break;\n case \"calcite-loader\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst CalciteListItem = ListItem;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteListItem, defineCustomElement };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { forceUpdate } from '@stencil/core/internal/client/index.js';\nimport { c as createObserver } from './observers.js';\n\nconst observed = new Set();\nlet mutationObserver;\nconst observerOptions = { childList: true };\n/**\n * Helper to set up a conditional slot component on connectedCallback.\n *\n * @param component\n * @deprecated Use `onSlotchange` event with `slotChangeHasAssignedElement` DOM utility instead.\n *\n * ```\n * this.mySlotHasElement = slotChangeHasAssignedElement(event)} />}\n * ```\n */\nfunction connectConditionalSlotComponent(component) {\n if (!mutationObserver) {\n mutationObserver = createObserver(\"mutation\", processMutations);\n }\n mutationObserver.observe(component.el, observerOptions);\n}\n/**\n * Helper to tear down a conditional slot component on disconnectedCallback.\n *\n * @param component\n * @deprecated Use `onSlotchange` event with `slotChangeHasAssignedElement` DOM utility instead.\n *\n * ```\n * this.mySlotHasElement = slotChangeHasAssignedElement(event)} />}\n * ```\n */\nfunction disconnectConditionalSlotComponent(component) {\n observed.delete(component.el);\n // we explicitly process queued mutations and disconnect and reconnect\n // the observer until MutationObserver gets an `unobserve` method\n // see https://github.com/whatwg/dom/issues/126\n processMutations(mutationObserver.takeRecords());\n mutationObserver.disconnect();\n for (const [element] of observed.entries()) {\n mutationObserver.observe(element, observerOptions);\n }\n}\nfunction processMutations(mutations) {\n mutations.forEach(({ target }) => {\n forceUpdate(target);\n });\n}\n\nexport { connectConditionalSlotComponent as c, disconnectConditionalSlotComponent as d };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nvar KindIcons;\n(function (KindIcons) {\n KindIcons[\"brand\"] = \"lightbulb\";\n KindIcons[\"danger\"] = \"exclamationMarkTriangle\";\n KindIcons[\"info\"] = \"information\";\n KindIcons[\"success\"] = \"checkCircle\";\n KindIcons[\"warning\"] = \"exclamationMarkTriangle\";\n})(KindIcons || (KindIcons = {}));\n\nexport { KindIcons as K };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { readTask } from '@stencil/core/internal/client/index.js';\n\nfunction isOpen(component) {\n return \"opened\" in component ? component.opened : component.open;\n}\nfunction emitImmediately(component, nonOpenCloseComponent = false) {\n (nonOpenCloseComponent ? component[component.transitionProp] : isOpen(component))\n ? component.onBeforeOpen()\n : component.onBeforeClose();\n (nonOpenCloseComponent ? component[component.transitionProp] : isOpen(component))\n ? component.onOpen()\n : component.onClose();\n}\n/**\n * Helper to determine globally set transition duration on the given openTransitionProp, which is imported and set in the @Watch(\"open\").\n * Used to emit (before)open/close events both for when the opacity transition is present and when there is none (transition-duration is set to 0).\n *\n * @example\n * import { onToggleOpenCloseComponent, OpenCloseComponent } from \"../../utils/openCloseComponent\";\n *\n * async componentWillLoad() {\n * // When component initially renders, if `open` was set we need to trigger on load as watcher doesn't fire.\n * if (this.open) {\n * onToggleOpenCloseComponent(this);\n * }\n * @Watch(\"open\")\n * async toggleModal(value: boolean): Promise {\n * onToggleOpenCloseComponent(this);\n * }\n *\n * @param component - OpenCloseComponent uses `open` prop to emit (before)open/close.\n * @param nonOpenCloseComponent - OpenCloseComponent uses `expanded` prop to emit (before)open/close.\n */\nfunction onToggleOpenCloseComponent(component, nonOpenCloseComponent = false) {\n readTask(() => {\n if (component.transitionEl) {\n const { transitionDuration: allDurations, transitionProperty: allProps } = getComputedStyle(component.transitionEl);\n const allTransitionDurationsArray = allDurations.split(\",\");\n const allTransitionPropsArray = allProps.split(\",\");\n const openTransitionPropIndex = allTransitionPropsArray.indexOf(component.openTransitionProp);\n const transitionDuration = allTransitionDurationsArray[openTransitionPropIndex] ??\n /* Safari will have a single transition value if multiple props share it,\n so we fall back to it if there's no matching prop duration */\n allTransitionDurationsArray[0];\n if (transitionDuration === \"0s\") {\n emitImmediately(component, nonOpenCloseComponent);\n return;\n }\n const fallbackTimeoutId = setTimeout(() => {\n component.transitionEl.removeEventListener(\"transitionstart\", onStart);\n component.transitionEl.removeEventListener(\"transitionend\", onEndOrCancel);\n component.transitionEl.removeEventListener(\"transitioncancel\", onEndOrCancel);\n emitImmediately(component, nonOpenCloseComponent);\n }, parseFloat(transitionDuration) * 1000);\n component.transitionEl.addEventListener(\"transitionstart\", onStart);\n component.transitionEl.addEventListener(\"transitionend\", onEndOrCancel);\n component.transitionEl.addEventListener(\"transitioncancel\", onEndOrCancel);\n function onStart(event) {\n if (event.propertyName === component.openTransitionProp && event.target === component.transitionEl) {\n clearTimeout(fallbackTimeoutId);\n component.transitionEl.removeEventListener(\"transitionstart\", onStart);\n (nonOpenCloseComponent ? component[component.transitionProp] : isOpen(component))\n ? component.onBeforeOpen()\n : component.onBeforeClose();\n }\n }\n function onEndOrCancel(event) {\n if (event.propertyName === component.openTransitionProp && event.target === component.transitionEl) {\n (nonOpenCloseComponent ? component[component.transitionProp] : isOpen(component))\n ? component.onOpen()\n : component.onClose();\n component.transitionEl.removeEventListener(\"transitionend\", onEndOrCancel);\n component.transitionEl.removeEventListener(\"transitioncancel\", onEndOrCancel);\n }\n }\n }\n });\n}\n\nexport { onToggleOpenCloseComponent as o };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client/index.js';\nimport { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot.js';\nimport { h as setRequestedIcon, g as getSlotted } from './dom.js';\nimport { a as setUpLoadableComponent, s as setComponentLoaded, c as componentFocusable } from './loadable.js';\nimport { c as connectLocalized, d as disconnectLocalized } from './locale.js';\nimport { c as connectMessages, d as disconnectMessages, s as setUpMessages, u as updateMessages } from './t9n.js';\nimport { K as KindIcons } from './resources.js';\nimport { o as onToggleOpenCloseComponent } from './openCloseComponent.js';\nimport { g as getIconScale } from './component.js';\nimport { d as defineCustomElement$2 } from './icon.js';\n\nconst SLOTS = {\n title: \"title\",\n message: \"message\",\n link: \"link\",\n actionsEnd: \"actions-end\",\n};\nconst CSS = {\n actionsEnd: \"actions-end\",\n close: \"notice-close\",\n container: \"container\",\n content: \"notice-content\",\n icon: \"notice-icon\",\n};\n\nconst noticeCss = \":host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\\n -2px *\\n calc(\\n 1 -\\n 2 * clamp(\\n 0,\\n var(--calcite-ui-focus-offset-invert),\\n 1\\n )\\n )\\n )}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([hidden]){display:none}[hidden]{display:none}\";\n\nconst Notice = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteNoticeBeforeClose = createEvent(this, \"calciteNoticeBeforeClose\", 6);\n this.calciteNoticeBeforeOpen = createEvent(this, \"calciteNoticeBeforeOpen\", 6);\n this.calciteNoticeClose = createEvent(this, \"calciteNoticeClose\", 6);\n this.calciteNoticeOpen = createEvent(this, \"calciteNoticeOpen\", 6);\n this.setTransitionEl = (el) => {\n this.transitionEl = el;\n };\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n this.close = () => {\n this.open = false;\n };\n this.openTransitionProp = \"opacity\";\n this.open = false;\n this.kind = \"brand\";\n this.closable = false;\n this.icon = undefined;\n this.iconFlipRtl = false;\n this.scale = \"m\";\n this.width = \"auto\";\n this.messages = undefined;\n this.messageOverrides = undefined;\n this.effectiveLocale = undefined;\n this.defaultMessages = undefined;\n }\n openHandler() {\n onToggleOpenCloseComponent(this);\n }\n onMessagesChange() {\n /* wired up by t9n util */\n }\n updateRequestedIcon() {\n this.requestedIcon = setRequestedIcon(KindIcons, this.icon, this.kind);\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n connectedCallback() {\n connectConditionalSlotComponent(this);\n connectLocalized(this);\n connectMessages(this);\n }\n disconnectedCallback() {\n disconnectConditionalSlotComponent(this);\n disconnectLocalized(this);\n disconnectMessages(this);\n }\n async componentWillLoad() {\n setUpLoadableComponent(this);\n this.requestedIcon = setRequestedIcon(KindIcons, this.icon, this.kind);\n await setUpMessages(this);\n if (this.open) {\n onToggleOpenCloseComponent(this);\n }\n }\n componentDidLoad() {\n setComponentLoaded(this);\n }\n render() {\n const { el } = this;\n const closeButton = (h(\"button\", { \"aria-label\": this.messages.close, class: CSS.close, onClick: this.close,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: (el) => (this.closeButton = el) }, h(\"calcite-icon\", { icon: \"x\", scale: getIconScale(this.scale) })));\n const hasActionEnd = getSlotted(el, SLOTS.actionsEnd);\n return (h(\"div\", { class: CSS.container,\n // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)\n ref: this.setTransitionEl }, this.requestedIcon ? (h(\"div\", { class: CSS.icon }, h(\"calcite-icon\", { flipRtl: this.iconFlipRtl, icon: this.requestedIcon, scale: getIconScale(this.scale) }))) : null, h(\"div\", { class: CSS.content }, h(\"slot\", { name: SLOTS.title }), h(\"slot\", { name: SLOTS.message }), h(\"slot\", { name: SLOTS.link })), hasActionEnd ? (h(\"div\", { class: CSS.actionsEnd }, h(\"slot\", { name: SLOTS.actionsEnd }))) : null, this.closable ? closeButton : null));\n }\n //--------------------------------------------------------------------------\n //\n // Public Methods\n //\n //--------------------------------------------------------------------------\n /** Sets focus on the component's first focusable element. */\n async setFocus() {\n await componentFocusable(this);\n const noticeLinkEl = this.el.querySelector(\"calcite-link\");\n if (!this.closeButton && !noticeLinkEl) {\n return;\n }\n if (noticeLinkEl) {\n return noticeLinkEl.setFocus();\n }\n else if (this.closeButton) {\n this.closeButton.focus();\n }\n }\n onBeforeClose() {\n this.calciteNoticeBeforeClose.emit();\n }\n onBeforeOpen() {\n this.calciteNoticeBeforeOpen.emit();\n }\n onClose() {\n this.calciteNoticeClose.emit();\n }\n onOpen() {\n this.calciteNoticeOpen.emit();\n }\n effectiveLocaleChange() {\n updateMessages(this, this.effectiveLocale);\n }\n static get assetsDirs() { return [\"assets\"]; }\n get el() { return this; }\n static get watchers() { return {\n \"open\": [\"openHandler\"],\n \"messageOverrides\": [\"onMessagesChange\"],\n \"icon\": [\"updateRequestedIcon\"],\n \"kind\": [\"updateRequestedIcon\"],\n \"effectiveLocale\": [\"effectiveLocaleChange\"]\n }; }\n static get style() { return noticeCss; }\n}, [1, \"calcite-notice\", {\n \"open\": [1540],\n \"kind\": [513],\n \"closable\": [516],\n \"icon\": [520],\n \"iconFlipRtl\": [516, \"icon-flip-rtl\"],\n \"scale\": [513],\n \"width\": [513],\n \"messages\": [1040],\n \"messageOverrides\": [1040],\n \"effectiveLocale\": [32],\n \"defaultMessages\": [32],\n \"setFocus\": [64]\n }]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-notice\", \"calcite-icon\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-notice\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Notice);\n }\n break;\n case \"calcite-icon\":\n if (!customElements.get(tagName)) {\n defineCustomElement$2();\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst CalciteNotice = Notice;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteNotice, defineCustomElement };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { A as Action, d as defineCustomElement$1 } from './action.js';\n\nconst CalciteAction = Action;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteAction, defineCustomElement };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nfunction getRoundRobinIndex(index, total) {\n return (index + total) % total;\n}\n\nexport { getRoundRobinIndex as g };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\n * v1.11.0\n */\nimport { Build } from '@stencil/core/internal/client/index.js';\nimport { b as getElementDir } from './dom.js';\nimport { d as debounce } from './debounce.js';\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n return {\n ...rect,\n top: rect.y,\n left: rect.x,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n };\n}\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a reference element when it is given a certain positioning strategy.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition$1 = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n continue;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n ...rects.floating,\n x,\n y\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$map$so;\n const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n const {\n x,\n y\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: diffCoords\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n };\n};\n\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n // Browsers without `ShadowRoot` support.\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle$1(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isContainingBlock(element) {\n const webkit = isWebKit();\n const css = getComputedStyle$1(element);\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else {\n currentNode = getParentNode(currentNode);\n }\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle$1(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.pageXOffset,\n scrollTop: element.pageYOffset\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentIFrame = win.frameElement;\n while (currentIFrame && offsetParent && offsetWin !== win) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentIFrame = getWindow(currentIFrame).frameElement;\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n if (offsetParent === documentElement) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n return getCssDimensions(element);\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n return element.offsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const window = getWindow(element);\n if (!isHTMLElement(element)) {\n return window;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}\n\nconst getElementRects = async function (_ref) {\n let {\n reference,\n floating,\n strategy\n } = _ref;\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n return {\n reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),\n floating: {\n x: 0,\n y: 0,\n ...(await getDimensionsFn(floating))\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n clearTimeout(timeoutId);\n io && io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 100);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle