import "./ListView.css";
import {ActionButtonGroupContext as $10401bdc118cbc90$export$33f5f2f2cb85d743} from "./ActionButtonGroup.mjs";
import {ActionMenuContext as $8bf3cd2442eb485e$export$7f4b66acaca28bd5} from "./ActionMenu.mjs";
import {centerBaseline as $1f4b04be3f24aae3$export$9d7e2342a7e53afa} from "./CenterBaseline.mjs";
import {Checkbox as $9b405e0f8095dce0$export$48513f6b9f8ce62d} from "./Checkbox.mjs";
import $4b69f02ec06b9226$export$2e2bcd8739ae039 from "./Chevron.mjs";
import {IconContext as $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed} from "../icons/Icon.mjs";
import {ImageContext as $dbd6f0b2503b938c$export$8151eb379fcf2442} from "./Image.mjs";
import $alyq6$intlStringsmjs from "./intlStrings.mjs";
import $d9f847a2895a93dc$export$2e2bcd8739ae039 from "./LinkOut.mjs";
import {ProgressCircle as $41ddd91dbbf0c389$export$c79b9d6b4cc92af7} from "./ProgressCircle.mjs";
import {Text as $8e847109a6ab556d$export$5f1af8db9871e1d6, TextContext as $8e847109a6ab556d$export$9afb8bc826b033ea} from "./Content.mjs";
import {useActionBarContainer as $f21f2186348fbc5b$export$13f32e21845e01d0} from "./ActionBar.mjs";
import {useScale as $859432f3b3573fcb$export$a8d2043b2d807f4d} from "./utils.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
import {jsx as $alyq6$jsx, jsxs as $alyq6$jsxs, Fragment as $alyq6$Fragment} from "react/jsx-runtime";
import {CollectionRendererContext as $alyq6$CollectionRendererContext, DefaultCollectionRenderer as $alyq6$DefaultCollectionRenderer, GridListLoadMoreItem as $alyq6$GridListLoadMoreItem, Collection as $alyq6$Collection, Virtualizer as $alyq6$Virtualizer, ListLayout as $alyq6$ListLayout, GridList as $alyq6$GridList, useSlottedContext as $alyq6$useSlottedContext, CheckboxContext as $alyq6$CheckboxContext, GridListItem as $alyq6$GridListItem, Provider as $alyq6$Provider, DEFAULT_SLOT as $alyq6$DEFAULT_SLOT} from "react-aria-components";
import {createContext as $alyq6$createContext, forwardRef as $alyq6$forwardRef, useRef as $alyq6$useRef, useContext as $alyq6$useContext} from "react";
import {useDOMRef as $alyq6$useDOMRef} from "@react-spectrum/utils";
import {useLocalizedStringFormatter as $alyq6$useLocalizedStringFormatter, useLocale as $alyq6$useLocale} from "react-aria";


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}
/*
 * Copyright 2026 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 


















const $6d4c8b365b6e9016$export$870039b0abfe3de0 = /*#__PURE__*/ (0, $alyq6$createContext)(null);
let $6d4c8b365b6e9016$var$InternalListViewContext = /*#__PURE__*/ (0, $alyq6$createContext)({});
const $6d4c8b365b6e9016$var$listViewWrapper = function anonymous(props, overrides) {
    let rules = " ";
    let minHeight = false;
    let minWidth = false;
    let position = false;
    let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L|F|M|K)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "M") minHeight = true;
        if (p[1] === "N") minWidth = true;
        if (p[1] === "_P") position = true;
        rules += p[0];
    }
    if (!minHeight) rules += ' Ma11';
    if (!minWidth) rules += ' Na11';
    rules += ' sd11';
    rules += ' _Bb11';
    rules += ' __ca11';
    if (!position) rules += ' _Pc11';
    rules += ' _Nb11';
    rules += ' Pb11';
    return rules;
};
// When any row has a trailing icon, reserve space so actions align.
const $6d4c8b365b6e9016$var$hasTrailingIconRows = ':has([data-has-trailing-icon]) [role="row"]';
const $6d4c8b365b6e9016$var$listView = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf11';
    else rules += ' _Le11';
    rules += ' Oh11';
    rules += ' Olc11';
    rules += ' _Mc11';
    if (props.isQuiet) rules += ' _Ka11';
    else rules += ' _Kb11';
    rules += ' _4c11';
    rules += ' Ma11';
    rules += ' Na11';
    rules += ' Za11';
    rules += ' Fb11';
    rules += ' _oa11';
    rules += ' _Na11';
    rules += ' Pa11';
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    if (props.isQuiet) rules += ' g911';
    else rules += ' gX11';
    rules += ' gla11';
    if (props.isQuiet) rules += ' od11';
    else rules += ' ob11';
    if (props.isQuiet) rules += ' nd11';
    else rules += ' nb11';
    if (props.isQuiet) rules += ' kd11';
    else rules += ' kb11';
    if (props.isQuiet) rules += ' jd11';
    else rules += ' jb11';
    rules += ' iq11';
    if (props.isQuiet) rules += ' _ka11';
    else rules += ' _kb11';
    if (props.isQuiet) rules += ' ha11';
    else rules += ' hb11';
    if (props.isQuiet) rules += ' ma11';
    else rules += ' mb11';
    if (props.isQuiet) rules += ' la11';
    else rules += ' lb11';
    rules += ' _jf11';
    rules += ' -Ev4N4b-Zd11';
    rules += ' -Ev4N4b-1bNH0cZuUmpre11';
    return rules;
};
const $6d4c8b365b6e9016$export$84d0dd190d551cd1 = /*#__PURE__*/ (0, $alyq6$forwardRef)(function ListView(props, ref) {
    [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $6d4c8b365b6e9016$export$870039b0abfe3de0);
    let { children: children, isQuiet: isQuiet, selectionStyle: selectionStyle = 'checkbox', overflowMode: overflowMode = 'truncate', loadingState: loadingState, onLoadMore: onLoadMore, renderEmptyState: userRenderEmptyState, hideLinkOutIcon: hideLinkOutIcon = false, ...otherProps } = props;
    let scale = (0, $859432f3b3573fcb$export$a8d2043b2d807f4d)();
    let stringFormatter = (0, $alyq6$useLocalizedStringFormatter)((0, ($parcel$interopDefault($alyq6$intlStringsmjs))), '@react-spectrum/s2');
    let rowHeight = scale === 'large' ? 50 : 40;
    let domRef = (0, $alyq6$useDOMRef)(ref);
    let scrollRef = (0, $alyq6$useRef)(null);
    let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
    let renderEmptyState;
    if (userRenderEmptyState != null && !isLoading) renderEmptyState = (renderProps)=>/*#__PURE__*/ (0, $alyq6$jsx)("div", {
            className: $6d4c8b365b6e9016$var$emptyStateWrapper,
            children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$CollectionRendererContext).Provider, {
                value: (0, $alyq6$DefaultCollectionRenderer),
                children: userRenderEmptyState(renderProps)
            })
        });
    else if (loadingState === 'loading') renderEmptyState = ()=>/*#__PURE__*/ (0, $alyq6$jsx)("div", {
            className: $6d4c8b365b6e9016$var$centeredWrapper,
            children: /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                className: $6d4c8b365b6e9016$var$loadingSpinnerWrapper,
                children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
                    isIndeterminate: true,
                    "aria-label": stringFormatter.format('table.loading')
                })
            })
        });
    let loadMoreSpinner = onLoadMore ? /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$GridListLoadMoreItem), {
        isLoading: loadingState === 'loadingMore',
        onLoadMore: onLoadMore,
        className: " Fb11 Za11 Tt11 Qt11",
        children: /*#__PURE__*/ (0, $alyq6$jsx)("div", {
            className: $6d4c8b365b6e9016$var$centeredWrapper,
            children: /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                className: $6d4c8b365b6e9016$var$loadingSpinnerWrapper,
                children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
                    isIndeterminate: true,
                    "aria-label": stringFormatter.format('table.loadingMore')
                })
            })
        })
    }) : null;
    let wrappedChildren;
    let gridListProps = otherProps;
    if (typeof children === 'function' && otherProps.items) {
        let { items: items, dependencies: dependencies = [], ...rest } = otherProps;
        gridListProps = rest;
        wrappedChildren = /*#__PURE__*/ (0, $alyq6$jsxs)((0, $alyq6$Fragment), {
            children: [
                /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$Collection), {
                    items: items,
                    dependencies: dependencies,
                    children: children
                }),
                loadMoreSpinner
            ]
        });
    } else wrappedChildren = /*#__PURE__*/ (0, $alyq6$jsxs)((0, $alyq6$Fragment), {
        children: [
            children,
            loadMoreSpinner
        ]
    });
    let { selectedKeys: selectedKeys, onSelectionChange: onSelectionChange, actionBar: actionBar, actionBarHeight: actionBarHeight } = (0, $f21f2186348fbc5b$export$13f32e21845e01d0)({
        ...props,
        scrollRef: scrollRef
    });
    return /*#__PURE__*/ (0, $alyq6$jsxs)("div", {
        ref: domRef,
        className: (props.UNSAFE_className || '') + $6d4c8b365b6e9016$var$listViewWrapper(null, props.styles),
        style: props.UNSAFE_style,
        children: [
            /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$Virtualizer), {
                layout: (0, $alyq6$ListLayout),
                layoutOptions: {
                    estimatedRowHeight: rowHeight,
                    loaderHeight: 60
                },
                children: /*#__PURE__*/ (0, $alyq6$jsx)($6d4c8b365b6e9016$var$InternalListViewContext.Provider, {
                    value: {
                        isQuiet: isQuiet,
                        selectionStyle: selectionStyle,
                        overflowMode: overflowMode,
                        scale: scale,
                        hideLinkOutIcon: hideLinkOutIcon
                    },
                    children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$GridList), {
                        ref: scrollRef,
                        ...gridListProps,
                        selectionBehavior: selectionStyle === 'highlight' ? 'replace' : 'toggle',
                        selectionMode: gridListProps.selectionMode,
                        renderEmptyState: renderEmptyState,
                        style: {
                            paddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0,
                            scrollPaddingBottom: actionBarHeight > 0 ? actionBarHeight + 8 : 0
                        },
                        className: (renderProps)=>$6d4c8b365b6e9016$var$listView({
                                ...renderProps,
                                isQuiet: isQuiet
                            }),
                        selectedKeys: selectedKeys,
                        defaultSelectedKeys: undefined,
                        onSelectionChange: onSelectionChange,
                        children: wrappedChildren
                    })
                })
            }),
            actionBar
        ]
    });
});
const $6d4c8b365b6e9016$var$selectedBackground = "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 7%)]";
const $6d4c8b365b6e9016$var$selectedActiveBackground = "[color-mix(in srgb, light-dark(rgb(255, 255, 255), rgb(17, 17, 17)), light-dark(rgb(19, 19, 19), rgb(242, 242, 242)) 10%)]";
const $6d4c8b365b6e9016$var$listitem = function anonymous(props) {
    let rules = " ";
    rules += ' _Le11';
    rules += ' _oa11';
    rules += ' qh11';
    rules += ' Sd11';
    rules += ' Rd11';
    rules += ' Tt11';
    rules += ' Qt11';
    rules += ' g911';
    if (props.isDisabled) {
        rules += ' pp11';
        rules += ' plc11';
    } else if (props.isSelected) {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    } else {
        if (props.isPressed) rules += ' pt11';
        else if (props.isFocusVisible) rules += ' pt11';
        else if (props.isHovered) rules += ' pt11';
        else rules += ' pv11';
    }
    rules += ' _Pc11';
    rules += ' z2mU11';
    rules += ' yzZKy11';
    rules += ' se11';
    rules += ' C91zTN11';
    rules += ' DIVIQId11';
    rules += ' Exumf9b11';
    rules += ' UDNKd2dai5a011';
    rules += ' ea11';
    if (props.scale === "large") rules += ' MODqQub11';
    else rules += ' Mh11';
    rules += ' _Xa11';
    if (props.isLink) rules += ' ry11';
    else rules += ' ri11';
    if (props.isSelected) {
        if (props.selectionStyle === "checkbox") rules += ' -EH8uVb-iq11';
        else if (props.selectionStyle === "highlight") rules += ' -EH8uVb-iw11';
    } else rules += ' -EH8uVb-iq11';
    rules += ' -EH8uVb-lia11';
    rules += ' _ka11';
    if (props.isLastItem) {
        if (props.isQuiet) rules += ' ha11';
        else rules += ' hb11';
    } else rules += ' hb11';
    rules += ' ma11';
    rules += ' la11';
    rules += ' _jf11';
    if (props.isSelected) rules += ' iA11';
    else if (props.isNextSelected) rules += ' iA11';
    else rules += ' i4pzfu11';
    return rules;
};
const $6d4c8b365b6e9016$var$listRowBackground = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf11';
    else rules += ' _Le11';
    rules += ' Oh11';
    rules += ' Olc11';
    rules += ' _Mc11';
    rules += ' _Kb11';
    rules += ' _Pa11';
    rules += ' _9a11';
    if (props.isFirstItem) rules += ' Wr11';
    else if (props.isPrevSelected) rules += ' Wr11';
    else if (props.isSelected) rules += ' WLPOtrc11';
    else rules += ' Wr11';
    rules += ' _Er11';
    rules += ' _Rr11';
    if (props.isSelected) rules += ' _lLPOtrc11';
    else rules += ' _lr11';
    if (props.isSelected) {
        if (props.selectionStyle === "highlight") {
            if (props.isPressed) rules += ' gaZwDBe11';
            else if (props.isHovered) rules += ' gaZwDBe11';
            else rules += ' glzvDBe11';
        } else if (props.selectionStyle === "checkbox") {
            if (props.isFocusVisible) rules += ' gRfT7e11';
            else if (props.isPressed) rules += ' gRfT7e11';
            else if (props.isHovered) rules += ' gRfT7e11';
            else rules += ' gj1B7i11';
        }
    } else if (props.isPressed) {
        if (props.selectionStyle === "checkbox") rules += ' gRfT7e11';
        else rules += ' g7IonAe11';
    } else if (props.isHovered) {
        if (props.selectionStyle === "checkbox") rules += ' gj1B7i11';
        else rules += ' gVQkD8c11';
    } else rules += ' gs9yXOb11';
    rules += ' gla11';
    if (props.isFirstItem) {
        if (props.isFocusVisible) rules += ' ob11';
        else if (props.isQuiet) rules += ' ob11';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' ob11';
            else if (props.selectionStyle === "checkbox") rules += ' od11';
        }
    }
    if (props.isFirstItem) {
        if (props.isFocusVisible) rules += ' nb11';
        else if (props.isQuiet) rules += ' nb11';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' nb11';
            else if (props.selectionStyle === "checkbox") rules += ' nd11';
        }
    }
    if (props.isLastItem) {
        if (props.isFocusVisible) rules += ' kb11';
        else if (props.isQuiet) rules += ' kb11';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' kb11';
            else if (props.selectionStyle === "checkbox") rules += ' kd11';
        }
    }
    if (props.isLastItem) {
        if (props.isFocusVisible) rules += ' jb11';
        else if (props.isQuiet) rules += ' jb11';
        else if (props.isSelected) {
            if (props.selectionStyle === "highlight") rules += ' jb11';
            else if (props.selectionStyle === "checkbox") rules += ' jd11';
        }
    }
    if (props.isPrevSelected) rules += ' _ka11';
    else {
        if (props.selectionStyle === "highlight") rules += ' _kb11';
        else if (props.selectionStyle === "checkbox") rules += ' _ka11';
    }
    if (props.isNextSelected) rules += ' ha11';
    else {
        if (props.selectionStyle === "highlight") rules += ' hb11';
        else if (props.selectionStyle === "checkbox") rules += ' ha11';
    }
    if (props.selectionStyle === "highlight") rules += ' mb11';
    else if (props.selectionStyle === "checkbox") rules += ' ma11';
    if (props.selectionStyle === "highlight") rules += ' lb11';
    else if (props.selectionStyle === "checkbox") rules += ' la11';
    rules += ' _jf11';
    if (props.isSelected) {
        if (props.selectionStyle === "highlight") rules += ' i4pzfu11';
        else if (props.selectionStyle === "checkbox") rules += ' iA11';
    } else rules += ' iA11';
    return rules;
};
let $6d4c8b365b6e9016$export$1237798dc640739a = function anonymous(props) {
    let rules = " ";
    rules += ' zv6x9r11';
    rules += ' yv6x9r11';
    rules += ' Bv6x9r11';
    rules += ' Av6x9r11';
    rules += ' _dc11';
    if (props.size === "XL") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "L") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "S") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else if (props.size === "XS") {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    } else {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e11';
        rules += ' vx11';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d11';
        rules += ' vx11';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b11';
        rules += ' vx11';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a11';
        rules += ' vx11';
    } else {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    if (props.size === "XL") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "L") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "S") {
        rules += ' xb11';
        rules += ' _xa11';
    } else if (props.size === "XS") {
        rules += ' xb11';
        rules += ' _xa11';
    } else {
        rules += ' xb11';
        rules += ' _xa11';
    }
    if (props.size === "XL") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "L") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "S") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else if (props.size === "XS") {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    } else {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    rules += ' p40ub4c11';
    rules += ' _Nc11';
    rules += ' Pc11';
    rules += ' _Yb11';
    if (props.overflowMode === "wrap") rules += ' _7b11';
    else rules += ' _7c11';
    return rules;
};
let $6d4c8b365b6e9016$export$6d59db4903f20f7d = function anonymous(props) {
    let rules = " ";
    rules += ' z9u7zPc11';
    rules += ' y9u7zPc11';
    rules += ' B9u7zPc11';
    rules += ' A9u7zPc11';
    rules += ' _dc11';
    rules += ' _Nc11';
    rules += ' Pc11';
    rules += ' _Yb11';
    if (props.overflowMode === "wrap") rules += ' _7b11';
    else rules += ' _7c11';
    rules += ' uk11';
    rules += ' ucJ9TBTb11';
    rules += ' ud3Euai11';
    rules += ' uea11';
    rules += ' ugb11';
    rules += ' uhd11';
    rules += ' uje11';
    rules += ' u2NhKxcl11';
    rules += ' uic11';
    rules += ' -_6BNtrc-b11';
    rules += ' vx11';
    rules += ' xb11';
    rules += ' _xa11';
    rules += ' _Fd11';
    rules += ' _FnuYUweb11';
    if (props.isDisabled) rules += ' pp11';
    else {
        if (props.isPressed) rules += ' pt11';
        else if (props.isFocusVisible) rules += ' pt11';
        else if (props.isHovered) rules += ' pt11';
        else rules += ' pv11';
    }
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    return rules;
};
let $6d4c8b365b6e9016$export$31d1842a0fd736e6 = " sd11 z2U5Crc11 y2U5Crc11 B2U5Crc11 AvoofG11 _dc11 eb11";
let $6d4c8b365b6e9016$export$1ca1ec8b29a4ce27 = " sb11 ZuUmpre11 FuUmpre11 Ht11 Hsu11 -_8sjo0b-t5ZbAob11";
let $6d4c8b365b6e9016$var$image = " z2U5Crc11 y2U5Crc11 B2U5Crc11 AvoofG11 Ht11 Hsu11 _dc11 oa11 na11 ka11 ja11 ZC11 fa11 _Hb11";
let $6d4c8b365b6e9016$var$actionButtonGroup = " zkG38H11 ykG38H11 BkG38H11 AvoofG11 _dc11 __Ac11 It11 Isu11";
let $6d4c8b365b6e9016$var$listActionMenu = " z6Nrfjc11 y6Nrfjc11 B6Nrfjc11 AvoofG11 _dc11";
const $6d4c8b365b6e9016$var$listCheckbox = function anonymous(props) {
    let rules = " ";
    rules += ' z2CW8rb11';
    rules += ' y2CW8rb11';
    rules += ' B2CW8rb11';
    rules += ' AvoofG11';
    rules += ' _dc11';
    rules += ' Hv11';
    if (props.isDisabled) rules += ' _6b11';
    else rules += ' _6c11';
    return rules;
};
const $6d4c8b365b6e9016$var$listTrailingIcon = " znWsohc11 ynWsohc11 BnWsohc11 AvoofG11 _dc11 sd11 eb11 It11 Isu11";
const $6d4c8b365b6e9016$var$centeredWrapper = " sd11 eb11 _Ca11 Za11 Fb11";
const $6d4c8b365b6e9016$var$loadingSpinnerWrapper = " TuNalie11 QuNalie11 SuNalie11 RuNalie11";
const $6d4c8b365b6e9016$var$emptyStateWrapper = " sd11 eb11 _Ca11 Za11 Fb11 _oa11 Tf11 Qf11 Sf11 Rf11";
function $6d4c8b365b6e9016$var$ListSelectionCheckbox({ isDisabled: isDisabled }) {
    let selectionContext = (0, $alyq6$useSlottedContext)((0, $alyq6$CheckboxContext), 'selection');
    let isSelectionDisabled = isDisabled || !!selectionContext?.isDisabled;
    return /*#__PURE__*/ (0, $alyq6$jsx)("div", {
        className: $6d4c8b365b6e9016$var$listCheckbox({
            isDisabled: isSelectionDisabled
        }),
        children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $9b405e0f8095dce0$export$48513f6b9f8ce62d), {
            slot: "selection"
        })
    });
}
function $6d4c8b365b6e9016$var$isNextSelected(id, state) {
    if (id == null || !state) return false;
    let keyAfter = state.collection.getKeyAfter(id);
    return keyAfter != null && state.selectionManager.isSelected(keyAfter);
}
function $6d4c8b365b6e9016$var$isPrevSelected(id, state) {
    if (id == null || !state) return false;
    let keyBefore = state.collection.getKeyBefore(id);
    return keyBefore != null && state.selectionManager.isSelected(keyBefore);
}
function $6d4c8b365b6e9016$var$isFirstItem(id, state) {
    if (id == null || !state) return false;
    return state.collection.getFirstKey() === id;
}
function $6d4c8b365b6e9016$var$isLastItem(id, state) {
    if (id == null || !state) return false;
    return state.collection.getLastKey() === id;
}
function $6d4c8b365b6e9016$export$c6bde0c04b033c0e(props1) {
    let ref = (0, $alyq6$useRef)(null);
    let { hasChildItems: hasChildItems, ...otherProps } = props1;
    let isLink = props1.href != null;
    let isLinkOut = isLink && props1.target === '_blank';
    let { isQuiet: isQuiet, selectionStyle: selectionStyle, overflowMode: overflowMode, scale: scale, hideLinkOutIcon: hideLinkOutIcon = false } = (0, $alyq6$useContext)($6d4c8b365b6e9016$var$InternalListViewContext);
    let textValue = props1.textValue || (typeof props1.children === 'string' ? props1.children : undefined);
    let { direction: direction } = (0, $alyq6$useLocale)();
    let hasTrailingIcon = hasChildItems || isLinkOut && !hideLinkOutIcon;
    return /*#__PURE__*/ (0, $alyq6$jsx)((0, $alyq6$GridListItem), {
        ...otherProps,
        textValue: textValue,
        ref: ref,
        ...hasTrailingIcon ? {
            'data-has-trailing-icon': ''
        } : {},
        className: (renderProps)=>$6d4c8b365b6e9016$var$listitem({
                ...renderProps,
                isLink: isLink,
                isQuiet: isQuiet,
                scale: scale,
                selectionStyle: selectionStyle,
                isPrevNotSelected: !$6d4c8b365b6e9016$var$isPrevSelected(renderProps.id, renderProps.state),
                isNextSelected: $6d4c8b365b6e9016$var$isNextSelected(renderProps.id, renderProps.state),
                isNextNotSelected: !$6d4c8b365b6e9016$var$isNextSelected(renderProps.id, renderProps.state),
                isFirstItem: $6d4c8b365b6e9016$var$isFirstItem(renderProps.id, renderProps.state),
                isLastItem: $6d4c8b365b6e9016$var$isLastItem(renderProps.id, renderProps.state)
            }),
        children: (renderProps)=>{
            let { children: children } = props1;
            let { selectionMode: selectionMode, selectionBehavior: selectionBehavior, isDisabled: isDisabled, id: id, state: state } = renderProps;
            return /*#__PURE__*/ (0, $alyq6$jsxs)((0, $alyq6$Provider), {
                values: [
                    [
                        (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                        {
                            slots: {
                                [(0, $alyq6$DEFAULT_SLOT)]: {
                                    styles: $6d4c8b365b6e9016$export$1237798dc640739a({
                                        ...renderProps,
                                        overflowMode: overflowMode
                                    })
                                },
                                label: {
                                    styles: $6d4c8b365b6e9016$export$1237798dc640739a({
                                        ...renderProps,
                                        overflowMode: overflowMode
                                    })
                                },
                                description: {
                                    styles: $6d4c8b365b6e9016$export$6d59db4903f20f7d({
                                        ...renderProps,
                                        overflowMode: overflowMode
                                    })
                                }
                            }
                        }
                    ],
                    [
                        (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                        {
                            slots: {
                                icon: {
                                    render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                        slot: 'icon',
                                        styles: $6d4c8b365b6e9016$export$31d1842a0fd736e6
                                    }),
                                    styles: $6d4c8b365b6e9016$export$1ca1ec8b29a4ce27
                                }
                            }
                        }
                    ],
                    [
                        (0, $dbd6f0b2503b938c$export$8151eb379fcf2442),
                        {
                            styles: $6d4c8b365b6e9016$var$image
                        }
                    ],
                    [
                        (0, $10401bdc118cbc90$export$33f5f2f2cb85d743),
                        {
                            styles: $6d4c8b365b6e9016$var$actionButtonGroup,
                            size: 'S',
                            isQuiet: true
                        }
                    ],
                    [
                        (0, $8bf3cd2442eb485e$export$7f4b66acaca28bd5),
                        {
                            styles: $6d4c8b365b6e9016$var$listActionMenu,
                            isQuiet: true,
                            size: 'S',
                            isDisabled: isDisabled
                        }
                    ]
                ],
                children: [
                    /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                        className: $6d4c8b365b6e9016$var$listRowBackground({
                            ...renderProps,
                            selectionStyle: selectionStyle,
                            isQuiet: isQuiet,
                            isPrevSelected: $6d4c8b365b6e9016$var$isPrevSelected(id, state),
                            isNextSelected: $6d4c8b365b6e9016$var$isNextSelected(id, state),
                            isPrevNotSelected: !$6d4c8b365b6e9016$var$isPrevSelected(id, state),
                            isNextNotSelected: !$6d4c8b365b6e9016$var$isNextSelected(id, state),
                            isFirstItem: $6d4c8b365b6e9016$var$isFirstItem(id, state),
                            isLastItem: $6d4c8b365b6e9016$var$isLastItem(id, state)
                        })
                    }),
                    selectionMode !== 'none' && selectionBehavior === 'toggle' && /*#__PURE__*/ (0, $alyq6$jsx)($6d4c8b365b6e9016$var$ListSelectionCheckbox, {
                        isDisabled: isDisabled
                    }),
                    typeof children === 'string' ? /*#__PURE__*/ (0, $alyq6$jsx)((0, $8e847109a6ab556d$export$5f1af8db9871e1d6), {
                        slot: "label",
                        children: children
                    }) : children,
                    isLinkOut && !hideLinkOutIcon && /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                        className: $6d4c8b365b6e9016$var$listTrailingIcon,
                        children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $d9f847a2895a93dc$export$2e2bcd8739ae039), {
                            size: "M",
                            className: function anonymous(props) {
                                let rules = " ";
                                if (props.direction === "rtl") {
                                    rules += ' -Z4Pn4c-a11';
                                    rules += ' __Ha11';
                                }
                                rules += ' -_8sjo0b-t5ZbAob11';
                                return rules;
                            }({
                                direction: direction
                            })
                        })
                    }),
                    hasChildItems && !isLinkOut && /*#__PURE__*/ (0, $alyq6$jsx)("div", {
                        className: $6d4c8b365b6e9016$var$listTrailingIcon,
                        children: /*#__PURE__*/ (0, $alyq6$jsx)((0, $4b69f02ec06b9226$export$2e2bcd8739ae039), {
                            className: function anonymous(props) {
                                let rules = " ";
                                if (props.direction === "rtl") {
                                    rules += ' -Z4Pn4c-a11';
                                    rules += ' __Ha11';
                                } else if (props.direction === "ltr") {
                                    rules += ' -Z4Pn4c-b11';
                                    rules += ' __Ha11';
                                }
                                if (props.direction === "rtl") {
                                    rules += ' -_04Pn4c-a11';
                                    rules += ' __Ha11';
                                } else if (props.direction === "ltr") {
                                    rules += ' -_04Pn4c-b11';
                                    rules += ' __Ha11';
                                }
                                rules += ' -_8sjo0b-t5ZbAob11';
                                return rules;
                            }({
                                direction: direction
                            })
                        })
                    })
                ]
            });
        }
    });
}


export {$6d4c8b365b6e9016$export$870039b0abfe3de0 as ListViewContext, $6d4c8b365b6e9016$export$84d0dd190d551cd1 as ListView, $6d4c8b365b6e9016$export$1237798dc640739a as label, $6d4c8b365b6e9016$export$6d59db4903f20f7d as description, $6d4c8b365b6e9016$export$31d1842a0fd736e6 as iconCenterWrapper, $6d4c8b365b6e9016$export$1ca1ec8b29a4ce27 as icon, $6d4c8b365b6e9016$export$c6bde0c04b033c0e as ListViewItem};
//# sourceMappingURL=ListView.mjs.map
