guments),this.expanded={}}connectedCallback(){super.connectedCallback()}toggleExpand(e){return()=>{const t=!this.expanded[e];this.expanded=Object.assign(Object.assign({},this.expanded),{[e]:t})}}renderObject(e,t){return f.y$.track(this,"expanded"),m.d`
            <ul>
                ${(0,v.rx)((()=>Object.keys(e)),m.d`${i=>{const n=e[i],o=t?`${t}.${i}`:i,l=k(n),s=this.expanded[o]||l;return m.d`
                            <li
                                data-path=${o}
                                @click=${()=>this.toggleExpand(o)}
                            >
                                ${this.renderPropertyKey({isCollapsable:!l,collapsed:!this.expanded[o],key:i,onClick:this.toggleExpand(o)})}
                                ${s?this.renderNode(n,o):this.renderNodePreview(n)}
                            </li>
                        `}}`)}
            </ul>
        `}renderNode(e,t=""){return k(e)?this.renderValue(e):this.renderObject(e,t)}renderNodePreview(e){return m.d`
            <span class="preview"> ${function(e){return Array.isArray(e)?"[...]":"{...}"}(e)} </span>
        `}renderPropertyKey({isCollapsable:e,collapsed:t,onClick:i,key:n}){return m.d`
            <span
                class="${function(...e){return e.filter(Boolean).join(" ")}(n&&"key",e&&"collapsable",t&&"collapsableCollapsed")}"
                @click=${e?i:null}
            >
                ${n}:
            </span>
        `}renderValue(e){var t;return T(e)?e:m.d`
                  <span tabindex="0" class=${t=e,null===t?"null":Array.isArray(t)?"array":typeof t}
                      >${JSON.stringify(e)}</span
                  >
              `}render(){return m.d` ${this.renderNode(this.data)} `}};(0,p.gn)([f.LO],D.prototype,"data",void 0),(0,p.gn)([f.LO],D.prototype,"expanded",void 0),D=(0,p.gn)([(0,w.M)({name:"json-viewer",template:I,styles:$})],D);const E=m.d`
    <div class="buttons">
        ${(0,v.rx)((e=>e.configItems),m.d` <fluent-button
                class="config-button 
                ${(e,t)=>e.configRef===t.parent.activeConfig.configRef?"active":""}"
                appearance="outline"
                @click=${(e,t)=>t.parent.updateActiveConfig(e)}
            >
                <div class="experience-type">
                    ${e=>e.configRef.experienceType}
                </div>
                <div class="instance-src">
                    ${e=>e.configRef.instanceSrc}
                </div>
            </fluent-button>`)}
    </div>
`,O=m.d`
    <div class="detail">
        <json-viewer :data=${e=>{var t,i;return null===(i=null===(t=e.activeConfig)||void 0===t?void 0:t.configWrapper)||void 0===i?void 0:i.properties}}>
        </json-viewer>
    </div>
`,L=m.d`
    ${E} ${O}
`;var F=i(16517),R=i(18335);let H=class extends w.H{connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return(0,p.mG)(this,void 0,void 0,(function*(){if(e.connectedCallback.call(this),this.updateConfigMap(),this.updateConfigItems(),0===this.configItems.length){const e={experienceType:"edgeChromium"===F.jG.AppType?"EdgeChromiumPageWC":"WindowsPage",instanceSrc:"default"};yield this.initLocalConfigs(e)}this.sortConfigItems(),!this.activeConfig&&this.configItems.length>0&&(this.activeConfig=this.configItems[0])}))}initLocalConfigs(e){return(0,p.mG)(this,void 0,void 0,(function*(){const t=[],i=yield R.U.getConfig(e),n={configRef:e,configWrapper:i};t.push(n),this.activeConfig||(this.activeConfig=n);const o=i&&i.properties,l=o&&(o.childRefs||o.slots);l&&"object"==typeof l&&Object.values(l).map((e=>(0,p.mG)(this,void 0,void 0,(function*(){this.initLocalConfigs(e.configRef)})))),this.configItems?this.configItems=[...this.configItems,...t]:this.configItems=t,this.sortConfigItems()}))}updateConfigMap(){const e=R.U.getInstance().getConfigResolver().getConfigServiceObject();this.configMap=e.getConfigMap()}updateConfigItems(){const e=[];this.configMap.forEach(((t,i)=>{const n=this.getConfigRefFromKey(i),o={experienceType:n.experienceType,properties:t.properties,typeVersion:"Git",_name:i};e.push({configRef:n,configWrapper:o})})),this.configItems=e}sortConfigItems(){this.configItems.sort(((e,t)=>e.configRef.experienceType>=t.configRef.experienceType?1:-1))}updateActiveConfig(e){this.activeConfig=e}getConfigRefFromKey(e){if(!e)return null;const[t,i,n]=e.split("/");return{experienceType:i,instanceSrc:n}}};(0,p.gn)([f.LO],H.prototype,"configMap",void 0),(0,p.gn)([f.LO],H.prototype,"configItems",void 0),(0,p.gn)([f.LO],H.prototype,"activeConfig",void 0),H=(0,p.gn)([(0,w.M)({name:"app-configs",template:L,styles:y})],H);var S=i(65620),A=i(62734),z=i(22674);const U=x.i`
    .link {
        font-size: inherit;
        font-weight: inherit;
        color: ${b.goi};
        outline: none;
        text-decoration: none;
    }

    .link:hover {
        color: ${b.D9J};
    }

    .link:active {
        color: ${b.VNr};
    }

    [row-type="default"]:hover {
        background: ${b.QpD};
        color: ${b.CHi};
    }

    [role="gridcell"],
    [role="columnheader"] {
        font-size: inherit;
    }

    svg {
        fill: ${b.goi};
        height: 20px;
        width: 20px;
    }
`,j=x.i`
    .icon {
        left: 50px;
    }

    .badge {
        left: -10px;
    }
`,P=x.i`
    .icon {
        right: 128px;
    }

    .badge {
        right: -10px;
    }
`,B=x.i`
    ${U}

    :host {
        --elevation: 4;
        --neutral-fill-stealth-rest: ${b.y9A};
    }

    .icon {
        position: fixed;
        z-index: 999;
        bottom: 0;
        text-align: center;
        border: 1px solid rgba(0, 0, 0, 0.15);
        ${A.XC}
        border-bottom: 0;
        border-radius: 5px 5px 0 0;
        background-color: ${b.y9A};
        text-align: center;
        height: 32px;
        width: 32px;
        display: flex;
    }

    .badge {
        position: absolute;
        top: -10px;
        z-index: auto;
        width: 20px;
        height: 20px;
        color: #fff;
        font-weight: 400;
        font-size: 12px;
        line-height: 20px;
        white-space: nowrap;
        text-align: center;
        background: #ff4d4f;
        border-radius: 10px;
        box-shadow: 0 0 0 1px #fff;
    }

    .icon-button {
        background: rgba(0, 0, 0, 0);
        overflow: hidden;
        border-radius: inherit;
    }

    .panel {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        transition: all 0.25s ease-in-out;
        flex-direction: column;
        ${A.XC}
        align-items: center;
        border-top: 1px solid rgba(0, 0, 0, 0.15);
        background-color: ${b.y9A};
        z-index: 998;
        display: flex;
    }

    .panel.collapsed {
        height: 0;
    }

    .panel.expanded {
        height: 30vh;
    }

    .panel.fullscreen {
        height: 100vh;
    }

    .panel > .header {
        height: 40px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        ${A.XC}
        box-sizing: border-box;
        padding: 0 6px;
        flex-wrap: nowrap;
        z-index: 1;
    }

    .panel > .content {
        display: flex;
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        overflow: auto;
        overscroll-behavior: contain;
    }

    .panel > .content > .button-list {
        padding: 8px;
        display: flex;
        flex-wrap: wrap;
        overflow: auto;
        width: 100%;
        align-content: start;
    }

    .panel > .header > .left {
        display: flex;
        height: 100%;
        align-items: center;
    }

    .panel > .header > .right {
        display: flex;
        height: 100%;
        align-items: center;
    }

    .panel > .header > .left > .title {
        font-size: 1.4em;
        font-weight: 600;
        margin-inline-start: 10px;
        white-space: nowrap;
    }

    .widget-button {
        ${A.XC}
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        cursor: pointer;
        text-align: center;
        height: 110px;
        width: 180px;
        border: none;
        font-size: inherit;
        font-weight: 600;
        margin: 8px;
    }

    .app-errors-title {
        font-weight: 500;
        color: rgb(233, 30, 30);
    }
`.withBehaviors(new z.O(P,j)),M=x.i`
    ${U}
    
    :host {
        flex: 1;
    }

    .column-header,
    [role="gridcell"] {
        text-align: center;
    }
`,V=m.d`
    <fluent-data-grid-row
        row-type="sticky-header"
        grid-template-columns="1fr 1fr 2fr 5fr"
        :columnDefinitions=${e=>e.columns}
    ></fluent-data-grid-row>
    ${(0,v.rx)((e=>e.appErrorItems),m.d`
            <fluent-data-grid-row
                grid-template-columns="1fr 1fr 2fr 5fr"
                :rowData=${e=>e}
                :columnDefinitions=${(e,t)=>t.parent.columns}
            ></fluent-data-grid-row>
        `)}
`;let K=class extends w.H{connectedCallback(){super.connectedCallback(),this.columns=this.config.columns,this.updateAppErrorItems()}updateAppErrorItems(){var e;const t=[];null===(e=this.appErrors)||void 0===e||e.map((e=>{const i=e.indexOf("{"),n=e.lastIndexOf("}");if(i&&n)try{const o=JSON.parse(e.slice(i,n+1));t.push(o)}catch(e){return}})),this.appErrorItems=t}attributeChangedCallback(){this.updateAppErrorItems()}};(0,p.gn)([f.LO],K.prototype,"appErrors",void 0),(0,p.gn)([f.LO],K.prototype,"appErrorItems",void 0),(0,p.gn)([S.Lj],K.prototype,"appErrorsCnt",void 0),(0,p.gn)([f.LO],K.prototype,"columns",void 0),K=(0,p.gn)([(0,w.M)({name:"console-monitor",template:V,styles:M})],K);const G=x.i`
    ${U}
    
    :host {
        width: 100%;
        flex: 1;
        display: flex;
    }

    .left-container {
        flex: 1;
    }

    .left-container > [role="row"] {
        border-right: 1px solid ${b.dtw};
    }

    [grid-column="1"] {
        font-weight: 500;
    }
    
    .right-container {
        flex: 1;
    }

    .level-1 {
        padding-left: 30px;
    }

    .level-2 {
        padding-left: 60px;
    }

`,W=m.d`
    <div class="left-container">
        ${(0,v.rx)((e=>e.leftSettingItems),m.d`
                <fluent-data-grid-row
                    grid-template-columns="1fr 1fr"
                    :rowData=${e=>e}
                    :columnDefinitions=${(e,t)=>t.parent.columns}
                    class="level-${e=>e.level}"
                ></fluent-data-grid-row>
            `)}
    </div>
    <div class="right-container">
        ${(0,v.rx)((e=>e.rightSettingItems),m.d`
                <fluent-data-grid-row
                    grid-template-columns="1fr 1fr"
                    :rowData=${e=>e}
                    :columnDefinitions=${(e,t)=>t.parent.columns}
                    class="level-${e=>e.level}"
                ></fluent-data-grid-row>
            `)}
    </div>
`;var q=i(54804),_=i(74539);let N=class extends w.H{connectedCallback(){super.connectedCallback(),this.clientSettings=q.Al.ClientSettings,this.settingItems=[],Object.entries(this.clientSettings).map((([e,t])=>{this.generateItems(e,t)})),this.columns=this.config.columns;const e=Math.ceil(this.settingItems.length/2);this.leftSettingItems=this.settingItems.slice(0,e),this.rightSettingItems=this.settingItems.slice(e)}generateItems(e,t,i=0){if((0,_.Kn)(t)){this.settingItems.push({key:e,level:i});for(const[e,n]of Object.entries(t))this.generateItems(e,n,i+1)}else this.settingItems.push({key:e,value:t,level:i})}};(0,p.gn)([f.LO],N.prototype,"clientSettings",void 0),(0,p.gn)([f.LO],N.prototype,"settingItems",void 0),(0,p.gn)([f.LO],N.prototype,"leftSettingItems",void 0),(0,p.gn)([f.LO],N.prototype,"rightSettingItems",void 0),(0,p.gn)([f.LO],N.prototype,"columns",void 0),N=(0,p.gn)([(0,w.M)({name:"client-settings",template:W,styles:G})],N);const Q=x.i`
    ${U}

    :host {
        padding: 8px;
        display: flex;
        flex-wrap: wrap;
        overflow: auto;
        width: 100%;
        align-content: start;
    }
    
    .util-button {
        box-shadow: rgb(255 255 255 / 20%) 0px 0px 2px 0px inset,
            rgb(0 0 0 / 10%) 0px 0px 10px 0px, rgb(0 0 0 / 10%) 0px 0px 5px 0px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
        text-align: center;
        height: 110px;
        width: 180px;
        border: none;
        font-size: inherit;
        font-weight: 600;
        margin: 8px;
    }
`,J=m.d`
    <fluent-button
        class="util-button"
        appearance="stealth"
        @click=${e=>e.showPosition(document.body)}
    >
        Show Card Positions
    </fluent-button>
    <fluent-button
        class="util-button"
        appearance="stealth"
        @click=${e=>e.showExperienceTypes(document.body)}
    >
        Show Experience Types
    </fluent-button>
`;let X=class extends w.H{connectedCallback(){super.connectedCallback()}showPosition(e){if(!e)return;if(e instanceof Element&&this.showPosition(e.shadowRoot),e.children&&e.children.length>0)for(let t=0;t<e.children.length;t++)this.showPosition(e.children[t]);if(e instanceof ShadowRoot)return;const t=this.getPositionInfo(e);this.addTooltip(e,t,"pos-set")}getPositionInfo(e){const t=e.getAttribute&&e.getAttribute("data-t");if(!t)return;let i;try{i=JSON.parse(t).ext}catch(e){return}return i?`row: ${i.row}, col: ${i.col}`:void 0}showExperienceTypes(e){if(!e)return;if(e instanceof Element&&this.showExperienceTypes(e.shadowRoot),e.children&&e.children.length>0)for(let t=0;t<e.children.length;t++)this.showExperienceTypes(e.children[t]);if(e instanceof ShadowRoot)return;const t=null==e?void 0:e.getAttribute("instance-id");this.addTooltip(e,t,"exp-set")}addTooltip(e,t,i){if(!t||e.classList.contains(i))return;const n=document.createElement("div");n.innerHTML=t,n.title=t,n.setAttribute("style","position: absolute;\n            padding: 2px 6px;\n            border-radius: 20px;\n            background-color: #A5C4EC;\n            display: inline-block;\n            z-index: 998;\n            font-size: 12px;\n            font-weight: 500;\n            transform: translateY(-16px);\n            color: #fff;");const o=document.createElement("div");o.setAttribute("style","position: absolute;\n            bottom: -9px;\n            left: 16px;\n            border-left: 10px solid transparent ;\n            border-right: 10px solid transparent;\n            border-top: 10px solid #A5C4EC;\n            z-index: 998;"),n.appendChild(o),e.classList.add(i),e.shadowRoot?e.shadowRoot.prepend&&e.shadowRoot.prepend(n):(null==e?void 0:e.prepend)&&(null==e||e.prepend(n))}};X=(0,p.gn)([(0,w.M)({name:"common-utils",template:J,styles:Q})],X);const Z=x.i`
    ${U}
    
    :host {
        flex: 1;
    }

    [role="gridcell"] {
        font-size: 16px;
    }
`,Y=m.d`
    ${(0,v.rx)((e=>e.flightItems),m.d`
            <fluent-data-grid-row
                grid-template-columns="1fr 1fr"
                :rowData=${e=>e}
                :columnDefinitions=${(e,t)=>t.parent.columns}
            ></fluent-data-grid-row>
        `)}
`;var ee=i(99478);let te=class extends w.H{connectedCallback(){super.connectedCallback(),this.columns=this.config.columns,this.updateFlightItems()}updateFlightItems(){this.currentFlights=q.Al.CurrentFlightSet;const e=[];this.currentFlights.forEach((t=>{e.push({id:t,expLink:this.getExpLink(t),flightLink:this.getFlightLink(t)})})),this.flightItems=e}getFlightLink(e){const t=new URL(window.location.origin+window.location.pathname);return t.searchParams.append("item",`flights:${e}`),m.d`<a href=${t} class="link" target="_blank"
            >✈️ Apply single flight</a
        >`}getExpLink(e){const t=(0,ee.WU)(this.expBaseUrl,e);return m.d`<a href=${t} class="link" target="_blank"
            >🧪 Go to exp page</a
        >`}};(0,p.gn)([f.LO],te.prototype,"flightItems",void 0),(0,p.gn)([f.LO],te.prototype,"columns",void 0),(0,p.gn)([f.LO],te.prototype,"expBaseUrl",void 0),te=(0,p.gn)([(0,w.M)({name:"current-flights",template:Y,styles:Z})],te);const ie=x.i`
    ${U}
    
    :host {
        width: 100%;
        flex: 1;
        display: flex;
    }

    .container {
        flex: 1;
    }

    .container > [role="row"] {
        border-right: 1px solid ${b.dtw};
    }

    [grid-column="1"] {
        font-weight: 500;
    }
`,ne=m.d`
    <div class="container">
        ${(0,v.rx)((e=>e.coachmarkInfo),m.d`
                <fluent-data-grid-row
                    grid-template-columns="1fr 5fr"
                    :rowData=${e=>e}
                    :columnDefinitions=${(e,t)=>t.parent.columns}
                    style="padding-left: ${e=>e.indent}px"
                ></fluent-data-grid-row>
            `)}
    </div>
`;var oe=i(53076),le=i(93450);let se=class extends w.H{connectedCallback(){super.connectedCallback(),this.coachmarkInfo=[],this.columns=this.config.columns,this.prepareCoachmarkInfo().then()}prepareCoachmarkInfo(){return(0,p.mG)(this,void 0,void 0,(function*(){const e=yield this.getSurface();Object.entries(e).map((([e,t])=>{this.generateInfo(e,t)}))}))}getSurface(){return(0,p.mG)(this,void 0,void 0,(function*(){if(this.irisDataConnector=yield le._.getInstance().rootReducer.getDataConnector(oe.z.IrisData),!this.irisDataConnector)return null;return yield this.irisDataConnector.tryGetSurfaceInfoInternal("88000309")}))}generateInfo(e,t,i=0){if((0,_.Kn)(t)){this.coachmarkInfo.push({key:e,indent:i});for(const[e,n]of Object.entries(t))this.generateInfo(e,n,i+20)}else this.coachmarkInfo.push({key:e,value:t,indent:i})}};(0,p.gn)([f.LO],se.prototype,"coachmarkInfo",void 0),(0,p.gn)([f.LO],se.prototype,"columns",void 0),se=(0,p.gn)([(0,w.M)({name:"coachmark-info",template:ne,styles:ie})],se);var re=i(96584),ae=i(1854);const ce=m.d`
    <sup class="badge">${e=>e.appErrorsCnt}</sup>
`,de=m.d`
    <div class="button-list">
        ${(0,v.rx)((e=>e.widgetList),m.d` <fluent-button
                class="widget-button"
                appearance="stealth"
                @click=${(e,t)=>t.parent.updateActiveWigdetId(e.id)}
            >
                ${(e,t)=>1===e.id?m.d`<span class="app-errors-title"
                            >${e.icon} Errors: ${t.parent.appErrorsCnt}</span
                        >`:m.d`<span>${e.icon} ${e.title}</span>`}
            </fluent-button>`)}
    </div>
`,he=m.d`
    ${(0,C.g)((e=>e.activeWidgetId===e.config.widgetConfigs.AppConfigs.id),m.d` <app-configs
            :config=${e=>e.config.widgetConfigs.AppConfigs}
        >
        </app-configs>`)}
    ${(0,C.g)((e=>e.activeWidgetId===e.config.widgetConfigs.ClientSettings.id),m.d` <client-settings
            :config=${e=>e.config.widgetConfigs.ClientSettings}
        >
        </client-settings>`)}
    ${(0,C.g)((e=>e.activeWidgetId===e.config.widgetConfigs.CommonUtils.id),m.d` <common-utils
            :config=${e=>e.config.widgetConfigs.CommonUtils}
        >
        </common-utils>`)}
    ${(0,C.g)((e=>e.activeWidgetId===e.config.widgetConfigs.ConsoleMonitor.id),m.d` <console-monitor
            :config=${e=>e.config.widgetConfigs.ConsoleMonitor}
            appErrorsCnt=${e=>e.appErrorsCnt}
            :appErrors=${e=>e.appErrors}
        >
        </console-monitor>`)}
    ${(0,C.g)((e=>e.activeWidgetId===e.config.widgetConfigs.CurrentFlights.id),m.d` <current-flights
            :config=${e=>e.config.widgetConfigs.CurrentFlights}
            :expBaseUrl=${e=>e.config.expBaseUrl}
        >
        </current-flights>`)}
    ${(0,C.g)((e=>e.activeWidgetId===e.config.widgetConfigs.CoachmarkInfo.id),m.d` <coachmark-info
            :config=${e=>e.config.widgetConfigs.CoachmarkInfo}
        >
        </coachmark-info>`)}
`,pe=m.d`
    <div class="panel ${e=>e.panelSize}">
        <div class="header">
            <div class="left">
                <fluent-button
                    class="icon-button"
                    appearance="stealth"
                    @click=${e=>e.updateActiveWigdetId(null)}
                >
                    ${re.Z}
                </fluent-button>
                <div class="title">${e=>e.panelTitle}</div>
            </div>
            <div class="right">
                <fluent-button
                    class="icon-button"
                    appearance="stealth"
                    @click=${e=>e.toggleFullscreen()}
                >
                    ${(0,C.g)((e=>e.panelSize===h.fullscreen),m.d`${ae.Z}`)}
                    ${(0,C.g)((e=>e.panelSize!==h.fullscreen),m.d`${'<svg viewBox="0 0 2048 2048"><path d="m1955 1533-931-930-931 930-90-90L1024 421l1021 1022-90 90z"/></svg>'}`)}
                </fluent-button>
                <fluent-button
                    class="icon-button"
                    appearance="stealth"
                    @click=${e=>e.panelSize=h.collapsed}
                >
                    ${'<svg viewBox="0 0 2048 2048"><path d="m1115 1024 690 691-90 90-691-690-691 690-90-90 690-691-690-691 90-90 691 690 691-690 90 90-690 691z"/></svg>'}
                </fluent-button>
            </div>
        </div>
        <div class="content">
            ${(0,C.g)((e=>e.activeWidgetId),he)}
            ${(0,C.g)((e=>!e.activeWidgetId),de)}
        </div>
    </div>
`,ue=m.d`
    <div class="icon" @click=${e=>e.togglePanel()}>
        <fluent-button class="icon-button" appearance="stealth">
            ${'<svg viewBox="0 0 2048 2048"><path d="M1408 512h640v1152H0V512h640V256h768v256zM768 384v128h512V384H768zm1152 256H128v256h384V768h128v128h768V768h128v128h384V640zM128 1536h1792v-512h-384v128h-128v-128H640v128H512v-128H128v512z"/></svg>'}
        </fluent-button>
        ${(0,C.g)((e=>e.appErrorsCnt>0),ce)}
    </div>
    ${pe}
`,fe={experienceConfigSchema:d};(0,n.z)().withShadowRootMode("closed").withElementDisambiguation((()=>r.h.ignoreDuplicate)).register((0,o.k)(),(0,l.hb)(),(0,s._w)(),(0,s.DR)(),(0,s.AO)())},99478:function(e,t,i){function n(e,...t){return e.replace(/{(\d+)}/g,(function(e,i){if(i>=t.length)return e;const n=t[i];return"number"==typeof n||n?n:""}))}function o(e){return!e||!e.trim()}i.d(t,{TF:function(){return o},WU:function(){return n}})},41754:function(e,t,i){i.d(t,{_w:function(){return z},AO:function(){return S},DR:function(){return A}});var n=i(20005),o=i(39181),l=i(65620),s=i(87697),r=i(90554),a=i(36153),c=i(48839);const d="none",h="default",p="sticky",u="default",f="columnheader",g="rowheader",m="default",v="header",C="sticky-header",w=o.d`
    <template>
        ${e=>null===e.rowData||null===e.columnDefinition||null===e.columnDefinition.columnDataKey?null:e.rowData[e.columnDefinition.columnDataKey]}
    </template>
`,x=o.d`
    <template>
        ${e=>null===e.columnDefinition?null:void 0===e.columnDefinition.title?e.columnDefinition.columnDataKey:e.columnDefinition.title}
    </template>
`;class b extends c.I{constructor(){super(...arguments),this.cellType=u,this.rowData=null,this.columnDefinition=null,this.isActiveCell=!1,this.customCellView=null,this.updateCellStyle=()=>{this.style.gridColumn=this.gridColumn}}cellTypeChanged(){this.$fastController.isConnected&&this.updateCellView()}gridColumnChanged(){this.$fastController.isConnected&&this.updateCellStyle()}columnDefinitionChanged(e,t){this.$fastController.isConnected&&this.updateCellView()}connectedCallback(){var e;super.connectedCallback(),this.addEventListener(r._m,this.handleFocusin),this.addEventListener(r.Oz,this.handleFocusout),this.addEventListener(r.AB,this.handleKeydown),this.style.gridColumn=`${void 0===(null===(e=this.columnDefinition)||void 0===e?void 0:e.gridColumn)?0:this.columnDefinition.gridColumn}`,this.updateCellView(),this.updateCellStyle()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(r._m,this.handleFocusin),this.removeEventListener(r.Oz,this.handleFocusout),this.removeEventListener(r.AB,this.handleKeydown),this.disconnectCellView()}handleFocusin(e){if(!this.isActiveCell){if(this.isActiveCell=!0,this.cellType===f){if(null!==this.columnDefinition&&!0!==this.columnDefinition.headerCellInternalFocusQueue&&"function"==typeof this.columnDefinition.headerCellFocusTargetCallback){const e=this.columnDefinition.headerCellFocusTargetCallback(this);null!==e&&e.focus()}}else if(null!==this.columnDefinition&&!0!==this.columnDefinition.cellInternalFocusQueue&&"function"==typeof this.columnDefinition.cellFocusTargetCallback){const e=this.columnDefinition.cellFocusTargetCallback(this);null!==e&&e.focus()}this.$emit("cell-focused",this)}}handleFocusout(e){this===document.activeElement||this.contains(document.activeElement)||(this.isActiveCell=!1)}handleKeydown(e){if(!(e.defaultPrevented||null===this.columnDefinition||this.cellType===u&&!0!==this.columnDefinition.cellInternalFocusQueue||this.cellType===f&&!0!==this.columnDefinition.headerCellInternalFocusQueue))switch(e.key){case a.kL:case a.ny:if(this.contains(document.activeElement)&&document.activeElement!==this)return;if(this.cellType===f){if(void 0!==this.columnDefinition.headerCellFocusTargetCallback){const t=this.columnDefinition.headerCellFocusTargetCallback(this);null!==t&&t.focus(),e.preventDefault()}}else if(void 0!==this.columnDefinition.cellFocusTargetCallback){const t=this.columnDefinition.cellFocusTargetCallback(this);null!==t&&t.focus(),e.preventDefault()}break;case a.CX:this.contains(document.activeElement)&&document.activeElement!==this&&(this.focus(),e.preventDefault())}}updateCellView(){if(this.disconnectCellView(),null!==this.columnDefinition)switch(this.cellType){case f:void 0!==this.columnDefinition.headerCellTemplate?this.customCellView=this.columnDefinition.headerCellTemplate.render(this,this):this.customCellView=x.render(this,this);break;case void 0:case g:case u:void 0!==this.columnDefinition.cellTemplate?this.customCellView=this.columnDefinition.cellTemplate.render(this,this):this.customCellView=w.render(this,this)}}disconnectCellView(){null!==this.customCellView&&(this.customCellView.dispose(),this.customCellView=null)}}(0,n.gn)([(0,l.Lj)({attribute:"cell-type"})],b.prototype,"cellType",void 0),(0,n.gn)([(0,l.Lj)({attribute:"grid-column"})],b.prototype,"gridColumn",void 0),(0,n.gn)([s.LO],b.prototype,"rowData",void 0),(0,n.gn)([s.LO],b.prototype,"columnDefinition",void 0);var y=i(18864);class $ extends c.I{constructor(){super(...arguments),this.rowType=m,this.rowData=null,this.columnDefinitions=null,this.isActiveRow=!1,this.cellsRepeatBehavior=null,this.cellsPlaceholder=null,this.focusColumnIndex=0,this.refocusOnLoad=!1,this.updateRowStyle=()=>{this.style.gridTemplateColumns=this.gridTemplateColumns}}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowStyle()}rowTypeChanged(){this.$fastController.isConnected&&this.updateItemTemplate()}rowDataChanged(){null!==this.rowData&&this.isActiveRow&&(this.refocusOnLoad=!0)}cellItemTemplateChanged(){this.updateItemTemplate()}headerCellItemTemplateChanged(){this.updateItemTemplate()}connectedCallback(){super.connectedCallback(),null===this.cellsRepeatBehavior&&(this.cellsPlaceholder=document.createComment(""),this.appendChild(this.cellsPlaceholder),this.updateItemTemplate(),this.cellsRepeatBehavior=new y.Gx((e=>e.columnDefinitions),(e=>e.activeCellItemTemplate),{positioning:!0}).createBehavior(this.cellsPlaceholder),this.$fastController.addBehaviors([this.cellsRepeatBehavior])),this.addEventListener("cell-focused",this.handleCellFocus),this.addEventListener(r.Oz,this.handleFocusout),this.addEventListener(r.AB,this.handleKeydown),this.updateRowStyle(),this.refocusOnLoad&&(this.refocusOnLoad=!1,this.cellElements.length>this.focusColumnIndex&&this.cellElements[this.focusColumnIndex].focus())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cell-focused",this.handleCellFocus),this.removeEventListener(r.Oz,this.handleFocusout),this.removeEventListener(r.AB,this.handleKeydown)}handleFocusout(e){this.contains(e.target)||(this.isActiveRow=!1,this.focusColumnIndex=0)}handleCellFocus(e){this.isActiveRow=!0,this.focusColumnIndex=this.cellElements.indexOf(e.target),this.$emit("row-focused",this)}handleKeydown(e){if(e.defaultPrevented)return;let t=0;switch(e.key){case a.BE:t=Math.max(0,this.focusColumnIndex-1),this.cellElements[t].focus(),e.preventDefault();break;case a.mr:t=Math.min(this.cellElements.length-1,this.focusColumnIndex+1),this.cellElements[t].focus(),e.preventDefault();break;case a.tU:e.ctrlKey||(this.cellElements[0].focus(),e.preventDefault());break;case a.Kh:e.ctrlKey||(this.cellElements[this.cellElements.length-1].focus(),e.preventDefault())}}updateItemTemplate(){this.activeCellItemTemplate=this.rowType===m&&void 0!==this.cellItemTemplate?this.cellItemTemplate:this.rowType===m&&void 0===this.cellItemTemplate?this.defaultCellItemTemplate:void 0!==this.headerCellItemTemplate?this.headerCellItemTemplate:this.defaultHeaderCellItemTemplate}}(0,n.gn)([(0,l.Lj)({attribute:"grid-template-columns"})],$.prototype,"gridTemplateColumns",void 0),(0,n.gn)([(0,l.Lj)({attribute:"row-type"})],$.prototype,"rowType",void 0),(0,n.gn)([s.LO],$.prototype,"rowData",void 0),(0,n.gn)([s.LO],$.prototype,"columnDefinitions",void 0),(0,n.gn)([s.LO],$.prototype,"cellItemTemplate",void 0),(0,n.gn)([s.LO],$.prototype,"headerCellItemTemplate",void 0),(0,n.gn)([s.LO],$.prototype,"rowIndex",void 0),(0,n.gn)([s.LO],$.prototype,"isActiveRow",void 0),(0,n.gn)([s.LO],$.prototype,"activeCellItemTemplate",void 0),(0,n.gn)([s.LO],$.prototype,"defaultCellItemTemplate",void 0),(0,n.gn)([s.LO],$.prototype,"defaultHeaderCellItemTemplate",void 0),(0,n.gn)([s.LO],$.prototype,"cellElements",void 0);var I=i(81422),T=i(74009),k=i(90960);var D=i(12968);class E extends c.I{constructor(){super(),this.noTabbing=!1,this.generateHeader=h,this.rowsData=[],this.columnDefinitions=null,this.focusRowIndex=0,this.focusColumnIndex=0,this.rowsPlaceholder=null,this.generatedHeader=null,this.isUpdatingFocus=!1,this.pendingFocusUpdate=!1,this.rowindexUpdateQueued=!1,this.columnDefinitionsStale=!0,this.generatedGridTemplateColumns="",this.focusOnCell=(e,t,i)=>{if(0===this.rowElements.length)return this.focusRowIndex=0,void(this.focusColumnIndex=0);const n=Math.max(0,Math.min(this.rowElements.length-1,e)),o=this.rowElements[n].querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'),l=o[Math.max(0,Math.min(o.length-1,t))];i&&this.scrollHeight!==this.clientHeight&&(n<this.focusRowIndex&&this.scrollTop>0||n>this.focusRowIndex&&this.scrollTop<this.scrollHeight-this.clientHeight)&&l.scrollIntoView({block:"center",inline:"center"}),l.focus()},this.onChildListChange=(e,t)=>{e&&e.length&&(e.forEach((e=>{e.addedNodes.forEach((e=>{1===e.nodeType&&"row"===e.getAttribute("role")&&(e.columnDefinitions=this.columnDefinitions)}))})),this.queueRowIndexUpdate())},this.queueRowIndexUpdate=()=>{this.rowindexUpdateQueued||(this.rowindexUpdateQueued=!0,D.SO.queueUpdate(this.updateRowIndexes))},this.updateRowIndexes=()=>{let e=this.gridTemplateColumns;if(void 0===e){if(""===this.generatedGridTemplateColumns&&this.rowElements.length>0){const e=this.rowElements[0];this.generatedGridTemplateColumns=new Array(e.cellElements.length).fill("1fr").join(" ")}e=this.generatedGridTemplateColumns}this.rowElements.forEach(((t,i)=>{const n=t;n.rowIndex=i,n.gridTemplateColumns=e,this.columnDefinitionsStale&&(n.columnDefinitions=this.columnDefinitions)})),this.rowindexUpdateQueued=!1,this.columnDefinitionsStale=!1}}static generateTemplateColumns(e){let t="";return e.forEach((e=>{t=`${t}${""===t?"":" "}1fr`})),t}noTabbingChanged(){this.$fastController.isConnected&&(this.noTabbing?this.setAttribute("tabIndex","-1"):this.setAttribute("tabIndex",this.contains(document.activeElement)||this===document.activeElement?"-1":"0"))}generateHeaderChanged(){this.$fastController.isConnected&&this.toggleGeneratedHeader()}gridTemplateColumnsChanged(){this.$fastController.isConnected&&this.updateRowIndexes()}rowsDataChanged(){null===this.columnDefinitions&&this.rowsData.length>0&&(this.columnDefinitions=E.generateColumns(this.rowsData[0])),this.$fastController.isConnected&&this.toggleGeneratedHeader()}columnDefinitionsChanged(){null!==this.columnDefinitions?(this.generatedGridTemplateColumns=E.generateTemplateColumns(this.columnDefinitions),this.$fastController.isConnected&&(this.columnDefinitionsStale=!0,this.queueRowIndexUpdate())):this.generatedGridTemplateColumns=""}headerCellItemTemplateChanged(){this.$fastController.isConnected&&null!==this.generatedHeader&&(this.generatedHeader.headerCellItemTemplate=this.headerCellItemTemplate)}focusRowIndexChanged(){this.$fastController.isConnected&&this.queueFocusUpdate()}focusColumnIndexChanged(){this.$fastController.isConnected&&this.queueFocusUpdate()}connectedCallback(){super.connectedCallback(),void 0===this.rowItemTemplate&&(this.rowItemTemplate=this.defaultRowItemTemplate),this.rowsPlaceholder=document.createComment(""),this.appendChild(this.rowsPlaceholder),this.toggleGeneratedHeader(),this.rowsRepeatBehavior=new y.Gx((e=>e.rowsData),(e=>e.rowItemTemplate),{positioning:!0}).createBehavior(this.rowsPlaceholder),this.$fastController.addBehaviors([this.rowsRepeatBehavior]),this.addEventListener("row-focused",this.handleRowFocus),this.addEventListener(r.Rl,this.handleFocus),this.addEventListener(r.AB,this.handleKeydown),this.addEventListener(r.Oz,this.handleFocusOut),this.observer=new MutationObserver(this.onChildListChange),this.observer.observe(this,{childList:!0}),this.noTabbing&&this.setAttribute("tabindex","-1"),D.SO.queueUpdate(this.queueRowIndexUpdate)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("row-focused",this.handleRowFocus),this.removeEventListener(r.Rl,this.handleFocus),this.removeEventListener(r.AB,this.handleKeydown),this.removeEventListener(r.Oz,this.handleFocusOut),this.observer.disconnect(),this.rowsPlaceholder=null,this.generatedHeader=null}handleRowFocus(e){this.isUpdatingFocus=!0;const t=e.target;this.focusRowIndex=this.rowElements.indexOf(t),this.focusColumnIndex=t.focusColumnIndex,this.setAttribute("tabIndex","-1"),this.isUpdatingFocus=!1}handleFocus(e){this.focusOnCell(this.focusRowIndex,this.focusColumnIndex,!0)}handleFocusOut(e){null!==e.relatedTarget&&this.contains(e.relatedTarget)||this.setAttribute("tabIndex",this.noTabbing?"-1":"0")}handleKeydown(e){if(e.defaultPrevented)return;let t;const i=this.rowElements.length-1,n=this.offsetHeight+this.scrollTop,o=this.rowElements[i];switch(e.key){case a.SB:e.preventDefault(),this.focusOnCell(this.focusRowIndex-1,this.focusColumnIndex,!0);break;case a.iF:e.preventDefault(),this.focusOnCell(this.focusRowIndex+1,this.focusColumnIndex,!0);break;case a.Op:if(e.preventDefault(),0===this.rowElements.length){this.focusOnCell(0,0,!1);break}if(0===this.focusRowIndex)return void this.focusOnCell(0,this.focusColumnIndex,!1);for(t=this.focusRowIndex-1;t>=0;t--){const e=this.rowElements[t];if(e.offsetTop<this.scrollTop){this.scrollTop=e.offsetTop+e.clientHeight-this.clientHeight;break}}this.focusOnCell(t,this.focusColumnIndex,!1);break;case a.hi:if(e.preventDefault(),0===this.rowElements.length){this.focusOnCell(0,0,!1);break}if(this.focusRowIndex>=i||o.offsetTop+o.offsetHeight<=n)return void this.focusOnCell(i,this.focusColumnIndex,!1);for(t=this.focusRowIndex+1;t<=i;t++){const e=this.rowElements[t];if(e.offsetTop+e.offsetHeight>n){let t=0;this.generateHeader===p&&null!==this.generatedHeader&&(t=this.generatedHeader.clientHeight),this.scrollTop=e.offsetTop-t;break}}this.focusOnCell(t,this.focusColumnIndex,!1);break;case a.tU:e.ctrlKey&&(e.preventDefault(),this.focusOnCell(0,0,!0));break;case a.Kh:e.ctrlKey&&null!==this.columnDefinitions&&(e.preventDefault(),this.focusOnCell(this.rowElements.length-1,this.columnDefinitions.length-1,!0))}}queueFocusUpdate(){this.isUpdatingFocus&&(this.contains(document.activeElement)||this===document.activeElement)||!1===this.pendingFocusUpdate&&(this.pendingFocusUpdate=!0,D.SO.queueUpdate((()=>this.updateFocus())))}updateFocus(){this.pendingFocusUpdate=!1,this.focusOnCell(this.focusRowIndex,this.focusColumnIndex,!0)}toggleGeneratedHeader(){if(null!==this.generatedHeader&&(this.removeChild(this.generatedHeader),this.generatedHeader=null),this.generateHeader!==d&&this.rowsData.length>0){const e=document.createElement(this.rowElementTag);return this.generatedHeader=e,this.generatedHeader.columnDefinitions=this.columnDefinitions,this.generatedHeader.gridTemplateColumns=this.gridTemplateColumns,this.generatedHeader.rowType=this.generateHeader===p?C:v,void(null===this.firstChild&&null===this.rowsPlaceholder||this.insertBefore(e,null!==this.firstChild?this.firstChild:this.rowsPlaceholder))}}}E.generateColumns=e=>Object.getOwnPropertyNames(e).map(((e,t)=>({columnDataKey:e,gridColumn:`${t}`}))),(0,n.gn)([(0,l.Lj)({attribute:"no-tabbing",mode:"boolean"})],E.prototype,"noTabbing",void 0),(0,n.gn)([(0,l.Lj)({attribute:"generate-header"})],E.prototype,"generateHeader",void 0),(0,n.gn)([(0,l.Lj)({attribute:"grid-template-columns"})],E.prototype,"gridTemplateColumns",void 0),(0,n.gn)([s.LO],E.prototype,"rowsData",void 0),(0,n.gn)([s.LO],E.prototype,"columnDefinitions",void 0),(0,n.gn)([s.LO],E.prototype,"rowItemTemplate",void 0),(0,n.gn)([s.LO],E.prototype,"cellItemTemplate",void 0),(0,n.gn)([s.LO],E.prototype,"headerCellItemTemplate",void 0),(0,n.gn)([s.LO],E.prototype,"focusRowIndex",void 0),(0,n.gn)([s.LO],E.prototype,"focusColumnIndex",void 0),(0,n.gn)([s.LO],E.prototype,"defaultRowItemTemplate",void 0),(0,n.gn)([s.LO],E.prototype,"rowElementTag",void 0),(0,n.gn)([s.LO],E.prototype,"rowElements",void 0);var O=i(53046);var L=i(40082),F=i(32804);var R=i(56201),H=i(87839);const S=b.compose({baseName:"data-grid-cell",template:(e,t)=>o.d`
        <template
            tabindex="-1"
            role="${e=>e.cellType&&"default"!==e.cellType?e.cellType:"gridcell"}"
            class="
            ${e=>"columnheader"===e.cellType?"column-header":"rowheader"===e.cellType?"row-header":""}
            "
        >
            <slot></slot>
        </template>
    `,styles:(e,t)=>O.i`
        :host {
            padding: calc(${F._5n} * 1px) calc(${F._5n} * 3px);
            color: ${F.CHi};
            box-sizing: border-box;
            font-family: ${F.SVJ};
            font-size: ${F.cSu};
            line-height: ${F.RUt};
            font-weight: 400;
            border: transparent calc(${F.Han} * 1px) solid;
            overflow: hidden;
            white-space: nowrap;
            border-radius: calc(${F.UWU} * 1px);
        }

        :host(.column-header) {
            font-weight: 600;
        }

        :host(:${R.b}) {
            border: ${F.yGg} calc(${F.Han} * 1px) solid;
            color: ${F.CHi};
        }
    `.withBehaviors((0,L.vF)(O.i`
                :host {
                    forced-color-adjust: none;
                    border-color: transparent;
                    background: ${H.H.Field};
                    color: ${H.H.FieldText};
                }

                :host(:${R.b}) {
                    border-color: ${H.H.FieldText};
                    box-shadow: 0 0 0 2px inset ${H.H.Field};
                    color: ${H.H.FieldText};
                }
            `))}),A=$.compose({baseName:"data-grid-row",template:(e,t)=>{const i=function(e){const t=e.tagFor(b);return o.d`
    <${t}
        cell-type="${e=>e.isRowHeader?"rowheader":void 0}"
        grid-column="${(e,t)=>t.index+1}"
        :rowData="${(e,t)=>t.parent.rowData}"
        :columnDefinition="${e=>e}"
    ></${t}>
`}(e),n=function(e){const t=e.tagFor(b);return o.d`
    <${t}
        cell-type="columnheader"
        grid-column="${(e,t)=>t.index+1}"
        :columnDefinition="${e=>e}"
    ></${t}>
`}(e);return o.d`
        <template
            role="row"
            class="${e=>"default"!==e.rowType?e.rowType:""}"
            :defaultCellItemTemplate="${i}"
            :defaultHeaderCellItemTemplate="${n}"
            ${(0,I.p)({property:"cellElements",filter:(0,T.R)('[role="cell"],[role="gridcell"],[role="columnheader"],[role="rowheader"]')})}
        >
            <slot ${(0,k.Q)("slottedCellElements")}></slot>
        </template>
    `},styles:(e,t)=>O.i`
        :host {
            display: grid;
            padding: 1px 0;
            box-sizing: border-box;
            width: 100%;
            border-bottom: calc(${F.Han} * 1px) solid ${F.dtw};
        }

        :host(.header) {
        }

        :host(.sticky-header) {
            background: ${F.wFS};
            position: sticky;
            top: 0;
        }
    `.withBehaviors((0,L.vF)(O.i`
                :host {
                }
            `))}),z=E.compose({baseName:"data-grid",template:(e,t)=>{const i=function(e){const t=e.tagFor($);return o.d`
    <${t}
        :rowData="${e=>e}"
        :cellItemTemplate="${(e,t)=>t.parent.cellItemTemplate}"
        :headerCellItemTemplate="${(e,t)=>t.parent.headerCellItemTemplate}"
    ></${t}>
`}(e),n=e.tagFor($);return o.d`
        <template
            role="grid"
            tabindex="0"
            :rowElementTag="${()=>n}"
            :defaultRowItemTemplate="${i}"
            ${(0,I.p)({property:"rowElements",filter:(0,T.R)("[role=row]")})}
        >
            <slot></slot>
        </template>
    `},styles:(e,t)=>O.i`
    :host {
        display: flex;
        position: relative;
        flex-direction: column;
    }
`})}}]);A
Eo