import{css as e,unsafeCSS as r}from"lit";import{DefaultColor1 as t,DefaultColor2 as o,DefaultColor4 as a,DefaultColor5 as i,DefaultColor8 as n}from"@openremote/core";import{mdiChevronRight as l,mdiChevronDown as s}from"@mdi/js";export const style=e`

    :host {       
        --internal-or-asset-tree-header-color: var(--or-asset-tree-header-color, var(--or-app-color4, ${r(a)}));     
        --internal-or-asset-tree-header-text-color: var(--or-asset-tree-header-text-color, var(--or-app-color8, ${r(n)}));
        --internal-or-asset-tree-header-menu-background-color: var(--or-asset-tree-header-menu-background-color, var(--internal-or-asset-tree-header-text-color));
        --internal-or-asset-tree-header-menu-text-color: var(--or-asset-tree-header-menu-text-color, inherit);
        --internal-or-asset-tree-header-height: var(--or-asset-tree-header-height, 48px);
        --internal-or-asset-tree-background-color: var(--or-asset-tree-background-color, var(--or-app-color1, ${r(t)}));
        --internal-or-asset-tree-text-color: var(--or-asset-tree-text-color, inherit);
        --internal-or-asset-tree-item-height: var(--or-asset-tree-item-height, 24px);
        --internal-or-asset-tree-item-padding: var(--or-asset-tree-item-padding, 10px);
        --internal-or-asset-tree-selected-background-color: var(--or-asset-tree-selected-background-color, var(--or-app-color2, ${r(o)}));
        --internal-or-asset-tree-selected-color: var(--or-asset-tree-selected-color, var(--or-app-color4, ${r(a)}));
        --internal-or-asset-tree-button-color: var(--or-asset-tree-button-color, var(--or-app-color4, ${r(a)}));
        --internal-or-asset-tree-line-color: var(--or-asset-tree-line-color, var(--or-app-color5, ${r(i)}));
        
        display: flex;
        flex-direction: column;
        height: 100%;
        width: 100%;
        background-color: var(--internal-or-asset-tree-background-color);
    }
    
    *[hidden] {
        display: none;
    }
    
    button {
        background-color: var(--internal-or-asset-tree-button-color);
        color: var(--internal-or-asset-tree-background-color);
        --or-icon-width: 20px;
        --or-icon-height: 20px;
        --or-icon-fill: var(--internal-or-asset-tree-background-color);
        border: none;
        padding: 0 6px;
        display: inline-block;
        cursor: pointer;
        opacity: 0.8;
    }

    button:focus, button:hover {
        outline: 0;
        opacity: 1;
    }
    
    #header {
        background-color: var(--internal-or-asset-tree-header-color);
        display: flex;
        align-items: center;
        width: 100%;        
        height: var(--internal-or-asset-tree-header-height);
        border-bottom: 1px solid ${r(i)};
        z-index: 1000;
        line-height: var(--internal-or-asset-tree-header-height);
        color: var(--internal-or-asset-tree-header-text-color);
        --or-icon-fill: var(--internal-or-asset-tree-header-text-color);
    }
   
    #title-container {
        flex: 1 0 auto;
        flex-direction: row;
        text-transform: capitalize;
        padding-left: 15px;
    }
    
    #title {
        font-weight: 500;
        font-size: 16px;        
    }
    
    #realm-picker {
        outline: none;
        margin-left: 5px;
        text-transform: none;
        font-size: 14px;
    }
    
    #header-btns {
        display: flex;
        flex-direction: row;
        padding-right: 5px;
    }

    #list-container {
        flex: 1 1 auto;
        overflow: auto;
        font-size: 14px;
    }
    
    #list {
        margin: 0;
        color: var(--internal-or-asset-tree-text-color);
        padding: 0;
        height: 100%;
    }
    
    #list, ol {
        list-style-type: none;
    }
        
    li ol {
        padding: 0;
    }
    
    #list li {
        width: 100%;
    }
    
    #list li:not([data-expanded]) > ol {
        display: none;
    }
    
    #list li[data-selected] > .node-container, #list li > .node-container:hover {
        background-color: var(--internal-or-asset-tree-selected-background-color);
    }
    
    #list li[data-selected] > .node-container {
        border-left-color: var(--internal-or-asset-tree-selected-color);
    }
          
    .asset-list-element .over {
        background-color: ${r(i)};
    }
    
    .in-between-element {
        position: relative;
        height: 2px;
    }
    .in-between-element.over {
        padding: 5px 0;
        margin: -5px 0;
    }
    .end-element, .loadmore-element {
        height: 44px;
    }
    .loadmore-element {
        display: flex;
        padding-left: 15px;
        align-items: center;
    }
    
    .node-container {
        display: flex;
        border-left: 4px solid transparent;
        user-select: none;
        cursor: pointer;
        height: var(--internal-or-asset-tree-item-height);
        line-height: var(--internal-or-asset-tree-item-height);
        padding-top: var(--internal-or-asset-tree-item-padding);
        padding-bottom: var(--internal-or-asset-tree-item-padding);
    }

    .node-container > * {
        flex: 0 0 auto;
    }
    
    .expander {
        width: 36px;
        height: 100%;
        display: inline-block;
        background-repeat: no-repeat;                
        background-size: 18px;
        background-position: center;
        
        margin-left: -4px;
        border-left: 4px solid transparent;
    }
    
    .expander[data-expandable] {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='rgb(204, 204, 204)' viewBox='0 0 24 24'%3E%3Cpath d='${r(l)}'/%3E%3C/svg%3E");
    }

    .expander[data-expandable]:hover {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='${r(l)}'/%3E%3C/svg%3E");
    }
    
    li[data-expanded] > .node-container .expander {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='${r(s)}'/%3E%3C/svg%3E") !important;
    }
    
    .node-name {
        margin: -4px 0;
        flex: 1 0 auto;
        display: flex;
        align-items: center;
    }
    
    .node-name > span {
        vertical-align: middle;
    }
    
    .node-name > or-icon {
        --or-icon-width: 18px;
        --or-icon-height: 18px;
        margin-right: 8px;
    }
    
    #loading {
        flex: 1 0 auto;
        display: inline-flex;
        align-items: center;
        text-align: center;
        margin: 0 auto;
        font-size: 14px;        
    }    
    
     @media only screen and (min-width: 768px){
        .expander {
            width: 26px;
        }
    }
    
    .mdc-list-item__graphic {
        margin-left: auto;
        display: flex;
        margin-right: 5px;
    }
    
    .mdc-checkbox {
        display: flex;
        height: 100%;
        align-items: center;
    }
    
    .mdc-checkbox or-icon {
        height: 15px;
        width: auto;
        color: var(--internal-or-asset-tree-line-color);
    }
    .mdc-checkbox or-icon.mdc-checkbox--parent {
        height: 17px;
    }

    .mdc-checkbox or-icon[icon="checkbox-marked"],
    .mdc-checkbox or-icon[icon="checkbox-multiple-marked"],
    .mdc-checkbox or-icon[icon="checkbox-multiple-marked-outline"] {
        color: var(--internal-or-asset-tree-selected-color);
    }
    
    #asset-tree-filter {
        display: flex;
        align-items: center;
        position: relative;
        background-color: var(--internal-or-asset-tree-selected-background-color);
    }
    
    #filterInput {
        padding: 7px 12px 7px 7px;
    }

    #filterAssetTypeDownIcon {
        width: 16px;
        height: 16px;
        position: absolute;
        right: 20px;
        padding-right: 14px;
        cursor: pointer;
    }
    
    #filterSettingsIcon {
        cursor: pointer;
        margin-right: 12px;
    }
    
    #asset-tree-filter-setting {
        position: absolute;
        background-color: var(--internal-or-asset-tree-background-color);
        top: calc(var(--internal-or-asset-tree-header-height) + var(--internal-or-header-height, 50px) - 1px);
        display: none;
        width: 300px;
        z-index: 100;
        box-shadow: rgb(0 0 0 / 21%) 0px 1px 3px 0px;
        box-sizing: border-box;
        padding: 10px;
    }

    #asset-tree-filter-setting .advanced-filter {
        display: flex;
        flex-direction: column;
    }

    #asset-tree-filter-setting.visible {
        display: block;
    }
    
    .filterAssetType {
        display: flex;
        align-items: center;
    }
    
    #clearIconContainer.visible {
        display: block;
    }

    #noAssetsFound {
        flex: 1 0 auto;
        display: inline-flex;
        align-items: center;
        text-align: center;
        margin: 0 auto;
        font-size: 14px;
    }
    
    .filterMatching {
        color: #808080;
    }
    
    .draggable {
        cursor: pointer;
    }
    
    .draggable:active[draggable="true"] {
        cursor: grabbing;
    }
`;