// Copyright 2011 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import{css,html,nothing,CrLitElement,render}from"chrome://resources/lit/v3_0/lit.rollup.js";import{loadTimeData}from"chrome://resources/js/load_time_data.js";import{mojo}from"chrome://resources/mojo/mojo/public/js/bindings.js";import{PolymerElement,html as html$1,templatize}from"chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js";import{addWebUiListener,removeWebUiListener,sendWithPromise}from"chrome://resources/js/cr.js";import"../../../../../../../../../../../../strings.m.js";const sheet$2=new CSSStyleSheet;sheet$2.replaceSync(`html{--google-blue-50-rgb:232,240,254;--google-blue-50:rgb(var(--google-blue-50-rgb));--google-blue-100-rgb:210,227,252;--google-blue-100:rgb(var(--google-blue-100-rgb));--google-blue-200-rgb:174,203,250;--google-blue-200:rgb(var(--google-blue-200-rgb));--google-blue-300-rgb:138,180,248;--google-blue-300:rgb(var(--google-blue-300-rgb));--google-blue-400-rgb:102,157,246;--google-blue-400:rgb(var(--google-blue-400-rgb));--google-blue-500-rgb:66,133,244;--google-blue-500:rgb(var(--google-blue-500-rgb));--google-blue-600-rgb:26,115,232;--google-blue-600:rgb(var(--google-blue-600-rgb));--google-blue-700-rgb:25,103,210;--google-blue-700:rgb(var(--google-blue-700-rgb));--google-blue-800-rgb:24,90,188;--google-blue-800:rgb(var(--google-blue-800-rgb));--google-blue-900-rgb:23,78,166;--google-blue-900:rgb(var(--google-blue-900-rgb));--google-green-50-rgb:230,244,234;--google-green-50:rgb(var(--google-green-50-rgb));--google-green-200-rgb:168,218,181;--google-green-200:rgb(var(--google-green-200-rgb));--google-green-300-rgb:129,201,149;--google-green-300:rgb(var(--google-green-300-rgb));--google-green-400-rgb:91,185,116;--google-green-400:rgb(var(--google-green-400-rgb));--google-green-500-rgb:52,168,83;--google-green-500:rgb(var(--google-green-500-rgb));--google-green-600-rgb:30,142,62;--google-green-600:rgb(var(--google-green-600-rgb));--google-green-700-rgb:24,128,56;--google-green-700:rgb(var(--google-green-700-rgb));--google-green-800-rgb:19,115,51;--google-green-800:rgb(var(--google-green-800-rgb));--google-green-900-rgb:13,101,45;--google-green-900:rgb(var(--google-green-900-rgb));--google-grey-50-rgb:248,249,250;--google-grey-50:rgb(var(--google-grey-50-rgb));--google-grey-100-rgb:241,243,244;--google-grey-100:rgb(var(--google-grey-100-rgb));--google-grey-200-rgb:232,234,237;--google-grey-200:rgb(var(--google-grey-200-rgb));--google-grey-300-rgb:218,220,224;--google-grey-300:rgb(var(--google-grey-300-rgb));--google-grey-400-rgb:189,193,198;--google-grey-400:rgb(var(--google-grey-400-rgb));--google-grey-500-rgb:154,160,166;--google-grey-500:rgb(var(--google-grey-500-rgb));--google-grey-600-rgb:128,134,139;--google-grey-600:rgb(var(--google-grey-600-rgb));--google-grey-700-rgb:95,99,104;--google-grey-700:rgb(var(--google-grey-700-rgb));--google-grey-800-rgb:60,64,67;--google-grey-800:rgb(var(--google-grey-800-rgb));--google-grey-900-rgb:32,33,36;--google-grey-900:rgb(var(--google-grey-900-rgb));--google-grey-900-white-4-percent:#292a2d;--google-purple-200-rgb:215,174,251;--google-purple-200:rgb(var(--google-purple-200-rgb));--google-purple-900-rgb:104,29,168;--google-purple-900:rgb(var(--google-purple-900-rgb));--google-red-100-rgb:244,199,195;--google-red-100:rgb(var(--google-red-100-rgb));--google-red-300-rgb:242,139,130;--google-red-300:rgb(var(--google-red-300-rgb));--google-red-500-rgb:234,67,53;--google-red-500:rgb(var(--google-red-500-rgb));--google-red-600-rgb:217,48,37;--google-red-600:rgb(var(--google-red-600-rgb));--google-red-700-rgb:197,57,41;--google-red-700:rgb(var(--google-red-700-rgb));--google-yellow-50-rgb:254,247,224;--google-yellow-50:rgb(var(--google-yellow-50-rgb));--google-yellow-100-rgb:254,239,195;--google-yellow-100:rgb(var(--google-yellow-100-rgb));--google-yellow-200-rgb:253,226,147;--google-yellow-200:rgb(var(--google-yellow-200-rgb));--google-yellow-300-rgb:253,214,51;--google-yellow-300:rgb(var(--google-yellow-300-rgb));--google-yellow-400-rgb:252,201,52;--google-yellow-400:rgb(var(--google-yellow-400-rgb));--google-yellow-500-rgb:251,188,4;--google-yellow-500:rgb(var(--google-yellow-500-rgb));--google-yellow-700-rgb:240,147,0;--google-yellow-700:rgb(var(--google-yellow-700-rgb));--cr-card-background-color:white;--cr-shadow-key-color_:color-mix(in srgb,var(--cr-shadow-color) 30%,transparent);--cr-shadow-ambient-color_:color-mix(in srgb,var(--cr-shadow-color) 15%,transparent);--cr-elevation-1:var(--cr-shadow-key-color_) 0 1px 2px 0,var(--cr-shadow-ambient-color_) 0 1px 3px 1px;--cr-elevation-2:var(--cr-shadow-key-color_) 0 1px 2px 0,var(--cr-shadow-ambient-color_) 0 2px 6px 2px;--cr-elevation-3:var(--cr-shadow-key-color_) 0 1px 3px 0,var(--cr-shadow-ambient-color_) 0 4px 8px 3px;--cr-elevation-4:var(--cr-shadow-key-color_) 0 2px 3px 0,var(--cr-shadow-ambient-color_) 0 6px 10px 4px;--cr-elevation-5:var(--cr-shadow-key-color_) 0 4px 4px 0,var(--cr-shadow-ambient-color_) 0 8px 12px 6px;--cr-card-shadow:var(--cr-elevation-2);--cr-focused-item-color:var(--google-grey-300);--cr-form-field-label-color:var(--google-grey-700);--cr-hairline-rgb:0,0,0;--cr-iph-anchor-highlight-color:rgba(var(--google-blue-600-rgb),0.1);--cr-menu-background-color:white;--cr-menu-background-focus-color:var(--google-grey-400);--cr-menu-shadow:var(--cr-elevation-2);--cr-separator-color:rgba(0,0,0,.06);--cr-title-text-color:rgb(90,90,90);--cr-scrollable-border-color:var(--google-grey-300);--cr-button-edge-spacing:12px;--cr-controlled-by-spacing:24px;--cr-default-input-max-width:264px;--cr-icon-ripple-size:36px;--cr-icon-ripple-padding:8px;--cr-icon-size:20px;--cr-icon-button-margin-start:16px;--cr-icon-ripple-margin:calc(var(--cr-icon-ripple-padding) * -1);--cr-section-min-height:48px;--cr-section-two-line-min-height:64px;--cr-section-padding:20px;--cr-section-vertical-padding:12px;--cr-section-indent-width:40px;--cr-section-indent-padding:calc(var(--cr-section-padding) + var(--cr-section-indent-width));--cr-section-vertical-margin:21px;--cr-centered-card-max-width:680px;--cr-centered-card-width-percentage:0.96;--cr-hairline:1px solid rgba(var(--cr-hairline-rgb),.14);--cr-separator-height:1px;--cr-separator-line:var(--cr-separator-height) solid var(--cr-separator-color);--cr-toolbar-overlay-animation-duration:150ms;--cr-toolbar-height:56px;--cr-card-border-radius:8px;--cr-disabled-opacity:.38;--cr-form-field-bottom-spacing:16px;--cr-form-field-label-font-size:.625rem;--cr-form-field-label-height:1em;--cr-form-field-label-line-height:1;--cr-fallback-color-outline:rgb(116,119,117);--cr-fallback-color-primary:rgb(11,87,208);--cr-fallback-color-on-primary:rgb(255,255,255);--cr-fallback-color-primary-container:rgb(211,227,253);--cr-fallback-color-on-primary-container:rgb(4,30,73);--cr-fallback-color-secondary-container:rgb(194,231,255);--cr-fallback-color-on-secondary-container:rgb(0,29,53);--cr-fallback-color-neutral-container:rgb(242,242,242);--cr-fallback-color-neutral-outline:rgb(199,199,199);--cr-fallback-color-surface:rgb(255,255,255);--cr-fallback-color-surface1:rgb(248,250,253);--cr-fallback-color-surface2:rgb(243,246,252);--cr-fallback-color-surface3:rgb(239,243,250);--cr-fallback-color-surface4:rgb(237,242,250);--cr-fallback-color-surface5:rgb(234,240,249);--cr-fallback-color-on-surface-rgb:31,31,31;--cr-fallback-color-on-surface:rgb(var(--cr-fallback-color-on-surface-rgb));--cr-fallback-color-surface-variant:rgb(225,227,225);--cr-fallback-color-on-surface-variant:rgb(68,71,70);--cr-fallback-color-on-surface-subtle:rgb(71,71,71);--cr-fallback-color-inverse-primary:rgb(168,199,250);--cr-fallback-color-inverse-surface:rgb(48,48,48);--cr-fallback-color-inverse-on-surface:rgb(242,242,242);--cr-fallback-color-tonal-container:rgb(211,227,253);--cr-fallback-color-on-tonal-container:rgb(4,30,73);--cr-fallback-color-tonal-outline:rgb(168,199,250);--cr-fallback-color-error:rgb(179,38,30);--cr-fallback-color-divider:rgb(211,227,253);--cr-fallback-color-state-hover-on-prominent_:rgba(253,252,251,.1);--cr-fallback-color-state-on-subtle-rgb_:31,31,31;--cr-fallback-color-state-hover-on-subtle_:rgba(var(--cr-fallback-color-state-on-subtle-rgb_),.06);--cr-fallback-color-state-ripple-neutral-on-subtle_:rgba(var(--cr-fallback-color-state-on-subtle-rgb_),.08);--cr-fallback-color-state-ripple-primary-rgb_:124,172,248;--cr-fallback-color-state-ripple-primary_:rgba(var(--cr-fallback-color-state-ripple-primary-rgb_),0.32);--cr-fallback-color-base-container:rgb(236,239,247);--cr-fallback-color-disabled-background:rgba(var(--cr-fallback-color-on-surface-rgb),.12);--cr-fallback-color-disabled-foreground:rgba(var(--cr-fallback-color-on-surface-rgb),var(--cr-disabled-opacity));--cr-hover-background-color:var(--color-sys-state-hover,rgba(var(--cr-fallback-color-on-surface-rgb),.08));--cr-hover-on-prominent-background-color:var(--color-sys-state-hover-on-prominent,var(--cr-fallback-color-state-hover-on-prominent_));--cr-hover-on-subtle-background-color:var(--color-sys-state-hover-on-subtle,var(--cr-fallback-color-state-hover-on-subtle_));--cr-active-background-color:var(--color-sys-state-pressed,rgba(var(--cr-fallback-color-on-surface-rgb),.12));--cr-active-on-primary-background-color:var(--color-sys-state-ripple-primary,var(--cr-fallback-color-state-ripple-primary_));--cr-active-neutral-on-subtle-background-color:var(--color-sys-state-ripple-neutral-on-subtle,var(--cr-fallback-color-state-ripple-neutral-on-subtle_));--cr-focus-outline-color:var(--color-sys-state-focus-ring,var(--cr-fallback-color-primary));--cr-focus-outline-inverse-color:var(--color-sys-state-focus-ring-inverse,var(--cr-fallback-color-inverse-primary));--cr-primary-text-color:var(--color-primary-foreground,var(--cr-fallback-color-on-surface));--cr-secondary-text-color:var(--color-secondary-foreground,var(--cr-fallback-color-on-surface-variant));--cr-link-color:var(--color-link-foreground-default,var(--cr-fallback-color-primary));--cr-button-height:36px;--cr-shadow-color:var(--color-sys-shadow,rgb(0,0,0));--cr-checked-color:var(--color-checkbox-foreground-checked,var(--cr-fallback-color-primary))}html[webui-refresh-2026]{--cr-card-background-color:var(--color-webui-card-background)}@media (prefers-color-scheme:dark){html{--cr-fallback-color-outline:rgb(142,145,143);--cr-fallback-color-primary:rgb(168,199,250);--cr-fallback-color-on-primary:rgb(6,46,111);--cr-fallback-color-primary-container:rgb(8,66,160);--cr-fallback-color-on-primary-container:rgb(211,227,253);--cr-fallback-color-secondary-container:rgb(0,74,119);--cr-fallback-color-on-secondary-container:rgb(194,231,255);--cr-fallback-color-neutral-container:rgb(40,40,40);--cr-fallback-color-neutral-outline:rgb(117,117,117);--cr-fallback-color-surface:rgb(31,31,31);--cr-fallback-color-surface1:rgb(39,40,42);--cr-fallback-color-surface2:rgb(45,47,49);--cr-fallback-color-surface3:rgb(51,52,56);--cr-fallback-color-surface4:rgb(52,54,58);--cr-fallback-color-surface5:rgb(56,58,62);--cr-fallback-color-on-surface-rgb:227,227,227;--cr-fallback-color-surface-variant:rgb(68,71,70);--cr-fallback-color-on-surface-variant:rgb(196,199,197);--cr-fallback-color-on-surface-subtle:rgb(199,199,199);--cr-fallback-color-inverse-primary:rgb(11,87,208);--cr-fallback-color-inverse-surface:rgb(227,227,227);--cr-fallback-color-inverse-on-surface:rgb(31,31,31);--cr-fallback-color-tonal-container:rgb(0,74,119);--cr-fallback-color-on-tonal-container:rgb(194,231,255);--cr-fallback-color-tonal-outline:rgb(4,125,183);--cr-fallback-color-error:rgb(242,184,181);--cr-fallback-color-divider:rgb(94,94,94);--cr-fallback-color-state-hover-on-prominent_:rgba(31,31,31,.06);--cr-fallback-color-state-on-subtle-rgb_:253,252,251;--cr-fallback-color-state-hover-on-subtle_:rgba(var(--cr-fallback-color-state-on-subtle-rgb_),.10);--cr-fallback-color-state-ripple-neutral-on-subtle_:rgba(var(--cr-fallback-color-state-on-subtle-rgb_),.16);--cr-fallback-color-state-ripple-primary-rgb_:76,141,246;--cr-fallback-color-base-container:rgba(40,40,40,1);--cr-card-background-color:var(--google-grey-900-white-4-percent);--cr-focused-item-color:var(--google-grey-800);--cr-form-field-label-color:var(--dark-secondary-color);--cr-hairline-rgb:255,255,255;--cr-iph-anchor-highlight-color:rgba(var(--google-grey-100-rgb),0.1);--cr-menu-background-color:var(--google-grey-900);--cr-menu-background-focus-color:var(--google-grey-700);--cr-menu-background-sheen:rgba(255,255,255,.06);--cr-menu-shadow:rgba(0,0,0,.3) 0 1px 2px 0,rgba(0,0,0,.15) 0 3px 6px 2px;--cr-separator-color:rgba(255,255,255,.1);--cr-title-text-color:var(--cr-primary-text-color);--cr-scrollable-border-color:var(--google-grey-700)}}@media (forced-colors:active){html{--cr-focus-outline-hcm:2px solid transparent;--cr-border-hcm:2px solid transparent;--cr-fallback-color-disabled-background:Canvas;--cr-fallback-color-disabled-foreground:GrayText}}@media (prefers-reduced-motion:reduce){html{--cr-animations-disabled:1}}`);document.adoptedStyleSheets=[...document.adoptedStyleSheets,sheet$2];function assert(value,message){if(value){return}throw new Error("Assertion failed"+(message?`: ${message}`:""))}function assertInstanceof(value,type,message){if(value instanceof type){return}throw new Error(`Value ${value} is not of type ${type.name||typeof type}`)}function assertNotReached(message="Unreachable code hit"){assert(false,message)}function assertNotReachedCase(_param,message){assertNotReached(message)}const CLASS_NAME="focus-outline-visible";const docsToManager=new Map;class FocusOutlineManager{focusByKeyboard_=true;classList_;constructor(doc){this.classList_=doc.documentElement.classList;doc.addEventListener("keydown",(e=>this.onEvent_(true,e)),true);doc.addEventListener("mousedown",(e=>this.onEvent_(false,e)),true);this.updateVisibility()}onEvent_(focusByKeyboard,e){if(this.focusByKeyboard_===focusByKeyboard){return}if(e instanceof KeyboardEvent&&e.repeat){return}this.focusByKeyboard_=focusByKeyboard;this.updateVisibility()}updateVisibility(){this.visible=this.focusByKeyboard_}set visible(visible){this.classList_.toggle(CLASS_NAME,visible)}get visible(){return this.classList_.contains(CLASS_NAME)}static forDocument(doc){let manager=docsToManager.get(doc);if(!manager){manager=new FocusOutlineManager(doc);docsToManager.set(doc,manager)}return manager}}class EventTracker{listeners_=[];add(target,eventType,listener,capture=false){const h={target:target,eventType:eventType,listener:listener,capture:capture};this.listeners_.push(h);target.addEventListener(eventType,listener,capture)}remove(target,eventType){this.listeners_=this.listeners_.filter((listener=>{if(listener.target===target&&(!eventType||listener.eventType===eventType)){EventTracker.removeEventListener(listener);return false}return true}))}removeAll(){this.listeners_.forEach((listener=>EventTracker.removeEventListener(listener)));this.listeners_=[]}static removeEventListener(entry){entry.target.removeEventListener(entry.eventType,entry.listener,entry.capture)}}function getDeepActiveElement(){let a=document.activeElement;while(a&&a.shadowRoot&&a.shadowRoot.activeElement){a=a.shadowRoot.activeElement}return a}function isRTL(){return document.documentElement.dir==="rtl"}function quoteString(str){return str.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1")}function listenOnce(target,eventNames,callback){const eventNamesArray=Array.isArray(eventNames)?eventNames:eventNames.split(/ +/);const removeAllAndCallCallback=function(event){eventNamesArray.forEach((function(eventName){target.removeEventListener(eventName,removeAllAndCallCallback,false)}));return callback(event)};eventNamesArray.forEach((function(eventName){target.addEventListener(eventName,removeAllAndCallCallback,false)}))}function hasKeyModifiers(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function debounceEnd(fn,time=50){let timerId;return()=>{clearTimeout(timerId);timerId=setTimeout(fn,time)}}const ACTIVE_CLASS="focus-row-active";class FocusRow{root;delegate;eventTracker=new EventTracker;boundary_;constructor(root,boundary,delegate){this.root=root;this.boundary_=boundary||document.documentElement;this.delegate=delegate}static isFocusable(element){if(!element||element.disabled){return false}let current=element;while(true){assertInstanceof(current,Element);const style=window.getComputedStyle(current);if(style.visibility==="hidden"||style.display==="none"){return false}const parent=current.parentNode;if(!parent){return false}if(parent===current.ownerDocument||parent instanceof DocumentFragment){return true}current=parent}}static getFocusableElement(element){const withFocusable=element;if(withFocusable.getFocusableElement){return withFocusable.getFocusableElement()}return element}addItem(type,selectorOrElement){assert(type);let element;if(typeof selectorOrElement==="string"){element=this.root.querySelector(selectorOrElement)}else{element=selectorOrElement}if(!element){return false}element.setAttribute("focus-type",type);element.tabIndex=this.isActive()?0:-1;this.eventTracker.add(element,"blur",this.onBlur_.bind(this));this.eventTracker.add(element,"focus",this.onFocus_.bind(this));this.eventTracker.add(element,"keydown",this.onKeydown_.bind(this));this.eventTracker.add(element,"mousedown",this.onMousedown_.bind(this));return true}destroy(){this.eventTracker.removeAll()}getCustomEquivalent(_sampleElement){const focusable=this.getFirstFocusable();assert(focusable);return focusable}getElements(){return Array.from(this.root.querySelectorAll("[focus-type]")).map(FocusRow.getFocusableElement)}getEquivalentElement(sampleElement){if(this.getFocusableElements().indexOf(sampleElement)>=0){return sampleElement}const sampleFocusType=this.getTypeForElement(sampleElement);if(sampleFocusType){const sameType=this.getFirstFocusable(sampleFocusType);if(sameType){return sameType}}return this.getCustomEquivalent(sampleElement)}getFirstFocusable(type){const element=this.getFocusableElements().find((el=>!type||el.getAttribute("focus-type")===type));return element||null}getFocusableElements(){return this.getElements().filter(FocusRow.isFocusable)}getTypeForElement(element){return element.getAttribute("focus-type")||""}isActive(){return this.root.classList.contains(ACTIVE_CLASS)}makeActive(active){if(active===this.isActive()){return}this.getElements().forEach((function(element){element.tabIndex=active?0:-1}));this.root.classList.toggle(ACTIVE_CLASS,active)}onBlur_(e){if(!this.boundary_.contains(e.relatedTarget)){return}const currentTarget=e.currentTarget;if(this.getFocusableElements().indexOf(currentTarget)>=0){this.makeActive(false)}}onFocus_(e){if(this.delegate){this.delegate.onFocus(this,e)}}onMousedown_(e){if(e.button){return}const target=e.currentTarget;if(!target.disabled){target.tabIndex=0}}onKeydown_(e){const elements=this.getFocusableElements();const currentElement=FocusRow.getFocusableElement(e.currentTarget);const elementIndex=elements.indexOf(currentElement);assert(elementIndex>=0);if(this.delegate&&this.delegate.onKeydown(this,e)){return}const isShiftTab=!e.altKey&&!e.ctrlKey&&!e.metaKey&&e.shiftKey&&e.key==="Tab";if(hasKeyModifiers(e)&&!isShiftTab){return}let index=-1;let shouldStopPropagation=true;if(isShiftTab){index=elementIndex-1;if(index<0){return}}else if(e.key==="ArrowLeft"){index=elementIndex+(isRTL()?1:-1)}else if(e.key==="ArrowRight"){index=elementIndex+(isRTL()?-1:1)}else if(e.key==="Home"){index=0}else if(e.key==="End"){index=elements.length-1}else{shouldStopPropagation=false}const elementToFocus=elements[index];if(elementToFocus){this.getEquivalentElement(elementToFocus).focus();e.preventDefault()}if(shouldStopPropagation){e.stopPropagation()}}}class VirtualFocusRow extends FocusRow{constructor(root,delegate){super(root,null,delegate)}getCustomEquivalent(sampleElement){const equivalent=this.delegate?this.delegate.getCustomEquivalent(sampleElement):null;return equivalent||super.getCustomEquivalent(sampleElement)}}let hideInk=false;document.addEventListener("pointerdown",(function(){hideInk=true}),true);document.addEventListener("keydown",(function(){hideInk=false}),true);function focusWithoutInk(toFocus){if(!("noink"in toFocus)||!hideInk){toFocus.focus();return}const toFocusWithNoInk=toFocus;assert(document===toFocusWithNoInk.ownerDocument);const{noink:noink}=toFocusWithNoInk;toFocusWithNoInk.noink=true;toFocusWithNoInk.focus();toFocusWithNoInk.noink=noink}const isMac=/Mac/.test(navigator.platform);const isWindows=/Win/.test(navigator.platform);const isAndroid=/Android/.test(navigator.userAgent);const isIOS=/CriOS/.test(navigator.userAgent);let instance$$=null;function getCss$U(){return instance$$||(instance$$=[...[],css`:host{--cr-hairline:1px solid var(--color-menu-separator,var(--cr-fallback-color-divider));--cr-action-menu-disabled-item-color:var(--color-menu-item-foreground-disabled,var(--cr-fallback-color-disabled-foreground));--cr-action-menu-disabled-item-opacity:1;--cr-menu-background-color:var(--color-menu-background,var(--cr-fallback-color-surface));--cr-menu-background-focus-color:var(--cr-hover-background-color);--cr-menu-shadow:var(--cr-elevation-2);--cr-primary-text-color:var(--color-menu-item-foreground,var(--cr-fallback-color-on-surface))}:host dialog{background-color:var(--cr-menu-background-color);border:none;border-radius:var(--cr-menu-border-radius,4px);box-shadow:var(--cr-menu-shadow);margin:0;min-width:128px;outline:none;overflow:var(--cr-action-menu-overflow,auto);padding:0;position:absolute}@media (forced-colors:active){:host dialog{border:var(--cr-border-hcm)}}:host dialog::backdrop{background-color:transparent}:host ::slotted(.dropdown-item){-webkit-tap-highlight-color:transparent;background:none;border:none;border-radius:0;box-sizing:border-box;color:var(--cr-primary-text-color);font:inherit;min-height:32px;padding:8px 24px;text-align:start;user-select:none;width:100%}:host ::slotted(.dropdown-item:not([hidden])){align-items:center;display:flex}:host ::slotted(.dropdown-item[disabled]){color:var(--cr-action-menu-disabled-item-color,var(--cr-primary-text-color));opacity:var(--cr-action-menu-disabled-item-opacity,0.65)}:host ::slotted(.dropdown-item:not([disabled])){cursor:pointer}:host ::slotted(.dropdown-item:focus){background-color:var(--cr-menu-background-focus-color);outline:none}:host dialog[open] ::slotted(.dropdown-item){user-select:auto}:host ::slotted(.dropdown-item:focus-visible){outline:solid 2px var(--cr-focus-outline-color);outline-offset:-2px}@media (forced-colors:active){:host ::slotted(.dropdown-item:focus){outline:var(--cr-focus-outline-hcm)}}.item-wrapper{outline:none;padding:var(--cr-action-menu-padding,8px 0)}`])}function getHtml$J(){return html` `}function hasFocusoutOutside(e,element){return!element||!element.contains(e.relatedTarget)}var AnchorAlignment;(function(AnchorAlignment){AnchorAlignment[AnchorAlignment["BEFORE_START"]=-2]="BEFORE_START";AnchorAlignment[AnchorAlignment["AFTER_START"]=-1]="AFTER_START";AnchorAlignment[AnchorAlignment["CENTER"]=0]="CENTER";AnchorAlignment[AnchorAlignment["BEFORE_END"]=1]="BEFORE_END";AnchorAlignment[AnchorAlignment["AFTER_END"]=2]="AFTER_END"})(AnchorAlignment||(AnchorAlignment={}));const DROPDOWN_ITEM_CLASS="dropdown-item";const SELECTABLE_DROPDOWN_ITEM_QUERY=`.${DROPDOWN_ITEM_CLASS}:not([hidden]):not([disabled])`;const AFTER_END_OFFSET=10;function getStartPointWithAnchor(start,end,menuLength,anchorAlignment,min,max){let startPoint=0;switch(anchorAlignment){case AnchorAlignment.BEFORE_START:startPoint=start-menuLength;break;case AnchorAlignment.AFTER_START:startPoint=start;break;case AnchorAlignment.CENTER:startPoint=(start+end-menuLength)/2;break;case AnchorAlignment.BEFORE_END:startPoint=end-menuLength;break;case AnchorAlignment.AFTER_END:startPoint=end;break;default:assertNotReachedCase()}if(startPoint+menuLength>max){startPoint=end-menuLength}if(startPointFocusRow.getFocusableElement(option)===focused));if(e.key==="Enter"){if(index!==-1){return}if(isWindows||isMac){this.close();e.preventDefault();return}}e.preventDefault();this.updateFocus_(options,index,e.key!=="ArrowUp");if(!this.hasMousemoveListener_){this.hasMousemoveListener_=true;this.addEventListener("mousemove",(e=>{this.onMouseover_(e);this.hasMousemoveListener_=false}),{once:true})}}onMouseover_(e){const item=e.composedPath().find((el=>el.matches&&el.matches(SELECTABLE_DROPDOWN_ITEM_QUERY)));(item||this.$.wrapper).focus()}updateFocus_(options,focusedIndex,next){const numOptions=options.length;assert(numOptions>0);let index;if(focusedIndex===-1){index=next?0:numOptions-1}else{const delta=next?1:-1;index=(numOptions+focusedIndex+delta)%numOptions}options[index].focus()}close(){if(!this.open){return}this.removeListeners_();this.$.dialog.close();this.open=false;if(this.anchorElement_){assert(this.anchorElement_);focusWithoutInk(this.anchorElement_);this.anchorElement_=null}if(this.lastConfig_){this.lastConfig_=null}}showAt(anchorElement,config){this.anchorElement_=anchorElement;this.anchorElement_.scrollIntoViewIfNeeded();const rect=this.anchorElement_.getBoundingClientRect();let height=rect.height;if(config&&!config.noOffset&&config.anchorAlignmentY===AnchorAlignment.AFTER_END){height-=AFTER_END_OFFSET}this.showAtPosition(Object.assign({top:rect.top,left:rect.left,height:height,width:rect.width,anchorAlignmentX:AnchorAlignment.BEFORE_END},config));this.$.wrapper.focus()}showAtPosition(config){const doc=document.scrollingElement;const scrollLeft=doc.scrollLeft;const scrollTop=doc.scrollTop;this.resetStyle_();this.nonModal?this.$.dialog.show():this.$.dialog.showModal();this.open=true;config.top+=scrollTop;config.left+=scrollLeft;this.positionDialog_(Object.assign({minX:scrollLeft,minY:scrollTop,maxX:scrollLeft+doc.clientWidth,maxY:scrollTop+doc.clientHeight},config));doc.scrollTop=scrollTop;doc.scrollLeft=scrollLeft;this.addListeners_();const openedByKey=FocusOutlineManager.forDocument(document).visible;if(openedByKey){requestAnimationFrame((()=>{if(!this.open){return}const selectableItems=Array.from(this.querySelectorAll(SELECTABLE_DROPDOWN_ITEM_QUERY));const focusedElement=getDeepActiveElement();const hasFocusedItem=selectableItems.some((item=>FocusRow.getFocusableElement(item)===focusedElement));if(!hasFocusedItem){selectableItems[0]?.focus()}}))}}resetStyle_(){this.$.dialog.style.left="";this.$.dialog.style.right="";this.$.dialog.style.top="0"}positionDialog_(config){this.lastConfig_=config;const c=Object.assign(getDefaultShowConfig(),config);const top=c.top;const left=c.left;const bottom=top+c.height;const right=left+c.width;const rtl=getComputedStyle(this).direction==="rtl";if(rtl){c.anchorAlignmentX*=-1}const offsetWidth=this.$.dialog.offsetWidth;const menuLeft=getStartPointWithAnchor(left,right,offsetWidth,c.anchorAlignmentX,c.minX,c.maxX);if(rtl){const menuRight=document.scrollingElement.clientWidth-menuLeft-offsetWidth;this.$.dialog.style.right=menuRight+"px"}else{this.$.dialog.style.left=menuLeft+"px"}const menuTop=getStartPointWithAnchor(top,bottom,this.$.dialog.offsetHeight,c.anchorAlignmentY,c.minY,c.maxY);this.$.dialog.style.top=menuTop+"px"}onSlotchange_(){for(const node of this.$.contentNode.assignedElements({flatten:true})){if(node.classList.contains(DROPDOWN_ITEM_CLASS)&&!node.getAttribute("role")){node.setAttribute("role","menuitem")}}}addListeners_(){this.boundClose_=this.boundClose_||(()=>{if(this.$.dialog.open){this.close()}});window.addEventListener("resize",this.boundClose_);window.addEventListener("popstate",this.boundClose_);if(this.autoReposition){this.resizeObserver_=new ResizeObserver((()=>{if(this.lastConfig_){this.positionDialog_(this.lastConfig_);this.fire("cr-action-menu-repositioned")}}));this.resizeObserver_.observe(this.$.dialog)}}}customElements.define(CrActionMenuElement.is,CrActionMenuElement);let instance$_=null;function getCss$T(){return instance$_||(instance$_=[...[],css`[hidden],:host([hidden]){display:none !important}`])}let instance$Z=null;function getCss$S(){return instance$Z||(instance$Z=[...[getCss$T()],css`:host{align-items:center;display:inline-flex;justify-content:center;position:relative;vertical-align:middle;fill:var(--iron-icon-fill-color,currentcolor);stroke:var(--iron-icon-stroke-color,none);width:var(--iron-icon-width,24px);height:var(--iron-icon-height,24px)}:host-context([webui-refresh-2026]){&:host(:focus){border-radius:2px;outline:solid 2px var(--cr-focus-outline-color)}}`])}let iconsetMap=null;class IconsetMap extends EventTarget{iconsets_=new Map;static getInstance(){return iconsetMap||(iconsetMap=new IconsetMap)}static resetInstanceForTesting(instance){iconsetMap=instance}get(id){return this.iconsets_.get(id)||null}set(id,iconset){assert(!this.iconsets_.has(id),`Tried to add a second iconset with id '${id}'`);this.iconsets_.set(id,iconset);this.dispatchEvent(new CustomEvent("cr-iconset-added",{detail:id}))}}class CrIconElement extends CrLitElement{static get is(){return"cr-icon"}static get styles(){return getCss$S()}static get properties(){return{icon:{type:String}}}#icon_accessor_storage="";get icon(){return this.#icon_accessor_storage}set icon(value){this.#icon_accessor_storage=value}iconsetName_="";iconName_="";iconset_=null;updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("icon")){const[iconsetName,iconName]=this.icon.split(":");this.iconName_=iconName||"";this.iconsetName_=iconsetName||"";this.updateIcon_()}}updateIcon_(){if(this.iconName_===""&&this.iconset_){this.iconset_.removeIcon(this)}else if(this.iconsetName_){const iconsetMap=IconsetMap.getInstance();this.iconset_=iconsetMap.get(this.iconsetName_);assert(this.iconset_,`Could not find iconset for: '${this.iconsetName_}:${this.iconName_}'`);this.iconset_.applyIcon(this,this.iconName_)}}}customElements.define(CrIconElement.is,CrIconElement);let instance$Y=null;function getCss$R(){return instance$Y||(instance$Y=[...[],css`:host{bottom:0;display:block;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transform:translate3d(0,0,0)}.ripple{background-color:currentcolor;left:0;opacity:var(--paper-ripple-opacity,0.25);pointer-events:none;position:absolute;will-change:height,transform,width}.ripple,:host(.circle){border-radius:50%}`])}const MAX_RADIUS_PX=300;const MIN_DURATION_MS=800;function distance(x1,y1,x2,y2){const xDelta=x1-x2;const yDelta=y1-y2;return Math.sqrt(xDelta*xDelta+yDelta*yDelta)}class CrRippleElement extends CrLitElement{static get is(){return"cr-ripple"}static get styles(){return getCss$R()}static get properties(){return{holdDown:{type:Boolean},recenters:{type:Boolean},noink:{type:Boolean}}}#holdDown_accessor_storage=false;get holdDown(){return this.#holdDown_accessor_storage}set holdDown(value){this.#holdDown_accessor_storage=value}#recenters_accessor_storage=false;get recenters(){return this.#recenters_accessor_storage}set recenters(value){this.#recenters_accessor_storage=value}#noink_accessor_storage=false;get noink(){return this.#noink_accessor_storage}set noink(value){this.#noink_accessor_storage=value}ripples_=[];eventTracker_=new EventTracker;connectedCallback(){super.connectedCallback();assert(this.parentNode);const keyEventTarget=this.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?this.parentNode.host:this.parentElement;this.eventTracker_.add(keyEventTarget,"pointerdown",(e=>this.uiDownAction(e)));this.eventTracker_.add(keyEventTarget,"pointerup",(()=>this.uiUpAction()));this.eventTracker_.add(keyEventTarget,"pointerout",(()=>this.uiUpAction()));this.eventTracker_.add(keyEventTarget,"keydown",(e=>{if(e.defaultPrevented){return}if(e.key==="Enter"){this.onEnterKeydown_();return}if(e.key===" "){this.onSpaceKeydown_()}}));this.eventTracker_.add(keyEventTarget,"keyup",(e=>{if(e.defaultPrevented){return}if(e.key===" "){this.onSpaceKeyup_()}}))}disconnectedCallback(){super.disconnectedCallback();this.eventTracker_.removeAll()}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("holdDown")){this.holdDownChanged_(this.holdDown,changedProperties.get("holdDown"))}}uiDownAction(e){if(e!==undefined&&e.button!==0){return}if(!this.noink){this.downAction_(e)}}downAction_(e){if(this.ripples_.length&&this.holdDown){return}this.showRipple_(e)}clear(){this.hideRipple_();this.holdDown=false}showAndHoldDown(){this.ripples_.forEach((ripple=>{ripple.remove()}));this.ripples_=[];this.holdDown=true}showRipple_(e){const rect=this.getBoundingClientRect();const roundedCenterX=function(){return Math.round(rect.width/2)};const roundedCenterY=function(){return Math.round(rect.height/2)};let x=0;let y=0;const centered=!e;if(centered){x=roundedCenterX();y=roundedCenterY()}else{x=Math.round(e.clientX-rect.left);y=Math.round(e.clientY-rect.top)}const corners=[{x:0,y:0},{x:rect.width,y:0},{x:0,y:rect.height},{x:rect.width,y:rect.height}];const cornerDistances=corners.map((function(corner){return Math.round(distance(x,y,corner.x,corner.y))}));const radius=Math.min(MAX_RADIUS_PX,Math.max.apply(Math,cornerDistances));const startTranslate=`${x-radius}px, ${y-radius}px`;let endTranslate=startTranslate;if(this.recenters&&!centered){endTranslate=`${roundedCenterX()-radius}px, ${roundedCenterY()-radius}px`}const ripple=document.createElement("div");ripple.classList.add("ripple");ripple.style.height=ripple.style.width=2*radius+"px";this.ripples_.push(ripple);this.shadowRoot.appendChild(ripple);ripple.animate({transform:[`translate(${startTranslate}) scale(0)`,`translate(${endTranslate}) scale(1)`]},{duration:Math.max(MIN_DURATION_MS,Math.log(radius)*radius)||0,easing:"cubic-bezier(.2, .9, .1, .9)",fill:"forwards"})}uiUpAction(){if(!this.noink){this.upAction_()}}upAction_(){if(!this.holdDown){this.hideRipple_()}}hideRipple_(){if(this.ripples_.length===0){return}this.ripples_.forEach((function(ripple){const opacity=ripple.computedStyleMap().get("opacity")??null;if(opacity===null){ripple.remove();return}const animation=ripple.animate({opacity:[opacity.value,0]},{duration:150,fill:"forwards"});animation.finished.then((()=>{ripple.remove()}))}));this.ripples_=[]}onEnterKeydown_(){this.uiDownAction();window.setTimeout((()=>{this.uiUpAction()}),1)}onSpaceKeydown_(){this.uiDownAction()}onSpaceKeyup_(){this.uiUpAction()}holdDownChanged_(newHoldDown,oldHoldDown){if(oldHoldDown===undefined){return}if(newHoldDown){this.downAction_()}else{this.upAction_()}}}customElements.define(CrRippleElement.is,CrRippleElement);const CrRippleMixin=superClass=>{class CrRippleMixin extends superClass{static get properties(){return{noink:{type:Boolean}}}#noink_accessor_storage=false;get noink(){return this.#noink_accessor_storage}set noink(value){this.#noink_accessor_storage=value}rippleContainer=null;ripple_=null;updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("noink")&&this.hasRipple()){assert(this.ripple_);this.ripple_.noink=this.noink}}ensureRippleOnPointerdown(){this.addEventListener("pointerdown",(()=>this.ensureRipple()),{capture:true})}ensureRipple(){if(this.hasRipple()){return}this.ripple_=this.createRipple();this.ripple_.noink=this.noink;const rippleContainer=this.rippleContainer||this.shadowRoot;assert(rippleContainer);rippleContainer.appendChild(this.ripple_)}getRipple(){this.ensureRipple();assert(this.ripple_);return this.ripple_}hasRipple(){return Boolean(this.ripple_)}createRipple(){const ripple=document.createElement("cr-ripple");ripple.id="ink";return ripple}}return CrRippleMixin};let instance$X=null;function getCss$Q(){return instance$X||(instance$X=[...[],css`:host{--cr-icon-button-fill-color:currentColor;--cr-icon-button-icon-start-offset:0;--cr-icon-button-icon-size:20px;--cr-icon-button-size:32px;--cr-icon-button-height:var(--cr-icon-button-size);--cr-icon-button-transition:150ms ease-in-out;--cr-icon-button-width:var(--cr-icon-button-size);-webkit-tap-highlight-color:transparent;border-radius:50%;color:var(--cr-icon-button-stroke-color,var(--cr-icon-button-fill-color));cursor:pointer;display:inline-flex;flex-shrink:0;height:var(--cr-icon-button-height);margin-inline-end:var(--cr-icon-button-margin-end,var(--cr-icon-ripple-margin));margin-inline-start:var(--cr-icon-button-margin-start);outline:none;overflow:hidden;pointer-events:auto;position:relative;user-select:none;vertical-align:middle;width:var(--cr-icon-button-width)}:host(:hover:not([disabled])){background-color:var(--cr-icon-button-hover-background-color,var(--cr-hover-background-color))}:host(:focus-visible:focus){box-shadow:inset 0 0 0 2px var(--cr-icon-button-focus-outline-color,var(--cr-focus-outline-color))}@media (forced-colors:active){:host(:focus-visible:focus){outline:var(--cr-focus-outline-hcm)}}#ink{--paper-ripple-opacity:1;color:var(--cr-icon-button-active-background-color,var(--cr-active-background-color))}:host([disabled]){cursor:initial;opacity:var(--cr-disabled-opacity);pointer-events:none}:host(.no-overlap){--cr-icon-button-margin-end:0;--cr-icon-button-margin-start:0}:host-context([dir=rtl]):host(:not([suppress-rtl-flip]):not([multiple-icons_])){transform:scaleX(-1)}:host-context([dir=rtl]):host(:not([suppress-rtl-flip])[multiple-icons_]) cr-icon{transform:scaleX(-1)}:host(:not([iron-icon])) #maskedImage{-webkit-mask-image:var(--cr-icon-image);-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;-webkit-mask-size:var(--cr-icon-button-icon-size);-webkit-transform:var(--cr-icon-image-transform,none);background-color:var(--cr-icon-button-fill-color);height:100%;transition:background-color var(--cr-icon-button-transition);width:100%}@media (forced-colors:active){:host(:not([iron-icon])) #maskedImage{background-color:ButtonText}}#icon{align-items:center;border-radius:4px;display:flex;height:100%;justify-content:center;padding-inline-start:var(--cr-icon-button-icon-start-offset);pointer-events:none;position:relative;width:100%}cr-icon{--iron-icon-fill-color:var(--cr-icon-button-fill-color);--iron-icon-stroke-color:var(--cr-icon-button-stroke-color,none);--iron-icon-height:var(--cr-icon-button-icon-size);--iron-icon-width:var(--cr-icon-button-icon-size);transition:fill var(--cr-icon-button-transition),stroke var(--cr-icon-button-transition)}@media (prefers-color-scheme:dark){:host{--cr-icon-button-fill-color:var(--google-grey-500)}}`])}function getHtml$I(){return html`
`}const CrIconbuttonElementBase=CrRippleMixin(CrLitElement);class CrIconButtonElement extends CrIconbuttonElementBase{static get is(){return"cr-icon-button"}static get styles(){return getCss$Q()}render(){return getHtml$I.bind(this)()}static get properties(){return{disabled:{type:Boolean,reflect:true},ironIcon:{type:String,reflect:true},suppressRtlFlip:{type:Boolean,value:false,reflect:true},multipleIcons_:{type:Boolean,reflect:true}}}#disabled_accessor_storage=false;get disabled(){return this.#disabled_accessor_storage}set disabled(value){this.#disabled_accessor_storage=value}#ironIcon_accessor_storage;get ironIcon(){return this.#ironIcon_accessor_storage}set ironIcon(value){this.#ironIcon_accessor_storage=value}#suppressRtlFlip_accessor_storage=false;get suppressRtlFlip(){return this.#suppressRtlFlip_accessor_storage}set suppressRtlFlip(value){this.#suppressRtlFlip_accessor_storage=value}#multipleIcons__accessor_storage=false;get multipleIcons_(){return this.#multipleIcons__accessor_storage}set multipleIcons_(value){this.#multipleIcons__accessor_storage=value}spaceKeyDown_=false;constructor(){super();this.addEventListener("blur",this.onBlur_.bind(this));this.addEventListener("click",this.onClick_.bind(this));this.addEventListener("keydown",this.onKeyDown_.bind(this));this.addEventListener("keyup",this.onKeyUp_.bind(this));this.ensureRippleOnPointerdown()}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("ironIcon")){const icons=(this.ironIcon||"").split(",");this.multipleIcons_=icons.length>1}}firstUpdated(){if(!this.hasAttribute("role")){this.setAttribute("role","button")}if(!this.hasAttribute("tabindex")){this.setAttribute("tabindex","0")}}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("disabled")){this.setAttribute("aria-disabled",this.disabled?"true":"false");this.disabledChanged_(this.disabled,changedProperties.get("disabled"))}if(changedProperties.has("ironIcon")){this.onIronIconChanged_()}}disabledChanged_(newValue,oldValue){if(!newValue&&oldValue===undefined){return}if(this.disabled){this.blur()}this.setAttribute("tabindex",String(this.disabled?-1:0))}onBlur_(){this.spaceKeyDown_=false}onClick_(e){if(this.disabled){e.stopImmediatePropagation()}}onIronIconChanged_(){this.shadowRoot.querySelectorAll("cr-icon").forEach((el=>el.remove()));if(!this.ironIcon){return}const icons=(this.ironIcon||"").split(",");icons.forEach((async icon=>{const crIcon=document.createElement("cr-icon");crIcon.icon=icon;crIcon.setAttribute("part","icon");this.$.icon.appendChild(crIcon);await crIcon.updateComplete;crIcon.shadowRoot.querySelectorAll("svg, img").forEach((child=>child.setAttribute("role","none")))}))}onKeyDown_(e){if(e.key!==" "&&(e.key!=="Enter"||isMac&&e.ctrlKey)){return}e.preventDefault();e.stopPropagation();if(e.repeat){return}if(e.key==="Enter"){this.click()}else if(e.key===" "){this.spaceKeyDown_=true}}onKeyUp_(e){if(e.key===" "||e.key==="Enter"&&!(isMac&&e.ctrlKey)){e.preventDefault();e.stopPropagation()}if(this.spaceKeyDown_&&e.key===" "){this.spaceKeyDown_=false;this.click()}}}customElements.define(CrIconButtonElement.is,CrIconButtonElement);function sanitizeInnerHtmlInternal(rawString,opts){opts=opts||{};const html=parseHtmlSubset(`${rawString}`,opts.tags,opts.attrs).firstElementChild;return html.innerHTML}let sanitizedPolicy=null;function sanitizeInnerHtml(rawString,opts){assert(window.trustedTypes);if(sanitizedPolicy===null){sanitizedPolicy=window.trustedTypes.createPolicy("sanitize-inner-html",{createHTML:sanitizeInnerHtmlInternal,createScript:()=>assertNotReached(),createScriptURL:()=>assertNotReached()})}return sanitizedPolicy.createHTML(rawString,opts)}const allowAttribute=(_node,_value)=>true;const allowedAttributes=new Map([["href",(node,value)=>node.tagName==="A"&&(value.startsWith("chrome://")||value.startsWith("https://")||value==="#")],["target",(node,value)=>node.tagName==="A"&&value==="_blank"]]);const allowedOptionalAttributes=new Map([["class",allowAttribute],["id",allowAttribute],["is",(_node,value)=>value==="action-link"||value===""],["role",(_node,value)=>value==="link"],["src",(node,value)=>node.tagName==="IMG"&&value.startsWith("chrome://")],["tabindex",allowAttribute],["aria-description",allowAttribute],["aria-hidden",allowAttribute],["aria-label",allowAttribute],["aria-labelledby",allowAttribute]]);const allowedTags=new Set(["A","B","I","BR","DIV","EM","KBD","P","PRE","SPAN","STRONG"]);const allowedOptionalTags=new Set(["IMG","LI","UL"]);let unsanitizedPolicy;function mergeTags(optTags){const clone=new Set(allowedTags);optTags.forEach((str=>{const tag=str.toUpperCase();if(allowedOptionalTags.has(tag)){clone.add(tag)}}));return clone}function mergeAttrs(optAttrs){const clone=new Map(allowedAttributes);optAttrs.forEach((key=>{if(allowedOptionalAttributes.has(key)){clone.set(key,allowedOptionalAttributes.get(key))}}));return clone}function walk(n,f){f(n);for(let i=0;iuntrustedHTML,createScript:()=>assertNotReached(),createScriptURL:()=>assertNotReached()})}s=unsanitizedPolicy.createHTML(s)}const df=r.createContextualFragment(s);walk(df,(function(node){switch(node.nodeType){case Node.ELEMENT_NODE:assertElement(tags,node);const nodeAttrs=node.attributes;for(let i=0;i{class I18nMixinLit extends superClass{i18nRaw_(id,...varArgs){return varArgs.length===0?loadTimeData.getString(id):loadTimeData.getStringF(id,...varArgs)}i18n(id,...varArgs){const rawString=this.i18nRaw_(id,...varArgs);return parseHtmlSubset(`${rawString}`).firstChild.textContent}i18nAdvanced(id,opts){opts=opts||{};const rawString=this.i18nRaw_(id,...opts.substitutions||[]);return sanitizeInnerHtml(rawString,opts)}i18nDynamic(_locale,id,...varArgs){return this.i18n(id,...varArgs)}i18nRecursive(locale,id,...varArgs){let args=varArgs;if(args.length>0){args=args.map((str=>this.i18nExists(str)?loadTimeData.getString(str):str))}return this.i18nDynamic(locale,id,...args)}i18nExists(id){return loadTimeData.valueExists(id)}}return I18nMixinLit};let instance$W=null;function getCss$P(){return instance$W||(instance$W=[...[],css`.icon-arrow-back{--cr-icon-image:url(//resources/images/icon_arrow_back_old.svg)}.icon-arrow-dropdown{--cr-icon-image:url(//resources/images/icon_arrow_dropdown_old.svg)}.icon-arrow-drop-down-cr23{--cr-icon-image:url(//resources/images/icon_arrow_drop_down_cr23_old.svg)}.icon-arrow-drop-up-cr23{--cr-icon-image:url(//resources/images/icon_arrow_drop_up_cr23_old.svg)}.icon-arrow-upward{--cr-icon-image:url(//resources/images/icon_arrow_upward_old.svg)}.icon-arrow-forward{--cr-icon-image:url(//resources/images/icon_arrow_forward_old.svg)}.icon-cancel{--cr-icon-image:url(//resources/images/icon_cancel_old.svg)}.icon-clear{--cr-icon-image:url(//resources/images/icon_clear_old.svg)}.icon-copy-content{--cr-icon-image:url(//resources/images/icon_copy_content_old.svg)}.icon-delete-gray{--cr-icon-image:url(//resources/images/icon_delete_gray_old.svg)}.icon-edit{--cr-icon-image:url(//resources/images/icon_edit_old.svg)}.icon-file{--cr-icon-image:url(//resources/images/icon_filetype_generic_old.svg)}.icon-folder-open{--cr-icon-image:url(//resources/images/icon_folder_open_old.svg)}.icon-picture-delete{--cr-icon-image:url(//resources/images/icon_picture_delete_old.svg)}.icon-expand-less{--cr-icon-image:url(//resources/images/icon_expand_less_old.svg)}.icon-expand-more{--cr-icon-image:url(//resources/images/icon_expand_more_old.svg)}.icon-external{--cr-icon-image:url(//resources/images/open_in_new_old.svg)}.icon-more-vert{--cr-icon-image:url(//resources/images/icon_more_vert_old.svg)}.icon-refresh{--cr-icon-image:url(//resources/images/icon_refresh_old.svg)}.icon-search{--cr-icon-image:url(//resources/images/icon_search.svg)}.icon-settings{--cr-icon-image:url(//resources/images/icon_settings_old.svg)}.icon-visibility{--cr-icon-image:url(//resources/images/icon_visibility_old.svg)}.icon-visibility-off{--cr-icon-image:url(//resources/images/icon_visibility_off_old.svg)}.subpage-arrow{--cr-icon-image:url(//resources/images/arrow_right_old.svg)}.cr-icon{-webkit-mask-image:var(--cr-icon-image);-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;-webkit-mask-size:var(--cr-icon-size);background-color:var(--cr-icon-color,var(--google-grey-700));flex-shrink:0;height:var(--cr-icon-ripple-size);margin-inline-end:var(--cr-icon-ripple-margin);margin-inline-start:var(--cr-icon-button-margin-start);user-select:none;width:var(--cr-icon-ripple-size)}:host-context([dir=rtl]) .cr-icon{transform:scaleX(-1)}.cr-icon.no-overlap{margin-inline-end:0;margin-inline-start:0}@media (prefers-color-scheme:dark){.cr-icon{background-color:var(--cr-icon-color,var(--google-grey-500))}}:host-context([webui-rounded-icons]){.icon-arrow-back{--cr-icon-image:url(//resources/images/icon_arrow_back.svg)}.icon-arrow-drop-down-cr23{--cr-icon-image:url(//resources/images/icon_arrow_drop_down_cr23.svg)}.icon-arrow-drop-up-cr23{--cr-icon-image:url(//resources/images/icon_arrow_drop_up_cr23.svg)}.icon-arrow-dropdown{--cr-icon-image:url(//resources/images/icon_arrow_dropdown.svg)}.icon-arrow-forward{--cr-icon-image:url(//resources/images/icon_arrow_forward.svg)}.icon-arrow-upward{--cr-icon-image:url(//resources/images/icon_arrow_upward.svg)}.icon-cancel{--cr-icon-image:url(//resources/images/icon_cancel.svg)}.icon-clear{--cr-icon-image:url(//resources/images/icon_clear.svg)}.icon-copy-content{--cr-icon-image:url(//resources/images/icon_copy_content.svg)}.icon-delete-gray{--cr-icon-image:url(//resources/images/icon_delete_gray.svg)}.icon-edit{--cr-icon-image:url(//resources/images/icon_edit.svg)}.icon-expand-less{--cr-icon-image:url(//resources/images/icon_expand_less.svg)}.icon-expand-more{--cr-icon-image:url(//resources/images/icon_expand_more.svg)}.icon-external{--cr-icon-image:url(//resources/images/open_in_new.svg)}.icon-file{--cr-icon-image:url(//resources/images/icon_filetype_generic.svg)}.icon-folder-open{--cr-icon-image:url(//resources/images/icon_folder_open.svg)}.icon-more-vert{--cr-icon-image:url(//resources/images/icon_more_vert.svg)}.icon-picture-delete{--cr-icon-image:url(//resources/images/icon_picture_delete.svg)}.icon-refresh{--cr-icon-image:url(//resources/images/icon_refresh.svg)}.icon-settings{--cr-icon-image:url(//resources/images/icon_settings.svg)}.icon-visibility{--cr-icon-image:url(//resources/images/icon_visibility.svg)}.icon-visibility-off{--cr-icon-image:url(//resources/images/icon_visibility_off.svg)}.subpage-arrow{--cr-icon-image:url(//resources/images/arrow_right.svg)}}`])}let instance$V=null;function getCss$O(){return instance$V||(instance$V=[...[getCss$T(),getCss$P()],css`[actionable]{cursor:pointer}.hr{border-top:var(--cr-separator-line)}iron-list.cr-separators>*:not([first]){border-top:var(--cr-separator-line)}[scrollable]{border-color:transparent;border-style:solid;border-width:1px 0;overflow-y:auto}[scrollable].is-scrolled{border-top-color:var(--cr-scrollable-border-color)}[scrollable].can-scroll:not(.scrolled-to-bottom){border-bottom-color:var(--cr-scrollable-border-color)}[scrollable] iron-list>:not(.no-outline):focus-visible,[selectable]:focus-visible,[selectable]>:focus-visible{outline:solid 2px var(--cr-focus-outline-color);outline-offset:-2px}.scroll-container{display:flex;flex-direction:column;min-height:1px}[selectable]>*{cursor:pointer}.cr-centered-card-container{box-sizing:border-box;display:block;height:inherit;margin:0 auto;max-width:var(--cr-centered-card-max-width);min-width:550px;position:relative;width:calc(100% * var(--cr-centered-card-width-percentage))}.cr-row{align-items:center;border-top:var(--cr-separator-line);display:flex;min-height:var(--cr-section-min-height);padding:0 var(--cr-section-padding)}.cr-row.first,.cr-row.continuation{border-top:none}.cr-row-gap{padding-inline-start:16px}.cr-button-gap{margin-inline-start:8px}paper-tooltip::part(tooltip),cr-tooltip::part(tooltip){border-radius:var(--paper-tooltip-border-radius,2px);font-size:92.31%;font-weight:500;max-width:330px;min-width:var(--paper-tooltip-min-width,200px);padding:var(--paper-tooltip-padding,10px 8px)}.cr-padded-text{padding-block-end:var(--cr-section-vertical-padding);padding-block-start:var(--cr-section-vertical-padding)}.cr-title-text{color:var(--cr-title-text-color);font-size:107.6923%;font-weight:500}.cr-secondary-text{color:var(--cr-secondary-text-color);font-weight:400}.cr-form-field-label{color:var(--cr-form-field-label-color);display:block;font-size:var(--cr-form-field-label-font-size);font-weight:500;letter-spacing:.4px;line-height:var(--cr-form-field-label-line-height);margin-bottom:8px}.cr-vertical-tab{align-items:center;display:flex}.cr-vertical-tab::before{border-radius:0 3px 3px 0;content:'';display:block;flex-shrink:0;height:var(--cr-vertical-tab-height,100%);width:4px}.cr-vertical-tab.selected::before{background:var(--cr-vertical-tab-selected-color,var(--cr-checked-color))}:host-context([dir=rtl]) .cr-vertical-tab::before{transform:scaleX(-1)}.iph-anchor-highlight{background-color:var(--cr-iph-anchor-highlight-color)}`])}const sheet$1=new CSSStyleSheet;sheet$1.replaceSync(`html{--annotation-background-color:var(--google-green-50);--annotation-text-color:var(--google-green-600);--border-color:var(--google-grey-300);--entity-image-background-color:var(--google-grey-50);--icon-color:var(--google-grey-600);--url-color:var(--google-blue-600);--card-max-width:960px;--card-min-width:550px;--card-padding-between:16px;--card-padding-side:24px;--first-card-padding-top:24px;--cluster-max-width:var(--card-max-width);--cluster-min-width:var(--card-min-width);--cluster-padding-horizontal:var(--card-padding-side);--cluster-padding-vertical:var(--card-padding-between);--favicon-margin:16px;--favicon-size:16px;--first-cluster-padding-top:var(--first-card-padding-top);--pill-height:34px;--pill-padding-icon:12px;--pill-padding-text:16px;--top-visit-favicon-size:24px}@media (prefers-color-scheme:dark){html{--annotation-background-color:var(--google-green-300);--annotation-text-color:var(--google-grey-900);--border-color:var(--google-grey-700);--entity-image-background-color:var(--google-grey-800);--icon-color:white;--url-color:var(--google-blue-300)}}`);document.adoptedStyleSheets=[...document.adoptedStyleSheets,sheet$1];let instance$U=null;function getCss$N(){return instance$U||(instance$U=[...[getCss$O(),getCss$T()],css`.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pill{border:1px solid var(--border-color);border-radius:calc(var(--pill-height) / 2);box-sizing:border-box;font-size:0.75rem;height:var(--pill-height);line-height:1.5}.pill-icon-start{padding-inline-end:var(--pill-padding-text);padding-inline-start:var(--pill-padding-icon)}.pill-icon-start .icon{margin-inline-end:4px}.pill-icon-end{padding-inline-end:var(--pill-padding-icon);padding-inline-start:var(--pill-padding-text)}.pill-icon-end .icon{margin-inline-start:8px}.search-highlight-hit{--search-highlight-hit-background-color:none;--search-highlight-hit-color:none;font-weight:700}.timestamp-and-menu{align-items:center;display:flex;flex-shrink:0}.timestamp{color:var(--cr-secondary-text-color);flex-shrink:0}`])}let instance$T=null;function getCss$M(){return instance$T||(instance$T=[...[getCss$N()],css`#actionMenuButton{--cr-icon-button-icon-size:20px;--cr-icon-button-margin-end:16px}:host([in-side-panel_]) #actionMenuButton{--cr-icon-button-icon-size:16px;--cr-icon-button-size:24px;--cr-icon-button-margin-end:8px}`])}function getHtml$H(){return html` ${this.renderActionMenu_?html` `:""}`}const ClusterMenuElementBase$1=I18nMixinLit(CrLitElement);class ClusterMenuElement extends ClusterMenuElementBase$1{static get is(){return"cluster-menu"}static get styles(){return getCss$M()}render(){return getHtml$H.bind(this)()}static get properties(){return{allowDeletingHistory_:{type:Boolean},inSidePanel_:{type:Boolean,reflect:true},renderActionMenu_:{type:Boolean}}}#allowDeletingHistory__accessor_storage=loadTimeData.getBoolean("allowDeletingHistory");get allowDeletingHistory_(){return this.#allowDeletingHistory__accessor_storage}set allowDeletingHistory_(value){this.#allowDeletingHistory__accessor_storage=value}#inSidePanel__accessor_storage=loadTimeData.getBoolean("inSidePanel");get inSidePanel_(){return this.#inSidePanel__accessor_storage}set inSidePanel_(value){this.#inSidePanel__accessor_storage=value}#renderActionMenu__accessor_storage=false;get renderActionMenu_(){return this.#renderActionMenu__accessor_storage}set renderActionMenu_(value){this.#renderActionMenu__accessor_storage=value}async onActionMenuButtonClick_(event){event.preventDefault();if(!this.renderActionMenu_){this.renderActionMenu_=true;await this.updateComplete}const menu=this.shadowRoot.querySelector("cr-action-menu");assert(menu);menu.showAt(this.$.actionMenuButton)}onOpenAllButtonClick_(event){event.preventDefault();this.fire("open-all-visits");this.closeActionMenu_()}onHideAllButtonClick_(event){event.preventDefault();this.fire("hide-all-visits");this.closeActionMenu_()}onRemoveAllButtonClick_(event){event.preventDefault();this.fire("remove-all-visits");this.closeActionMenu_()}closeActionMenu_(){const menu=this.shadowRoot.querySelector("cr-action-menu");assert(menu);menu.close()}}customElements.define(ClusterMenuElement.is,ClusterMenuElement);let instance$S=null;function getCss$L(){return instance$S||(instance$S=[...[],css`:host{display:none}`])}function getHtml$G(){return html` `}const APPLIED_ICON_CLASS="cr-iconset-svg-icon_";class CrIconsetElement extends CrLitElement{static get is(){return"cr-iconset"}static get styles(){return getCss$L()}render(){return getHtml$G.bind(this)()}static get properties(){return{name:{type:String},size:{type:Number}}}#name_accessor_storage="";get name(){return this.#name_accessor_storage}set name(value){this.#name_accessor_storage=value}#size_accessor_storage=24;get size(){return this.#size_accessor_storage}set size(value){this.#size_accessor_storage=value}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("name")){assert(changedProperties.get("name")===undefined);IconsetMap.getInstance().set(this.name,this)}}applyIcon(element,iconName){this.removeIcon(element);const svg=this.cloneIcon_(iconName);if(svg){svg.classList.add(APPLIED_ICON_CLASS);element.shadowRoot.insertBefore(svg,element.shadowRoot.childNodes[0]);return svg}return null}createIcon(iconName){return this.cloneIcon_(iconName)}removeIcon(element){const oldSvg=element.shadowRoot.querySelector(`.${APPLIED_ICON_CLASS}`);if(oldSvg){oldSvg.remove()}}cloneIcon_(id){const sourceSvg=this.querySelector(`g[id="${id}"]`);if(!sourceSvg){return null}const svgClone=this.$.baseSvg.cloneNode(true);const content=sourceSvg.cloneNode(true);content.removeAttribute("id");const contentViewBox=content.getAttribute("viewBox");if(contentViewBox){svgClone.setAttribute("viewBox",contentViewBox)}svgClone.style.display="block";svgClone.style.height="100%";svgClone.style.width="100%";svgClone.style.pointerEvents="none";svgClone.appendChild(content);return svgClone}}customElements.define(CrIconsetElement.is,CrIconsetElement);function isValidArray(arr){if(arr instanceof Array&&Object.isFrozen(arr)){return true}return false}function getStaticString(literal){const isStaticString=isValidArray(literal)&&!!literal.raw&&isValidArray(literal.raw)&&literal.length===literal.raw.length&&literal.length===1;assert(isStaticString,"static_types.js only allows static strings");return literal.join("")}function createTypes(_ignore,literal){return getStaticString(literal)}const rules={createHTML:createTypes,createScript:createTypes,createScriptURL:createTypes};let staticPolicy;if(window.trustedTypes){staticPolicy=window.trustedTypes.createPolicy("static-types",rules)}else{staticPolicy=rules}function getTrustedHTML(literal){return staticPolicy.createHTML("",literal)}const div$3=document.createElement("div");if(document.documentElement.hasAttribute("webui-rounded-icons")){div$3.innerHTML=getTrustedHTML` `}else{div$3.innerHTML=getTrustedHTML` `}const iconsets$3=div$3.querySelectorAll("cr-iconset");for(const iconset of iconsets$3){document.head.appendChild(iconset)}let instance$R=null;function getCss$K(){return instance$R||(instance$R=[...[getCss$N()],css`:host{--cr-icon-button-margin-start:0px;--gradient-start:64px;--horizontal-carousel-button-center:calc(var(--horizontal-carousel-button-size) / 2 + var(--horizontal-carousel-button-margin));--horizontal-carousel-button-margin:14px;--horizontal-carousel-button-size:28px;display:flex;isolation:isolate;position:relative}.carousel-button,.hover-layer{border-radius:50%;display:none;position:absolute;top:50%;transform:translateY(-50%)}.carousel-button{--cr-icon-button-size:var(--horizontal-carousel-button-size);background-color:var(--color-button-background-tonal);margin:0;z-index:1}:host(:hover) .carousel-button{display:block}.hover-layer{background:var(--cr-hover-background-color);height:var(--horizontal-carousel-button-size);width:var(--horizontal-carousel-button-size);pointer-events:none;z-index:2}#backButton,#backHoverLayer{left:var(--horizontal-carousel-button-margin)}#forwardButton,#forwardHoverLayer{right:var(--horizontal-carousel-button-margin)}#backButton:hover~#backHoverLayer,#forwardButton:hover~#forwardHoverLayer{display:block}:host([show-back-button_]:hover) #carouselContainer{-webkit-mask-image:linear-gradient(to right,transparent var(--horizontal-carousel-button-center),black var(--gradient-start))}:host([show-forward-button_]:hover) #carouselContainer{-webkit-mask-image:linear-gradient(to right,black calc(100% - var(--gradient-start)),transparent calc(100% - var(--horizontal-carousel-button-center)))}:host([show-back-button_][show-forward-button_]:hover) #carouselContainer{-webkit-mask-image:linear-gradient(to right,transparent var(--horizontal-carousel-button-center),black var(--gradient-start),black calc(100% - var(--gradient-start)),transparent calc(100% - var(--horizontal-carousel-button-center)))}#carouselContainer{display:flex;flex-wrap:nowrap;min-width:0;padding:2px;overflow-x:hidden}`])}function getHtml$F(){return html`
`}class HorizontalCarouselElement extends CrLitElement{static get is(){return"horizontal-carousel"}static get styles(){return getCss$K()}render(){return getHtml$F.bind(this)()}static get properties(){return{showForwardButton_:{type:Boolean,reflect:true},showBackButton_:{type:Boolean,reflect:true}}}resizeObserver_=null;eventTracker_=new EventTracker;#showBackButton__accessor_storage=false;get showBackButton_(){return this.#showBackButton__accessor_storage}set showBackButton_(value){this.#showBackButton__accessor_storage=value}#showForwardButton__accessor_storage=false;get showForwardButton_(){return this.#showForwardButton__accessor_storage}set showForwardButton_(value){this.#showForwardButton__accessor_storage=value}connectedCallback(){super.connectedCallback();this.resizeObserver_=new ResizeObserver((()=>{this.setShowCarouselButtons_()}));this.resizeObserver_.observe(this.$.carouselContainer);this.eventTracker_.add(this,"keyup",this.onTabFocus_.bind(this))}disconnectedCallback(){super.disconnectedCallback();if(this.resizeObserver_){this.resizeObserver_.unobserve(this.$.carouselContainer);this.resizeObserver_=null}}onCarouselBackClick_(){const targetPosition=this.calculateTargetPosition_(-1);this.$.carouselContainer.scrollTo({left:targetPosition,behavior:"smooth"});this.showBackButton_=targetPosition>0;this.showForwardButton_=true}onCarouselForwardClick_(){const targetPosition=this.calculateTargetPosition_(1);this.$.carouselContainer.scrollTo({left:targetPosition,behavior:"smooth"});this.showForwardButton_=targetPosition+this.$.carouselContainer.clientWidth0;this.showForwardButton_=false}}calculateTargetPosition_(direction){const offset=this.$.carouselContainer.clientWidth/2*direction;const targetPosition=Math.floor(this.$.carouselContainer.scrollLeft+offset);return Math.max(0,Math.min(targetPosition,this.$.carouselContainer.scrollWidth-this.$.carouselContainer.clientWidth))}}customElements.define(HorizontalCarouselElement.is,HorizontalCarouselElement);class MojoBrowserProxyFactory{handlerRemoteCtor_;callbackRouterCtor_;bindFn_;instance_=null;constructor(handlerRemoteCtor_,callbackRouterCtor_,bindFn_){this.handlerRemoteCtor_=handlerRemoteCtor_;this.callbackRouterCtor_=callbackRouterCtor_;this.bindFn_=bindFn_}getInstance(){if(!this.instance_){const handler=new this.handlerRemoteCtor_;const callbackRouter=new this.callbackRouterCtor_;this.bindFn_(callbackRouter.$.bindNewPipeAndPassRemote(),handler.$.bindNewPipeAndPassReceiver());this.instance_={handler:handler,callbackRouter:callbackRouter}}return this.instance_}setInstance(proxy){this.instance_=proxy}createForTest(handler){const callbackRouter=new this.callbackRouterCtor_;return{instance:{handler:handler,callbackRouter:callbackRouter},remote:callbackRouter.$.bindNewPipeAndPassRemote()}}}class MojoHandlerProxyFactory{handlerRemoteCtor_;bindFn_;instance_=null;constructor(handlerRemoteCtor_,bindFn_){this.handlerRemoteCtor_=handlerRemoteCtor_;this.bindFn_=bindFn_}getInstance(){if(!this.instance_){const handler=new this.handlerRemoteCtor_;this.bindFn_(handler.$.bindNewPipeAndPassReceiver());this.instance_={handler:handler}}return this.instance_}setInstance(proxy){this.instance_=proxy}}class JSTimeDataView{decoder_;version_;fieldSpecs_;constructor(decoder,version,fieldSpecs){this.decoder_=decoder;this.version_=version;this.fieldSpecs_=fieldSpecs}get msec(){const field=this.fieldSpecs_[0];return mojo.internal.decodeStructField(this.decoder_,field,this.version_)}}class JsTimeConverter{msec(date){return date.valueOf()}convert(view){return new Date(view.msec)}}const TimeSpec={$:{}};const JSTimeSpec={$:{}};const TimeDeltaSpec={$:{}};const TimeTicksSpec={$:{}};mojo.internal.Struct(TimeSpec.$,"Time",[mojo.internal.StructField("internalValue",0,0,mojo.internal.Int64,BigInt(0),false,0,undefined,undefined)],[[0,16]]);const converterForJSTime=new JsTimeConverter;mojo.internal.TypemappedStruct(JSTimeSpec.$,"JSTime",JSTimeDataView,converterForJSTime,[mojo.internal.StructField("msec",0,0,mojo.internal.Double,0,false,0,undefined,(value=>converterForJSTime.msec(value)))],[[0,16]]);mojo.internal.Struct(TimeDeltaSpec.$,"TimeDelta",[mojo.internal.StructField("microseconds",0,0,mojo.internal.Int64,BigInt(0),false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TimeTicksSpec.$,"TimeTicks",[mojo.internal.StructField("internalValue",0,0,mojo.internal.Int64,BigInt(0),false,0,undefined,undefined)],[[0,16]]);class UrlDataView{decoder_;version_;fieldSpecs_;constructor(decoder,version,fieldSpecs){this.decoder_=decoder;this.version_=version;this.fieldSpecs_=fieldSpecs}get url(){const field=this.fieldSpecs_[0];return mojo.internal.decodeStructField(this.decoder_,field,this.version_)}}class UrlConverter{url(url){return url}convert(view){return view.url}}const UrlSpec={$:{}};const converterForUrl=new UrlConverter;mojo.internal.TypemappedStruct(UrlSpec.$,"Url",UrlDataView,converterForUrl,[mojo.internal.StructField("url",0,0,mojo.internal.String,null,false,0,undefined,(value=>converterForUrl.url(value)))],[[0,16]]);const AnnotationSpec={$:mojo.internal.Enum()};var Annotation;(function(Annotation){Annotation[Annotation["MIN_VALUE"]=0]="MIN_VALUE";Annotation[Annotation["MAX_VALUE"]=1]="MAX_VALUE";Annotation[Annotation["kBookmarked"]=0]="kBookmarked";Annotation[Annotation["kSearchResultsPage"]=1]="kSearchResultsPage"})(Annotation||(Annotation={}));({$:mojo.internal.Enum()});var InteractionState;(function(InteractionState){InteractionState[InteractionState["MIN_VALUE"]=0]="MIN_VALUE";InteractionState[InteractionState["MAX_VALUE"]=2]="MAX_VALUE";InteractionState[InteractionState["kDefault"]=0]="kDefault";InteractionState[InteractionState["kHidden"]=1]="kHidden";InteractionState[InteractionState["kDone"]=2]="kDone"})(InteractionState||(InteractionState={}));const MatchPositionSpec={$:{}};const SearchQuerySpec$1={$:{}};const RawVisitDataSpec={$:{}};const URLVisitSpec={$:{}};const ClusterSpec={$:{}};mojo.internal.Struct(MatchPositionSpec.$,"MatchPosition",[mojo.internal.StructField("begin",0,0,mojo.internal.Uint32,0,false,0,undefined,undefined),mojo.internal.StructField("end",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(SearchQuerySpec$1.$,"SearchQuery",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("url",8,0,UrlSpec.$,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(RawVisitDataSpec.$,"RawVisitData",[mojo.internal.StructField("url",0,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("visitTime",8,0,TimeSpec.$,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(URLVisitSpec.$,"URLVisit",[mojo.internal.StructField("visitId",0,0,mojo.internal.Int64,BigInt(0),false,0,undefined,undefined),mojo.internal.StructField("normalizedUrl",8,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("urlForDisplay",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("pageTitle",24,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("titleMatchPositions",32,0,mojo.internal.Array(MatchPositionSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("urlForDisplayMatchPositions",40,0,mojo.internal.Array(MatchPositionSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("rawVisitData",48,0,RawVisitDataSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("duplicates",56,0,mojo.internal.Array(RawVisitDataSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("relativeDate",64,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("annotations",72,0,mojo.internal.Array(AnnotationSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("isKnownToSync",80,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("debugInfo",88,0,mojo.internal.Map(mojo.internal.String,mojo.internal.String,false),null,false,0,undefined,undefined),mojo.internal.StructField("hasUrlKeyedImage",80,1,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,104]]);mojo.internal.Struct(ClusterSpec.$,"Cluster",[mojo.internal.StructField("id",0,0,mojo.internal.Int64,BigInt(0),false,0,undefined,undefined),mojo.internal.StructField("visits",8,0,mojo.internal.Array(URLVisitSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("label",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("tabGroupName",24,0,mojo.internal.String,null,true,0,undefined,undefined),mojo.internal.StructField("labelMatchPositions",32,0,mojo.internal.Array(MatchPositionSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("relatedSearches",40,0,mojo.internal.Array(SearchQuerySpec$1.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("imageUrl",48,0,UrlSpec.$,null,true,0,undefined,undefined),mojo.internal.StructField("fromPersistence",56,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("debugInfo",64,0,mojo.internal.String,null,true,0,undefined,undefined)],[[0,80]]);({$:mojo.internal.Enum()});var WindowOpenDisposition;(function(WindowOpenDisposition){WindowOpenDisposition[WindowOpenDisposition["MIN_VALUE"]=0]="MIN_VALUE";WindowOpenDisposition[WindowOpenDisposition["MAX_VALUE"]=12]="MAX_VALUE";WindowOpenDisposition[WindowOpenDisposition["UNKNOWN"]=0]="UNKNOWN";WindowOpenDisposition[WindowOpenDisposition["CURRENT_TAB"]=1]="CURRENT_TAB";WindowOpenDisposition[WindowOpenDisposition["SINGLETON_TAB"]=2]="SINGLETON_TAB";WindowOpenDisposition[WindowOpenDisposition["NEW_FOREGROUND_TAB"]=3]="NEW_FOREGROUND_TAB";WindowOpenDisposition[WindowOpenDisposition["NEW_BACKGROUND_TAB"]=4]="NEW_BACKGROUND_TAB";WindowOpenDisposition[WindowOpenDisposition["NEW_POPUP"]=5]="NEW_POPUP";WindowOpenDisposition[WindowOpenDisposition["NEW_WINDOW"]=6]="NEW_WINDOW";WindowOpenDisposition[WindowOpenDisposition["SAVE_TO_DISK"]=7]="SAVE_TO_DISK";WindowOpenDisposition[WindowOpenDisposition["OFF_THE_RECORD"]=8]="OFF_THE_RECORD";WindowOpenDisposition[WindowOpenDisposition["IGNORE_ACTION"]=9]="IGNORE_ACTION";WindowOpenDisposition[WindowOpenDisposition["SWITCH_TO_TAB"]=10]="SWITCH_TO_TAB";WindowOpenDisposition[WindowOpenDisposition["NEW_PICTURE_IN_PICTURE"]=11]="NEW_PICTURE_IN_PICTURE";WindowOpenDisposition[WindowOpenDisposition["NEW_SPLIT_VIEW"]=12]="NEW_SPLIT_VIEW"})(WindowOpenDisposition||(WindowOpenDisposition={}));const ClickModifiersSpec={$:{}};mojo.internal.Struct(ClickModifiersSpec.$,"ClickModifiers",[mojo.internal.StructField("middleButton",0,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("altKey",0,1,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("ctrlKey",0,2,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("metaKey",0,3,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("shiftKey",0,4,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);const PointSpec={$:{}};const PointFSpec={$:{}};const Point3FSpec={$:{}};const SizeSpec={$:{}};const SizeFSpec={$:{}};const RectSpec={$:{}};const RectFSpec={$:{}};const InsetsSpec={$:{}};const InsetsFSpec={$:{}};const Vector2dSpec={$:{}};const Vector2dFSpec={$:{}};const Vector3dFSpec={$:{}};const QuaternionSpec={$:{}};const QuadFSpec={$:{}};const AxisTransform2dSpec={$:{}};mojo.internal.Struct(PointSpec.$,"Point",[mojo.internal.StructField("x",0,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PointFSpec.$,"PointF",[mojo.internal.StructField("x",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Point3FSpec.$,"Point3F",[mojo.internal.StructField("x",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("z",8,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(SizeSpec.$,"Size",[mojo.internal.StructField("width",0,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("height",4,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(SizeFSpec.$,"SizeF",[mojo.internal.StructField("width",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("height",4,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(RectSpec.$,"Rect",[mojo.internal.StructField("x",0,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("width",8,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("height",12,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(RectFSpec.$,"RectF",[mojo.internal.StructField("x",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("width",8,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("height",12,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(InsetsSpec.$,"Insets",[mojo.internal.StructField("top",0,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("left",4,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("bottom",8,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("right",12,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(InsetsFSpec.$,"InsetsF",[mojo.internal.StructField("top",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("left",4,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("bottom",8,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("right",12,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(Vector2dSpec.$,"Vector2d",[mojo.internal.StructField("x",0,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Vector2dFSpec.$,"Vector2dF",[mojo.internal.StructField("x",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Vector3dFSpec.$,"Vector3dF",[mojo.internal.StructField("x",0,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("y",4,0,mojo.internal.Float,0,false,0,undefined,undefined),mojo.internal.StructField("z",8,0,mojo.internal.Float,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(QuaternionSpec.$,"Quaternion",[mojo.internal.StructField("x",0,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("y",8,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("z",16,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("w",24,0,mojo.internal.Double,0,false,0,undefined,undefined)],[[0,40]]);mojo.internal.Struct(QuadFSpec.$,"QuadF",[mojo.internal.StructField("p1",0,0,PointFSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("p2",8,0,PointFSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("p3",16,0,PointFSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("p4",24,0,PointFSpec.$,null,false,0,undefined,undefined)],[[0,40]]);mojo.internal.Struct(AxisTransform2dSpec.$,"AxisTransform2d",[mojo.internal.StructField("scale",0,0,Vector2dFSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("translation",8,0,Vector2dFSpec.$,null,false,0,undefined,undefined)],[[0,24]]);const ClusterActionSpec={$:mojo.internal.Enum()};var ClusterAction;(function(ClusterAction){ClusterAction[ClusterAction["MIN_VALUE"]=0]="MIN_VALUE";ClusterAction[ClusterAction["MAX_VALUE"]=3]="MAX_VALUE";ClusterAction[ClusterAction["kDeleted"]=0]="kDeleted";ClusterAction[ClusterAction["kOpenedInTabGroup"]=1]="kOpenedInTabGroup";ClusterAction[ClusterAction["kRelatedSearchClicked"]=2]="kRelatedSearchClicked";ClusterAction[ClusterAction["kVisitClicked"]=3]="kVisitClicked"})(ClusterAction||(ClusterAction={}));const RelatedSearchActionSpec={$:mojo.internal.Enum()};var RelatedSearchAction;(function(RelatedSearchAction){RelatedSearchAction[RelatedSearchAction["MIN_VALUE"]=0]="MIN_VALUE";RelatedSearchAction[RelatedSearchAction["MAX_VALUE"]=0]="MAX_VALUE";RelatedSearchAction[RelatedSearchAction["kClicked"]=0]="kClicked"})(RelatedSearchAction||(RelatedSearchAction={}));const VisitActionSpec={$:mojo.internal.Enum()};var VisitAction;(function(VisitAction){VisitAction[VisitAction["MIN_VALUE"]=0]="MIN_VALUE";VisitAction[VisitAction["MAX_VALUE"]=2]="MAX_VALUE";VisitAction[VisitAction["kClicked"]=0]="kClicked";VisitAction[VisitAction["kHidden"]=1]="kHidden";VisitAction[VisitAction["kDeleted"]=2]="kDeleted"})(VisitAction||(VisitAction={}));const VisitTypeSpec={$:mojo.internal.Enum()};var VisitType;(function(VisitType){VisitType[VisitType["MIN_VALUE"]=0]="MIN_VALUE";VisitType[VisitType["MAX_VALUE"]=1]="MAX_VALUE";VisitType[VisitType["kSRP"]=0]="kSRP";VisitType[VisitType["kNonSRP"]=1]="kNonSRP"})(VisitType||(VisitType={}));let PageHandlerPendingReceiver$3=class PageHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_clusters.mojom.PageHandler",scope)}};let PageHandlerRemote$3=class PageHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver$3,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}openHistoryUrl(url,clickModifiers){this.proxy.sendMessage(702264332,PageHandler_OpenHistoryUrl_ParamsSpec.$,null,[url,clickModifiers],false)}showContextMenuForSearchbox(query,point){this.proxy.sendMessage(1161298583,PageHandler_ShowContextMenuForSearchbox_ParamsSpec.$,null,[query,point],false)}showContextMenuForURL(url,point){this.proxy.sendMessage(1975031121,PageHandler_ShowContextMenuForURL_ParamsSpec.$,null,[url,point],false)}showSidePanelUI(){this.proxy.sendMessage(625367745,PageHandler_ShowSidePanelUI_ParamsSpec$1.$,null,[],false)}toggleVisibility(visible){return this.proxy.sendMessage(16341499,PageHandler_ToggleVisibility_ParamsSpec.$,PageHandler_ToggleVisibility_ResponseParamsSpec.$,[visible],false)}startQueryClusters(query,beginTime,recluster){this.proxy.sendMessage(441822040,PageHandler_StartQueryClusters_ParamsSpec.$,null,[query,beginTime,recluster],false)}loadMoreClusters(query){this.proxy.sendMessage(215517294,PageHandler_LoadMoreClusters_ParamsSpec.$,null,[query],false)}hideVisits(visits){return this.proxy.sendMessage(1401380332,PageHandler_HideVisits_ParamsSpec.$,PageHandler_HideVisits_ResponseParamsSpec.$,[visits],false)}removeVisits(visits){return this.proxy.sendMessage(1192094908,PageHandler_RemoveVisits_ParamsSpec$1.$,PageHandler_RemoveVisits_ResponseParamsSpec$1.$,[visits],false)}removeVisitByUrlAndTime(url,timestamp){return this.proxy.sendMessage(2130754912,PageHandler_RemoveVisitByUrlAndTime_ParamsSpec.$,PageHandler_RemoveVisitByUrlAndTime_ResponseParamsSpec.$,[url,timestamp],false)}openVisitUrlsInTabGroup(visits,tabGroupName){this.proxy.sendMessage(152414125,PageHandler_OpenVisitUrlsInTabGroup_ParamsSpec.$,null,[visits,tabGroupName],false)}recordVisitAction(visitAction,visitIndex,visitType){this.proxy.sendMessage(557793317,PageHandler_RecordVisitAction_ParamsSpec.$,null,[visitAction,visitIndex,visitType],false)}recordRelatedSearchAction(action,visitIndex){this.proxy.sendMessage(1902532527,PageHandler_RecordRelatedSearchAction_ParamsSpec.$,null,[action,visitIndex],false)}recordClusterAction(clusterAction,clusterIndex){this.proxy.sendMessage(945117344,PageHandler_RecordClusterAction_ParamsSpec.$,null,[clusterAction,clusterIndex],false)}recordToggledVisibility(visible){this.proxy.sendMessage(857847515,PageHandler_RecordToggledVisibility_ParamsSpec.$,null,[visible],false)}};let PagePendingReceiver$3=class PagePendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_clusters.mojom.Page",scope)}};let PageRemote$3=class PageRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver$3,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}onClustersQueryResult(result){this.proxy.sendMessage(1104102036,Page_OnClustersQueryResult_ParamsSpec.$,null,[result],false)}onClusterImageUpdated(clusterIndex,imageUrl){this.proxy.sendMessage(2017176175,Page_OnClusterImageUpdated_ParamsSpec.$,null,[clusterIndex,imageUrl],false)}onVisitsHidden(hiddenVisits){this.proxy.sendMessage(873952978,Page_OnVisitsHidden_ParamsSpec.$,null,[hiddenVisits],false)}onVisitsRemoved(removedVisits){this.proxy.sendMessage(1061445220,Page_OnVisitsRemoved_ParamsSpec.$,null,[removedVisits],false)}onHistoryDeleted(){this.proxy.sendMessage(796826044,Page_OnHistoryDeleted_ParamsSpec$1.$,null,[],false)}onQueryChangedByUser(query){this.proxy.sendMessage(105714358,Page_OnQueryChangedByUser_ParamsSpec.$,null,[query],false)}};let PageCallbackRouter$3=class PageCallbackRouter{helper_internal_;$;router_;onClustersQueryResult;onClusterImageUpdated;onVisitsHidden;onVisitsRemoved;onHistoryDeleted;onQueryChangedByUser;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote$3);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.onClustersQueryResult=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1104102036,Page_OnClustersQueryResult_ParamsSpec.$,null,this.onClustersQueryResult.createReceiverHandler(false),false);this.onClusterImageUpdated=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(2017176175,Page_OnClusterImageUpdated_ParamsSpec.$,null,this.onClusterImageUpdated.createReceiverHandler(false),false);this.onVisitsHidden=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(873952978,Page_OnVisitsHidden_ParamsSpec.$,null,this.onVisitsHidden.createReceiverHandler(false),false);this.onVisitsRemoved=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1061445220,Page_OnVisitsRemoved_ParamsSpec.$,null,this.onVisitsRemoved.createReceiverHandler(false),false);this.onHistoryDeleted=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(796826044,Page_OnHistoryDeleted_ParamsSpec$1.$,null,this.onHistoryDeleted.createReceiverHandler(false),false);this.onQueryChangedByUser=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(105714358,Page_OnQueryChangedByUser_ParamsSpec.$,null,this.onQueryChangedByUser.createReceiverHandler(false),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}};let PageHandlerFactoryPendingReceiver$1=class PageHandlerFactoryPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_clusters.mojom.PageHandlerFactory",scope)}};let PageHandlerFactoryRemote$1=class PageHandlerFactoryRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerFactoryPendingReceiver$1,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}createPageHandler(page,handler){this.proxy.sendMessage(1999669109,PageHandlerFactory_CreatePageHandler_ParamsSpec$1.$,null,[page,handler],false)}};let PageHandlerFactory$1=class PageHandlerFactory{static get $interfaceName(){return"history_clusters.mojom.PageHandlerFactory"}static getRemote(){let remote=new PageHandlerFactoryRemote$1;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}};const QueryResultSpec$1={$:{}};const PageHandler_OpenHistoryUrl_ParamsSpec={$:{}};const PageHandler_ShowContextMenuForSearchbox_ParamsSpec={$:{}};const PageHandler_ShowContextMenuForURL_ParamsSpec={$:{}};const PageHandler_ShowSidePanelUI_ParamsSpec$1={$:{}};const PageHandler_ToggleVisibility_ParamsSpec={$:{}};const PageHandler_ToggleVisibility_ResponseParamsSpec={$:{}};const PageHandler_StartQueryClusters_ParamsSpec={$:{}};const PageHandler_LoadMoreClusters_ParamsSpec={$:{}};const PageHandler_HideVisits_ParamsSpec={$:{}};const PageHandler_HideVisits_ResponseParamsSpec={$:{}};const PageHandler_RemoveVisits_ParamsSpec$1={$:{}};const PageHandler_RemoveVisits_ResponseParamsSpec$1={$:{}};const PageHandler_RemoveVisitByUrlAndTime_ParamsSpec={$:{}};const PageHandler_RemoveVisitByUrlAndTime_ResponseParamsSpec={$:{}};const PageHandler_OpenVisitUrlsInTabGroup_ParamsSpec={$:{}};const PageHandler_RecordVisitAction_ParamsSpec={$:{}};const PageHandler_RecordRelatedSearchAction_ParamsSpec={$:{}};const PageHandler_RecordClusterAction_ParamsSpec={$:{}};const PageHandler_RecordToggledVisibility_ParamsSpec={$:{}};const Page_OnClustersQueryResult_ParamsSpec={$:{}};const Page_OnClusterImageUpdated_ParamsSpec={$:{}};const Page_OnVisitsHidden_ParamsSpec={$:{}};const Page_OnVisitsRemoved_ParamsSpec={$:{}};const Page_OnHistoryDeleted_ParamsSpec$1={$:{}};const Page_OnQueryChangedByUser_ParamsSpec={$:{}};const PageHandlerFactory_CreatePageHandler_ParamsSpec$1={$:{}};mojo.internal.Struct(QueryResultSpec$1.$,"QueryResult",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("clusters",8,0,mojo.internal.Array(ClusterSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("canLoadMore",16,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("isContinuation",16,1,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(PageHandler_OpenHistoryUrl_ParamsSpec.$,"PageHandler_OpenHistoryUrl_Params",[mojo.internal.StructField("url",0,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("clickModifiers",8,0,ClickModifiersSpec.$,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_ShowContextMenuForSearchbox_ParamsSpec.$,"PageHandler_ShowContextMenuForSearchbox_Params",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("point",8,0,PointSpec.$,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_ShowContextMenuForURL_ParamsSpec.$,"PageHandler_ShowContextMenuForURL_Params",[mojo.internal.StructField("url",0,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("point",8,0,PointSpec.$,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_ShowSidePanelUI_ParamsSpec$1.$,"PageHandler_ShowSidePanelUI_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_ToggleVisibility_ParamsSpec.$,"PageHandler_ToggleVisibility_Params",[mojo.internal.StructField("visible",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_ToggleVisibility_ResponseParamsSpec.$,"PageHandler_ToggleVisibility_ResponseParams",[mojo.internal.StructField("visible",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_StartQueryClusters_ParamsSpec.$,"PageHandler_StartQueryClusters_Params",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("beginTime",8,0,TimeSpec.$,null,true,0,undefined,undefined),mojo.internal.StructField("recluster",16,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(PageHandler_LoadMoreClusters_ParamsSpec.$,"PageHandler_LoadMoreClusters_Params",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_HideVisits_ParamsSpec.$,"PageHandler_HideVisits_Params",[mojo.internal.StructField("visits",0,0,mojo.internal.Array(URLVisitSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_HideVisits_ResponseParamsSpec.$,"PageHandler_HideVisits_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RemoveVisits_ParamsSpec$1.$,"PageHandler_RemoveVisits_Params",[mojo.internal.StructField("visits",0,0,mojo.internal.Array(URLVisitSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RemoveVisits_ResponseParamsSpec$1.$,"PageHandler_RemoveVisits_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RemoveVisitByUrlAndTime_ParamsSpec.$,"PageHandler_RemoveVisitByUrlAndTime_Params",[mojo.internal.StructField("url",0,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("timestamp",8,0,mojo.internal.Double,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_RemoveVisitByUrlAndTime_ResponseParamsSpec.$,"PageHandler_RemoveVisitByUrlAndTime_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_OpenVisitUrlsInTabGroup_ParamsSpec.$,"PageHandler_OpenVisitUrlsInTabGroup_Params",[mojo.internal.StructField("visits",0,0,mojo.internal.Array(URLVisitSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("tabGroupName",8,0,mojo.internal.String,null,true,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_RecordVisitAction_ParamsSpec.$,"PageHandler_RecordVisitAction_Params",[mojo.internal.StructField("visitAction",0,0,VisitActionSpec.$,0,false,0,undefined,undefined),mojo.internal.StructField("visitIndex",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined),mojo.internal.StructField("visitType",8,0,VisitTypeSpec.$,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_RecordRelatedSearchAction_ParamsSpec.$,"PageHandler_RecordRelatedSearchAction_Params",[mojo.internal.StructField("action",0,0,RelatedSearchActionSpec.$,0,false,0,undefined,undefined),mojo.internal.StructField("visitIndex",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RecordClusterAction_ParamsSpec.$,"PageHandler_RecordClusterAction_Params",[mojo.internal.StructField("clusterAction",0,0,ClusterActionSpec.$,0,false,0,undefined,undefined),mojo.internal.StructField("clusterIndex",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RecordToggledVisibility_ParamsSpec.$,"PageHandler_RecordToggledVisibility_Params",[mojo.internal.StructField("visible",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Page_OnClustersQueryResult_ParamsSpec.$,"Page_OnClustersQueryResult_Params",[mojo.internal.StructField("result",0,0,QueryResultSpec$1.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Page_OnClusterImageUpdated_ParamsSpec.$,"Page_OnClusterImageUpdated_Params",[mojo.internal.StructField("clusterIndex",0,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("imageUrl",8,0,UrlSpec.$,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(Page_OnVisitsHidden_ParamsSpec.$,"Page_OnVisitsHidden_Params",[mojo.internal.StructField("hiddenVisits",0,0,mojo.internal.Array(URLVisitSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Page_OnVisitsRemoved_ParamsSpec.$,"Page_OnVisitsRemoved_Params",[mojo.internal.StructField("removedVisits",0,0,mojo.internal.Array(URLVisitSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Page_OnHistoryDeleted_ParamsSpec$1.$,"Page_OnHistoryDeleted_Params",[],[[0,8]]);mojo.internal.Struct(Page_OnQueryChangedByUser_ParamsSpec.$,"Page_OnQueryChangedByUser_Params",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandlerFactory_CreatePageHandler_ParamsSpec$1.$,"PageHandlerFactory_CreatePageHandler_Params",[mojo.internal.StructField("page",0,0,mojo.internal.InterfaceProxy(PageRemote$3),null,false,0,undefined,undefined),mojo.internal.StructField("handler",8,0,mojo.internal.InterfaceRequest(PageHandlerPendingReceiver$3),null,false,0,undefined,undefined)],[[0,24]]);const browserProxyFactory$4=new MojoBrowserProxyFactory(PageHandlerRemote$3,PageCallbackRouter$3,((remote,receiver)=>PageHandlerFactory$1.getRemote().createPageHandler(remote,receiver)));class MetricsProxyImpl{recordClusterAction(action,index){browserProxyFactory$4.getInstance().handler.recordClusterAction(action,index)}recordRelatedSearchAction(action,index){browserProxyFactory$4.getInstance().handler.recordRelatedSearchAction(action,index)}recordToggledVisibility(visible){browserProxyFactory$4.getInstance().handler.recordToggledVisibility(visible)}recordVisitAction(action,index,type){browserProxyFactory$4.getInstance().handler.recordVisitAction(action,index,type)}static getInstance(){return instance$Q||(instance$Q=new MetricsProxyImpl)}static setInstance(obj){instance$Q=obj}static getVisitType(visit){return visit.annotations.includes(Annotation.kSearchResultsPage)?VisitType.kSRP:VisitType.kNonSRP}}let instance$Q=null;let instance$P=null;function getCss$J(){return instance$P||(instance$P=[...[getCss$N()],css`:host{--border-color:var(--color-suggestion-chip-border,var(--cr-fallback-color-tonal-outline));--icon-color:var(--color-suggestion-chip-icon,var(--cr-fallback-color-primary));--pill-padding-text:12px;--pill-padding-icon:8px;--pill-height:28px;display:block;min-width:0}a{align-items:center;color:inherit;display:flex;outline:none;text-decoration:none;overflow:hidden;position:relative}:host-context(.focus-outline-visible) a:focus{--pill-padding-icon:9px;--pill-padding-text:13px;border:none;box-shadow:none;outline:2px solid var(--cr-focus-outline-color);outline-offset:0}span{position:relative;z-index:1}.icon{--cr-icon-button-margin-start:0;--cr-icon-color:var(--icon-color);--cr-icon-image:url(chrome://resources/images/icon_search.svg);--cr-icon-ripple-margin:0;--cr-icon-ripple-size:16px;--cr-icon-size:16px}cr-ripple{--paper-ripple-opacity:1;color:var(--cr-active-background-color);display:block}#hover-layer{display:none}:host(:hover) #hover-layer{background:var(--cr-hover-background-color);content:'';display:block;inset:0;pointer-events:none;position:absolute}`])}function getHtml$E(){return html`
${this.searchQuery?.query||""}
`}const SearchQueryElementBase=CrRippleMixin(CrLitElement);class SearchQueryElement extends SearchQueryElementBase{static get is(){return"search-query"}static get styles(){return getCss$J()}render(){return getHtml$E.bind(this)()}static get properties(){return{index:{type:Number},searchQuery:{type:Object}}}#index_accessor_storage=-1;get index(){return this.#index_accessor_storage}set index(value){this.#index_accessor_storage=value}#searchQuery_accessor_storage;get searchQuery(){return this.#searchQuery_accessor_storage}set searchQuery(value){this.#searchQuery_accessor_storage=value}firstUpdated(){this.addEventListener("pointerdown",this.onPointerDown_.bind(this));this.addEventListener("pointercancel",this.onPointerCancel_.bind(this))}onAuxclick_(){MetricsProxyImpl.getInstance().recordRelatedSearchAction(RelatedSearchAction.kClicked,this.index);this.fire("related-search-clicked")}onClick_(event){event.preventDefault();this.onAuxclick_();this.openUrl_(event)}onKeydown_(e){this.noink=e.key===" ";if(e.key!=="Enter"){return}this.getRipple().uiDownAction();this.onAuxclick_();this.openUrl_(e);setTimeout((()=>this.getRipple().uiUpAction()),100)}onPointerDown_(){this.noink=false;this.ensureRipple()}onPointerCancel_(){this.getRipple().clear()}openUrl_(event){assert(this.searchQuery);browserProxyFactory$4.getInstance().handler.openHistoryUrl(this.searchQuery.url,{middleButton:false,altKey:event.altKey,ctrlKey:event.ctrlKey,metaKey:event.metaKey,shiftKey:event.shiftKey})}createRipple(){this.rippleContainer=this.$.searchQueryLink;const ripple=super.createRipple();return ripple}}customElements.define(SearchQueryElement.is,SearchQueryElement);const AUTO_SRC="auto-src";const CLEAR_SRC="clear-src";const IS_GOOGLE_PHOTOS="is-google-photos";const STATIC_ENCODE="static-encode";const ENCODE_TYPE="encode-type";class CrAutoImgElement extends HTMLImageElement{static get observedAttributes(){return[AUTO_SRC,IS_GOOGLE_PHOTOS,STATIC_ENCODE,ENCODE_TYPE]}attributeChangedCallback(name,oldValue,newValue){if(name!==AUTO_SRC&&name!==IS_GOOGLE_PHOTOS&&name!==STATIC_ENCODE&&name!==ENCODE_TYPE){return}if(name===IS_GOOGLE_PHOTOS&&oldValue===null===(newValue===null)){return}if(this.hasAttribute(CLEAR_SRC)){this.removeAttribute("src")}let url=null;try{url=new URL(this.getAttribute(AUTO_SRC)||"")}catch(_){}if(!url||url.protocol==="chrome-untrusted:"){this.removeAttribute("src");return}if(url.protocol==="data:"||url.protocol==="chrome:"){this.src=url.href;return}if(!this.hasAttribute(IS_GOOGLE_PHOTOS)&&!this.hasAttribute(STATIC_ENCODE)&&!this.hasAttribute(ENCODE_TYPE)){this.src="chrome://image?"+url.href;return}this.src=`chrome://image?url=${encodeURIComponent(url.href)}`;if(this.hasAttribute(IS_GOOGLE_PHOTOS)){this.src+=`&isGooglePhotos=true`}if(this.hasAttribute(STATIC_ENCODE)){this.src+=`&staticEncode=true`}if(this.hasAttribute(ENCODE_TYPE)){this.src+=`&encodeType=${this.getAttribute(ENCODE_TYPE)}`}}set autoSrc(src){this.setAttribute(AUTO_SRC,src)}get autoSrc(){return this.getAttribute(AUTO_SRC)||""}set clearSrc(_){this.setAttribute(CLEAR_SRC,"")}get clearSrc(){return this.getAttribute(CLEAR_SRC)||""}set isGooglePhotos(enabled){if(enabled){this.setAttribute(IS_GOOGLE_PHOTOS,"")}else{this.removeAttribute(IS_GOOGLE_PHOTOS)}}get isGooglePhotos(){return this.hasAttribute(IS_GOOGLE_PHOTOS)}set staticEncode(enabled){if(enabled){this.setAttribute(STATIC_ENCODE,"")}else{this.removeAttribute(STATIC_ENCODE)}}get staticEncode(){return this.hasAttribute(STATIC_ENCODE)}set encodeType(type){if(type){this.setAttribute(ENCODE_TYPE,type)}else{this.removeAttribute(ENCODE_TYPE)}}get encodeType(){return this.getAttribute(ENCODE_TYPE)||""}}customElements.define("cr-auto-img",CrAutoImgElement,{extends:"img"});const ClientIdSpec={$:mojo.internal.Enum()};var ClientId;(function(ClientId){ClientId[ClientId["MIN_VALUE"]=0]="MIN_VALUE";ClientId[ClientId["MAX_VALUE"]=6]="MAX_VALUE";ClientId[ClientId["Journeys"]=0]="Journeys";ClientId[ClientId["JourneysSidePanel"]=1]="JourneysSidePanel";ClientId[ClientId["NtpRealbox"]=2]="NtpRealbox";ClientId[ClientId["NtpQuests"]=3]="NtpQuests";ClientId[ClientId["Bookmarks"]=4]="Bookmarks";ClientId[ClientId["NtpTabResumption"]=5]="NtpTabResumption";ClientId[ClientId["HistoryEmbeddings"]=6]="HistoryEmbeddings"})(ClientId||(ClientId={}));class PageImageServiceHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"page_image_service.mojom.PageImageServiceHandler",scope)}}class PageImageServiceHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageImageServiceHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}getPageImageUrl(clientId,pageUrl,options){return this.proxy.sendMessage(730188154,PageImageServiceHandler_GetPageImageUrl_ParamsSpec.$,PageImageServiceHandler_GetPageImageUrl_ResponseParamsSpec.$,[clientId,pageUrl,options],false)}}class PageImageServiceHandler{static get $interfaceName(){return"page_image_service.mojom.PageImageServiceHandler"}static getRemote(){let remote=new PageImageServiceHandlerRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}const OptionsSpec={$:{}};const ImageResultSpec={$:{}};const PageImageServiceHandler_GetPageImageUrl_ParamsSpec={$:{}};const PageImageServiceHandler_GetPageImageUrl_ResponseParamsSpec={$:{}};mojo.internal.Struct(OptionsSpec.$,"Options",[mojo.internal.StructField("suggestImages",0,0,mojo.internal.Bool,true,false,0,undefined,undefined),mojo.internal.StructField("optimizationGuideImages",0,1,mojo.internal.Bool,true,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(ImageResultSpec.$,"ImageResult",[mojo.internal.StructField("imageUrl",0,0,UrlSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageImageServiceHandler_GetPageImageUrl_ParamsSpec.$,"PageImageServiceHandler_GetPageImageUrl_Params",[mojo.internal.StructField("clientId",0,0,ClientIdSpec.$,0,false,0,undefined,undefined),mojo.internal.StructField("pageUrl",8,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("options",16,0,OptionsSpec.$,null,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(PageImageServiceHandler_GetPageImageUrl_ResponseParamsSpec.$,"PageImageServiceHandler_GetPageImageUrl_ResponseParams",[mojo.internal.StructField("result",0,0,ImageResultSpec.$,null,true,0,undefined,undefined)],[[0,16]]);class PageImageServiceBrowserProxy{handler;constructor(handler){this.handler=handler}static getInstance(){return instance$O||(instance$O=new PageImageServiceBrowserProxy(PageImageServiceHandler.getRemote()))}static setInstance(obj){instance$O=obj}}let instance$O=null;function getSupportedScaleFactors(){const supportedScaleFactors=[];if(!isIOS){supportedScaleFactors.push(1)}if(!isIOS&&!isAndroid){supportedScaleFactors.push(2)}else{supportedScaleFactors.push(window.devicePixelRatio)}return supportedScaleFactors}function getUrlForCss(s){const s2=s.replace(/(\(|\)|\,|\s|\'|\"|\\)/g,"\\$1");return`url("${s2}")`}function getImageSet(path){const supportedScaleFactors=getSupportedScaleFactors();const replaceStartIndex=path.indexOf("SCALEFACTOR");if(replaceStartIndex<0){return getUrlForCss(path)}let s="";for(let i=0;i`:""}class PageFaviconElement extends CrLitElement{static get is(){return"page-favicon"}static get styles(){return getCss$I()}render(){return getHtml$D.bind(this)()}static get properties(){return{inSidePanel_:{type:Boolean,reflect:true},url:{type:String},isKnownToSync:{type:Boolean},imageUrl_:{type:String},isImageCover_:{type:Boolean,reflect:true}}}#isKnownToSync_accessor_storage=false;get isKnownToSync(){return this.#isKnownToSync_accessor_storage}set isKnownToSync(value){this.#isKnownToSync_accessor_storage=value}#url_accessor_storage=null;get url(){return this.#url_accessor_storage}set url(value){this.#url_accessor_storage=value}#imageUrl__accessor_storage=null;get imageUrl_(){return this.#imageUrl__accessor_storage}set imageUrl_(value){this.#imageUrl__accessor_storage=value}#inSidePanel__accessor_storage=loadTimeData.getBoolean("inSidePanel");get inSidePanel_(){return this.#inSidePanel__accessor_storage}set inSidePanel_(value){this.#inSidePanel__accessor_storage=value}#isImageCover__accessor_storage=loadTimeData.getBoolean("isHistoryClustersImageCover");get isImageCover_(){return this.#isImageCover__accessor_storage}set isImageCover_(value){this.#isImageCover__accessor_storage=value}getImageUrlForTesting(){return this.imageUrl_}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("url")||changedProperties.has("imageUrl_")){if(this.imageUrl_||!this.url){this.style.setProperty("background-image","")}else{this.style.setProperty("background-image",getFaviconForPageURL(this.url,this.isKnownToSync,"",16))}}if(changedProperties.has("url")||changedProperties.has("isKnownToSync")){this.urlAndIsKnownToSyncChanged_()}}async urlAndIsKnownToSyncChanged_(){if(!this.url||!this.isKnownToSync||!loadTimeData.getBoolean("isHistoryClustersImagesEnabled")){this.imageUrl_=null;return}const{result:result}=await PageImageServiceBrowserProxy.getInstance().handler.getPageImageUrl(ClientId.Journeys,this.url,{suggestImages:true,optimizationGuideImages:true});if(result){this.imageUrl_=result.imageUrl}else{this.imageUrl_=null}}}customElements.define(PageFaviconElement.is,PageFaviconElement);let instance$M=null;function getCss$H(){return instance$M||(instance$M=[...[getCss$N()],css`:host{align-items:center;cursor:pointer;display:flex;min-height:48px}:host(:hover){background-color:var(--cr-hover-background-color)}.suffix-icons{display:flex;opacity:0;position:absolute;--cr-icon-button-margin-end:8px}:host(:hover) .suffix-icons,.suffix-icons:focus-within{opacity:1;position:static}.hide-visit-icon{--cr-icon-image:url(chrome://resources/cr_components/history_clusters/hide_source_gm_grey_24dp.svg);--cr-icon-button-icon-size:16px;--cr-icon-button-size:24px}.icon-more-vert{--cr-icon-button-margin-start:0;--cr-icon-button-margin-end:21px;--cr-icon-button-icon-size:16px;--cr-icon-button-size:24px}:host([in-side-panel_]) .icon-more-vert{--cr-icon-button-margin-end:8px}#header{align-items:center;display:flex;flex-grow:1;justify-content:space-between;min-width:0;padding-inline-start:var(--cluster-padding-horizontal)}:host([in-side-panel_]) #header{padding-inline-start:8px}a{color:inherit;text-decoration:none}#link-container{align-items:center;display:flex;margin-inline-end:var(--cluster-padding-horizontal);min-width:0;outline:none;padding-inline:2px}:host(:hover) #link-container{margin-inline-end:0}:host([in-side-panel_]) #icon{background-color:var(--color-list-item-url-favicon-background,var(--cr-fallback-color-neutral-container));height:40px;width:40px}:host-context(.focus-outline-visible) #link-container:focus{box-shadow:0 0 0 2px var(--cr-focus-outline-color)}#page-info{display:flex;flex-direction:column;min-width:0;gap:4px}#title-and-annotations{align-items:center;display:flex;line-height:2}.annotation{align-items:center;background-color:var(--annotation-background-color);border-radius:4px;color:var(--annotation-text-color);display:inline-flex;flex-shrink:0;font-weight:500;margin-inline-start:12px;padding:0 8px}.annotation+.annotation{margin-inline-start:8px}#title{font-size:12px;font-weight:500;line-height:16px}:host([in-side-panel_]) #title{font-size:.75rem;font-weight:500}#url{font-size:11px;color:var(--cr-secondary-text-color);line-height:14px}:host([in-side-panel_]) #url{color:var(--color-history-clusters-side-panel-card-secondary-foreground)}#debug-info{color:var(--cr-secondary-text-color)}`])}function getHtml$C(){return html` ${this.renderActionMenu_?html` `:""}`}const WRAPPER_CSS_CLASS="search-highlight-wrapper";const ORIGINAL_CONTENT_CSS_CLASS="search-highlight-original-content";const HIT_CSS_CLASS="search-highlight-hit";function highlight(node,ranges){assert(ranges.length>0);const wrapper=document.createElement("span");wrapper.classList.add(WRAPPER_CSS_CLASS);assert(node.parentNode);node.parentNode.replaceChild(wrapper,node);const span=document.createElement("span");span.classList.add(ORIGINAL_CONTENT_CSS_CLASS);span.style.display="none";span.appendChild(node);wrapper.appendChild(span);const text=node.textContent;const tokens=[];for(let i=0;i0){highlight(node,ranges)}}const annotationToStringId=new Map([[Annotation.kBookmarked,"bookmarked"]]);const ClusterMenuElementBase=I18nMixinLit(CrLitElement);class UrlVisitElement extends ClusterMenuElementBase{static get is(){return"url-visit"}static get styles(){return getCss$H()}render(){return getHtml$C.bind(this)()}static get properties(){return{query:{type:String},visit:{type:Object},fromPersistence:{type:Boolean},allowDeletingHistory_:{type:Boolean},inSidePanel_:{type:Boolean,reflect:true},renderActionMenu_:{type:Boolean}}}#query_accessor_storage="";get query(){return this.#query_accessor_storage}set query(value){this.#query_accessor_storage=value}#visit_accessor_storage;get visit(){return this.#visit_accessor_storage}set visit(value){this.#visit_accessor_storage=value}#fromPersistence_accessor_storage=false;get fromPersistence(){return this.#fromPersistence_accessor_storage}set fromPersistence(value){this.#fromPersistence_accessor_storage=value}annotations_=[];#allowDeletingHistory__accessor_storage=loadTimeData.getBoolean("allowDeletingHistory");get allowDeletingHistory_(){return this.#allowDeletingHistory__accessor_storage}set allowDeletingHistory_(value){this.#allowDeletingHistory__accessor_storage=value}#inSidePanel__accessor_storage=loadTimeData.getBoolean("inSidePanel");get inSidePanel_(){return this.#inSidePanel__accessor_storage}set inSidePanel_(value){this.#inSidePanel__accessor_storage=value}#renderActionMenu__accessor_storage=false;get renderActionMenu_(){return this.#renderActionMenu__accessor_storage}set renderActionMenu_(value){this.#renderActionMenu__accessor_storage=value}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("visit")){assert(this.visit);insertHighlightedTextWithMatchesIntoElement(this.$.title,this.visit.pageTitle,this.visit.titleMatchPositions);insertHighlightedTextWithMatchesIntoElement(this.$.url,this.visit.urlForDisplay,this.visit.urlForDisplayMatchPositions)}}fireVisitClickedEvent_(){this.fire("visit-clicked",this.visit)}onAuxclick_(event){this.onClick_(event)}onClick_(event){if(event.defaultPrevented){return}event.preventDefault();this.fireVisitClickedEvent_();this.openUrl_(event)}onContextmenu_(event){if(!loadTimeData.getBoolean("inSidePanel")||!this.visit){return}browserProxyFactory$4.getInstance().handler.showContextMenuForURL(this.visit.normalizedUrl,{x:event.clientX,y:event.clientY})}onKeydown_(e){if(e.key!=="Enter"){return}this.fireVisitClickedEvent_();this.openUrl_(e)}async onActionMenuButtonClick_(event){event.preventDefault();if(!this.renderActionMenu_){this.renderActionMenu_=true;await this.updateComplete}const menu=this.shadowRoot.querySelector("cr-action-menu");assert(menu);menu.showAt(this.$.actionMenuButton)}onHideSelfButtonClick_(event){this.emitMenuButtonClick_(event,"hide-visit")}onRemoveSelfButtonClick_(event){this.emitMenuButtonClick_(event,"remove-visit")}emitMenuButtonClick_(event,emitEventName){event.preventDefault();this.fire(emitEventName,this.visit);if(this.renderActionMenu_){const menu=this.shadowRoot.querySelector("cr-action-menu");assert(menu);menu.close()}}computeAnnotations_(){if(this.inSidePanel_||!this.visit){return[]}return this.visit.annotations.map((annotation=>annotationToStringId.get(annotation))).filter((id=>!!id)).map((id=>loadTimeData.getString(id)))}computeDebugInfo_(){if(!loadTimeData.getBoolean("isHistoryClustersDebug")||!this.visit){return""}return JSON.stringify(this.visit.debugInfo)}openUrl_(event){assert(this.visit);browserProxyFactory$4.getInstance().handler.openHistoryUrl(this.visit.normalizedUrl,{middleButton:event.button===1,altKey:event.altKey,ctrlKey:event.ctrlKey,metaKey:event.metaKey,shiftKey:event.shiftKey})}}customElements.define(UrlVisitElement.is,UrlVisitElement);var HistoryResultType;(function(HistoryResultType){HistoryResultType[HistoryResultType["TRADITIONAL"]=0]="TRADITIONAL";HistoryResultType[HistoryResultType["GROUPED"]=1]="GROUPED";HistoryResultType[HistoryResultType["EMBEDDINGS"]=2]="EMBEDDINGS";HistoryResultType[HistoryResultType["END"]=3]="END"})(HistoryResultType||(HistoryResultType={}));var HistoryEmbeddingsUserActions;(function(HistoryEmbeddingsUserActions){HistoryEmbeddingsUserActions[HistoryEmbeddingsUserActions["NON_EMPTY_QUERY_HISTORY_SEARCH"]=0]="NON_EMPTY_QUERY_HISTORY_SEARCH";HistoryEmbeddingsUserActions[HistoryEmbeddingsUserActions["END"]=7]="END"})(HistoryEmbeddingsUserActions||(HistoryEmbeddingsUserActions={}));const QUERY_RESULT_MINIMUM_AGE=2e3;let instance$L=null;function getCss$G(){return instance$L||(instance$L=[...[getCss$N(),getCss$P()],css`:host{--indentation:52px;--search-query-margin:10px;display:block;padding-bottom:var(--cluster-padding-vertical)}:host([in-side-panel]){--cr-icon-button-margin-start:18px;--search-query-margin:4px;padding-bottom:0;padding-top:8px}:host([in-side-panel]) #container{background:var(--color-side-panel-card-background);border-radius:12px;overflow:hidden}:host([in-side-panel][is-first]){padding-top:0}:host(:focus:focus-visible) #container{box-shadow:inset 0 0 0 2px var(--cr-focus-outline-color)}:host([has-hidden-visits_]) #container{margin-bottom:var(--cluster-padding-vertical)}:host([in-side-panel]) #container url-visit:last-of-type{margin-bottom:8px}:host(:not([in-side-panel])) #container{background-color:var(--cr-card-background-color);border-radius:var(--cr-card-border-radius);box-shadow:var(--cr-card-shadow);padding:var(--cluster-padding-vertical) 0}.label-row{align-items:center;display:flex;flex-grow:1;justify-content:space-between;min-height:24px;min-width:0;padding-block-end:13px;padding-inline-start:var(--cluster-padding-horizontal)}:host([in-side-panel]) .label-row{min-height:44px;padding-block-end:0;padding-inline-start:16px}#label{color:var(--cr-primary-text-color);font-size:16px;font-weight:500}:host([in-side-panel]) #label{font-size:.875rem;line-height:calc(10/7);margin-inline-end:16px}.timestamp{font-size:11px}:host([in-side-panel]) .timestamp{font-size:.6875rem;line-height:calc(5/3)}.debug-info{color:var(--cr-secondary-text-color)}#related-searches-divider{display:none}:host([in-side-panel]) #related-searches-divider{display:block;background-color:var(--color-history-clusters-side-panel-divider);height:1px;margin:8px 16px}#related-searches{margin:16px var(--cluster-padding-horizontal) 0}:host([in-side-panel]) #related-searches{margin:16px 2px}:host([in-side-panel]) search-query{flex-shrink:0;margin-top:0}search-query:not(:last-of-type){margin-inline-end:var(--search-query-margin)}:host([in-side-panel]) search-query:first-of-type{margin-inline-start:16px}`])}function getHtml$B(){return html`
${this.debugInfo_()}
${this.timestamp_()}
${this.visits_().map((item=>html` `))} ${this.relatedSearches_.map(((item,index)=>html` `))}
`}const ClusterElementBase=I18nMixinLit(CrLitElement);class ClusterElement extends ClusterElementBase{static get is(){return"history-cluster"}static get styles(){return getCss$G()}render(){return getHtml$B.bind(this)()}static get properties(){return{cluster:{type:Object},index:{type:Number},inSidePanel:{type:Boolean,reflect:true},query:{type:String},relatedSearches_:{type:Array},label_:{type:String,state:true},imageUrl_:{type:String}}}#cluster_accessor_storage;get cluster(){return this.#cluster_accessor_storage}set cluster(value){this.#cluster_accessor_storage=value}#index_accessor_storage=-1;get index(){return this.#index_accessor_storage}set index(value){this.#index_accessor_storage=value}#inSidePanel_accessor_storage=loadTimeData.getBoolean("inSidePanel");get inSidePanel(){return this.#inSidePanel_accessor_storage}set inSidePanel(value){this.#inSidePanel_accessor_storage=value}#query_accessor_storage="";get query(){return this.#query_accessor_storage}set query(value){this.#query_accessor_storage=value}#imageUrl__accessor_storage="";get imageUrl_(){return this.#imageUrl__accessor_storage}set imageUrl_(value){this.#imageUrl__accessor_storage=value}#relatedSearches__accessor_storage=[];get relatedSearches_(){return this.#relatedSearches__accessor_storage}set relatedSearches_(value){this.#relatedSearches__accessor_storage=value}callbackRouter_;onVisitsHiddenListenerId_=null;onVisitsRemovedListenerId_=null;#label__accessor_storage="no_label";get label_(){return this.#label__accessor_storage}set label_(value){this.#label__accessor_storage=value}constructor(){super();this.callbackRouter_=browserProxyFactory$4.getInstance().callbackRouter}connectedCallback(){super.connectedCallback();this.onVisitsHiddenListenerId_=this.callbackRouter_.onVisitsHidden.addListener(this.onVisitsRemovedOrHidden_.bind(this));this.onVisitsRemovedListenerId_=this.callbackRouter_.onVisitsRemoved.addListener(this.onVisitsRemovedOrHidden_.bind(this))}disconnectedCallback(){super.disconnectedCallback();assert(this.onVisitsHiddenListenerId_);this.callbackRouter_.removeListener(this.onVisitsHiddenListenerId_);this.onVisitsHiddenListenerId_=null;assert(this.onVisitsRemovedListenerId_);this.callbackRouter_.removeListener(this.onVisitsRemovedListenerId_);this.onVisitsRemovedListenerId_=null}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("cluster")){assert(this.cluster);this.label_=this.cluster.label?this.cluster.label:"no_label";this.imageUrl_=this.cluster.imageUrl?this.cluster.imageUrl:"";this.relatedSearches_=this.cluster.relatedSearches.filter(((query,index)=>query&&!(this.inSidePanel&&index>2)))}}updated(changedProperties){super.updated(changedProperties);const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("label_")&&this.label_!=="no_label"&&this.cluster){insertHighlightedTextWithMatchesIntoElement(this.$.label,this.cluster.label,this.cluster.labelMatchPositions)}if(changedPrivateProperties.has("imageUrl_")){requestIdleCallback((()=>{this.fire("iron-resize")}))}else if(changedProperties.has("cluster")){this.fire("iron-resize")}}onRelatedSearchClicked_(){MetricsProxyImpl.getInstance().recordClusterAction(ClusterAction.kRelatedSearchClicked,this.index)}onHorizontalCarouselPointerdown_(event){this.onBrowserIdle_().then((()=>{if(window.getSelection()&&!event.altKey){window.getSelection()?.empty()}}))}onVisitClicked_(event){MetricsProxyImpl.getInstance().recordClusterAction(ClusterAction.kVisitClicked,this.index);const visit=event.detail;const visitIndex=this.getVisitIndex_(visit);MetricsProxyImpl.getInstance().recordVisitAction(VisitAction.kClicked,visitIndex,MetricsProxyImpl.getVisitType(visit));this.fire("record-history-link-click",{resultType:HistoryResultType.GROUPED,index:visitIndex})}onOpenAllVisits_(){assert(this.cluster);browserProxyFactory$4.getInstance().handler.openVisitUrlsInTabGroup(this.cluster.visits,this.cluster.tabGroupName??null);MetricsProxyImpl.getInstance().recordClusterAction(ClusterAction.kOpenedInTabGroup,this.index)}onHideAllVisits_(){this.fire("hide-visits",this.cluster?this.cluster.visits:[])}onRemoveAllVisits_(){this.fire("remove-visits",this.cluster?this.cluster.visits:[])}onHideVisit_(event){const visit=event.detail;MetricsProxyImpl.getInstance().recordVisitAction(VisitAction.kHidden,this.getVisitIndex_(visit),MetricsProxyImpl.getVisitType(visit))}onRemoveVisit_(event){const visit=event.detail;MetricsProxyImpl.getInstance().recordVisitAction(VisitAction.kDeleted,this.getVisitIndex_(visit),MetricsProxyImpl.getVisitType(visit));this.fire("remove-visits",[visit])}onBrowserIdle_(){return new Promise((resolve=>{requestIdleCallback((()=>{resolve()}))}))}onVisitsRemovedOrHidden_(removedVisits){assert(this.cluster);const visitHasBeenRemoved=visit=>removedVisits.findIndex((removedVisit=>{if(visit.normalizedUrl!==removedVisit.normalizedUrl){return false}const rawVisitTime=visit.rawVisitData.visitTime.internalValue;return removedVisit.rawVisitData.visitTime.internalValue===rawVisitTime||removedVisit.duplicates.map((data=>data.visitTime.internalValue)).includes(rawVisitTime)}))!==-1;const allVisits=this.cluster.visits;const remainingVisits=allVisits.filter((v=>!visitHasBeenRemoved(v)));if(allVisits.length===remainingVisits.length){return}if(!remainingVisits.length){this.fire("remove-cluster",this.index);MetricsProxyImpl.getInstance().recordClusterAction(ClusterAction.kDeleted,this.index)}else{this.cluster.visits=remainingVisits;this.requestUpdate()}this.updateComplete.then((()=>{this.fire("iron-resize")}))}getVisitIndex_(visit){return this.cluster?this.cluster.visits.indexOf(visit):-1}hideRelatedSearches_(){return!this.cluster||!this.cluster.relatedSearches.length}debugInfo_(){return this.cluster&&this.cluster.debugInfo?this.cluster.debugInfo:""}timestamp_(){return this.cluster&&this.cluster.visits.length>0?this.cluster.visits[0].relativeDate:""}visits_(){return this.cluster?this.cluster.visits:[]}}customElements.define(ClusterElement.is,ClusterElement);let instance$K=null;function getCss$F(){return instance$K||(instance$K=[...[getCss$T()],css`:host{--cr-button-background-color:transparent;--cr-button-border-color:var(--color-button-border,var(--cr-fallback-color-tonal-outline));--cr-button-text-color:var(--color-button-foreground,var(--cr-fallback-color-primary));--cr-button-ripple-opacity:1;--cr-button-ripple-color:var(--cr-active-background-color);--cr-button-disabled-background-color:transparent;--cr-button-disabled-border-color:var(--color-button-border-disabled,var(--cr-fallback-color-disabled-background));--cr-button-disabled-text-color:var(--color-button-foreground-disabled,var(--cr-fallback-color-disabled-foreground));flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:5.14em;height:var(--cr-button-height);padding:8px 16px;outline-width:0;overflow:hidden;position:relative;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;border:var(--cr-button-border,1px solid var(--cr-button-border-color));border-radius:100px;background:var(--cr-button-background-color);color:var(--cr-button-text-color);font-weight:500;line-height:20px;isolation:isolate}:host(.action-button){--cr-button-background-color:var(--color-button-background-prominent,var(--cr-fallback-color-primary));--cr-button-text-color:var(--color-button-foreground-prominent,var(--cr-fallback-color-on-primary));--cr-button-ripple-color:var(--cr-active-on-primary-background-color);--cr-button-border:none;--cr-button-disabled-background-color:var(--color-button-background-prominent-disabled,var(--cr-fallback-color-disabled-background));--cr-button-disabled-text-color:var(--color-button-foreground-disabled,var(--cr-fallback-color-disabled-foreground));--cr-button-disabled-border:none}:host(.tonal-button),:host(.floating-button){--cr-button-background-color:var(--color-button-background-tonal,var(--cr-fallback-color-secondary-container));--cr-button-text-color:var(--color-button-foreground-tonal,var(--cr-fallback-color-on-tonal-container));--cr-button-border:none;--cr-button-disabled-background-color:var(--color-button-background-tonal-disabled,var(--cr-fallback-color-disabled-background));--cr-button-disabled-text-color:var(--color-button-foreground-disabled,var(--cr-fallback-color-disabled-foreground));--cr-button-disabled-border:none}@media (forced-colors:active){@container style(--color-button-foreground){:host{forced-color-adjust:none}}}:host(.floating-button){border-radius:8px;height:40px;transition:box-shadow 80ms linear}:host(.floating-button:hover){box-shadow:var(--cr-elevation-3)}:host([has-prefix-icon_]),:host([has-suffix-icon_]){--iron-icon-height:20px;--iron-icon-width:20px;--icon-block-padding-large:16px;--icon-block-padding-small:12px;gap:8px;padding-block-end:8px;padding-block-start:8px}:host([has-prefix-icon_]){padding-inline-end:var(--icon-block-padding-large);padding-inline-start:var(--icon-block-padding-small)}:host([has-suffix-icon_]){padding-inline-end:var(--icon-block-padding-small);padding-inline-start:var(--icon-block-padding-large)}:host-context(.focus-outline-visible):host(:focus){box-shadow:none;outline:2px solid var(--cr-focus-outline-color);outline-offset:2px}#background{border-radius:inherit;inset:0;pointer-events:none;position:absolute;z-index:0}#content{display:inline}#hoverBackground{content:'';display:none;inset:0;pointer-events:none;position:absolute;z-index:1}:host(:hover) #hoverBackground{background:var(--cr-hover-background-color);display:block}:host(.action-button:hover) #hoverBackground{background:var(--cr-hover-on-prominent-background-color)}:host([disabled]){background:var(--cr-button-disabled-background-color);border:var(--cr-button-disabled-border,1px solid var(--cr-button-disabled-border-color));color:var(--cr-button-disabled-text-color);cursor:auto;pointer-events:none}:host(.cancel-button){margin-inline-end:8px}:host(.action-button),:host(.cancel-button){line-height:154%}#ink{color:var(--cr-button-ripple-color);--paper-ripple-opacity:var(--cr-button-ripple-opacity)}#hoverBackground,cr-ripple{z-index:1}#content,::slotted(*){z-index:2}`])}function getHtml$A(){return html`
`}const CrButtonElementBase=CrRippleMixin(CrLitElement);class CrButtonElement extends CrButtonElementBase{static get is(){return"cr-button"}static get styles(){return getCss$F()}render(){return getHtml$A.bind(this)()}static get properties(){return{disabled:{type:Boolean,reflect:true},hasPrefixIcon_:{type:Boolean,reflect:true},hasSuffixIcon_:{type:Boolean,reflect:true}}}#disabled_accessor_storage=false;get disabled(){return this.#disabled_accessor_storage}set disabled(value){this.#disabled_accessor_storage=value}#hasPrefixIcon__accessor_storage=false;get hasPrefixIcon_(){return this.#hasPrefixIcon__accessor_storage}set hasPrefixIcon_(value){this.#hasPrefixIcon__accessor_storage=value}#hasSuffixIcon__accessor_storage=false;get hasSuffixIcon_(){return this.#hasSuffixIcon__accessor_storage}set hasSuffixIcon_(value){this.#hasSuffixIcon__accessor_storage=value}spaceKeyDown_=false;timeoutIds_=new Set;constructor(){super();this.addEventListener("blur",this.onBlur_.bind(this));this.addEventListener("click",this.onClick_.bind(this));this.addEventListener("keydown",this.onKeyDown_.bind(this));this.addEventListener("keyup",this.onKeyUp_.bind(this));this.ensureRippleOnPointerdown()}disconnectedCallback(){super.disconnectedCallback();this.timeoutIds_.forEach(clearTimeout);this.timeoutIds_.clear()}firstUpdated(){if(!this.hasAttribute("role")){this.setAttribute("role","button")}if(!this.hasAttribute("tabindex")){this.setAttribute("tabindex","0")}FocusOutlineManager.forDocument(document)}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("disabled")){this.setAttribute("aria-disabled",this.disabled?"true":"false");this.disabledChanged_(this.disabled,changedProperties.get("disabled"))}}setTimeout_(fn,delay){if(!this.isConnected){return}const id=setTimeout((()=>{this.timeoutIds_.delete(id);fn()}),delay);this.timeoutIds_.add(id)}disabledChanged_(newValue,oldValue){if(!newValue&&oldValue===undefined){return}if(this.disabled){this.blur()}this.setAttribute("tabindex",String(this.disabled?-1:0))}onBlur_(){this.spaceKeyDown_=false;this.setTimeout_((()=>this.getRipple().uiUpAction()),100)}onClick_(e){if(this.disabled){e.stopImmediatePropagation()}}onPrefixIconSlotchange_(){this.hasPrefixIcon_=this.$.prefixIcon.assignedElements().length>0}onSuffixIconSlotchange_(){this.hasSuffixIcon_=this.$.suffixIcon.assignedElements().length>0}onKeyDown_(e){if(e.key!==" "&&(e.key!=="Enter"||isMac&&e.ctrlKey)){return}e.preventDefault();e.stopPropagation();if(e.repeat){return}this.getRipple().uiDownAction();if(e.key==="Enter"){this.click();this.setTimeout_((()=>this.getRipple().uiUpAction()),100)}else if(e.key===" "){this.spaceKeyDown_=true}}onKeyUp_(e){if(e.key!==" "&&(e.key!=="Enter"||isMac&&e.ctrlKey)){return}e.preventDefault();e.stopPropagation();if(this.spaceKeyDown_&&e.key===" "){this.spaceKeyDown_=false;this.click();this.getRipple().uiUpAction()}}}customElements.define(CrButtonElement.is,CrButtonElement);let instance$J=null;function getCss$E(){return instance$J||(instance$J=[...[],css`.cr-scrollable{anchor-name:--cr-scrollable;anchor-scope:--cr-scrollable;container-type:scroll-state;overflow:auto}.cr-scrollable-top,.cr-scrollable-top-shadow,.cr-scrollable-bottom,.cr-scrollable-bottom-shadow{display:none;position:fixed;position-anchor:--cr-scrollable;left:anchor(left);width:anchor-size(width);pointer-events:none;&:where(.force-on){display:block}}.cr-scrollable-top{top:anchor(top);border-top:1px solid var(--cr-scrollable-border-color);@container scroll-state(scrollable:top){display:block}}.cr-scrollable-bottom{bottom:anchor(bottom);border-bottom:1px solid var(--cr-scrollable-border-color);@container scroll-state(scrollable:bottom){display:block}}.cr-scrollable-top-shadow,.cr-scrollable-bottom-shadow{box-shadow:inset 0 5px 6px -3px rgba(0,0,0,.4);display:block;height:8px;opacity:0;top:anchor(top);transition:opacity 500ms;z-index:1;&:where(.force-on){opacity:1}}.cr-scrollable-top-shadow{@container scroll-state(scrollable:top){opacity:1}}.cr-scrollable-bottom-shadow{top:auto;bottom:anchor(bottom);transform:scale(-1);@container scroll-state(scrollable:bottom){opacity:1}}`])}let instance$I=null;function getCss$D(){return instance$I||(instance$I=[...[getCss$T(),getCss$P(),getCss$E()],css`dialog{background-color:var(--cr-dialog-background-color,white);border:0;border-radius:var(--cr-dialog-border-radius,8px);bottom:50%;box-shadow:0 0 16px rgba(0,0,0,0.12),0 16px 16px rgba(0,0,0,0.24);color:inherit;line-height:20px;max-height:initial;max-width:initial;overflow-y:hidden;padding:0;position:absolute;top:50%;width:var(--cr-dialog-width,512px)}@media (prefers-color-scheme:dark){dialog{background-color:var(--cr-dialog-background-color,var(--google-grey-900));background-image:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04))}}:host-context([webui-refresh-2026]){dialog{background-color:var(--cr-dialog-background-color,var(--color-webui-dialog-background))}}@media (forced-colors:active){dialog{border:var(--cr-border-hcm)}}dialog[open] #content-wrapper{display:flex;flex-direction:column;max-height:100vh;overflow:auto}.top-container,:host ::slotted([slot=button-container]),:host ::slotted([slot=footer]){flex-shrink:0}dialog::backdrop{background-color:rgba(0,0,0,0.6);bottom:0;left:0;position:fixed;right:0;top:0}:host ::slotted([slot=body]){color:var(--cr-secondary-text-color);padding:0 var(--cr-dialog-body-padding-horizontal,20px)}:host ::slotted([slot=title]){color:var(--cr-primary-text-color);flex:1;font-family:var(--cr-dialog-font-family,inherit);font-size:var(--cr-dialog-title-font-size,calc(15 / 13 * 100%));line-height:1;padding-bottom:var(--cr-dialog-title-slot-padding-bottom,16px);padding-inline-end:var(--cr-dialog-title-slot-padding-end,20px);padding-inline-start:var(--cr-dialog-title-slot-padding-start,20px);padding-top:var(--cr-dialog-title-slot-padding-top,20px)}:host ::slotted([slot=button-container]){display:flex;justify-content:flex-end;padding-bottom:var(--cr-dialog-button-container-padding-bottom,16px);padding-inline-end:var(--cr-dialog-button-container-padding-horizontal,16px);padding-inline-start:var(--cr-dialog-button-container-padding-horizontal,16px);padding-top:var(--cr-dialog-button-container-padding-top,16px)}:host ::slotted([slot=footer]){border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;border-top:1px solid #dbdbdb;margin:0;padding:16px 20px}:host([hide-backdrop]) dialog::backdrop{opacity:0}@media (prefers-color-scheme:dark){:host ::slotted([slot=footer]){border-top-color:var(--cr-separator-color)}}.body-container{box-sizing:border-box;display:flex;flex-direction:column;min-height:1.375rem;overflow:auto}.top-container{align-items:flex-start;display:flex;min-height:var(--cr-dialog-top-container-min-height,31px)}.title-container{display:flex;flex:1;font-size:inherit;font-weight:inherit;margin:0;outline:none}#close{align-self:flex-start;margin-inline-end:4px;margin-top:4px}@container style(--cr-dialog-body-border-top){.cr-scrollable-top{display:block;border-top:var(--cr-dialog-body-border-top)}}`])}function getHtml$z(){return html`

${this.showCloseButton?html` `:""}
`}class CrDialogElement extends CrLitElement{static get is(){return"cr-dialog"}static get styles(){return getCss$D()}render(){return getHtml$z.bind(this)()}static get properties(){return{open:{type:Boolean,reflect:true},closeText:{type:String},ignorePopstate:{type:Boolean},ignoreEnterKey:{type:Boolean},consumeKeydownEvent:{type:Boolean},noCancel:{type:Boolean},showCloseButton:{type:Boolean},showOnAttach:{type:Boolean},ariaDescriptionText:{type:String}}}#closeText_accessor_storage;get closeText(){return this.#closeText_accessor_storage}set closeText(value){this.#closeText_accessor_storage=value}#consumeKeydownEvent_accessor_storage=false;get consumeKeydownEvent(){return this.#consumeKeydownEvent_accessor_storage}set consumeKeydownEvent(value){this.#consumeKeydownEvent_accessor_storage=value}#ignoreEnterKey_accessor_storage=false;get ignoreEnterKey(){return this.#ignoreEnterKey_accessor_storage}set ignoreEnterKey(value){this.#ignoreEnterKey_accessor_storage=value}#ignorePopstate_accessor_storage=false;get ignorePopstate(){return this.#ignorePopstate_accessor_storage}set ignorePopstate(value){this.#ignorePopstate_accessor_storage=value}#noCancel_accessor_storage=false;get noCancel(){return this.#noCancel_accessor_storage}set noCancel(value){this.#noCancel_accessor_storage=value}#open_accessor_storage=false;get open(){return this.#open_accessor_storage}set open(value){this.#open_accessor_storage=value}#showCloseButton_accessor_storage=false;get showCloseButton(){return this.#showCloseButton_accessor_storage}set showCloseButton(value){this.#showCloseButton_accessor_storage=value}#showOnAttach_accessor_storage=false;get showOnAttach(){return this.#showOnAttach_accessor_storage}set showOnAttach(value){this.#showOnAttach_accessor_storage=value}#ariaDescriptionText_accessor_storage;get ariaDescriptionText(){return this.#ariaDescriptionText_accessor_storage}set ariaDescriptionText(value){this.#ariaDescriptionText_accessor_storage=value}mutationObserver_=null;boundKeydown_=null;tracker_=new EventTracker;connectedCallback(){super.connectedCallback();const mutationObserverCallback=()=>{if(this.$.dialog.open){this.addKeydownListener_()}else{this.removeKeydownListener_()}};this.mutationObserver_=new MutationObserver(mutationObserverCallback);this.mutationObserver_.observe(this.$.dialog,{attributes:true,attributeFilter:["open"]});mutationObserverCallback();if(this.showOnAttach){this.showModal()}this.tracker_.add(window,"popstate",(()=>{if(!this.ignorePopstate&&this.$.dialog.open){this.cancel()}}))}disconnectedCallback(){super.disconnectedCallback();this.removeKeydownListener_();if(this.mutationObserver_){this.mutationObserver_.disconnect();this.mutationObserver_=null}this.tracker_.removeAll()}firstUpdated(){if(!this.ignoreEnterKey){this.addEventListener("keypress",this.onKeypress_.bind(this))}this.addEventListener("pointerdown",(e=>this.onPointerdown_(e)))}addKeydownListener_(){if(!this.consumeKeydownEvent){return}this.boundKeydown_=this.boundKeydown_||this.onKeydown_.bind(this);this.addEventListener("keydown",this.boundKeydown_);document.body.addEventListener("keydown",this.boundKeydown_)}removeKeydownListener_(){if(!this.boundKeydown_){return}this.removeEventListener("keydown",this.boundKeydown_);document.body.removeEventListener("keydown",this.boundKeydown_);this.boundKeydown_=null}async showModal(){if(this.showOnAttach){const element=this.querySelector("[autofocus]");if(element&&element instanceof CrLitElement&&!element.shadowRoot){element.ensureInitialRender()}}this.$.dialog.showModal();assert(this.$.dialog.open);this.open=true;await this.updateComplete;this.fire("cr-dialog-open")}onCloseClick_(){this.cancel()}cancel(){this.fire("cancel");this.$.dialog.close();assert(!this.$.dialog.open);this.open=false}close(){this.$.dialog.close("success");assert(!this.$.dialog.open);this.open=false}setTitleAriaLabel(title){this.$.dialog.removeAttribute("aria-labelledby");this.$.dialog.setAttribute("aria-label",title)}onCloseKeypress_(e){e.stopPropagation()}onNativeDialogClose_(e){if(e.target!==this.getNative()){return}this.fire("close")}async onNativeDialogCancel_(e){if(e.target!==this.getNative()){return}this.open=false;await this.updateComplete;this.fire("cancel")}getNative(){return this.$.dialog}onKeypress_(e){if(e.key!=="Enter"){return}const accept=e.target===this||e.composedPath().some((el=>el.tagName==="CR-INPUT"&&el.type!=="search"));if(!accept){return}const actionButton=this.querySelector(".action-button:not([disabled]):not([hidden])");if(actionButton){actionButton.click();e.preventDefault()}}onKeydown_(e){assert(this.consumeKeydownEvent);if(!this.getNative().open){return}if(this.ignoreEnterKey&&e.key==="Enter"){return}e.stopPropagation()}onPointerdown_(e){if(e.button!==0||e.composedPath()[0].tagName!=="DIALOG"){return}this.$.dialog.animate([{transform:"scale(1)",offset:0},{transform:"scale(1.02)",offset:.4},{transform:"scale(1.02)",offset:.6},{transform:"scale(1)",offset:1}],{duration:180,easing:"ease-in-out",iterations:1});e.preventDefault()}focus(){const titleContainer=this.shadowRoot.querySelector(".title-container");assert(titleContainer);titleContainer.focus()}}customElements.define(CrDialogElement.is,CrDialogElement);let instance$H=null;function getCss$C(){return instance$H||(instance$H=[...[],css`:host{display:block;position:relative}:host([chunk-size='0']) #container>::slotted(*){box-sizing:border-box;contain-intrinsic-size:var(--list-item-size,100px) auto;content-visibility:auto;width:100%}:host(:not([chunk-size='0'])) #container>::slotted(.chunk){box-sizing:border-box;contain-intrinsic-size:calc(var(--chunk-size) * var(--list-item-size,100px)) auto;content-visibility:auto;width:100%}`])}class CrLazyListElement extends CrLitElement{static get is(){return"cr-lazy-list"}static get styles(){return getCss$C()}render(){const host=this.listItemHost===undefined?this.getRootNode().host:this.listItemHost;if(this.chunkSize===0){render(this.items.slice(0,this.numItemsDisplayed_).map(((item,index)=>this.template(item,index))),this,{host:host})}else{const chunks=Math.ceil(this.numItemsDisplayed_/this.chunkSize);const chunkArray=new Array(chunks).fill(0);render(chunkArray.map(((_item,index)=>html`
`)),this,{host:host});for(let chunkIndex=0;chunkIndexthis.template(item,start+index))),chunk,{host:host})}}return html`
`}static get properties(){return{chunkSize:{type:Number,reflect:true},items:{type:Array},itemSize:{type:Number},listItemHost:{type:Object},minViewportHeight:{type:Number},scrollOffset:{type:Number},scrollTarget:{type:Object},restoreFocusElement:{type:Object},template:{type:Object},numItemsDisplayed_:{state:true,type:Number}}}#items_accessor_storage=[];get items(){return this.#items_accessor_storage}set items(value){this.#items_accessor_storage=value}#itemSize_accessor_storage=undefined;get itemSize(){return this.#itemSize_accessor_storage}set itemSize(value){this.#itemSize_accessor_storage=value}#listItemHost_accessor_storage;get listItemHost(){return this.#listItemHost_accessor_storage}set listItemHost(value){this.#listItemHost_accessor_storage=value}#minViewportHeight_accessor_storage;get minViewportHeight(){return this.#minViewportHeight_accessor_storage}set minViewportHeight(value){this.#minViewportHeight_accessor_storage=value}#scrollOffset_accessor_storage=0;get scrollOffset(){return this.#scrollOffset_accessor_storage}set scrollOffset(value){this.#scrollOffset_accessor_storage=value}#scrollTarget_accessor_storage=document.documentElement;get scrollTarget(){return this.#scrollTarget_accessor_storage}set scrollTarget(value){this.#scrollTarget_accessor_storage=value}#restoreFocusElement_accessor_storage=null;get restoreFocusElement(){return this.#restoreFocusElement_accessor_storage}set restoreFocusElement(value){this.#restoreFocusElement_accessor_storage=value}#template_accessor_storage=()=>html``;get template(){return this.#template_accessor_storage}set template(value){this.#template_accessor_storage=value}#chunkSize_accessor_storage=0;get chunkSize(){return this.#chunkSize_accessor_storage}set chunkSize(value){this.#chunkSize_accessor_storage=value}#numItemsDisplayed__accessor_storage=0;get numItemsDisplayed_(){return this.#numItemsDisplayed__accessor_storage}set numItemsDisplayed_(value){this.#numItemsDisplayed__accessor_storage=value}lastItemsLength_=0;lastRenderedHeight_=0;resizeObserver_=null;scrollListener_=()=>this.onScroll_();willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("items")){this.lastItemsLength_=this.items.length;this.numItemsDisplayed_=this.items.length===0?0:Math.min(this.numItemsDisplayed_,this.items.length)}else{assert(this.items.length===this.lastItemsLength_,"Items array changed in place; rendered result may be incorrect.")}if(changedProperties.has("itemSize")){this.style.setProperty("--list-item-size",`${this.itemSize}px`)}if(changedProperties.has("chunkSize")){this.style.setProperty("--chunk-size",`${this.chunkSize}`)}}updated(changedProperties){super.updated(changedProperties);let itemsChanged=false;if(changedProperties.has("items")||changedProperties.has("minViewportHeight")||changedProperties.has("scrollOffset")){const previous=changedProperties.get("items");if(previous!==undefined||this.items.length!==0){this.onItemsChanged_();itemsChanged=true}}if(changedProperties.has("scrollTarget")){this.addRemoveScrollTargetListeners_(changedProperties.get("scrollTarget")||null);if(this.scrollTarget&&this.items.length>0&&!itemsChanged){this.fillCurrentViewport()}}}fillCurrentViewport(){if(this.items.length===0){return Promise.resolve()}return this.update_(this.$.container.style.height==="0px")}async ensureItemRendered(index){if(index{requestAnimationFrame((()=>{const newHeight=this.getViewHeight_();if(newHeight>0&&newHeight!==this.lastRenderedHeight_){this.fillCurrentViewport()}}))}));this.resizeObserver_.observe(this.scrollTarget)}}shouldRestoreFocus_(){if(!this.restoreFocusElement){return false}const active=getDeepActiveElement();return this.restoreFocusElement===active||!!this.restoreFocusElement.shadowRoot&&this.restoreFocusElement.shadowRoot.activeElement===active}async onItemsChanged_(){if(this.items.length>0){const restoreFocus=this.shouldRestoreFocus_();await this.update_(true);if(restoreFocus){setTimeout((()=>{if(!this.restoreFocusElement){return}this.restoreFocusElement.focus();this.fire("focus-restored-for-test")}),0)}}else{this.$.container.style.height="0px";this.fire("items-rendered");this.fire("viewport-filled")}}getScrollTop_(){return this.scrollTarget===document.documentElement?window.pageYOffset:this.scrollTarget.scrollTop}getViewHeight_(){const offsetHeight=this.scrollTarget===document.documentElement?window.innerHeight:this.scrollTarget.offsetHeight;return this.getScrollTop_()-this.scrollOffset+Math.max(this.minViewportHeight||0,offsetHeight)}async update_(forceUpdateHeight){if(!this.scrollTarget){return}const height=this.getViewHeight_();if(height<=0){return}const added=await this.fillViewHeight_(height);this.fire("items-rendered");if(added||forceUpdateHeight){await this.updateHeight_();this.fire("viewport-filled")}}async fillViewHeight_(height){this.fire("fill-height-start");this.lastRenderedHeight_=height;assert(this.items.length);const initialDomItemCount=this.domItems().length;if(initialDomItemCount===0){await this.updateNumItemsDisplayed_(1)}const itemHeight=this.domItemAverageHeight_();if(itemHeight===0){this.lastRenderedHeight_=0;return false}const desiredDomItemCount=Math.min(Math.ceil(height/itemHeight),this.items.length);if(desiredDomItemCount>this.numItemsDisplayed_){await this.updateNumItemsDisplayed_(desiredDomItemCount)}const added=initialDomItemCount!==desiredDomItemCount;if(added){this.fire("fill-height-end")}return added}async updateNumItemsDisplayed_(itemsToDisplay){this.numItemsDisplayed_=itemsToDisplay;if(this.numItemsDisplayed_>200&&this.chunkSize<2){console.warn(`cr-lazy-list: ${this.numItemsDisplayed_} list items rendered. `+"If this is expected, consider chunking mode (chunkSize > 1) "+"to improve scrolling performance.")}await this.updateComplete}domItems(){return this.chunkSize===0?this.$.slot.assignedElements():Array.from(this.querySelectorAll(".chunk > *"))}domItemAverageHeight_(){assert(this.items.length>0);const domItems=this.domItems();assert(domItems.length>0);const firstDomItem=domItems.at(0);const lastDomItem=domItems.at(-1);const lastDomItemHeight=lastDomItem.offsetHeight;if(firstDomItem===lastDomItem&&lastDomItemHeight===0){return 0}else if(this.itemSize){return this.itemSize}let totalHeight=lastDomItem.offsetTop+lastDomItemHeight;if(this.chunkSize>0){totalHeight+=lastDomItem.offsetParent.offsetTop-firstDomItem.offsetParent.offsetTop}else{totalHeight-=firstDomItem.offsetTop}return totalHeight/domItems.length}async updateHeight_(){await new Promise((resolve=>setTimeout(resolve,0)));const estScrollHeight=this.items.length>0?this.items.length*this.domItemAverageHeight_():0;this.$.container.style.height=estScrollHeight+"px"}async onScroll_(){const scrollTop=this.getScrollTop_();if(scrollTop<=0||this.numItemsDisplayed_===this.items.length){return}await this.fillCurrentViewport()}}customElements.define(CrLazyListElement.is,CrLazyListElement);let instance$G=null;function getCss$B(){return instance$G||(instance$G=[...[],css`:host{display:block;position:relative}:host([using-default-scroll-target]){overflow-y:auto}`])}class CrInfiniteListElement extends CrLitElement{static get is(){return"cr-infinite-list"}static get styles(){return getCss$B()}render(){render(html` `,this,{host:this});return html``}static get properties(){return{chunkSize:{type:Number},scrollOffset:{type:Number},scrollTarget:{type:Object},usingDefaultScrollTarget:{type:Boolean,reflect:true},items:{type:Array},focusedIndex:{type:Number},itemSize:{type:Number},template:{type:Object}}}#chunkSize_accessor_storage=0;get chunkSize(){return this.#chunkSize_accessor_storage}set chunkSize(value){this.#chunkSize_accessor_storage=value}#scrollOffset_accessor_storage=0;get scrollOffset(){return this.#scrollOffset_accessor_storage}set scrollOffset(value){this.#scrollOffset_accessor_storage=value}#scrollTarget_accessor_storage=this;get scrollTarget(){return this.#scrollTarget_accessor_storage}set scrollTarget(value){this.#scrollTarget_accessor_storage=value}#usingDefaultScrollTarget_accessor_storage=true;get usingDefaultScrollTarget(){return this.#usingDefaultScrollTarget_accessor_storage}set usingDefaultScrollTarget(value){this.#usingDefaultScrollTarget_accessor_storage=value}#items_accessor_storage=[];get items(){return this.#items_accessor_storage}set items(value){this.#items_accessor_storage=value}#itemSize_accessor_storage=undefined;get itemSize(){return this.#itemSize_accessor_storage}set itemSize(value){this.#itemSize_accessor_storage=value}#template_accessor_storage=()=>html``;get template(){return this.#template_accessor_storage}set template(value){this.#template_accessor_storage=value}#focusedIndex_accessor_storage=-1;get focusedIndex(){return this.#focusedIndex_accessor_storage}set focusedIndex(value){this.#focusedIndex_accessor_storage=value}restoreFocus_=false;willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("scrollTarget")){this.usingDefaultScrollTarget=this.scrollTarget===this}if(changedProperties.has("items")){if(this.isFocusWithinList_()){this.restoreFocus_=true}if(this.focusedIndex>=this.items.length){this.focusedIndex=this.items.length-1}else if(this.focusedIndex===-1&&this.items.length>0){this.focusedIndex=0}}}isFocusWithinList_(){if(this.focusedIndex===-1){return false}const list=this.querySelector("cr-lazy-list");assert(list);const renderedItems=list.domItems();if(renderedItems.length<=this.focusedIndex){return false}return renderedItems[this.focusedIndex].matches(":focus-within")}fillCurrentViewport(){const list=this.querySelector("cr-lazy-list");assert(list);return list.fillCurrentViewport()}ensureItemRendered(index){const list=this.querySelector("cr-lazy-list");assert(list);return list.ensureItemRendered(index)}onViewportFilled_(){if(!this.restoreFocus_){return}this.restoreFocus_=false;this.fire("restore-list-focus");setTimeout((async()=>{if(this.focusedIndex>=0&&this.focusedIndexitem===e.target||item.contains(e.target)||item.shadowRoot?.activeElement===e.target));if(focusedIdx!==-1){this.focusedIndex=focusedIdx}}async onKeyDown_(e){if(e.shiftKey||e.key!=="ArrowUp"&&e.key!=="ArrowDown"){return}e.stopPropagation();e.preventDefault();const newIndex=e.key==="ArrowUp"?Math.max(0,this.focusedIndex-1):Math.min(this.items.length-1,this.focusedIndex+1);if(newIndex===this.focusedIndex){return}this.focusedIndex=newIndex;await this.updateComplete;const list=this.querySelector("cr-lazy-list");assert(list);const element=await list.ensureItemRendered(this.focusedIndex);element.focus();element.scrollIntoViewIfNeeded()}}customElements.define(CrInfiniteListElement.is,CrInfiniteListElement);class CrLazyRenderElement extends PolymerElement{static get is(){return"cr-lazy-render"}static get template(){return html$1``}child_=null;instance_=null;get(){if(!this.child_){this.render_()}assert(this.child_);return this.child_}getIfExists(){return this.child_}render_(){const template=this.shadowRoot.querySelector("slot").assignedNodes({flatten:true}).filter((n=>n.nodeType===Node.ELEMENT_NODE))[0];const TemplateClass=templatize(template,this,{mutableData:false,forwardHostProp:this._forwardHostPropV2});const parentNode=this.parentNode;if(parentNode&&!this.child_){this.instance_=new TemplateClass;this.child_=this.instance_.root.firstElementChild;parentNode.insertBefore(this.instance_.root,this)}}_forwardHostPropV2(prop,value){if(this.instance_){this.instance_.forwardHostProp(prop,value)}}}customElements.define(CrLazyRenderElement.is,CrLazyRenderElement);let instance$F=null;function getCss$A(){return instance$F||(instance$F=[...[],css`:host{--cr-toast-background:var(--color-toast-background,var(--cr-fallback-color-inverse-surface));--cr-toast-button-color:var(--color-toast-button,var(--cr-fallback-color-inverse-primary));--cr-toast-text-color:var(--color-toast-foreground,var(--cr-fallback-color-inverse-on-surface));--cr-focus-outline-color:var(--cr-focus-outline-inverse-color);align-items:center;background:var(--cr-toast-background);border-radius:8px;bottom:0;box-shadow:0 2px 4px 0 rgba(0,0,0,0.28);box-sizing:border-box;display:flex;line-height:20px;margin:24px;max-width:var(--cr-toast-max-width,568px);min-height:52px;min-width:288px;opacity:0;padding:0 16px;position:fixed;transform:translateY(100px);transition:opacity 300ms,transform 300ms;visibility:hidden;z-index:1}:host-context([dir=ltr]){left:0}:host-context([dir=rtl]){right:0}:host([open]){opacity:1;transform:translateY(0);visibility:visible}:host(:not([open])) ::slotted(*){display:none}:host ::slotted(*){color:var(--cr-toast-text-color)}:host ::slotted(cr-button){background-color:transparent !important;border:none !important;color:var(--cr-toast-button-color) !important;margin-inline-start:32px !important;min-width:52px !important;padding:8px !important}:host ::slotted(cr-button:hover){background-color:transparent !important}::slotted(cr-button:last-of-type){margin-inline-end:-8px}`])}function getHtml$y(){return html``}class CrToastElement extends CrLitElement{static get is(){return"cr-toast"}static get styles(){return getCss$A()}render(){return getHtml$y.bind(this)()}static get properties(){return{duration:{type:Number},open:{type:Boolean,reflect:true}}}#duration_accessor_storage=0;get duration(){return this.#duration_accessor_storage}set duration(value){this.#duration_accessor_storage=value}#open_accessor_storage=false;get open(){return this.#open_accessor_storage}set open(value){this.#open_accessor_storage=value}hideTimeoutId_=null;constructor(){super();this.addEventListener("focusin",this.clearTimeout_);this.addEventListener("focusout",this.resetAutoHide_)}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("duration")||changedProperties.has("open")){this.resetAutoHide_()}}clearTimeout_(){if(this.hideTimeoutId_!==null){window.clearTimeout(this.hideTimeoutId_);this.hideTimeoutId_=null}}resetAutoHide_(){this.clearTimeout_();if(this.open&&this.duration!==0){this.hideTimeoutId_=window.setTimeout((()=>{this.hide()}),this.duration)}}async show(){const shouldResetAutohide=this.open;this.removeAttribute("role");this.open=true;await this.updateComplete;this.setAttribute("role","alert");if(shouldResetAutohide){this.resetAutoHide_()}}async hide(){this.open=false;await this.updateComplete}}customElements.define(CrToastElement.is,CrToastElement);let instance$E=null;function getCss$z(){return instance$E||(instance$E=[...[getCss$N()],css`:host{color:var(--cr-primary-text-color);display:block;font-size:0.875rem}:host([is-empty]){padding-block:80px}cr-dialog::part(dialog){--cr-dialog-width:min(calc(100% - 32px),512px)}:host([in-side-panel_]) cr-toast{margin:16px}#clusters{margin:0 auto;max-width:var(--cluster-max-width);min-width:var(--cluster-min-width);padding:var(--first-cluster-padding-top) var(--cluster-padding-horizontal) 0}:host([in-side-panel_]) #clusters{min-width:0;padding:0}:host(:not([in-side-panel_])) history-cluster{overflow-clip-margin:8px}:host-context(.focus-outline-visible) history-cluster:focus,history-cluster:focus-visible{outline:none}:host([in-side-panel_]) history-cluster{border-bottom:none}:host([in-side-panel_]) history-cluster[is-last]{border-bottom:none}#placeholder{align-items:center;color:var(--md-loading-message-color);display:flex;flex:1;font-size:inherit;font-weight:500;height:100%;justify-content:center}#footer{display:flex;justify-content:center;padding:0 var(--cluster-padding-horizontal) var(--cluster-padding-vertical)}:host([in-side-panel_]) #footer{padding-top:var(--cluster-padding-vertical)}:host([in-side-panel_]) cr-dialog{--cr-dialog-background-color:var(--color-history-clusters-side-panel-dialog-background);--cr-primary-text-color:var(--color-history-clusters-side-panel-dialog-primary-foreground);--cr-secondary-text-color:var(--color-history-clusters-side-panel-dialog-secondary-foreground);--cr-dialog-title-font-size:16px;--cr-dialog-title-slot-padding-bottom:8px;font-weight:500}:host([in-side-panel_]) cr-dialog::part(dialog){--cr-scrollable-border-color:var(--color-history-clusters-side-panel-dialog-divider);border-radius:12px;box-shadow:var(--cr-elevation-3)}.spinner-icon{height:100%;width:100%}`])}function getHtml$x(){return html`
${this.computePlaceholderText_()}
`}"> ${this.showConfirmationDialog_?html`
${this.i18n("removeSelected")}
${this.i18n("deleteWarning")}
${this.i18n("cancel")} ${this.i18n("deleteConfirm")}
`:""}
${this.i18n("removeFromHistoryToast")}
`}function jsDateToMojoDate$1(date){const windowsEpoch=Date.UTC(1601,0,1,0,0,0,0);const unixEpoch=Date.UTC(1970,0,1,0,0,0,0);const epochDeltaInMs=unixEpoch-windowsEpoch;const internalValue=BigInt(date.valueOf()+epochDeltaInMs)*BigInt(1e3);return{internalValue:internalValue}}const HistoryClustersElementBase=I18nMixinLit(CrLitElement);class HistoryClustersElement extends HistoryClustersElementBase{static get is(){return"history-clusters"}static get styles(){return getCss$z()}render(){return getHtml$x.bind(this)()}static get properties(){return{inSidePanel_:{type:Boolean,reflect:true},query:{type:String},timeRangeStart:{type:Object},canLoadMore_:{type:Boolean},clusters_:{type:Array},hasResult_:{type:Boolean},resultQuery_:{type:String},showSpinner_:{type:Boolean},showConfirmationDialog_:{type:Boolean},visitsToBeRemoved_:{type:Array},scrollOffset:{type:Number},scrollTarget:{type:Object},isActive:{type:Boolean,reflect:true},isEmpty:{type:Boolean,reflect:true}}}#isActive_accessor_storage=true;get isActive(){return this.#isActive_accessor_storage}set isActive(value){this.#isActive_accessor_storage=value}#isEmpty_accessor_storage=true;get isEmpty(){return this.#isEmpty_accessor_storage}set isEmpty(value){this.#isEmpty_accessor_storage=value}#query_accessor_storage="";get query(){return this.#query_accessor_storage}set query(value){this.#query_accessor_storage=value}#scrollOffset_accessor_storage=0;get scrollOffset(){return this.#scrollOffset_accessor_storage}set scrollOffset(value){this.#scrollOffset_accessor_storage=value}#scrollTarget_accessor_storage=document.documentElement;get scrollTarget(){return this.#scrollTarget_accessor_storage}set scrollTarget(value){this.#scrollTarget_accessor_storage=value}#timeRangeStart_accessor_storage;get timeRangeStart(){return this.#timeRangeStart_accessor_storage}set timeRangeStart(value){this.#timeRangeStart_accessor_storage=value}#canLoadMore__accessor_storage=false;get canLoadMore_(){return this.#canLoadMore__accessor_storage}set canLoadMore_(value){this.#canLoadMore__accessor_storage=value}#clusters__accessor_storage=[];get clusters_(){return this.#clusters__accessor_storage}set clusters_(value){this.#clusters__accessor_storage=value}#hasResult__accessor_storage=false;get hasResult_(){return this.#hasResult__accessor_storage}set hasResult_(value){this.#hasResult__accessor_storage=value}#resultQuery__accessor_storage="";get resultQuery_(){return this.#resultQuery__accessor_storage}set resultQuery_(value){this.#resultQuery__accessor_storage=value}browserProxy_;#inSidePanel__accessor_storage=loadTimeData.getBoolean("inSidePanel");get inSidePanel_(){return this.#inSidePanel__accessor_storage}set inSidePanel_(value){this.#inSidePanel__accessor_storage=value}lastOffsetHeight_=0;resizeObserver_=new ResizeObserver((()=>{if(this.lastOffsetHeight_===0){this.lastOffsetHeight_=this.scrollTarget.offsetHeight;return}if(this.scrollTarget.offsetHeight>this.lastOffsetHeight_){this.lastOffsetHeight_=this.scrollTarget.offsetHeight;this.onScrollOrResize_()}}));scrollDebounce_=200;scrollListener_=()=>this.onScrollOrResize_();onClustersQueryResultListenerId_=null;onClusterImageUpdatedListenerId_=null;onVisitsRemovedListenerId_=null;onHistoryDeletedListenerId_=null;onQueryChangedByUserListenerId_=null;#showConfirmationDialog__accessor_storage=false;get showConfirmationDialog_(){return this.#showConfirmationDialog__accessor_storage}set showConfirmationDialog_(value){this.#showConfirmationDialog__accessor_storage=value}#showSpinner__accessor_storage=false;get showSpinner_(){return this.#showSpinner__accessor_storage}set showSpinner_(value){this.#showSpinner__accessor_storage=value}scrollTimeout_=null;#visitsToBeRemoved__accessor_storage=[];get visitsToBeRemoved_(){return this.#visitsToBeRemoved__accessor_storage}set visitsToBeRemoved_(value){this.#visitsToBeRemoved__accessor_storage=value}constructor(){super();this.browserProxy_=browserProxyFactory$4.getInstance()}connectedCallback(){super.connectedCallback();FocusOutlineManager.forDocument(document);this.onClustersQueryResultListenerId_=this.browserProxy_.callbackRouter.onClustersQueryResult.addListener(this.onClustersQueryResult_.bind(this));this.onClusterImageUpdatedListenerId_=this.browserProxy_.callbackRouter.onClusterImageUpdated.addListener(this.onClusterImageUpdated_.bind(this));this.onVisitsRemovedListenerId_=this.browserProxy_.callbackRouter.onVisitsRemoved.addListener(this.onVisitsRemoved_.bind(this));this.onHistoryDeletedListenerId_=this.browserProxy_.callbackRouter.onHistoryDeleted.addListener(this.onHistoryDeleted_.bind(this));this.onQueryChangedByUserListenerId_=this.browserProxy_.callbackRouter.onQueryChangedByUser.addListener(this.onQueryChangedByUser_.bind(this));if(this.inSidePanel_){this.browserProxy_.handler.showSidePanelUI()}}disconnectedCallback(){super.disconnectedCallback();assert(this.onClustersQueryResultListenerId_);this.browserProxy_.callbackRouter.removeListener(this.onClustersQueryResultListenerId_);this.onClustersQueryResultListenerId_=null;assert(this.onVisitsRemovedListenerId_);this.browserProxy_.callbackRouter.removeListener(this.onVisitsRemovedListenerId_);this.onVisitsRemovedListenerId_=null;assert(this.onHistoryDeletedListenerId_);this.browserProxy_.callbackRouter.removeListener(this.onHistoryDeletedListenerId_);this.onHistoryDeletedListenerId_=null;assert(this.onQueryChangedByUserListenerId_);this.browserProxy_.callbackRouter.removeListener(this.onQueryChangedByUserListenerId_);this.onQueryChangedByUserListenerId_=null;assert(this.onClusterImageUpdatedListenerId_);this.browserProxy_.callbackRouter.removeListener(this.onClusterImageUpdatedListenerId_);this.onClusterImageUpdatedListenerId_=null}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("query")||changedProperties.has("timeRangeStart")){this.onQueryChanged_()}const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("hasResult_")||changedPrivateProperties.has("clusters_")){this.isEmpty=this.hasResult_&&this.clusters_.length===0}}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("scrollTarget")){const oldTarget=changedProperties.get("scrollTarget");if(oldTarget){this.resizeObserver_.disconnect();if(this.isActive||changedProperties.has("isActive")){oldTarget.removeEventListener("scroll",this.scrollListener_)}}if(this.scrollTarget){this.resizeObserver_.observe(this.scrollTarget);if(this.isActive){this.scrollTarget.addEventListener("scroll",this.scrollListener_)}}}else if(changedProperties.has("isActive")){if(this.isActive){this.scrollTarget.addEventListener("scroll",this.scrollListener_)}else{this.scrollTarget.removeEventListener("scroll",this.scrollListener_)}}const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("clusters_")){const previous=changedPrivateProperties.get("clusters_");const clustersRemoved=previous&&previous.length>this.clusters_.length;if(clustersRemoved&&this.canLoadMore_&&this.$.clusters.offsetHeight{requestIdleCallback((()=>{resolve()}))}))}onClustersQueryResult_(result){this.hasResult_=true;this.canLoadMore_=result.canLoadMore;if(result.isContinuation){this.clusters_=[...this.clusters_.slice(),...result.clusters]}else{this.scrollTarget.scrollTop=0;this.clusters_=result.clusters;this.resultQuery_=result.query}this.onBrowserIdle_().then((()=>{if((this.$.clusters.offsetHeight{if(this.hasResult_&&this.canLoadMore_){this.canLoadMore_=false}this.browserProxy_.handler.startQueryClusters(this.query.trim(),this.timeRangeStart?jsDateToMojoDate$1(this.timeRangeStart):null,new URLSearchParams(window.location.search).has("recluster"))}))}onVisitsRemoved_(removedVisits){if(removedVisits.length===1){this.$.confirmationToast.show()}}onHistoryDeleted_(){this.onQueryChanged_()}onQueryChangedByUser_(query){this.fire("query-changed-by-user",query)}onScrollOrResize_(){if(this.scrollTimeout_){clearTimeout(this.scrollTimeout_)}this.scrollTimeout_=setTimeout((()=>this.onScrollTimeout_()),this.scrollDebounce_)}onScrollTimeout_(){this.scrollTimeout_=null;const lowerScroll=this.scrollTarget.scrollHeight-this.scrollTarget.scrollTop-this.scrollTarget.offsetHeight;if(lowerScroll<500){this.onScrolledToBottom_()}}removeVisits_(){this.browserProxy_.handler.removeVisits(this.visitsToBeRemoved_).then((()=>{this.visitsToBeRemoved_=[]}))}}customElements.define(HistoryClustersElement.is,HistoryClustersElement);let instance$D=null;function getCss$y(){return instance$D||(instance$D=[...[],css`:host{--cr-chip-border-radius:8px;--cr-chip-color:var(--color-chip-foreground,var(--cr-fallback-color-on-surface));--cr-chip-font-size:12px;--cr-chip-height:28px}button{--cr-icon-button-margin-start:0;--cr-icon-color:var(--color-chip-icon,var(--cr-fallback-color-primary));--cr-icon-ripple-margin:0;--cr-icon-ripple-size:16px;--cr-icon-size:contain;--iron-icon-fill-color:var(--color-chip-icon,var(--cr-fallback-color-primary));--iron-icon-height:16px;--iron-icon-width:16px;align-items:center;appearance:none;background-color:transparent;border:1px solid var(--color-chip-border,var(--cr-fallback-color-tonal-outline));border-radius:var(--cr-chip-border-radius);color:var(--cr-chip-color);cursor:pointer;font-family:inherit;display:flex;flex-direction:row;font-size:var(--cr-chip-font-size);font-weight:500;gap:4px;height:var(--cr-chip-height);overflow:hidden;padding:0 8px;position:relative;white-space:nowrap}button:not(:is([disabled],[selected])):hover{background-color:transparent;border-color:var(--color-chip-border,var(--cr-fallback-color-tonal-outline))}button:focus-visible{outline:solid 2px var(--cr-focus-outline-color);outline-offset:2px}button[disabled]{cursor:default;opacity:var(--cr-disabled-opacity)}button[selected]{--cr-icon-color:var(--color-chip-icon-selected,var(--cr-fallback-color-on-tonal-container));--iron-icon-fill-color:var(--color-chip-icon-selected,var(--cr-fallback-color-on-tonal-container));background-color:var(--color-chip-background-selected,var(--cr-fallback-color-tonal-container));border-color:var(--color-chip-background-selected,var(--cr-fallback-color-tonal-container));color:var(--color-chip-foreground-selected,var(--cr-fallback-color-on-tonal-container));padding:0 8px}#hoverLayer{display:none}button:hover #hoverLayer{background:var(--cr-hover-on-subtle-background-color);display:block;inset:0;pointer-events:none;position:absolute}#ink{--paper-ripple-opacity:1;color:var(--cr-active-neutral-on-subtle-background-color);display:block}`])}function getHtml$w(){return html` `}const CrChipElementBase=CrRippleMixin(CrLitElement);class CrChipElement extends CrChipElementBase{static get is(){return"cr-chip"}static get styles(){return getCss$y()}render(){return getHtml$w.bind(this)()}static get properties(){return{disabled:{type:Boolean},chipAriaLabel:{type:String},chipRole:{type:String},selected:{type:Boolean,reflect:true}}}#disabled_accessor_storage=false;get disabled(){return this.#disabled_accessor_storage}set disabled(value){this.#disabled_accessor_storage=value}#chipAriaLabel_accessor_storage="";get chipAriaLabel(){return this.#chipAriaLabel_accessor_storage}set chipAriaLabel(value){this.#chipAriaLabel_accessor_storage=value}#chipRole_accessor_storage="";get chipRole(){return this.#chipRole_accessor_storage}set chipRole(value){this.#chipRole_accessor_storage=value}#selected_accessor_storage=false;get selected(){return this.#selected_accessor_storage}set selected(value){this.#selected_accessor_storage=value}constructor(){super();this.ensureRippleOnPointerdown()}createRipple(){this.rippleContainer=this.shadowRoot.querySelector("button");return super.createRipple()}}customElements.define(CrChipElement.is,CrChipElement);let instance$C=null;function getCss$x(){return instance$C||(instance$C=[...[],css`.md-select{--md-arrow-width:7px;--md-select-bg-color:transparent;--md-select-option-bg-color:white;--md-select-side-padding:10px;--md-select-text-color:inherit;-webkit-appearance:none;background:url(//resources/images/arrow_down.svg) calc(100% - var(--md-select-side-padding)) center no-repeat;background-color:var(--md-select-bg-color);background-size:var(--md-arrow-width);border:solid 1px var(--color-combobox-container-outline,var(--cr-fallback-color-neutral-outline));border-radius:8px;box-sizing:border-box;color:var(--md-select-text-color);cursor:pointer;font-family:inherit;font-size:12px;height:36px;max-width:100%;outline:none;padding-block-end:0;padding-block-start:0;padding-inline-end:calc(var(--md-select-side-padding) + var(--md-arrow-width) + 3px);padding-inline-start:var(--md-select-side-padding);width:var(--md-select-width,200px)}@media (prefers-color-scheme:dark){.md-select{--md-select-option-bg-color:var(--google-grey-900-white-4-percent);background-image:url(//resources/images/dark/arrow_down.svg)}}.md-select:hover{background-color:var(--color-comboxbox-ink-drop-hovered,var(--cr-hover-on-subtle-background-color))}.md-select :-webkit-any(option,optgroup){background-color:var(--md-select-option-bg-color)}.md-select[disabled]{background-color:var(--color-combobox-background-disabled,var(--cr-fallback-color-disabled-background));border-color:transparent;color:var(--color-textfield-foreground-disabled,var(--cr-fallback-color-disabled-foreground));opacity:1;pointer-events:none}.md-select:focus{outline:solid 2px var(--cr-focus-outline-color);outline-offset:-1px}:host-context([dir=rtl]) .md-select{background-position-x:var(--md-select-side-padding)}`])}let instance$B=null;function getCss$w(){return instance$B||(instance$B=[...[getCss$x()],css`:host{display:flex;align-items:center;justify-content:flex-start;gap:12px}hr{margin:0;width:1px;height:20px;border:0;background:var(--color-history-embeddings-divider,var(--cr-fallback-color-divider))}#suggestions{display:flex;gap:8px}.suggestion-label{text-transform:lowercase}`])}function getHtml$v(){return html`
${this.suggestions_.map(((item,index)=>html` ${item.label} `))}
`}function generateSuggestions(){const yesterday=new Date;yesterday.setDate(yesterday.getDate()-1);yesterday.setHours(0,0,0,0);const last7Days=new Date;last7Days.setDate(last7Days.getDate()-7);last7Days.setHours(0,0,0,0);const last30Days=new Date;last30Days.setDate(last30Days.getDate()-30);last30Days.setHours(0,0,0,0);return[{label:loadTimeData.getString("historyEmbeddingsSuggestion1"),timeRangeStart:yesterday,ariaLabel:loadTimeData.getString("historyEmbeddingsSuggestion1AriaLabel")},{label:loadTimeData.getString("historyEmbeddingsSuggestion2"),timeRangeStart:last7Days,ariaLabel:loadTimeData.getString("historyEmbeddingsSuggestion2AriaLabel")},{label:loadTimeData.getString("historyEmbeddingsSuggestion3"),timeRangeStart:last30Days,ariaLabel:loadTimeData.getString("historyEmbeddingsSuggestion3AriaLabel")}]}const HistoryEmbeddingsFilterChipsElementElementBase=I18nMixinLit(CrLitElement);class HistoryEmbeddingsFilterChipsElement extends HistoryEmbeddingsFilterChipsElementElementBase{static get is(){return"cr-history-embeddings-filter-chips"}static get styles(){return getCss$w()}render(){return getHtml$v.bind(this)()}static get properties(){return{enableShowResultsByGroupOption:{type:Boolean},timeRangeStart:{type:Object},selectedSuggestion:{type:Object,notify:true},showResultsByGroup:{type:Boolean,notify:true},suggestions_:{type:Array}}}#enableShowResultsByGroupOption_accessor_storage=false;get enableShowResultsByGroupOption(){return this.#enableShowResultsByGroupOption_accessor_storage}set enableShowResultsByGroupOption(value){this.#enableShowResultsByGroupOption_accessor_storage=value}#selectedSuggestion_accessor_storage;get selectedSuggestion(){return this.#selectedSuggestion_accessor_storage}set selectedSuggestion(value){this.#selectedSuggestion_accessor_storage=value}#showResultsByGroup_accessor_storage=false;get showResultsByGroup(){return this.#showResultsByGroup_accessor_storage}set showResultsByGroup(value){this.#showResultsByGroup_accessor_storage=value}#suggestions__accessor_storage=generateSuggestions();get suggestions_(){return this.#suggestions__accessor_storage}set suggestions_(value){this.#suggestions__accessor_storage=value}#timeRangeStart_accessor_storage;get timeRangeStart(){return this.#timeRangeStart_accessor_storage}set timeRangeStart(value){this.#timeRangeStart_accessor_storage=value}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("timeRangeStart")){this.onTimeRangeStartChanged_()}}isSuggestionSelected_(suggestion){return this.selectedSuggestion===suggestion}onShowByGroupSelectMenuChange_(){this.showResultsByGroup=this.$.showByGroupSelectMenu.value==="true"}onTimeRangeStartChanged_(){if(this.timeRangeStart?.getTime()===this.selectedSuggestion?.timeRangeStart.getTime()){return}this.selectedSuggestion=this.suggestions_.find((suggestion=>suggestion.timeRangeStart.getTime()===this.timeRangeStart?.getTime()))}onSuggestionClick_(e){const index=Number(e.currentTarget.dataset["index"]);const clickedSuggestion=this.suggestions_[index];assert(clickedSuggestion);if(this.isSuggestionSelected_(clickedSuggestion)){this.selectedSuggestion=undefined}else{this.selectedSuggestion=clickedSuggestion}}}customElements.define(HistoryEmbeddingsFilterChipsElement.is,HistoryEmbeddingsFilterChipsElement);class CrLazyRenderLitElement extends CrLitElement{static get is(){return"cr-lazy-render-lit"}render(){if(this.rendered_){render(this.template(),this.parentNode,{host:this.getRootNode().host,renderBefore:this})}return html``}static get properties(){return{template:{type:Object},rendered_:{type:Boolean,state:true}}}#rendered__accessor_storage=false;get rendered_(){return this.#rendered__accessor_storage}set rendered_(value){this.#rendered__accessor_storage=value}#template_accessor_storage=()=>html``;get template(){return this.#template_accessor_storage}set template(value){this.#template_accessor_storage=value}child_=null;get(){if(!this.rendered_){this.rendered_=true;this.performUpdate();this.child_=this.previousElementSibling}assert(this.child_);return this.child_}getIfExists(){return this.child_}}customElements.define(CrLazyRenderLitElement.is,CrLazyRenderLitElement);let instance$A=null;function getCss$v(){return instance$A||(instance$A=[...[],css`.buttons{--cr-feedback-buttons-icon-size_:16px;display:grid;grid-auto-columns:var(--cr-feedback-buttons-icon-size_);grid-auto-rows:var(--cr-feedback-buttons-icon-size_);grid-auto-flow:column;gap:12px;align-items:center;justify-items:center}cr-icon-button{--cr-icon-button-fill-color:currentColor;--cr-icon-button-icon-size:var(--cr-feedback-buttons-icon-size_);--cr-icon-button-size:24px;margin:0}`])}function getHtml$u(){return html`
`}var CrFeedbackOption;(function(CrFeedbackOption){CrFeedbackOption[CrFeedbackOption["THUMBS_DOWN"]=0]="THUMBS_DOWN";CrFeedbackOption[CrFeedbackOption["THUMBS_UP"]=1]="THUMBS_UP";CrFeedbackOption[CrFeedbackOption["UNSPECIFIED"]=2]="UNSPECIFIED"})(CrFeedbackOption||(CrFeedbackOption={}));class CrFeedbackButtonsElement extends CrLitElement{static get is(){return"cr-feedback-buttons"}static get styles(){return getCss$v()}render(){return getHtml$u.bind(this)()}static get properties(){return{selectedOption:{type:Number},thumbsDownLabel_:{type:String},thumbsUpLabel_:{type:String},disabled:{type:Boolean}}}#selectedOption_accessor_storage=CrFeedbackOption.UNSPECIFIED;get selectedOption(){return this.#selectedOption_accessor_storage}set selectedOption(value){this.#selectedOption_accessor_storage=value}#thumbsDownLabel__accessor_storage=loadTimeData.getString("thumbsDown");get thumbsDownLabel_(){return this.#thumbsDownLabel__accessor_storage}set thumbsDownLabel_(value){this.#thumbsDownLabel__accessor_storage=value}#thumbsUpLabel__accessor_storage=loadTimeData.getString("thumbsUp");get thumbsUpLabel_(){return this.#thumbsUpLabel__accessor_storage}set thumbsUpLabel_(value){this.#thumbsUpLabel__accessor_storage=value}#disabled_accessor_storage=false;get disabled(){return this.#disabled_accessor_storage}set disabled(value){this.#disabled_accessor_storage=value}getThumbsDownAriaPressed_(){return this.selectedOption===CrFeedbackOption.THUMBS_DOWN}getThumbsDownIcon_(){return this.selectedOption===CrFeedbackOption.THUMBS_DOWN?"cr:thumb-down-filled":"cr:thumb-down"}getThumbsUpAriaPressed_(){return this.selectedOption===CrFeedbackOption.THUMBS_UP}getThumbsUpIcon_(){return this.selectedOption===CrFeedbackOption.THUMBS_UP?"cr:thumb-up-filled":"cr:thumb-up"}async notifySelectedOptionChanged_(){await this.updateComplete;this.fire("selected-option-changed",{value:this.selectedOption})}onThumbsDownClick_(){this.selectedOption=this.selectedOption===CrFeedbackOption.THUMBS_DOWN?CrFeedbackOption.UNSPECIFIED:CrFeedbackOption.THUMBS_DOWN;this.notifySelectedOptionChanged_()}onThumbsUpClick_(){this.selectedOption=this.selectedOption===CrFeedbackOption.THUMBS_UP?CrFeedbackOption.UNSPECIFIED:CrFeedbackOption.THUMBS_UP;this.notifySelectedOptionChanged_()}}customElements.define(CrFeedbackButtonsElement.is,CrFeedbackButtonsElement);let instance$z=null;function getCss$u(){return instance$z||(instance$z=[...[],css`:host{--cr-loading-gradient-color-start:var(--color-loading-gradient-start,transparent);--cr-loading-gradient-color-middle:var(--color-loading-gradient-middle,var(--cr-fallback-color-primary-container));--cr-loading-gradient-color-end:var(--color-loading-gradient-end,rgb(231,248,237));display:flex;width:100%;height:fit-content;position:relative}@media (prefers-color-scheme:dark){:host{--cr-loading-gradient-color-end:var(--color-loading-gradient-end,rgb(15,82,35))}}#gradient{position:absolute;inset:0;background:linear-gradient(135deg,var(--cr-loading-gradient-color-start) 0%,var(--cr-loading-gradient-color-middle) 20%,var(--cr-loading-gradient-color-end) 40%,var(--cr-loading-gradient-color-start) 60%,var(--cr-loading-gradient-color-middle) 80%,var(--cr-loading-gradient-color-end) 100%);background-position:100% 100%;background-size:250% 250%;animation:gradient 2s infinite linear}@keyframes gradient{0%{background-position:100% 100%}100%{background-position:0% 0%}}`])}function getHtml$t(){return html`
`}let count=0;class CrLoadingGradientElement extends CrLitElement{static get is(){return"cr-loading-gradient"}static get styles(){return getCss$u()}render(){return getHtml$t.bind(this)()}onSlotchange_(){const clipPath=this.querySelector("svg clipPath");assert(clipPath);const generatedId=`crLoadingGradient${count++}`;clipPath.id=generatedId;this.style.clipPath=`url(#${generatedId})`}}customElements.define(CrLoadingGradientElement.is,CrLoadingGradientElement);const HOVERED_STYLE="hovered";const MouseHoverableMixinLit=superClass=>{class MouseHoverableMixinLit extends superClass{firstUpdated(changedProperties){super.firstUpdated(changedProperties);this.addEventListener("pointerenter",(e=>{const hostElement=e.currentTarget;hostElement.classList.toggle(HOVERED_STYLE,e.pointerType==="mouse")}));this.addEventListener("pointerleave",(e=>{if(e.pointerType!=="mouse"){return}const hostElement=e.currentTarget;hostElement.classList.remove(HOVERED_STYLE)}))}}return MouseHoverableMixinLit};let instance$y=null;function getCss$t(){return instance$y||(instance$y=[...[getCss$T(),getCss$P()],css`:host{box-sizing:border-box;display:block;position:relative;width:100%}#item{--cr-url-list-item-image-container-border_:2px solid white;--cr-url-list-item-image-container-border-radius_:5px;align-items:center;box-sizing:border-box;cursor:default;display:flex;height:var(--cr-url-list-item-height,48px);padding:var(--cr-url-list-item-padding,4px 16px);width:100%}@media (prefers-color-scheme:dark){#item{--cr-url-list-item-image-container-border_:2px solid black}}:host([size=compact]) #item{padding:var(--cr-url-list-item-padding,6px 16px);height:var(--cr-url-list-item-height,36px)}:host([size=large]) #item{padding:var(--cr-url-list-item-padding,6px 16px);height:var(--cr-url-list-item-height,68px)}:host([size=medium]) #item,:host([size=large]) #item{--cr-url-list-item-image-container-border-radius_:9px}:host(.hovered),:host([force-hover]){background:var(--cr-hover-background-color)}:host(.active),:host-context(.focus-outline-visible):host(:focus-within){background:var(--cr-active-background-color)}#anchor,#button{appearance:none;background:transparent;border:0;position:absolute;inset:0}#anchor:focus,#button:focus{outline:0}@media (forced-colors:active){#anchor:focus,#button:focus{outline:var(--cr-focus-outline-hcm)}}::slotted([slot=prefix]){margin-inline-end:16px}#iconContainer{align-items:center;background:var(--color-list-item-url-favicon-background,var(--cr-fallback-color-neutral-container));border-radius:4px;display:flex;flex-shrink:0;height:var(--cr-url-list-item-container-height,40px);justify-content:center;margin-inline-end:var(--cr-url-list-item-icon-margin-end,16px);overflow:hidden;width:var(--cr-url-list-item-container-width,40px)}:host([size=compact]) #iconContainer{height:24px;margin-inline-end:8px;width:24px}:host([is-folder_]) #iconContainer{background:var(--color-list-item-folder-icon-background,var(--cr-fallback-color-primary-container));color:var(--color-list-item-folder-icon-foreground,var(--cr-fallback-color-on-primary-container))}:host([size=large]) #iconContainer{height:56px;margin-inline-end:16px;width:56px}:host([size=medium]) #iconContainer,:host([size=large]) #iconContainer{border-radius:8px}#folder-icon{display:flex}.favicon{background-position:center center;background-repeat:no-repeat;height:16px;width:16px}:host([size=large]) .folder-and-count{align-items:center;display:grid;grid-template-columns:repeat(2,50%);grid-template-rows:repeat(2,50%);height:100%;justify-items:center;width:100%}.folder-and-count .image-container{border-bottom:var(--cr-url-list-item-image-container-border_);border-radius:0 var(--cr-url-list-item-image-container-border-radius_) 0 0;box-sizing:border-box;height:100%;width:100%}:host-context([dir=rtl]) .folder-and-count .image-container{border-radius:var(--cr-url-list-item-image-container-border-radius_) 0 0 0}.folder-and-count .image-container img{height:100%;object-fit:cover;opacity:95%;width:100%}.folder-and-count:not(:has(div:nth-child(3))) .image-container:first-of-type{border-bottom:none;border-inline-end:var(--cr-url-list-item-image-container-border_);border-radius:var(--cr-url-list-item-image-container-border-radius_) 0 0 var(--cr-url-list-item-image-container-border-radius_);grid-row:1/span 2}:host-context([dir=rtl]) .folder-and-count:not(:has(div:nth-child(3))) .image-container:first-of-type{border-radius:0 var(--cr-url-list-item-image-container-border-radius_) var(--cr-url-list-item-image-container-border-radius_) 0}.folder-and-count:not(:has(div:nth-child(2))) .image-container:first-of-type{border:none;border-radius:var(--cr-url-list-item-image-container-border-radius_);grid-column:1/span 2;grid-row:1/span 2}.folder{--cr-icon-color:currentColor;--cr-icon-size:20px;height:var(--cr-icon-size);margin:0;width:var(--cr-icon-size)}:host([size=compact]) .folder{--cr-icon-size:16px}.count{--cr-url-list-item-count-border-radius:4px;display:none}:host([size=large]) .count{align-items:center;background:var(--color-list-item-folder-icon-background,var(--cr-fallback-color-primary-container));border-radius:var(--cr-url-list-item-count-border-radius) 0 0 0;color:var(--color-list-item-folder-icon-foreground,var(--cr-fallback-color-on-primary-container));display:flex;font-weight:500;grid-column:2;grid-row:2;height:100%;justify-content:center;width:100%;z-index:1}:host-context([dir=rtl]):host([size=large]) .count{border-radius:0 var(--cr-url-list-item-count-border-radius) 0 0}.folder-and-count:has(div:nth-child(2)) .count{border-radius:0}:host([size=large]) .folder-and-count:not(:has(div:nth-child(2))):has(.image-container) .count{border-inline-start:var(--cr-url-list-item-image-container-border_);border-top:var(--cr-url-list-item-image-container-border_)}.image-container{background:black;border-radius:var(--cr-url-list-item-image-container-border-radius_);height:100%;width:100%}@media (prefers-color-scheme:dark){.image-container{background:transparent}}.metadata{display:flex;flex-direction:column;gap:8px;min-width:0;width:100%}:host([has-slotted-content_]) .metadata{display:none}:host([size=compact]) .metadata{align-items:center;flex-direction:row}:host([size=compact]) .metadata,:host([size=medium]) .metadata{gap:var(--cr-url-list-item-metadata-gap,4px)}:host([size=large]) .metadata{gap:var(--cr-url-list-item-metadata-gap,2px)}.title{color:var(--cr-primary-text-color);font-family:inherit;font-size:12px;font-weight:500}.title:focus{outline:none}.descriptions{align-items:center;display:flex;gap:3px;height:14px}:host([size=compact]) .descriptions{display:contents}:host([size=large]) .descriptions{align-items:flex-start;flex-direction:column;gap:4px;height:auto}:host(:not([has-descriptions_])) .descriptions{display:none}.description{color:var(--cr-secondary-text-color);display:flex;font-size:11px;font-weight:400;max-width:100%}.description-text:has(+.description-meta:not([hidden])){flex-shrink:1}:host([reverse-elide-description]) .description-text{direction:rtl}:host([size=compact]) .description{font-size:12px}.title,.description-text,.description-meta{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.description-meta{flex-shrink:0;padding-inline-start:4px}.badges{align-items:flex-start;display:flex;gap:4px;min-width:fit-content}:host(:not([has-badges])) .badges{display:none}:host([has-badges]) .badges{margin-inline-start:4px}.suffix{align-items:center;color:var(--cr-secondary-text-color);display:flex;flex-shrink:0;font-size:11px;font-weight:400;line-height:20px;margin-inline-end:-4px;margin-inline-start:auto}::slotted([slot=suffix]){display:none}::slotted(cr-icon-button[slot=suffix]){--cr-icon-button-icon-size:16px;--cr-icon-button-size:24px;--cr-icon-button-margin-end:0;--cr-icon-button-margin-start:0}::slotted([slot=suffix]:not(cr-icon-button)){margin-inline-end:16px}:host(.hovered) ::slotted([slot=suffix]),:host-context(.focus-outline-visible):host(:focus-within) ::slotted([slot=suffix]),:host([always-show-suffix]) ::slotted([slot=suffix]){display:block}.url-image{height:100%;object-fit:cover;object-position:center center;opacity:95%;width:100%}`])}function getHtml$s(){return html`
${this.shouldShowFolderImages_()?html` ${this.imageUrls.map(((item,index)=>html` ${this.shouldShowImageUrl_(item,index)?html`
`:""} `))} `:""}
${this.getDisplayedCount_()}
`}var CrUrlListItemSize;(function(CrUrlListItemSize){CrUrlListItemSize["COMPACT"]="compact";CrUrlListItemSize["MEDIUM"]="medium";CrUrlListItemSize["LARGE"]="large"})(CrUrlListItemSize||(CrUrlListItemSize={}));const CrUrlListItemElementBase=MouseHoverableMixinLit(CrLitElement);class CrUrlListItemElement extends CrUrlListItemElementBase{static get is(){return"cr-url-list-item"}static get styles(){return getCss$t()}render(){return getHtml$s.bind(this)()}static get properties(){return{alwaysShowSuffix:{type:Boolean,reflect:true},itemAriaLabel:{type:String},itemAriaDescription:{type:String},count:{type:Number},description:{type:String},url:{type:String},title:{reflect:true,type:String},hasBadges:{type:Boolean,reflect:true},hasDescriptions_:{type:Boolean,reflect:true},hasSlottedContent_:{type:Boolean,reflect:true},reverseElideDescription:{type:Boolean,reflect:true},isFolder_:{type:Boolean,reflect:true},size:{type:String,reflect:true},imageUrls:{type:Array},firstImageLoaded_:{type:Boolean,state:true},forceHover:{reflect:true,type:Boolean},descriptionMeta:{type:String},asAnchor:{type:Boolean},asAnchorTarget:{type:String}}}#alwaysShowSuffix_accessor_storage=false;get alwaysShowSuffix(){return this.#alwaysShowSuffix_accessor_storage}set alwaysShowSuffix(value){this.#alwaysShowSuffix_accessor_storage=value}#asAnchor_accessor_storage=false;get asAnchor(){return this.#asAnchor_accessor_storage}set asAnchor(value){this.#asAnchor_accessor_storage=value}#asAnchorTarget_accessor_storage="_self";get asAnchorTarget(){return this.#asAnchorTarget_accessor_storage}set asAnchorTarget(value){this.#asAnchorTarget_accessor_storage=value}#itemAriaLabel_accessor_storage;get itemAriaLabel(){return this.#itemAriaLabel_accessor_storage}set itemAriaLabel(value){this.#itemAriaLabel_accessor_storage=value}#itemAriaDescription_accessor_storage;get itemAriaDescription(){return this.#itemAriaDescription_accessor_storage}set itemAriaDescription(value){this.#itemAriaDescription_accessor_storage=value}#count_accessor_storage;get count(){return this.#count_accessor_storage}set count(value){this.#count_accessor_storage=value}#description_accessor_storage;get description(){return this.#description_accessor_storage}set description(value){this.#description_accessor_storage=value}#reverseElideDescription_accessor_storage=false;get reverseElideDescription(){return this.#reverseElideDescription_accessor_storage}set reverseElideDescription(value){this.#reverseElideDescription_accessor_storage=value}#hasBadges_accessor_storage=false;get hasBadges(){return this.#hasBadges_accessor_storage}set hasBadges(value){this.#hasBadges_accessor_storage=value}#hasDescriptions__accessor_storage=false;get hasDescriptions_(){return this.#hasDescriptions__accessor_storage}set hasDescriptions_(value){this.#hasDescriptions__accessor_storage=value}#hasSlottedContent__accessor_storage=false;get hasSlottedContent_(){return this.#hasSlottedContent__accessor_storage}set hasSlottedContent_(value){this.#hasSlottedContent__accessor_storage=value}#isFolder__accessor_storage=false;get isFolder_(){return this.#isFolder__accessor_storage}set isFolder_(value){this.#isFolder__accessor_storage=value}#size_accessor_storage=CrUrlListItemSize.MEDIUM;get size(){return this.#size_accessor_storage}set size(value){this.#size_accessor_storage=value}#title_accessor_storage="";get title(){return this.#title_accessor_storage}set title(value){this.#title_accessor_storage=value}#url_accessor_storage;get url(){return this.#url_accessor_storage}set url(value){this.#url_accessor_storage=value}#imageUrls_accessor_storage=[];get imageUrls(){return this.#imageUrls_accessor_storage}set imageUrls(value){this.#imageUrls_accessor_storage=value}#firstImageLoaded__accessor_storage=false;get firstImageLoaded_(){return this.#firstImageLoaded__accessor_storage}set firstImageLoaded_(value){this.#firstImageLoaded__accessor_storage=value}#forceHover_accessor_storage=false;get forceHover(){return this.#forceHover_accessor_storage}set forceHover(value){this.#forceHover_accessor_storage=value}#descriptionMeta_accessor_storage="";get descriptionMeta(){return this.#descriptionMeta_accessor_storage}set descriptionMeta(value){this.#descriptionMeta_accessor_storage=value}connectedCallback(){super.connectedCallback();this.resetFirstImageLoaded_()}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("hasBadges")||changedProperties.has("description")){this.hasDescriptions_=!!this.description||this.hasBadges||!!this.descriptionMeta}if(changedProperties.has("count")){this.isFolder_=this.count!==undefined}if(changedProperties.has("size")){assert(Object.values(CrUrlListItemSize).includes(this.size))}}firstUpdated(changedProperties){super.firstUpdated(changedProperties);FocusOutlineManager.forDocument(document);this.addEventListener("pointerdown",(()=>this.setActiveState_(true)));this.addEventListener("pointerup",(()=>this.setActiveState_(false)));this.addEventListener("pointerleave",(()=>this.setActiveState_(false)))}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("imageUrls")){this.resetFirstImageLoaded_()}}focus(){this.getFocusableElement().focus()}getFocusableElement(){if(this.asAnchor){return this.$.anchor}else{return this.$.button}}resetFirstImageLoaded_(){this.firstImageLoaded_=false;const image=this.shadowRoot.querySelector("img");if(!image){return}if(image.complete){this.firstImageLoaded_=true;return}image.addEventListener("load",(()=>{this.firstImageLoaded_=true}),{once:true})}getItemAriaDescription_(){return this.itemAriaDescription||this.description}getItemAriaLabel_(){return this.itemAriaLabel||this.title}getAnchorAriaDescription_(){return this.asAnchor?this.getItemAriaDescription_():undefined}getAnchorAriaLabel_(){return this.asAnchor?this.getItemAriaLabel_():undefined}getButtonAriaDescription_(){return!this.asAnchor?this.getItemAriaDescription_():undefined}getButtonAriaLabel_(){return!this.asAnchor?this.getItemAriaLabel_():undefined}getDisplayedCount_(){if(this.count&&this.count>999){return"99+"}return this.count===undefined?"":this.count.toString()}getFavicon_(){return getFaviconForPageURL(this.url||"",false)}shouldShowImageUrl_(_url,index){return index<=1}onBadgesSlotchange_(){this.hasBadges=this.$.badges.assignedElements({flatten:true}).length>0}onContentSlotchange_(){this.hasSlottedContent_=this.$.content.assignedElements({flatten:true}).length>0}setActiveState_(active){this.classList.toggle("active",active)}shouldShowFavicon_(){return this.url!==undefined&&(this.size===CrUrlListItemSize.COMPACT||this.imageUrls.length===0)}shouldShowUrlImage_(){return this.url!==undefined&&!(this.size===CrUrlListItemSize.COMPACT||this.imageUrls.length===0)&&this.firstImageLoaded_}shouldShowFolderImages_(){return this.size!==CrUrlListItemSize.COMPACT}shouldShowFolderIcon_(){return this.size===CrUrlListItemSize.COMPACT||this.imageUrls.length===0}shouldShowFolderCount_(){return this.url===undefined}}customElements.define(CrUrlListItemElement.is,CrUrlListItemElement);const div$2=document.createElement("div");div$2.innerHTML=getTrustedHTML` `;const iconsets$2=div$2.querySelectorAll("cr-iconset");for(const iconset of iconsets$2){document.head.appendChild(iconset)}let instance$x=null;function getCss$s(){return instance$x||(instance$x=[...[],css`:host{--gradient-start-color_:var(--color-history-embeddings-image-background-gradient-start,var(--cr-fallback-color-primary-container));--gradient-end-color_:var(--color-history-embeddings-image-background-gradient-end,rgb(231,248,237));--illustration-color_:var(--gradient-end-color_);align-items:center;background:linear-gradient(131deg,var(--gradient-start-color_) 12.23%,var(--gradient-end-color_) 78.96%);display:flex;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}#illustrationPath{fill:var(--illustration-color_)}#image{height:100%;inset:0;object-fit:cover;position:absolute;width:100%}@media (prefers-color-scheme:dark){:host{--gradient-end-color_:var(--color-history-embeddings-image-background-gradient-end,rgb(15,82,35));--illustration-color_:var(--gradient-start-color_)}}`])}function getHtml$r(){return html` `}class HistoryEmbeddingsResultImageElement extends CrLitElement{static get is(){return"cr-history-embeddings-result-image"}static get styles(){return getCss$s()}render(){return getHtml$r.bind(this)()}static get properties(){return{hasImage:{type:Boolean,reflect:true},imageUrl_:{type:String},inSidePanel:{type:Boolean,reflect:true},searchResult:{type:Object}}}#hasImage_accessor_storage=false;get hasImage(){return this.#hasImage_accessor_storage}set hasImage(value){this.#hasImage_accessor_storage=value}#imageUrl__accessor_storage=null;get imageUrl_(){return this.#imageUrl__accessor_storage}set imageUrl_(value){this.#imageUrl__accessor_storage=value}#inSidePanel_accessor_storage=false;get inSidePanel(){return this.#inSidePanel_accessor_storage}set inSidePanel(value){this.#inSidePanel_accessor_storage=value}#searchResult_accessor_storage=null;get searchResult(){return this.#searchResult_accessor_storage}set searchResult(value){this.#searchResult_accessor_storage=value}willUpdate(changedProperties){super.willUpdate(changedProperties);if(!loadTimeData.getBoolean("enableHistoryEmbeddingsImages")){return}if(changedProperties.has("searchResult")){this.imageUrl_=null;this.hasImage=false;if(this.searchResult?.isUrlKnownToSync){this.fetchImageForSearchResult_()}}}async fetchImageForSearchResult_(){assert(this.searchResult);const searchResultUrl=this.searchResult.url;const{result:result}=await PageImageServiceBrowserProxy.getInstance().handler.getPageImageUrl(ClientId.HistoryEmbeddings,searchResultUrl,{suggestImages:true,optimizationGuideImages:true});if(result&&searchResultUrl===this.searchResult.url){this.imageUrl_=result.imageUrl;this.hasImage=true}}}customElements.define(HistoryEmbeddingsResultImageElement.is,HistoryEmbeddingsResultImageElement);let instance$w=null;function getCss$r(){return instance$w||(instance$w=[...[],css`:host{clip:rect(0 0 0 0);height:1px;overflow:hidden;position:fixed;width:1px}`])}function getHtml$q(){return html` `}const TIMEOUT_MS=150;const instances=new Map;function getInstance(container=document.body){if(instances.has(container)){return instances.get(container)}assert(container.isConnected);const instance=new CrA11yAnnouncerElement;container.appendChild(instance);instances.set(container,instance);return instance}class CrA11yAnnouncerElement extends CrLitElement{static get is(){return"cr-a11y-announcer"}static get styles(){return getCss$r()}render(){return getHtml$q.bind(this)()}currentTimeout_=null;messages_=[];disconnectedCallback(){super.disconnectedCallback();if(this.currentTimeout_!==null){clearTimeout(this.currentTimeout_);this.currentTimeout_=null}for(const[parent,instance]of instances){if(instance===this){instances.delete(parent);break}}}announce(message,timeout=TIMEOUT_MS){if(this.currentTimeout_!==null){clearTimeout(this.currentTimeout_);this.currentTimeout_=null}this.messages_.push(message);this.currentTimeout_=setTimeout((()=>{const messagesDiv=this.shadowRoot.querySelector("#messages");messagesDiv.innerHTML=window.trustedTypes.emptyHTML;for(const message of this.messages_){const div=document.createElement("div");div.textContent=message;messagesDiv.appendChild(div)}this.dispatchEvent(new CustomEvent("cr-a11y-announcer-messages-sent",{bubbles:true,detail:{messages:this.messages_.slice()}}));this.messages_.length=0;this.currentTimeout_=null}),timeout)}}customElements.define(CrA11yAnnouncerElement.is,CrA11yAnnouncerElement);let instance$v=null;function getCss$q(){return instance$v||(instance$v=[...[getCss$T()],css`:host{display:block}:host([is-empty]){display:none}.card{background:var(--color-history-embeddings-background,var(--cr-card-background-color));border-radius:var(--cr-card-border-radius);box-shadow:var(--cr-card-shadow);padding-block:var(--cr-history-embeddings-card-padding-block,0)}:host([enable-answers_]) .card{padding-block:var(--cr-history-embeddings-card-padding-block-with-answers,16px)}h2{display:flex;align-items:center;gap:14px;margin:0;padding:var(--cr-history-embeddings-heading-padding,23px 24px 13px);font-size:var(--cr-history-embeddings-heading-font-size,16px);font-weight:500;line-height:var(--cr-history-embeddings-heading-line-height,24px);color:var(--color-history-embeddings-foreground,var(--cr-primary-text-color))}h2 cr-icon{flex-shrink:0}:host([enable-answers_]) h2{font-size:var(--cr-history-embeddings-heading-font-size,14px);line-height:var(--cr-history-embeddings-heading-line-height,20px);padding:var(--cr-history-embeddings-heading-padding,8px 24px)}:host([enable-answers_]) .answer-section{margin-block-end:var(--cr-history-embeddings-answer-section-margin-block-end,16px)}:host([enable-answers_]) .answer{font-size:16px;font-weight:500;line-height:24px;padding:var(--cr-history-embeddings-answer-padding,8px 24px)}:host([enable-answers_]) .answer[is-error]{color:var(--cr-secondary-text-color);font-size:11px;font-weight:400}:host([enable-answers_]) .answer-source{align-items:center;color:var(--color-history-embeddings-foreground-subtle,var(--cr-secondary-text-color));display:inline-flex;font-size:11px;gap:4px;margin:var(--cr-history-embeddings-answer-source-margin,8px 24px);max-width:calc(100% - 48px);line-height:16px;text-decoration:none}:host([enable-answers_]) .answer-link{align-items:center;display:flex;gap:4px;min-width:0}:host([enable-answers_]) .answer-link .result-url{text-decoration:underline}:host([enable-answers_]) .answer-source .time{margin-inline-start:0}.loading{padding:var(--cr-history-embeddings-loading-padding,4px 24px 24px 24px)}:host([enable-answers_]) .loading{padding:var(--cr-history-embeddings-loading-padding,4px 24px 8px 24px)}hr{border:0;display:var(--cr-history-embeddings-hr-display,block);height:1px;background:var(--color-history-embeddings-divider,var(--cr-fallback-color-divider));margin:0 24px}:host([enable-answers_]) hr{display:none}hr:last-of-type{display:none}cr-url-list-item{--cr-url-list-item-height:auto;--cr-url-list-item-padding:var(--cr-history-embeddings-url-list-item-padding,14px 24px)}cr-url-list-item:has(.source-passage:not([hidden])){--cr-url-list-item-padding:14px 24px 6px}hr:has(+cr-url-list-item:hover),cr-url-list-item:hover+hr{opacity:0}:host([enable-answers_]) cr-url-list-item{--cr-url-list-item-padding:var(--cr-history-embeddings-url-list-item-padding,8px 24px)}:host([enable-answers_]) .result-item{align-items:center;color:var(--color-history-embeddings-foreground,var(--cr-primary-text-color));display:flex;gap:16px;padding:8px 24px;text-decoration:none}:host([enable-answers_][in-side-panel]) .result-item{padding:4px 16px}:host([enable-answers_]) .result-image{align-items:center;background:var(--color-history-embeddings-image-background,var(--cr-fallback-color-neutral-container));border-radius:8px;display:flex;flex-shrink:0;justify-content:center;height:58px;overflow:hidden;width:104px}:host([enable-answers_][in-side-panel]) .result-image{height:40px;width:40px}:host([enable-answers_][in-side-panel]) cr-history-embeddings-result-image:not([has-image]){display:none}:host([enable-answers_]:not([in-side-panel])) .result-image .favicon{display:none}:host([enable-answers_][in-side-panel]) cr-history-embeddings-result-image[has-image]~.favicon{display:none}:host([enable-answers_]) .result-metadata{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}:host([enable-answers_]) .result-title,:host([enable-answers_]) .result-url{line-height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([enable-answers_]) .result-title{font-size:12px;font-weight:500}:host([enable-answers_]) .result-url-and-favicon{align-items:center;display:flex;gap:4px}:host([enable-answers_]) .result-url{color:var(--color-history-embeddings-foreground-subtle,var(--cr-secondary-text-color));font-size:11px}:host([enable-answers_]) .favicon{background-position:center center;background-repeat:no-repeat;flex-shrink:0;height:16px;width:16px}:host([enable-answers_][in-side-panel]) .result-url-and-favicon .favicon{display:none}.time{margin-inline-start:16px}:host([enable-answers_]) .time{color:var(--color-history-embeddings-foreground-subtle,var(--cr-secondary-text-color));font-size:11px;line-height:16px;white-space:nowrap}:host([enable-answers_]) .more-actions{--cr-icon-button-icon-size:16px;--cr-icon-button-size:24px;--cr-icon-button-margin-end:0;--cr-icon-button-margin-start:0}.footer{display:flex;align-items:center;font-size:var(--cr-history-embeddings-footer-font-size,inherit);line-height:var(--cr-history-embeddings-footer-line-height,inherit);gap:8px;padding:var(--cr-history-embeddings-footer-padding,16px 24px 24px);color:var(--color-history-embeddings-foreground-subtle,var(--cr-secondary-text-color))}:host([enable-answers_]) .footer{padding:var(--cr-history-embeddings-footer-padding-with-answers,16px 24px 24px)}.source-passage{display:flex;font-size:11px;font-style:italic;line-height:16px;padding:6px 24px 14px}.source-passage-line{background:var(--color-history-embeddings-divider,var(--cr-fallback-color-divider));width:1px;margin-inline-start:20px;margin-inline-end:36px}`])}function getHtml$p(){return html` ${!this.enableAnswers_?html`

${this.getHeadingText_()}

${this.loadingResults_?html`
`:html`
${this.searchResult_?.items.map(((item,index)=>html` ${this.getDateTime_(item)}
${item.sourcePassage}

`))}
`}
`:""} ${this.enableAnswers_?html`
${this.showAnswerSection_()?html`

${this.getHeadingTextForAnswerSection_()}

${this.loadingAnswer_?html`
`:html`
${this.getAnswerOrError_()}
`} ${this.answerSource_?html`
${this.answerSource_.urlForDisplay}
•
${this.getAnswerDateTime_()}
`:""}
`:""}

${this.getHeadingText_()}

${this.loadingResults_?html`
`:html`
${this.searchResult_?.items.map(((item,index)=>html` ${this.enableImages_?html`
${this.getDateTime_(item)}
`:html` ${this.getDateTime_(item)}
${item.sourcePassage}

`} `))}
`}
`:""} ${this.showMoreFromSiteMenuOption?html` `:""} `}"> `}const AnswerStatusSpec={$:mojo.internal.Enum()};var AnswerStatus;(function(AnswerStatus){AnswerStatus[AnswerStatus["MIN_VALUE"]=0]="MIN_VALUE";AnswerStatus[AnswerStatus["MAX_VALUE"]=7]="MAX_VALUE";AnswerStatus[AnswerStatus["kUnspecified"]=0]="kUnspecified";AnswerStatus[AnswerStatus["kLoading"]=1]="kLoading";AnswerStatus[AnswerStatus["kSuccess"]=2]="kSuccess";AnswerStatus[AnswerStatus["kUnanswerable"]=3]="kUnanswerable";AnswerStatus[AnswerStatus["kModelUnavailable"]=4]="kModelUnavailable";AnswerStatus[AnswerStatus["kExecutionFailure"]=5]="kExecutionFailure";AnswerStatus[AnswerStatus["kExecutionCanceled"]=6]="kExecutionCanceled";AnswerStatus[AnswerStatus["kFiltered"]=7]="kFiltered"})(AnswerStatus||(AnswerStatus={}));const UserFeedbackSpec={$:mojo.internal.Enum()};var UserFeedback;(function(UserFeedback){UserFeedback[UserFeedback["MIN_VALUE"]=0]="MIN_VALUE";UserFeedback[UserFeedback["MAX_VALUE"]=2]="MAX_VALUE";UserFeedback[UserFeedback["kUserFeedbackUnspecified"]=0]="kUserFeedbackUnspecified";UserFeedback[UserFeedback["kUserFeedbackNegative"]=1]="kUserFeedbackNegative";UserFeedback[UserFeedback["kUserFeedbackPositive"]=2]="kUserFeedbackPositive"})(UserFeedback||(UserFeedback={}));class PageHandlerFactoryPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_embeddings.mojom.PageHandlerFactory",scope)}}class PageHandlerFactoryRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerFactoryPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}createPageHandler(page,handler){this.proxy.sendMessage(1999669109,PageHandlerFactory_CreatePageHandler_ParamsSpec.$,null,[page,handler],false)}}class PageHandlerFactory{static get $interfaceName(){return"history_embeddings.mojom.PageHandlerFactory"}static getRemote(){let remote=new PageHandlerFactoryRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}let PageHandlerPendingReceiver$2=class PageHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_embeddings.mojom.PageHandler",scope)}};let PageHandlerRemote$2=class PageHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver$2,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}search(query){this.proxy.sendMessage(702264332,PageHandler_Search_ParamsSpec.$,null,[query],false)}sendQualityLog(selectedIndices,numEnteredChars){this.proxy.sendMessage(1161298583,PageHandler_SendQualityLog_ParamsSpec.$,null,[selectedIndices,numEnteredChars],false)}recordSearchResultsMetrics(nonEmptyResults,userClickedResult,answerShown,answerCitationClicked,otherHistoryResultClicked,queryWordCount){this.proxy.sendMessage(1975031121,PageHandler_RecordSearchResultsMetrics_ParamsSpec.$,null,[nonEmptyResults,userClickedResult,answerShown,answerCitationClicked,otherHistoryResultClicked,queryWordCount],false)}setUserFeedback(feedback){this.proxy.sendMessage(625367745,PageHandler_SetUserFeedback_ParamsSpec.$,null,[feedback],false)}openSettingsPage(){this.proxy.sendMessage(16341499,PageHandler_OpenSettingsPage_ParamsSpec.$,null,[],false)}};let PagePendingReceiver$2=class PagePendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_embeddings.mojom.Page",scope)}};let PageRemote$2=class PageRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver$2,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}searchResultChanged(result){this.proxy.sendMessage(1104102036,Page_SearchResultChanged_ParamsSpec.$,null,[result],false)}};let PageCallbackRouter$2=class PageCallbackRouter{helper_internal_;$;router_;searchResultChanged;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote$2);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.searchResultChanged=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1104102036,Page_SearchResultChanged_ParamsSpec.$,null,this.searchResultChanged.createReceiverHandler(false),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}};const AnswerDataSpec={$:{}};const SearchResultItemSpec={$:{}};const SearchQuerySpec={$:{}};const SearchResultSpec={$:{}};const PageHandlerFactory_CreatePageHandler_ParamsSpec={$:{}};const PageHandler_Search_ParamsSpec={$:{}};const PageHandler_SendQualityLog_ParamsSpec={$:{}};const PageHandler_RecordSearchResultsMetrics_ParamsSpec={$:{}};const PageHandler_SetUserFeedback_ParamsSpec={$:{}};const PageHandler_OpenSettingsPage_ParamsSpec={$:{}};const Page_SearchResultChanged_ParamsSpec={$:{}};mojo.internal.Struct(AnswerDataSpec.$,"AnswerData",[mojo.internal.StructField("answerTextDirectives",0,0,mojo.internal.Array(mojo.internal.String,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(SearchResultItemSpec.$,"SearchResultItem",[mojo.internal.StructField("title",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("url",8,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("urlForDisplay",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("relativeTime",24,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("shortDateTime",32,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("lastUrlVisitTimestamp",40,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("sourcePassage",48,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("answerData",56,0,AnswerDataSpec.$,null,true,0,undefined,undefined),mojo.internal.StructField("isUrlKnownToSync",64,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,80]]);mojo.internal.Struct(SearchQuerySpec.$,"SearchQuery",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("timeRangeStart",8,0,TimeSpec.$,null,true,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(SearchResultSpec.$,"SearchResult",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("answerStatus",8,0,AnswerStatusSpec.$,0,false,0,undefined,undefined),mojo.internal.StructField("answer",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("items",24,0,mojo.internal.Array(SearchResultItemSpec.$,false),null,false,0,undefined,undefined)],[[0,40]]);mojo.internal.Struct(PageHandlerFactory_CreatePageHandler_ParamsSpec.$,"PageHandlerFactory_CreatePageHandler_Params",[mojo.internal.StructField("page",0,0,mojo.internal.InterfaceProxy(PageRemote$2),null,false,0,undefined,undefined),mojo.internal.StructField("handler",8,0,mojo.internal.InterfaceRequest(PageHandlerPendingReceiver$2),null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_Search_ParamsSpec.$,"PageHandler_Search_Params",[mojo.internal.StructField("query",0,0,SearchQuerySpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_SendQualityLog_ParamsSpec.$,"PageHandler_SendQualityLog_Params",[mojo.internal.StructField("selectedIndices",0,0,mojo.internal.Array(mojo.internal.Uint32,false),null,false,0,undefined,undefined),mojo.internal.StructField("numEnteredChars",8,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PageHandler_RecordSearchResultsMetrics_ParamsSpec.$,"PageHandler_RecordSearchResultsMetrics_Params",[mojo.internal.StructField("nonEmptyResults",0,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("userClickedResult",0,1,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("answerShown",0,2,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("answerCitationClicked",0,3,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("otherHistoryResultClicked",0,4,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("queryWordCount",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_SetUserFeedback_ParamsSpec.$,"PageHandler_SetUserFeedback_Params",[mojo.internal.StructField("feedback",0,0,UserFeedbackSpec.$,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_OpenSettingsPage_ParamsSpec.$,"PageHandler_OpenSettingsPage_Params",[],[[0,8]]);mojo.internal.Struct(Page_SearchResultChanged_ParamsSpec.$,"Page_SearchResultChanged_Params",[mojo.internal.StructField("result",0,0,SearchResultSpec.$,null,false,0,undefined,undefined)],[[0,16]]);const browserProxyFactory$3=new MojoBrowserProxyFactory(PageHandlerRemote$2,PageCallbackRouter$2,((remote,receiver)=>PageHandlerFactory.getRemote().createPageHandler(remote,receiver)));function jsDateToMojoDate(date){const windowsEpoch=Date.UTC(1601,0,1,0,0,0,0);const unixEpoch=Date.UTC(1970,0,1,0,0,0,0);const epochDeltaInMs=unixEpoch-windowsEpoch;const internalValue=BigInt(date.valueOf()+epochDeltaInMs)*BigInt(1e3);return{internalValue:internalValue}}const LOADING_STATE_MINIMUM_MS=300;const HistoryEmbeddingsElementBase=I18nMixinLit(CrLitElement);class HistoryEmbeddingsElement extends HistoryEmbeddingsElementBase{static get is(){return"cr-history-embeddings"}static get styles(){return getCss$q()}render(){return getHtml$p.bind(this)()}static get properties(){return{clickedIndices_:{type:Object},forceSuppressLogging:{type:Boolean},numCharsForQuery:{type:Number},feedbackState_:{type:Number},loadingAnswer_:{type:Boolean},loadingResults_:{type:Boolean},searchResult_:{type:Object},searchResultDirty_:{type:Boolean},searchQuery:{type:String},timeRangeStart:{type:Object},isEmpty:{type:Boolean,reflect:true,notify:true},enableAnswers_:{type:Boolean,reflect:true},enableImages_:{type:Boolean},answerSource_:{type:Object},showMoreFromSiteMenuOption:{type:Boolean},showRelativeTimes:{type:Boolean},otherHistoryResultClicked:{type:Boolean},inSidePanel:{type:Boolean,reflect:true},webuiRoundedIconsEnabled_:{type:Boolean}}}actionMenuItem_=null;#answerSource__accessor_storage=null;get answerSource_(){return this.#answerSource__accessor_storage}set answerSource_(value){this.#answerSource__accessor_storage=value}answerLinkClicked_=false;browserProxy_=browserProxyFactory$3.getInstance();#clickedIndices__accessor_storage=new Set;get clickedIndices_(){return this.#clickedIndices__accessor_storage}set clickedIndices_(value){this.#clickedIndices__accessor_storage=value}#enableAnswers__accessor_storage=loadTimeData.getBoolean("enableHistoryEmbeddingsAnswers");get enableAnswers_(){return this.#enableAnswers__accessor_storage}set enableAnswers_(value){this.#enableAnswers__accessor_storage=value}#enableImages__accessor_storage=loadTimeData.getBoolean("enableHistoryEmbeddingsImages");get enableImages_(){return this.#enableImages__accessor_storage}set enableImages_(value){this.#enableImages__accessor_storage=value}#feedbackState__accessor_storage=CrFeedbackOption.UNSPECIFIED;get feedbackState_(){return this.#feedbackState__accessor_storage}set feedbackState_(value){this.#feedbackState__accessor_storage=value}#loadingAnswer__accessor_storage=false;get loadingAnswer_(){return this.#loadingAnswer__accessor_storage}set loadingAnswer_(value){this.#loadingAnswer__accessor_storage=value}#loadingResults__accessor_storage=false;get loadingResults_(){return this.#loadingResults__accessor_storage}set loadingResults_(value){this.#loadingResults__accessor_storage=value}loadingStateMinimumMs_=LOADING_STATE_MINIMUM_MS;queryResultMinAge_=QUERY_RESULT_MINIMUM_AGE;#searchResult__accessor_storage=null;get searchResult_(){return this.#searchResult__accessor_storage}set searchResult_(value){this.#searchResult__accessor_storage=value}#searchResultDirty__accessor_storage=false;get searchResultDirty_(){return this.#searchResultDirty__accessor_storage}set searchResultDirty_(value){this.#searchResultDirty__accessor_storage=value}#webuiRoundedIconsEnabled__accessor_storage=loadTimeData.getBoolean("webuiRoundedIconsEnabled");get webuiRoundedIconsEnabled_(){return this.#webuiRoundedIconsEnabled__accessor_storage}set webuiRoundedIconsEnabled_(value){this.#webuiRoundedIconsEnabled__accessor_storage=value}searchTimestamp_=0;resultPendingMetricsTimestamp_=null;eventTracker_=new EventTracker;#forceSuppressLogging_accessor_storage=false;get forceSuppressLogging(){return this.#forceSuppressLogging_accessor_storage}set forceSuppressLogging(value){this.#forceSuppressLogging_accessor_storage=value}#isEmpty_accessor_storage=true;get isEmpty(){return this.#isEmpty_accessor_storage}set isEmpty(value){this.#isEmpty_accessor_storage=value}#numCharsForQuery_accessor_storage=0;get numCharsForQuery(){return this.#numCharsForQuery_accessor_storage}set numCharsForQuery(value){this.#numCharsForQuery_accessor_storage=value}numCharsForLastResultQuery_=0;#searchQuery_accessor_storage="";get searchQuery(){return this.#searchQuery_accessor_storage}set searchQuery(value){this.#searchQuery_accessor_storage=value}#timeRangeStart_accessor_storage;get timeRangeStart(){return this.#timeRangeStart_accessor_storage}set timeRangeStart(value){this.#timeRangeStart_accessor_storage=value}searchResultChangedId_=null;searchResultPromise_=null;#showRelativeTimes_accessor_storage=false;get showRelativeTimes(){return this.#showRelativeTimes_accessor_storage}set showRelativeTimes(value){this.#showRelativeTimes_accessor_storage=value}#showMoreFromSiteMenuOption_accessor_storage=false;get showMoreFromSiteMenuOption(){return this.#showMoreFromSiteMenuOption_accessor_storage}set showMoreFromSiteMenuOption(value){this.#showMoreFromSiteMenuOption_accessor_storage=value}#otherHistoryResultClicked_accessor_storage=false;get otherHistoryResultClicked(){return this.#otherHistoryResultClicked_accessor_storage}set otherHistoryResultClicked(value){this.#otherHistoryResultClicked_accessor_storage=value}#inSidePanel_accessor_storage=false;get inSidePanel(){return this.#inSidePanel_accessor_storage}set inSidePanel(value){this.#inSidePanel_accessor_storage=value}connectedCallback(){super.connectedCallback();this.eventTracker_.add(window,"beforeunload",(()=>{this.flushDebouncedUserMetrics_(true)}));if(this.inSidePanel){this.eventTracker_.add(document,"visibilitychange",(()=>{if(document.visibilityState==="hidden"){this.flushDebouncedUserMetrics_()}}))}this.searchResultChangedId_=this.browserProxy_.callbackRouter.searchResultChanged.addListener(this.searchResultChanged_.bind(this))}disconnectedCallback(){super.disconnectedCallback();this.flushDebouncedUserMetrics_(true);this.eventTracker_.removeAll();if(this.searchResultChangedId_!==null){this.browserProxy_.callbackRouter.removeListener(this.searchResultChangedId_);this.searchResultChangedId_=null}}willUpdate(changedProperties){super.willUpdate(changedProperties);const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("loadingResults_")||changedPrivateProperties.has("searchResult_")||changedPrivateProperties.has("searchResultDirty_")&&this.searchResultDirty_){this.isEmpty=this.computeIsEmpty_()}if(changedPrivateProperties.has("loadingAnswer_")||changedPrivateProperties.has("searchResult_")||changedPrivateProperties.has("searchResultDirty_")&&this.searchResultDirty_){this.answerSource_=this.computeAnswerSource_()}const isSearchQueryInitialization=changedProperties.get("searchQuery")===undefined&&this.searchQuery==="";if(changedProperties.has("searchQuery")&&!isSearchQueryInitialization||changedProperties.has("timeRangeStart")){this.onSearchQueryChanged_()}if(changedPrivateProperties.has("searchResultDirty_")&&this.searchResultDirty_){this.searchResultDirty_=false}}computeAnswerSource_(){if(!this.enableAnswers_||this.loadingAnswer_){return null}return this.searchResult_?.items.find((item=>item.answerData))||null}computeIsEmpty_(){return!this.loadingResults_&&this.searchResult_?.items.length===0}getAnswerOrError_(){if(!this.searchResult_){return undefined}switch(this.searchResult_.answerStatus){case AnswerStatus.kUnspecified:case AnswerStatus.kLoading:case AnswerStatus.kExecutionCanceled:case AnswerStatus.kUnanswerable:case AnswerStatus.kFiltered:case AnswerStatus.kModelUnavailable:return undefined;case AnswerStatus.kSuccess:return this.searchResult_.answer;case AnswerStatus.kExecutionFailure:return this.i18n("historyEmbeddingsAnswererErrorTryAgain");default:assertNotReachedCase(this.searchResult_.answerStatus)}}getAnswerSourceUrl_(){if(!this.answerSource_){return undefined}const sourceUrl=new URL(this.answerSource_.url);const textDirectives=this.answerSource_.answerData?.answerTextDirectives;if(textDirectives&&textDirectives.length>0){sourceUrl.hash=`:~:text=${textDirectives[0].split(",").map(encodeURIComponent).join(",")}`}return sourceUrl.toString()}getFavicon_(item){return getFaviconForPageURL(item?.url||"",true)}getHeadingText_(){if(this.loadingResults_){return this.i18n("historyEmbeddingsHeadingLoading",this.searchQuery)}if(this.enableAnswers_){return this.i18n("historyEmbeddingsWithAnswersResultsHeading")}return this.i18n("historyEmbeddingsHeading",this.searchQuery)}getHeadingTextForAnswerSection_(){if(this.loadingAnswer_){return this.i18n("historyEmbeddingsAnswerLoadingHeading")}return this.i18n("historyEmbeddingsAnswerHeading")}getAnswerDateTime_(){if(!this.answerSource_){return""}const dateTime=this.getDateTime_(this.answerSource_);return this.i18n("historyEmbeddingsAnswerSourceDate",dateTime)}getDateTime_(item){if(this.showRelativeTimes){return item.relativeTime}return item.shortDateTime}hasAnswer_(){if(!this.enableAnswers_){return false}return this.searchResult_?.answer!==""}isAnswerErrorState_(){if(!this.searchResult_){return false}return this.searchResult_.answerStatus===AnswerStatus.kExecutionFailure}onFeedbackSelectedOptionChanged_(e){this.feedbackState_=e.detail.value;switch(e.detail.value){case CrFeedbackOption.UNSPECIFIED:this.browserProxy_.handler.setUserFeedback(UserFeedback.kUserFeedbackUnspecified);return;case CrFeedbackOption.THUMBS_UP:this.browserProxy_.handler.setUserFeedback(UserFeedback.kUserFeedbackPositive);return;case CrFeedbackOption.THUMBS_DOWN:this.browserProxy_.handler.setUserFeedback(UserFeedback.kUserFeedbackNegative);return;default:assertNotReachedCase(e.detail.value)}}onAnswerLinkContextmenu_(e){this.fire("answer-context-menu",{item:this.answerSource_,x:e.clientX,y:e.clientY})}onAnswerLinkAuxclick_(e){this.onAnswerLinkClick_(e)}onAnswerLinkClick_(e){this.answerLinkClicked_=true;this.fire("answer-click",{item:this.answerSource_,middleButton:e.button===1,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey})}onMoreActionsClick_(e){e.preventDefault();e.stopPropagation();assert(this.searchResult_);const target=e.target;const index=Number(target.dataset["index"]);const item=this.searchResult_.items[index];assert(item);this.actionMenuItem_=item;this.$.sharedMenu.get().showAt(target)}onMoreFromSiteClick_(){assert(this.actionMenuItem_);this.fire("more-from-site-click",this.actionMenuItem_);this.$.sharedMenu.get().close()}async onRemoveFromHistoryClick_(){assert(this.searchResult_);assert(this.actionMenuItem_);this.searchResult_.items.splice(this.searchResult_.items.indexOf(this.actionMenuItem_),1);this.searchResultDirty_=true;await this.updateComplete;this.fire("remove-item-click",this.actionMenuItem_);this.$.sharedMenu.get().close()}onResultContextmenu_(e){assert(this.searchResult_);const index=Number(e.currentTarget.dataset["index"]);this.fire("result-context-menu",{item:this.searchResult_.items[index],x:e.clientX,y:e.clientY})}onResultAuxclick_(e){this.onResultClick_(e)}onResultClick_(e){assert(this.searchResult_);const index=Number(e.currentTarget.dataset["index"]);this.fire("result-click",{item:this.searchResult_.items[index],middleButton:e.button===1,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey});this.fire("record-history-link-click",{resultType:HistoryResultType.EMBEDDINGS,index:index});this.clickedIndices_.add(index);this.browserProxy_.handler.recordSearchResultsMetrics(true,true,this.hasAnswer_(),this.answerLinkClicked_,this.otherHistoryResultClicked,this.searchQuery.split(" ").length)}onSearchQueryChanged_(){this.flushDebouncedUserMetrics_();this.clickedIndices_.clear();this.answerLinkClicked_=false;this.numCharsForLastResultQuery_=this.numCharsForQuery;this.searchResultPromise_=null;this.loadingResults_=true;this.loadingAnswer_=false;const query={query:this.searchQuery,timeRangeStart:this.timeRangeStart?jsDateToMojoDate(this.timeRangeStart):null};this.searchTimestamp_=performance.now();this.browserProxy_.handler.search(query)}searchResultChanged_(result){if(this.searchResultPromise_){this.searchResultPromise_=this.searchResultPromise_.then((()=>this.searchResultChangedImpl_(result)))}else{this.searchResultPromise_=new Promise((resolve=>{setTimeout((()=>{this.searchResultChangedImpl_(result);resolve()}),Math.max(0,this.searchTimestamp_+this.loadingStateMinimumMs_-performance.now()))}))}}searchResultChangedImpl_(result){if(result.query!==this.searchQuery){return}const isNewQuery=this.searchResult_?.query!==result.query;const hasResults=result.items.length>0;const hasNewResults=this.searchResult_?.items.length!==result.items.length;const shouldAnnounceForResults=isNewQuery&&hasResults||!isNewQuery&&hasNewResults;this.feedbackState_=CrFeedbackOption.UNSPECIFIED;this.searchResult_=result;this.loadingResults_=false;this.loadingAnswer_=result.answerStatus===AnswerStatus.kLoading;this.resultPendingMetricsTimestamp_=performance.now();if(shouldAnnounceForResults){const resultsLabelId=result.items.length===1?"historyEmbeddingsMatch":"historyEmbeddingsMatches";const message=loadTimeData.getStringF("foundSearchResults",result.items.length,loadTimeData.getString(resultsLabelId),result.query);getInstance().announce(message)}}showAnswerSection_(){if(!this.searchResult_){return false}else if(this.searchResult_.query!==this.searchQuery){return false}else{return this.searchResult_.answerStatus!==AnswerStatus.kUnspecified&&this.searchResult_.answerStatus!==AnswerStatus.kUnanswerable&&this.searchResult_.answerStatus!==AnswerStatus.kFiltered&&this.searchResult_.answerStatus!==AnswerStatus.kModelUnavailable}}flushDebouncedUserMetrics_(forceFlush=false){if(this.resultPendingMetricsTimestamp_===null){return}const userClickedResult=this.clickedIndices_.size>0;const resultsWereStable=performance.now()-this.resultPendingMetricsTimestamp_>=this.queryResultMinAge_;const canLog=resultsWereStable||forceFlush;if(canLog&&!userClickedResult){const nonEmptyResults=!!this.searchResult_&&this.searchResult_.items&&this.searchResult_.items.length>0;this.browserProxy_.handler.recordSearchResultsMetrics(nonEmptyResults,false,this.hasAnswer_(),this.answerLinkClicked_,this.otherHistoryResultClicked,this.searchQuery.split(" ").length)}if(!this.forceSuppressLogging&&canLog){this.browserProxy_.handler.sendQualityLog(Array.from(this.clickedIndices_),this.numCharsForLastResultQuery_)}this.resultPendingMetricsTimestamp_=null}overrideLoadingStateMinimumMsForTesting(ms){this.loadingStateMinimumMs_=ms}overrideQueryResultMinAgeForTesting(ms){this.queryResultMinAge_=ms}searchResultChangedForTesting(result){this.searchResultChanged_(result)}}customElements.define(HistoryEmbeddingsElement.is,HistoryEmbeddingsElement);let instance$u=null;function getCss$p(){return instance$u||(instance$u=[...[],css`:host{--cr-drawer-width:256px}:host dialog{--transition-timing:200ms ease;background-color:var(--cr-drawer-background-color,#fff);border:none;border-start-end-radius:var(--cr-drawer-border-start-end-radius,0);border-end-end-radius:var(--cr-drawer-border-end-end-radius,0);bottom:0;left:calc(-1 * var(--cr-drawer-width));margin:0;max-height:initial;max-width:initial;overflow:hidden;padding:0;position:absolute;top:0;transition:left var(--transition-timing);width:var(--cr-drawer-width)}@media (prefers-color-scheme:dark){:host dialog{background:var(--cr-drawer-background-color,var(--google-grey-900)) linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04))}}:host dialog,#container{height:100%;word-break:break-word}:host([show_]) dialog{left:0}:host([align=rtl]) dialog{left:auto;right:calc(-1 * var(--cr-drawer-width));transition:right var(--transition-timing)}:host([show_][align=rtl]) dialog{right:0}:host dialog::backdrop{background:rgba(0,0,0,0.5);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity var(--transition-timing)}:host([show_]) dialog::backdrop{opacity:1}.drawer-header{align-items:center;border-bottom:var(--cr-separator-line);color:var(--cr-drawer-header-color,inherit);display:flex;font-size:123.08%;font-weight:var(--cr-drawer-header-font-weight,inherit);min-height:56px;padding-inline-start:var(--cr-drawer-header-padding,24px)}@media (prefers-color-scheme:dark){.drawer-header{color:var(--cr-primary-text-color)}}#heading{outline:none}:host ::slotted([slot='body']){height:calc(100% - 56px);overflow:auto}picture{margin-inline-end:16px}picture,#product-logo{height:24px;width:24px}`])}function getHtml$o(){return html`
${this.heading}
`}class CrDrawerElement extends CrLitElement{static get is(){return"cr-drawer"}static get styles(){return getCss$p()}render(){return getHtml$o.bind(this)()}static get properties(){return{heading:{type:String},show_:{type:Boolean,reflect:true},align:{type:String,reflect:true}}}#heading_accessor_storage="";get heading(){return this.#heading_accessor_storage}set heading(value){this.#heading_accessor_storage=value}#align_accessor_storage="ltr";get align(){return this.#align_accessor_storage}set align(value){this.#align_accessor_storage=value}#show__accessor_storage=false;get show_(){return this.#show__accessor_storage}set show_(value){this.#show__accessor_storage=value}get open(){return this.$.dialog.open}set open(_value){assertNotReached("Cannot set |open|.")}toggle(){if(this.open){this.cancel()}else{this.openDrawer()}}async openDrawer(){if(this.open){return}this.$.dialog.showModal();this.show_=true;await this.updateComplete;this.fire("cr-drawer-opening");listenOnce(this.$.dialog,"transitionend",(()=>{this.fire("cr-drawer-opened")}))}dismiss_(cancel){if(!this.open){return}this.show_=false;listenOnce(this.$.dialog,"transitionend",(()=>{this.$.dialog.close(cancel?"canceled":"closed")}))}cancel(){this.dismiss_(true)}close(){this.dismiss_(false)}wasCanceled(){return!this.open&&this.$.dialog.returnValue==="canceled"}onContainerClick_(event){event.stopPropagation()}onDialogClick_(){this.cancel()}onDialogCancel_(event){event.preventDefault();this.cancel()}onDialogClose_(){this.fire("close")}}customElements.define(CrDrawerElement.is,CrDrawerElement);const CrSelectableMixin=superClass=>{class CrSelectableMixin extends superClass{static get properties(){return{attrForSelected:{type:String},selected:{type:String,notify:true},selectedAttribute:{type:String},selectable:{type:String}}}#attrForSelected_accessor_storage=null;get attrForSelected(){return this.#attrForSelected_accessor_storage}set attrForSelected(value){this.#attrForSelected_accessor_storage=value}#selectable_accessor_storage;get selectable(){return this.#selectable_accessor_storage}set selectable(value){this.#selectable_accessor_storage=value}#selected_accessor_storage;get selected(){return this.#selected_accessor_storage}set selected(value){this.#selected_accessor_storage=value}#selectedAttribute_accessor_storage=null;get selectedAttribute(){return this.#selectedAttribute_accessor_storage}set selectedAttribute(value){this.#selectedAttribute_accessor_storage=value}selectOnClick=true;items_=[];selectedItem_=null;firstUpdated(changedProperties){super.firstUpdated(changedProperties);if(this.selectOnClick){this.addEventListener("click",(e=>this.onClick_(e)))}this.observeItems()}observeItems(){this.getSlot().addEventListener("slotchange",(()=>this.itemsChanged()))}connectedCallback(){super.connectedCallback();this.updateItems_()}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("attrForSelected")){if(this.selectedItem_){assert(this.attrForSelected);const value=this.selectedItem_.getAttribute(this.attrForSelected);assert(value!==null);this.selected=value}}}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("selected")){this.updateSelectedItem_()}}select(value){this.selected=value}selectPrevious(){const length=this.items_.length;let index=length-1;if(this.selected!==undefined){index=(this.valueToIndex_(this.selected)-1+length)%length}this.selected=this.indexToValue_(index)}selectNext(){const index=this.selected===undefined?0:(this.valueToIndex_(this.selected)+1)%this.items_.length;this.selected=this.indexToValue_(index)}getItemsForTest(){return this.items_}getSlot(){const slot=this.shadowRoot.querySelector("slot");assert(slot);return slot}queryItems(){const selectable=this.selectable===undefined?"*":this.selectable;return Array.from(this.querySelectorAll(`:scope > ${selectable}`))}queryMatchingItem(selector){const selectable=this.selectable||"*";return this.querySelector(`:scope > :is(${selectable})${selector}`)}updateItems_(){this.items_=this.queryItems();this.items_.forEach(((item,index)=>item.setAttribute("data-selection-index",index.toString())))}get selectedItem(){return this.selectedItem_}updateSelectedItem_(){if(!this.items_){return}const item=this.selected==null?null:this.items_[this.valueToIndex_(this.selected)];if(!!item&&this.selectedItem_!==item){this.setItemSelected_(this.selectedItem_,false);this.setItemSelected_(item,true)}else if(!item){this.setItemSelected_(this.selectedItem_,false)}}setItemSelected_(item,isSelected){if(!item){return}item.classList.toggle("selected",isSelected);if(this.selectedAttribute){item.toggleAttribute(this.selectedAttribute,isSelected)}this.selectedItem_=isSelected?item:null;this.fire("iron-"+(isSelected?"select":"deselect"),{item:item})}valueToIndex_(value){if(!this.attrForSelected){return Number(value)}const match=this.queryMatchingItem(`[${this.attrForSelected}="${value}"]`);return match?Number(match.dataset["selectionIndex"]):-1}indexToValue_(index){if(!this.attrForSelected){return index}const item=this.items_[index];if(!item){return index}return item.getAttribute(this.attrForSelected)||index}itemsChanged(){this.updateItems_();this.updateSelectedItem_();this.fire("iron-items-changed")}onClick_(e){let element=e.target;while(element&&element!==this){const idx=this.items_.indexOf(element);if(idx>=0){const value=this.indexToValue_(idx);assert(value!==null);this.fire("iron-activate",{item:element,selected:value});this.select(value);return}element=element.parentNode}}}return CrSelectableMixin};let instance$t=null;function getCss$o(){return instance$t||(instance$t=[...[],css`:host{display:block}:host(:not([show-all]))>::slotted(:not(slot):not(.selected)){display:none !important}`])}function getHtml$n(){return html``}const CrPageSelectorElementBase=CrSelectableMixin(CrLitElement);class CrPageSelectorElement extends CrPageSelectorElementBase{static get is(){return"cr-page-selector"}static get styles(){return getCss$o()}render(){return getHtml$n.bind(this)()}static get properties(){return{hasNestedSlots:{type:Boolean}}}#hasNestedSlots_accessor_storage=false;get hasNestedSlots(){return this.#hasNestedSlots_accessor_storage}set hasNestedSlots(value){this.#hasNestedSlots_accessor_storage=value}constructor(){super();this.selectOnClick=false}queryItems(){return this.hasNestedSlots?Array.from(this.getSlot().assignedElements({flatten:true})):super.queryItems()}queryMatchingItem(selector){if(this.hasNestedSlots){const match=this.queryItems().find((el=>el.matches(selector)));return match?match:null}return super.queryMatchingItem(selector)}observeItems(){if(this.hasNestedSlots){this.addEventListener("slotchange",(()=>this.itemsChanged()))}super.observeItems()}}customElements.define(CrPageSelectorElement.is,CrPageSelectorElement);let instance$s=null;function getCss$n(){return instance$s||(instance$s=[...[getCss$T()],css`:host{cursor:pointer;display:flex;flex-direction:row;font-size:var(--cr-tabs-font-size,14px);font-weight:500;height:var(--cr-tabs-height,48px);user-select:none}:host-context([webui-refresh-2026]){&:host{--cr-tabs-selected-color:var(--color-tab-nav-item-selected,var(--google-blue-600))}@media (prefers-color-scheme:dark){&:host{--cr-tabs-selected-color:var(--color-tab-nav-item-selected,var(--google-blue-300))}}}.tab{align-items:center;color:var(--cr-secondary-text-color);display:flex;flex:var(--cr-tabs-flex,auto);height:100%;justify-content:center;opacity:1;outline:none;padding:0 var(--cr-tabs-tab-inline-padding,0);position:relative;transition:opacity 100ms cubic-bezier(.4,0,1,1)}:host-context(.focus-outline-visible) .tab:focus{outline:var(--cr-tabs-focus-outline,auto);outline-offset:var(--cr-tabs-focus-outline-offset,0)}.selected{color:var(--cr-tabs-selected-color,var(--google-blue-600));opacity:1}@media (prefers-color-scheme:dark){.selected{color:var(--cr-tabs-selected-color,var(--google-blue-300))}}.tab-icon{-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;-webkit-mask-size:var(--cr-tabs-icon-size,var(--cr-icon-size));background-color:var(--cr-secondary-text-color);display:none;height:var(--cr-tabs-icon-size,var(--cr-icon-size));margin-inline-end:var(--cr-tabs-icon-margin-end,var(--cr-icon-size));width:var(--cr-tabs-icon-size,var(--cr-icon-size))}.selected .tab-icon{background-color:var(--cr-tabs-selected-color,var(--google-blue-600))}@media (prefers-color-scheme:dark){.selected .tab-icon{background-color:var(--cr-tabs-selected-color,var(--google-blue-300))}}.tab-indicator,.tab-indicator-background{bottom:0;height:var(--cr-tabs-selection-bar-width,2px);left:var(--cr-tabs-tab-inline-padding,0);position:absolute;right:var(--cr-tabs-tab-inline-padding,0)}.tab-indicator{border-top-left-radius:var(--cr-tabs-selection-bar-radius,var(--cr-tabs-selection-bar-width,2px));border-top-right-radius:var(--cr-tabs-selection-bar-radius,var(--cr-tabs-selection-bar-width,2px));opacity:0;transform-origin:left center;transition:transform}.selected .tab-indicator{background:var(--cr-tabs-selected-color,var(--google-blue-600));opacity:1}.tab-indicator.expand{transition-duration:150ms;transition-timing-function:cubic-bezier(.4,0,1,1)}.tab-indicator.contract{transition-duration:180ms;transition-timing-function:cubic-bezier(0,0,.2,1)}.tab-indicator-background{background:var(--cr-tabs-unselected-color,var(--google-blue-600));opacity:var(--cr-tabs-selection-bar-unselected-opacity,0);z-index:-1}@media (prefers-color-scheme:dark){.tab-indicator-background{background:var(--cr-tabs-unselected-color,var(--google-blue-300))}.selected .tab-indicator{background:var(--cr-tabs-selected-color,var(--google-blue-300))}}@media (forced-colors:active){.tab-indicator-background{background:SelectedItem}.selected .tab-indicator{background:SelectedItem}}`])}function getHtml$m(){return html`${this.tabNames.map(((item,index)=>html` `))}`}const NONE_SELECTED=-1;class CrTabsElement extends CrLitElement{static get is(){return"cr-tabs"}static get styles(){return getCss$n()}render(){return getHtml$m.bind(this)()}static get properties(){return{tabIcons:{type:Array},tabNames:{type:Array},selected:{type:Number,notify:true}}}#tabIcons_accessor_storage=[];get tabIcons(){return this.#tabIcons_accessor_storage}set tabIcons(value){this.#tabIcons_accessor_storage=value}#tabNames_accessor_storage=[];get tabNames(){return this.#tabNames_accessor_storage}set tabNames(value){this.#tabNames_accessor_storage=value}#selected_accessor_storage=NONE_SELECTED;get selected(){return this.#selected_accessor_storage}set selected(value){this.#selected_accessor_storage=value}isRtl_=false;connectedCallback(){super.connectedCallback();this.isRtl_=this.matches(":host-context([dir=rtl]) cr-tabs")}firstUpdated(){this.setAttribute("role","tablist");this.addEventListener("keydown",this.onKeyDown_.bind(this))}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("selected")){this.onSelectedChanged_(this.selected,changedProperties.get("selected"))}}getAriaSelected_(index){return index===this.selected?"true":"false"}getIconStyle_(index){const icon=this.tabIcons[index];return icon?`-webkit-mask-image: url(${icon}); display: block;`:""}getTabindex_(index){return index===this.selected?"0":"-1"}getSelectedClass_(index){return index===this.selected?"selected":""}onSelectedChanged_(newSelected,oldSelected){if(newSelected===NONE_SELECTED||oldSelected===NONE_SELECTED||oldSelected===undefined){return}const tabs=this.shadowRoot.querySelectorAll(".tab");if(tabs.length<=oldSelected){return}const oldTabRect=tabs[oldSelected].getBoundingClientRect();const newTabRect=tabs[newSelected].getBoundingClientRect();const newIndicator=tabs[newSelected].querySelector(".tab-indicator");newIndicator.classList.remove("expand","contract");this.updateIndicator_(newIndicator,newTabRect,oldTabRect.left,oldTabRect.width);newIndicator.getBoundingClientRect();newIndicator.classList.add("expand");newIndicator.addEventListener("transitionend",(e=>this.onIndicatorTransitionEnd_(e)),{once:true});const leftmostEdge=Math.min(oldTabRect.left,newTabRect.left);const fullWidth=newTabRect.left>oldTabRect.left?newTabRect.right-oldTabRect.left:oldTabRect.right-newTabRect.left;this.updateIndicator_(newIndicator,newTabRect,leftmostEdge,fullWidth)}async onKeyDown_(e){const count=this.tabNames.length;let newSelection;if(e.key==="Home"){newSelection=0}else if(e.key==="End"){newSelection=count-1}else if(e.key==="ArrowLeft"||e.key==="ArrowRight"){const delta=e.key==="ArrowLeft"?this.isRtl_?1:-1:this.isRtl_?-1:1;newSelection=(count+this.selected+delta)%count}else{return}e.preventDefault();e.stopPropagation();this.selected=newSelection;await this.updateComplete;this.shadowRoot.querySelector(".tab.selected").focus()}onIndicatorTransitionEnd_(event){const indicator=event.target;indicator.classList.replace("expand","contract");indicator.style.transform=`translateX(0) scaleX(1)`}onTabClick_(e){const target=e.currentTarget;this.selected=Number(target.dataset["index"])}updateIndicator_(indicator,originRect,newLeft,newWidth){const leftDiff=100*(newLeft-originRect.left)/originRect.width;const widthRatio=newWidth/originRect.width;const transform=`translateX(${leftDiff}%) scaleX(${widthRatio})`;indicator.style.transform=transform}}customElements.define(CrTabsElement.is,CrTabsElement);let instance$r=null;function getCss$m(){return instance$r||(instance$r=[...[getCss$T()],css`:host{display:block;box-sizing:border-box}#promo{display:flex;align-items:center;background:var(--cr-card-background-color);border-radius:8px;box-shadow:var(--cr-card-shadow);box-sizing:border-box;margin-block-start:16px;margin-block-end:8px;padding:32px 48px 32px 27px;gap:18px;position:relative;width:100%}#close{--cr-icon-button-margin-end:0;position:absolute;inset-block-start:12px;inset-inline-end:12px}#illustration{flex-shrink:0;width:250px;height:121px;background:url(images/history_embeddings_promo.svg) no-repeat center center}@media (prefers-color-scheme:dark){#illustration{background-image:url(images/history_embeddings_promo_dark.svg)}}#text{max-width:573px}#title{margin-block-start:0;margin-block-end:8px;color:var(--cr-primary-text-color);font-size:16px;font-weight:500;line-height:24px}#description{color:var(--cr-secondary-text-color);font-size:13px;font-style:normal;font-weight:400;line-height:20px}#description-first-block{margin-block-end:1em}a{color:var(--cr-link-color);display:inline-block}`])}function getHtml$l(){return html` `}const HISTORY_EMBEDDINGS_PROMO_SHOWN_KEY="history-embeddings-promo";const HISTORY_EMBEDDINGS_ANSWERS_PROMO_SHOWN_KEY="history-embeddings-answers-promo";function getPromoShownKey(){return loadTimeData.getBoolean("enableHistoryEmbeddingsAnswers")?HISTORY_EMBEDDINGS_ANSWERS_PROMO_SHOWN_KEY:HISTORY_EMBEDDINGS_PROMO_SHOWN_KEY}class HistoryEmbeddingsPromoElement extends CrLitElement{static get is(){return"history-embeddings-promo"}static get styles(){return getCss$m()}render(){return getHtml$l.bind(this)()}static get properties(){return{isAnswersEnabled_:{type:Boolean},shown_:{type:Boolean}}}#isAnswersEnabled__accessor_storage=loadTimeData.getBoolean("enableHistoryEmbeddingsAnswers");get isAnswersEnabled_(){return this.#isAnswersEnabled__accessor_storage}set isAnswersEnabled_(value){this.#isAnswersEnabled__accessor_storage=value}#shown__accessor_storage=!window.localStorage.getItem(getPromoShownKey());get shown_(){return this.#shown__accessor_storage}set shown_(value){this.#shown__accessor_storage=value}onCloseClick_(){window.localStorage.setItem(getPromoShownKey(),true.toString());this.shown_=false}}customElements.define(HistoryEmbeddingsPromoElement.is,HistoryEmbeddingsPromoElement);const styleMod$2=document.createElement("dom-module");styleMod$2.appendChild(html$1` `.content);styleMod$2.register("cr-hidden-style");const styleMod$1=document.createElement("dom-module");styleMod$1.appendChild(html$1` `.content);styleMod$1.register("cr-icons");const styleMod=document.createElement("dom-module");styleMod.appendChild(html$1` `.content);styleMod.register("cr-shared-style");const WebUiListenerMixinLit=superClass=>{class WebUiListenerMixinLit extends superClass{webUiListeners_=[];addWebUiListener(eventName,callback){this.webUiListeners_.push(addWebUiListener(eventName,callback))}disconnectedCallback(){super.disconnectedCallback();while(this.webUiListeners_.length>0){removeWebUiListener(this.webUiListeners_.pop())}}}return WebUiListenerMixinLit};let instance$q=null;function getCss$l(){return instance$q||(instance$q=[...[getCss$T()],css`:host{display:block;box-sizing:border-box}#promo{display:flex;align-items:center;background:var(--cr-card-background-color);border-radius:8px;box-shadow:var(--cr-card-shadow);box-sizing:border-box;margin-block-start:16px;margin-block-end:8px;padding:24px 16px;gap:18px;position:relative;width:100%}#close{--cr-icon-button-margin-end:0;position:absolute;inset-block-start:12px;inset-inline-end:12px}.sync-history-illustration{content:url(images/sync_history_promo.svg);width:200px}@media (prefers-color-scheme:dark){.sync-history-illustration{content:url(images/sync_history_promo_dark.svg)}}.promo-content{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;margin-inline-end:28px;margin-block-start:6px}.title{font-size:16px;font-weight:500;margin:0}.description{color:var(--cr-secondary-text-color);max-width:573px}.flex-row{margin-block-start:8px;display:flex;flex-direction:row;width:100%;justify-content:space-between;align-items:center}`])}function getHtml$k(){return html` `}class HistoryCrossDeviceSigninPromoHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history_cross_device_signin_promo.mojom.HistoryCrossDeviceSigninPromoHandler",scope)}}class HistoryCrossDeviceSigninPromoHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(HistoryCrossDeviceSigninPromoHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}shouldShowPromoCard(){return this.proxy.sendMessage(230484457,HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ParamsSpec.$,HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ResponseParamsSpec.$,[],false)}onPromoCardShown(){this.proxy.sendMessage(788794454,HistoryCrossDeviceSigninPromoHandler_OnPromoCardShown_ParamsSpec.$,null,[],false)}onPromoCardDismissed(){this.proxy.sendMessage(1268992088,HistoryCrossDeviceSigninPromoHandler_OnPromoCardDismissed_ParamsSpec.$,null,[],false)}onPromoCardActionClicked(){return this.proxy.sendMessage(2010059715,HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ParamsSpec.$,HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ResponseParamsSpec.$,[],false)}}class HistoryCrossDeviceSigninPromoHandler{static get $interfaceName(){return"history_cross_device_signin_promo.mojom.HistoryCrossDeviceSigninPromoHandler"}static getRemote(){let remote=new HistoryCrossDeviceSigninPromoHandlerRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}const HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ParamsSpec={$:{}};const HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ResponseParamsSpec={$:{}};const HistoryCrossDeviceSigninPromoHandler_OnPromoCardShown_ParamsSpec={$:{}};const HistoryCrossDeviceSigninPromoHandler_OnPromoCardDismissed_ParamsSpec={$:{}};const HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ParamsSpec={$:{}};const HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ResponseParamsSpec={$:{}};mojo.internal.Struct(HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ParamsSpec.$,"HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_Params",[],[[0,8]]);mojo.internal.Struct(HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ResponseParamsSpec.$,"HistoryCrossDeviceSigninPromoHandler_ShouldShowPromoCard_ResponseParams",[mojo.internal.StructField("shouldShow",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(HistoryCrossDeviceSigninPromoHandler_OnPromoCardShown_ParamsSpec.$,"HistoryCrossDeviceSigninPromoHandler_OnPromoCardShown_Params",[],[[0,8]]);mojo.internal.Struct(HistoryCrossDeviceSigninPromoHandler_OnPromoCardDismissed_ParamsSpec.$,"HistoryCrossDeviceSigninPromoHandler_OnPromoCardDismissed_Params",[],[[0,8]]);mojo.internal.Struct(HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ParamsSpec.$,"HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_Params",[],[[0,8]]);mojo.internal.Struct(HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ResponseParamsSpec.$,"HistoryCrossDeviceSigninPromoHandler_OnPromoCardActionClicked_ResponseParams",[],[[0,8]]);class HistoryCrossDeviceSigninPromoBrowserProxy{handler;constructor(handler){this.handler=handler}static getInstance(){if(!instance$p){instance$p=new HistoryCrossDeviceSigninPromoBrowserProxy(HistoryCrossDeviceSigninPromoHandler.getRemote())}return instance$p}static setInstance(obj){instance$p=obj}}let instance$p=null;const HistoryCrossDeviceSigninPromoElementBase=WebUiListenerMixinLit(I18nMixinLit(CrLitElement));class HistoryCrossDeviceSigninPromoElement extends HistoryCrossDeviceSigninPromoElementBase{static get is(){return"history-cross-device-signin-promo"}static get styles(){return getCss$l()}render(){return getHtml$k.bind(this)()}connectedCallback(){super.connectedCallback();this.handler_.shouldShowPromoCard().then((({shouldShow:shouldShow})=>{this.propagateShouldShowPromo_(shouldShow);if(shouldShow){this.handler_.onPromoCardShown()}}))}handler_=HistoryCrossDeviceSigninPromoBrowserProxy.getInstance().handler;onActionButtonClick_(){this.$.actionButton.disabled=true;this.handler_.onPromoCardActionClicked().then((()=>{this.propagateShouldShowPromo_(false)}))}onCloseClick_(){this.handler_.onPromoCardDismissed();this.propagateShouldShowPromo_(false)}propagateShouldShowPromo_(shouldShow){this.fire("should-show-history-cross-device-signin-promo",{shouldShow:shouldShow})}}customElements.define(HistoryCrossDeviceSigninPromoElement.is,HistoryCrossDeviceSigninPromoElement);const FilteringBehaviorSpec={$:mojo.internal.Enum()};var FilteringBehavior;(function(FilteringBehavior){FilteringBehavior[FilteringBehavior["MIN_VALUE"]=-1]="MIN_VALUE";FilteringBehavior[FilteringBehavior["MAX_VALUE"]=3]="MAX_VALUE";FilteringBehavior[FilteringBehavior["kUnknown"]=-1]="kUnknown";FilteringBehavior[FilteringBehavior["kAllow"]=0]="kAllow";FilteringBehavior[FilteringBehavior["kBlock"]=2]="kBlock";FilteringBehavior[FilteringBehavior["kInvalid"]=3]="kInvalid"})(FilteringBehavior||(FilteringBehavior={}));const CriticalActionTypeSpec={$:mojo.internal.Enum()};var CriticalActionType;(function(CriticalActionType){CriticalActionType[CriticalActionType["MIN_VALUE"]=0]="MIN_VALUE";CriticalActionType[CriticalActionType["MAX_VALUE"]=7]="MAX_VALUE";CriticalActionType[CriticalActionType["kUnknown"]=0]="kUnknown";CriticalActionType[CriticalActionType["kFormFill"]=1]="kFormFill";CriticalActionType[CriticalActionType["kDownload"]=2]="kDownload";CriticalActionType[CriticalActionType["kSettingChange"]=3]="kSettingChange";CriticalActionType[CriticalActionType["kCredentialAccess"]=4]="kCredentialAccess";CriticalActionType[CriticalActionType["kGooglePasswordManager"]=5]="kGooglePasswordManager";CriticalActionType[CriticalActionType["kFederatedLogin"]=6]="kFederatedLogin";CriticalActionType[CriticalActionType["kCredentialsOtp"]=7]="kCredentialsOtp"})(CriticalActionType||(CriticalActionType={}));let PageHandlerPendingReceiver$1=class PageHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history.mojom.PageHandler",scope)}};let PageHandlerRemote$1=class PageHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver$1,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}setPage(page){this.proxy.sendMessage(702264332,PageHandler_SetPage_ParamsSpec$1.$,null,[page],false)}queryHistory(query,maxResults,beginTime,includeUserVisits,includeActorVisits){return this.proxy.sendMessage(1161298583,PageHandler_QueryHistory_ParamsSpec.$,PageHandler_QueryHistory_ResponseParamsSpec.$,[query,maxResults,beginTime,includeUserVisits,includeActorVisits],false)}queryHistoryContinuation(){return this.proxy.sendMessage(1975031121,PageHandler_QueryHistoryContinuation_ParamsSpec.$,PageHandler_QueryHistoryContinuation_ResponseParamsSpec.$,[],false)}removeVisits(items){return this.proxy.sendMessage(625367745,PageHandler_RemoveVisits_ParamsSpec.$,PageHandler_RemoveVisits_ResponseParamsSpec.$,[items],false)}openClearBrowsingDataDialog(){this.proxy.sendMessage(16341499,PageHandler_OpenClearBrowsingDataDialog_ParamsSpec.$,null,[],false)}removeBookmark(url){this.proxy.sendMessage(441822040,PageHandler_RemoveBookmark_ParamsSpec.$,null,[url],false)}setLastSelectedTab(lastTab){this.proxy.sendMessage(215517294,PageHandler_SetLastSelectedTab_ParamsSpec.$,null,[lastTab],false)}showSidePanelUI(){this.proxy.sendMessage(1401380332,PageHandler_ShowSidePanelUI_ParamsSpec.$,null,[],false)}requestAccountInfo(){return this.proxy.sendMessage(1192094908,PageHandler_RequestAccountInfo_ParamsSpec.$,PageHandler_RequestAccountInfo_ResponseParamsSpec.$,[],false)}turnOnHistorySync(){this.proxy.sendMessage(2130754912,PageHandler_TurnOnHistorySync_ParamsSpec.$,null,[],false)}shouldShowHistoryPageHistorySyncPromo(){return this.proxy.sendMessage(152414125,PageHandler_ShouldShowHistoryPageHistorySyncPromo_ParamsSpec.$,PageHandler_ShouldShowHistoryPageHistorySyncPromo_ResponseParamsSpec.$,[],false)}recordHistoryPageHistorySyncPromoDismissed(){this.proxy.sendMessage(557793317,PageHandler_RecordHistoryPageHistorySyncPromoDismissed_ParamsSpec.$,null,[],false)}incrementHistoryPageHistorySyncPromoShownCount(){this.proxy.sendMessage(1902532527,PageHandler_IncrementHistoryPageHistorySyncPromoShownCount_ParamsSpec.$,null,[],false)}};let PageHandler$1=class PageHandler{static get $interfaceName(){return"history.mojom.PageHandler"}static getRemote(){let remote=new PageHandlerRemote$1;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}};let PagePendingReceiver$1=class PagePendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history.mojom.Page",scope)}};let PageRemote$1=class PageRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver$1,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}onHistoryDeleted(){this.proxy.sendMessage(1104102036,Page_OnHistoryDeleted_ParamsSpec.$,null,[],false)}onHasOtherFormsChanged(hasOtherForms){this.proxy.sendMessage(2017176175,Page_OnHasOtherFormsChanged_ParamsSpec.$,null,[hasOtherForms],false)}sendAccountInfo(accountInfo){this.proxy.sendMessage(873952978,Page_SendAccountInfo_ParamsSpec.$,null,[accountInfo],false)}};let PageCallbackRouter$1=class PageCallbackRouter{helper_internal_;$;router_;onHistoryDeleted;onHasOtherFormsChanged;sendAccountInfo;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote$1);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.onHistoryDeleted=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1104102036,Page_OnHistoryDeleted_ParamsSpec.$,null,this.onHistoryDeleted.createReceiverHandler(false),false);this.onHasOtherFormsChanged=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(2017176175,Page_OnHasOtherFormsChanged_ParamsSpec.$,null,this.onHasOtherFormsChanged.createReceiverHandler(false),false);this.sendAccountInfo=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(873952978,Page_SendAccountInfo_ParamsSpec.$,null,this.sendAccountInfo.createReceiverHandler(false),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}};const QueryStateSpec={$:{}};const HistoryQuerySpec={$:{}};const DebugInfoSpec={$:{}};const HistoryEntrySpec={$:{}};const CriticalActionSpec={$:{}};const QueryResultSpec={$:{}};const RemovalItemSpec={$:{}};const AccountInfoSpec={$:{}};const PageHandler_SetPage_ParamsSpec$1={$:{}};const PageHandler_QueryHistory_ParamsSpec={$:{}};const PageHandler_QueryHistory_ResponseParamsSpec={$:{}};const PageHandler_QueryHistoryContinuation_ParamsSpec={$:{}};const PageHandler_QueryHistoryContinuation_ResponseParamsSpec={$:{}};const PageHandler_RemoveVisits_ParamsSpec={$:{}};const PageHandler_RemoveVisits_ResponseParamsSpec={$:{}};const PageHandler_OpenClearBrowsingDataDialog_ParamsSpec={$:{}};const PageHandler_RemoveBookmark_ParamsSpec={$:{}};const PageHandler_SetLastSelectedTab_ParamsSpec={$:{}};const PageHandler_ShowSidePanelUI_ParamsSpec={$:{}};const PageHandler_RequestAccountInfo_ParamsSpec={$:{}};const PageHandler_RequestAccountInfo_ResponseParamsSpec={$:{}};const PageHandler_TurnOnHistorySync_ParamsSpec={$:{}};const PageHandler_ShouldShowHistoryPageHistorySyncPromo_ParamsSpec={$:{}};const PageHandler_ShouldShowHistoryPageHistorySyncPromo_ResponseParamsSpec={$:{}};const PageHandler_RecordHistoryPageHistorySyncPromoDismissed_ParamsSpec={$:{}};const PageHandler_IncrementHistoryPageHistorySyncPromoShownCount_ParamsSpec={$:{}};const Page_OnHistoryDeleted_ParamsSpec={$:{}};const Page_OnHasOtherFormsChanged_ParamsSpec={$:{}};const Page_SendAccountInfo_ParamsSpec={$:{}};mojo.internal.Struct(QueryStateSpec.$,"QueryState",[mojo.internal.StructField("incremental",0,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("querying",0,1,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("searchTerm",8,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("after",16,0,mojo.internal.String,null,true,0,undefined,undefined),mojo.internal.StructField("includeUserVisits",0,2,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("includeActorVisits",0,3,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(HistoryQuerySpec.$,"HistoryQuery",[mojo.internal.StructField("term",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("finished",8,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(DebugInfoSpec.$,"DebugInfo",[mojo.internal.StructField("isUrlInLocalDatabase",0,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("visitCount",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined),mojo.internal.StructField("typedCount",8,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(HistoryEntrySpec.$,"HistoryEntry",[mojo.internal.StructField("url",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("title",8,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("domain",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("fallbackFaviconText",24,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("time",32,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("allTimestamps",40,0,mojo.internal.Map(mojo.internal.String,mojo.internal.Array(mojo.internal.Double,false),false),null,false,0,undefined,undefined),mojo.internal.StructField("dateShort",48,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("deviceName",56,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("deviceType",64,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("dateTimeOfDay",72,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("dateRelativeDay",80,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("selected",88,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("readableTimestamp",96,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("snippet",104,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("starred",88,1,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("hostFilteringBehavior",92,0,FilteringBehaviorSpec.$,-1,false,0,undefined,undefined),mojo.internal.StructField("blockedVisit",88,2,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("isUrlInRemoteUserData",88,3,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("isActorVisit",88,4,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("remoteIconUrlForUma",112,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("debug",120,0,DebugInfoSpec.$,null,true,0,undefined,undefined),mojo.internal.StructField("criticalActions",128,0,mojo.internal.Array(CriticalActionSpec.$,false),null,false,0,undefined,undefined)],[[0,144]]);mojo.internal.Struct(CriticalActionSpec.$,"CriticalAction",[mojo.internal.StructField("id",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("label",8,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("tooltip",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("linkoutUrl",24,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("actionType",32,0,CriticalActionTypeSpec.$,0,false,0,undefined,undefined)],[[0,48]]);mojo.internal.Struct(QueryResultSpec.$,"QueryResult",[mojo.internal.StructField("info",0,0,HistoryQuerySpec.$,null,true,0,undefined,undefined),mojo.internal.StructField("value",8,0,mojo.internal.Array(HistoryEntrySpec.$,false),null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(RemovalItemSpec.$,"RemovalItem",[mojo.internal.StructField("url",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("timestamps",8,0,mojo.internal.Array(mojo.internal.Double,false),null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(AccountInfoSpec.$,"AccountInfo",[mojo.internal.StructField("accountImageSrc",0,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("name",8,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("email",16,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(PageHandler_SetPage_ParamsSpec$1.$,"PageHandler_SetPage_Params",[mojo.internal.StructField("page",0,0,mojo.internal.InterfaceProxy(PageRemote$1),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_QueryHistory_ParamsSpec.$,"PageHandler_QueryHistory_Params",[mojo.internal.StructField("query",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("maxResults",8,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("begin_time_$flag",12,0,mojo.internal.Bool,false,false,0,{isPrimary:true,linkedValueFieldName:"begin_time_$value",originalFieldName:"beginTime"},undefined),mojo.internal.StructField("begin_time_$value",16,0,mojo.internal.Double,0,false,0,{isPrimary:false,originalFieldName:"beginTime"},undefined),mojo.internal.StructField("includeUserVisits",12,1,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("includeActorVisits",12,2,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(PageHandler_QueryHistory_ResponseParamsSpec.$,"PageHandler_QueryHistory_ResponseParams",[mojo.internal.StructField("results",0,0,QueryResultSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_QueryHistoryContinuation_ParamsSpec.$,"PageHandler_QueryHistoryContinuation_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_QueryHistoryContinuation_ResponseParamsSpec.$,"PageHandler_QueryHistoryContinuation_ResponseParams",[mojo.internal.StructField("results",0,0,QueryResultSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RemoveVisits_ParamsSpec.$,"PageHandler_RemoveVisits_Params",[mojo.internal.StructField("items",0,0,mojo.internal.Array(RemovalItemSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RemoveVisits_ResponseParamsSpec.$,"PageHandler_RemoveVisits_ResponseParams",[],[[0,8]]);mojo.internal.Struct(PageHandler_OpenClearBrowsingDataDialog_ParamsSpec.$,"PageHandler_OpenClearBrowsingDataDialog_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_RemoveBookmark_ParamsSpec.$,"PageHandler_RemoveBookmark_Params",[mojo.internal.StructField("url",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_SetLastSelectedTab_ParamsSpec.$,"PageHandler_SetLastSelectedTab_Params",[mojo.internal.StructField("lastTab",0,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_ShowSidePanelUI_ParamsSpec.$,"PageHandler_ShowSidePanelUI_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_RequestAccountInfo_ParamsSpec.$,"PageHandler_RequestAccountInfo_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_RequestAccountInfo_ResponseParamsSpec.$,"PageHandler_RequestAccountInfo_ResponseParams",[mojo.internal.StructField("accountInfo",0,0,AccountInfoSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_TurnOnHistorySync_ParamsSpec.$,"PageHandler_TurnOnHistorySync_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_ShouldShowHistoryPageHistorySyncPromo_ParamsSpec.$,"PageHandler_ShouldShowHistoryPageHistorySyncPromo_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_ShouldShowHistoryPageHistorySyncPromo_ResponseParamsSpec.$,"PageHandler_ShouldShowHistoryPageHistorySyncPromo_ResponseParams",[mojo.internal.StructField("shouldShow",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(PageHandler_RecordHistoryPageHistorySyncPromoDismissed_ParamsSpec.$,"PageHandler_RecordHistoryPageHistorySyncPromoDismissed_Params",[],[[0,8]]);mojo.internal.Struct(PageHandler_IncrementHistoryPageHistorySyncPromoShownCount_ParamsSpec.$,"PageHandler_IncrementHistoryPageHistorySyncPromoShownCount_Params",[],[[0,8]]);mojo.internal.Struct(Page_OnHistoryDeleted_ParamsSpec.$,"Page_OnHistoryDeleted_Params",[],[[0,8]]);mojo.internal.Struct(Page_OnHasOtherFormsChanged_ParamsSpec.$,"Page_OnHasOtherFormsChanged_Params",[mojo.internal.StructField("hasOtherForms",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Page_SendAccountInfo_ParamsSpec.$,"Page_SendAccountInfo_Params",[mojo.internal.StructField("accountInfo",0,0,AccountInfoSpec.$,null,false,0,undefined,undefined)],[[0,16]]);class BrowserProxyImpl{handler;callbackRouter;constructor(){this.handler=PageHandler$1.getRemote();this.callbackRouter=new PageCallbackRouter$1;this.handler.setPage(this.callbackRouter.$.bindNewPipeAndPassRemote())}recordHistogram(histogram,value,max){chrome.send("metricsHandler:recordInHistogram",[histogram,value,max])}recordBooleanHistogram(histogram,value){chrome.metricsPrivate.recordBoolean(histogram,value)}recordAction(action){if(action.indexOf("_")===-1){action=`HistoryPage_${action}`}chrome.send("metricsHandler:recordAction",[action])}recordTime(histogram,time){chrome.send("metricsHandler:recordTime",[histogram,time])}recordLongTime(histogram,time){chrome.metricsPrivate.recordLongTime(histogram,time)}recordSigninPendingOffered(){chrome.send("recordSigninPendingOffered")}navigateToUrl(url,target,e){chrome.send("navigateToUrl",[url,target,e.button,e.altKey,e.ctrlKey,e.metaKey,e.shiftKey])}otherDevicesInitialized(){chrome.send("otherDevicesInitialized")}getInitialIdentityState(){return sendWithPromise("getInitialIdentityState")}startTurnOnSyncFlow(){chrome.send("startTurnOnSyncFlow")}static getInstance(){return instance$o||(instance$o=new BrowserProxyImpl)}static setInstance(obj){instance$o=obj}}let instance$o=null;const RESULTS_PER_PAGE=150;const BROWSING_GAP_TIME=15*60*1e3;var HistorySignInState;(function(HistorySignInState){HistorySignInState[HistorySignInState["SIGNED_OUT"]=0]="SIGNED_OUT";HistorySignInState[HistorySignInState["WEB_ONLY_SIGNED_IN"]=1]="WEB_ONLY_SIGNED_IN";HistorySignInState[HistorySignInState["SIGNED_IN"]=2]="SIGNED_IN";HistorySignInState[HistorySignInState["SIGN_IN_PENDING"]=3]="SIGN_IN_PENDING"})(HistorySignInState||(HistorySignInState={}));var SyncState;(function(SyncState){SyncState[SyncState["TURNED_OFF"]=0]="TURNED_OFF";SyncState[SyncState["TURNED_ON"]=1]="TURNED_ON";SyncState[SyncState["DISABLED"]=2]="DISABLED"})(SyncState||(SyncState={}));var HistoryPageViewHistogram;(function(HistoryPageViewHistogram){HistoryPageViewHistogram[HistoryPageViewHistogram["HISTORY"]=0]="HISTORY";HistoryPageViewHistogram[HistoryPageViewHistogram["DEPRECATED_GROUPED_WEEK"]=1]="DEPRECATED_GROUPED_WEEK";HistoryPageViewHistogram[HistoryPageViewHistogram["DEPRECATED_GROUPED_MONTH"]=2]="DEPRECATED_GROUPED_MONTH";HistoryPageViewHistogram[HistoryPageViewHistogram["SYNCED_TABS"]=3]="SYNCED_TABS";HistoryPageViewHistogram[HistoryPageViewHistogram["SIGNIN_PROMO"]=4]="SIGNIN_PROMO";HistoryPageViewHistogram[HistoryPageViewHistogram["JOURNEYS"]=5]="JOURNEYS";HistoryPageViewHistogram[HistoryPageViewHistogram["PRODUCT_SPECIFICATIONS_LISTS"]=6]="PRODUCT_SPECIFICATIONS_LISTS";HistoryPageViewHistogram[HistoryPageViewHistogram["END"]=7]="END"})(HistoryPageViewHistogram||(HistoryPageViewHistogram={}));const SYNCED_TABS_HISTOGRAM_NAME="HistoryPage.OtherDevicesMenu";var SyncedTabsHistogram;(function(SyncedTabsHistogram){SyncedTabsHistogram[SyncedTabsHistogram["INITIALIZED"]=0]="INITIALIZED";SyncedTabsHistogram[SyncedTabsHistogram["SHOW_MENU_DEPRECATED"]=1]="SHOW_MENU_DEPRECATED";SyncedTabsHistogram[SyncedTabsHistogram["LINK_CLICKED"]=2]="LINK_CLICKED";SyncedTabsHistogram[SyncedTabsHistogram["LINK_RIGHT_CLICKED"]=3]="LINK_RIGHT_CLICKED";SyncedTabsHistogram[SyncedTabsHistogram["SESSION_NAME_RIGHT_CLICKED_DEPRECATED"]=4]="SESSION_NAME_RIGHT_CLICKED_DEPRECATED";SyncedTabsHistogram[SyncedTabsHistogram["SHOW_SESSION_MENU"]=5]="SHOW_SESSION_MENU";SyncedTabsHistogram[SyncedTabsHistogram["COLLAPSE_SESSION"]=6]="COLLAPSE_SESSION";SyncedTabsHistogram[SyncedTabsHistogram["EXPAND_SESSION"]=7]="EXPAND_SESSION";SyncedTabsHistogram[SyncedTabsHistogram["OPEN_ALL"]=8]="OPEN_ALL";SyncedTabsHistogram[SyncedTabsHistogram["HAS_FOREIGN_DATA"]=9]="HAS_FOREIGN_DATA";SyncedTabsHistogram[SyncedTabsHistogram["HIDE_FOR_NOW"]=10]="HIDE_FOR_NOW";SyncedTabsHistogram[SyncedTabsHistogram["OPENED_LINK_VIA_CONTEXT_MENU"]=11]="OPENED_LINK_VIA_CONTEXT_MENU";SyncedTabsHistogram[SyncedTabsHistogram["LIMIT"]=12]="LIMIT"})(SyncedTabsHistogram||(SyncedTabsHistogram={}));var VisitContextMenuAction;(function(VisitContextMenuAction){VisitContextMenuAction[VisitContextMenuAction["MORE_FROM_THIS_SITE_CLICKED"]=0]="MORE_FROM_THIS_SITE_CLICKED";VisitContextMenuAction[VisitContextMenuAction["REMOVE_FROM_HISTORY_CLICKED"]=1]="REMOVE_FROM_HISTORY_CLICKED";VisitContextMenuAction[VisitContextMenuAction["REMOVE_BOOKMARK_CLICKED"]=2]="REMOVE_BOOKMARK_CLICKED";VisitContextMenuAction[VisitContextMenuAction["REVIEW_GEMINI_ACTIVITY_CLICKED"]=3]="REVIEW_GEMINI_ACTIVITY_CLICKED";VisitContextMenuAction[VisitContextMenuAction["MAX_VALUE"]=4]="MAX_VALUE"})(VisitContextMenuAction||(VisitContextMenuAction={}));let instance$n=null;function getCss$k(){return instance$n||(instance$n=[...[getCss$T()],css`:host{display:block;box-sizing:border-box}#promo{display:flex;align-items:center;background:var(--cr-card-background-color);border-radius:8px;box-shadow:var(--cr-card-shadow);box-sizing:border-box;margin-block-start:16px;margin-block-end:8px;padding:24px 16px;gap:18px;position:relative;width:100%}#close{--cr-icon-button-margin-end:0;position:absolute;inset-block-start:12px;inset-inline-end:12px}.sync-history-illustration{content:url(images/sync_history_promo.svg);width:200px}@media (prefers-color-scheme:dark){.sync-history-illustration{content:url(images/sync_history_promo_dark.svg)}}.promo-content{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;margin-right:28px;margin-top:6px}.title{font-size:16px;font-weight:500;margin:0}.description{color:var(--cr-secondary-text-color);max-width:573px}.web-only-signed-in-description{color:var(--cr-secondary-text-color);max-width:726px}.profile-row{text-align:left;align-items:center;display:flex}.avatar{border-radius:50%;height:32px;margin-inline-end:12px;width:32px}.account-name{font-size:13px}.account-email{font-size:12px}.flex-row{margin-top:8px;display:flex;flex-direction:row;width:100%;justify-content:space-between;align-items:center}`])}function getHtml$j(){return html` ${this.shown_?html` `:""} `}const HistorySyncPromoElementBase=WebUiListenerMixinLit(CrLitElement);class HistorySyncPromoElement extends HistorySyncPromoElementBase{static get is(){return"history-sync-promo"}static get styles(){return getCss$k()}render(){return getHtml$j.bind(this)()}static get properties(){return{shown_:{type:Boolean},historyIdentityState_:{type:Object},accountInfo_:{type:Object}}}#shown__accessor_storage=true;get shown_(){return this.#shown__accessor_storage}set shown_(value){this.#shown__accessor_storage=value}#accountInfo__accessor_storage=null;get accountInfo_(){return this.#accountInfo__accessor_storage}set accountInfo_(value){this.#accountInfo__accessor_storage=value}callbackRouter_;onAccountInfoDataReceivedListenerId_=null;#historyIdentityState__accessor_storage={signIn:HistorySignInState.SIGNED_OUT,tabsSync:SyncState.TURNED_OFF,historySync:SyncState.TURNED_OFF};get historyIdentityState_(){return this.#historyIdentityState__accessor_storage}set historyIdentityState_(value){this.#historyIdentityState__accessor_storage=value}constructor(){super();this.callbackRouter_=BrowserProxyImpl.getInstance().callbackRouter}connectedCallback(){super.connectedCallback();BrowserProxyImpl.getInstance().getInitialIdentityState().then((identityState=>{this.historyIdentityState_=identityState}));this.addWebUiListener("history-identity-state-changed",(identityState=>this.historyIdentityState_=identityState));this.onAccountInfoDataReceivedListenerId_=this.callbackRouter_.sendAccountInfo.addListener(this.handleAccountInfoChanged_.bind(this));BrowserProxyImpl.getInstance().handler.requestAccountInfo().then((({accountInfo:accountInfo})=>this.handleAccountInfoChanged_(accountInfo)));BrowserProxyImpl.getInstance().handler.incrementHistoryPageHistorySyncPromoShownCount()}disconnectedCallback(){super.disconnectedCallback();if(this.onAccountInfoDataReceivedListenerId_!==null){this.callbackRouter_.removeListener(this.onAccountInfoDataReceivedListenerId_);this.onAccountInfoDataReceivedListenerId_=null}}handleAccountInfoChanged_(accountInfo){this.accountInfo_=accountInfo}onCloseClick_(){this.shown_=false;BrowserProxyImpl.getInstance().handler.recordHistoryPageHistorySyncPromoDismissed()}isSignInState_(state){return this.historyIdentityState_.signIn===state}isHistorySyncTurnedOn_(){return this.historyIdentityState_.historySync===SyncState.TURNED_ON}onTurnOnHistorySyncClick_(){BrowserProxyImpl.getInstance().handler.turnOnHistorySync()}}customElements.define(HistorySyncPromoElement.is,HistorySyncPromoElement);function getHtml$i(){return html``}class HistorySearchedLabelElement extends CrLitElement{static get is(){return"history-searched-label"}render(){return getHtml$i.bind(this)()}static get properties(){return{title:{type:String},searchTerm:{type:String}}}#searchTerm_accessor_storage="";get searchTerm(){return this.#searchTerm_accessor_storage}set searchTerm(value){this.#searchTerm_accessor_storage=value}#title_accessor_storage="";get title(){return this.#title_accessor_storage}set title(value){this.#title_accessor_storage=value}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("title")||changedProperties.has("searchTerm")){this.setSearchedTextToBold_()}}setSearchedTextToBold_(){if(this.title===undefined){return}const titleText=this.title;if(this.searchTerm===""||this.searchTerm===null||this.searchTerm===undefined){this.textContent=titleText;return}const re=new RegExp(quoteString(this.searchTerm),"gim");let i=0;let match;this.textContent="";while(match=re.exec(titleText)){if(match.index>i){this.appendChild(document.createTextNode(titleText.slice(i,match.index)))}i=re.lastIndex;const b=document.createElement("b");b.textContent=titleText.substring(match.index,i);this.appendChild(b)}if(i `;const iconsets$1=div$1.querySelectorAll("cr-iconset");for(const iconset of iconsets$1){document.head.appendChild(iconset)}let instance$m=null;function getCss$j(){return instance$m||(instance$m=[...[],css`:host{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:flex;outline:none;user-select:none;--cr-checkbox-border-size:2px;--cr-checkbox-size:16px;--cr-checkbox-ripple-size:32px;--cr-checkbox-ripple-offset:50%;--cr-checkbox-checked-box-color:var(--cr-checked-color);--cr-checkbox-ripple-checked-color:var(--cr-active-background-color);--cr-checkbox-ripple-opacity:1;--cr-checkbox-mark-color:var(--color-checkbox-check,var(--cr-fallback-color-on-primary));--cr-checkbox-ripple-unchecked-color:var(--cr-active-background-color);--cr-checkbox-unchecked-box-color:var(--color-checkbox-foreground-unchecked,var(--cr-fallback-color-outline));--cr-checkbox-checked-ripple-opacity:.2;--cr-checkbox-unchecked-ripple-opacity:.15}@media (prefers-color-scheme:dark){:host{--cr-checkbox-checked-ripple-opacity:.4;--cr-checkbox-unchecked-ripple-opacity:.4}}:host([disabled]){cursor:initial;opacity:1;pointer-events:none;--cr-checkbox-checked-box-color:var(--color-checkbox-container-disabled,var(--cr-fallback-color-disabled-background));--cr-checkbox-unchecked-box-color:var(--color-checkbox-outline-disabled,var(--cr-fallback-color-disabled-background));--cr-checkbox-mark-color:var(--color-checkbox-check-disabled,var(--cr-fallback-color-disabled-foreground))}#checkbox{background:none;border:var(--cr-checkbox-border-size) solid var(--cr-checkbox-unchecked-box-color);border-radius:2px;box-sizing:border-box;cursor:pointer;display:block;flex-shrink:0;height:var(--cr-checkbox-size);isolation:isolate;margin:0;outline:none;padding:0;position:relative;transform:none;width:var(--cr-checkbox-size)}:host([disabled][checked]) #checkbox{border-color:transparent}#hover-layer{display:none}#checkbox:hover #hover-layer{background-color:var(--cr-hover-background-color);border-radius:50%;display:block;height:32px;left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);width:32px}@media (forced-colors:active){:host(:focus) #checkbox{outline:var(--cr-focus-outline-hcm)}}#checkbox:focus-visible{outline:var(--cr-checkbox-focus-outline,2px solid var(--cr-focus-outline-color));outline-offset:2px}#checkmark{display:block;forced-color-adjust:auto;position:relative;transform:scale(0);z-index:1}#checkmark path{fill:var(--cr-checkbox-mark-color)}:host([checked]) #checkmark{transform:scale(1);transition:transform 140ms ease-out}:host([checked]) #checkbox{background:var(--cr-checkbox-checked-box-background-color,var(--cr-checkbox-checked-box-color));border-color:var(--cr-checkbox-checked-box-color)}#ink{--paper-ripple-opacity:var(--cr-checkbox-ripple-opacity,var(--cr-checkbox-unchecked-ripple-opacity));color:var(--cr-checkbox-ripple-unchecked-color);height:var(--cr-checkbox-ripple-size);left:var(--cr-checkbox-ripple-offset);outline:var(--cr-checkbox-ripple-ring,none);pointer-events:none;top:var(--cr-checkbox-ripple-offset);transform:translate(-50%,-50%);transition:color linear 80ms;width:var(--cr-checkbox-ripple-size)}:host([checked]) #ink{--paper-ripple-opacity:var(--cr-checkbox-ripple-opacity,var(--cr-checkbox-checked-ripple-opacity));color:var(--cr-checkbox-ripple-checked-color)}:host-context([dir=rtl]) #ink{left:auto;right:var(--cr-checkbox-ripple-offset);transform:translate(50%,-50%)}#labelContainer{color:var(--cr-checkbox-label-color,var(--cr-primary-text-color));padding-inline-start:var(--cr-checkbox-label-padding-start,20px);white-space:normal}:host(.label-first) #labelContainer{order:-1;padding-inline-end:var(--cr-checkbox-label-padding-end,20px);padding-inline-start:0}:host(.no-label) #labelContainer{display:none}#ariaDescription{height:0;overflow:hidden;width:0}`])}function getHtml$h(){return html`
`}const CrCheckboxElementBase=CrRippleMixin(CrLitElement);class CrCheckboxElement extends CrCheckboxElementBase{static get is(){return"cr-checkbox"}static get styles(){return getCss$j()}render(){return getHtml$h.bind(this)()}static get properties(){return{checked:{type:Boolean,reflect:true,notify:true},disabled:{type:Boolean,reflect:true},ariaDescription:{type:String},ariaLabelOverride:{type:String},tabIndex:{type:Number}}}#checked_accessor_storage=false;get checked(){return this.#checked_accessor_storage}set checked(value){this.#checked_accessor_storage=value}#disabled_accessor_storage=false;get disabled(){return this.#disabled_accessor_storage}set disabled(value){this.#disabled_accessor_storage=value}#ariaDescription_accessor_storage=null;get ariaDescription(){return this.#ariaDescription_accessor_storage}set ariaDescription(value){this.#ariaDescription_accessor_storage=value}#ariaLabelOverride_accessor_storage;get ariaLabelOverride(){return this.#ariaLabelOverride_accessor_storage}set ariaLabelOverride(value){this.#ariaLabelOverride_accessor_storage=value}#tabIndex_accessor_storage=0;get tabIndex(){return this.#tabIndex_accessor_storage}set tabIndex(value){this.#tabIndex_accessor_storage=value}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("disabled")){const previousTabIndex=changedProperties.get("disabled");if(previousTabIndex!==undefined||this.disabled){this.tabIndex=this.disabled?-1:0}}}firstUpdated(){this.addEventListener("click",this.onClick_.bind(this));this.addEventListener("pointerup",this.hideRipple_.bind(this));this.$.labelContainer.addEventListener("pointerdown",this.showRipple_.bind(this));this.$.labelContainer.addEventListener("pointerleave",this.hideRipple_.bind(this));this.$.checkbox.addEventListener("click",this.onCheckboxClick_.bind(this))}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("tabIndex")){this.removeAttribute("tabindex")}}focus(){this.$.checkbox.focus()}getFocusableElement(){return this.$.checkbox}getAriaDisabled_(){return this.disabled?"true":"false"}getAriaChecked_(){return this.checked?"true":"false"}showRipple_(){if(this.noink){return}this.getRipple().showAndHoldDown()}hideRipple_(){this.getRipple().clear()}onCheckboxClick_(e){e.stopPropagation();e.preventDefault();this.click()}async onClick_(e){if(this.disabled||e.target.tagName==="A"){return}e.stopPropagation();e.preventDefault();this.checked=!this.checked;await this.updateComplete;this.fire("change",this.checked)}onKeydown_(e){if(e.key!==" "&&(e.key!=="Enter"||isMac&&e.ctrlKey)){return}e.preventDefault();e.stopPropagation();if(e.repeat){return}if(e.key==="Enter"){this.click()}}onKeyup_(e){if(e.key===" "||e.key==="Enter"&&!(isMac&&e.ctrlKey)){e.preventDefault();e.stopPropagation()}if(e.key===" "){this.click()}}createRipple(){this.rippleContainer=this.$.checkbox;const ripple=super.createRipple();ripple.setAttribute("recenters","");ripple.classList.add("circle");return ripple}}customElements.define(CrCheckboxElement.is,CrCheckboxElement);let instance$l=null;function getCss$i(){return instance$l||(instance$l=[...[],css`:host{--collapse-duration:var(--iron-collapse-transition-duration,300ms);display:block;transition:max-height var(--collapse-duration) ease-out;overflow:visible}:host([no-animation]){transition:none}:host(.collapse-closed){display:none}:host(:not(.collapse-opened)){overflow:hidden}`])}function getHtml$g(){return html``}class CrCollapseElement extends CrLitElement{static get is(){return"cr-collapse"}static get styles(){return getCss$i()}render(){return getHtml$g.bind(this)()}static get properties(){return{opened:{type:Boolean,notify:true},noAnimation:{type:Boolean,reflect:true}}}#opened_accessor_storage=false;get opened(){return this.#opened_accessor_storage}set opened(value){this.#opened_accessor_storage=value}#noAnimation_accessor_storage=false;get noAnimation(){return this.#noAnimation_accessor_storage}set noAnimation(value){this.#noAnimation_accessor_storage=value}toggle(){this.opened=!this.opened}show(){this.opened=true}hide(){this.opened=false}firstUpdated(){if(!this.hasAttribute("role")){this.setAttribute("role","group")}this.setAttribute("aria-hidden","true");this.addEventListener("transitionend",(e=>this.onTransitionEnd_(e)))}updated(changedProperties){super.updated(changedProperties);if(!changedProperties.has("opened")){return}this.setAttribute("aria-hidden",this.opened?"false":"true");this.classList.toggle("collapse-closed",false);this.classList.toggle("collapse-opened",false);this.updateHeight_(this.opened,changedProperties.get("opened"));if(this.opened){this.focus()}}updateHeight_(opening,lastOpened){const finalMaxHeight=opening?"":"0px";const animationStartSize=`${this.getBoundingClientRect().height}px`;const animationEndSize=opening?`${this.scrollHeight}px`:"0px";const willAnimate=lastOpened!==undefined&&!this.noAnimation&&this.style.maxHeight!==finalMaxHeight&&animationStartSize!==animationEndSize;if(willAnimate&&!opening){this.style.maxHeight=animationStartSize;this.scrollTop=this.scrollTop}this.style.maxHeight=animationEndSize;if(!willAnimate){this.updateStyles_()}}onTransitionEnd_(e){if(e.composedPath()[0]===this){this.updateStyles_()}}updateStyles_(){this.style.maxHeight=this.opened?"":"0px";this.classList.toggle("collapse-closed",!this.opened);this.classList.toggle("collapse-opened",this.opened)}}customElements.define(CrCollapseElement.is,CrCollapseElement);let instance$k=null;function getCss$h(){return instance$k||(instance$k=[...[getCss$T()],css`:host{display:block;position:absolute;outline:none;z-index:1002;user-select:none;cursor:default}#tooltip{display:block;outline:none;font-size:10px;line-height:1;background-color:var(--paper-tooltip-background,#616161);color:var(--paper-tooltip-text-color,white);padding:8px;border-radius:2px}@keyframes keyFrameFadeInOpacity{0%{opacity:0}100%{opacity:var(--paper-tooltip-opacity,0.9)}}@keyframes keyFrameFadeOutOpacity{0%{opacity:var(--paper-tooltip-opacity,0.9)}100%{opacity:0}}.fade-in-animation{opacity:0;animation-delay:var(--paper-tooltip-delay-in,500ms);animation-name:keyFrameFadeInOpacity;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:var(--paper-tooltip-duration-in,500ms);animation-fill-mode:forwards}.fade-out-animation{opacity:var(--paper-tooltip-opacity,0.9);animation-delay:var(--paper-tooltip-delay-out,0ms);animation-name:keyFrameFadeOutOpacity;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:var(--paper-tooltip-duration-out,500ms);animation-fill-mode:forwards}#tooltipOffsetFiller{position:absolute;:host([position='top']) &{top:100%}:host([position='bottom']) &{bottom:100%}:host([position='left']) &{left:100%}:host([position='right']) &{right:100%}:host(:is([position='top'],[position='bottom'])) &{left:0;height:var(--cr-tooltip-offset);width:100%}:host(:is([position='left'],[position='right'])) &{top:0;height:100%;width:var(--cr-tooltip-offset)}}`])}function getHtml$f(){return html`
`}var TooltipPosition;(function(TooltipPosition){TooltipPosition["TOP"]="top";TooltipPosition["BOTTOM"]="bottom";TooltipPosition["LEFT"]="left";TooltipPosition["RIGHT"]="right"})(TooltipPosition||(TooltipPosition={}));class CrTooltipElement extends CrLitElement{static get is(){return"cr-tooltip"}static get styles(){return getCss$h()}render(){return getHtml$f.bind(this)()}static get properties(){return{for:{type:String},manualMode:{type:Boolean},position:{type:String,reflect:true},fitToVisibleBounds:{type:Boolean},offset:{type:Number},animationDelay:{type:Number},hideDelay:{type:Number}}}#animationDelay_accessor_storage=500;get animationDelay(){return this.#animationDelay_accessor_storage}set animationDelay(value){this.#animationDelay_accessor_storage=value}#fitToVisibleBounds_accessor_storage=false;get fitToVisibleBounds(){return this.#fitToVisibleBounds_accessor_storage}set fitToVisibleBounds(value){this.#fitToVisibleBounds_accessor_storage=value}#hideDelay_accessor_storage=600;get hideDelay(){return this.#hideDelay_accessor_storage}set hideDelay(value){this.#hideDelay_accessor_storage=value}#for_accessor_storage="";get for(){return this.#for_accessor_storage}set for(value){this.#for_accessor_storage=value}#manualMode_accessor_storage=false;get manualMode(){return this.#manualMode_accessor_storage}set manualMode(value){this.#manualMode_accessor_storage=value}#offset_accessor_storage=14;get offset(){return this.#offset_accessor_storage}set offset(value){this.#offset_accessor_storage=value}#position_accessor_storage=TooltipPosition.BOTTOM;get position(){return this.#position_accessor_storage}set position(value){this.#position_accessor_storage=value}animationPlaying_=false;showing_=false;manualTarget_;target_=null;tracker_=new EventTracker;hideTimeout_=null;connectedCallback(){super.connectedCallback();this.findTarget_()}disconnectedCallback(){super.disconnectedCallback();if(!this.manualMode){this.removeListeners_()}this.resetHideTimeout_()}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("animationDelay")){this.style.setProperty("--paper-tooltip-delay-in",`${this.animationDelay}ms`)}}firstUpdated(changedProperties){super.firstUpdated(changedProperties);this.addEventListener("animationend",(()=>this.onAnimationEnd_()))}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("for")){this.findTarget_()}if(changedProperties.has("manualMode")){if(this.manualMode){this.removeListeners_()}else{this.addListeners_()}}if(changedProperties.has("offset")){this.style.setProperty("--cr-tooltip-offset",`${this.offset}px`)}}get target(){if(this.manualTarget_){return this.manualTarget_}const ownerRoot=this.getRootNode();if(this.for){return ownerRoot.querySelector(`#${this.for}`)}const parentNode=this.parentNode;return!!parentNode&&parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?ownerRoot.host:parentNode}set target(target){this.manualTarget_=target;this.findTarget_()}show(){this.resetHideTimeout_();if(this.showing_){return}if(!!this.textContent&&this.textContent.trim()===""){const children=this.shadowRoot.querySelector("slot").assignedElements();const hasNonEmptyChild=Array.from(children).some((el=>!!el.textContent&&el.textContent.trim()!==""));if(!hasNonEmptyChild){return}}this.showing_=true;this.$.tooltip.hidden=false;this.$.tooltip.classList.remove("fade-out-animation");this.updatePosition();this.animationPlaying_=true;this.$.tooltip.classList.add("fade-in-animation")}hide(){if(!this.showing_){return}if(this.animationPlaying_){this.showing_=false;this.$.tooltip.classList.remove("fade-in-animation","fade-out-animation");this.$.tooltip.hidden=true;return}this.$.tooltip.classList.remove("fade-in-animation");this.$.tooltip.classList.add("fade-out-animation");this.showing_=false;this.animationPlaying_=true}queueHide_(){this.resetHideTimeout_();this.hideTimeout_=setTimeout((()=>{this.hide();this.hideTimeout_=null}),this.hideDelay)}resetHideTimeout_(){if(this.hideTimeout_!==null){clearTimeout(this.hideTimeout_);this.hideTimeout_=null}}updatePosition(){if(!this.target_){return}const offsetParent=this.offsetParent||this.composedOffsetParent_();if(!offsetParent){return}const offset=this.offset;const parentRect=offsetParent.getBoundingClientRect();const targetRect=this.target_.getBoundingClientRect();const tooltipRect=this.$.tooltip.getBoundingClientRect();const horizontalCenterOffset=(targetRect.width-tooltipRect.width)/2;const verticalCenterOffset=(targetRect.height-tooltipRect.height)/2;const targetLeft=targetRect.left-parentRect.left;const targetTop=targetRect.top-parentRect.top;let tooltipLeft;let tooltipTop;switch(this.position){case TooltipPosition.TOP:tooltipLeft=targetLeft+horizontalCenterOffset;tooltipTop=targetTop-tooltipRect.height-offset;break;case TooltipPosition.BOTTOM:tooltipLeft=targetLeft+horizontalCenterOffset;tooltipTop=targetTop+targetRect.height+offset;break;case TooltipPosition.LEFT:tooltipLeft=targetLeft-tooltipRect.width-offset;tooltipTop=targetTop+verticalCenterOffset;break;case TooltipPosition.RIGHT:tooltipLeft=targetLeft+targetRect.width+offset;tooltipTop=targetTop+verticalCenterOffset;break;default:assertNotReachedCase(this.position)}if(this.fitToVisibleBounds){if(parentRect.left+tooltipLeft+tooltipRect.width>window.innerWidth){this.style.right="0px";this.style.left="auto"}else{this.style.left=Math.max(0,tooltipLeft)+"px";this.style.right="auto"}if(parentRect.top+tooltipTop+tooltipRect.height>window.innerHeight){this.style.bottom=parentRect.height-targetTop+offset+"px";this.style.top="auto"}else{this.style.top=Math.max(-parentRect.top,tooltipTop)+"px";this.style.bottom="auto"}}else{this.style.left=tooltipLeft+"px";this.style.top=tooltipTop+"px"}}findTarget_(){if(!this.manualMode){this.removeListeners_()}this.target_=this.target;if(!this.manualMode){this.addListeners_()}}onAnimationEnd_(){this.animationPlaying_=false;if(!this.showing_){this.$.tooltip.classList.remove("fade-out-animation");this.$.tooltip.hidden=true}}addListeners_(){if(this.target_){this.tracker_.add(this.target_,"pointerenter",(()=>this.show()));this.tracker_.add(this.target_,"focus",(()=>this.show()));this.tracker_.add(this.target_,"pointerleave",(()=>this.queueHide_()));this.tracker_.add(this.target_,"blur",(()=>this.hide()));this.tracker_.add(this.target_,"click",(()=>this.hide()))}this.tracker_.add(this.$.tooltip,"animationend",(()=>this.onAnimationEnd_()));this.tracker_.add(this,"pointerenter",(()=>this.show()));this.tracker_.add(this,"pointerleave",(()=>this.queueHide_()))}removeListeners_(){this.tracker_.removeAll()}composedOffsetParent_(){if(this.computedStyleMap().get("display").value==="none"){return null}for(let ancestor=flatTreeParent(this);ancestor!==null;ancestor=flatTreeParent(ancestor)){if(!(ancestor instanceof Element)){continue}const style=ancestor.computedStyleMap();if(style.get("display").value==="none"){return null}if(style.get("display").value==="contents"){continue}if(style.get("position").value!=="static"){return ancestor}if(ancestor.tagName==="BODY"){return ancestor}}return null;function flatTreeParent(element){if(element.assignedSlot){return element.assignedSlot}if(element.parentNode instanceof ShadowRoot){return element.parentNode.host}return element.parentElement}}}customElements.define(CrTooltipElement.is,CrTooltipElement);let instance$j=null;function getCss$g(){return instance$j||(instance$j=[...[getCss$O()],css`:host{display:flex}cr-icon{--iron-icon-width:var(--cr-icon-size);--iron-icon-height:var(--cr-icon-size);--iron-icon-fill-color:var(--cr-tooltip-icon-fill-color,var(--google-grey-700))}@media (prefers-color-scheme:dark){cr-icon{--iron-icon-fill-color:var(--cr-tooltip-icon-fill-color,var(--google-grey-500))}}`])}function getHtml$e(){return html` ${this.tooltipText} `}class CrTooltipIconElement extends CrLitElement{static get is(){return"cr-tooltip-icon"}static get styles(){return getCss$g()}render(){return getHtml$e.bind(this)()}static get properties(){return{iconAriaLabel:{type:String},iconClass:{type:String},tooltipText:{type:String},tooltipPosition:{type:String}}}#iconAriaLabel_accessor_storage="";get iconAriaLabel(){return this.#iconAriaLabel_accessor_storage}set iconAriaLabel(value){this.#iconAriaLabel_accessor_storage=value}#iconClass_accessor_storage="";get iconClass(){return this.#iconClass_accessor_storage}set iconClass(value){this.#iconClass_accessor_storage=value}#tooltipText_accessor_storage="";get tooltipText(){return this.#tooltipText_accessor_storage}set tooltipText(value){this.#tooltipText_accessor_storage=value}#tooltipPosition_accessor_storage="top";get tooltipPosition(){return this.#tooltipPosition_accessor_storage}set tooltipPosition(value){this.#tooltipPosition_accessor_storage=value}getFocusableElement(){return this.$.indicator}}customElements.define(CrTooltipIconElement.is,CrTooltipIconElement);class FocusRowMixinDelegate{listItem_;constructor(listItem){this.listItem_=listItem}onFocus(_row,e){const element=e.composedPath()[0];const focusableElement=FocusRow.getFocusableElement(element);if(element!==focusableElement){focusableElement.focus()}this.listItem_.lastFocused=focusableElement}onKeydown(_row,e){if(e.key==="Enter"){e.stopPropagation()}return false}getCustomEquivalent(sampleElement){return this.listItem_.overrideCustomEquivalent?this.listItem_.getCustomEquivalent(sampleElement):null}}const FocusRowMixinLit=superClass=>{class FocusRowMixinLit extends superClass{static get properties(){return{row_:{type:Object},mouseFocused_:{type:Boolean},id:{type:String,reflect:true},isFocused:{type:Boolean,notify:true},focusRowIndex:{type:Number},lastFocused:{type:Object,notify:true},listTabIndex:{type:Number},listBlurred:{type:Boolean,notify:true}}}#row__accessor_storage=null;get row_(){return this.#row__accessor_storage}set row_(value){this.#row__accessor_storage=value}#mouseFocused__accessor_storage=false;get mouseFocused_(){return this.#mouseFocused__accessor_storage}set mouseFocused_(value){this.#mouseFocused__accessor_storage=value}#isFocused_accessor_storage=false;get isFocused(){return this.#isFocused_accessor_storage}set isFocused(value){this.#isFocused_accessor_storage=value}#focusRowIndex_accessor_storage;get focusRowIndex(){return this.#focusRowIndex_accessor_storage}set focusRowIndex(value){this.#focusRowIndex_accessor_storage=value}#lastFocused_accessor_storage=null;get lastFocused(){return this.#lastFocused_accessor_storage}set lastFocused(value){this.#lastFocused_accessor_storage=value}#listTabIndex_accessor_storage;get listTabIndex(){return this.#listTabIndex_accessor_storage}set listTabIndex(value){this.#listTabIndex_accessor_storage=value}#listBlurred_accessor_storage=false;get listBlurred(){return this.#listBlurred_accessor_storage}set listBlurred(value){this.#listBlurred_accessor_storage=value}firstControl_=null;controlObservers_=[];subtreeObserver_=null;boundOnFirstControlKeydown_=null;connectedCallback(){super.connectedCallback();this.classList.add("no-outline");this.boundOnFirstControlKeydown_=this.onFirstControlKeydown_.bind(this);this.updateComplete.then((()=>{const rowContainer=this.shadowRoot.querySelector("[focus-row-container]");assert(rowContainer);this.row_=new VirtualFocusRow(rowContainer,new FocusRowMixinDelegate(this));this.addItems_();this.addEventListener("focus",this.onFocus_);this.subtreeObserver_=new MutationObserver((()=>this.addItems_()));this.subtreeObserver_.observe(this.shadowRoot,{childList:true,subtree:true});this.addEventListener("mousedown",this.onMouseDown_);this.addEventListener("blur",this.onBlur_)}))}disconnectedCallback(){super.disconnectedCallback();this.removeEventListener("focus",this.onFocus_);if(this.subtreeObserver_){this.subtreeObserver_.disconnect();this.subtreeObserver_=null}this.removeEventListener("mousedown",this.onMouseDown_);this.removeEventListener("blur",this.onBlur_);this.removeObservers_();if(this.firstControl_&&this.boundOnFirstControlKeydown_){this.firstControl_.removeEventListener("keydown",this.boundOnFirstControlKeydown_);this.boundOnFirstControlKeydown_=null}if(this.row_){this.row_.destroy()}}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("focusRowIndex")&&this.focusRowIndex!==undefined){this.setAttribute("aria-rowindex",(this.focusRowIndex+1).toString());const oldIndex=changedProperties.get("focusRowIndex");if(this.id===this.computeId_(oldIndex)){this.id=this.computeId_(this.focusRowIndex)||""}}}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("listTabIndex")){this.listTabIndexChanged_()}}computeId_(index){return index!==undefined?`frb${index}`:undefined}getFocusRow(){assert(this.row_);return this.row_}updateFirstControl_(){assert(this.row_);const newFirstControl=this.row_.getFirstFocusable();if(newFirstControl===this.firstControl_){return}if(this.firstControl_){this.firstControl_.removeEventListener("keydown",this.boundOnFirstControlKeydown_)}this.firstControl_=newFirstControl;if(this.firstControl_){this.firstControl_.addEventListener("keydown",this.boundOnFirstControlKeydown_)}}removeObservers_(){if(this.controlObservers_.length>0){this.controlObservers_.forEach((observer=>{observer.disconnect()}))}this.controlObservers_=[]}addItems_(){this.listTabIndexChanged_();if(this.row_){this.removeObservers_();this.row_.destroy();const controls=this.shadowRoot.querySelectorAll("[focus-row-control]");controls.forEach((control=>{assert(control);assert(this.row_);this.row_.addItem(control.getAttribute("focus-type"),FocusRow.getFocusableElement(control));this.addMutationObservers_(control)}));this.updateFirstControl_()}}createObserver_(){return new MutationObserver((mutations=>{const mutation=mutations[0];if(mutation.attributeName==="style"&&mutation.oldValue){const newStyle=window.getComputedStyle(mutation.target);const oldDisplayValue=mutation.oldValue.match(/^display:(.*)(?=;)/);const oldVisibilityValue=mutation.oldValue.match(/^visibility:(.*)(?=;)/);if(oldDisplayValue&&newStyle.display===oldDisplayValue[1].trim()&&oldVisibilityValue&&newStyle.visibility===oldVisibilityValue[1].trim()){return}}this.updateFirstControl_()}))}addMutationObservers_(control){let current=control;while(current&¤t!==this.shadowRoot){const currentObserver=this.createObserver_();currentObserver.observe(current,{attributes:true,attributeFilter:["hidden","disabled","style"],attributeOldValue:true});this.controlObservers_.push(currentObserver);current=current.parentNode}}onFocus_(e){if(this.mouseFocused_){this.mouseFocused_=false;return}const restoreFocusToFirst=this.listBlurred&&e.composedPath()[0]===this;if(this.lastFocused&&!restoreFocusToFirst){assert(this.row_);focusWithoutInk(this.row_.getEquivalentElement(this.lastFocused))}else{assert(this.firstControl_);const firstFocusable=this.firstControl_;focusWithoutInk(firstFocusable)}this.listBlurred=false;this.isFocused=true}onFirstControlKeydown_(e){const keyEvent=e;if(keyEvent.shiftKey&&keyEvent.key==="Tab"){this.focus()}}listTabIndexChanged_(){if(this.row_){this.row_.makeActive(this.listTabIndex===0)}if(this.listTabIndex===0){this.listBlurred=false}}onMouseDown_(){this.mouseFocused_=true}onBlur_(e){this.mouseFocused_=false;this.isFocused=false;const node=e.relatedTarget?e.relatedTarget:null;if(!this.parentNode.contains(node)){this.listBlurred=true}}}return FocusRowMixinLit};const sheet=new CSSStyleSheet;sheet.replaceSync(`html{--card-border-color:rgba(0,0,0,0.14);--card-first-last-item-padding:8px;--card-max-width:960px;--card-min-width:550px;--card-padding-between:16px;--card-padding-side:24px;--first-card-padding-top:24px;--history-item-time-color:#646464;--interactive-color:var(--google-blue-500);--item-height:36px;--separator-color:rgba(0,0,0,0.08);--side-bar-width:256px;--sidebar-footer-text-color:var(--google-grey-700);--toolbar-height:56px}@media (prefers-color-scheme:dark){html{--card-border-color:var(--cr-separator-color);--history-item-time-color:var(--cr-secondary-text-color);--interactive-color:var(--google-blue-300);--separator-color:var(--cr-separator-color);--sidebar-footer-text-color:rgba(255,255,255,0.6)}}html[webui-refresh-2026]{--card-border-color:var(--color-history-page-separator);--history-item-time-color:var(--color-history-page-text);--interactive-color:var(--color-history-page-bookmark-star);--separator-color:var(--color-history-page-separator);--sidebar-footer-text-color:var(--cr-color-history-page-text)}`);document.adoptedStyleSheets=[...document.adoptedStyleSheets,sheet];let instance$i=null;function getCss$f(){return instance$i||(instance$i=[...[getCss$T()],css`a{color:var(--cr-link-color)}.history-cards{margin:0 auto;max-width:var(--card-max-width);min-width:var(--card-min-width);padding:0 var(--card-padding-side);width:calc(100% - 2 * var(--card-padding-side))}.card-title{align-items:center;display:flex;font-size:16px;font-weight:500;line-height:24px;overflow:hidden;padding:23px 24px 13px;text-overflow:ellipsis;white-space:nowrap}:host-context([webui-refresh-2026]) .card-title:not([aria-expanded='false']){border-bottom:1px solid var(--color-history-page-separator)}.centered-message{align-items:center;color:var(--md-loading-message-color);display:flex;flex:1;font-size:108%;font-weight:500;height:100%;justify-content:center}.website-icon{background-repeat:no-repeat;background-size:16px;background-position:center center;border-radius:4px;flex:none;height:24px;width:24px}.website-link{align-items:center;color:var(--cr-primary-text-color);display:flex;overflow:hidden;text-decoration:none}.website-title{font-size:12px;font-weight:500;margin-inline-start:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`])}let instance$h=null;function getCss$e(){return instance$h||(instance$h=[...[getCss$T(),getCss$f()],css`:host{display:block;outline:none;pointer-events:none;--item-container-padding-start:14px;--title-domain-padding-start:5px;--favicon-size:24px;--actor-icon-size:16px;--actor-icon-floating-offset:6px;--website-title-margin-start:8px;--critical-action-row-padding-start:20px}:host([is-critical-actions-enabled_]){--website-title-margin-start:24px}#main-container{position:relative}:host([is-card-end]) #main-container{margin-bottom:var(--card-padding-between)}:host([is-card-start][is-card-end]) #main-container{border-radius:var(--cr-card-border-radius)}#date-accessed{display:none}:host([is-card-start]) #date-accessed{display:block}#item-container{align-items:flex-start;display:flex;min-height:var(--item-height);padding-inline-start:var(--item-container-padding-start);pointer-events:auto}:host([is-card-start]) #item-container{padding-top:var(--card-first-last-item-padding)}:host([is-card-end]) #item-container{padding-bottom:var(--card-first-last-item-padding)}#checkbox-cell{align-items:center;display:flex;height:var(--item-height)}#item-info{display:flex;flex:1;flex-direction:column;min-width:0}#item-info-row{align-items:center;display:flex;height:var(--item-height);min-width:0;width:100%}#title-and-domain{align-items:center;display:flex;flex:1;height:var(--item-height);margin-inline-end:auto;overflow:hidden;padding-inline-start:var(--title-domain-padding-start)}#checkbox{margin:0 10px}.website-icon{height:var(--favicon-size);width:var(--favicon-size)}.website-title{margin-inline-start:var(--website-title-margin-start)}#checkbox:not(:defined){border:2px solid var(--cr-secondary-text-color);border-radius:2px;content:'';display:block;height:12px;width:12px}#timeAccessed{align-items:center;color:var(--history-item-time-color);display:flex;font-size:12px;height:var(--item-height);margin-inline-start:6px;min-width:96px}#domain{color:var(--cr-secondary-text-color);font-size:12px;margin-inline-start:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#menuButton{--cr-icon-button-margin-end:20px;--cr-icon-button-margin-start:0;--cr-icon-button-icon-size:16px;--cr-icon-button-size:24px}#actor-icon{--cr-icon-size:20px;--paper-tooltip-min-width:0;padding-inline-start:12px}.website-link{position:relative}#title-and-domain #actor-icon{--cr-icon-size:12px;--cr-tooltip-icon-fill-color:var(--color-sys-on-tonal-container,var(--cr-fallback-color-on-tonal-container));align-items:center;background-color:var(--color-sys-surface1,var(--cr-fallback-color-surface1));border-radius:50%;display:flex;flex:none;height:var(--actor-icon-size);width:var(--actor-icon-size);inset-inline-start:calc(var(--favicon-size) - var(--actor-icon-size) + var(--actor-icon-floating-offset));justify-content:center;padding-inline-start:0;position:absolute;z-index:1}#bookmark-star{--cr-icon-button-fill-color:var(--interactive-color);--cr-icon-button-icon-size:16px;--cr-icon-button-margin-start:12px;--cr-icon-button-size:32px}#expand-button{--cr-icon-button-icon-size:16px;--cr-icon-button-margin-start:12px;--cr-icon-button-size:32px}#collapse{pointer-events:auto}#expanded-container{border:0;padding:6px 0}.critical-actions-title{color:var(--cr-primary-text-color);font-size:13px;font-weight:500;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline-start:calc(var(--title-domain-padding-start) + var(--favicon-size) + var(--website-title-margin-start));padding-bottom:4px}.critical-actions-list{display:flex;flex-direction:column;padding-inline-start:calc(var(--title-domain-padding-start) + var(--favicon-size) + var(--website-title-margin-start) - var(--critical-action-row-padding-start))}.critical-action-row{align-items:center;border-radius:8px;box-sizing:border-box;cursor:pointer;display:flex;height:32px;justify-content:space-between;outline:none;padding-inline-start:var(--critical-action-row-padding-start);padding-inline-end:16px;transition:background-color 150ms ease-in-out;user-select:none}.critical-action-row:hover{background-color:var(--color-sys-state-hover-on-subtle,var(--cr-hover-background-color))}.critical-action-row:active{background-color:var(--color-sys-state-pressed,var(--cr-active-background-color))}.critical-action-row:focus-visible{outline:2px solid var(--cr-focus-outline-color)}.critical-action-label{color:var(--cr-primary-text-color);font-size:12px;font-weight:400;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.critical-action-button{--cr-icon-button-fill-color:var(--cr-secondary-text-color);--cr-icon-button-hover-background-color:transparent;--cr-icon-button-active-background-color:transparent;--cr-icon-button-icon-size:18px;--cr-icon-button-size:20px}.critical-action-row:hover .critical-action-button{--cr-icon-button-fill-color:var(--cr-primary-text-color)}#icons{align-items:center;display:flex;padding-inline-end:12px}#debug-container{color:var(--history-item-time-color);display:flex;padding-inline-start:22px;pointer-events:auto}.debug-info:not(:first-child){margin-inline-start:15px}#time-gap-separator{border-inline-start:1px solid #888;height:15px;margin-inline-start:77px}@media (prefers-color-scheme:dark){#time-gap-separator{border-color:var(--google-grey-500)}}#background-clip{bottom:-0.4px;clip:rect(auto 999px auto -5px);left:0;position:absolute;right:0;top:0;z-index:-1}:host([is-card-end]) #background-clip{bottom:0;clip:rect(auto 999px 500px -5px)}:host([is-card-start]) #background-clip{clip:auto}#background{background-color:var(--cr-card-background-color);bottom:0;box-shadow:var(--cr-card-shadow);left:0;position:absolute;right:0;top:0}:host(:not([is-card-start])) #background{top:-5px}:host([is-card-start]) #background{border-radius:var(--cr-card-border-radius) var(--cr-card-border-radius) 0 0}:host([is-card-end]) #background{border-radius:0 0 var(--cr-card-border-radius) var(--cr-card-border-radius)}:host([is-card-start][is-card-end]) #background{border-radius:var(--cr-card-border-radius)}#options{align-items:center;display:flex;height:var(--item-height)}cr-checkbox::part(label-container){clip:rect(0,0,0,0);display:block;position:fixed}`])}function getHtml$d(){return html`
${this.cardTitle_()}
${this.getEntrySummary_()}
${this.shouldShowActorTooltip_()?html` `:""} ${this.item?.starred?html` `:""} ${this.isExpandable_()?html` `:""}
${this.isExpandable_()?html`
$i18n{geminiKeyBrowsingActionsTitle}
${this.getCriticalActions_().map(((action,index)=>html`
${action.label}
`))}
`:""}
${this.item?.debug?html` `:""}
`}const HistoryItemElementBase=FocusRowMixinLit(CrLitElement);class HistoryItemElement extends HistoryItemElementBase{static get is(){return"history-item"}static get styles(){return getCss$e()}render(){return getHtml$d.bind(this)()}static get properties(){return{item:{type:Object},selected:{type:Boolean,reflect:true},isCardStart:{type:Boolean,reflect:true},isCardEnd:{type:Boolean,reflect:true},selectionNotAllowed_:{type:Boolean},hasTimeGap:{type:Boolean},index:{type:Number},numberOfItems:{type:Number},searchTerm:{type:String},isExpanded_:{type:Boolean,reflect:true},isCriticalActionsEnabled_:{type:Boolean,reflect:true}}}isShiftKeyDown_=false;#selectionNotAllowed__accessor_storage=!loadTimeData.getBoolean("allowDeletingHistory");get selectionNotAllowed_(){return this.#selectionNotAllowed__accessor_storage}set selectionNotAllowed_(value){this.#selectionNotAllowed__accessor_storage=value}#isCriticalActionsEnabled__accessor_storage=loadTimeData.getBoolean("isCriticalActionsEnabled");get isCriticalActionsEnabled_(){return this.#isCriticalActionsEnabled__accessor_storage}set isCriticalActionsEnabled_(value){this.#isCriticalActionsEnabled__accessor_storage=value}eventTracker_=new EventTracker;#item_accessor_storage;get item(){return this.#item_accessor_storage}set item(value){this.#item_accessor_storage=value}#hasTimeGap_accessor_storage=false;get hasTimeGap(){return this.#hasTimeGap_accessor_storage}set hasTimeGap(value){this.#hasTimeGap_accessor_storage=value}#index_accessor_storage=-1;get index(){return this.#index_accessor_storage}set index(value){this.#index_accessor_storage=value}#searchTerm_accessor_storage="";get searchTerm(){return this.#searchTerm_accessor_storage}set searchTerm(value){this.#searchTerm_accessor_storage=value}#isCardStart_accessor_storage=false;get isCardStart(){return this.#isCardStart_accessor_storage}set isCardStart(value){this.#isCardStart_accessor_storage=value}#isCardEnd_accessor_storage=false;get isCardEnd(){return this.#isCardEnd_accessor_storage}set isCardEnd(value){this.#isCardEnd_accessor_storage=value}#numberOfItems_accessor_storage=0;get numberOfItems(){return this.#numberOfItems_accessor_storage}set numberOfItems(value){this.#numberOfItems_accessor_storage=value}#selected_accessor_storage=false;get selected(){return this.#selected_accessor_storage}set selected(value){this.#selected_accessor_storage=value}#isExpanded__accessor_storage=false;get isExpanded_(){return this.#isExpanded__accessor_storage}set isExpanded_(value){this.#isExpanded__accessor_storage=value}connectedCallback(){super.connectedCallback();this.updateComplete.then((()=>{this.eventTracker_.add(this.$.checkbox,"keydown",(e=>this.onCheckboxKeydown_(e)))}))}disconnectedCallback(){super.disconnectedCallback();this.eventTracker_.remove(this.$.checkbox,"keydown")}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("item")){this.isExpanded_=false;this.itemChanged_();this.fire("iron-resize")}}focusOnMenuButton(){focusWithoutInk(this.$.menuButton)}onCheckboxKeydown_(e){if(e.shiftKey&&e.key==="Tab"){this.focus()}}onRowClick_(e){const path=e.composedPath();let inItemContainer=false;for(let i=0;i0}getExpandIcon_(){return this.isExpanded_?"cr:keyboard-arrow-up":"cr:keyboard-arrow-down"}onExpandClick_(e){e.stopPropagation();this.isExpanded_=!this.isExpanded_;BrowserProxyImpl.getInstance().recordAction(this.isExpanded_?"HistoryPage_CriticalActionsExpanded":"HistoryPage_CriticalActionsCollapsed");this.fire("iron-resize")}getCriticalActions_(){return this.item?.criticalActions||[]}onCriticalActionClick_(e){e.stopPropagation();const index=Number(e.currentTarget.dataset["index"]);const action=this.getCriticalActions_()[index];if(action?.linkoutUrl){if(action.actionType!==undefined){BrowserProxyImpl.getInstance().recordHistogram("HistoryPage.CriticalAction.Click",action.actionType,CriticalActionType.MAX_VALUE+1)}window.open(action.linkoutUrl,"_blank","noopener,noreferrer")}}onCriticalActionKeydown_(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();this.onCriticalActionClick_(e)}}onRemoveBookmarkClick_(){if(!this.item?.starred){return}if(this.shadowRoot.querySelector("#bookmark-star")===this.shadowRoot.activeElement){focusWithoutInk(this.$.menuButton)}const browserProxy=BrowserProxyImpl.getInstance();browserProxy.handler.removeBookmark(this.item.url);browserProxy.recordAction("BookmarkStarClicked");this.fire("remove-bookmark-stars",this.item.url)}onMenuButtonClick_(e){this.fire("open-menu",{target:e.target,index:this.index,item:this.item});e.stopPropagation()}onMenuButtonKeydown_(e){if(this.item?.starred&&e.shiftKey&&e.key==="Tab"){e.stopImmediatePropagation()}}onLinkClick_(){const browserProxy=BrowserProxyImpl.getInstance();browserProxy.recordAction("EntryLinkClick");if(this.searchTerm){browserProxy.recordAction("SearchResultClick")}this.fire("record-history-link-click",{resultType:HistoryResultType.TRADITIONAL,index:this.index})}onLinkAuxclick_(){this.onLinkClick_()}onLinkContextmenu_(){BrowserProxyImpl.getInstance().recordAction("EntryLinkRightClick")}itemChanged_(){if(!this.item){return}this.$.icon.style.backgroundImage=getFaviconForPageURL(this.item.url,this.item.isUrlInRemoteUserData,this.item.remoteIconUrlForUma);this.eventTracker_.add(this.$.timeAccessed,"mouseover",(()=>this.addTimeTitle_()))}cardTitle_(){if(this.item===undefined){return""}if(!this.searchTerm){return this.item.dateRelativeDay}return searchResultsTitle(this.numberOfItems,this.searchTerm)}addTimeTitle_(){if(!this.item){return}const el=this.$.timeAccessed;el.setAttribute("title",new Date(this.item.time).toString());this.eventTracker_.remove(el,"mouseover")}actorIconClass_(){return loadTimeData.getBoolean("webuiRoundedIconsEnabled")?"history20:arrow-selector-tool":"history20:arrow-selector-tool-old"}}customElements.define(HistoryItemElement.is,HistoryItemElement);function searchResultsTitle(numberOfResults,searchTerm){const resultId=numberOfResults===1?"searchResult":"searchResults";return loadTimeData.getStringF("foundSearchResults",numberOfResults,loadTimeData.getString(resultId),searchTerm)}let instance$g=null;function getCss$d(){return instance$g||(instance$g=[...[getCss$O(),getCss$f()],css`:host{box-sizing:border-box;display:block}:host([is-empty]){padding-block:80px}.history-cards{margin-block-start:var(--first-card-padding-top)}dialog [slot=body]{white-space:pre-wrap}.chunk{overflow-clip-margin:8px}`])}function getHtml$c(){return html`
${this.noResultsMessage_()}
`}const HistoryListElementBase=I18nMixinLit(CrLitElement);class HistoryListElement extends HistoryListElementBase{static get is(){return"history-list"}static get styles(){return getCss$d()}render(){return getHtml$c.bind(this)()}static get properties(){return{searchedTerm:{type:String},resultLoadingDisabled_:{type:Boolean},selectedItems:{type:Object},canDeleteHistory_:{type:Boolean},historyData_:{type:Array},lastFocused_:{type:Object},listBlurred_:{type:Boolean},lastSelectedIndex:{type:Number},pendingDelete:{notify:true,type:Boolean},queryState:{type:Object},actionMenuModel_:{type:Object},scrollTarget:{type:Object},scrollOffset:{type:Number},isActive:{type:Boolean},isEmpty:{type:Boolean,reflect:true}}}#historyData__accessor_storage=[];get historyData_(){return this.#historyData__accessor_storage}set historyData_(value){this.#historyData__accessor_storage=value}callbackRouter_;#canDeleteHistory__accessor_storage=loadTimeData.getBoolean("allowDeletingHistory");get canDeleteHistory_(){return this.#canDeleteHistory__accessor_storage}set canDeleteHistory_(value){this.#canDeleteHistory__accessor_storage=value}#actionMenuModel__accessor_storage=null;get actionMenuModel_(){return this.#actionMenuModel__accessor_storage}set actionMenuModel_(value){this.#actionMenuModel__accessor_storage=value}lastOffsetHeight_=0;resizeObserver_=new ResizeObserver((()=>{if(this.lastOffsetHeight_===0){this.lastOffsetHeight_=this.scrollTarget.offsetHeight;return}if(this.scrollTarget.offsetHeight>this.lastOffsetHeight_){this.lastOffsetHeight_=this.scrollTarget.offsetHeight;this.onScrollOrResize_()}}));#resultLoadingDisabled__accessor_storage=false;get resultLoadingDisabled_(){return this.#resultLoadingDisabled__accessor_storage}set resultLoadingDisabled_(value){this.#resultLoadingDisabled__accessor_storage=value}scrollDebounce_=200;scrollListener_=()=>this.onScrollOrResize_();scrollTimeout_=null;#isActive_accessor_storage=true;get isActive(){return this.#isActive_accessor_storage}set isActive(value){this.#isActive_accessor_storage=value}#isEmpty_accessor_storage=false;get isEmpty(){return this.#isEmpty_accessor_storage}set isEmpty(value){this.#isEmpty_accessor_storage=value}#searchedTerm_accessor_storage="";get searchedTerm(){return this.#searchedTerm_accessor_storage}set searchedTerm(value){this.#searchedTerm_accessor_storage=value}#selectedItems_accessor_storage=new Set;get selectedItems(){return this.#selectedItems_accessor_storage}set selectedItems(value){this.#selectedItems_accessor_storage=value}#pendingDelete_accessor_storage=false;get pendingDelete(){return this.#pendingDelete_accessor_storage}set pendingDelete(value){this.#pendingDelete_accessor_storage=value}#lastFocused__accessor_storage=null;get lastFocused_(){return this.#lastFocused__accessor_storage}set lastFocused_(value){this.#lastFocused__accessor_storage=value}#listBlurred__accessor_storage=false;get listBlurred_(){return this.#listBlurred__accessor_storage}set listBlurred_(value){this.#listBlurred__accessor_storage=value}#lastSelectedIndex_accessor_storage=-1;get lastSelectedIndex(){return this.#lastSelectedIndex_accessor_storage}set lastSelectedIndex(value){this.#lastSelectedIndex_accessor_storage=value}#queryState_accessor_storage={incremental:false,querying:false,searchTerm:"",after:null,includeUserVisits:true,includeActorVisits:true};get queryState(){return this.#queryState_accessor_storage}set queryState(value){this.#queryState_accessor_storage=value}#scrollTarget_accessor_storage=document.documentElement;get scrollTarget(){return this.#scrollTarget_accessor_storage}set scrollTarget(value){this.#scrollTarget_accessor_storage=value}#scrollOffset_accessor_storage=0;get scrollOffset(){return this.#scrollOffset_accessor_storage}set scrollOffset(value){this.#scrollOffset_accessor_storage=value}onHistoryDeletedListenerId_=null;constructor(){super();this.callbackRouter_=BrowserProxyImpl.getInstance().callbackRouter}connectedCallback(){super.connectedCallback();this.onHistoryDeletedListenerId_=this.callbackRouter_.onHistoryDeleted.addListener(this.onHistoryDeleted_.bind(this))}disconnectedCallback(){super.disconnectedCallback();if(this.onHistoryDeletedListenerId_!==null){this.callbackRouter_.removeListener(this.onHistoryDeletedListenerId_);this.onHistoryDeletedListenerId_=null}}willUpdate(changedProperties){super.willUpdate(changedProperties);const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("historyData_")){this.isEmpty=this.historyData_.length===0}}firstUpdated(){this.setAttribute("role","application");this.setAttribute("aria-roledescription",this.i18n("ariaRoleDescription"));this.addEventListener("history-checkbox-select",this.onItemSelected_);this.addEventListener("open-menu",this.onOpenMenu_);this.addEventListener("remove-bookmark-stars",(e=>this.onRemoveBookmarkStars_(e)))}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("isActive")){this.onIsActiveChanged_()}if(changedProperties.has("scrollTarget")){this.onScrollTargetChanged_(changedProperties.get("scrollTarget"))}}historyResult(info,results){if(!info){return}this.initializeResults_(info,results);this.closeMenu_();if(info.term&&!this.queryState.incremental){let resultsLabelId;if(loadTimeData.getBoolean("enableHistoryEmbeddings")){resultsLabelId=results.length===1?"searchResultExactMatch":"searchResultExactMatches"}else{resultsLabelId=results.length===1?"searchResult":"searchResults"}const message=loadTimeData.getStringF("foundSearchResults",results.length,loadTimeData.getString(resultsLabelId),info.term);getInstance().announce(message)}this.addNewResults(results,this.queryState.incremental,info.finished)}addNewResults(historyResults,incremental,finished){const results=historyResults.filter((entry=>!entry.url.includes("group-home")));if(this.scrollTimeout_){clearTimeout(this.scrollTimeout_)}if(!incremental){this.resultLoadingDisabled_=false;this.historyData_=[];this.fire("unselect-all");this.scrollTarget.scrollTop=0}this.historyData_=[...this.historyData_,...results];this.resultLoadingDisabled_=finished;this.recordActorVisitShown_(results)}recordActorVisitShown_(historyResults){const historyResultsContainActorVisit=historyResults.some((result=>result.isActorVisit));BrowserProxyImpl.getInstance().recordBooleanHistogram("HistoryPage.ActorItemsShown",historyResultsContainActorVisit)}onHistoryDeleted_(){if(this.getSelectedItemCount()>0){return}this.fire("query-history",false)}selectOrUnselectAll(){if(this.historyData_.length===this.getSelectedItemCount()){this.unselectAllItems()}else{this.selectAllItems()}}selectAllItems(){if(this.historyData_.length===this.getSelectedItemCount()){return}const indices=this.historyData_.map(((_,index)=>index));this.changeSelections_(indices,true)}unselectAllItems(){this.changeSelections_(Array.from(this.selectedItems),false);assert(this.selectedItems.size===0)}getSelectedItemCount(){return this.selectedItems.size}deleteSelectedWithPrompt(){if(!this.canDeleteHistory_){return}BrowserProxyImpl.getInstance().recordAction("RemoveSelected");if(this.queryState.searchTerm!==""){BrowserProxyImpl.getInstance().recordAction("SearchResultRemove")}this.$.dialog.get().showModal();const button=this.shadowRoot.querySelector(".action-button");assert(button);button.focus()}fillCurrentViewport(){this.$.infiniteList.fillCurrentViewport()}openSelected(){const selected=this.getSelectedEntries_();for(const entry of selected){window.open(entry.url,"_blank")}}changeSelections_(indices,selected){indices.forEach((index=>{if(this.historyData_[index]){this.historyData_[index].selected=selected}if(selected){this.selectedItems.add(index)}else{this.selectedItems.delete(index)}}));this.requestUpdate()}deleteSelected_(){assert(!this.pendingDelete);const toBeRemoved=this.getSelectedEntries_();this.deleteItems_(toBeRemoved).then((()=>{this.pendingDelete=false;this.removeItemsByIndex_(Array.from(this.selectedItems));this.fire("unselect-all");if(this.historyData_.length===0){this.fire("query-history",false)}}))}removeItemsByIndex_(indices){const indicesSet=new Set(indices);this.historyData_=this.historyData_.filter(((_,index)=>!indicesSet.has(index)))}removeItemsByIndexForTesting(indices){this.removeItemsByIndex_(indices)}closeMenu_(){const menu=this.$.sharedMenu.getIfExists();if(menu&&menu.open){this.actionMenuModel_=null;menu.close()}}onDialogConfirmClick_(){BrowserProxyImpl.getInstance().recordAction("ConfirmRemoveSelected");this.deleteSelected_();const dialog=this.$.dialog.getIfExists();assert(dialog);dialog.close()}onDialogCancelClick_(){BrowserProxyImpl.getInstance().recordAction("CancelRemoveSelected");const dialog=this.$.dialog.getIfExists();assert(dialog);dialog.close()}onRemoveBookmarkStars_(e){const url=e.detail;if(this.historyData_===undefined){return}this.historyData_.forEach((data=>{if(data.url===url){data.starred=false}}));this.requestUpdate()}onScrollToBottom_(){if(this.resultLoadingDisabled_||this.queryState.querying){return}this.fire("query-history",true)}onOpenMenu_(e){const target=e.detail.target;this.actionMenuModel_=e.detail;this.$.sharedMenu.get().showAt(target)}deleteItems_(items){const removalList=items.flatMap((item=>Object.entries(item.allTimestamps).map((([url,timestamps])=>({url:url,timestamps:timestamps})))));this.pendingDelete=true;return BrowserProxyImpl.getInstance().handler.removeVisits(removalList)}recordContextMenuActionsHistogram_(action){BrowserProxyImpl.getInstance().recordHistogram(this.actionMenuModel_.item.isActorVisit?"HistoryPage.ActorContextMenuActions":"HistoryPage.NonActorContextMenuActions",action,VisitContextMenuAction.MAX_VALUE)}onMoreFromSiteClick_(){BrowserProxyImpl.getInstance().recordAction("EntryMenuShowMoreFromSite");this.recordContextMenuActionsHistogram_(VisitContextMenuAction.MORE_FROM_THIS_SITE_CLICKED);assert(this.$.sharedMenu.getIfExists());this.fire("change-query",{search:"host:"+this.actionMenuModel_.item.domain});this.actionMenuModel_=null;this.closeMenu_()}onRemoveBookmarkClick_(){this.recordContextMenuActionsHistogram_(VisitContextMenuAction.REMOVE_BOOKMARK_CLICKED);BrowserProxyImpl.getInstance().handler.removeBookmark(this.actionMenuModel_.item.url);this.fire("remove-bookmark-stars",this.actionMenuModel_.item.url);this.closeMenu_()}isCriticalActionsEnabled_(){return loadTimeData.getBoolean("isCriticalActionsEnabled")}canShowReviewGeminiActivity_(){return this.isCriticalActionsEnabled_()&&!!this.actionMenuModel_?.item.isActorVisit}onReviewGeminiActivityClick_(e){BrowserProxyImpl.getInstance().recordAction("EntryMenuReviewGeminiActivity");this.recordContextMenuActionsHistogram_(VisitContextMenuAction.REVIEW_GEMINI_ACTIVITY_CLICKED);BrowserProxyImpl.getInstance().navigateToUrl(loadTimeData.getString("myActivityGeminiAppsUrl"),"_blank",e);this.closeMenu_()}onRemoveFromHistoryClick_(){BrowserProxyImpl.getInstance().recordAction("EntryMenuRemoveFromHistory");this.recordContextMenuActionsHistogram_(VisitContextMenuAction.REMOVE_FROM_HISTORY_CLICKED);assert(!this.pendingDelete);assert(this.$.sharedMenu.getIfExists());const itemData=this.actionMenuModel_;this.deleteItems_([itemData.item]).then((()=>{getInstance().announce(this.i18n("deleteSuccess",itemData.item.title));this.pendingDelete=false;this.fire("unselect-all");this.removeItemsByIndex_([itemData.index]);const index=itemData.index;if(index===undefined){return}if(this.historyData_.length>0){setTimeout((async()=>{const item=await this.$.infiniteList.ensureItemRendered(Math.min(this.historyData_.length-1,index));item.focusOnMenuButton()}),1)}}));this.closeMenu_()}onItemSelected_(e){const index=e.detail.index;const indices=[];if(e.detail.shiftKey&&this.lastSelectedIndex!==-1){for(let i=Math.min(index,this.lastSelectedIndex);i<=Math.max(index,this.lastSelectedIndex);i++){indices.push(i)}}if(indices.length===0){indices.push(index)}const selected=!this.selectedItems.has(index);this.changeSelections_(indices,selected);this.lastSelectedIndex=index}needsTimeGap_(_item,index){const length=this.historyData_.length;if(index===undefined||index>=length-1||length===0){return false}const currentItem=this.historyData_[index];const nextItem=this.historyData_[index+1];if(this.searchedTerm){return currentItem.dateShort!==nextItem.dateShort}return currentItem.time-nextItem.time>BROWSING_GAP_TIME&¤tItem.dateRelativeDay===nextItem.dateRelativeDay}isCardStart_(_item,i){const length=this.historyData_.length;if(i===undefined||length===0||i>length-1){return false}return i===0||this.historyData_[i].dateRelativeDay!==this.historyData_[i-1].dateRelativeDay}isCardEnd_(_item,i){const length=this.historyData_.length;if(length===0||i>length-1){return false}return i===length-1||this.historyData_[i].dateRelativeDay!==this.historyData_[i+1].dateRelativeDay}hasResults_(){return this.historyData_.length>0}noResultsMessage_(){const messageId=this.searchedTerm!==""?"noSearchResults":"noResults";return loadTimeData.getString(messageId)}canSearchMoreFromSite_(){return this.searchedTerm===""||this.searchedTerm!==this.actionMenuModel_?.item.domain}initializeResults_(info,results){if(results.length===0){return}let currentDate=results[0].dateRelativeDay;for(const result of results){result.selected=false;result.readableTimestamp=info.term===""?result.dateTimeOfDay:result.dateShort;if(result.dateRelativeDay!==currentDate){currentDate=result.dateRelativeDay}}}onIsActiveChanged_(){if(this.isActive){this.scrollTarget.addEventListener("scroll",this.scrollListener_)}else{this.scrollTarget.removeEventListener("scroll",this.scrollListener_)}}onScrollTargetChanged_(oldTarget){if(oldTarget){this.resizeObserver_.disconnect();oldTarget.removeEventListener("scroll",this.scrollListener_)}if(this.scrollTarget){this.lastOffsetHeight_=this.scrollTarget.offsetHeight;this.resizeObserver_.observe(this.scrollTarget);this.scrollTarget.addEventListener("scroll",this.scrollListener_);this.fillCurrentViewport()}}setScrollDebounceForTest(debounce){this.scrollDebounce_=debounce}onScrollOrResize_(){if(this.scrollTimeout_){clearTimeout(this.scrollTimeout_)}this.scrollTimeout_=setTimeout((()=>this.onScrollTimeout_()),this.scrollDebounce_)}onScrollTimeout_(){this.scrollTimeout_=null;const lowerScroll=this.scrollTarget.scrollHeight-this.scrollTarget.scrollTop-this.scrollTarget.offsetHeight;if(lowerScroll<500){this.onScrollToBottom_()}this.fire("scroll-timeout-for-test")}onLastFocusedChanged_(e){this.lastFocused_=e.detail.value}onListBlurredChanged_(e){this.listBlurred_=e.detail.value}onRestoreListFocus_(){this.listBlurred_=false}getSelectedEntries_(){return Array.from(this.selectedItems,(idx=>this.historyData_[idx]))}}customElements.define(HistoryListElement.is,HistoryListElement);const CrSearchFieldMixinLit=superClass=>{class CrSearchFieldMixinLit extends superClass{static get properties(){return{label:{type:String},clearLabel:{type:String},hasSearchText:{type:Boolean,reflect:true}}}#label_accessor_storage="";get label(){return this.#label_accessor_storage}set label(value){this.#label_accessor_storage=value}#clearLabel_accessor_storage="";get clearLabel(){return this.#clearLabel_accessor_storage}set clearLabel(value){this.#clearLabel_accessor_storage=value}#hasSearchText_accessor_storage=false;get hasSearchText(){return this.#hasSearchText_accessor_storage}set hasSearchText(value){this.#hasSearchText_accessor_storage=value}effectiveValue_="";searchDelayTimer_=-1;getSearchInput(){assertNotReached()}getValue(){return this.getSearchInput().value}setValue(value,noEvent){const updated=this.updateEffectiveValue_(value);this.getSearchInput().value=this.effectiveValue_;if(!updated){if(value===""&&this.hasSearchText){this.hasSearchText=false}return}this.onSearchTermInput();if(!noEvent){this.fire("search-changed",this.effectiveValue_)}}scheduleSearch_(){if(this.searchDelayTimer_>=0){clearTimeout(this.searchDelayTimer_)}const length=this.getValue().length;const timeoutMs=length>0?500-100*(Math.min(length,4)-1):0;this.searchDelayTimer_=setTimeout((()=>{this.getSearchInput().dispatchEvent(new CustomEvent("search",{composed:true,detail:this.getValue()}));this.searchDelayTimer_=-1}),timeoutMs)}onSearchTermSearch(){this.onValueChanged_(this.getValue(),false)}onSearchTermInput(){this.hasSearchText=this.getSearchInput().value!=="";this.scheduleSearch_()}onValueChanged_(newValue,noEvent){const updated=this.updateEffectiveValue_(newValue);if(updated&&!noEvent){this.fire("search-changed",this.effectiveValue_)}}updateEffectiveValue_(value){const effectiveValue=value.replace(/\s+/g," ").replace(/^\s/,"");if(effectiveValue===this.effectiveValue_){return false}this.effectiveValue_=effectiveValue;return true}}return CrSearchFieldMixinLit};let instance$f=null;function getCss$c(){return instance$f||(instance$f=[...[],css`.spinner{--cr-spinner-size:28px;mask-image:url(//resources/images/throbber_small.svg);mask-position:center;mask-repeat:no-repeat;mask-size:var(--cr-spinner-size) var(--cr-spinner-size);background-color:var(--cr-spinner-color,var(--google-blue-500));height:var(--cr-spinner-size);width:var(--cr-spinner-size)}@media (prefers-color-scheme:dark){.spinner{background-color:var(--cr-spinner-color,var(--google-blue-300))}}`])}let instance$e=null;function getCss$b(){return instance$e||(instance$e=[...[getCss$O(),getCss$P(),getCss$c()],css`:host{display:block;height:40px;isolation:isolate;transition:background-color 150ms cubic-bezier(0.4,0,0.2,1),width 150ms cubic-bezier(0.4,0,0.2,1);width:44px}:host([disabled]){opacity:var(--cr-disabled-opacity)}[hidden]{display:none !important}@media (prefers-color-scheme:light){cr-icon-button{--cr-icon-button-fill-color:var(--cr-toolbar-search-field-input-icon-color,var(--google-grey-700));--cr-icon-button-focus-outline-color:var(--cr-toolbar-icon-button-focus-outline-color,var(--cr-focus-outline-color))}}@media (prefers-color-scheme:dark){cr-icon-button{--cr-icon-button-fill-color:var(--cr-toolbar-search-field-input-icon-color,var(--google-grey-500))}}cr-icon-button{--cr-icon-button-fill-color:var(--cr-toolbar-search-field-icon-color,var(--color-toolbar-search-field-icon,var(--cr-secondary-text-color)));--cr-icon-button-size:var(--cr-toolbar-icon-container-size,28px);--cr-icon-button-icon-size:20px;margin:var(--cr-toolbar-icon-margin,0)}#icon{transition:margin 150ms,opacity 200ms}#prompt{color:var(--cr-toolbar-search-field-prompt-color,var(--color-toolbar-search-field-foreground-placeholder,var(--cr-secondary-text-color)));opacity:0;transition:opacity 200ms}@media (prefers-color-scheme:dark){#prompt{color:var(--cr-toolbar-search-field-prompt-color,white)}}@media (prefers-color-scheme:dark){#prompt{--cr-toolbar-search-field-prompt-opacity:1;color:var(--cr-secondary-text-color,white)}}.spinner{--cr-spinner-color:var(--cr-toolbar-search-field-input-icon-color,var(--google-grey-700));--cr-spinner-size:var(--cr-icon-size);margin:0;opacity:1;padding:2px;position:absolute}@media (prefers-color-scheme:dark){.spinner{--cr-spinner-color:var(--cr-toolbar-search-field-input-icon-color,white)}}#searchTerm{-webkit-font-smoothing:antialiased;flex:1;font-size:12px;font-weight:500;line-height:185%;margin:var(--cr-toolbar-search-field-term-margin,0);position:relative}label{bottom:0;cursor:var(--cr-toolbar-search-field-cursor,text);left:0;overflow:hidden;position:absolute;right:0;top:0;white-space:nowrap}:host([has-search-text]) label{visibility:hidden}input{-webkit-appearance:none;background:transparent;border:none;caret-color:var(--cr-toolbar-search-field-input-caret-color,currentColor);color:var(--cr-toolbar-search-field-input-text-color,var(--color-toolbar-search-field-foreground,var(--cr-fallback-color-on-surface)));font:inherit;font-size:12px;font-weight:500;outline:none;padding:0;position:relative;width:100%}@media (prefers-color-scheme:dark){input{color:var(--cr-toolbar-search-field-input-text-color,white)}}input[type='search']::-webkit-search-cancel-button{display:none}:host([narrow]){border-radius:var(--cr-toolbar-search-field-border-radius,0)}:host(:not([narrow])){background:none;border-radius:var(--cr-toolbar-search-field-border-radius,46px);cursor:var(--cr-toolbar-search-field-cursor,default);height:36px;max-width:var(--cr-toolbar-field-max-width,none);overflow:hidden;padding:0 6px;position:relative;width:var(--cr-toolbar-field-width,680px);--cr-toolbar-search-field-border-radius:100px}@media (prefers-color-scheme:dark){:host(:not([narrow])){background:var(--cr-toolbar-search-field-background,rgba(0,0,0,0.22))}}#background,#stateBackground{display:none}:host(:not([narrow])) #background{background:var(--cr-toolbar-search-field-background,var(--color-toolbar-search-field-background,var(--cr-fallback-color-base-container)));border-radius:inherit;display:block;inset:0;pointer-events:none;position:absolute;z-index:0}:host-context([webui-refresh-2026]){&:host(:not([narrow])) #background{background:var(--cr-toolbar-search-field-background,var(--color-toolbar-search-field-background,var(--cr-fallback-color-surface4)))}}:host([search-focused_]:not([narrow])){outline:2px solid var(--cr-focus-outline-color);outline-offset:2px}:host(:not([narrow])) #stateBackground{display:block;inset:0;pointer-events:none;position:absolute}:host(:hover:not([search-focused_],[narrow])) #stateBackground{background:var(--color-toolbar-search-field-background-hover,var(--cr-hover-background-color));z-index:1}:host(:not([narrow]):not([showing-search])) #icon{opacity:var(--cr-toolbar-search-field-icon-opacity,1)}:host(:not([narrow])) #prompt{opacity:var(--cr-toolbar-search-field-prompt-opacity,1)}:host([narrow]) #prompt{opacity:var(--cr-toolbar-search-field-narrow-mode-prompt-opacity,0)}:host([narrow]:not([showing-search])) #searchTerm{display:none}:host([showing-search][spinner-active]) #icon{opacity:0}:host([narrow][showing-search]){width:100%}:host([narrow][showing-search]) #icon,:host([narrow][showing-search]) .spinner{margin-inline-start:var(--cr-toolbar-search-icon-margin-inline-start,18px)}#content{align-items:center;display:flex;height:100%;position:relative;z-index:2}`])}function getHtml$b(){return html`
${this.shouldShowSpinner_()?html`
`:""}
${this.hasSearchText?html` `:html``}
`}const CrToolbarSearchFieldElementBase=CrSearchFieldMixinLit(CrLitElement);class CrToolbarSearchFieldElement extends CrToolbarSearchFieldElementBase{static get is(){return"cr-toolbar-search-field"}static get styles(){return getCss$b()}render(){return getHtml$b.bind(this)()}static get properties(){return{narrow:{type:Boolean,reflect:true},showingSearch:{type:Boolean,notify:true,reflect:true},disabled:{type:Boolean,reflect:true},autofocus:{type:Boolean,reflect:true},spinnerActive:{type:Boolean,reflect:true},searchFocused_:{type:Boolean,reflect:true},iconOverride:{type:String},inputAriaDescription:{type:String}}}#narrow_accessor_storage=false;get narrow(){return this.#narrow_accessor_storage}set narrow(value){this.#narrow_accessor_storage=value}#showingSearch_accessor_storage=false;get showingSearch(){return this.#showingSearch_accessor_storage}set showingSearch(value){this.#showingSearch_accessor_storage=value}#disabled_accessor_storage=false;get disabled(){return this.#disabled_accessor_storage}set disabled(value){this.#disabled_accessor_storage=value}#autofocus_accessor_storage=false;get autofocus(){return this.#autofocus_accessor_storage}set autofocus(value){this.#autofocus_accessor_storage=value}#spinnerActive_accessor_storage=false;get spinnerActive(){return this.#spinnerActive_accessor_storage}set spinnerActive(value){this.#spinnerActive_accessor_storage=value}#searchFocused__accessor_storage=false;get searchFocused_(){return this.#searchFocused__accessor_storage}set searchFocused_(value){this.#searchFocused__accessor_storage=value}#iconOverride_accessor_storage;get iconOverride(){return this.#iconOverride_accessor_storage}set iconOverride(value){this.#iconOverride_accessor_storage=value}#inputAriaDescription_accessor_storage="";get inputAriaDescription(){return this.#inputAriaDescription_accessor_storage}set inputAriaDescription(value){this.#inputAriaDescription_accessor_storage=value}firstUpdated(){this.addEventListener("click",(e=>this.showSearch_(e)))}getSearchInput(){return this.$.searchInput}isSearchFocused(){return this.searchFocused_}async showAndFocus(){this.showingSearch=true;await this.updateComplete;this.focus_()}onSearchTermNativeBeforeinput(e){this.fire("search-term-native-before-input",{e:e})}onSearchTermInput(){super.onSearchTermInput();this.showingSearch=this.hasSearchText||this.isSearchFocused()}onSearchTermNativeInput(e){this.onSearchTermInput();this.fire("search-term-native-input",{e:e,inputValue:this.getValue()})}getIconTabIndex_(){return this.narrow&&!this.hasSearchText?0:-1}getIconAriaHidden_(){return(!this.narrow||this.hasSearchText).toString()}shouldShowSpinner_(){return this.spinnerActive&&this.showingSearch}onSearchIconClick_(){this.fire("search-icon-clicked")}focus_(){this.getSearchInput().focus()}onInputFocus_(){this.searchFocused_=true}onInputBlur_(){this.searchFocused_=false;if(!this.hasSearchText){this.showingSearch=false}}onSearchTermKeydown_(e){if(e.key==="Escape"){this.showingSearch=false;this.setValue("");this.getSearchInput().blur()}}async showSearch_(e){if(e.target!==this.shadowRoot.querySelector("#clearSearch")){this.showingSearch=true}if(this.narrow){await this.updateComplete;this.focus_()}}onClearSearchClick_(){this.setValue("");this.focus_();this.spinnerActive=false;this.fire("search-term-cleared")}}customElements.define(CrToolbarSearchFieldElement.is,CrToolbarSearchFieldElement);let instance$d=null;function getCss$a(){return instance$d||(instance$d=[...[getCss$T(),getCss$P()],css`:host{align-items:center;box-sizing:border-box;color:var(--google-grey-900);display:flex;height:var(--cr-toolbar-height)}@media (prefers-color-scheme:dark){:host{color:var(--cr-secondary-text-color)}}h1{flex:1;font-size:170%;font-weight:var(--cr-toolbar-header-font-weight,500);letter-spacing:.25px;line-height:normal;margin-inline-start:6px;padding-inline-end:12px;white-space:var(--cr-toolbar-header-white-space,normal)}@media (prefers-color-scheme:dark){h1{color:var(--cr-primary-text-color)}}#leftContent{position:relative;transition:opacity 100ms}#leftSpacer{align-items:center;box-sizing:border-box;display:flex;padding-inline-start:calc(12px + 6px);width:var(--cr-toolbar-left-spacer-width,auto)}cr-icon-button{--cr-icon-button-size:32px;min-width:32px}@media (prefers-color-scheme:light){cr-icon-button{--cr-icon-button-fill-color:currentColor;--cr-icon-button-focus-outline-color:var(--cr-focus-outline-color)}}#centeredContent{display:flex;flex:1 1 0;justify-content:center}#rightSpacer{padding-inline-end:12px}:host([narrow]) #centeredContent{justify-content:flex-end}:host([has-overlay]){transition:visibility var(--cr-toolbar-overlay-animation-duration);visibility:hidden}:host([narrow][showing-search_]) #leftContent{opacity:0;position:absolute}:host(:not([narrow])) #leftContent{flex:1 1 var(--cr-toolbar-field-margin,0)}:host(:not([narrow])) #centeredContent{flex-basis:var(--cr-toolbar-center-basis,0)}:host(:not([narrow])[disable-right-content-grow]) #centeredContent{justify-content:start;padding-inline-start:12px}:host(:not([narrow])) #rightContent{flex:1 1 0;text-align:end}:host(:not([narrow])[disable-right-content-grow]) #rightContent{flex:0 1 0}picture{display:none}#menuButton{margin-inline-end:9px}#menuButton~h1{margin-inline-start:0}:host([always-show-logo]) picture,:host(:not([narrow])) picture{display:initial;margin-inline-end:16px}:host([always-show-logo]) #leftSpacer,:host(:not([narrow])) #leftSpacer{padding-inline-start:calc(12px + 9px)}:host([always-show-logo]) :is(picture,#product-logo),:host(:not([narrow])) :is(picture,#product-logo){height:24px;width:24px}`])}function getHtml$a(){return html`
${this.showMenu?html` `:""}

${this.pageName}

`}class CrToolbarElement extends CrLitElement{static get is(){return"cr-toolbar"}static get styles(){return getCss$a()}render(){return getHtml$a.bind(this)()}static get properties(){return{pageName:{type:String},searchPrompt:{type:String},clearLabel:{type:String},menuLabel:{type:String},spinnerActive:{type:Boolean},showMenu:{type:Boolean},showSearch:{type:Boolean},autofocus:{type:Boolean,reflect:true},narrow:{type:Boolean,reflect:true,notify:true},narrowThreshold:{type:Number},alwaysShowLogo:{type:Boolean,reflect:true},showingSearch_:{type:Boolean,reflect:true},searchIconOverride:{type:String},searchInputAriaDescription:{type:String}}}#pageName_accessor_storage="";get pageName(){return this.#pageName_accessor_storage}set pageName(value){this.#pageName_accessor_storage=value}#searchPrompt_accessor_storage="";get searchPrompt(){return this.#searchPrompt_accessor_storage}set searchPrompt(value){this.#searchPrompt_accessor_storage=value}#clearLabel_accessor_storage="";get clearLabel(){return this.#clearLabel_accessor_storage}set clearLabel(value){this.#clearLabel_accessor_storage=value}#menuLabel_accessor_storage;get menuLabel(){return this.#menuLabel_accessor_storage}set menuLabel(value){this.#menuLabel_accessor_storage=value}#spinnerActive_accessor_storage=false;get spinnerActive(){return this.#spinnerActive_accessor_storage}set spinnerActive(value){this.#spinnerActive_accessor_storage=value}#showMenu_accessor_storage=false;get showMenu(){return this.#showMenu_accessor_storage}set showMenu(value){this.#showMenu_accessor_storage=value}#showSearch_accessor_storage=true;get showSearch(){return this.#showSearch_accessor_storage}set showSearch(value){this.#showSearch_accessor_storage=value}#autofocus_accessor_storage=false;get autofocus(){return this.#autofocus_accessor_storage}set autofocus(value){this.#autofocus_accessor_storage=value}#narrow_accessor_storage=false;get narrow(){return this.#narrow_accessor_storage}set narrow(value){this.#narrow_accessor_storage=value}#narrowThreshold_accessor_storage=900;get narrowThreshold(){return this.#narrowThreshold_accessor_storage}set narrowThreshold(value){this.#narrowThreshold_accessor_storage=value}#alwaysShowLogo_accessor_storage=false;get alwaysShowLogo(){return this.#alwaysShowLogo_accessor_storage}set alwaysShowLogo(value){this.#alwaysShowLogo_accessor_storage=value}#showingSearch__accessor_storage=false;get showingSearch_(){return this.#showingSearch__accessor_storage}set showingSearch_(value){this.#showingSearch__accessor_storage=value}#searchIconOverride_accessor_storage;get searchIconOverride(){return this.#searchIconOverride_accessor_storage}set searchIconOverride(value){this.#searchIconOverride_accessor_storage=value}#searchInputAriaDescription_accessor_storage="";get searchInputAriaDescription(){return this.#searchInputAriaDescription_accessor_storage}set searchInputAriaDescription(value){this.#searchInputAriaDescription_accessor_storage=value}narrowQuery_=null;willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("narrowThreshold")){this.narrowQuery_=window.matchMedia(`(max-width: ${this.narrowThreshold}px)`);this.narrow=this.narrowQuery_.matches;this.narrowQuery_.addListener((()=>this.onQueryChanged_()))}}getSearchField(){return this.$.search}onMenuClick_(){this.fire("cr-toolbar-menu-click")}async focusMenuButton(){assert(this.showMenu);await this.updateComplete;const menuButton=this.shadowRoot.querySelector("#menuButton");assert(!!menuButton);menuButton.focus()}isMenuFocused(){return!!this.shadowRoot.activeElement&&this.shadowRoot.activeElement.id==="menuButton"}onShowingSearchChanged_(e){this.showingSearch_=e.detail.value}onQueryChanged_(){assert(this.narrowQuery_);this.narrow=this.narrowQuery_.matches}}customElements.define(CrToolbarElement.is,CrToolbarElement);let instance$c=null;function getCss$9(){return instance$c||(instance$c=[...[],css`:host{background-color:white;border-bottom:1px solid var(--google-grey-300);bottom:0;color:var(--cr-primary-text-color);display:flex;left:0;opacity:0;padding-inline-start:var(--cr-toolbar-field-margin,0);pointer-events:none;position:absolute;right:0;top:0;transition:opacity var(--cr-toolbar-overlay-animation-duration),visibility var(--cr-toolbar-overlay-animation-duration);visibility:hidden}@media (prefers-color-scheme:dark){:host{background-color:var(--google-grey-900);background-image:linear-gradient(rgba(255,255,255,.04),rgba(255,255,255,.04));border-bottom-color:var(--cr-separator-color)}}:host([show]){opacity:1;pointer-events:initial;visibility:initial}#overlay-content{align-items:center;display:flex;flex:1;margin:0 auto;max-width:var(--cr-toolbar-selection-overlay-max-width,initial);padding:0 var(--cr-toolbar-selection-overlay-padding,24px)}#number-selected{flex:1}cr-icon-button{height:36px;margin-inline-end:24px;margin-inline-start:2px;width:36px}#slot{align-items:center;display:flex;gap:var(--cr-toolbar-selection-overlay-slot-gap,16px);margin-inline-start:8px}`])}function getHtml$9(){return html`
${this.selectionLabel}
`}class CrToolbarSelectionOverlayElement extends CrLitElement{static get is(){return"cr-toolbar-selection-overlay"}static get styles(){return getCss$9()}render(){return getHtml$9.bind(this)()}static get properties(){return{show:{type:Boolean,reflect:true},cancelLabel:{type:String},selectionLabel:{type:String}}}#show_accessor_storage=false;get show(){return this.#show_accessor_storage}set show(value){this.#show_accessor_storage=value}#cancelLabel_accessor_storage="";get cancelLabel(){return this.#cancelLabel_accessor_storage}set cancelLabel(value){this.#cancelLabel_accessor_storage=value}#selectionLabel_accessor_storage="";get selectionLabel(){return this.#selectionLabel_accessor_storage}set selectionLabel(value){this.#selectionLabel_accessor_storage=value}firstUpdated(){this.setAttribute("role","toolbar")}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("selectionLabel")){if(changedProperties.get("selectionLabel")===undefined&&this.selectionLabel===""){return}this.setAttribute("aria-label",this.selectionLabel);const announcer=getInstance();announcer.announce(this.selectionLabel)}}onClearSelectionClick_(){this.fire("clear-selected-items")}}customElements.define(CrToolbarSelectionOverlayElement.is,CrToolbarSelectionOverlayElement);let instance$b=null;function getCss$8(){return instance$b||(instance$b=[...[getCss$f()],css`:host{display:flex;position:relative}cr-toolbar{--cr-toolbar-center-basis:var(--cluster-max-width);--cr-toolbar-left-spacer-width:var(--side-bar-width);--cr-toolbar-field-margin:var(--side-bar-width);flex:1}:host([has-drawer]) cr-toolbar,:host([has-drawer]) cr-toolbar-selection-overlay{--cr-toolbar-field-margin:0}cr-toolbar-selection-overlay{opacity:0;--cr-toolbar-selection-overlay-max-width:var(--card-max-width);--cr-toolbar-field-margin:var(--side-bar-width)}cr-toolbar-selection-overlay[show]{opacity:1}`])}function getHtml$8(){return html` $i18n{openSelected} $i18n{delete} `}function safeDecodeURIComponent(s){try{return window.decodeURIComponent(s)}catch(_e){return s}}function getCurrentPathname(){return safeDecodeURIComponent(window.location.pathname)}function getCurrentHash(){return safeDecodeURIComponent(window.location.hash.slice(1))}let instance$a=null;class CrRouter extends EventTarget{path_=getCurrentPathname();query_=window.location.search.slice(1);hash_=getCurrentHash();dwellTime_=2e3;lastChangedAt_;constructor(){super();this.lastChangedAt_=window.performance.now()-(this.dwellTime_-200);window.addEventListener("hashchange",(()=>this.hashChanged_()));window.addEventListener("popstate",(()=>this.urlChanged_()))}setDwellTime(dwellTime){this.dwellTime_=dwellTime;this.lastChangedAt_=window.performance.now()-this.dwellTime_}getPath(){return this.path_}getQueryParams(){return new URLSearchParams(this.query_)}getHash(){return this.hash_}setHash(hash){this.hash_=safeDecodeURIComponent(hash);if(this.hash_!==getCurrentHash()){this.updateState_()}}setQueryParams(params){this.query_=params.toString();if(this.query_!==window.location.search.substring(1)){this.updateState_()}}setPath(path){assert(path.startsWith("/"));this.path_=safeDecodeURIComponent(path);if(this.path_!==getCurrentPathname()){this.updateState_()}}hashChanged_(){const oldHash=this.hash_;this.hash_=getCurrentHash();if(this.hash_!==oldHash){this.dispatchEvent(new CustomEvent("cr-router-hash-changed",{bubbles:true,composed:true,detail:this.hash_}))}}urlChanged_(){this.hashChanged_();const oldPath=this.path_;this.path_=getCurrentPathname();if(oldPath!==this.path_){this.dispatchEvent(new CustomEvent("cr-router-path-changed",{bubbles:true,composed:true,detail:this.path_}))}const oldQuery=this.query_;this.query_=window.location.search.substring(1);if(oldQuery!==this.query_){this.dispatchEvent(new CustomEvent("cr-router-query-params-changed",{bubbles:true,composed:true,detail:this.getQueryParams()}))}}updateState_(){const url=new URL(window.location.origin);const pathPieces=this.path_.split("/");url.pathname=pathPieces.map((piece=>window.encodeURIComponent(piece))).join("/");if(this.query_){url.search=this.query_}if(this.hash_){url.hash=window.encodeURIComponent(this.hash_)}const now=window.performance.now();const shouldReplace=this.lastChangedAt_+this.dwellTime_>now;this.lastChangedAt_=now;if(shouldReplace){window.history.replaceState({},"",url.href)}else{window.history.pushState({},"",url.href)}}static getInstance(){return instance$a||(instance$a=new CrRouter)}static resetForTesting(){instance$a=null}}const Page={HISTORY:"history",HISTORY_CLUSTERS:"grouped",SYNCED_TABS:"syncedTabs",PRODUCT_SPECIFICATIONS_LISTS:"comparisonTables"};const TABBED_PAGES=[Page.HISTORY,Page.HISTORY_CLUSTERS];class HistoryRouterElement extends CrLitElement{static get is(){return"history-router"}static get template(){return null}static get properties(){return{lastSelectedTab:{type:Number},selectedPage:{type:String,notify:true},queryState:{type:Object}}}#lastSelectedTab_accessor_storage=-1;get lastSelectedTab(){return this.#lastSelectedTab_accessor_storage}set lastSelectedTab(value){this.#lastSelectedTab_accessor_storage=value}#selectedPage_accessor_storage="";get selectedPage(){return this.#selectedPage_accessor_storage}set selectedPage(value){this.#selectedPage_accessor_storage=value}#queryState_accessor_storage={incremental:false,querying:false,searchTerm:"",after:null,includeUserVisits:true,includeActorVisits:true};get queryState(){return this.#queryState_accessor_storage}set queryState(value){this.#queryState_accessor_storage=value}timeRangeStart;eventTracker_=new EventTracker;connectedCallback(){super.connectedCallback();if(window.location.hash){window.location.href=window.location.href.split("#")[0]+"?"+window.location.hash.substr(1)}const router=CrRouter.getInstance();this.onPathChanged_(router.getPath());this.onQueryParamsChanged_(router.getQueryParams());this.eventTracker_.add(router,"cr-router-path-changed",(e=>this.onPathChanged_(e.detail)));this.eventTracker_.add(router,"cr-router-query-params-changed",(e=>this.onQueryParamsChanged_(e.detail)))}disconnectedCallback(){super.disconnectedCallback();this.eventTracker_.removeAll()}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("queryState")&&changedProperties.get("queryState")||changedProperties.has("selectedPage")&&changedProperties.get("selectedPage")){this.serializeUrl()}}serializeUrl(){let path=this.selectedPage;if(path===Page.HISTORY){path=""}const router=CrRouter.getInstance();router.setPath("/"+path);if(!this.queryState){return}const queryParams=new URLSearchParams;if(this.queryState.searchTerm){queryParams.set("q",this.queryState.searchTerm)}if(this.queryState.after){queryParams.set("after",this.queryState.after)}router.setQueryParams(queryParams)}onPathChanged_(newPath){const sections=newPath.substr(1).split("/");const page=sections[0]||(window.location.search?"history":TABBED_PAGES[this.lastSelectedTab]);this.selectedPage=page}onQueryParamsChanged_(newParams){const changes={search:""};changes.search=newParams.get("q")||"";let after="";const afterFromParams=newParams.get("after");if(!!afterFromParams&&afterFromParams.match(/^\d{4}-\d{2}-\d{2}$/)){const afterAsDate=new Date(afterFromParams);if(!isNaN(afterAsDate.getTime())){after=afterFromParams}}changes.after=after;this.fire("change-query",changes)}}customElements.define(HistoryRouterElement.is,HistoryRouterElement);class HistoryToolbarElement extends CrLitElement{static get is(){return"history-toolbar"}static get styles(){return getCss$8()}render(){return getHtml$8.bind(this)()}static get properties(){return{count:{type:Number},itemsSelected_:{type:Boolean},pendingDelete:{type:Boolean},searchTerm:{type:String},selectedPage:{type:String},spinnerActive:{type:Boolean},hasDrawer:{type:Boolean,reflect:true},hasMoreResults:{type:Boolean},querying:{type:Boolean},queryInfo:{type:Object},showMenuPromo:{type:Boolean}}}#count_accessor_storage=0;get count(){return this.#count_accessor_storage}set count(value){this.#count_accessor_storage=value}#pendingDelete_accessor_storage=false;get pendingDelete(){return this.#pendingDelete_accessor_storage}set pendingDelete(value){this.#pendingDelete_accessor_storage=value}#searchTerm_accessor_storage="";get searchTerm(){return this.#searchTerm_accessor_storage}set searchTerm(value){this.#searchTerm_accessor_storage=value}#selectedPage_accessor_storage="";get selectedPage(){return this.#selectedPage_accessor_storage}set selectedPage(value){this.#selectedPage_accessor_storage=value}#hasDrawer_accessor_storage=false;get hasDrawer(){return this.#hasDrawer_accessor_storage}set hasDrawer(value){this.#hasDrawer_accessor_storage=value}#hasMoreResults_accessor_storage=false;get hasMoreResults(){return this.#hasMoreResults_accessor_storage}set hasMoreResults(value){this.#hasMoreResults_accessor_storage=value}#querying_accessor_storage=false;get querying(){return this.#querying_accessor_storage}set querying(value){this.#querying_accessor_storage=value}#queryInfo_accessor_storage=null;get queryInfo(){return this.#queryInfo_accessor_storage}set queryInfo(value){this.#queryInfo_accessor_storage=value}#spinnerActive_accessor_storage=false;get spinnerActive(){return this.#spinnerActive_accessor_storage}set spinnerActive(value){this.#spinnerActive_accessor_storage=value}#showMenuPromo_accessor_storage=false;get showMenuPromo(){return this.#showMenuPromo_accessor_storage}set showMenuPromo(value){this.#showMenuPromo_accessor_storage=value}#itemsSelected__accessor_storage=false;get itemsSelected_(){return this.#itemsSelected__accessor_storage}set itemsSelected_(value){this.#itemsSelected__accessor_storage=value}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("count")){this.changeToolbarView_()}}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("searchTerm")){this.searchTermChanged_()}}get searchField(){return this.$.mainToolbar.getSearchField()}onDeleteSelectedItemsClick_(){this.deleteSelectedItems()}deleteSelectedItems(){this.fire("delete-selected")}onOpenSelectedItemsClick_(){this.openSelectedItems()}openSelectedItems(){this.fire("open-selected")}onClearSelectedItems_(){this.clearSelectedItems()}clearSelectedItems(){this.fire("unselect-all");getInstance().announce(loadTimeData.getString("itemsUnselected"))}changeToolbarView_(){this.itemsSelected_=this.count>0}searchTermChanged_(){if(this.searchField.getValue()!==this.searchTerm){this.searchField.showAndFocus();this.searchField.setValue(this.searchTerm)}}onSearchChanged_(event){this.fire("change-query",{search:event.detail,after:null})}numberOfItemsSelected_(count){return count>0?loadTimeData.getStringF("itemsSelected",count):""}computeSearchIconOverride_(){if(loadTimeData.getBoolean("enableHistoryEmbeddings")&&TABBED_PAGES.includes(this.selectedPage)){return loadTimeData.getBoolean("webuiRoundedIconsEnabled")?"history-embeddings:search-spark":"history-embeddings:search-old"}return undefined}computeSearchInputAriaDescriptionOverride_(){if(loadTimeData.getBoolean("enableHistoryEmbeddings")&&TABBED_PAGES.includes(this.selectedPage)){return loadTimeData.getString("historyEmbeddingsDisclaimer")}return undefined}computeSearchPrompt_(){if(loadTimeData.getBoolean("enableHistoryEmbeddings")&&TABBED_PAGES.includes(this.selectedPage)){if(loadTimeData.getBoolean("enableHistoryEmbeddingsAnswers")){const possiblePrompts=["historyEmbeddingsSearchPrompt","historyEmbeddingsAnswersSearchAlternativePrompt1","historyEmbeddingsAnswersSearchAlternativePrompt2","historyEmbeddingsAnswersSearchAlternativePrompt3","historyEmbeddingsAnswersSearchAlternativePrompt4"];const randomIndex=Math.floor(Math.random()*possiblePrompts.length);return loadTimeData.getString(possiblePrompts[randomIndex])}return loadTimeData.getString("historyEmbeddingsSearchPrompt")}return loadTimeData.getString("searchPrompt")}}customElements.define(HistoryToolbarElement.is,HistoryToolbarElement);let instance$9=null;function getCss$7(){return instance$9||(instance$9=[...[getCss$O()],css`:host{display:block;margin:16px auto 8px;max-width:var(--cluster-max-width);width:100%;padding:0 16px;box-sizing:border-box}.filter-chip-container{display:flex;gap:8px}`])} /* Copyright 2026 The Chromium Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */function getHtml$7(){return html`
$i18n{sourceFilterChipUser} $i18n{sourceFilterChipActor}
`} /* Copyright 2026 The Chromium Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */class HistoryFilterChipsElement extends CrLitElement{static get is(){return"history-filter-chips"}static get styles(){return getCss$7()}render(){return getHtml$7.bind(this)()}static get properties(){return{userVisits:{type:Boolean},actorVisits:{type:Boolean}}}#userVisits_accessor_storage=true;get userVisits(){return this.#userVisits_accessor_storage}set userVisits(value){this.#userVisits_accessor_storage=value}#actorVisits_accessor_storage=true;get actorVisits(){return this.#actorVisits_accessor_storage}set actorVisits(value){this.#actorVisits_accessor_storage=value}isUserSelected(){return this.userVisits&&!this.actorVisits}isActorSelected(){return this.actorVisits&&!this.userVisits}onUserVisitsClick_(){this.userVisits=true;this.actorVisits=!this.actorVisits;this.recordMetrics_(this.userVisits,this.actorVisits);this.fireChange_(this.userVisits,this.actorVisits)}onActorVisitsClick_(){this.actorVisits=true;this.userVisits=!this.userVisits;this.recordMetrics_(this.userVisits,this.actorVisits);this.fireChange_(this.userVisits,this.actorVisits)}recordMetrics_(newUserState,newActorState){let action="";if(newUserState&&newActorState){action="HistoryPage_ShowAllEnabled"}else if(newUserState&&!newActorState){action="HistoryPage_ShowUserOnlyEnabled"}else if(!newUserState&&newActorState){action="HistoryPage_ShowActorOnlyEnabled"}if(action!==""){BrowserProxyImpl.getInstance().recordAction(action)}}getUserVisitsIcon_(){if(this.isUserSelected()){return"cr:check"}return this.isCriticalActionsEnabled_()?"cr:person":"cr:person-filled"}getActorVisitsIcon_(){if(this.isActorSelected()){return"cr:check"}return""}isCriticalActionsEnabled_(){return loadTimeData.valueExists("isCriticalActionsEnabled")&&loadTimeData.getBoolean("isCriticalActionsEnabled")}fireChange_(userVisits,actorVisits){this.fire("filter-changed",{userVisits:userVisits,actorVisits:actorVisits})}}customElements.define(HistoryFilterChipsElement.is,HistoryFilterChipsElement);function convertDateToQueryValue(date){const fullYear=date.getFullYear();const month=date.getMonth()+1;const day=date.getDate();function twoDigits(value){return value>=10?`${value}`:`0${value}`}return`${fullYear}-${twoDigits(month)}-${twoDigits(day)}`}class HistoryQueryManagerElement extends CrLitElement{static get is(){return"history-query-manager"}static get template(){return null}static get properties(){return{queryState:{type:Object,notify:true},queryResult:{type:Object}}}#queryState_accessor_storage={incremental:false,querying:false,searchTerm:"",after:null,includeUserVisits:true,includeActorVisits:true};get queryState(){return this.#queryState_accessor_storage}set queryState(value){this.#queryState_accessor_storage=value}#queryResult_accessor_storage={info:null,value:[]};get queryResult(){return this.#queryResult_accessor_storage}set queryResult(value){this.#queryResult_accessor_storage=value}eventTracker_=new EventTracker;resultPendingMetricsTimestamp_=null;connectedCallback(){super.connectedCallback();this.eventTracker_.add(document,"change-query",this.onChangeQuery_.bind(this));this.eventTracker_.add(document,"query-history",this.onQueryHistory_.bind(this));this.eventTracker_.add(document,"visibilitychange",(()=>{if(document.visibilityState==="hidden"){this.flushDebouncedQueryResultMetric_()}}))}disconnectedCallback(){super.disconnectedCallback();this.flushDebouncedQueryResultMetric_();this.eventTracker_.removeAll()}initialize(){this.queryHistory_(false)}queryHistory_(incremental){this.queryState={...this.queryState,querying:true,incremental:incremental};let afterTimestamp;if(loadTimeData.getBoolean("enableHistoryEmbeddings")&&this.queryState.after){const afterDate=new Date(this.queryState.after);afterDate.setHours(0,0,0,0);afterTimestamp=afterDate.getTime()}const browserProxy=BrowserProxyImpl.getInstance();const promise=incremental?browserProxy.handler.queryHistoryContinuation():browserProxy.handler.queryHistory(this.queryState.searchTerm,RESULTS_PER_PAGE,afterTimestamp?afterTimestamp:null,this.queryState.includeUserVisits,this.queryState.includeActorVisits);promise.then((result=>this.onQueryResult_(result.results)),(()=>{}))}onChangeQuery_(e){const changes=e.detail;let needsUpdate=false;if(changes.search!==null&&changes.search!==this.queryState.searchTerm){this.queryState={...this.queryState,searchTerm:changes.search};this.searchTermChanged_();needsUpdate=true}if(loadTimeData.getBoolean("enableHistoryEmbeddings")&&changes.after!==null&&changes.after!==this.queryState.after&&(Boolean(changes.after)||Boolean(this.queryState.after))){this.queryState={...this.queryState,after:changes.after};needsUpdate=true}if(changes.includeUserVisits!==undefined&&changes.includeUserVisits!==this.queryState.includeUserVisits){this.queryState={...this.queryState,includeUserVisits:changes.includeUserVisits};needsUpdate=true}if(changes.includeActorVisits!==undefined&&changes.includeActorVisits!==this.queryState.includeActorVisits){this.queryState={...this.queryState,includeActorVisits:changes.includeActorVisits};needsUpdate=true}if(needsUpdate){this.queryHistory_(false)}}onQueryHistory_(e){this.queryHistory_(e.detail);return false}onQueryResult_(results){this.queryState={...this.queryState,querying:false};this.queryResult={...this.queryResult,info:results.info,value:results.value};this.fire("query-finished",{result:this.queryResult})}searchTermChanged_(){this.flushDebouncedQueryResultMetric_();if(this.queryState.searchTerm){BrowserProxyImpl.getInstance().recordAction("Search");this.resultPendingMetricsTimestamp_=performance.now()}}flushDebouncedQueryResultMetric_(){if(this.resultPendingMetricsTimestamp_&&performance.now()-this.resultPendingMetricsTimestamp_>=QUERY_RESULT_MINIMUM_AGE){BrowserProxyImpl.getInstance().recordHistogram("History.Embeddings.UserActions",HistoryEmbeddingsUserActions.NON_EMPTY_QUERY_HISTORY_SEARCH,HistoryEmbeddingsUserActions.END)}this.resultPendingMetricsTimestamp_=null}}customElements.define(HistoryQueryManagerElement.is,HistoryQueryManagerElement);let instance$8=null;function getCss$6(){return instance$8||(instance$8=[...[],css`:host{align-items:center;border-top:1px solid var(--cr-separator-color);color:var(--cr-secondary-text-color);display:none;font-size:0.8125rem;justify-content:center;padding:0 24px}:host-context([webui-refresh-2026]){a:focus{border-radius:2px;outline:solid 2px var(--cr-focus-outline-color)}}:host([is-managed_]){display:flex}a[href]{color:var(--cr-link-color)}cr-icon{align-self:flex-start;flex-shrink:0;height:20px;padding-inline-end:var(--managed-footnote-icon-padding,8px);width:20px}`])}function getHtml$6(){return html`${this.isManaged_?html`
`:""}`}const ManagedFootnoteElementBase=I18nMixinLit(WebUiListenerMixinLit(CrLitElement));class ManagedFootnoteElement extends ManagedFootnoteElementBase{static get is(){return"managed-footnote"}static get styles(){return getCss$6()}render(){return getHtml$6.bind(this)()}static get properties(){return{isManaged_:{reflect:true,type:Boolean},managedByIcon_:{reflect:true,type:String}}}#isManaged__accessor_storage=loadTimeData.getBoolean("isManaged");get isManaged_(){return this.#isManaged__accessor_storage}set isManaged_(value){this.#isManaged__accessor_storage=value}#managedByIcon__accessor_storage=loadTimeData.getString("managedByIcon");get managedByIcon_(){return this.#managedByIcon__accessor_storage}set managedByIcon_(value){this.#managedByIcon__accessor_storage=value}firstUpdated(){this.addWebUiListener("is-managed-changed",(managed=>{loadTimeData.overrideValues({isManaged:managed});this.isManaged_=managed}))}getManagementString_(){return this.i18nAdvanced("browserManagedByOrg")}}customElements.define(ManagedFootnoteElement.is,ManagedFootnoteElement);chrome.send("observeManagedUI");function getHtml$5(){return html``}const CrMenuSelectorElementBase=CrSelectableMixin(CrLitElement);class CrMenuSelectorElement extends CrMenuSelectorElementBase{static get is(){return"cr-menu-selector"}render(){return getHtml$5.bind(this)()}connectedCallback(){super.connectedCallback();FocusOutlineManager.forDocument(document)}firstUpdated(changedProperties){super.firstUpdated(changedProperties);this.setAttribute("role","menu");this.addEventListener("focusin",this.onFocusin_.bind(this));this.addEventListener("keydown",this.onKeydown_.bind(this));this.addEventListener("iron-deselect",(e=>this.onIronDeselected_(e)));this.addEventListener("iron-select",(e=>this.onIronSelected_(e)))}getAllFocusableItems_(){return Array.from(this.querySelectorAll("[role=menuitem]:not([disabled]):not([hidden])"))}onFocusin_(e){const focusMovedWithKeyboard=FocusOutlineManager.forDocument(document).visible;const focusMovedFromOutside=e.relatedTarget===null||!this.contains(e.relatedTarget);if(focusMovedWithKeyboard&&focusMovedFromOutside){this.getAllFocusableItems_()[0].focus()}}onIronDeselected_(e){e.detail.item.removeAttribute("aria-current")}onIronSelected_(e){e.detail.item.setAttribute("aria-current","page")}onKeydown_(event){const items=this.getAllFocusableItems_();assert(items.length>=1);const currentFocusedIndex=items.indexOf(this.querySelector(":focus"));let newFocusedIndex=currentFocusedIndex;switch(event.key){case"Tab":if(event.shiftKey){items[0].focus()}else{items[items.length-1].focus({preventScroll:true})}return;case"ArrowDown":newFocusedIndex=(currentFocusedIndex+1)%items.length;break;case"ArrowUp":newFocusedIndex=(currentFocusedIndex+items.length-1)%items.length;break;case"Home":newFocusedIndex=0;break;case"End":newFocusedIndex=items.length-1;break}if(newFocusedIndex===currentFocusedIndex){return}event.preventDefault();items[newFocusedIndex].focus()}}customElements.define(CrMenuSelectorElement.is,CrMenuSelectorElement);let instance$7=null;function getCss$5(){return instance$7||(instance$7=[...[],css`.cr-nav-menu-item{--cr-nav-menu-item-color:var(--google-grey-900);--cr-nav-menu-item-color-selected:var(--google-blue-700);--cr-nav-menu-item-background-color-hover:var(--google-grey-200);--cr-nav-menu-item-background-color-selected:var(--google-blue-50);--cr-nav-menu-item-icon-color:var(--google-grey-700);--cr-nav-menu-item-icon-color-hover:var(--google-grey-700);--cr-nav-menu-item-icon-color-selected:var(--google-blue-600);--iron-icon-fill-color:var(--cr-nav-menu-item-icon-color);--iron-icon-height:20px;--iron-icon-width:20px;--cr-icon-ripple-size:20px;align-items:center;border-end-end-radius:100px;border-start-end-radius:100px;box-sizing:border-box;color:var(--cr-nav-menu-item-color);display:flex;font-size:14px;font-weight:500;line-height:14px;margin-inline-end:2px;margin-inline-start:1px;min-height:40px;overflow:hidden;padding-block-end:10px;padding-block-start:10px;padding-inline-start:23px;padding-inline-end:16px;position:relative;text-decoration:none}:host-context([webui-refresh-2026]){.cr-nav-menu-item{--cr-nav-menu-item-color:var(--color-nav-menu-item);--cr-nav-menu-item-color-selected:var(--color-nav-menu-item-selected);--cr-nav-menu-item-background-color-hover:var(--color-nav-menu-item-background-hover);--cr-nav-menu-item-background-color-selected:var(--color-nav-menu-item-background-selected);--cr-nav-menu-item-icon-color:var(--color-nav-menu-item);--cr-nav-menu-item-icon-color-selected:var(--color-nav-menu-item-selected)}.cr-nav-menu-item:focus{outline:solid 2px var(--cr-focus-outline-color);outline-offset:-2px;border-start-start-radius:10px;border-end-start-radius:10px}}:host-context(cr-drawer) .cr-nav-menu-item{margin-inline-end:8px}.cr-nav-menu-item:hover{--iron-icon-fill-color:var(--cr-nav-menu-item-icon-color-hover);background:var(--cr-nav-menu-item-background-color-hover)}.cr-nav-menu-item[selected]{--iron-icon-fill-color:var(--cr-nav-menu-item-icon-color-selected);background:var(--cr-nav-menu-item-background-color-selected);color:var(--cr-nav-menu-item-color-selected)}@media (prefers-color-scheme:dark){.cr-nav-menu-item{--cr-nav-menu-item-color:white;--cr-nav-menu-item-color-selected:var(--google-grey-900);--cr-nav-menu-item-background-color-hover:var(--google-grey-800);--cr-nav-menu-item-background-color-selected:var(--google-blue-300);--cr-nav-menu-item-icon-color:var(--google-grey-500);--cr-nav-menu-item-icon-color-hover:white;--cr-nav-menu-item-icon-color-selected:black}}.cr-nav-menu-item:focus{outline:auto 5px -webkit-focus-ring-color;z-index:1}.cr-nav-menu-item:focus:not([selected]):not(:hover){background:transparent}.cr-nav-menu-item cr-icon,.cr-nav-menu-item iron-icon{flex-shrink:0;margin-inline-end:20px;pointer-events:none;vertical-align:top}@media (forced-colors:active){.cr-nav-menu-item[selected]{background:Highlight;color:HighlightText;--iron-icon-fill-color:HighlightText;forced-color-adjust:none}}`])}let instance$6=null;function getCss$4(){return instance$6||(instance$6=[...[getCss$T(),getCss$P(),getCss$5()],css`:host{display:flex;flex-direction:column;height:100%;overflow-x:hidden;overflow-y:auto;width:var(--side-bar-width)}.separator{background-color:var(--separator-color);flex-shrink:0;height:1px;margin:8px 0}cr-menu-selector{padding-top:8px;user-select:none}cr-menu-selector>a[disabled]{opacity:0.65;pointer-events:none}#spacer{flex:1}#footer{color:var(--sidebar-footer-text-color);width:var(--side-bar-width)}#footer a{color:var(--cr-link-color)}managed-footnote{--managed-footnote-icon-padding:12px;border:none;margin:24px 0;padding-inline-end:16px;padding-inline-start:24px}#google-account-footer{display:flex;margin:24px 0;padding-inline-end:16px;padding-inline-start:24px}#google-account-footer cr-icon{align-self:flex-start;flex-shrink:0;height:20px;padding-inline-end:12px;width:20px}#google-account-footer>div{overflow-x:hidden}cr-icon{display:block;margin-inline-end:20px}#clear-browsing-data{justify-content:normal}#clear-browsing-data .cr-icon{margin-inline-end:0;margin-inline-start:9px}`])}function getHtml$4(){return html` $i18n{historyMenuItem} $i18n{openTabsMenuItem} $i18n{clearBrowsingData}
`}class HistorySideBarElement extends CrLitElement{static get is(){return"history-side-bar"}static get styles(){return getCss$4()}render(){return getHtml$4.bind(this)()}static get properties(){return{footerInfo:{type:Object},historyClustersEnabled:{type:Boolean},historyClustersVisible:{type:Boolean,notify:true},selectedPage:{type:String,notify:true},selectedTab:{type:Number,notify:true},guestSession_:{type:Boolean},showFooter_:{type:Boolean},showGoogleAccountFooter_:{type:Boolean},showGMAOnly_:{type:Boolean},showGAAOnly_:{type:Boolean},showGMAAndGAA_:{type:Boolean},showHistoryClusters_:{type:Boolean}}}#footerInfo_accessor_storage={managed:false,otherFormsOfHistory:false,geminiAppsActivity:false};get footerInfo(){return this.#footerInfo_accessor_storage}set footerInfo(value){this.#footerInfo_accessor_storage=value}#historyClustersEnabled_accessor_storage=false;get historyClustersEnabled(){return this.#historyClustersEnabled_accessor_storage}set historyClustersEnabled(value){this.#historyClustersEnabled_accessor_storage=value}#historyClustersVisible_accessor_storage=false;get historyClustersVisible(){return this.#historyClustersVisible_accessor_storage}set historyClustersVisible(value){this.#historyClustersVisible_accessor_storage=value}#selectedPage_accessor_storage="";get selectedPage(){return this.#selectedPage_accessor_storage}set selectedPage(value){this.#selectedPage_accessor_storage=value}#selectedTab_accessor_storage=-1;get selectedTab(){return this.#selectedTab_accessor_storage}set selectedTab(value){this.#selectedTab_accessor_storage=value}#guestSession__accessor_storage=loadTimeData.getBoolean("isGuestSession");get guestSession_(){return this.#guestSession__accessor_storage}set guestSession_(value){this.#guestSession__accessor_storage=value}#showFooter__accessor_storage=false;get showFooter_(){return this.#showFooter__accessor_storage}set showFooter_(value){this.#showFooter__accessor_storage=value}#showGoogleAccountFooter__accessor_storage=false;get showGoogleAccountFooter_(){return this.#showGoogleAccountFooter__accessor_storage}set showGoogleAccountFooter_(value){this.#showGoogleAccountFooter__accessor_storage=value}#showGMAOnly__accessor_storage=false;get showGMAOnly_(){return this.#showGMAOnly__accessor_storage}set showGMAOnly_(value){this.#showGMAOnly__accessor_storage=value}#showGAAOnly__accessor_storage=false;get showGAAOnly_(){return this.#showGAAOnly__accessor_storage}set showGAAOnly_(value){this.#showGAAOnly__accessor_storage=value}#showGMAAndGAA__accessor_storage=false;get showGMAAndGAA_(){return this.#showGMAAndGAA__accessor_storage}set showGMAAndGAA_(value){this.#showGMAAndGAA__accessor_storage=value}#showHistoryClusters__accessor_storage=false;get showHistoryClusters_(){return this.#showHistoryClusters__accessor_storage}set showHistoryClusters_(value){this.#showHistoryClusters__accessor_storage=value}connectedCallback(){super.connectedCallback();this.addEventListener("keydown",(e=>this.onKeydown_(e)))}willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("footerInfo")){this.updateFooterVisibility()}if(changedProperties.has("historyClustersEnabled")||changedProperties.has("historyClustersVisible")){this.showHistoryClusters_=this.historyClustersEnabled&&this.historyClustersVisible}}updateFooterVisibility(){this.showGMAOnly_=false;this.showGAAOnly_=false;this.showGMAAndGAA_=false;if(this.footerInfo.otherFormsOfHistory&&this.footerInfo.geminiAppsActivity){this.showGMAAndGAA_=true}else if(this.footerInfo.otherFormsOfHistory){this.showGMAOnly_=true}else if(this.footerInfo.geminiAppsActivity){this.showGAAOnly_=true}this.showGoogleAccountFooter_=this.showGMAAndGAA_||this.showGMAOnly_||this.showGAAOnly_;this.showFooter_=this.footerInfo.managed||this.showGoogleAccountFooter_}onGoogleAccountFooterClick_(e){if(e.target.tagName!=="A"){return}e.preventDefault();const browserProxy=BrowserProxyImpl.getInstance();switch(e.target.id){case"footerGoogleMyActivityLink":case"footerMyActivityLink":browserProxy.recordAction("SideBarFooterGoogleMyActivityClick");browserProxy.navigateToUrl(loadTimeData.getString("sidebarFooterGMALink"),"_blank",e);break;case"footerGeminiAppsActivityLink":browserProxy.recordAction("SideBarFooterGeminiAppsActivityClick");browserProxy.navigateToUrl(loadTimeData.getString("sidebarFooterGAALink"),"_blank",e);break}}onKeydown_(e){if(e.key===" "){e.composedPath()[0].click()}}onMenuIronActivate_(){this.fire("history-close-drawer")}onSelectorSelectedChanged_(e){this.selectedPage=e.detail.value}onClearBrowsingDataClick_(e){const browserProxy=BrowserProxyImpl.getInstance();browserProxy.recordAction("InitClearBrowsingData");browserProxy.handler.openClearBrowsingDataDialog();e.preventDefault()}onItemClick_(e){e.preventDefault()}getHistoryItemHref_(){return this.showHistoryClusters_&&TABBED_PAGES[this.selectedTab]===Page.HISTORY_CLUSTERS?"/"+Page.HISTORY_CLUSTERS:"/"}getHistoryItemPath_(){return this.showHistoryClusters_&&TABBED_PAGES[this.selectedTab]===Page.HISTORY_CLUSTERS?Page.HISTORY_CLUSTERS:Page.HISTORY}}customElements.define(HistorySideBarElement.is,HistorySideBarElement);class ForeignSessionPageHandlerFactoryPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history.mojom.ForeignSessionPageHandlerFactory",scope)}}class ForeignSessionPageHandlerFactoryRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(ForeignSessionPageHandlerFactoryPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}createForeignSessionPageHandler(page,handler){this.proxy.sendMessage(1180800191,ForeignSessionPageHandlerFactory_CreateForeignSessionPageHandler_ParamsSpec.$,null,[page,handler],false)}}class ForeignSessionPageHandlerFactory{static get $interfaceName(){return"history.mojom.ForeignSessionPageHandlerFactory"}static getRemote(){let remote=new ForeignSessionPageHandlerFactoryRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}class ForeignSessionPageHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history.mojom.ForeignSessionPageHandler",scope)}}class ForeignSessionPageHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(ForeignSessionPageHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}getForeignSessions(){return this.proxy.sendMessage(1296788765,ForeignSessionPageHandler_GetForeignSessions_ParamsSpec.$,ForeignSessionPageHandler_GetForeignSessions_ResponseParamsSpec.$,[],false)}openForeignSessionAllTabs(sessionTag){this.proxy.sendMessage(1666646306,ForeignSessionPageHandler_OpenForeignSessionAllTabs_ParamsSpec.$,null,[sessionTag],false)}openForeignSessionTab(sessionTag,tabId,modifiers){this.proxy.sendMessage(1411444415,ForeignSessionPageHandler_OpenForeignSessionTab_ParamsSpec.$,null,[sessionTag,tabId,modifiers],false)}deleteForeignSession(sessionTag){this.proxy.sendMessage(233464139,ForeignSessionPageHandler_DeleteForeignSession_ParamsSpec.$,null,[sessionTag],false)}setForeignSessionCollapsed(sessionTag,collapsed){this.proxy.sendMessage(1449034741,ForeignSessionPageHandler_SetForeignSessionCollapsed_ParamsSpec.$,null,[sessionTag,collapsed],false)}showUi(){this.proxy.sendMessage(279770705,ForeignSessionPageHandler_ShowUi_ParamsSpec.$,null,[],false)}}class ForeignSessionPagePendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"history.mojom.ForeignSessionPage",scope)}}class ForeignSessionPageRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(ForeignSessionPagePendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}onForeignSessionsChanged(sessions){this.proxy.sendMessage(107732062,ForeignSessionPage_OnForeignSessionsChanged_ParamsSpec.$,null,[sessions],false)}}class ForeignSessionPageCallbackRouter{helper_internal_;$;router_;onForeignSessionsChanged;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(ForeignSessionPageRemote);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.onForeignSessionsChanged=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(107732062,ForeignSessionPage_OnForeignSessionsChanged_ParamsSpec.$,null,this.onForeignSessionsChanged.createReceiverHandler(false),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}}const ForeignSessionTabSpec={$:{}};const ForeignSessionWindowSpec={$:{}};const ForeignSessionSpec={$:{}};const ForeignSessionPageHandlerFactory_CreateForeignSessionPageHandler_ParamsSpec={$:{}};const ForeignSessionPageHandler_GetForeignSessions_ParamsSpec={$:{}};const ForeignSessionPageHandler_GetForeignSessions_ResponseParamsSpec={$:{}};const ForeignSessionPageHandler_OpenForeignSessionAllTabs_ParamsSpec={$:{}};const ForeignSessionPageHandler_OpenForeignSessionTab_ParamsSpec={$:{}};const ForeignSessionPageHandler_DeleteForeignSession_ParamsSpec={$:{}};const ForeignSessionPageHandler_SetForeignSessionCollapsed_ParamsSpec={$:{}};const ForeignSessionPageHandler_ShowUi_ParamsSpec={$:{}};const ForeignSessionPage_OnForeignSessionsChanged_ParamsSpec={$:{}};mojo.internal.Struct(ForeignSessionTabSpec.$,"ForeignSessionTab",[mojo.internal.StructField("direction",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("remoteIconUrlForUma",8,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("sessionId",16,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("timestamp",24,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("timestampDisplayStr",32,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("title",40,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("url",48,0,UrlSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("windowId",20,0,mojo.internal.Int32,0,false,0,undefined,undefined)],[[0,64]]);mojo.internal.Struct(ForeignSessionWindowSpec.$,"ForeignSessionWindow",[mojo.internal.StructField("timestamp",0,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("sessionId",8,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("tabs",16,0,mojo.internal.Array(ForeignSessionTabSpec.$,false),null,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(ForeignSessionSpec.$,"ForeignSession",[mojo.internal.StructField("tag",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("name",8,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("modifiedTime",16,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("timestamp",24,0,mojo.internal.Double,0,false,0,undefined,undefined),mojo.internal.StructField("collapsed",32,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("windows",40,0,mojo.internal.Array(ForeignSessionWindowSpec.$,false),null,false,0,undefined,undefined)],[[0,56]]);mojo.internal.Struct(ForeignSessionPageHandlerFactory_CreateForeignSessionPageHandler_ParamsSpec.$,"ForeignSessionPageHandlerFactory_CreateForeignSessionPageHandler_Params",[mojo.internal.StructField("page",0,0,mojo.internal.InterfaceProxy(ForeignSessionPageRemote),null,false,0,undefined,undefined),mojo.internal.StructField("handler",8,0,mojo.internal.InterfaceRequest(ForeignSessionPageHandlerPendingReceiver),null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(ForeignSessionPageHandler_GetForeignSessions_ParamsSpec.$,"ForeignSessionPageHandler_GetForeignSessions_Params",[],[[0,8]]);mojo.internal.Struct(ForeignSessionPageHandler_GetForeignSessions_ResponseParamsSpec.$,"ForeignSessionPageHandler_GetForeignSessions_ResponseParams",[mojo.internal.StructField("sessions",0,0,mojo.internal.Array(ForeignSessionSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(ForeignSessionPageHandler_OpenForeignSessionAllTabs_ParamsSpec.$,"ForeignSessionPageHandler_OpenForeignSessionAllTabs_Params",[mojo.internal.StructField("sessionTag",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(ForeignSessionPageHandler_OpenForeignSessionTab_ParamsSpec.$,"ForeignSessionPageHandler_OpenForeignSessionTab_Params",[mojo.internal.StructField("sessionTag",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("tabId",8,0,mojo.internal.Int32,0,false,0,undefined,undefined),mojo.internal.StructField("modifiers",16,0,ClickModifiersSpec.$,null,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(ForeignSessionPageHandler_DeleteForeignSession_ParamsSpec.$,"ForeignSessionPageHandler_DeleteForeignSession_Params",[mojo.internal.StructField("sessionTag",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(ForeignSessionPageHandler_SetForeignSessionCollapsed_ParamsSpec.$,"ForeignSessionPageHandler_SetForeignSessionCollapsed_Params",[mojo.internal.StructField("sessionTag",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("collapsed",8,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(ForeignSessionPageHandler_ShowUi_ParamsSpec.$,"ForeignSessionPageHandler_ShowUi_Params",[],[[0,8]]);mojo.internal.Struct(ForeignSessionPage_OnForeignSessionsChanged_ParamsSpec.$,"ForeignSessionPage_OnForeignSessionsChanged_Params",[mojo.internal.StructField("sessions",0,0,mojo.internal.Array(ForeignSessionSpec.$,false),null,false,0,undefined,undefined)],[[0,16]]);const browserProxyFactory$2=new MojoBrowserProxyFactory(ForeignSessionPageHandlerRemote,ForeignSessionPageCallbackRouter,((remote,receiver)=>ForeignSessionPageHandlerFactory.getRemote().createForeignSessionPageHandler(remote,receiver)));let instance$5=null;function getCss$3(){return instance$5||(instance$5=[...[getCss$f()],css`:host{-webkit-tap-highlight-color:transparent;display:block}#cardHeading{cursor:pointer;justify-content:space-between;padding-inline-end:0}#tab-item-list{padding:8px 0}#last-update-time{color:var(--cr-secondary-text-color)}#title-left-content{display:flex;overflow:hidden}#device-name{overflow:hidden;padding-inline-end:3px;text-overflow:ellipsis}#right-buttons{color:var(--cr-secondary-text-color);margin-inline-end:24px}#collapse{overflow:hidden}#history-item-container{background-color:var(--cr-card-background-color);border-radius:var(--cr-card-border-radius);box-shadow:var(--cr-card-shadow)}.item-container{align-items:center;display:flex;margin:0 20px;min-height:var(--item-height)}.window-separator{background-color:var(--card-border-color);height:1px;margin:5px auto;width:80%}`])}function getHtml$3(){return html`
${this.device}
${this.lastUpdateTime}
${this.tabs.map(((tab,index)=>html`
`))}
`}class HistorySyncedDeviceCardElement extends CrLitElement{static get is(){return"history-synced-device-card"}static get styles(){return getCss$3()}render(){return getHtml$3.bind(this)()}static get properties(){return{tabs:{type:Array},device:{type:String},lastUpdateTime:{type:String},opened:{type:Boolean,notify:true},searchTerm:{type:String},separatorIndexes:{type:Array},sessionTag:{type:String}}}#device_accessor_storage="";get device(){return this.#device_accessor_storage}set device(value){this.#device_accessor_storage=value}#lastUpdateTime_accessor_storage="";get lastUpdateTime(){return this.#lastUpdateTime_accessor_storage}set lastUpdateTime(value){this.#lastUpdateTime_accessor_storage=value}#tabs_accessor_storage=[];get tabs(){return this.#tabs_accessor_storage}set tabs(value){this.#tabs_accessor_storage=value}#opened_accessor_storage=true;get opened(){return this.#opened_accessor_storage}set opened(value){this.#opened_accessor_storage=value}#searchTerm_accessor_storage="";get searchTerm(){return this.#searchTerm_accessor_storage}set searchTerm(value){this.#searchTerm_accessor_storage=value}#separatorIndexes_accessor_storage=[];get separatorIndexes(){return this.#separatorIndexes_accessor_storage}set separatorIndexes(value){this.#separatorIndexes_accessor_storage=value}#sessionTag_accessor_storage="";get sessionTag(){return this.#sessionTag_accessor_storage}set sessionTag(value){this.#sessionTag_accessor_storage=value}updated(changedProperties){super.updated(changedProperties);if(changedProperties.has("tabs")){this.notifyFocusUpdate_();this.updateIcons_()}}createFocusRows(){const titleRow=new FocusRow(this.$.cardHeading,null);titleRow.addItem("menu","#menuButton");titleRow.addItem("collapse","#collapseButton");const rows=[titleRow];if(this.opened){this.shadowRoot.querySelectorAll(".item-container").forEach((function(el){const row=new FocusRow(el,null);row.addItem("link",".website-link");rows.push(row)}))}return rows}onLinkClick_(e){BrowserProxyImpl.getInstance().recordHistogram(SYNCED_TABS_HISTOGRAM_NAME,SyncedTabsHistogram.LINK_CLICKED,SyncedTabsHistogram.LIMIT);const modifiers={middleButton:e.button===1,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey};browserProxyFactory$2.getInstance().handler.openForeignSessionTab(this.sessionTag,Number(e.currentTarget.dataset["sessionId"]),modifiers);e.preventDefault()}onLinkAuxclick_(e){if(e.button===1){this.onLinkClick_(e)}}onCardHeadingClick_(){this.toggleTabCard()}async toggleTabCard(){const histogramValue=this.opened?SyncedTabsHistogram.COLLAPSE_SESSION:SyncedTabsHistogram.EXPAND_SESSION;BrowserProxyImpl.getInstance().recordHistogram(SYNCED_TABS_HISTOGRAM_NAME,histogramValue,SyncedTabsHistogram.LIMIT);this.opened=!this.opened;await this.updateComplete;this.fire("update-focus-grid")}notifyFocusUpdate_(){this.fire("update-focus-grid")}updateIcons_(){setTimeout((()=>{const icons=this.shadowRoot.querySelectorAll(".website-icon");for(let i=0;i=0);let newRow=-1;if(e.key==="ArrowUp"){newRow=rowIndex-1}else if(e.key==="ArrowDown"){newRow=rowIndex+1}else if(e.key==="PageUp"){newRow=0}else if(e.key==="PageDown"){newRow=this.rows.length-1}const rowToFocus=this.rows[newRow];if(rowToFocus){this.ignoreFocusChange_=true;rowToFocus.getEquivalentElement(this.lastFocused_).focus();e.preventDefault();return true}return false}getCustomEquivalent(_sampleElement){return null}destroy(){this.rows.forEach((function(row){row.destroy()}));this.rows.length=0}getRowIndexForTarget(target){for(let i=0;i=0){return i}}return-1}getRowForRoot(root){for(let i=0;i-1){this.rows.splice(nextRowIndex,1)}}ensureRowActive(preferredRow){if(this.rows.length===0){return}for(let i=0;i
${this.syncedDevices_.map(((syncedDevice,index)=>html` `))}
${this.noSyncedTabsMessage_()}
$i18n{turnOnSyncPromo}
$i18n{turnOnSyncPromoDesc}
$i18n{turnOnSyncButton}
${this.shouldShowHistorySyncOptIn_()?html`
${this.isSignInState_(HistorySignInState.SIGNED_OUT)||this.isSignInState_(HistorySignInState.WEB_ONLY_SIGNED_IN)?html`

$i18n{turnOnSyncHistoryPromo}

$i18n{syncHistoryPromoBodySignedOut}
`:""} ${this.isSignInState_(HistorySignInState.WEB_ONLY_SIGNED_IN)&&this.accountInfo_?html`
`:""} ${this.isSignInState_(HistorySignInState.SIGN_IN_PENDING)&&this.accountInfo_?html`

$i18n{turnOnSyncHistoryPromo}

${!this.isTabsSyncTurnedOn_()?html`
$i18n{syncHistoryPromoBodyPendingSignIn}
`:""} ${this.isTabsSyncTurnedOn_()?html`
$i18n{syncHistoryPromoBodyPendingSignInSyncHistoryOn}
`:""} `:""} ${this.isSignInState_(HistorySignInState.SIGNED_IN)&&!this.isTabsSyncTurnedOn_()&&this.accountInfo_?html`

$i18n{turnOnSyncHistoryPromo}

$i18n{turnOnSignedInSyncHistoryPromoBodySignInSyncOff}
`:""} ${this.isSignInState_(HistorySignInState.SIGN_IN_PENDING)&&this.isTabsSyncTurnedOn_()?html` $i18n{verifyItsYou} `:html` $i18n{turnOnSyncHistoryButton} `}
`:""} `}const HistorySyncedDeviceManagerElementBase=WebUiListenerMixinLit(CrLitElement);class HistorySyncedDeviceManagerElement extends HistorySyncedDeviceManagerElementBase{static get is(){return"history-synced-device-manager"}static get styles(){return getCss$2()}render(){return getHtml$2.bind(this)()}static get properties(){return{sessionList:{type:Array},searchTerm:{type:String},syncedDevices_:{type:Array},historyIdentityState_:{type:Object},guestSession_:{type:Boolean},signInAllowed_:{type:Boolean},fetchingSyncedTabs_:{type:Boolean},hasSeenForeignData_:{type:Boolean},actionMenuModel_:{type:String},replaceSyncPromosWithSignInPromos_:{type:Boolean},accountInfo_:{type:Object}}}focusGrid_=null;focusGridUpdateTimeout_=null;#syncedDevices__accessor_storage=[];get syncedDevices_(){return this.#syncedDevices__accessor_storage}set syncedDevices_(value){this.#syncedDevices__accessor_storage=value}#hasSeenForeignData__accessor_storage=false;get hasSeenForeignData_(){return this.#hasSeenForeignData__accessor_storage}set hasSeenForeignData_(value){this.#hasSeenForeignData__accessor_storage=value}#fetchingSyncedTabs__accessor_storage=false;get fetchingSyncedTabs_(){return this.#fetchingSyncedTabs__accessor_storage}set fetchingSyncedTabs_(value){this.#fetchingSyncedTabs__accessor_storage=value}#actionMenuModel__accessor_storage=null;get actionMenuModel_(){return this.#actionMenuModel__accessor_storage}set actionMenuModel_(value){this.#actionMenuModel__accessor_storage=value}#guestSession__accessor_storage=loadTimeData.getBoolean("isGuestSession");get guestSession_(){return this.#guestSession__accessor_storage}set guestSession_(value){this.#guestSession__accessor_storage=value}#signInAllowed__accessor_storage=loadTimeData.getBoolean("isSignInAllowed");get signInAllowed_(){return this.#signInAllowed__accessor_storage}set signInAllowed_(value){this.#signInAllowed__accessor_storage=value}#replaceSyncPromosWithSignInPromos__accessor_storage=loadTimeData.getBoolean("replaceSyncPromosWithSignInPromos");get replaceSyncPromosWithSignInPromos_(){return this.#replaceSyncPromosWithSignInPromos__accessor_storage}set replaceSyncPromosWithSignInPromos_(value){this.#replaceSyncPromosWithSignInPromos__accessor_storage=value}signinPausedImpressionRecorded_=false;#accountInfo__accessor_storage=null;get accountInfo_(){return this.#accountInfo__accessor_storage}set accountInfo_(value){this.#accountInfo__accessor_storage=value}onAccountInfoDataReceivedListenerId_=null;#historyIdentityState__accessor_storage={signIn:HistorySignInState.SIGNED_OUT,tabsSync:SyncState.TURNED_OFF,historySync:SyncState.TURNED_OFF};get historyIdentityState_(){return this.#historyIdentityState__accessor_storage}set historyIdentityState_(value){this.#historyIdentityState__accessor_storage=value}#searchTerm_accessor_storage="";get searchTerm(){return this.#searchTerm_accessor_storage}set searchTerm(value){this.#searchTerm_accessor_storage=value}#sessionList_accessor_storage=null;get sessionList(){return this.#sessionList_accessor_storage}set sessionList(value){this.#sessionList_accessor_storage=value}connectedCallback(){super.connectedCallback();this.focusGrid_=new FocusGrid;BrowserProxyImpl.getInstance().otherDevicesInitialized();BrowserProxyImpl.getInstance().recordHistogram(SYNCED_TABS_HISTOGRAM_NAME,SyncedTabsHistogram.INITIALIZED,SyncedTabsHistogram.LIMIT);BrowserProxyImpl.getInstance().getInitialIdentityState().then((identityState=>{this.historyIdentityState_=identityState}));this.addWebUiListener("history-identity-state-changed",(identityState=>this.historyIdentityState_=identityState));this.onAccountInfoDataReceivedListenerId_=BrowserProxyImpl.getInstance().callbackRouter.sendAccountInfo.addListener(this.handleAccountInfoChanged_.bind(this));BrowserProxyImpl.getInstance().handler.requestAccountInfo().then((({accountInfo:accountInfo})=>this.handleAccountInfoChanged_(accountInfo)))}disconnectedCallback(){super.disconnectedCallback();this.focusGrid_.destroy();if(this.onAccountInfoDataReceivedListenerId_!==null){BrowserProxyImpl.getInstance().callbackRouter.removeListener(this.onAccountInfoDataReceivedListenerId_);this.onAccountInfoDataReceivedListenerId_=null}}willUpdate(changedProperties){super.willUpdate(changedProperties);const changedPrivateProperties=changedProperties;if(changedProperties.has("sessionList")){this.updateSyncedDevices_()}if(changedProperties.has("searchTerm")){this.searchTermChanged_()}if(changedPrivateProperties.has("historyIdentityState_")){this.onIdentityStateChanged_(changedPrivateProperties.get("historyIdentityState_")||null)}}firstUpdated(){this.addEventListener("synced-device-card-open-menu",this.onOpenMenu_);this.addEventListener("update-focus-grid",this.updateFocusGrid_)}configureSignInForTest(data){this.signInAllowed_=data.signInAllowed;this.guestSession_=data.guestSession}createInternalDevice_(session){let tabs=[];const separatorIndexes=[];for(let i=0;i{const cards=this.shadowRoot.querySelectorAll("history-synced-device-card");Array.from(cards).reduce(((prev,cur)=>prev.concat(cur.createFocusRows())),[]).forEach((row=>{this.focusGrid_.addRow(row)}));this.focusGrid_.ensureRowActive(1);this.focusGridUpdateTimeout_=null}))}onDeleteSessionClick_(){const menu=this.$.menu.getIfExists();assert(menu);BrowserProxyImpl.getInstance().recordHistogram(SYNCED_TABS_HISTOGRAM_NAME,SyncedTabsHistogram.HIDE_FOR_NOW,SyncedTabsHistogram.LIMIT);assert(this.actionMenuModel_);browserProxyFactory$2.getInstance().handler.deleteForeignSession(this.actionMenuModel_);this.actionMenuModel_=null;menu.close()}clearSyncedDevicesForTest(){this.clearDisplayedSyncedDevices_()}clearDisplayedSyncedDevices_(){this.syncedDevices_=[]}isSignInState_(state){return this.historyIdentityState_.signIn===state}shouldShowHistorySyncOptIn_(){return this.replaceSyncPromosWithSignInPromos_&&!this.isTabsSyncDisabled_()&&!(this.isSignInState_(HistorySignInState.SIGNED_IN)&&this.isTabsSyncTurnedOn_())}isTabsSyncTurnedOn_(){return this.historyIdentityState_.tabsSync===SyncState.TURNED_ON}isTabsSyncDisabled_(){return this.historyIdentityState_.tabsSync===SyncState.DISABLED}showNoSyncedMessage_(){if(this.guestSession_||this.isTabsSyncDisabled_()){return true}return this.isSignInState_(HistorySignInState.SIGNED_IN)&&this.isTabsSyncTurnedOn_()&&this.syncedDevices_.length===0}showSignInGuide_(){const show=this.isSignInState_(HistorySignInState.SIGNED_OUT)&&!this.guestSession_&&this.signInAllowed_;if(show){BrowserProxyImpl.getInstance().recordAction("Signin_Impression_FromRecentTabs")}return show}noSyncedTabsMessage_(){let stringName=this.fetchingSyncedTabs_?"loading":"noSyncedResults";if(this.searchTerm!==""){stringName="noSearchResults"}return loadTimeData.getString(stringName)}updateSyncedDevices_(){if(this.sessionList===null){return}this.fetchingSyncedTabs_=false;if(this.sessionList.length>0&&!this.hasSeenForeignData_){this.hasSeenForeignData_=true;BrowserProxyImpl.getInstance().recordHistogram(SYNCED_TABS_HISTOGRAM_NAME,SyncedTabsHistogram.HAS_FOREIGN_DATA,SyncedTabsHistogram.LIMIT)}const devices=[];this.sessionList.forEach((session=>{const device=this.createInternalDevice_(session);if(device.tabs.length!==0){devices.push(device)}}));this.syncedDevices_=devices}onIdentityStateChanged_(previous){this.maybeRecordSigninPendingOffered_();if(previous===null){return}this.fire("history-view-changed");if(this.replaceSyncPromosWithSignInPromos_){if(this.isSignInState_(HistorySignInState.SIGNED_OUT)||this.isTabsSyncDisabled_()){this.clearDisplayedSyncedDevices_();this.sessionList=null;return}}else if(this.isSignInState_(HistorySignInState.SIGNED_OUT)){this.clearDisplayedSyncedDevices_();this.sessionList=null;return}if(this.sessionList===null){this.fetchingSyncedTabs_=true}this.updateSyncedDevices_()}maybeRecordSigninPendingOffered_(){if(!this.replaceSyncPromosWithSignInPromos_){return}if(!this.isSignInState_(HistorySignInState.SIGN_IN_PENDING)){this.signinPausedImpressionRecorded_=false;return}if(this.signinPausedImpressionRecorded_){return}BrowserProxyImpl.getInstance().recordSigninPendingOffered();this.signinPausedImpressionRecorded_=true}searchTermChanged_(){this.clearDisplayedSyncedDevices_();this.updateSyncedDevices_()}onCardOpenedChanged_(e){const currentTarget=e.currentTarget;const index=Number(currentTarget.dataset["index"]);const device=this.syncedDevices_[index];device.opened=e.detail.value;this.requestUpdate()}}customElements.define(HistorySyncedDeviceManagerElement.is,HistorySyncedDeviceManagerElement);class PageHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"color_change_listener.mojom.PageHandler",scope)}}class PageHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}setPage(page){this.proxy.sendMessage(702264332,PageHandler_SetPage_ParamsSpec.$,null,[page],false)}}class PageHandler{static get $interfaceName(){return"color_change_listener.mojom.PageHandler"}static getRemote(){let remote=new PageHandlerRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}class PagePendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"color_change_listener.mojom.Page",scope)}}class PageRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(PagePendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}onColorProviderChanged(){this.proxy.sendMessage(1104102036,Page_OnColorProviderChanged_ParamsSpec.$,null,[],false)}}class PageCallbackRouter{helper_internal_;$;router_;onColorProviderChanged;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageRemote);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.onColorProviderChanged=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1104102036,Page_OnColorProviderChanged_ParamsSpec.$,null,this.onColorProviderChanged.createReceiverHandler(false),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}}const PageHandler_SetPage_ParamsSpec={$:{}};const Page_OnColorProviderChanged_ParamsSpec={$:{}};mojo.internal.Struct(PageHandler_SetPage_ParamsSpec.$,"PageHandler_SetPage_Params",[mojo.internal.StructField("page",0,0,mojo.internal.InterfaceProxy(PageRemote),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(Page_OnColorProviderChanged_ParamsSpec.$,"Page_OnColorProviderChanged_Params",[],[[0,8]]);let instance$3=null;class BrowserProxy{callbackRouter;constructor(){this.callbackRouter=new PageCallbackRouter;const pageHandlerRemote=PageHandler.getRemote();pageHandlerRemote.setPage(this.callbackRouter.$.bindNewPipeAndPassRemote())}static getInstance(){return instance$3||(instance$3=new BrowserProxy)}static setInstance(newInstance){instance$3=newInstance}}const COLORS_CSS_SELECTOR="link[href*='//theme/colors.css']";let documentInstance=null;class ColorChangeUpdater{listenerId_=null;root_;constructor(root){assert(documentInstance===null||root!==document);this.root_=root}start(){if(this.listenerId_!==null){return}this.listenerId_=BrowserProxy.getInstance().callbackRouter.onColorProviderChanged.addListener(this.onColorProviderChanged.bind(this))}async onColorProviderChanged(){await this.refreshColorsCss()}async refreshColorsCss(){const colorCssNode=this.root_.querySelector(COLORS_CSS_SELECTOR);if(!colorCssNode){return false}const href=colorCssNode.getAttribute("href");if(!href){return false}const hrefURL=new URL(href,location.href);const params=new URLSearchParams(hrefURL.search);params.set("version",(new Date).getTime().toString());const newHref=`${hrefURL.origin}${hrefURL.pathname}?${params.toString()}`;const newColorsCssLink=document.createElement("link");newColorsCssLink.setAttribute("href",newHref);newColorsCssLink.rel="stylesheet";newColorsCssLink.type="text/css";const newColorsLoaded=new Promise((resolve=>{newColorsCssLink.onload=resolve}));if(this.root_===document){document.getElementsByTagName("body")[0].appendChild(newColorsCssLink)}else{this.root_.appendChild(newColorsCssLink)}await newColorsLoaded;const oldColorCssNode=document.querySelector(COLORS_CSS_SELECTOR);if(oldColorCssNode){oldColorCssNode.remove()}return true}static forDocument(){return documentInstance||(documentInstance=new ColorChangeUpdater(document))}}const BigBufferSharedMemoryRegionSpec={$:{}};const BigBufferSpec={$:{}};mojo.internal.Struct(BigBufferSharedMemoryRegionSpec.$,"BigBufferSharedMemoryRegion",[mojo.internal.StructField("bufferHandle",0,0,mojo.internal.Handle,null,false,0,undefined,undefined),mojo.internal.StructField("size",4,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Union(BigBufferSpec.$,"BigBuffer",{bytes:{ordinal:0,type:mojo.internal.Array(mojo.internal.Uint8,false)},sharedMemory:{ordinal:1,type:BigBufferSharedMemoryRegionSpec.$},invalidBuffer:{ordinal:2,type:mojo.internal.Bool}});var BigBufferFieldTags;(function(BigBufferFieldTags){BigBufferFieldTags[BigBufferFieldTags["BYTES"]=0]="BYTES";BigBufferFieldTags[BigBufferFieldTags["SHARED_MEMORY"]=1]="SHARED_MEMORY";BigBufferFieldTags[BigBufferFieldTags["INVALID_BUFFER"]=2]="INVALID_BUFFER"})(BigBufferFieldTags||(BigBufferFieldTags={}));class String16DataView{decoder_;version_;fieldSpecs_;constructor(decoder,version,fieldSpecs){this.decoder_=decoder;this.version_=version;this.fieldSpecs_=fieldSpecs}get data(){const field=this.fieldSpecs_[0];return mojo.internal.decodeStructField(this.decoder_,field,this.version_)}}class String16Converter{data(str){const arr=[];for(let i=0;iconverterForString16.data(value)))],[[0,16]]);mojo.internal.Struct(BigString16Spec.$,"BigString16",[mojo.internal.StructField("data",0,0,BigBufferSpec.$,null,false,0,undefined,undefined)],[[0,24]]);const TextEntryModeSpec={$:mojo.internal.Enum()};var TextEntryMode;(function(TextEntryMode){TextEntryMode[TextEntryMode["MIN_VALUE"]=0]="MIN_VALUE";TextEntryMode[TextEntryMode["MAX_VALUE"]=2]="MAX_VALUE";TextEntryMode[TextEntryMode["kReplaceAll"]=0]="kReplaceAll";TextEntryMode[TextEntryMode["kInsertOrReplace"]=1]="kInsertOrReplace";TextEntryMode[TextEntryMode["kAppend"]=2]="kAppend"})(TextEntryMode||(TextEntryMode={}));class TrackedElementHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"tracked_element.mojom.TrackedElementHandler",scope)}}class TrackedElementHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(TrackedElementHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}setManager(observer){this.proxy.sendMessage(1627149635,TrackedElementHandler_SetManager_ParamsSpec.$,null,[observer],false)}trackedElementCanHighlightChanged(identifier,canHiglight){this.proxy.sendMessage(566306674,TrackedElementHandler_TrackedElementCanHighlightChanged_ParamsSpec.$,null,[identifier,canHiglight],false)}trackedElementVisibilityChanged(identifier,visible,rect){this.proxy.sendMessage(1462930283,TrackedElementHandler_TrackedElementVisibilityChanged_ParamsSpec.$,null,[identifier,visible,rect],false)}trackedElementActivated(identifier){this.proxy.sendMessage(788991102,TrackedElementHandler_TrackedElementActivated_ParamsSpec.$,null,[identifier],false)}trackedElementCustomEvent(identifier,customEventName){this.proxy.sendMessage(336142196,TrackedElementHandler_TrackedElementCustomEvent_ParamsSpec.$,null,[identifier,customEventName],false)}}class TrackedElementHandler{static get $interfaceName(){return"tracked_element.mojom.TrackedElementHandler"}static getRemote(){let remote=new TrackedElementHandlerRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}class TrackedElementManagerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"tracked_element.mojom.TrackedElementManager",scope)}}class TrackedElementManagerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(TrackedElementManagerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}onElementHighlightChanged(identifier,highlighted){this.proxy.sendMessage(497855683,TrackedElementManager_OnElementHighlightChanged_ParamsSpec.$,null,[identifier,highlighted],false)}clickElement(identifier){return this.proxy.sendMessage(1199336054,TrackedElementManager_ClickElement_ParamsSpec.$,TrackedElementManager_ClickElement_ResponseParamsSpec.$,[identifier],false)}focusElement(identifier){return this.proxy.sendMessage(1310211267,TrackedElementManager_FocusElement_ParamsSpec.$,TrackedElementManager_FocusElement_ResponseParamsSpec.$,[identifier],false)}selectTab(identifier,index){return this.proxy.sendMessage(682302367,TrackedElementManager_SelectTab_ParamsSpec.$,TrackedElementManager_SelectTab_ResponseParamsSpec.$,[identifier,index],false)}selectDropdownItem(identifier,index){return this.proxy.sendMessage(1883664713,TrackedElementManager_SelectDropdownItem_ParamsSpec.$,TrackedElementManager_SelectDropdownItem_ResponseParamsSpec.$,[identifier,index],false)}enterText(identifier,text,mode){return this.proxy.sendMessage(501878576,TrackedElementManager_EnterText_ParamsSpec.$,TrackedElementManager_EnterText_ResponseParamsSpec.$,[identifier,text,mode],false)}confirm(identifier){return this.proxy.sendMessage(1461552035,TrackedElementManager_Confirm_ParamsSpec.$,TrackedElementManager_Confirm_ResponseParamsSpec.$,[identifier],false)}}class TrackedElementManagerCallbackRouter{helper_internal_;$;router_;onElementHighlightChanged;clickElement;focusElement;selectTab;selectDropdownItem;enterText;confirm;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(TrackedElementManagerRemote);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.onElementHighlightChanged=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(497855683,TrackedElementManager_OnElementHighlightChanged_ParamsSpec.$,null,this.onElementHighlightChanged.createReceiverHandler(false),false);this.clickElement=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1199336054,TrackedElementManager_ClickElement_ParamsSpec.$,TrackedElementManager_ClickElement_ResponseParamsSpec.$,this.clickElement.createReceiverHandler(true),false);this.focusElement=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1310211267,TrackedElementManager_FocusElement_ParamsSpec.$,TrackedElementManager_FocusElement_ResponseParamsSpec.$,this.focusElement.createReceiverHandler(true),false);this.selectTab=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(682302367,TrackedElementManager_SelectTab_ParamsSpec.$,TrackedElementManager_SelectTab_ResponseParamsSpec.$,this.selectTab.createReceiverHandler(true),false);this.selectDropdownItem=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1883664713,TrackedElementManager_SelectDropdownItem_ParamsSpec.$,TrackedElementManager_SelectDropdownItem_ResponseParamsSpec.$,this.selectDropdownItem.createReceiverHandler(true),false);this.enterText=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(501878576,TrackedElementManager_EnterText_ParamsSpec.$,TrackedElementManager_EnterText_ResponseParamsSpec.$,this.enterText.createReceiverHandler(true),false);this.confirm=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1461552035,TrackedElementManager_Confirm_ParamsSpec.$,TrackedElementManager_Confirm_ResponseParamsSpec.$,this.confirm.createReceiverHandler(true),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}}const TrackedElementIdentifierSpec={$:{}};const TrackedElementHandler_SetManager_ParamsSpec={$:{}};const TrackedElementHandler_TrackedElementCanHighlightChanged_ParamsSpec={$:{}};const TrackedElementHandler_TrackedElementVisibilityChanged_ParamsSpec={$:{}};const TrackedElementHandler_TrackedElementActivated_ParamsSpec={$:{}};const TrackedElementHandler_TrackedElementCustomEvent_ParamsSpec={$:{}};const TrackedElementManager_OnElementHighlightChanged_ParamsSpec={$:{}};const TrackedElementManager_ClickElement_ParamsSpec={$:{}};const TrackedElementManager_ClickElement_ResponseParamsSpec={$:{}};const TrackedElementManager_FocusElement_ParamsSpec={$:{}};const TrackedElementManager_FocusElement_ResponseParamsSpec={$:{}};const TrackedElementManager_SelectTab_ParamsSpec={$:{}};const TrackedElementManager_SelectTab_ResponseParamsSpec={$:{}};const TrackedElementManager_SelectDropdownItem_ParamsSpec={$:{}};const TrackedElementManager_SelectDropdownItem_ResponseParamsSpec={$:{}};const TrackedElementManager_EnterText_ParamsSpec={$:{}};const TrackedElementManager_EnterText_ResponseParamsSpec={$:{}};const TrackedElementManager_Confirm_ParamsSpec={$:{}};const TrackedElementManager_Confirm_ResponseParamsSpec={$:{}};mojo.internal.Struct(TrackedElementIdentifierSpec.$,"TrackedElementIdentifier",[mojo.internal.StructField("nativeIdentifier",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("secondaryIdentifier",8,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(TrackedElementHandler_SetManager_ParamsSpec.$,"TrackedElementHandler_SetManager_Params",[mojo.internal.StructField("observer",0,0,mojo.internal.InterfaceProxy(TrackedElementManagerRemote),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementHandler_TrackedElementCanHighlightChanged_ParamsSpec.$,"TrackedElementHandler_TrackedElementCanHighlightChanged_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("canHiglight",8,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(TrackedElementHandler_TrackedElementVisibilityChanged_ParamsSpec.$,"TrackedElementHandler_TrackedElementVisibilityChanged_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("visible",8,0,mojo.internal.Bool,false,false,0,undefined,undefined),mojo.internal.StructField("rect",16,0,RectFSpec.$,null,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(TrackedElementHandler_TrackedElementActivated_ParamsSpec.$,"TrackedElementHandler_TrackedElementActivated_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementHandler_TrackedElementCustomEvent_ParamsSpec.$,"TrackedElementHandler_TrackedElementCustomEvent_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("customEventName",8,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(TrackedElementManager_OnElementHighlightChanged_ParamsSpec.$,"TrackedElementManager_OnElementHighlightChanged_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("highlighted",8,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(TrackedElementManager_ClickElement_ParamsSpec.$,"TrackedElementManager_ClickElement_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_ClickElement_ResponseParamsSpec.$,"TrackedElementManager_ClickElement_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_FocusElement_ParamsSpec.$,"TrackedElementManager_FocusElement_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_FocusElement_ResponseParamsSpec.$,"TrackedElementManager_FocusElement_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_SelectTab_ParamsSpec.$,"TrackedElementManager_SelectTab_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("index",8,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(TrackedElementManager_SelectTab_ResponseParamsSpec.$,"TrackedElementManager_SelectTab_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_SelectDropdownItem_ParamsSpec.$,"TrackedElementManager_SelectDropdownItem_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("index",8,0,mojo.internal.Uint32,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(TrackedElementManager_SelectDropdownItem_ResponseParamsSpec.$,"TrackedElementManager_SelectDropdownItem_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_EnterText_ParamsSpec.$,"TrackedElementManager_EnterText_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("text",8,0,String16Spec.$,null,false,0,undefined,undefined),mojo.internal.StructField("mode",16,0,TextEntryModeSpec.$,0,false,0,undefined,undefined)],[[0,32]]);mojo.internal.Struct(TrackedElementManager_EnterText_ResponseParamsSpec.$,"TrackedElementManager_EnterText_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_Confirm_ParamsSpec.$,"TrackedElementManager_Confirm_Params",[mojo.internal.StructField("identifier",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(TrackedElementManager_Confirm_ResponseParamsSpec.$,"TrackedElementManager_Confirm_ResponseParams",[mojo.internal.StructField("success",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);const HelpBubbleArrowPositionSpec={$:mojo.internal.Enum()};var HelpBubbleArrowPosition;(function(HelpBubbleArrowPosition){HelpBubbleArrowPosition[HelpBubbleArrowPosition["MIN_VALUE"]=0]="MIN_VALUE";HelpBubbleArrowPosition[HelpBubbleArrowPosition["MAX_VALUE"]=11]="MAX_VALUE";HelpBubbleArrowPosition[HelpBubbleArrowPosition["TOP_LEFT"]=0]="TOP_LEFT";HelpBubbleArrowPosition[HelpBubbleArrowPosition["TOP_CENTER"]=1]="TOP_CENTER";HelpBubbleArrowPosition[HelpBubbleArrowPosition["TOP_RIGHT"]=2]="TOP_RIGHT";HelpBubbleArrowPosition[HelpBubbleArrowPosition["BOTTOM_LEFT"]=3]="BOTTOM_LEFT";HelpBubbleArrowPosition[HelpBubbleArrowPosition["BOTTOM_CENTER"]=4]="BOTTOM_CENTER";HelpBubbleArrowPosition[HelpBubbleArrowPosition["BOTTOM_RIGHT"]=5]="BOTTOM_RIGHT";HelpBubbleArrowPosition[HelpBubbleArrowPosition["LEFT_TOP"]=6]="LEFT_TOP";HelpBubbleArrowPosition[HelpBubbleArrowPosition["LEFT_CENTER"]=7]="LEFT_CENTER";HelpBubbleArrowPosition[HelpBubbleArrowPosition["LEFT_BOTTOM"]=8]="LEFT_BOTTOM";HelpBubbleArrowPosition[HelpBubbleArrowPosition["RIGHT_TOP"]=9]="RIGHT_TOP";HelpBubbleArrowPosition[HelpBubbleArrowPosition["RIGHT_CENTER"]=10]="RIGHT_CENTER";HelpBubbleArrowPosition[HelpBubbleArrowPosition["RIGHT_BOTTOM"]=11]="RIGHT_BOTTOM"})(HelpBubbleArrowPosition||(HelpBubbleArrowPosition={}));const HelpBubbleClosedReasonSpec={$:mojo.internal.Enum()};var HelpBubbleClosedReason;(function(HelpBubbleClosedReason){HelpBubbleClosedReason[HelpBubbleClosedReason["MIN_VALUE"]=0]="MIN_VALUE";HelpBubbleClosedReason[HelpBubbleClosedReason["MAX_VALUE"]=2]="MAX_VALUE";HelpBubbleClosedReason[HelpBubbleClosedReason["kPageChanged"]=0]="kPageChanged";HelpBubbleClosedReason[HelpBubbleClosedReason["kDismissedByUser"]=1]="kDismissedByUser";HelpBubbleClosedReason[HelpBubbleClosedReason["kTimedOut"]=2]="kTimedOut"})(HelpBubbleClosedReason||(HelpBubbleClosedReason={}));class HelpBubbleHandlerFactoryPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"help_bubble.mojom.HelpBubbleHandlerFactory",scope)}}class HelpBubbleHandlerFactoryRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(HelpBubbleHandlerFactoryPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}createHelpBubbleHandler(client,handler){this.proxy.sendMessage(1253403811,HelpBubbleHandlerFactory_CreateHelpBubbleHandler_ParamsSpec.$,null,[client,handler],false)}}class HelpBubbleHandlerFactory{static get $interfaceName(){return"help_bubble.mojom.HelpBubbleHandlerFactory"}static getRemote(){let remote=new HelpBubbleHandlerFactoryRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}class HelpBubbleHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"help_bubble.mojom.HelpBubbleHandler",scope)}}class HelpBubbleHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(HelpBubbleHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}helpBubbleButtonPressed(id,buttonIndex){this.proxy.sendMessage(949963946,HelpBubbleHandler_HelpBubbleButtonPressed_ParamsSpec.$,null,[id,buttonIndex],false)}helpBubbleClosed(id,reason){this.proxy.sendMessage(812140545,HelpBubbleHandler_HelpBubbleClosed_ParamsSpec.$,null,[id,reason],false)}}class HelpBubbleClientPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"help_bubble.mojom.HelpBubbleClient",scope)}}class HelpBubbleClientRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(HelpBubbleClientPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}showHelpBubble(params){this.proxy.sendMessage(1453906927,HelpBubbleClient_ShowHelpBubble_ParamsSpec.$,null,[params],false)}toggleFocusForAccessibility(id){this.proxy.sendMessage(526302955,HelpBubbleClient_ToggleFocusForAccessibility_ParamsSpec.$,null,[id],false)}hideHelpBubble(id){this.proxy.sendMessage(1136546288,HelpBubbleClient_HideHelpBubble_ParamsSpec.$,null,[id],false)}externalHelpBubbleUpdated(id,shown){this.proxy.sendMessage(637918551,HelpBubbleClient_ExternalHelpBubbleUpdated_ParamsSpec.$,null,[id,shown],false)}}class HelpBubbleClientCallbackRouter{helper_internal_;$;router_;showHelpBubble;toggleFocusForAccessibility;hideHelpBubble;externalHelpBubbleUpdated;onConnectionError;constructor(){this.helper_internal_=new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(HelpBubbleClientRemote);this.$=new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);this.router_=new mojo.internal.interfaceSupport.CallbackRouter;this.showHelpBubble=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1453906927,HelpBubbleClient_ShowHelpBubble_ParamsSpec.$,null,this.showHelpBubble.createReceiverHandler(false),false);this.toggleFocusForAccessibility=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(526302955,HelpBubbleClient_ToggleFocusForAccessibility_ParamsSpec.$,null,this.toggleFocusForAccessibility.createReceiverHandler(false),false);this.hideHelpBubble=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(1136546288,HelpBubbleClient_HideHelpBubble_ParamsSpec.$,null,this.hideHelpBubble.createReceiverHandler(false),false);this.externalHelpBubbleUpdated=new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);this.helper_internal_.registerHandler(637918551,HelpBubbleClient_ExternalHelpBubbleUpdated_ParamsSpec.$,null,this.externalHelpBubbleUpdated.createReceiverHandler(false),false);this.onConnectionError=this.helper_internal_.getConnectionErrorEventRouter()}removeListener(id){return this.router_.removeListener(id)}}const HelpBubbleButtonParamsSpec={$:{}};const ProgressSpec={$:{}};const HelpBubbleParamsSpec={$:{}};const HelpBubbleHandlerFactory_CreateHelpBubbleHandler_ParamsSpec={$:{}};const PdfHelpBubbleHandlerFactory_CreateHelpBubbleHandler_ParamsSpec={$:{}};const HelpBubbleHandler_HelpBubbleButtonPressed_ParamsSpec={$:{}};const HelpBubbleHandler_HelpBubbleClosed_ParamsSpec={$:{}};const HelpBubbleClient_ShowHelpBubble_ParamsSpec={$:{}};const HelpBubbleClient_ToggleFocusForAccessibility_ParamsSpec={$:{}};const HelpBubbleClient_HideHelpBubble_ParamsSpec={$:{}};const HelpBubbleClient_ExternalHelpBubbleUpdated_ParamsSpec={$:{}};mojo.internal.Struct(HelpBubbleButtonParamsSpec.$,"HelpBubbleButtonParams",[mojo.internal.StructField("text",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("isDefault",8,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(ProgressSpec.$,"Progress",[mojo.internal.StructField("current",0,0,mojo.internal.Uint8,0,false,0,undefined,undefined),mojo.internal.StructField("total",1,0,mojo.internal.Uint8,0,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(HelpBubbleParamsSpec.$,"HelpBubbleParams",[mojo.internal.StructField("id",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("position",8,0,HelpBubbleArrowPositionSpec.$,HelpBubbleArrowPosition.TOP_CENTER,false,0,undefined,undefined),mojo.internal.StructField("titleText",16,0,mojo.internal.String,null,true,0,undefined,undefined),mojo.internal.StructField("bodyText",24,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("closeButtonAltText",32,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("bodyIconName",40,0,mojo.internal.String,null,true,0,undefined,undefined),mojo.internal.StructField("bodyIconAltText",48,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("progress",56,0,ProgressSpec.$,null,true,0,undefined,undefined),mojo.internal.StructField("buttons",64,0,mojo.internal.Array(HelpBubbleButtonParamsSpec.$,false),null,false,0,undefined,undefined),mojo.internal.StructField("focus_on_show_hint_$flag",12,0,mojo.internal.Bool,false,false,0,{isPrimary:true,linkedValueFieldName:"focus_on_show_hint_$value",originalFieldName:"focusOnShowHint"},undefined),mojo.internal.StructField("focus_on_show_hint_$value",12,1,mojo.internal.Bool,false,false,0,{isPrimary:false,originalFieldName:"focusOnShowHint"},undefined),mojo.internal.StructField("timeout",72,0,TimeDeltaSpec.$,null,true,0,undefined,undefined)],[[0,88]]);mojo.internal.Struct(HelpBubbleHandlerFactory_CreateHelpBubbleHandler_ParamsSpec.$,"HelpBubbleHandlerFactory_CreateHelpBubbleHandler_Params",[mojo.internal.StructField("client",0,0,mojo.internal.InterfaceProxy(HelpBubbleClientRemote),null,false,0,undefined,undefined),mojo.internal.StructField("handler",8,0,mojo.internal.InterfaceRequest(HelpBubbleHandlerPendingReceiver),null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(PdfHelpBubbleHandlerFactory_CreateHelpBubbleHandler_ParamsSpec.$,"PdfHelpBubbleHandlerFactory_CreateHelpBubbleHandler_Params",[mojo.internal.StructField("client",0,0,mojo.internal.InterfaceProxy(HelpBubbleClientRemote),null,false,0,undefined,undefined),mojo.internal.StructField("helpBubbleHandler",8,0,mojo.internal.InterfaceRequest(HelpBubbleHandlerPendingReceiver),null,false,0,undefined,undefined),mojo.internal.StructField("trackedElementHandler",12,0,mojo.internal.InterfaceRequest(TrackedElementHandlerPendingReceiver),null,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(HelpBubbleHandler_HelpBubbleButtonPressed_ParamsSpec.$,"HelpBubbleHandler_HelpBubbleButtonPressed_Params",[mojo.internal.StructField("id",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("buttonIndex",8,0,mojo.internal.Uint8,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(HelpBubbleHandler_HelpBubbleClosed_ParamsSpec.$,"HelpBubbleHandler_HelpBubbleClosed_Params",[mojo.internal.StructField("id",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("reason",8,0,HelpBubbleClosedReasonSpec.$,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(HelpBubbleClient_ShowHelpBubble_ParamsSpec.$,"HelpBubbleClient_ShowHelpBubble_Params",[mojo.internal.StructField("params",0,0,HelpBubbleParamsSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(HelpBubbleClient_ToggleFocusForAccessibility_ParamsSpec.$,"HelpBubbleClient_ToggleFocusForAccessibility_Params",[mojo.internal.StructField("id",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(HelpBubbleClient_HideHelpBubble_ParamsSpec.$,"HelpBubbleClient_HideHelpBubble_Params",[mojo.internal.StructField("id",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(HelpBubbleClient_ExternalHelpBubbleUpdated_ParamsSpec.$,"HelpBubbleClient_ExternalHelpBubbleUpdated_Params",[mojo.internal.StructField("id",0,0,TrackedElementIdentifierSpec.$,null,false,0,undefined,undefined),mojo.internal.StructField("shown",8,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,24]]);const browserProxyFactory$1=new MojoBrowserProxyFactory(HelpBubbleHandlerRemote,HelpBubbleClientCallbackRouter,((remote,receiver)=>HelpBubbleHandlerFactory.getRemote().createHelpBubbleHandler(remote,receiver)));class TrackedElementProxyImpl{handler_=TrackedElementHandler.getRemote();callbackRouter=new TrackedElementManagerCallbackRouter;getHandler(){return this.handler_}static getInstance(){return instance$2||(instance$2=new TrackedElementProxyImpl)}static setInstance(obj){instance$2=obj;TrackedElementManager.setInstance(undefined)}static getAutoGeneratedSecondaryId(){return"webui:"+crypto.randomUUID()}}let instance$2=null;const TRACKED_ELEMENT_VISIBILITY_CHANGED_EVENT="tracked-element-visibility-changed";class ElementData{elements=new Map;eventTarget=new EventTarget}const NATIVE_ELEMENT_IDENTIFIER_KEY="nativeId";const SECONDARY_ELEMENT_IDENTIFIER_KEY="secondaryId";function areBoundsEqual(a,b){if(!a||!b){return a===b}return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}function parseOptions(options){if(!options){return{padding:{top:0,bottom:0,left:0,right:0},fixed:false}}const padding={top:0,bottom:0,left:0,right:0};padding.top=clampPadding$1(options.paddingTop);padding.left=clampPadding$1(options.paddingLeft);padding.bottom=clampPadding$1(options.paddingBottom);padding.right=clampPadding$1(options.paddingRight);return{padding:padding,fixed:!!options.fixed}}function clampPadding$1(n=0){return Math.max(0,Math.min(20,n))}function computeIsVisible(element){const rect=element.getBoundingClientRect();return rect.height>0&&rect.width>0}class TrackedElementManager{static getInstance(){if(!window._trackedElementManager){window._trackedElementManager=new TrackedElementManager}return window._trackedElementManager}static setInstance(instance){window._trackedElementManager=instance}trackedElementHandler_;trackedElements_=new Map;fixedElementObserver_;resizeObserver_;attributeMutationObserver_;documentMutationObserver_;debouncedUpdateAllBoundsCallback_;constructor(){this.trackedElementHandler_=TrackedElementProxyImpl.getInstance().getHandler();const callbackRouter=TrackedElementProxyImpl.getInstance().callbackRouter;this.trackedElementHandler_.setManager(callbackRouter.$.bindNewPipeAndPassRemote());callbackRouter.onElementHighlightChanged.addListener(this.onElementHighlightChanged_.bind(this));callbackRouter.clickElement.addListener(this.clickElement_.bind(this));callbackRouter.focusElement.addListener(this.focusElement_.bind(this));callbackRouter.selectTab.addListener(this.selectTab_.bind(this));callbackRouter.selectDropdownItem.addListener(this.selectDropdownItem_.bind(this));callbackRouter.enterText.addListener(this.enterText_.bind(this));callbackRouter.confirm.addListener(this.confirm_.bind(this));this.debouncedUpdateAllBoundsCallback_=debounceEnd(this.updateAllBounds_.bind(this),50);this.resizeObserver_=new ResizeObserver((entries=>entries.forEach((({target:target})=>{if(target!==document.body){this.onElementVisibilityChanged_(target,computeIsVisible(target))}this.debouncedUpdateAllBoundsCallback_()}))));this.fixedElementObserver_=new IntersectionObserver((entries=>entries.forEach((({target:target,isIntersecting:isIntersecting})=>this.onElementVisibilityChanged_(target,isIntersecting)))),{root:null});this.attributeMutationObserver_=new MutationObserver((mutations=>{for(const mutation of mutations){const target=mutation.target;if(this.getDataForElement_(target)){this.onElementVisibilityChanged_(target,computeIsVisible(target))}}}));const checkTrackedNodes=nodes=>{nodes.forEach((node=>{if(node instanceof HTMLElement){if(this.getDataForElement_(node)){this.onElementVisibilityChanged_(node,computeIsVisible(node))}node.querySelectorAll("*").forEach((descendant=>{if(descendant instanceof HTMLElement&&this.getDataForElement_(descendant)){this.onElementVisibilityChanged_(descendant,computeIsVisible(descendant))}}))}}))};this.documentMutationObserver_=new MutationObserver((mutations=>{for(const mutation of mutations){checkTrackedNodes(mutation.removedNodes);checkTrackedNodes(mutation.addedNodes)}}));document.addEventListener("scroll",this.debouncedUpdateAllBoundsCallback_,{passive:true});this.resizeObserver_.observe(document.body);this.documentMutationObserver_.observe(document,{childList:true,subtree:true})}static getElementId(element){const nativeIdentifier=element.dataset[NATIVE_ELEMENT_IDENTIFIER_KEY];const secondaryIdentifier=element.dataset[SECONDARY_ELEMENT_IDENTIFIER_KEY];if(!nativeIdentifier){return undefined}assert(secondaryIdentifier,"Element has native identifier "+nativeIdentifier+" but no secondary id.");return{nativeIdentifier:nativeIdentifier,secondaryIdentifier:secondaryIdentifier}}getDataForElement_(element){const id=TrackedElementManager.getElementId(element);if(!id){return undefined}const maybeTrackedElement=this.trackedElements_.get(id.nativeIdentifier)?.elements.get(id.secondaryIdentifier);if(!maybeTrackedElement){return undefined}assert(maybeTrackedElement.element===element,`Found different element with same native (${id.nativeIdentifier}) and secondary (${id.secondaryIdentifier}) ids!`);return maybeTrackedElement}getDataForId_(id){const nativeId=id.nativeIdentifier;const secondaryId=id.secondaryIdentifier;if(!nativeId||!secondaryId){return undefined}return this.trackedElements_.get(nativeId)?.elements.get(secondaryId)}getElementFor(element){const id=TrackedElementManager.getElementId(element);return id?this.getElementWithId(id):undefined}getElementWithId(id,visibleOnly=false){const el=this.getDataForId_(id);if(!el||visibleOnly&&!el.visible){return undefined}return{element:el.element,visible:el.visible,bounds:el.bounds}}getAllElementsWithNativeId(nativeIdentifier,visibleOnly=false){const result=[];const data=this.trackedElements_.get(nativeIdentifier);if(data){for(const el of data.elements.values()){if(!visibleOnly||el.visible){result.push({element:el.element,visible:el.visible,bounds:el.bounds})}}}return result}static idToString_(id){return id.nativeIdentifier+" - "+id.secondaryIdentifier}reset(){this.resizeObserver_.disconnect();this.fixedElementObserver_.disconnect();this.attributeMutationObserver_.disconnect();this.documentMutationObserver_.disconnect();document.removeEventListener("scroll",this.debouncedUpdateAllBoundsCallback_);this.trackedElements_.clear();this.resizeObserver_.observe(document.body);this.documentMutationObserver_.observe(document,{childList:true,subtree:true})}startTracking(element,nativeId,options,onVisibilityChanged){if(this.getDataForElement_(element)){this.stopTracking(element)}const secondaryId=options?.secondaryId||TrackedElementProxyImpl.getAutoGeneratedSecondaryId();element.dataset[NATIVE_ELEMENT_IDENTIFIER_KEY]=nativeId;element.dataset[SECONDARY_ELEMENT_IDENTIFIER_KEY]=secondaryId;const parsedOptions=parseOptions(options);const initialVisible=computeIsVisible(element);const trackedElement={element:element,nativeId:nativeId,secondaryId:secondaryId,padding:parsedOptions.padding,fixed:parsedOptions.fixed,visible:initialVisible,bounds:{x:0,y:0,width:0,height:0},onVisibilityChanged:onVisibilityChanged,onHighlightChanged:options?.onHighlightChanged};if(!this.trackedElements_.has(nativeId)){this.trackedElements_.set(nativeId,new ElementData)}const data=this.trackedElements_.get(nativeId);assert(!data.elements.has(secondaryId),"Attempted to track an element with native id "+nativeId+" twice, or two elements with conflicting secondary id "+secondaryId);data.elements.set(secondaryId,trackedElement);if(trackedElement.fixed){this.fixedElementObserver_.observe(element)}else{this.resizeObserver_.observe(element)}this.attributeMutationObserver_.observe(element,{attributes:true,attributeFilter:["style","class","hidden"]});if(options?.onHighlightChanged){this.trackedElementHandler_.trackedElementCanHighlightChanged(TrackedElementManager.elementToIdentifier_(trackedElement),true)}this.onElementVisibilityChanged_(element,initialVisible)}getVisibilityEventTarget(nativeId){if(!this.trackedElements_.has(nativeId)){this.trackedElements_.set(nativeId,new ElementData)}return this.trackedElements_.get(nativeId).eventTarget}stopTracking(element){const trackedElement=this.getDataForElement_(element);if(!trackedElement){return}if(trackedElement.onHighlightChanged){this.trackedElementHandler_.trackedElementCanHighlightChanged(TrackedElementManager.elementToIdentifier_(trackedElement),false)}this.onElementVisibilityChanged_(element,false);if(trackedElement.fixed){this.fixedElementObserver_.unobserve(element)}else{this.resizeObserver_.unobserve(element)}this.trackedElements_.get(trackedElement.nativeId)?.elements.delete(trackedElement.secondaryId);delete element.dataset[NATIVE_ELEMENT_IDENTIFIER_KEY];delete element.dataset[SECONDARY_ELEMENT_IDENTIFIER_KEY]}notifyElementActivated(element){const el=this.getDataForElement_(element);assert(el);this.trackedElementHandler_.trackedElementActivated(TrackedElementManager.elementToIdentifier_(el))}notifyCustomEvent(element,customEventName){const el=this.getDataForElement_(element);assert(el);this.trackedElementHandler_.trackedElementCustomEvent(TrackedElementManager.elementToIdentifier_(el),customEventName)}onElementVisibilityChanged_(element,visible){const trackedElement=this.getDataForElement_(element);if(!trackedElement){return}const bounds=visible?this.getElementBounds_(trackedElement):{x:0,y:0,width:0,height:0};const update={visible:visible,bounds:bounds,element:element};if(trackedElement.onVisibilityChanged){trackedElement.onVisibilityChanged(update)}this.trackedElements_.get(trackedElement.nativeId).eventTarget.dispatchEvent(new CustomEvent(TRACKED_ELEMENT_VISIBILITY_CHANGED_EVENT,{detail:update}));if(trackedElement.lastReportedVisible===visible&&areBoundsEqual(trackedElement.lastReportedBounds,bounds)){return}trackedElement.lastReportedVisible=visible;trackedElement.lastReportedBounds=bounds;const wasVisible=trackedElement.visible;trackedElement.visible=visible;trackedElement.bounds=bounds;this.trackedElementHandler_.trackedElementVisibilityChanged(TrackedElementManager.elementToIdentifier_(trackedElement),visible,bounds);if(visible&&!wasVisible&&trackedElement.onHighlightChanged){this.trackedElementHandler_.trackedElementCanHighlightChanged(TrackedElementManager.elementToIdentifier_(trackedElement),true)}}updateAllBounds_(){this.trackedElements_.forEach(((elementData,_)=>{elementData.elements.forEach(((trackedElement,_)=>{const element=trackedElement.element;this.onElementVisibilityChanged_(element,computeIsVisible(element))}))}))}getElementBounds_(trackedElement){const rect={x:0,y:0,width:0,height:0};const bounds=trackedElement.element.getBoundingClientRect();rect.x=bounds.x;rect.y=bounds.y;rect.width=bounds.width;rect.height=bounds.height;const padding=trackedElement.padding;rect.x-=padding.left;rect.y-=padding.top;rect.width+=padding.left+padding.right;rect.height+=padding.top+padding.bottom;return rect}onElementHighlightChanged_(id,highlighted){const trackedElement=this.getDataForId_(id);const maybeCallback=trackedElement?.onHighlightChanged;if(maybeCallback){maybeCallback(highlighted,trackedElement.element)}}async waitUntilNotDisabled_(element,id){if(!element.hasAttribute("disabled")){return}console.info(`TrackedElementManager: Element ${TrackedElementManager.idToString_(id)} is disabled, `+`waiting...`);return new Promise((resolve=>{const observer=new MutationObserver((()=>{if(!element.hasAttribute("disabled")){observer.disconnect();console.info(`TrackedElementManager: Element ${TrackedElementManager.idToString_(id)} is no `+`longer disabled.`);resolve()}}));observer.observe(element,{attributes:true,attributeFilter:["disabled"]})}))}async clickElement_(id){const trackedElement=this.getDataForId_(id);if(!trackedElement){console.error(`TrackedElementManager: Click failed, element not found: ${TrackedElementManager.idToString_(id)}`);return{success:false}}let target=trackedElement.element;if(target.shadowRoot&&!["BUTTON","INPUT","A","SELECT"].includes(target.tagName)){const inner=target.shadowRoot.querySelector('button, [role="button"], cr-icon-button, cr-button');if(inner){target=inner}}await this.waitUntilNotDisabled_(target,id);const oldPointerCapture={setPointerCapture:target.setPointerCapture,hasPointerCapture:target.hasPointerCapture,releasePointerCapture:target.releasePointerCapture};{let hasCapture=null;target.setPointerCapture=id=>{hasCapture=id};target.hasPointerCapture=id=>id===hasCapture;target.releasePointerCapture=id=>{if(id===hasCapture){hasCapture=null}}}const bounds=target.getBoundingClientRect();target.dispatchEvent(new PointerEvent("pointerdown",{bubbles:true,composed:true,button:0,pointerId:1,isPrimary:true,buttons:1,clientX:bounds.left+bounds.width/2,clientY:bounds.top+bounds.height/2}));target.dispatchEvent(new PointerEvent("pointerup",{bubbles:true,composed:true,button:0,pointerId:1,isPrimary:true,buttons:0,clientX:bounds.left+bounds.width/2,clientY:bounds.top+bounds.height/2}));target.dispatchEvent(new MouseEvent("click",{bubbles:true,composed:true,button:0,detail:1,clientX:bounds.left+bounds.width/2,clientY:bounds.top+bounds.height/2}));target.setPointerCapture=oldPointerCapture.setPointerCapture;target.hasPointerCapture=oldPointerCapture.hasPointerCapture;target.releasePointerCapture=oldPointerCapture.releasePointerCapture;return{success:true}}focusElement_(id){const trackedElement=this.getDataForId_(id);if(!trackedElement){console.error(`TrackedElementManager: Focus failed, element not found: ${TrackedElementManager.idToString_(id)}`);return{success:false}}trackedElement.element.focus();return{success:true}}selectTab_(id,index){const trackedElement=this.getDataForId_(id);if(!trackedElement){console.error(`TrackedElementManager: SelectTab failed, element not found: ${TrackedElementManager.idToString_(id)}`);return{success:false}}const element=trackedElement.element;if(element.tagName==="CR-TABS"){element.selected=index;return{success:true}}const tabs=element.querySelectorAll('[role="tab"]');if(tabs.length>index){tabs[index].click();return{success:true}}const childTabs=element.children;if(childTabs.length>index){childTabs[index].click();return{success:true}}console.error(`TrackedElementManager: SelectTab failed, tab index ${index} not found in ${TrackedElementManager.idToString_(id)}`);return{success:false}}selectDropdownItem_(id,index){const trackedElement=this.getDataForId_(id);if(!trackedElement){console.error(`TrackedElementManager: SelectDropdownItem failed, element not found: ${TrackedElementManager.idToString_(id)}`);return{success:false}}const element=trackedElement.element;if(element instanceof HTMLSelectElement){if(index>=element.options.length){console.error(`TrackedElementManager: SelectDropdownItem failed, index ${index} out of bounds for ${TrackedElementManager.idToString_(id)}`);return{success:false}}element.selectedIndex=index;element.dispatchEvent(new Event("change",{bubbles:true}));return{success:true}}if(element.tagName==="CR-SELECT"){const select=element.shadowRoot?.querySelector("select");if(select&&index `}else{div.innerHTML=getTrustedHTML` `}const iconsets=div.querySelectorAll("cr-iconset");for(const iconset of iconsets){document.head.appendChild(iconset)}let instance$1=null;function getCss$1(){return instance$1||(instance$1=[...[getCss$T()],css`:host{--help-bubble-background:var(--color-feature-promo-bubble-background,var(--google-blue-700));--help-bubble-foreground:var(--color-feature-promo-bubble-foreground,var(--google-grey-200));--help-bubble-border-radius:12px;--help-bubble-close-button-icon-size:16px;--help-bubble-close-button-size:20px;--help-bubble-element-spacing:8px;--help-bubble-padding:20px;--help-bubble-font-weight:400;border-radius:var(--help-bubble-border-radius);box-shadow:0 6px 10px 4px rgba(60,64,67,0.15),0 2px 3px rgba(60,64,67,0.3);box-sizing:border-box;position:absolute;z-index:1}#arrow{--help-bubble-arrow-size:11.3px;--help-bubble-arrow-size-half:calc(var(--help-bubble-arrow-size) / 2);--help-bubble-arrow-diameter:16px;--help-bubble-arrow-radius:calc(var(--help-bubble-arrow-diameter) / 2);--help-bubble-arrow-edge-offset:22px;--help-bubble-arrow-offset:calc(var(--help-bubble-arrow-edge-offset) + var(--help-bubble-arrow-radius));--help-bubble-arrow-border-radius:2px;position:absolute}#inner-arrow{background-color:var(--help-bubble-background);height:var(--help-bubble-arrow-size);left:calc(0px - var(--help-bubble-arrow-size-half));position:absolute;top:calc(0px - var(--help-bubble-arrow-size-half));transform:rotate(45deg);width:var(--help-bubble-arrow-size);z-index:-1}#arrow.bottom-edge{bottom:0}#arrow.bottom-edge #inner-arrow{border-bottom-right-radius:var(--help-bubble-arrow-border-radius)}#arrow.top-edge{top:0}#arrow.top-edge #inner-arrow{border-top-left-radius:var(--help-bubble-arrow-border-radius)}#arrow.right-edge{right:0}#arrow.right-edge #inner-arrow{border-top-right-radius:var(--help-bubble-arrow-border-radius)}#arrow.left-edge{left:0}#arrow.left-edge #inner-arrow{border-bottom-left-radius:var(--help-bubble-arrow-border-radius)}#arrow.top-position{top:var(--help-bubble-arrow-offset)}#arrow.vertical-center-position{top:50%}#arrow.bottom-position{bottom:var(--help-bubble-arrow-offset)}#arrow.left-position{left:var(--help-bubble-arrow-offset)}#arrow.horizontal-center-position{left:50%}#arrow.right-position{right:var(--help-bubble-arrow-offset)}#topContainer{display:flex;flex-direction:row}#progress{display:inline-block;flex:auto}#progress div{--help-bubble-progress-size:8px;background-color:var(--help-bubble-foreground);border:1px solid var(--help-bubble-foreground);border-radius:50%;display:inline-block;height:var(--help-bubble-progress-size);margin-inline-end:var(--help-bubble-element-spacing);margin-top:5px;width:var(--help-bubble-progress-size)}#progress .total-progress{background-color:var(--help-bubble-background)}#topBody,#mainBody{flex:1;font-size:14px;font-style:normal;font-weight:var(--help-bubble-font-weight);letter-spacing:0.3px;line-height:20px;margin:0}#title{flex:1;font-size:18px;font-style:normal;font-weight:500;line-height:24px;margin:0}.help-bubble{--cr-focus-outline-color:var(--help-bubble-foreground);background-color:var(--help-bubble-background);border-radius:var(--help-bubble-border-radius);box-sizing:border-box;color:var(--help-bubble-foreground);display:flex;flex-direction:column;justify-content:space-between;max-width:350px;min-width:200px;padding:var(--help-bubble-padding);position:relative}#main{display:flex;flex-direction:row;justify-content:flex-start;margin-top:var(--help-bubble-element-spacing)}#middleRowSpacer{margin-inline-start:32px}cr-icon-button,cr-button{--help-bubble-button-foreground:var(--help-bubble-foreground);--help-bubble-button-background:var(--help-bubble-background);--help-bubble-button-hover-alpha:10%}cr-button.default-button{--help-bubble-button-foreground:var(--color-feature-promo-bubble-default-button-foreground,var(--help-bubble-background));--help-bubble-button-background:var(--color-feature-promo-bubble-default-button-background,var(--help-bubble-foreground));--help-bubble-button-hover-alpha:6%}@media (prefers-color-scheme:dark){cr-icon-button,cr-button{--help-bubble-button-hover-alpha:6%}cr-button.default-button{--help-bubble-button-hover-alpha:10%}}cr-icon-button:hover,#buttons cr-button:hover{background-color:color-mix(in srgb,var(--help-bubble-button-foreground) var(--help-bubble-button-hover-alpha),var(--help-bubble-button-background))}cr-icon-button{--cr-icon-button-fill-color:var(--help-bubble-button-foreground);--cr-icon-button-icon-size:var(--help-bubble-close-button-icon-size);--cr-icon-button-size:var(--help-bubble-close-button-size);--cr-icon-button-stroke-color:var(--help-bubble-button-foreground);box-sizing:border-box;display:block;flex:none;float:right;height:var(--cr-icon-button-size);margin:0;margin-inline-start:var(--help-bubble-element-spacing);order:2;width:var(--cr-icon-button-size)}cr-icon-button:focus-visible:focus{box-shadow:inset 0 0 0 1px var(--cr-focus-outline-color)}#bodyIcon{--help-bubble-body-icon-image-size:18px;--help-bubble-body-icon-size:24px;--iron-icon-height:var(--help-bubble-body-icon-image-size);--iron-icon-width:var(--help-bubble-body-icon-image-size);background-color:var(--help-bubble-foreground);border-radius:50%;box-sizing:border-box;color:var(--help-bubble-background);height:var(--help-bubble-body-icon-size);margin-inline-end:var(--help-bubble-element-spacing);padding:calc((var(--help-bubble-body-icon-size) - var(--help-bubble-body-icon-image-size)) / 2);text-align:center;width:var(--help-bubble-body-icon-size)}#bodyIcon cr-icon{display:block}#buttons{display:flex;flex-direction:row;justify-content:flex-end;margin-top:16px}#buttons cr-button{--cr-button-border-color:var(--help-bubble-foreground);--cr-button-text-color:var(--help-bubble-button-foreground);--cr-button-background-color:var(--help-bubble-button-background)}#buttons cr-button:focus{box-shadow:none;outline:2px solid var(--cr-focus-outline-color);outline-offset:1px}#buttons cr-button:not(:first-child){margin-inline-start:var(--help-bubble-element-spacing)}`])}function getHtml$1(){return html`
${this.progressData_.map(((_item,index)=>html`
`))}

${this.titleText}

${this.bodyText}

${this.bodyText}

${this.sortedButtons.map((item=>html` ${item.text}`))}
`}const ACTION_BUTTON_ID_PREFIX="action-button-";const HELP_BUBBLE_DISMISSED_EVENT="help-bubble-dismissed";const HELP_BUBBLE_TIMED_OUT_EVENT="help-bubble-timed-out";const HELP_BUBBLE_SCROLL_ANCHOR_OPTIONS={behavior:"smooth",block:"center"};class HelpBubbleElement extends CrLitElement{static get is(){return"help-bubble"}static get styles(){return getCss$1()}render(){return getHtml$1.bind(this)()}static get properties(){return{nativeId:{type:String,reflect:true},secondaryId:{type:String,reflect:true},position:{type:Number,reflect:true},bodyIconName:{type:String},bodyIconAltText:{type:String},progress:{type:Object},titleText:{type:String},bodyText:{type:String},buttons:{type:Array},sortedButtons:{type:Array},closeButtonAltText:{type:String},closeButtonTabIndex:{type:Number},progressData_:{type:Array,state:true}}}#nativeId_accessor_storage="";get nativeId(){return this.#nativeId_accessor_storage}set nativeId(value){this.#nativeId_accessor_storage=value}#secondaryId_accessor_storage="";get secondaryId(){return this.#secondaryId_accessor_storage}set secondaryId(value){this.#secondaryId_accessor_storage=value}#bodyText_accessor_storage="";get bodyText(){return this.#bodyText_accessor_storage}set bodyText(value){this.#bodyText_accessor_storage=value}#titleText_accessor_storage="";get titleText(){return this.#titleText_accessor_storage}set titleText(value){this.#titleText_accessor_storage=value}#closeButtonAltText_accessor_storage="";get closeButtonAltText(){return this.#closeButtonAltText_accessor_storage}set closeButtonAltText(value){this.#closeButtonAltText_accessor_storage=value}#closeButtonTabIndex_accessor_storage=0;get closeButtonTabIndex(){return this.#closeButtonTabIndex_accessor_storage}set closeButtonTabIndex(value){this.#closeButtonTabIndex_accessor_storage=value}#position_accessor_storage=HelpBubbleArrowPosition.TOP_CENTER;get position(){return this.#position_accessor_storage}set position(value){this.#position_accessor_storage=value}#buttons_accessor_storage=[];get buttons(){return this.#buttons_accessor_storage}set buttons(value){this.#buttons_accessor_storage=value}#sortedButtons_accessor_storage=[];get sortedButtons(){return this.#sortedButtons_accessor_storage}set sortedButtons(value){this.#sortedButtons_accessor_storage=value}#progress_accessor_storage=null;get progress(){return this.#progress_accessor_storage}set progress(value){this.#progress_accessor_storage=value}#bodyIconName_accessor_storage=null;get bodyIconName(){return this.#bodyIconName_accessor_storage}set bodyIconName(value){this.#bodyIconName_accessor_storage=value}#bodyIconAltText_accessor_storage="";get bodyIconAltText(){return this.#bodyIconAltText_accessor_storage}set bodyIconAltText(value){this.#bodyIconAltText_accessor_storage=value}timeoutMs=null;timeoutTimerId=null;debouncedUpdate=null;padding={top:0,bottom:0,left:0,right:0};fixed=false;focusAnchor=false;buttonListObserver_=null;anchorElement_=null;#progressData__accessor_storage=[];get progressData_(){return this.#progressData__accessor_storage}set progressData_(value){this.#progressData__accessor_storage=value}resizeObserver_=null;willUpdate(changedProperties){super.willUpdate(changedProperties);if(changedProperties.has("buttons")){this.sortedButtons=this.buttons.toSorted(this.buttonSortFunc_)}}show(anchorElement){this.anchorElement_=anchorElement;if(this.progress){this.progressData_=new Array(this.progress.total);this.progressData_.fill(true)}else{this.progressData_=[]}this.closeButtonTabIndex=this.buttons.length?this.buttons.length+2:1;assert(this.anchorElement_,"Tried to show a help bubble but anchorElement does not exist");this.style.display="block";this.style.position=this.fixed?"fixed":"absolute";this.style.visibility="visible";this.removeAttribute("aria-hidden");this.updatePosition();if(this.timeoutMs!==null){const timedOutCallback=()=>{this.fire(HELP_BUBBLE_TIMED_OUT_EVENT,{nativeId:this.nativeId,secondaryId:this.secondaryId})};this.timeoutTimerId=setTimeout(timedOutCallback,this.timeoutMs)}}hide(){this.style.display="none";this.style.visibility="hidden";this.setAttribute("aria-hidden","true");this.anchorElement_=null;if(this.timeoutTimerId!==null){clearInterval(this.timeoutTimerId);this.timeoutTimerId=null}}getAnchorElement(){return this.anchorElement_}getButtonForTesting(buttonIndex){return this.$.buttons.querySelector(`[id="${ACTION_BUTTON_ID_PREFIX+buttonIndex}"]`)}focus(){const defaultButton=this.$.buttons.querySelector("cr-button.default-button")||this.$.buttons.querySelector("cr-button");if(defaultButton){defaultButton.focus();return}this.$.close.focus();if(this.anchorElement_&&this.focusAnchor){this.anchorElement_.focus()}}static isDefaultButtonLeading(){return isWindows}onCloseButtonClick_(){this.dismiss_()}dismiss_(){assert(this.nativeId,"Dismiss: expected help bubble to have a native id.");this.fire(HELP_BUBBLE_DISMISSED_EVENT,{nativeId:this.nativeId,secondaryId:this.secondaryId,fromActionButton:false})}onKeydown_(e){if(e.key==="Escape"){e.stopPropagation();this.dismiss_()}}onHelpBubbleClick_(e){e.stopPropagation()}getProgressClass_(index){return index-1);return ACTION_BUTTON_ID_PREFIX+index}getButtonClass_(isDefault){return isDefault?"default-button focus-outline-visible":"focus-outline-visible"}getButtonTabIndex_(item){const index=this.buttons.indexOf(item);assert(index>-1);return item.isDefault?1:index+2}buttonSortFunc_(button1,button2){if(button1.isDefault){return isWindows?-1:1}if(button2.isDefault){return isWindows?1:-1}return 0}getArrowClass_(){let classList="";switch(this.position){case HelpBubbleArrowPosition.TOP_LEFT:case HelpBubbleArrowPosition.TOP_CENTER:case HelpBubbleArrowPosition.TOP_RIGHT:classList="top-edge ";break;case HelpBubbleArrowPosition.BOTTOM_LEFT:case HelpBubbleArrowPosition.BOTTOM_CENTER:case HelpBubbleArrowPosition.BOTTOM_RIGHT:classList="bottom-edge ";break;case HelpBubbleArrowPosition.LEFT_TOP:case HelpBubbleArrowPosition.LEFT_CENTER:case HelpBubbleArrowPosition.LEFT_BOTTOM:classList="left-edge ";break;case HelpBubbleArrowPosition.RIGHT_TOP:case HelpBubbleArrowPosition.RIGHT_CENTER:case HelpBubbleArrowPosition.RIGHT_BOTTOM:classList="right-edge ";break;default:assertNotReached("Unknown help bubble position: "+this.position)}switch(this.position){case HelpBubbleArrowPosition.TOP_LEFT:case HelpBubbleArrowPosition.BOTTOM_LEFT:classList+="left-position";break;case HelpBubbleArrowPosition.TOP_CENTER:case HelpBubbleArrowPosition.BOTTOM_CENTER:classList+="horizontal-center-position";break;case HelpBubbleArrowPosition.TOP_RIGHT:case HelpBubbleArrowPosition.BOTTOM_RIGHT:classList+="right-position";break;case HelpBubbleArrowPosition.LEFT_TOP:case HelpBubbleArrowPosition.RIGHT_TOP:classList+="top-position";break;case HelpBubbleArrowPosition.LEFT_CENTER:case HelpBubbleArrowPosition.RIGHT_CENTER:classList+="vertical-center-position";break;case HelpBubbleArrowPosition.LEFT_BOTTOM:case HelpBubbleArrowPosition.RIGHT_BOTTOM:classList+="bottom-position";break;default:assertNotReached("Unknown help bubble position: "+this.position)}return classList}updatePosition(){assert(this.anchorElement_,"Update position: expected valid anchor element.");const ANCHOR_OFFSET=16;const ARROW_WIDTH=16;const ARROW_OFFSET_FROM_EDGE=22+ARROW_WIDTH/2;const anchorRect=this.anchorElement_.getBoundingClientRect();const anchorRectCenter={x:anchorRect.left+anchorRect.width/2,y:anchorRect.top+anchorRect.height/2};const helpBubbleRect=this.getBoundingClientRect();let offsetX=this.anchorElement_.offsetLeft;let offsetY=this.anchorElement_.offsetTop;switch(this.position){case HelpBubbleArrowPosition.TOP_LEFT:case HelpBubbleArrowPosition.TOP_CENTER:case HelpBubbleArrowPosition.TOP_RIGHT:offsetY+=anchorRect.height+ANCHOR_OFFSET+this.padding.bottom;break;case HelpBubbleArrowPosition.BOTTOM_LEFT:case HelpBubbleArrowPosition.BOTTOM_CENTER:case HelpBubbleArrowPosition.BOTTOM_RIGHT:offsetY-=helpBubbleRect.height+ANCHOR_OFFSET+this.padding.top;break;case HelpBubbleArrowPosition.LEFT_TOP:case HelpBubbleArrowPosition.LEFT_CENTER:case HelpBubbleArrowPosition.LEFT_BOTTOM:offsetX+=anchorRect.width+ANCHOR_OFFSET+this.padding.right;break;case HelpBubbleArrowPosition.RIGHT_TOP:case HelpBubbleArrowPosition.RIGHT_CENTER:case HelpBubbleArrowPosition.RIGHT_BOTTOM:offsetX-=helpBubbleRect.width+ANCHOR_OFFSET+this.padding.left;break;default:assertNotReached()}switch(this.position){case HelpBubbleArrowPosition.TOP_LEFT:case HelpBubbleArrowPosition.BOTTOM_LEFT:if(anchorRect.left+ARROW_OFFSET_FROM_EDGE>anchorRectCenter.x){offsetX+=anchorRect.width/2-ARROW_OFFSET_FROM_EDGE}break;case HelpBubbleArrowPosition.TOP_CENTER:case HelpBubbleArrowPosition.BOTTOM_CENTER:offsetX+=anchorRect.width/2-helpBubbleRect.width/2;break;case HelpBubbleArrowPosition.TOP_RIGHT:case HelpBubbleArrowPosition.BOTTOM_RIGHT:if(anchorRect.right-ARROW_OFFSET_FROM_EDGEanchorRectCenter.y){offsetY+=anchorRect.height/2-ARROW_OFFSET_FROM_EDGE}break;case HelpBubbleArrowPosition.LEFT_CENTER:case HelpBubbleArrowPosition.RIGHT_CENTER:offsetY+=anchorRect.height/2-helpBubbleRect.height/2;break;case HelpBubbleArrowPosition.LEFT_BOTTOM:case HelpBubbleArrowPosition.RIGHT_BOTTOM:if(anchorRect.bottom-ARROW_OFFSET_FROM_EDGE0)}assert(!this.bubble_.progress||this.bubble_.progress.total>=this.bubble_.progress.current);assert(this.root_);if(getComputedStyle(this.anchor_).getPropertyValue("position")==="fixed"){this.bubble_.fixed=true}const container=this.options_.containerElement;if(container){container.appendChild(this.bubble_)}else{this.anchor_.parentNode.insertBefore(this.bubble_,this.anchor_)}return this.bubble_}setAnchorHighlight_(highlight){assert(this.anchor_,"Set anchor highlight: expected valid anchor element.");this.anchor_.classList.toggle(ANCHOR_HIGHLIGHT_CLASS,highlight);if(highlight){(this.bubble_||this.anchor_).focus();this.anchor_.scrollIntoView(HELP_BUBBLE_SCROLL_ANCHOR_OPTIONS)}}}class HelpBubbleMixinCommon{helpBubbleProxy_;host_;isConnected_=false;helpBubbleControllerById_=new Map;helpBubbleListenerIds_=[];helpBubbleDismissedEventTracker_=new EventTracker;constructor(proxy,host){assert(proxy);assert(host);this.helpBubbleProxy_=proxy;this.host_=host}get controllers(){return Array.from(this.helpBubbleControllerById_.values())}onConnected(){const router=this.helpBubbleProxy_.callbackRouter;this.helpBubbleListenerIds_.push(router.showHelpBubble.addListener(this.onShowHelpBubble_.bind(this)),router.toggleFocusForAccessibility.addListener(this.onToggleHelpBubbleFocusForAccessibility_.bind(this)),router.hideHelpBubble.addListener(this.onHideHelpBubble_.bind(this)),router.externalHelpBubbleUpdated.addListener(this.onExternalHelpBubbleUpdated_.bind(this)));this.controllers.forEach((ctrl=>this.observeControllerAnchor_(ctrl,ctrl.getOptions())));this.isConnected_=true}onDisconnected(){this.isConnected_=false;for(const listenerId of this.helpBubbleListenerIds_){this.helpBubbleProxy_.callbackRouter.removeListener(listenerId)}this.helpBubbleListenerIds_=[];this.helpBubbleDismissedEventTracker_.removeAll();for(const nativeId of this.helpBubbleControllerById_.keys()){this.unregisterHelpBubble(nativeId)}this.helpBubbleControllerById_.clear()}registerHelpBubble(nativeId,trackable,options={}){if(this.helpBubbleControllerById_.has(nativeId)){const ctrl=this.helpBubbleControllerById_.get(nativeId);if(ctrl&&ctrl.isBubbleShowing()){return false}this.unregisterHelpBubble(nativeId)}const controller=new HelpBubbleController(nativeId,this.host_.shadowRoot);controller.track(trackable,options);this.helpBubbleControllerById_.set(nativeId,controller);if(this.isConnected_){this.observeControllerAnchor_(controller,options)}return true}unregisterHelpBubble(nativeId){const ctrl=this.helpBubbleControllerById_.get(nativeId);if(ctrl&&ctrl.hasAnchor()){this.unobserveControllerAnchor_(ctrl)}this.helpBubbleControllerById_.delete(nativeId)}observeControllerAnchor_(controller,options){const anchor=controller.getAnchor();TrackedElementManager.getInstance().startTracking(anchor,controller.getNativeId(),options,this.onAnchorVisibilityChanged_.bind(this))}unobserveControllerAnchor_(controller){const anchor=controller.getAnchor();TrackedElementManager.getInstance().stopTracking(anchor)}isHelpBubbleShowing(){return this.controllers.some((ctrl=>ctrl.isBubbleShowing()))}isHelpBubbleShowingForTesting(target){const controllers=this.controllers.filter(this.filterControllersForTesting_(target));return!!controllers[0]}getHelpBubbleForTesting(target){const controllers=this.controllers.filter(this.filterControllersForTesting_(target));return controllers[0]?controllers[0].getBubble():null}static matchesAnchor_(ctrl,target){const anchor=ctrl.getAnchor();if(!anchor){return false}if(target instanceof HTMLElement){return anchor===target}return anchor.id===target||ctrl.getNativeId()===target}filterControllersForTesting_(target){return ctrl=>ctrl.isBubbleShowing()&&HelpBubbleMixinCommon.matchesAnchor_(ctrl,target)}getSortedAnchorStatusesForTesting(){return this.controllers.sort(((a,b)=>a.getNativeId().localeCompare(b.getNativeId()))).map((ctrl=>[ctrl.getNativeId(),ctrl.hasAnchor()]))}canShowHelpBubble(anchorId){const controller=this.helpBubbleControllerById_.get(anchorId);if(!controller){return false}if(!controller.canShowBubble()){return false}const anchor=controller.getAnchor();const anchorIsUsed=this.controllers.some((otherCtrl=>otherCtrl.isBubbleShowing()&&otherCtrl.getAnchor()===anchor));return!anchorIsUsed}showHelpBubble(params){assert(this.canShowHelpBubble(params.id.nativeIdentifier),"Can't show help bubble");const controller=this.helpBubbleControllerById_.get(params.id.nativeIdentifier);const bubble=controller.createBubble(params);this.helpBubbleDismissedEventTracker_.add(bubble,HELP_BUBBLE_DISMISSED_EVENT,this.onHelpBubbleDismissed_.bind(this));this.helpBubbleDismissedEventTracker_.add(bubble,HELP_BUBBLE_TIMED_OUT_EVENT,this.onHelpBubbleTimedOut_.bind(this));controller.show()}hideHelpBubble(nativeId){const ctrl=this.helpBubbleControllerById_.get(nativeId);if(!ctrl||!ctrl.hasBubble()){return false}this.helpBubbleDismissedEventTracker_.remove(ctrl.getBubble(),HELP_BUBBLE_DISMISSED_EVENT);this.helpBubbleDismissedEventTracker_.remove(ctrl.getBubble(),HELP_BUBBLE_TIMED_OUT_EVENT);ctrl.hide();return true}notifyHelpBubbleAnchorActivated(nativeId){const ctrl=this.helpBubbleControllerById_.get(nativeId);if(!ctrl||!ctrl.isBubbleShowing()){return false}const anchor=ctrl.getAnchor();TrackedElementManager.getInstance().notifyElementActivated(anchor);return true}notifyHelpBubbleAnchorCustomEvent(nativeId,customEvent){const ctrl=this.helpBubbleControllerById_.get(nativeId);if(!ctrl||!ctrl.isBubbleShowing()){return false}const anchor=ctrl.getAnchor();if(anchor){TrackedElementManager.getInstance().notifyCustomEvent(anchor,customEvent)}return true}onAnchorVisibilityChanged_(update){const id=TrackedElementManager.getElementId(update.element);assert(id,"Got visibility event for element without an identifier.");const ctrl=this.helpBubbleControllerById_.get(id.nativeIdentifier);if(!ctrl||ctrl.getAnchor()!==update.element){return}if(!update.visible){const hidden=this.hideHelpBubble(id.nativeIdentifier);if(hidden){this.helpBubbleProxy_.handler.helpBubbleClosed(id,HelpBubbleClosedReason.kPageChanged)}}if(ctrl){ctrl.updateAnchorVisibility(update.visible,update.bounds)}}onShowHelpBubble_(params){if(!this.helpBubbleControllerById_.has(params.id.nativeIdentifier)){return}this.showHelpBubble(params)}onToggleHelpBubbleFocusForAccessibility_(id){if(!this.helpBubbleControllerById_.has(id.nativeIdentifier)){return}const ctrl=this.helpBubbleControllerById_.get(id.nativeIdentifier);if(ctrl){const anchor=ctrl.getAnchor();if(anchor){anchor.focus()}}}onHideHelpBubble_(id){this.hideHelpBubble(id.nativeIdentifier)}onExternalHelpBubbleUpdated_(id,shown){if(!this.helpBubbleControllerById_.has(id.nativeIdentifier)){return}const ctrl=this.helpBubbleControllerById_.get(id.nativeIdentifier);ctrl.updateExternalShowingStatus(shown)}onHelpBubbleDismissed_(e){const nativeIdentifier=e.detail.nativeId;const secondaryIdentifier=e.detail.secondaryId;assert(nativeIdentifier);assert(secondaryIdentifier);const hidden=this.hideHelpBubble(nativeIdentifier);assert(hidden);if(e.detail.fromActionButton){this.helpBubbleProxy_.handler.helpBubbleButtonPressed({nativeIdentifier:nativeIdentifier,secondaryIdentifier:secondaryIdentifier},e.detail.buttonIndex)}else{this.helpBubbleProxy_.handler.helpBubbleClosed({nativeIdentifier:nativeIdentifier,secondaryIdentifier:secondaryIdentifier},HelpBubbleClosedReason.kDismissedByUser)}}onHelpBubbleTimedOut_(e){const nativeIdentifier=e.detail.nativeId;const secondaryIdentifier=e.detail.secondaryId;assert(nativeIdentifier);assert(secondaryIdentifier);const hidden=this.hideHelpBubble(nativeIdentifier);assert(hidden);this.helpBubbleProxy_.handler.helpBubbleClosed({nativeIdentifier:nativeIdentifier,secondaryIdentifier:secondaryIdentifier},HelpBubbleClosedReason.kTimedOut)}}const HelpBubbleMixinLit=superClass=>{class HelpBubbleMixinLit extends superClass{impl_;constructor(...args){super(...args);this.impl_=new HelpBubbleMixinCommon(this.createHelpBubbleProxy(),this)}createHelpBubbleProxy(){return browserProxyFactory$1.getInstance()}connectedCallback(){super.connectedCallback();this.impl_.onConnected()}disconnectedCallback(){super.disconnectedCallback();this.impl_.onDisconnected()}registerHelpBubble(nativeId,trackable,options={}){return this.impl_.registerHelpBubble(nativeId,trackable,options)}unregisterHelpBubble(nativeId){this.impl_.unregisterHelpBubble(nativeId)}isHelpBubbleShowing(){return this.impl_.isHelpBubbleShowing()}isHelpBubbleShowingForTesting(target){return this.impl_.isHelpBubbleShowingForTesting(target)}getHelpBubbleForTesting(target){return this.impl_.getHelpBubbleForTesting(target)}getSortedAnchorStatusesForTesting(){return this.impl_.getSortedAnchorStatusesForTesting()}canShowHelpBubble(anchorId){return this.impl_.canShowHelpBubble(anchorId)}showHelpBubble(params){this.impl_.showHelpBubble(params)}hideHelpBubble(nativeId){return this.impl_.hideHelpBubble(nativeId)}notifyHelpBubbleAnchorActivated(nativeId){return this.impl_.notifyHelpBubbleAnchorActivated(nativeId)}notifyHelpBubbleAnchorCustomEvent(nativeId,customEvent){return this.impl_.notifyHelpBubbleAnchorCustomEvent(nativeId,customEvent)}}return HelpBubbleMixinLit};class KeyboardShortcut{useKeyCode_=false;mods_={};key_=null;keyCode_=null;constructor(shortcut){shortcut.split("|").forEach((part=>{const partLc=part.toLowerCase();switch(partLc){case"alt":case"ctrl":case"meta":case"shift":this.mods_[partLc+"Key"]=true;break;default:if(this.key_){throw Error("Invalid shortcut")}this.key_=part;if(part.match(/^[a-z]$/)){this.useKeyCode_=true;this.keyCode_=part.toUpperCase().charCodeAt(0)}}}))}matchesEvent(e){if(this.useKeyCode_&&e.keyCode===this.keyCode_||e.key===this.key_){const mods=this.mods_;return["altKey","ctrlKey","metaKey","shiftKey"].every((function(k){return e[k]===!!mods[k]}))}return false}}class KeyboardShortcutList{shortcuts_;constructor(shortcuts){this.shortcuts_=shortcuts.split(/\s+/).map((function(shortcut){return new KeyboardShortcut(shortcut)}))}matchesEvent(e){return this.shortcuts_.some((function(keyboardShortcut){return keyboardShortcut.matchesEvent(e)}))}}const FindShortcutManager=(()=>{const listeners=[];let modalContextOpen=false;const shortcutCtrlF=new KeyboardShortcutList(isMac?"meta|f":"ctrl|f");const shortcutSlash=new KeyboardShortcutList("/");window.addEventListener("keydown",(e=>{if(e.defaultPrevented||listeners.length===0){return}const element=e.composedPath()[0];if(!shortcutCtrlF.matchesEvent(e)&&(element.tagName==="INPUT"||element.tagName==="TEXTAREA"||!shortcutSlash.matchesEvent(e))){return}const focusIndex=listeners.findIndex((listener=>listener.searchInputHasFocus()));const index=focusIndex<=0?listeners.length-1:focusIndex-1;if(listeners[index].handleFindShortcut(modalContextOpen)){e.preventDefault()}}));window.addEventListener("cr-dialog-open",(()=>{modalContextOpen=true}));window.addEventListener("cr-drawer-opened",(()=>{modalContextOpen=true}));window.addEventListener("close",(e=>{if(["CR-DIALOG","CR-DRAWER"].includes(e.composedPath()[0].nodeName)){modalContextOpen=false}}));return Object.freeze({listeners:listeners})})();const FindShortcutMixinLit=superClass=>{class FindShortcutMixinLit extends superClass{findShortcutListenOnAttach=true;connectedCallback(){super.connectedCallback();if(this.findShortcutListenOnAttach){this.becomeActiveFindShortcutListener()}}disconnectedCallback(){super.disconnectedCallback();if(this.findShortcutListenOnAttach){this.removeSelfAsFindShortcutListener()}}becomeActiveFindShortcutListener(){const listeners=FindShortcutManager.listeners;assert(!listeners.includes(this),"Already listening for find shortcuts.");listeners.push(this)}handleFindShortcutInternal_(){assertNotReached("Must override handleFindShortcut()")}handleFindShortcut(_modalContextOpen){this.handleFindShortcutInternal_();return false}removeSelfAsFindShortcutListener(){const listeners=FindShortcutManager.listeners;const index=listeners.indexOf(this);assert(listeners.includes(this),"Find shortcut listener not found.");listeners.splice(index,1)}searchInputHasFocusInternal_(){assertNotReached("Must override searchInputHasFocus()")}searchInputHasFocus(){this.searchInputHasFocusInternal_();return false}}return FindShortcutMixinLit};const FeaturePromoFeatureUsedActionSpec={$:mojo.internal.Enum()};var FeaturePromoFeatureUsedAction;(function(FeaturePromoFeatureUsedAction){FeaturePromoFeatureUsedAction[FeaturePromoFeatureUsedAction["MIN_VALUE"]=0]="MIN_VALUE";FeaturePromoFeatureUsedAction[FeaturePromoFeatureUsedAction["MAX_VALUE"]=1]="MAX_VALUE";FeaturePromoFeatureUsedAction[FeaturePromoFeatureUsedAction["kClosePromoIfPresent"]=0]="kClosePromoIfPresent";FeaturePromoFeatureUsedAction[FeaturePromoFeatureUsedAction["kIgnorePromoIfPresent"]=1]="kIgnorePromoIfPresent"})(FeaturePromoFeatureUsedAction||(FeaturePromoFeatureUsedAction={}));class UserEducationMixedTrustHandlerFactoryPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"user_education.mojom.UserEducationMixedTrustHandlerFactory",scope)}}class UserEducationMixedTrustHandlerFactoryRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(UserEducationMixedTrustHandlerFactoryPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}createUserEducationMixedTrustHandler(handler){this.proxy.sendMessage(1723905981,UserEducationMixedTrustHandlerFactory_CreateUserEducationMixedTrustHandler_ParamsSpec.$,null,[handler],false)}}class UserEducationMixedTrustHandlerFactory{static get $interfaceName(){return"user_education.mojom.UserEducationMixedTrustHandlerFactory"}static getRemote(){let remote=new UserEducationMixedTrustHandlerFactoryRemote;remote.$.bindNewPipeAndPassReceiver().bindInBrowser();return remote}}class UserEducationMixedTrustHandlerPendingReceiver{handle;constructor(handle){this.handle=mojo.internal.interfaceSupport.getEndpointForReceiver(handle)}bindInBrowser(scope="context"){mojo.internal.interfaceSupport.bind(this.handle,"user_education.mojom.UserEducationMixedTrustHandler",scope)}}class UserEducationMixedTrustHandlerRemote{proxy;$;onConnectionError;constructor(handle){this.proxy=new mojo.internal.interfaceSupport.InterfaceRemoteBase(UserEducationMixedTrustHandlerPendingReceiver,handle);this.$=new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);this.onConnectionError=this.proxy.getConnectionErrorEventRouter()}maybeShowFeaturePromo(params){this.proxy.sendMessage(833740054,UserEducationMixedTrustHandler_MaybeShowFeaturePromo_ParamsSpec.$,null,[params],false)}notifyFeaturePromoFeatureUsed(featureName,action){this.proxy.sendMessage(1122367579,UserEducationMixedTrustHandler_NotifyFeaturePromoFeatureUsed_ParamsSpec.$,null,[featureName,action],false)}notifyAdditionalConditionEvent(eventName){this.proxy.sendMessage(143662005,UserEducationMixedTrustHandler_NotifyAdditionalConditionEvent_ParamsSpec.$,null,[eventName],false)}notifyNewBadgeFeatureUsed(featureName){this.proxy.sendMessage(862972908,UserEducationMixedTrustHandler_NotifyNewBadgeFeatureUsed_ParamsSpec.$,null,[featureName],false)}maybeShowNewBadgeFor(featureName){return this.proxy.sendMessage(398413198,UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ParamsSpec.$,UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ResponseParamsSpec.$,[featureName],false)}}const FeaturePromoParamsSpec={$:{}};const UserEducationMixedTrustHandlerFactory_CreateUserEducationMixedTrustHandler_ParamsSpec={$:{}};const UserEducationMixedTrustHandler_MaybeShowFeaturePromo_ParamsSpec={$:{}};const UserEducationMixedTrustHandler_NotifyFeaturePromoFeatureUsed_ParamsSpec={$:{}};const UserEducationMixedTrustHandler_NotifyAdditionalConditionEvent_ParamsSpec={$:{}};const UserEducationMixedTrustHandler_NotifyNewBadgeFeatureUsed_ParamsSpec={$:{}};const UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ParamsSpec={$:{}};const UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ResponseParamsSpec={$:{}};mojo.internal.Struct(FeaturePromoParamsSpec.$,"FeaturePromoParams",[mojo.internal.StructField("featureName",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("key",8,0,mojo.internal.String,null,true,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(UserEducationMixedTrustHandlerFactory_CreateUserEducationMixedTrustHandler_ParamsSpec.$,"UserEducationMixedTrustHandlerFactory_CreateUserEducationMixedTrustHandler_Params",[mojo.internal.StructField("handler",0,0,mojo.internal.InterfaceRequest(UserEducationMixedTrustHandlerPendingReceiver),null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(UserEducationMixedTrustHandler_MaybeShowFeaturePromo_ParamsSpec.$,"UserEducationMixedTrustHandler_MaybeShowFeaturePromo_Params",[mojo.internal.StructField("params",0,0,FeaturePromoParamsSpec.$,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(UserEducationMixedTrustHandler_NotifyFeaturePromoFeatureUsed_ParamsSpec.$,"UserEducationMixedTrustHandler_NotifyFeaturePromoFeatureUsed_Params",[mojo.internal.StructField("featureName",0,0,mojo.internal.String,null,false,0,undefined,undefined),mojo.internal.StructField("action",8,0,FeaturePromoFeatureUsedActionSpec.$,0,false,0,undefined,undefined)],[[0,24]]);mojo.internal.Struct(UserEducationMixedTrustHandler_NotifyAdditionalConditionEvent_ParamsSpec.$,"UserEducationMixedTrustHandler_NotifyAdditionalConditionEvent_Params",[mojo.internal.StructField("eventName",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(UserEducationMixedTrustHandler_NotifyNewBadgeFeatureUsed_ParamsSpec.$,"UserEducationMixedTrustHandler_NotifyNewBadgeFeatureUsed_Params",[mojo.internal.StructField("featureName",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ParamsSpec.$,"UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_Params",[mojo.internal.StructField("featureName",0,0,mojo.internal.String,null,false,0,undefined,undefined)],[[0,16]]);mojo.internal.Struct(UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ResponseParamsSpec.$,"UserEducationMixedTrustHandler_MaybeShowNewBadgeFor_ResponseParams",[mojo.internal.StructField("shouldShow",0,0,mojo.internal.Bool,false,false,0,undefined,undefined)],[[0,16]]);const browserProxyFactory=new MojoHandlerProxyFactory(UserEducationMixedTrustHandlerRemote,(receiver=>UserEducationMixedTrustHandlerFactory.getRemote().createUserEducationMixedTrustHandler(receiver)));let instance=null;function getCss(){return instance||(instance=[...[getCss$O(),getCss$f(),getCss$E()],css`:host{color:var(--cr-primary-text-color);display:flex;flex-direction:column;height:100%;line-height:1.54;overflow:hidden}:host([enable-history-embeddings_]){--first-card-padding-top:0;--first-cluster-padding-top:0}:host-context([webui-refresh-2026]){#tabs{border-color:var(--color-history-page-separator)}}#main-container{anchor-name:--main-container;display:flex;flex:1;overflow:hidden;position:relative}#content{flex:1;min-width:0}#content,#content>*{height:100%}#historyEmbeddingsDisclaimer{box-sizing:border-box;width:100%;margin:0 auto;padding:6px 10px 8px;color:var(--cr-secondary-text-color);font-size:11px;font-weight:400;text-wrap:pretty}#historyEmbeddingsDisclaimer[narrow]{padding-inline:24px;max-width:none}#historyEmbeddingsDisclaimer:not([narrow]) #historyEmbeddingsDisclaimerContent{max-width:680px}cr-history-embeddings-filter-chips{margin:0 auto;padding:16px 8px}cr-history-embeddings-filter-chips~#tabsContent{--first-card-padding-top:8px;--first-cluster-padding-top:8px}#tabsContainer{display:flex;flex-direction:column;--cr-tabs-height:48px;--tabs-margin-top:16px}#tabs{--cr-tabs-icon-margin-end:12px;--cr-tabs-selection-bar-width:3px;--cr-tabs-tab-inline-padding:16px;border-bottom:1px solid var(--separator-color);display:flex;justify-content:start;margin:0 auto;max-width:var(--cluster-max-width);width:100%}#tabsScrollContainer{overflow:auto;height:100%;scrollbar-gutter:stable}.cr-scrollable-top-shadow{position-anchor:--main-container}:host([has-history-embeddings-results_]) history-list[is-empty],:host([has-history-embeddings-results_]) history-clusters[is-empty]{display:none}cr-history-embeddings{margin-block-end:var(--card-padding-between)}`])}function getHtml(){return html`
$i18n{historyEmbeddingsDisclaimer} $i18n{learnMore}
${this.showTabs_?html`
`:""} ${this.showFilterChips_()?html` `:""}
${this.shouldShowHistoryPageHistorySyncPromo_()?html`
`:""}
${this.enableHistoryEmbeddings_?html`
${this.shouldShowHistoryEmbeddings_()?html` `:""}
`:""} ${this.historyClustersSelected_()?html` `:""}
${this.syncedTabsSelected_()?html`
`:""}
`}function onDocumentClick(evt){const e=evt;if(e.button>1||e.defaultPrevented){return}const eventPath=e.composedPath();let anchor=null;if(eventPath){for(const element of eventPath){if(element.tagName==="A"&&element.href){anchor=element;break}}}let el=e.target;if(!anchor&&el.nodeType===Node.ELEMENT_NODE&&el.webkitMatchesSelector("A, A *")){while(el.tagName!=="A"){el=el.parentElement}anchor=el}if(!anchor){return}if((anchor.protocol==="file:"||anchor.protocol==="about:")&&(e.button===0||e.button===1)){BrowserProxyImpl.getInstance().navigateToUrl(anchor.href,anchor.target,e);e.preventDefault()}}const HistoryAppElementBase=HelpBubbleMixinLit(FindShortcutMixinLit(WebUiListenerMixinLit(CrLitElement)));class HistoryAppElement extends HistoryAppElementBase{static get is(){return"history-app"}static get styles(){return getCss()}render(){return getHtml.bind(this)()}static get properties(){return{enableHistoryEmbeddings_:{type:Boolean,reflect:true},unoPhase2FollowUpEnabled_:{type:Boolean},shouldShowHistorySyncPromo_:{type:Boolean},shouldShowHistoryCrossDeviceSigninPromo_:{type:Boolean},contentPage_:{type:String},tabsContentPage_:{type:String},selectedPage_:{type:String},queryResult_:{type:Object},sessionList_:{type:Array},identityState_:{type:Object},pendingDelete_:{type:Boolean},queryState_:{type:Object},hasDrawer_:{type:Boolean},footerInfo:{type:Object},historyClustersEnabled_:{type:Boolean},historyClustersVisible_:{type:Boolean},lastSelectedTab_:{type:Number},showHistoryClusters_:{type:Boolean,reflect:true},showTabs_:{type:Boolean},selectedTab_:{type:Number},tabsIcons_:{type:Array},tabsNames_:{type:Array},scrollTarget_:{type:Object},queryStateAfterDate_:{type:Object},hasHistoryEmbeddingsResults_:{type:Boolean,reflect:true},tabContentScrollOffset_:{type:Number},nonEmbeddingsResultClicked_:{type:Boolean},numCharsTypedInSearch_:{type:Number},historyEmbeddingsDisclaimerLinkClicked_:{type:Boolean},includeActorVisits_:{type:Boolean},includeUserVisits_:{type:Boolean},isBrowsingHistoryActorIntegrationM3Enabled_:{type:Boolean},isGlicWebActuationAvailable_:{type:Boolean}}}#footerInfo_accessor_storage={managed:loadTimeData.getBoolean("isManaged"),otherFormsOfHistory:false,geminiAppsActivity:loadTimeData.getBoolean("isGlicEnabled")};get footerInfo(){return this.#footerInfo_accessor_storage}set footerInfo(value){this.#footerInfo_accessor_storage=value}#enableHistoryEmbeddings__accessor_storage=loadTimeData.getBoolean("enableHistoryEmbeddings");get enableHistoryEmbeddings_(){return this.#enableHistoryEmbeddings__accessor_storage}set enableHistoryEmbeddings_(value){this.#enableHistoryEmbeddings__accessor_storage=value}#unoPhase2FollowUpEnabled__accessor_storage=loadTimeData.getBoolean("unoPhase2FollowUp");get unoPhase2FollowUpEnabled_(){return this.#unoPhase2FollowUpEnabled__accessor_storage}set unoPhase2FollowUpEnabled_(value){this.#unoPhase2FollowUpEnabled__accessor_storage=value}#shouldShowHistorySyncPromo__accessor_storage=false;get shouldShowHistorySyncPromo_(){return this.#shouldShowHistorySyncPromo__accessor_storage}set shouldShowHistorySyncPromo_(value){this.#shouldShowHistorySyncPromo__accessor_storage=value}#shouldShowHistoryCrossDeviceSigninPromo__accessor_storage=false;get shouldShowHistoryCrossDeviceSigninPromo_(){return this.#shouldShowHistoryCrossDeviceSigninPromo__accessor_storage}set shouldShowHistoryCrossDeviceSigninPromo_(value){this.#shouldShowHistoryCrossDeviceSigninPromo__accessor_storage=value}#hasDrawer__accessor_storage=false;get hasDrawer_(){return this.#hasDrawer__accessor_storage}set hasDrawer_(value){this.#hasDrawer__accessor_storage=value}#historyClustersEnabled__accessor_storage=loadTimeData.getBoolean("isHistoryClustersEnabled");get historyClustersEnabled_(){return this.#historyClustersEnabled__accessor_storage}set historyClustersEnabled_(value){this.#historyClustersEnabled__accessor_storage=value}#historyClustersVisible__accessor_storage=loadTimeData.getBoolean("isHistoryClustersVisible");get historyClustersVisible_(){return this.#historyClustersVisible__accessor_storage}set historyClustersVisible_(value){this.#historyClustersVisible__accessor_storage=value}#identityState__accessor_storage={signIn:HistorySignInState.SIGNED_OUT,tabsSync:SyncState.TURNED_OFF,historySync:SyncState.TURNED_OFF};get identityState_(){return this.#identityState__accessor_storage}set identityState_(value){this.#identityState__accessor_storage=value}#lastSelectedTab__accessor_storage=loadTimeData.getInteger("lastSelectedTab");get lastSelectedTab_(){return this.#lastSelectedTab__accessor_storage}set lastSelectedTab_(value){this.#lastSelectedTab__accessor_storage=value}#contentPage__accessor_storage=Page.HISTORY;get contentPage_(){return this.#contentPage__accessor_storage}set contentPage_(value){this.#contentPage__accessor_storage=value}#tabsContentPage__accessor_storage=Page.HISTORY;get tabsContentPage_(){return this.#tabsContentPage__accessor_storage}set tabsContentPage_(value){this.#tabsContentPage__accessor_storage=value}#pendingDelete__accessor_storage=false;get pendingDelete_(){return this.#pendingDelete__accessor_storage}set pendingDelete_(value){this.#pendingDelete__accessor_storage=value}#queryResult__accessor_storage={info:null,value:[]};get queryResult_(){return this.#queryResult__accessor_storage}set queryResult_(value){this.#queryResult__accessor_storage=value}#sessionList__accessor_storage=null;get sessionList_(){return this.#sessionList__accessor_storage}set sessionList_(value){this.#sessionList__accessor_storage=value}#queryState__accessor_storage={incremental:false,querying:false,searchTerm:"",after:null,includeUserVisits:true,includeActorVisits:true};get queryState_(){return this.#queryState__accessor_storage}set queryState_(value){this.#queryState__accessor_storage=value}#selectedPage__accessor_storage=Page.HISTORY;get selectedPage_(){return this.#selectedPage__accessor_storage}set selectedPage_(value){this.#selectedPage__accessor_storage=value}#selectedTab__accessor_storage=loadTimeData.getInteger("lastSelectedTab")||0;get selectedTab_(){return this.#selectedTab__accessor_storage}set selectedTab_(value){this.#selectedTab__accessor_storage=value}#showTabs__accessor_storage=false;get showTabs_(){return this.#showTabs__accessor_storage}set showTabs_(value){this.#showTabs__accessor_storage=value}#showHistoryClusters__accessor_storage=false;get showHistoryClusters_(){return this.#showHistoryClusters__accessor_storage}set showHistoryClusters_(value){this.#showHistoryClusters__accessor_storage=value}#tabsIcons__accessor_storage=[document.documentElement.hasAttribute("webui-rounded-icons")?"images/list.svg":"images/list_old.svg",document.documentElement.hasAttribute("webui-rounded-icons")?"chrome://resources/images/icon_journeys.svg":"chrome://resources/images/icon_journeys_old.svg"];get tabsIcons_(){return this.#tabsIcons__accessor_storage}set tabsIcons_(value){this.#tabsIcons__accessor_storage=value}#tabsNames__accessor_storage=[loadTimeData.getString("historyListTabLabel"),loadTimeData.getString("historyClustersTabLabel")];get tabsNames_(){return this.#tabsNames__accessor_storage}set tabsNames_(value){this.#tabsNames__accessor_storage=value}#scrollTarget__accessor_storage=document.body;get scrollTarget_(){return this.#scrollTarget__accessor_storage}set scrollTarget_(value){this.#scrollTarget__accessor_storage=value}#queryStateAfterDate__accessor_storage;get queryStateAfterDate_(){return this.#queryStateAfterDate__accessor_storage}set queryStateAfterDate_(value){this.#queryStateAfterDate__accessor_storage=value}#hasHistoryEmbeddingsResults__accessor_storage=false;get hasHistoryEmbeddingsResults_(){return this.#hasHistoryEmbeddingsResults__accessor_storage}set hasHistoryEmbeddingsResults_(value){this.#hasHistoryEmbeddingsResults__accessor_storage=value}#historyEmbeddingsDisclaimerLinkClicked__accessor_storage=false;get historyEmbeddingsDisclaimerLinkClicked_(){return this.#historyEmbeddingsDisclaimerLinkClicked__accessor_storage}set historyEmbeddingsDisclaimerLinkClicked_(value){this.#historyEmbeddingsDisclaimerLinkClicked__accessor_storage=value}#tabContentScrollOffset__accessor_storage=0;get tabContentScrollOffset_(){return this.#tabContentScrollOffset__accessor_storage}set tabContentScrollOffset_(value){this.#tabContentScrollOffset__accessor_storage=value}#numCharsTypedInSearch__accessor_storage=0;get numCharsTypedInSearch_(){return this.#numCharsTypedInSearch__accessor_storage}set numCharsTypedInSearch_(value){this.#numCharsTypedInSearch__accessor_storage=value}#nonEmbeddingsResultClicked__accessor_storage=false;get nonEmbeddingsResultClicked_(){return this.#nonEmbeddingsResultClicked__accessor_storage}set nonEmbeddingsResultClicked_(value){this.#nonEmbeddingsResultClicked__accessor_storage=value}#includeActorVisits__accessor_storage=true;get includeActorVisits_(){return this.#includeActorVisits__accessor_storage}set includeActorVisits_(value){this.#includeActorVisits__accessor_storage=value}#includeUserVisits__accessor_storage=true;get includeUserVisits_(){return this.#includeUserVisits__accessor_storage}set includeUserVisits_(value){this.#includeUserVisits__accessor_storage=value}#isBrowsingHistoryActorIntegrationM3Enabled__accessor_storage=loadTimeData.getBoolean("isBrowsingHistoryActorIntegrationM3Enabled");get isBrowsingHistoryActorIntegrationM3Enabled_(){return this.#isBrowsingHistoryActorIntegrationM3Enabled__accessor_storage}set isBrowsingHistoryActorIntegrationM3Enabled_(value){this.#isBrowsingHistoryActorIntegrationM3Enabled__accessor_storage=value}#isGlicWebActuationAvailable__accessor_storage=loadTimeData.getBoolean("isGlicWebActuationAvailable");get isGlicWebActuationAvailable_(){return this.#isGlicWebActuationAvailable__accessor_storage}set isGlicWebActuationAvailable_(value){this.#isGlicWebActuationAvailable__accessor_storage=value}callbackRouter_;foreignSessionCallbackRouter_;dataFromNativeBeforeInput_=null;eventTracker_=new EventTracker;historyClustersViewStartTime_=null;historyEmbeddingsResizeObserver_=null;lastRecordedSelectedPageHistogramValue_=HistoryPageViewHistogram.END;onForeignSessionsChangedListenerId_=null;onHasOtherFormsChangedListenerId_=null;constructor(){super();this.callbackRouter_=BrowserProxyImpl.getInstance().callbackRouter;this.foreignSessionCallbackRouter_=browserProxyFactory$2.getInstance().callbackRouter}connectedCallback(){super.connectedCallback();const enableWebuiRefresh2026=loadTimeData.getString("webuiRefresh2026")!=="";if(enableWebuiRefresh2026){this.addThemedColors_();ColorChangeUpdater.forDocument().start()}this.eventTracker_.add(document,"click",onDocumentClick);this.eventTracker_.add(document,"auxclick",onDocumentClick);this.eventTracker_.add(document,"keydown",(e=>this.onKeyDown_(e)));this.eventTracker_.add(document,"visibilitychange",this.onVisibilityChange_.bind(this));this.eventTracker_.add(document,"record-history-link-click",this.onRecordHistoryLinkClick_.bind(this));this.addWebUiListener("history-identity-state-changed",(identityState=>this.onIdentityStateChanged_(identityState)));this.onForeignSessionsChangedListenerId_=this.foreignSessionCallbackRouter_.onForeignSessionsChanged.addListener((sessionList=>this.setForeignSessions_(sessionList)));this.shadowRoot.querySelector("history-query-manager").initialize();browserProxyFactory$2.getInstance().handler.getForeignSessions().then((({sessions:sessions})=>this.setForeignSessions_(sessions)));BrowserProxyImpl.getInstance().getInitialIdentityState().then((identityState=>this.onIdentityStateChanged_(identityState)));const mediaQuery=window.matchMedia("(max-width: 1023px)");this.hasDrawer_=mediaQuery.matches;this.eventTracker_.add(mediaQuery,"change",(e=>this.hasDrawer_=e.matches));this.onHasOtherFormsChangedListenerId_=this.callbackRouter_.onHasOtherFormsChanged.addListener((hasOtherForms=>this.onHasOtherFormsChanged_(hasOtherForms)));BrowserProxyImpl.getInstance().handler.shouldShowHistoryPageHistorySyncPromo().then((({shouldShow:shouldShow})=>this.handleShouldShowHistoryPageHistorySyncPromoChanged_(shouldShow)))}disconnectedCallback(){super.disconnectedCallback();this.eventTracker_.removeAll();if(this.historyEmbeddingsResizeObserver_){this.historyEmbeddingsResizeObserver_.disconnect();this.historyEmbeddingsResizeObserver_=null}if(this.onHasOtherFormsChangedListenerId_!==null){this.callbackRouter_.removeListener(this.onHasOtherFormsChangedListenerId_);this.onHasOtherFormsChangedListenerId_=null}if(this.onForeignSessionsChangedListenerId_!==null){this.foreignSessionCallbackRouter_.removeListener(this.onForeignSessionsChangedListenerId_);this.onForeignSessionsChangedListenerId_=null}}willUpdate(changedProperties){super.willUpdate(changedProperties);const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("historyClustersEnabled_")||changedPrivateProperties.has("historyClustersVisible_")){this.showHistoryClusters_=this.historyClustersEnabled_&&this.historyClustersVisible_}if(changedPrivateProperties.has("showHistoryClusters_")||changedPrivateProperties.has("enableHistoryEmbeddings_")){this.showTabs_=this.showHistoryClusters_&&!this.enableHistoryEmbeddings_}if(changedPrivateProperties.has("selectedTab_")){this.lastSelectedTab_=this.selectedTab_;if(!this.selectedPage_||TABBED_PAGES.includes(this.selectedPage_)){this.selectedPage_=TABBED_PAGES[this.selectedTab_]}}if(changedPrivateProperties.has("queryState_")){if(this.queryState_.after){const afterDate=new Date(this.queryState_.after+"T00:00:00");if(this.queryStateAfterDate_?.getTime()!==afterDate.getTime()){this.queryStateAfterDate_=afterDate}}else{this.queryStateAfterDate_=undefined}}}firstUpdated(changedProperties){super.firstUpdated(changedProperties);this.addEventListener("cr-toolbar-menu-click",this.onCrToolbarMenuClick_);this.addEventListener("delete-selected",this.deleteSelected);this.addEventListener("open-selected",this.openSelected);this.addEventListener("history-checkbox-select",this.checkboxSelected);this.addEventListener("history-close-drawer",this.closeDrawer_);this.addEventListener("history-view-changed",this.historyViewChanged_);this.addEventListener("unselect-all",this.unselectAll);if(loadTimeData.getBoolean("maybeShowEmbeddingsIph")){this.registerHelpBubble("kHistorySearchInputElementId",this.$.toolbar.searchField);setTimeout((()=>{browserProxyFactory.getInstance().handler.maybeShowFeaturePromo({featureName:"IPH_HistorySearch",key:null})}),1e3)}}getScrollTargetForTesting(){return this.scrollTarget_}getShowResultsByGroup_(){return this.selectedPage_===Page.HISTORY_CLUSTERS}getShowHistoryList_(){return this.selectedPage_===Page.HISTORY}onShowResultsByGroupChanged_(e){if(!this.selectedPage_){return}const showResultsByGroup=e.detail.value;if(showResultsByGroup){this.selectedTab_=TABBED_PAGES.indexOf(Page.HISTORY_CLUSTERS)}else{this.selectedTab_=TABBED_PAGES.indexOf(Page.HISTORY)}}updated(changedProperties){super.updated(changedProperties);const changedPrivateProperties=changedProperties;if(changedPrivateProperties.has("selectedTab_")){BrowserProxyImpl.getInstance().handler.setLastSelectedTab(this.selectedTab_)}if(changedPrivateProperties.has("selectedPage_")){this.selectedPageChanged_(changedPrivateProperties.get("selectedPage_"))}if(changedPrivateProperties.has("hasDrawer_")){this.hasDrawerChanged_()}if(changedPrivateProperties.has("enableHistoryEmbeddings_")&&this.enableHistoryEmbeddings_){this.onHistoryEmbeddingsContainerShown_()}}historyClustersSelected_(){return this.selectedPage_===Page.HISTORY_CLUSTERS&&this.showHistoryClusters_}onFirstRender_(){const searchField=this.$.toolbar.searchField;if(!searchField.narrow){searchField.getSearchInput().focus()}if(loadTimeData.getBoolean("isCriticalActionsEnabled")&&this.showFilterChips_()){const filterChipsEl=this.shadowRoot.querySelector("#historyFilterChips");if(filterChipsEl){filterChipsEl.updateComplete.then((()=>{const chipEl=filterChipsEl.shadowRoot.querySelector("#actorVisitsChip");if(chipEl){this.registerHelpBubble("HistoryUI::kHistoryGeminiFilterChipElementId",chipEl);setTimeout((()=>{browserProxyFactory.getInstance().handler.maybeShowFeaturePromo({featureName:"IPH_CriticalActionFilterChip",key:null})}),1e3)}}))}}requestIdleCallback((function(){document.fonts.load("bold 12px Roboto")}))}onCrToolbarMenuClick_(){this.$.drawer.get().toggle()}checkboxSelected(){this.$.toolbar.count=this.$.history.getSelectedItemCount()}selectOrUnselectAll(){this.$.history.selectOrUnselectAll();this.$.toolbar.count=this.$.history.getSelectedItemCount()}unselectAll(){this.$.history.unselectAllItems();this.$.toolbar.count=0}deleteSelected(){this.$.history.deleteSelectedWithPrompt()}openSelected(){this.$.history.openSelected()}onQueryFinished_(e){this.queryResult_=e.detail.result;this.$.history.historyResult(e.detail.result.info,e.detail.result.value);if(document.body.classList.contains("loading")){document.body.classList.remove("loading");this.onFirstRender_()}}onKeyDown_(e){if((e.key==="Delete"||e.key==="Backspace")&&!hasKeyModifiers(e)){this.onDeleteCommand_();return}if(e.key==="a"&&!e.altKey&&!e.shiftKey){let hasTriggerModifier=e.ctrlKey&&!e.metaKey;if(hasTriggerModifier&&this.onSelectAllCommand_()){e.preventDefault()}}if(e.key==="Escape"){this.unselectAll();getInstance().announce(loadTimeData.getString("itemsUnselected"));e.preventDefault()}}onVisibilityChange_(){if(this.selectedPage_!==Page.HISTORY_CLUSTERS){return}if(document.visibilityState==="hidden"){this.recordHistoryClustersDuration_()}else if(document.visibilityState==="visible"&&this.historyClustersViewStartTime_===null){this.historyClustersViewStartTime_=new Date}}onRecordHistoryLinkClick_(e){if(!this.queryResult_.info||!this.queryResult_.info.term){return}if(e.detail.resultType!==HistoryResultType.EMBEDDINGS){this.nonEmbeddingsResultClicked_=true}const browserProxy=BrowserProxyImpl.getInstance();browserProxy.recordHistogram("History.SearchResultClicked.Type",e.detail.resultType,HistoryResultType.END);const boundary=100;const clampedIndex=Math.min(e.detail.index,99);browserProxy.recordHistogram("History.SearchResultClicked.Index",clampedIndex,boundary);switch(e.detail.resultType){case HistoryResultType.TRADITIONAL:browserProxy.recordHistogram("History.SearchResultClicked.Index.Traditional",clampedIndex,boundary);break;case HistoryResultType.GROUPED:browserProxy.recordHistogram("History.SearchResultClicked.Index.Grouped",clampedIndex,boundary);break;case HistoryResultType.EMBEDDINGS:browserProxy.recordHistogram("History.SearchResultClicked.Index.Embeddings",clampedIndex,boundary);break;case HistoryResultType.END:break;default:assertNotReachedCase(e.detail.resultType)}}onDeleteCommand_(){if(this.$.toolbar.count===0||this.pendingDelete_){return}this.deleteSelected()}onSelectAllCommand_(){if(this.$.toolbar.searchField.isSearchFocused()||this.syncedTabsSelected_()||this.historyClustersSelected_()){return false}this.selectOrUnselectAll();return true}setForeignSessions_(sessionList){this.sessionList_=sessionList}onIdentityStateChanged_(identityState){this.identityState_=identityState}onHasOtherFormsChanged_(hasOtherForms){this.footerInfo=Object.assign({},this.footerInfo,{otherFormsOfHistory:hasOtherForms})}syncedTabsSelected_(){return this.selectedPage_===Page.SYNCED_TABS}shouldShowSpinner_(){return this.queryState_.querying&&!this.queryState_.incremental&&this.queryState_.searchTerm!==""}updateContentPage_(){switch(this.selectedPage_){case Page.SYNCED_TABS:this.contentPage_=Page.SYNCED_TABS;break;default:this.contentPage_=Page.HISTORY}}updateTabsContentPage_(){this.tabsContentPage_=this.selectedPage_===Page.HISTORY_CLUSTERS&&this.historyClustersEnabled_&&this.historyClustersVisible_?Page.HISTORY_CLUSTERS:Page.HISTORY}selectedPageChanged_(oldPage){this.updateContentPage_();this.updateTabsContentPage_();this.unselectAll();this.historyViewChanged_();this.maybeUpdateSelectedHistoryTab_();if(oldPage===Page.HISTORY_CLUSTERS&&this.selectedPage_!==Page.HISTORY_CLUSTERS){this.recordHistoryClustersDuration_()}if(this.selectedPage_===Page.HISTORY_CLUSTERS){this.historyClustersViewStartTime_=new Date}}onContentIronSelect_(){this.updateScrollTarget_()}onTabsContentIronSelect_(){this.updateScrollTarget_()}updateScrollTarget_(){const topLevelIronPages=this.$.content;const topLevelHistoryPage=this.$.tabsContainer;if(topLevelIronPages.selectedItem&&topLevelIronPages.selectedItem===topLevelHistoryPage){this.scrollTarget_=this.$.tabsScrollContainer;this.$.history.fillCurrentViewport()}else{this.scrollTarget_=topLevelIronPages.selectedItem}}maybeUpdateSelectedHistoryTab_(){if(TABBED_PAGES.includes(this.selectedPage_)){this.selectedTab_=TABBED_PAGES.indexOf(this.selectedPage_)}}historyViewChanged_(){this.recordHistoryPageView_()}recordHistoryClustersDuration_(){assert(this.historyClustersViewStartTime_!==null);const duration=(new Date).getTime()-this.historyClustersViewStartTime_.getTime();BrowserProxyImpl.getInstance().recordLongTime("History.Clusters.WebUISessionDuration",duration);this.historyClustersViewStartTime_=null}hasDrawerChanged_(){const drawer=this.$.drawer.getIfExists();if(!this.hasDrawer_&&drawer&&drawer.open){drawer.cancel()}}closeDrawer_(){const drawer=this.$.drawer.get();if(drawer&&drawer.open){drawer.close()}}recordHistoryPageView_(){let histogramValue=HistoryPageViewHistogram.END;switch(this.selectedPage_){case Page.HISTORY_CLUSTERS:histogramValue=HistoryPageViewHistogram.JOURNEYS;break;case Page.SYNCED_TABS:histogramValue=this.identityState_.signIn===HistorySignInState.SIGNED_IN&&this.identityState_.tabsSync===SyncState.TURNED_ON?HistoryPageViewHistogram.SYNCED_TABS:HistoryPageViewHistogram.SIGNIN_PROMO;break;default:histogramValue=HistoryPageViewHistogram.HISTORY;break}if(histogramValue===this.lastRecordedSelectedPageHistogramValue_){return}this.lastRecordedSelectedPageHistogramValue_=histogramValue;BrowserProxyImpl.getInstance().recordHistogram("History.HistoryPageView",histogramValue,HistoryPageViewHistogram.END)}handleFindShortcut(modalContextOpen){if(modalContextOpen){return false}this.$.toolbar.searchField.showAndFocus();return true}searchInputHasFocus(){return this.$.toolbar.searchField.isSearchFocused()}setHasDrawerForTesting(enabled){this.hasDrawer_=enabled}shouldShowHistoryPageHistorySyncPromo_(){return this.unoPhase2FollowUpEnabled_&&this.shouldShowHistorySyncPromo_&&this.identityState_.historySync!==SyncState.DISABLED&&!(this.identityState_.signIn===HistorySignInState.SIGNED_IN&&this.identityState_.historySync===SyncState.TURNED_ON)}handleShouldShowHistoryPageHistorySyncPromoChanged_(shouldShowHistorySyncPromo){this.shouldShowHistorySyncPromo_=shouldShowHistorySyncPromo}onShouldShowHistoryCrossDeviceSigninPromo_(e){this.shouldShowHistoryCrossDeviceSigninPromo_=e.detail.shouldShow}shouldShowHistoryEmbeddings_(){if(!loadTimeData.getBoolean("enableHistoryEmbeddings")){return false}if(!this.queryState_.searchTerm){return false}return this.queryState_.searchTerm.split(" ").filter((part=>part.length>0)).length>=loadTimeData.getInteger("historyEmbeddingsSearchMinimumWordCount")}onSelectedSuggestionChanged_(e){let afterString=undefined;if(e.detail.value?.timeRangeStart){afterString=convertDateToQueryValue(e.detail.value.timeRangeStart)}this.fire("change-query",{search:this.queryState_.searchTerm,after:afterString})}onHistoryEmbeddingsDisclaimerLinkAuxclick_(){this.onHistoryEmbeddingsDisclaimerLinkClick_()}onHistoryEmbeddingsDisclaimerLinkClick_(){this.historyEmbeddingsDisclaimerLinkClicked_=true}onHistoryEmbeddingsItemMoreFromSiteClick_(e){const historyEmbeddingsItem=e.detail;this.fire("change-query",{search:"host:"+new URL(historyEmbeddingsItem.url).hostname})}onHistoryEmbeddingsItemRemoveItemClick_(e){const historyEmbeddingsItem=e.detail;BrowserProxyImpl.getInstance().handler.removeVisits([{url:historyEmbeddingsItem.url,timestamps:[historyEmbeddingsItem.lastUrlVisitTimestamp]}])}onHistoryEmbeddingsIsEmptyChanged_(e){this.hasHistoryEmbeddingsResults_=!e.detail.value}onHistoryEmbeddingsContainerShown_(){assert(this.enableHistoryEmbeddings_);const historyEmbeddingsContainer=this.shadowRoot.querySelector("#historyEmbeddingsContainer");assert(historyEmbeddingsContainer);this.historyEmbeddingsResizeObserver_=new ResizeObserver((entries=>{assert(entries.length===1);this.tabContentScrollOffset_=entries[0].contentRect.height}));this.historyEmbeddingsResizeObserver_.observe(historyEmbeddingsContainer)}onQueryStateChanged_(e){this.nonEmbeddingsResultClicked_=false;this.queryState_=e.detail.value}onSelectedPageChanged_(e){this.selectedPage_=e.detail.value}onToolbarSearchTermNativeBeforeInput_(e){this.dataFromNativeBeforeInput_=e.detail.e.data}onToolbarSearchTermNativeInput_(e){const insertedText=this.dataFromNativeBeforeInput_;this.dataFromNativeBeforeInput_=null;if(e.detail.inputValue.length===0){this.numCharsTypedInSearch_=0}else if(insertedText===e.detail.inputValue){this.numCharsTypedInSearch_=1}else{this.numCharsTypedInSearch_++}}onToolbarSearchTermCleared_(){this.numCharsTypedInSearch_=0}onListPendingDeleteChanged_(e){this.pendingDelete_=e.detail.value}onTabsSelectedChanged_(e){this.onSelectedTabChanged_(e)}onSelectedTabChanged_(e){this.selectedTab_=e.detail.value}onHistoryClustersVisibleChanged_(e){this.historyClustersVisible_=e.detail.value}onFilterChanged_(e){this.includeUserVisits_=e.detail.userVisits;this.includeActorVisits_=e.detail.actorVisits;this.fire("change-query",{search:this.queryState_.searchTerm,includeActorVisits:this.includeActorVisits_,includeUserVisits:this.includeUserVisits_})}showFilterChips_(){return this.isBrowsingHistoryActorIntegrationM3Enabled_&&this.isGlicWebActuationAvailable_&&!this.getShowResultsByGroup_()}addThemedColors_(){assert(document.body.querySelector(COLORS_CSS_SELECTOR)===null);const link=document.createElement("link");link.rel="stylesheet";link.href="chrome://theme/colors.css?sets=ui,chrome";document.body.appendChild(link)}}customElements.define(HistoryAppElement.is,HistoryAppElement);export{BrowserProxyImpl,ClusterAction,CrActionMenuElement,CrButtonElement,CrCheckboxElement,CrDialogElement,CrRouter,CriticalActionType,HISTORY_EMBEDDINGS_ANSWERS_PROMO_SHOWN_KEY,HISTORY_EMBEDDINGS_PROMO_SHOWN_KEY,HistoryAppElement,HistoryCrossDeviceSigninPromoBrowserProxy,HistoryCrossDeviceSigninPromoElement,PageHandlerRemote$2 as HistoryEmbeddingsPageHandlerRemote,HistoryEmbeddingsPromoElement,HistoryFilterChipsElement,HistoryItemElement,HistoryListElement,HistoryPageViewHistogram,HistorySearchedLabelElement,HistorySideBarElement,HistorySignInState,HistorySyncedDeviceCardElement,HistorySyncedDeviceManagerElement,HistoryToolbarElement,MetricsProxyImpl,PageCallbackRouter$3 as PageCallbackRouter,PageHandlerRemote$3 as PageHandlerRemote,RelatedSearchAction,SYNCED_TABS_HISTOGRAM_NAME,SyncState,SyncedTabsHistogram,VisitAction,VisitContextMenuAction,VisitType,browserProxyFactory$2 as foreignSessionBrowserProxyFactory,getTrustedHTML,browserProxyFactory$4 as historyClustersBrowserProxyFactory,browserProxyFactory$3 as historyEmbeddingsBrowserProxyFactory,browserProxyFactory as userEducationProxyFactory};