import*as e from"../common/common.js";import*as t from"../../models/text_utils/text_utils.js";import*as n from"../i18n/i18n.js";import*as r from"../platform/platform.js";import{assertNotNullOrUndefined as s,UserVisibleError as i}from"../platform/platform.js";import*as o from"../root/root.js";import*as a from"../host/host.js";import*as l from"../protocol_client/protocol_client.js";import*as d from"../../third_party/codemirror.next/codemirror.next.js";const c=new Map;class h extends e.ObjectWrapper.ObjectWrapper{#e;constructor(e){super(),this.#e=e}target(){return this.#e}async preSuspendModel(e){}async suspendModel(e){}async resumeModel(){}async postResumeModel(){}dispose(){}static register(e,t){if(t.early&&!t.autostart)throw new Error(`Error registering model ${e.name}: early models must be autostarted.`);c.set(e,t)}static get registeredModels(){return c}}var u=Object.freeze({__proto__:null,SDKModel:h});const g=[{inherited:!0,name:"-webkit-border-horizontal-spacing"},{name:"-webkit-border-image"},{inherited:!0,name:"-webkit-border-vertical-spacing"},{keywords:["stretch","start","center","end","baseline"],name:"-webkit-box-align"},{keywords:["slice","clone"],name:"-webkit-box-decoration-break"},{keywords:["normal","reverse"],name:"-webkit-box-direction"},{name:"-webkit-box-flex"},{name:"-webkit-box-ordinal-group"},{keywords:["horizontal","vertical"],name:"-webkit-box-orient"},{keywords:["start","center","end","justify"],name:"-webkit-box-pack"},{name:"-webkit-box-reflect"},{longhands:["break-after"],name:"-webkit-column-break-after"},{longhands:["break-before"],name:"-webkit-column-break-before"},{longhands:["break-inside"],name:"-webkit-column-break-inside"},{inherited:!0,name:"-webkit-font-smoothing"},{inherited:!0,keywords:["auto","loose","normal","strict","after-white-space","anywhere"],name:"-webkit-line-break"},{keywords:["none"],name:"-webkit-line-clamp"},{inherited:!0,name:"-webkit-locale"},{longhands:["-webkit-mask-box-image-source","-webkit-mask-box-image-slice","-webkit-mask-box-image-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat"],name:"-webkit-mask-box-image"},{name:"-webkit-mask-box-image-outset"},{name:"-webkit-mask-box-image-repeat"},{name:"-webkit-mask-box-image-slice"},{name:"-webkit-mask-box-image-source"},{name:"-webkit-mask-box-image-width"},{name:"-webkit-mask-position-x"},{name:"-webkit-mask-position-y"},{name:"-webkit-perspective-origin-x"},{name:"-webkit-perspective-origin-y"},{inherited:!0,keywords:["logical","visual"],name:"-webkit-rtl-ordering"},{inherited:!0,name:"-webkit-ruby-position"},{inherited:!0,name:"-webkit-tap-highlight-color"},{inherited:!0,name:"-webkit-text-combine"},{inherited:!0,name:"-webkit-text-decorations-in-effect"},{inherited:!0,name:"-webkit-text-fill-color"},{inherited:!0,name:"-webkit-text-orientation"},{inherited:!0,keywords:["none","disc","circle","square"],name:"-webkit-text-security"},{inherited:!0,longhands:["-webkit-text-stroke-width","-webkit-text-stroke-color"],name:"-webkit-text-stroke"},{inherited:!0,name:"-webkit-text-stroke-color"},{inherited:!0,name:"-webkit-text-stroke-width"},{name:"-webkit-transform-origin-x"},{name:"-webkit-transform-origin-y"},{name:"-webkit-transform-origin-z"},{keywords:["auto","none","element"],name:"-webkit-user-drag"},{inherited:!0,keywords:["read-only","read-write","read-write-plaintext-only"],name:"-webkit-user-modify"},{inherited:!0,name:"-webkit-writing-mode"},{inherited:!0,keywords:["auto","currentcolor"],name:"accent-color"},{name:"additive-symbols"},{name:"align-content"},{name:"align-items"},{name:"align-self"},{keywords:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"],name:"alignment-baseline"},{longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing","-webkit-box-align","-webkit-box-decoration-break","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-reflect","-webkit-font-smoothing","-webkit-line-break","-webkit-line-clamp","-webkit-locale","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat","-webkit-mask-box-image-slice","-webkit-mask-box-image-source","-webkit-mask-box-image-width","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-rtl-ordering","-webkit-ruby-position","-webkit-tap-highlight-color","-webkit-text-combine","-webkit-text-decorations-in-effect","-webkit-text-fill-color","-webkit-text-orientation","-webkit-text-security","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-user-drag","-webkit-writing-mode","accent-color","additive-symbols","align-content","align-items","align-self","alignment-baseline","anchor-name","anchor-scope","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","animation-trigger-exit-range-end","animation-trigger-exit-range-start","animation-trigger-range-end","animation-trigger-range-start","animation-trigger-timeline","animation-trigger-type","app-region","appearance","ascent-override","aspect-ratio","backdrop-filter","backface-visibility","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position-x","background-position-y","background-repeat","background-size","base-palette","baseline-shift","baseline-source","block-size","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start-color","border-block-start-style","border-block-start-width","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-end-end-radius","border-end-start-radius","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-start-end-radius","border-start-start-radius","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","buffered-rendering","caption-side","caret-animation","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","color-scheme","column-count","column-fill","column-gap","column-height","column-rule-break","column-rule-color","column-rule-outset","column-rule-style","column-rule-width","column-span","column-width","column-wrap","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-width","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-end-end-shape","corner-end-start-shape","corner-start-end-shape","corner-start-start-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cursor","cx","cy","d","descent-override","display","dominant-baseline","dynamic-range-limit","empty-cells","fallback","field-sizing","fill","fill-opacity","fill-rule","filter","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","font-display","font-family","font-feature-settings","font-kerning","font-optical-sizing","font-palette","font-size","font-size-adjust","font-stretch","font-style","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap-rule-paint-order","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column-end","grid-column-start","grid-row-end","grid-row-start","grid-template-areas","grid-template-columns","grid-template-rows","height","hyphenate-character","hyphenate-limit-chars","hyphens","image-orientation","image-rendering","inherits","initial-letter","initial-value","inline-size","inset-block-end","inset-block-start","inset-inline-end","inset-inline-start","interactivity","interest-target-hide-delay","interest-target-show-delay","interpolate-size","isolation","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-clamp","line-gap-override","line-height","list-style-image","list-style-position","list-style-type","margin-block-end","margin-block-start","margin-bottom","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marker-end","marker-mid","marker-start","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-repeat","mask-size","mask-type","masonry-auto-tracks","masonry-direction","masonry-fill","masonry-slack","masonry-template-tracks","masonry-track-end","masonry-track-start","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","navigation","negative","object-fit","object-position","object-view-box","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","origin-trial-test-property","orphans","outline-color","outline-offset","outline-style","outline-width","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","override-colors","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","pad","padding-block-end","padding-block-start","padding-bottom","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-orientation","paint-order","perspective","perspective-origin","pointer-events","position","position-anchor","position-area","position-try-fallbacks","position-try-order","position-visibility","prefix","print-color-adjust","quotes","r","range","reading-flow","reading-order","resize","result","right","rotate","row-gap","row-rule-break","row-rule-color","row-rule-outset","row-rule-style","row-rule-width","ruby-align","ruby-position","rx","ry","scale","scroll-behavior","scroll-initial-target","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-marker-contain","scroll-marker-group","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-start-block","scroll-start-inline","scroll-start-x","scroll-start-y","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","size","size-adjust","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","suffix","symbols","syntax","system","tab-size","table-layout","text-align","text-align-last","text-anchor","text-autospace","text-box-edge","text-box-trim","text-combine-upright","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-spacing-trim","text-transform","text-underline-offset","text-underline-position","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","types","unicode-range","user-select","vector-effect","vertical-align","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-class","view-transition-group","view-transition-name","visibility","white-space-collapse","widows","width","will-change","word-break","word-spacing","writing-mode","x","y","z-index","zoom"],name:"all"},{keywords:["none"],name:"anchor-name"},{keywords:["none","all"],name:"anchor-scope"},{longhands:["animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-name","animation-timeline","animation-range-start","animation-range-end"],name:"animation"},{keywords:["replace","add","accumulate"],name:"animation-composition"},{name:"animation-delay"},{keywords:["normal","reverse","alternate","alternate-reverse"],name:"animation-direction"},{name:"animation-duration"},{keywords:["none","forwards","backwards","both"],name:"animation-fill-mode"},{keywords:["infinite"],name:"animation-iteration-count"},{keywords:["none"],name:"animation-name"},{keywords:["running","paused"],name:"animation-play-state"},{longhands:["animation-range-start","animation-range-end"],name:"animation-range"},{name:"animation-range-end"},{name:"animation-range-start"},{keywords:["none","auto"],name:"animation-timeline"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"animation-timing-function"},{longhands:["animation-trigger-timeline","animation-trigger-type","animation-trigger-range-start","animation-trigger-range-end","animation-trigger-exit-range-start","animation-trigger-exit-range-end"],name:"animation-trigger"},{longhands:["animation-trigger-exit-range-start","animation-trigger-exit-range-end"],name:"animation-trigger-exit-range"},{name:"animation-trigger-exit-range-end"},{name:"animation-trigger-exit-range-start"},{longhands:["animation-trigger-range-start","animation-trigger-range-end"],name:"animation-trigger-range"},{name:"animation-trigger-range-end"},{name:"animation-trigger-range-start"},{keywords:["none","auto"],name:"animation-trigger-timeline"},{keywords:["once","repeat","alternate","state"],name:"animation-trigger-type"},{keywords:["none","drag","no-drag"],name:"app-region"},{name:"appearance"},{name:"ascent-override"},{keywords:["auto"],name:"aspect-ratio"},{keywords:["none"],name:"backdrop-filter"},{keywords:["visible","hidden"],name:"backface-visibility"},{longhands:["background-image","background-position-x","background-position-y","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"],name:"background"},{keywords:["scroll","fixed","local"],name:"background-attachment"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],name:"background-blend-mode"},{keywords:["border-box","padding-box","content-box","text"],name:"background-clip"},{keywords:["currentcolor"],name:"background-color"},{keywords:["auto","none"],name:"background-image"},{keywords:["border-box","padding-box","content-box"],name:"background-origin"},{longhands:["background-position-x","background-position-y"],name:"background-position"},{name:"background-position-x"},{name:"background-position-y"},{name:"background-repeat"},{keywords:["auto","cover","contain"],name:"background-size"},{name:"base-palette"},{keywords:["baseline","sub","super"],name:"baseline-shift"},{keywords:["auto","first","last"],name:"baseline-source"},{keywords:["auto"],name:"block-size"},{longhands:["border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border"},{longhands:["border-block-start-color","border-block-start-style","border-block-start-width","border-block-end-color","border-block-end-style","border-block-end-width"],name:"border-block"},{longhands:["border-block-start-color","border-block-end-color"],name:"border-block-color"},{longhands:["border-block-end-width","border-block-end-style","border-block-end-color"],name:"border-block-end"},{name:"border-block-end-color"},{name:"border-block-end-style"},{name:"border-block-end-width"},{longhands:["border-block-start-width","border-block-start-style","border-block-start-color"],name:"border-block-start"},{name:"border-block-start-color"},{name:"border-block-start-style"},{name:"border-block-start-width"},{longhands:["border-block-start-style","border-block-end-style"],name:"border-block-style"},{longhands:["border-block-start-width","border-block-end-width"],name:"border-block-width"},{longhands:["border-bottom-width","border-bottom-style","border-bottom-color"],name:"border-bottom"},{keywords:["currentcolor"],name:"border-bottom-color"},{name:"border-bottom-left-radius"},{name:"border-bottom-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-bottom-style"},{keywords:["thin","medium","thick"],name:"border-bottom-width"},{inherited:!0,keywords:["separate","collapse"],name:"border-collapse"},{longhands:["border-top-color","border-right-color","border-bottom-color","border-left-color"],name:"border-color"},{name:"border-end-end-radius"},{name:"border-end-start-radius"},{longhands:["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border-image"},{name:"border-image-outset"},{keywords:["stretch","repeat","round","space"],name:"border-image-repeat"},{name:"border-image-slice"},{keywords:["none"],name:"border-image-source"},{keywords:["auto"],name:"border-image-width"},{longhands:["border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-end-color","border-inline-end-style","border-inline-end-width"],name:"border-inline"},{longhands:["border-inline-start-color","border-inline-end-color"],name:"border-inline-color"},{longhands:["border-inline-end-width","border-inline-end-style","border-inline-end-color"],name:"border-inline-end"},{name:"border-inline-end-color"},{name:"border-inline-end-style"},{name:"border-inline-end-width"},{longhands:["border-inline-start-width","border-inline-start-style","border-inline-start-color"],name:"border-inline-start"},{name:"border-inline-start-color"},{name:"border-inline-start-style"},{name:"border-inline-start-width"},{longhands:["border-inline-start-style","border-inline-end-style"],name:"border-inline-style"},{longhands:["border-inline-start-width","border-inline-end-width"],name:"border-inline-width"},{longhands:["border-left-width","border-left-style","border-left-color"],name:"border-left"},{keywords:["currentcolor"],name:"border-left-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-left-style"},{keywords:["thin","medium","thick"],name:"border-left-width"},{longhands:["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],name:"border-radius"},{longhands:["border-right-width","border-right-style","border-right-color"],name:"border-right"},{keywords:["currentcolor"],name:"border-right-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-right-style"},{keywords:["thin","medium","thick"],name:"border-right-width"},{inherited:!0,longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing"],name:"border-spacing"},{name:"border-start-end-radius"},{name:"border-start-start-radius"},{keywords:["none"],longhands:["border-top-style","border-right-style","border-bottom-style","border-left-style"],name:"border-style"},{longhands:["border-top-width","border-top-style","border-top-color"],name:"border-top"},{keywords:["currentcolor"],name:"border-top-color"},{name:"border-top-left-radius"},{name:"border-top-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-top-style"},{keywords:["thin","medium","thick"],name:"border-top-width"},{longhands:["border-top-width","border-right-width","border-bottom-width","border-left-width"],name:"border-width"},{keywords:["auto"],name:"bottom"},{keywords:["slice","clone"],name:"box-decoration-break"},{keywords:["none"],name:"box-shadow"},{keywords:["content-box","border-box"],name:"box-sizing"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-after"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-before"},{keywords:["auto","avoid","avoid-column","avoid-page"],name:"break-inside"},{keywords:["auto","dynamic","static"],name:"buffered-rendering"},{inherited:!0,keywords:["top","bottom"],name:"caption-side"},{inherited:!0,keywords:["auto","manual"],name:"caret-animation"},{inherited:!0,keywords:["auto","currentcolor"],name:"caret-color"},{keywords:["none","left","right","both","inline-start","inline-end"],name:"clear"},{keywords:["auto"],name:"clip"},{keywords:["border-box","padding-box","content-box","margin-box","fill-box","stroke-box","view-box","none"],name:"clip-path"},{inherited:!0,keywords:["nonzero","evenodd"],name:"clip-rule"},{inherited:!0,keywords:["currentcolor"],name:"color"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation-filters"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality"],name:"color-rendering"},{inherited:!0,name:"color-scheme"},{keywords:["auto"],name:"column-count"},{keywords:["balance","auto"],name:"column-fill"},{keywords:["normal"],name:"column-gap"},{keywords:["auto"],name:"column-height"},{longhands:["column-rule-width","column-rule-style","column-rule-color"],name:"column-rule"},{inherited:!1,keywords:["none","spanning-item","intersection"],name:"column-rule-break"},{keywords:["currentcolor"],name:"column-rule-color"},{inherited:!1,name:"column-rule-outset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"column-rule-style"},{keywords:["thin","medium","thick"],name:"column-rule-width"},{keywords:["none","all"],name:"column-span"},{keywords:["auto"],name:"column-width"},{keywords:["nowrap","wrap"],name:"column-wrap"},{longhands:["column-width","column-count"],name:"columns"},{keywords:["none","strict","content","size","layout","style","paint","inline-size","block-size"],name:"contain"},{name:"contain-intrinsic-block-size"},{keywords:["none"],name:"contain-intrinsic-height"},{name:"contain-intrinsic-inline-size"},{longhands:["contain-intrinsic-width","contain-intrinsic-height"],name:"contain-intrinsic-size"},{keywords:["none"],name:"contain-intrinsic-width"},{longhands:["container-name","container-type"],name:"container"},{keywords:["none"],name:"container-name"},{keywords:["normal","inline-size","size","scroll-state"],name:"container-type"},{name:"content"},{keywords:["visible","auto","hidden"],name:"content-visibility"},{name:"corner-bottom-left-shape"},{name:"corner-bottom-right-shape"},{name:"corner-end-end-shape"},{name:"corner-end-start-shape"},{longhands:["corner-top-left-shape","corner-top-right-shape","corner-bottom-right-shape","corner-bottom-left-shape"],name:"corner-shape"},{name:"corner-start-end-shape"},{name:"corner-start-start-shape"},{name:"corner-top-left-shape"},{name:"corner-top-right-shape"},{keywords:["none"],name:"counter-increment"},{keywords:["none"],name:"counter-reset"},{keywords:["none"],name:"counter-set"},{inherited:!0,keywords:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"],name:"cursor"},{name:"cx"},{name:"cy"},{keywords:["none"],name:"d"},{name:"descent-override"},{inherited:!0,keywords:["ltr","rtl"],name:"direction"},{keywords:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math","ruby","ruby-text","masonry","inline-masonry"],name:"display"},{inherited:!0,keywords:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"],name:"dominant-baseline"},{inherited:!0,keywords:["standard","no-limit","constrained"],name:"dynamic-range-limit"},{inherited:!0,keywords:["show","hide"],name:"empty-cells"},{name:"fallback"},{keywords:["fixed","content"],name:"field-sizing"},{inherited:!0,name:"fill"},{inherited:!0,name:"fill-opacity"},{inherited:!0,keywords:["nonzero","evenodd"],name:"fill-rule"},{keywords:["none"],name:"filter"},{longhands:["flex-grow","flex-shrink","flex-basis"],name:"flex"},{keywords:["auto","fit-content","min-content","max-content","content"],name:"flex-basis"},{keywords:["row","row-reverse","column","column-reverse"],name:"flex-direction"},{longhands:["flex-direction","flex-wrap"],name:"flex-flow"},{name:"flex-grow"},{name:"flex-shrink"},{keywords:["nowrap","wrap","wrap-reverse"],name:"flex-wrap"},{keywords:["none","left","right","inline-start","inline-end"],name:"float"},{keywords:["currentcolor"],name:"flood-color"},{name:"flood-opacity"},{inherited:!0,longhands:["font-style","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-alternates","font-variant-position","font-variant-emoji","font-weight","font-stretch","font-size","line-height","font-family","font-optical-sizing","font-size-adjust","font-kerning","font-feature-settings","font-variation-settings"],name:"font"},{name:"font-display"},{inherited:!0,name:"font-family"},{inherited:!0,keywords:["normal"],name:"font-feature-settings"},{inherited:!0,keywords:["auto","normal","none"],name:"font-kerning"},{inherited:!0,keywords:["auto","none"],name:"font-optical-sizing"},{inherited:!0,keywords:["normal","light","dark"],name:"font-palette"},{inherited:!0,keywords:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"],name:"font-size"},{inherited:!0,keywords:["none","ex-height","cap-height","ch-width","ic-width","ic-height","from-font"],name:"font-size-adjust"},{inherited:!0,keywords:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"],name:"font-stretch"},{inherited:!0,keywords:["normal","italic","oblique"],name:"font-style"},{inherited:!0,longhands:["font-synthesis-weight","font-synthesis-style","font-synthesis-small-caps"],name:"font-synthesis"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-small-caps"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-style"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-weight"},{inherited:!0,longhands:["font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji"],name:"font-variant"},{inherited:!0,keywords:["normal"],name:"font-variant-alternates"},{inherited:!0,keywords:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"],name:"font-variant-caps"},{inherited:!0,keywords:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"],name:"font-variant-east-asian"},{inherited:!0,keywords:["normal","text","emoji","unicode"],name:"font-variant-emoji"},{inherited:!0,keywords:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"],name:"font-variant-ligatures"},{inherited:!0,keywords:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"],name:"font-variant-numeric"},{inherited:!0,keywords:["normal","sub","super"],name:"font-variant-position"},{inherited:!0,keywords:["normal"],name:"font-variation-settings"},{inherited:!0,keywords:["normal","bold","bolder","lighter"],name:"font-weight"},{inherited:!0,keywords:["auto","none","preserve-parent-color"],name:"forced-color-adjust"},{longhands:["row-gap","column-gap"],name:"gap"},{inherited:!1,keywords:["row-over-column","column-over-row"],name:"gap-rule-paint-order"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-flow","grid-auto-rows","grid-auto-columns"],name:"grid"},{longhands:["grid-row-start","grid-column-start","grid-row-end","grid-column-end"],name:"grid-area"},{keywords:["auto","min-content","max-content"],name:"grid-auto-columns"},{keywords:["row","column"],name:"grid-auto-flow"},{keywords:["auto","min-content","max-content"],name:"grid-auto-rows"},{longhands:["grid-column-start","grid-column-end"],name:"grid-column"},{keywords:["auto"],name:"grid-column-end"},{keywords:["auto"],name:"grid-column-start"},{longhands:["grid-row-start","grid-row-end"],name:"grid-row"},{keywords:["auto"],name:"grid-row-end"},{keywords:["auto"],name:"grid-row-start"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas"],name:"grid-template"},{keywords:["none"],name:"grid-template-areas"},{keywords:["none"],name:"grid-template-columns"},{keywords:["none"],name:"grid-template-rows"},{keywords:["auto","fit-content","min-content","max-content"],name:"height"},{inherited:!0,name:"hyphenate-character"},{inherited:!0,keywords:["auto"],name:"hyphenate-limit-chars"},{inherited:!0,keywords:["none","manual","auto"],name:"hyphens"},{inherited:!0,name:"image-orientation"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"],name:"image-rendering"},{name:"inherits"},{inherited:!1,keywords:["drop","normal","raise"],name:"initial-letter"},{name:"initial-value"},{keywords:["auto"],name:"inline-size"},{longhands:["top","right","bottom","left"],name:"inset"},{longhands:["inset-block-start","inset-block-end"],name:"inset-block"},{name:"inset-block-end"},{name:"inset-block-start"},{longhands:["inset-inline-start","inset-inline-end"],name:"inset-inline"},{name:"inset-inline-end"},{name:"inset-inline-start"},{inherited:!0,keywords:["auto","inert"],name:"interactivity"},{longhands:["interest-target-show-delay","interest-target-hide-delay"],name:"interest-target-delay"},{name:"interest-target-hide-delay"},{name:"interest-target-show-delay"},{inherited:!0,keywords:["numeric-only","allow-keywords"],name:"interpolate-size"},{keywords:["auto","isolate"],name:"isolation"},{name:"justify-content"},{name:"justify-items"},{name:"justify-self"},{keywords:["auto"],name:"left"},{inherited:!0,keywords:["normal"],name:"letter-spacing"},{keywords:["currentcolor"],name:"lighting-color"},{inherited:!0,keywords:["auto","loose","normal","strict","anywhere"],name:"line-break"},{keywords:["none","auto"],name:"line-clamp"},{name:"line-gap-override"},{inherited:!0,keywords:["normal"],name:"line-height"},{inherited:!0,longhands:["list-style-position","list-style-image","list-style-type"],name:"list-style"},{inherited:!0,keywords:["none"],name:"list-style-image"},{inherited:!0,keywords:["outside","inside"],name:"list-style-position"},{inherited:!0,keywords:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"],name:"list-style-type"},{longhands:["margin-top","margin-right","margin-bottom","margin-left"],name:"margin"},{longhands:["margin-block-start","margin-block-end"],name:"margin-block"},{keywords:["auto"],name:"margin-block-end"},{keywords:["auto"],name:"margin-block-start"},{keywords:["auto"],name:"margin-bottom"},{longhands:["margin-inline-start","margin-inline-end"],name:"margin-inline"},{keywords:["auto"],name:"margin-inline-end"},{keywords:["auto"],name:"margin-inline-start"},{keywords:["auto"],name:"margin-left"},{keywords:["auto"],name:"margin-right"},{keywords:["auto"],name:"margin-top"},{inherited:!0,longhands:["marker-start","marker-mid","marker-end"],name:"marker"},{inherited:!0,keywords:["none"],name:"marker-end"},{inherited:!0,keywords:["none"],name:"marker-mid"},{inherited:!0,keywords:["none"],name:"marker-start"},{longhands:["mask-image","-webkit-mask-position-x","-webkit-mask-position-y","mask-size","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode"],name:"mask"},{name:"mask-clip"},{name:"mask-composite"},{name:"mask-image"},{name:"mask-mode"},{name:"mask-origin"},{longhands:["-webkit-mask-position-x","-webkit-mask-position-y"],name:"mask-position"},{name:"mask-repeat"},{name:"mask-size"},{keywords:["luminance","alpha"],name:"mask-type"},{keywords:["auto","min-content","max-content"],name:"masonry-auto-tracks"},{keywords:["row","row-reverse","column","column-reverse"],name:"masonry-direction"},{keywords:["normal","reverse"],name:"masonry-fill"},{longhands:["masonry-direction","masonry-fill"],name:"masonry-flow"},{keywords:["normal"],name:"masonry-slack"},{name:"masonry-template-tracks"},{longhands:["masonry-track-start","masonry-track-end"],name:"masonry-track"},{keywords:["auto"],name:"masonry-track-end"},{keywords:["auto"],name:"masonry-track-start"},{inherited:!0,name:"math-depth"},{inherited:!0,keywords:["normal","compact"],name:"math-shift"},{inherited:!0,keywords:["normal","compact"],name:"math-style"},{keywords:["none"],name:"max-block-size"},{keywords:["none"],name:"max-height"},{keywords:["none"],name:"max-inline-size"},{keywords:["none"],name:"max-width"},{name:"min-block-size"},{name:"min-height"},{name:"min-inline-size"},{name:"min-width"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],name:"mix-blend-mode"},{name:"navigation"},{name:"negative"},{keywords:["fill","contain","cover","none","scale-down"],name:"object-fit"},{name:"object-position"},{keywords:["none"],name:"object-view-box"},{longhands:["offset-position","offset-path","offset-distance","offset-rotate","offset-anchor"],name:"offset"},{keywords:["auto"],name:"offset-anchor"},{name:"offset-distance"},{keywords:["none"],name:"offset-path"},{keywords:["auto","normal"],name:"offset-position"},{keywords:["auto","reverse"],name:"offset-rotate"},{name:"opacity"},{name:"order"},{keywords:["normal","none"],name:"origin-trial-test-property"},{inherited:!0,name:"orphans"},{longhands:["outline-color","outline-style","outline-width"],name:"outline"},{keywords:["currentcolor"],name:"outline-color"},{name:"outline-offset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"outline-style"},{keywords:["thin","medium","thick"],name:"outline-width"},{longhands:["overflow-x","overflow-y"],name:"overflow"},{inherited:!1,keywords:["visible","none","auto"],name:"overflow-anchor"},{name:"overflow-block"},{keywords:["border-box","content-box","padding-box"],name:"overflow-clip-margin"},{name:"overflow-inline"},{inherited:!0,keywords:["normal","break-word","anywhere"],name:"overflow-wrap"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-x"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-y"},{keywords:["none","auto"],name:"overlay"},{name:"override-colors"},{longhands:["overscroll-behavior-x","overscroll-behavior-y"],name:"overscroll-behavior"},{name:"overscroll-behavior-block"},{name:"overscroll-behavior-inline"},{keywords:["auto","contain","none"],name:"overscroll-behavior-x"},{keywords:["auto","contain","none"],name:"overscroll-behavior-y"},{name:"pad"},{longhands:["padding-top","padding-right","padding-bottom","padding-left"],name:"padding"},{longhands:["padding-block-start","padding-block-end"],name:"padding-block"},{name:"padding-block-end"},{name:"padding-block-start"},{name:"padding-bottom"},{longhands:["padding-inline-start","padding-inline-end"],name:"padding-inline"},{name:"padding-inline-end"},{name:"padding-inline-start"},{name:"padding-left"},{name:"padding-right"},{name:"padding-top"},{keywords:["auto"],name:"page"},{longhands:["break-after"],name:"page-break-after"},{longhands:["break-before"],name:"page-break-before"},{longhands:["break-inside"],name:"page-break-inside"},{name:"page-orientation"},{inherited:!0,keywords:["normal","fill","stroke","markers"],name:"paint-order"},{keywords:["none"],name:"perspective"},{name:"perspective-origin"},{longhands:["align-content","justify-content"],name:"place-content"},{longhands:["align-items","justify-items"],name:"place-items"},{longhands:["align-self","justify-self"],name:"place-self"},{inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],name:"pointer-events"},{keywords:["static","relative","absolute","fixed","sticky"],name:"position"},{keywords:["auto"],name:"position-anchor"},{keywords:["none","top","bottom","center","left","right","x-start","x-end","y-start","y-end","start","end","self-start","self-end","all"],name:"position-area"},{longhands:["position-try-order","position-try-fallbacks"],name:"position-try"},{keywords:["none","flip-block","flip-inline","flip-start"],name:"position-try-fallbacks"},{keywords:["normal","most-width","most-height","most-block-size","most-inline-size"],name:"position-try-order"},{keywords:["always","anchors-visible","no-overflow"],name:"position-visibility"},{name:"prefix"},{inherited:!0,keywords:["economy","exact"],name:"print-color-adjust"},{inherited:!0,keywords:["auto","none"],name:"quotes"},{name:"r"},{name:"range"},{keywords:["normal","flex-visual","flex-flow","grid-rows","grid-columns","grid-order","source-order"],name:"reading-flow"},{name:"reading-order"},{keywords:["none","both","horizontal","vertical","block","inline"],name:"resize"},{name:"result"},{keywords:["auto"],name:"right"},{name:"rotate"},{keywords:["normal"],name:"row-gap"},{inherited:!1,keywords:["none","spanning-item","intersection"],name:"row-rule-break"},{keywords:["currentcolor"],name:"row-rule-color"},{inherited:!1,name:"row-rule-outset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"row-rule-style"},{keywords:["thin","medium","thick"],name:"row-rule-width"},{inherited:!0,keywords:["space-around","start","center","space-between"],name:"ruby-align"},{inherited:!0,keywords:["over","under"],name:"ruby-position"},{keywords:["auto"],name:"rx"},{keywords:["auto"],name:"ry"},{name:"scale"},{keywords:["auto","smooth"],name:"scroll-behavior"},{keywords:["none","nearest"],name:"scroll-initial-target"},{longhands:["scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left"],name:"scroll-margin"},{longhands:["scroll-margin-block-start","scroll-margin-block-end"],name:"scroll-margin-block"},{name:"scroll-margin-block-end"},{name:"scroll-margin-block-start"},{name:"scroll-margin-bottom"},{longhands:["scroll-margin-inline-start","scroll-margin-inline-end"],name:"scroll-margin-inline"},{name:"scroll-margin-inline-end"},{name:"scroll-margin-inline-start"},{name:"scroll-margin-left"},{name:"scroll-margin-right"},{name:"scroll-margin-top"},{keywords:["none","auto"],name:"scroll-marker-contain"},{keywords:["none","after","before"],name:"scroll-marker-group"},{longhands:["scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left"],name:"scroll-padding"},{longhands:["scroll-padding-block-start","scroll-padding-block-end"],name:"scroll-padding-block"},{keywords:["auto"],name:"scroll-padding-block-end"},{keywords:["auto"],name:"scroll-padding-block-start"},{keywords:["auto"],name:"scroll-padding-bottom"},{longhands:["scroll-padding-inline-start","scroll-padding-inline-end"],name:"scroll-padding-inline"},{keywords:["auto"],name:"scroll-padding-inline-end"},{keywords:["auto"],name:"scroll-padding-inline-start"},{keywords:["auto"],name:"scroll-padding-left"},{keywords:["auto"],name:"scroll-padding-right"},{keywords:["auto"],name:"scroll-padding-top"},{keywords:["none","start","end","center"],name:"scroll-snap-align"},{keywords:["normal","always"],name:"scroll-snap-stop"},{keywords:["none","x","y","block","inline","both","mandatory","proximity"],name:"scroll-snap-type"},{longhands:["scroll-start-block","scroll-start-inline"],name:"scroll-start"},{name:"scroll-start-block"},{name:"scroll-start-inline"},{name:"scroll-start-x"},{name:"scroll-start-y"},{longhands:["scroll-timeline-name","scroll-timeline-axis"],name:"scroll-timeline"},{name:"scroll-timeline-axis"},{name:"scroll-timeline-name"},{inherited:!0,keywords:["auto"],name:"scrollbar-color"},{inherited:!1,keywords:["auto","stable","both-edges"],name:"scrollbar-gutter"},{inherited:!1,keywords:["auto","thin","none"],name:"scrollbar-width"},{name:"shape-image-threshold"},{keywords:["none"],name:"shape-margin"},{keywords:["none"],name:"shape-outside"},{inherited:!0,keywords:["auto","optimizespeed","crispedges","geometricprecision"],name:"shape-rendering"},{name:"size"},{name:"size-adjust"},{inherited:!0,keywords:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"],name:"speak"},{name:"speak-as"},{name:"src"},{keywords:["currentcolor"],name:"stop-color"},{name:"stop-opacity"},{inherited:!0,name:"stroke"},{inherited:!0,keywords:["none"],name:"stroke-dasharray"},{inherited:!0,name:"stroke-dashoffset"},{inherited:!0,keywords:["butt","round","square"],name:"stroke-linecap"},{inherited:!0,keywords:["miter","bevel","round"],name:"stroke-linejoin"},{inherited:!0,name:"stroke-miterlimit"},{inherited:!0,name:"stroke-opacity"},{inherited:!0,name:"stroke-width"},{name:"suffix"},{name:"symbols"},{name:"syntax"},{name:"system"},{inherited:!0,name:"tab-size"},{keywords:["auto","fixed"],name:"table-layout"},{inherited:!0,keywords:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"],name:"text-align"},{inherited:!0,keywords:["auto","start","end","left","right","center","justify"],name:"text-align-last"},{inherited:!0,keywords:["start","middle","end"],name:"text-anchor"},{inherited:!0,keywords:["normal","no-autospace"],name:"text-autospace"},{longhands:["text-box-trim","text-box-edge"],name:"text-box"},{inherited:!0,name:"text-box-edge"},{keywords:["none","trim-start","trim-end","trim-both"],name:"text-box-trim"},{inherited:!0,keywords:["none","all"],name:"text-combine-upright"},{longhands:["text-decoration-line","text-decoration-thickness","text-decoration-style","text-decoration-color"],name:"text-decoration"},{keywords:["currentcolor"],name:"text-decoration-color"},{keywords:["none","underline","overline","line-through","blink","spelling-error","grammar-error"],name:"text-decoration-line"},{inherited:!0,keywords:["none","auto"],name:"text-decoration-skip-ink"},{keywords:["solid","double","dotted","dashed","wavy"],name:"text-decoration-style"},{inherited:!1,keywords:["auto","from-font"],name:"text-decoration-thickness"},{inherited:!0,longhands:["text-emphasis-style","text-emphasis-color"],name:"text-emphasis"},{inherited:!0,keywords:["currentcolor"],name:"text-emphasis-color"},{inherited:!0,name:"text-emphasis-position"},{inherited:!0,name:"text-emphasis-style"},{inherited:!0,name:"text-indent"},{inherited:!0,keywords:["sideways","mixed","upright"],name:"text-orientation"},{keywords:["clip","ellipsis"],name:"text-overflow"},{inherited:!0,keywords:["auto","optimizespeed","optimizelegibility","geometricprecision"],name:"text-rendering"},{inherited:!0,keywords:["none"],name:"text-shadow"},{inherited:!0,keywords:["none","auto"],name:"text-size-adjust"},{inherited:!0,longhands:["text-autospace","text-spacing-trim"],name:"text-spacing"},{inherited:!0,keywords:["normal","space-all","space-first","trim-start"],name:"text-spacing-trim"},{inherited:!0,keywords:["capitalize","uppercase","lowercase","none","math-auto"],name:"text-transform"},{inherited:!0,keywords:["auto"],name:"text-underline-offset"},{inherited:!0,keywords:["auto","from-font","under","left","right"],name:"text-underline-position"},{inherited:!0,longhands:["text-wrap-mode","text-wrap-style"],name:"text-wrap"},{inherited:!0,keywords:["wrap","nowrap"],name:"text-wrap-mode"},{inherited:!0,keywords:["auto","balance","pretty","stable"],name:"text-wrap-style"},{name:"timeline-scope"},{keywords:["auto"],name:"top"},{keywords:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"],name:"touch-action"},{keywords:["none"],name:"transform"},{keywords:["content-box","border-box","fill-box","stroke-box","view-box"],name:"transform-box"},{name:"transform-origin"},{keywords:["flat","preserve-3d"],name:"transform-style"},{longhands:["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"],name:"transition"},{keywords:["normal","allow-discrete"],name:"transition-behavior"},{name:"transition-delay"},{name:"transition-duration"},{keywords:["none"],name:"transition-property"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"transition-timing-function"},{name:"translate"},{name:"types"},{keywords:["normal","embed","bidi-override","isolate","plaintext","isolate-override"],name:"unicode-bidi"},{name:"unicode-range"},{inherited:!0,keywords:["auto","none","text","all","contain"],name:"user-select"},{keywords:["none","non-scaling-stroke"],name:"vector-effect"},{keywords:["baseline","sub","super","text-top","text-bottom","middle"],name:"vertical-align"},{longhands:["view-timeline-name","view-timeline-axis","view-timeline-inset"],name:"view-timeline"},{name:"view-timeline-axis"},{name:"view-timeline-inset"},{name:"view-timeline-name"},{keywords:["none"],name:"view-transition-class"},{keywords:["normal","contain","nearest"],name:"view-transition-group"},{keywords:["none","auto"],name:"view-transition-name"},{inherited:!0,keywords:["visible","hidden","collapse"],name:"visibility"},{inherited:!0,longhands:["white-space-collapse","text-wrap-mode"],name:"white-space"},{inherited:!0,keywords:["collapse","preserve","preserve-breaks","break-spaces"],name:"white-space-collapse"},{inherited:!0,name:"widows"},{keywords:["auto","fit-content","min-content","max-content"],name:"width"},{keywords:["auto"],name:"will-change"},{inherited:!0,keywords:["normal","break-all","keep-all","break-word","auto-phrase"],name:"word-break"},{inherited:!0,keywords:["normal"],name:"word-spacing"},{inherited:!0,keywords:["horizontal-tb","vertical-rl","vertical-lr","sideways-rl","sideways-lr"],name:"writing-mode"},{name:"x"},{name:"y"},{keywords:["auto"],name:"z-index"},{name:"zoom"}],p={"-webkit-box-align":{values:["stretch","start","center","end","baseline"]},"-webkit-box-decoration-break":{values:["slice","clone"]},"-webkit-box-direction":{values:["normal","reverse"]},"-webkit-box-orient":{values:["horizontal","vertical"]},"-webkit-box-pack":{values:["start","center","end","justify"]},"-webkit-line-break":{values:["auto","loose","normal","strict","after-white-space","anywhere"]},"-webkit-line-clamp":{values:["none"]},"-webkit-rtl-ordering":{values:["logical","visual"]},"-webkit-text-security":{values:["none","disc","circle","square"]},"-webkit-user-drag":{values:["auto","none","element"]},"-webkit-user-modify":{values:["read-only","read-write","read-write-plaintext-only"]},"accent-color":{values:["auto","currentcolor"]},"alignment-baseline":{values:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"]},"anchor-name":{values:["none"]},"anchor-scope":{values:["none","all"]},"animation-composition":{values:["replace","add","accumulate"]},"animation-direction":{values:["normal","reverse","alternate","alternate-reverse"]},"animation-fill-mode":{values:["none","forwards","backwards","both"]},"animation-iteration-count":{values:["infinite"]},"animation-name":{values:["none"]},"animation-play-state":{values:["running","paused"]},"animation-timeline":{values:["none","auto"]},"animation-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"animation-trigger-timeline":{values:["none","auto"]},"animation-trigger-type":{values:["once","repeat","alternate","state"]},"app-region":{values:["none","drag","no-drag"]},"aspect-ratio":{values:["auto"]},"backdrop-filter":{values:["none"]},"backface-visibility":{values:["visible","hidden"]},"background-attachment":{values:["scroll","fixed","local"]},"background-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"background-clip":{values:["border-box","padding-box","content-box","text"]},"background-color":{values:["currentcolor"]},"background-image":{values:["auto","none"]},"background-origin":{values:["border-box","padding-box","content-box"]},"background-size":{values:["auto","cover","contain"]},"baseline-shift":{values:["baseline","sub","super"]},"baseline-source":{values:["auto","first","last"]},"block-size":{values:["auto"]},"border-bottom-color":{values:["currentcolor"]},"border-bottom-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-bottom-width":{values:["thin","medium","thick"]},"border-collapse":{values:["separate","collapse"]},"border-image-repeat":{values:["stretch","repeat","round","space"]},"border-image-source":{values:["none"]},"border-image-width":{values:["auto"]},"border-left-color":{values:["currentcolor"]},"border-left-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-left-width":{values:["thin","medium","thick"]},"border-right-color":{values:["currentcolor"]},"border-right-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-right-width":{values:["thin","medium","thick"]},"border-style":{values:["none"]},"border-top-color":{values:["currentcolor"]},"border-top-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-top-width":{values:["thin","medium","thick"]},bottom:{values:["auto"]},"box-decoration-break":{values:["slice","clone"]},"box-shadow":{values:["none"]},"box-sizing":{values:["content-box","border-box"]},"break-after":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-before":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-inside":{values:["auto","avoid","avoid-column","avoid-page"]},"buffered-rendering":{values:["auto","dynamic","static"]},"caption-side":{values:["top","bottom"]},"caret-animation":{values:["auto","manual"]},"caret-color":{values:["auto","currentcolor"]},clear:{values:["none","left","right","both","inline-start","inline-end"]},clip:{values:["auto"]},"clip-path":{values:["border-box","padding-box","content-box","margin-box","fill-box","stroke-box","view-box","none"]},"clip-rule":{values:["nonzero","evenodd"]},color:{values:["currentcolor"]},"color-interpolation":{values:["auto","srgb","linearrgb"]},"color-interpolation-filters":{values:["auto","srgb","linearrgb"]},"color-rendering":{values:["auto","optimizespeed","optimizequality"]},"column-count":{values:["auto"]},"column-fill":{values:["balance","auto"]},"column-gap":{values:["normal"]},"column-height":{values:["auto"]},"column-rule-break":{values:["none","spanning-item","intersection"]},"column-rule-color":{values:["currentcolor"]},"column-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"column-rule-width":{values:["thin","medium","thick"]},"column-span":{values:["none","all"]},"column-width":{values:["auto"]},"column-wrap":{values:["nowrap","wrap"]},contain:{values:["none","strict","content","size","layout","style","paint","inline-size","block-size"]},"contain-intrinsic-height":{values:["none"]},"contain-intrinsic-width":{values:["none"]},"container-name":{values:["none"]},"container-type":{values:["normal","inline-size","size","scroll-state"]},"content-visibility":{values:["visible","auto","hidden"]},"counter-increment":{values:["none"]},"counter-reset":{values:["none"]},"counter-set":{values:["none"]},cursor:{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]},d:{values:["none"]},direction:{values:["ltr","rtl"]},display:{values:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math","ruby","ruby-text","masonry","inline-masonry"]},"dominant-baseline":{values:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"]},"dynamic-range-limit":{values:["standard","no-limit","constrained"]},"empty-cells":{values:["show","hide"]},"field-sizing":{values:["fixed","content"]},"fill-rule":{values:["nonzero","evenodd"]},filter:{values:["none"]},"flex-basis":{values:["auto","fit-content","min-content","max-content","content"]},"flex-direction":{values:["row","row-reverse","column","column-reverse"]},"flex-wrap":{values:["nowrap","wrap","wrap-reverse"]},float:{values:["none","left","right","inline-start","inline-end"]},"flood-color":{values:["currentcolor"]},"font-feature-settings":{values:["normal"]},"font-kerning":{values:["auto","normal","none"]},"font-optical-sizing":{values:["auto","none"]},"font-palette":{values:["normal","light","dark"]},"font-size":{values:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"]},"font-size-adjust":{values:["none","ex-height","cap-height","ch-width","ic-width","ic-height","from-font"]},"font-stretch":{values:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]},"font-style":{values:["normal","italic","oblique"]},"font-synthesis-small-caps":{values:["auto","none"]},"font-synthesis-style":{values:["auto","none"]},"font-synthesis-weight":{values:["auto","none"]},"font-variant-alternates":{values:["normal"]},"font-variant-caps":{values:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]},"font-variant-east-asian":{values:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"]},"font-variant-emoji":{values:["normal","text","emoji","unicode"]},"font-variant-ligatures":{values:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"]},"font-variant-numeric":{values:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"]},"font-variant-position":{values:["normal","sub","super"]},"font-variation-settings":{values:["normal"]},"font-weight":{values:["normal","bold","bolder","lighter"]},"forced-color-adjust":{values:["auto","none","preserve-parent-color"]},"gap-rule-paint-order":{values:["row-over-column","column-over-row"]},"grid-auto-columns":{values:["auto","min-content","max-content"]},"grid-auto-flow":{values:["row","column"]},"grid-auto-rows":{values:["auto","min-content","max-content"]},"grid-column-end":{values:["auto"]},"grid-column-start":{values:["auto"]},"grid-row-end":{values:["auto"]},"grid-row-start":{values:["auto"]},"grid-template-areas":{values:["none"]},"grid-template-columns":{values:["none"]},"grid-template-rows":{values:["none"]},height:{values:["auto","fit-content","min-content","max-content"]},"hyphenate-limit-chars":{values:["auto"]},hyphens:{values:["none","manual","auto"]},"image-rendering":{values:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"]},"initial-letter":{values:["drop","normal","raise"]},"inline-size":{values:["auto"]},interactivity:{values:["auto","inert"]},"interpolate-size":{values:["numeric-only","allow-keywords"]},isolation:{values:["auto","isolate"]},left:{values:["auto"]},"letter-spacing":{values:["normal"]},"lighting-color":{values:["currentcolor"]},"line-break":{values:["auto","loose","normal","strict","anywhere"]},"line-clamp":{values:["none","auto"]},"line-height":{values:["normal"]},"list-style-image":{values:["none"]},"list-style-position":{values:["outside","inside"]},"list-style-type":{values:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"]},"margin-block-end":{values:["auto"]},"margin-block-start":{values:["auto"]},"margin-bottom":{values:["auto"]},"margin-inline-end":{values:["auto"]},"margin-inline-start":{values:["auto"]},"margin-left":{values:["auto"]},"margin-right":{values:["auto"]},"margin-top":{values:["auto"]},"marker-end":{values:["none"]},"marker-mid":{values:["none"]},"marker-start":{values:["none"]},"mask-type":{values:["luminance","alpha"]},"masonry-auto-tracks":{values:["auto","min-content","max-content"]},"masonry-direction":{values:["row","row-reverse","column","column-reverse"]},"masonry-fill":{values:["normal","reverse"]},"masonry-slack":{values:["normal"]},"masonry-track-end":{values:["auto"]},"masonry-track-start":{values:["auto"]},"math-shift":{values:["normal","compact"]},"math-style":{values:["normal","compact"]},"max-block-size":{values:["none"]},"max-height":{values:["none"]},"max-inline-size":{values:["none"]},"max-width":{values:["none"]},"mix-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},"object-fit":{values:["fill","contain","cover","none","scale-down"]},"object-view-box":{values:["none"]},"offset-anchor":{values:["auto"]},"offset-path":{values:["none"]},"offset-position":{values:["auto","normal"]},"offset-rotate":{values:["auto","reverse"]},"origin-trial-test-property":{values:["normal","none"]},"outline-color":{values:["currentcolor"]},"outline-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"outline-width":{values:["thin","medium","thick"]},"overflow-anchor":{values:["visible","none","auto"]},"overflow-clip-margin":{values:["border-box","content-box","padding-box"]},"overflow-wrap":{values:["normal","break-word","anywhere"]},"overflow-x":{values:["visible","hidden","scroll","auto","overlay","clip"]},"overflow-y":{values:["visible","hidden","scroll","auto","overlay","clip"]},overlay:{values:["none","auto"]},"overscroll-behavior-x":{values:["auto","contain","none"]},"overscroll-behavior-y":{values:["auto","contain","none"]},page:{values:["auto"]},"paint-order":{values:["normal","fill","stroke","markers"]},perspective:{values:["none"]},"pointer-events":{values:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"]},position:{values:["static","relative","absolute","fixed","sticky"]},"position-anchor":{values:["auto"]},"position-area":{values:["none","top","bottom","center","left","right","x-start","x-end","y-start","y-end","start","end","self-start","self-end","all"]},"position-try-fallbacks":{values:["none","flip-block","flip-inline","flip-start"]},"position-try-order":{values:["normal","most-width","most-height","most-block-size","most-inline-size"]},"position-visibility":{values:["always","anchors-visible","no-overflow"]},"print-color-adjust":{values:["economy","exact"]},quotes:{values:["auto","none"]},"reading-flow":{values:["normal","flex-visual","flex-flow","grid-rows","grid-columns","grid-order","source-order"]},resize:{values:["none","both","horizontal","vertical","block","inline"]},right:{values:["auto"]},"row-gap":{values:["normal"]},"row-rule-break":{values:["none","spanning-item","intersection"]},"row-rule-color":{values:["currentcolor"]},"row-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"row-rule-width":{values:["thin","medium","thick"]},"ruby-align":{values:["space-around","start","center","space-between"]},"ruby-position":{values:["over","under"]},rx:{values:["auto"]},ry:{values:["auto"]},"scroll-behavior":{values:["auto","smooth"]},"scroll-initial-target":{values:["none","nearest"]},"scroll-marker-contain":{values:["none","auto"]},"scroll-marker-group":{values:["none","after","before"]},"scroll-padding-block-end":{values:["auto"]},"scroll-padding-block-start":{values:["auto"]},"scroll-padding-bottom":{values:["auto"]},"scroll-padding-inline-end":{values:["auto"]},"scroll-padding-inline-start":{values:["auto"]},"scroll-padding-left":{values:["auto"]},"scroll-padding-right":{values:["auto"]},"scroll-padding-top":{values:["auto"]},"scroll-snap-align":{values:["none","start","end","center"]},"scroll-snap-stop":{values:["normal","always"]},"scroll-snap-type":{values:["none","x","y","block","inline","both","mandatory","proximity"]},"scrollbar-color":{values:["auto"]},"scrollbar-gutter":{values:["auto","stable","both-edges"]},"scrollbar-width":{values:["auto","thin","none"]},"shape-margin":{values:["none"]},"shape-outside":{values:["none"]},"shape-rendering":{values:["auto","optimizespeed","crispedges","geometricprecision"]},speak:{values:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"]},"stop-color":{values:["currentcolor"]},"stroke-dasharray":{values:["none"]},"stroke-linecap":{values:["butt","round","square"]},"stroke-linejoin":{values:["miter","bevel","round"]},"table-layout":{values:["auto","fixed"]},"text-align":{values:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"]},"text-align-last":{values:["auto","start","end","left","right","center","justify"]},"text-anchor":{values:["start","middle","end"]},"text-autospace":{values:["normal","no-autospace"]},"text-box-trim":{values:["none","trim-start","trim-end","trim-both"]},"text-combine-upright":{values:["none","all"]},"text-decoration-color":{values:["currentcolor"]},"text-decoration-line":{values:["none","underline","overline","line-through","blink","spelling-error","grammar-error"]},"text-decoration-skip-ink":{values:["none","auto"]},"text-decoration-style":{values:["solid","double","dotted","dashed","wavy"]},"text-decoration-thickness":{values:["auto","from-font"]},"text-emphasis-color":{values:["currentcolor"]},"text-orientation":{values:["sideways","mixed","upright"]},"text-overflow":{values:["clip","ellipsis"]},"text-rendering":{values:["auto","optimizespeed","optimizelegibility","geometricprecision"]},"text-shadow":{values:["none"]},"text-size-adjust":{values:["none","auto"]},"text-spacing-trim":{values:["normal","space-all","space-first","trim-start"]},"text-transform":{values:["capitalize","uppercase","lowercase","none","math-auto"]},"text-underline-offset":{values:["auto"]},"text-underline-position":{values:["auto","from-font","under","left","right"]},"text-wrap-mode":{values:["wrap","nowrap"]},"text-wrap-style":{values:["auto","balance","pretty","stable"]},top:{values:["auto"]},"touch-action":{values:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"]},transform:{values:["none"]},"transform-box":{values:["content-box","border-box","fill-box","stroke-box","view-box"]},"transform-style":{values:["flat","preserve-3d"]},"transition-behavior":{values:["normal","allow-discrete"]},"transition-property":{values:["none"]},"transition-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"unicode-bidi":{values:["normal","embed","bidi-override","isolate","plaintext","isolate-override"]},"user-select":{values:["auto","none","text","all","contain"]},"vector-effect":{values:["none","non-scaling-stroke"]},"vertical-align":{values:["baseline","sub","super","text-top","text-bottom","middle"]},"view-transition-class":{values:["none"]},"view-transition-group":{values:["normal","contain","nearest"]},"view-transition-name":{values:["none","auto"]},visibility:{values:["visible","hidden","collapse"]},"white-space-collapse":{values:["collapse","preserve","preserve-breaks","break-spaces"]},width:{values:["auto","fit-content","min-content","max-content"]},"will-change":{values:["auto"]},"word-break":{values:["normal","break-all","keep-all","break-word","auto-phrase"]},"word-spacing":{values:["normal"]},"writing-mode":{values:["horizontal-tb","vertical-rl","vertical-lr","sideways-rl","sideways-lr"]},"z-index":{values:["auto"]}},m=new Map([["-epub-caption-side","caption-side"],["-epub-text-combine","-webkit-text-combine"],["-epub-text-emphasis","text-emphasis"],["-epub-text-emphasis-color","text-emphasis-color"],["-epub-text-emphasis-style","text-emphasis-style"],["-epub-text-orientation","-webkit-text-orientation"],["-epub-text-transform","text-transform"],["-epub-word-break","word-break"],["-epub-writing-mode","-webkit-writing-mode"],["-webkit-align-content","align-content"],["-webkit-align-items","align-items"],["-webkit-align-self","align-self"],["-webkit-animation","animation"],["-webkit-animation-delay","animation-delay"],["-webkit-animation-direction","animation-direction"],["-webkit-animation-duration","animation-duration"],["-webkit-animation-fill-mode","animation-fill-mode"],["-webkit-animation-iteration-count","animation-iteration-count"],["-webkit-animation-name","animation-name"],["-webkit-animation-play-state","animation-play-state"],["-webkit-animation-timing-function","animation-timing-function"],["-webkit-app-region","app-region"],["-webkit-appearance","appearance"],["-webkit-backface-visibility","backface-visibility"],["-webkit-background-clip","background-clip"],["-webkit-background-origin","background-origin"],["-webkit-background-size","background-size"],["-webkit-border-after","border-block-end"],["-webkit-border-after-color","border-block-end-color"],["-webkit-border-after-style","border-block-end-style"],["-webkit-border-after-width","border-block-end-width"],["-webkit-border-before","border-block-start"],["-webkit-border-before-color","border-block-start-color"],["-webkit-border-before-style","border-block-start-style"],["-webkit-border-before-width","border-block-start-width"],["-webkit-border-bottom-left-radius","border-bottom-left-radius"],["-webkit-border-bottom-right-radius","border-bottom-right-radius"],["-webkit-border-end","border-inline-end"],["-webkit-border-end-color","border-inline-end-color"],["-webkit-border-end-style","border-inline-end-style"],["-webkit-border-end-width","border-inline-end-width"],["-webkit-border-radius","border-radius"],["-webkit-border-start","border-inline-start"],["-webkit-border-start-color","border-inline-start-color"],["-webkit-border-start-style","border-inline-start-style"],["-webkit-border-start-width","border-inline-start-width"],["-webkit-border-top-left-radius","border-top-left-radius"],["-webkit-border-top-right-radius","border-top-right-radius"],["-webkit-box-shadow","box-shadow"],["-webkit-box-sizing","box-sizing"],["-webkit-clip-path","clip-path"],["-webkit-column-count","column-count"],["-webkit-column-gap","column-gap"],["-webkit-column-rule","column-rule"],["-webkit-column-rule-color","column-rule-color"],["-webkit-column-rule-style","column-rule-style"],["-webkit-column-rule-width","column-rule-width"],["-webkit-column-span","column-span"],["-webkit-column-width","column-width"],["-webkit-columns","columns"],["-webkit-filter","filter"],["-webkit-flex","flex"],["-webkit-flex-basis","flex-basis"],["-webkit-flex-direction","flex-direction"],["-webkit-flex-flow","flex-flow"],["-webkit-flex-grow","flex-grow"],["-webkit-flex-shrink","flex-shrink"],["-webkit-flex-wrap","flex-wrap"],["-webkit-font-feature-settings","font-feature-settings"],["-webkit-hyphenate-character","hyphenate-character"],["-webkit-justify-content","justify-content"],["-webkit-logical-height","block-size"],["-webkit-logical-width","inline-size"],["-webkit-margin-after","margin-block-end"],["-webkit-margin-before","margin-block-start"],["-webkit-margin-end","margin-inline-end"],["-webkit-margin-start","margin-inline-start"],["-webkit-mask","mask"],["-webkit-mask-clip","mask-clip"],["-webkit-mask-composite","mask-composite"],["-webkit-mask-image","mask-image"],["-webkit-mask-origin","mask-origin"],["-webkit-mask-position","mask-position"],["-webkit-mask-repeat","mask-repeat"],["-webkit-mask-size","mask-size"],["-webkit-max-logical-height","max-block-size"],["-webkit-max-logical-width","max-inline-size"],["-webkit-min-logical-height","min-block-size"],["-webkit-min-logical-width","min-inline-size"],["-webkit-opacity","opacity"],["-webkit-order","order"],["-webkit-padding-after","padding-block-end"],["-webkit-padding-before","padding-block-start"],["-webkit-padding-end","padding-inline-end"],["-webkit-padding-start","padding-inline-start"],["-webkit-perspective","perspective"],["-webkit-perspective-origin","perspective-origin"],["-webkit-print-color-adjust","print-color-adjust"],["-webkit-shape-image-threshold","shape-image-threshold"],["-webkit-shape-margin","shape-margin"],["-webkit-shape-outside","shape-outside"],["-webkit-text-emphasis","text-emphasis"],["-webkit-text-emphasis-color","text-emphasis-color"],["-webkit-text-emphasis-position","text-emphasis-position"],["-webkit-text-emphasis-style","text-emphasis-style"],["-webkit-text-size-adjust","text-size-adjust"],["-webkit-transform","transform"],["-webkit-transform-origin","transform-origin"],["-webkit-transform-style","transform-style"],["-webkit-transition","transition"],["-webkit-transition-delay","transition-delay"],["-webkit-transition-duration","transition-duration"],["-webkit-transition-property","transition-property"],["-webkit-transition-timing-function","transition-timing-function"],["-webkit-user-select","user-select"],["grid-column-gap","column-gap"],["grid-gap","gap"],["grid-row-gap","row-gap"],["word-wrap","overflow-wrap"]]);class f{#t=[];#n=new Map;#r=new Map;#s=new Set;#i=new Set;#o=new Map;#a=new Map;#l=[];#d=[];#c;constructor(e,t){this.#a=t;for(let t=0;t<e.length;++t){const n=e[t],r=n.name;if(!CSS.supports(r,"initial"))continue;this.#t.push(r),n.inherited&&this.#s.add(r),n.svg&&this.#i.add(r);const s=e[t].longhands;if(s){this.#n.set(r,s);for(let e=0;e<s.length;++e){const t=s[e];let n=this.#r.get(t);n||(n=[],this.#r.set(t,n)),n.push(r)}}}this.#t.sort(f.sortPrefixesAndCSSWideKeywordsToEnd),this.#c=new Set(this.#t);const n=new Map;for(const[e,t]of Object.entries(p))n.set(e,new Set(t.values));for(const[e,t]of D){const r=n.get(e);r?n.set(e,r.union(t)):n.set(e,t)}for(const[e,t]of n){for(const n of F)!t.has(n)&&CSS.supports(e,n)&&t.add(n);this.#o.set(e,[...t])}for(const e of this.#c){const t=this.specificPropertyValues(e).filter((t=>CSS.supports(e,t))).sort(f.sortPrefixesAndCSSWideKeywordsToEnd).map((t=>`${e}: ${t}`));this.isSVGProperty(e)||this.#l.push(...t),this.#d.push(...t)}}static isCSSWideKeyword(e){return y.includes(e)}static isPositionTryOrderKeyword(e){return v.includes(e)}static sortPrefixesAndCSSWideKeywordsToEnd(e,t){const n=f.isCSSWideKeyword(e),r=f.isCSSWideKeyword(t);if(n&&!r)return 1;if(!n&&r)return-1;const s=e.startsWith("-webkit-"),i=t.startsWith("-webkit-");return s&&!i?1:!s&&i||e<t?-1:e>t?1:0}allProperties(){return this.#t}aliasesFor(){return this.#a}nameValuePresets(e){return e?this.#d:this.#l}isSVGProperty(e){return e=e.toLowerCase(),this.#i.has(e)}getLonghands(e){return this.#n.get(e)||null}getShorthands(e){return this.#r.get(e)||null}isColorAwareProperty(e){return E.has(e.toLowerCase())||this.isCustomProperty(e.toLowerCase())}isFontFamilyProperty(e){return"font-family"===e.toLowerCase()}isAngleAwareProperty(e){const t=e.toLowerCase();return E.has(t)||L.has(t)}isGridAreaDefiningProperty(e){return"grid"===(e=e.toLowerCase())||"grid-template"===e||"grid-template-areas"===e}isGridColumnNameAwareProperty(e){return e=e.toLowerCase(),["grid-column","grid-column-start","grid-column-end"].includes(e)}isGridRowNameAwareProperty(e){return e=e.toLowerCase(),["grid-row","grid-row-start","grid-row-end"].includes(e)}isGridAreaNameAwareProperty(e){return"grid-area"===(e=e.toLowerCase())}isGridNameAwareProperty(e){return this.isGridAreaNameAwareProperty(e)||this.isGridColumnNameAwareProperty(e)||this.isGridRowNameAwareProperty(e)}isLengthProperty(e){return"line-height"!==(e=e.toLowerCase())&&(T.has(e)||e.startsWith("margin")||e.startsWith("padding")||-1!==e.indexOf("width")||-1!==e.indexOf("height"))}isBezierAwareProperty(e){return e=e.toLowerCase(),M.has(e)||this.isCustomProperty(e)}isFontAwareProperty(e){return e=e.toLowerCase(),P.has(e)||this.isCustomProperty(e)}isCustomProperty(e){return e.startsWith("--")}isShadowProperty(e){return"box-shadow"===(e=e.toLowerCase())||"text-shadow"===e||"-webkit-box-shadow"===e}isStringProperty(e){return"content"===(e=e.toLowerCase())}canonicalPropertyName(e){if(this.isCustomProperty(e))return e;e=e.toLowerCase();const t=this.#a.get(e);if(t)return t;if(!e||e.length<9||"-"!==e.charAt(0))return e;const n=e.match(/(?:-webkit-)(.+)/);return n&&this.#c.has(n[1])?n[1]:e}isCSSPropertyName(e){return!!((e=e.toLowerCase()).startsWith("--")&&e.length>2||e.startsWith("-moz-")||e.startsWith("-ms-")||e.startsWith("-o-")||e.startsWith("-webkit-"))||this.#c.has(e)}isPropertyInherited(e){return(e=e.toLowerCase()).startsWith("--")||this.#s.has(this.canonicalPropertyName(e))||this.#s.has(e)}specificPropertyValues(e){const t=e.replace(/^-webkit-/,""),n=this.#o;let r=n.get(e)||n.get(t);if(!r){r=[];for(const t of F)CSS.supports(e,t)&&r.push(t);n.set(e,r)}return r}getPropertyValues(t){t=t.toLowerCase();const n=[...this.specificPropertyValues(t),...y];if(this.isColorAwareProperty(t)){n.push("currentColor");for(const t of e.Color.Nicknames.keys())n.push(t)}return n.sort(f.sortPrefixesAndCSSWideKeywordsToEnd)}propertyUsageWeight(e){return N.get(e)||N.get(this.canonicalPropertyName(e))||0}getValuePreset(e,t){const n=R.get(e);let r=n?n.get(t):null;if(!r)return null;let s=r.length,i=r.length;return r&&(s=r.indexOf("|"),i=r.lastIndexOf("|"),i=s===i?i:i-1,r=r.replace(/\|/g,"")),{text:r,startColumn:s,endColumn:i}}isHighlightPseudoType(e){return"highlight"===e||"selection"===e||"target-text"===e||"grammar-error"===e||"spelling-error"===e}}const b=new Map([["linear","cubic-bezier(0, 0, 1, 1)"],["ease","cubic-bezier(0.25, 0.1, 0.25, 1)"],["ease-in","cubic-bezier(0.42, 0, 1, 1)"],["ease-in-out","cubic-bezier(0.42, 0, 0.58, 1)"],["ease-out","cubic-bezier(0, 0, 0.58, 1)"]]),y=["inherit","initial","revert","revert-layer","unset"],v=["normal","most-height","most-width","most-block-size","most-inline-size"],I=/((?:\[[\w\- ]+\]\s*)*(?:"[^"]+"|'[^']+'))[^'"\[]*\[?[^'"\[]*/;let w=null;function S(){if(!w){w=new f(g,m)}return w}const k=new Map([["linear-gradient","linear-gradient(|45deg, black, transparent|)"],["radial-gradient","radial-gradient(|black, transparent|)"],["repeating-linear-gradient","repeating-linear-gradient(|45deg, black, transparent 100px|)"],["repeating-radial-gradient","repeating-radial-gradient(|black, transparent 100px|)"],["url","url(||)"]]),C=new Map([["blur","blur(|1px|)"],["brightness","brightness(|0.5|)"],["contrast","contrast(|0.5|)"],["drop-shadow","drop-shadow(|2px 4px 6px black|)"],["grayscale","grayscale(|1|)"],["hue-rotate","hue-rotate(|45deg|)"],["invert","invert(|1|)"],["opacity","opacity(|0.5|)"],["saturate","saturate(|0.5|)"],["sepia","sepia(|1|)"],["url","url(||)"]]),x=new Map([["superellipse(0.5)","superellipse(|0.5|)"],["superellipse(infinity)","superellipse(|infinity|)"]]),R=new Map([["filter",C],["backdrop-filter",C],["background",k],["background-image",k],["-webkit-mask-image",k],["transform",new Map([["scale","scale(|1.5|)"],["scaleX","scaleX(|1.5|)"],["scaleY","scaleY(|1.5|)"],["scale3d","scale3d(|1.5, 1.5, 1.5|)"],["rotate","rotate(|45deg|)"],["rotateX","rotateX(|45deg|)"],["rotateY","rotateY(|45deg|)"],["rotateZ","rotateZ(|45deg|)"],["rotate3d","rotate3d(|1, 1, 1, 45deg|)"],["skew","skew(|10deg, 10deg|)"],["skewX","skewX(|10deg|)"],["skewY","skewY(|10deg|)"],["translate","translate(|10px, 10px|)"],["translateX","translateX(|10px|)"],["translateY","translateY(|10px|)"],["translateZ","translateZ(|10px|)"],["translate3d","translate3d(|10px, 10px, 10px|)"],["matrix","matrix(|1, 0, 0, 1, 0, 0|)"],["matrix3d","matrix3d(|1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1|)"],["perspective","perspective(|10px|)"]])],["corner-shape",x]]),T=new Set(["background-position","border-spacing","bottom","font-size","height","left","letter-spacing","max-height","max-width","min-height","min-width","right","text-indent","top","width","word-spacing","grid-row-gap","grid-column-gap","row-gap"]),M=new Set(["animation","animation-timing-function","transition","transition-timing-function","-webkit-animation","-webkit-animation-timing-function","-webkit-transition","-webkit-transition-timing-function"]),P=new Set(["font-size","line-height","font-weight","font-family","letter-spacing"]),E=new Set(["accent-color","background","background-color","background-image","border","border-color","border-image","border-image-source","border-bottom","border-bottom-color","border-left","border-left-color","border-right","border-right-color","border-top","border-top-color","border-block","border-block-color","border-block-end","border-block-end-color","border-block-start","border-block-start-color","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-start","border-inline-start-color","box-shadow","caret-color","color","column-rule","column-rule-color","content","fill","list-style-image","mask","mask-image","mask-border","mask-border-source","outline","outline-color","scrollbar-color","stop-color","stroke","text-decoration-color","text-shadow","text-emphasis","text-emphasis-color","-webkit-border-after","-webkit-border-after-color","-webkit-border-before","-webkit-border-before-color","-webkit-border-end","-webkit-border-end-color","-webkit-border-start","-webkit-border-start-color","-webkit-box-reflect","-webkit-box-shadow","-webkit-column-rule-color","-webkit-mask","-webkit-mask-box-image","-webkit-mask-box-image-source","-webkit-mask-image","-webkit-tap-highlight-color","-webkit-text-emphasis","-webkit-text-emphasis-color","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","flood-color","lighting-color","stop-color"]),L=new Set(["-webkit-border-image","transform","-webkit-transform","rotate","filter","-webkit-filter","backdrop-filter","offset","offset-rotate","font-style"]),A=new Set(["over","under","over right","over left","under right","under left"]),O=new Set(["none","dot","circle","double-circle","triangle","sesame","filled","open","dot open","circle open","double-circle open","triangle open","sesame open",'"❤️"']),D=new Map([["background-repeat",new Set(["repeat","repeat-x","repeat-y","no-repeat","space","round"])],["content",new Set(["normal","close-quote","no-close-quote","no-open-quote","open-quote"])],["baseline-shift",new Set(["baseline"])],["max-height",new Set(["min-content","max-content","-webkit-fill-available","fit-content"])],["color",new Set(["black"])],["background-color",new Set(["white"])],["box-shadow",new Set(["inset"])],["text-shadow",new Set(["0 0 black"])],["-webkit-writing-mode",new Set(["horizontal-tb","vertical-rl","vertical-lr"])],["writing-mode",new Set(["lr","rl","tb","lr-tb","rl-tb","tb-rl"])],["page-break-inside",new Set(["avoid"])],["cursor",new Set(["-webkit-zoom-in","-webkit-zoom-out","-webkit-grab","-webkit-grabbing"])],["border-width",new Set(["medium","thick","thin"])],["border-style",new Set(["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"])],["size",new Set(["a3","a4","a5","b4","b5","landscape","ledger","legal","letter","portrait"])],["overflow",new Set(["hidden","visible","overlay","scroll"])],["overscroll-behavior",new Set(["contain"])],["text-rendering",new Set(["optimizeSpeed","optimizeLegibility","geometricPrecision"])],["text-align",new Set(["-webkit-auto","-webkit-match-parent"])],["clip-path",new Set(["circle","ellipse","inset","polygon","url"])],["color-interpolation",new Set(["sRGB","linearRGB"])],["word-wrap",new Set(["normal","break-word"])],["font-weight",new Set(["100","200","300","400","500","600","700","800","900"])],["text-emphasis",O],["-webkit-text-emphasis",O],["color-rendering",new Set(["optimizeSpeed","optimizeQuality"])],["-webkit-text-combine",new Set(["horizontal"])],["text-orientation",new Set(["sideways-right"])],["outline",new Set(["inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"])],["font",new Set(["caption","icon","menu","message-box","small-caption","-webkit-mini-control","-webkit-small-control","-webkit-control","status-bar"])],["dominant-baseline",new Set(["text-before-edge","text-after-edge","use-script","no-change","reset-size"])],["text-emphasis-position",A],["-webkit-text-emphasis-position",A],["alignment-baseline",new Set(["before-edge","after-edge","text-before-edge","text-after-edge","hanging"])],["page-break-before",new Set(["left","right","always","avoid"])],["border-image",new Set(["repeat","stretch","space","round"])],["text-decoration",new Set(["blink","line-through","overline","underline","wavy","double","solid","dashed","dotted"])],["font-family",new Set(["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-webkit-body"])],["zoom",new Set(["normal"])],["max-width",new Set(["min-content","max-content","-webkit-fill-available","fit-content"])],["-webkit-font-smoothing",new Set(["antialiased","subpixel-antialiased"])],["border",new Set(["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"])],["font-variant",new Set(["small-caps","normal","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"])],["vertical-align",new Set(["top","bottom","-webkit-baseline-middle"])],["page-break-after",new Set(["left","right","always","avoid"])],["text-emphasis-style",O],["-webkit-text-emphasis-style",O],["transform",new Set(["scale","scaleX","scaleY","scale3d","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d","perspective"])],["align-content",new Set(["normal","baseline","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end"])],["justify-content",new Set(["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","left","right"])],["place-content",new Set(["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","baseline"])],["align-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["justify-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","legacy","anchor-center"])],["place-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["align-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["justify-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","anchor-center"])],["place-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["perspective-origin",new Set(["left","center","right","top","bottom"])],["transform-origin",new Set(["left","center","right","top","bottom"])],["transition-timing-function",new Set(["cubic-bezier","steps"])],["animation-timing-function",new Set(["cubic-bezier","steps"])],["-webkit-backface-visibility",new Set(["visible","hidden"])],["-webkit-column-break-after",new Set(["always","avoid"])],["-webkit-column-break-before",new Set(["always","avoid"])],["-webkit-column-break-inside",new Set(["avoid"])],["-webkit-column-span",new Set(["all"])],["-webkit-column-gap",new Set(["normal"])],["filter",new Set(["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"])],["backdrop-filter",new Set(["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"])],["grid-template-columns",new Set(["min-content","max-content"])],["grid-template-rows",new Set(["min-content","max-content"])],["grid-auto-flow",new Set(["dense"])],["background",new Set(["repeat","repeat-x","repeat-y","no-repeat","top","bottom","left","right","center","fixed","local","scroll","space","round","border-box","content-box","padding-box","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["background-image",new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["background-position",new Set(["top","bottom","left","right","center"])],["background-position-x",new Set(["left","right","center"])],["background-position-y",new Set(["top","bottom","center"])],["background-repeat-x",new Set(["repeat","no-repeat"])],["background-repeat-y",new Set(["repeat","no-repeat"])],["border-bottom",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-left",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-right",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-top",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["buffered-rendering",new Set(["static","dynamic"])],["color-interpolation-filters",new Set(["srgb","linearrgb"])],["column-rule",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["flex-flow",new Set(["nowrap","row","row-reverse","column","column-reverse","wrap","wrap-reverse"])],["height",new Set(["-webkit-fill-available"])],["inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["list-style",new Set(["outside","inside","disc","circle","square","decimal","decimal-leading-zero","arabic-indic","bengali","cambodian","khmer","devanagari","gujarati","gurmukhi","kannada","lao","malayalam","mongolian","myanmar","oriya","persian","urdu","telugu","tibetan","thai","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","cjk-earthly-branch","cjk-heavenly-stem","ethiopic-halehame","ethiopic-halehame-am","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","hangul","hangul-consonant","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","hebrew","armenian","lower-armenian","upper-armenian","georgian","cjk-ideographic","simp-chinese-formal","simp-chinese-informal","trad-chinese-formal","trad-chinese-informal","hiragana","katakana","hiragana-iroha","katakana-iroha"])],["max-block-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["max-inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-block-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["object-position",new Set(["top","bottom","left","right","center"])],["shape-outside",new Set(["border-box","content-box","padding-box","margin-box"])],["-webkit-appearance",new Set(["checkbox","radio","push-button","square-button","button","inner-spin-button","listbox","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","menulist","menulist-button","meter","progress-bar","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","searchfield","searchfield-cancel-button","textfield","textarea"])],["-webkit-border-after",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-after-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-after-width",new Set(["medium","thick","thin"])],["-webkit-border-before",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-before-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-before-width",new Set(["medium","thick","thin"])],["-webkit-border-end",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-end-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-end-width",new Set(["medium","thick","thin"])],["-webkit-border-start",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-start-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-start-width",new Set(["medium","thick","thin"])],["-webkit-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-mask-box-image",new Set(["repeat","stretch","space","round"])],["-webkit-mask-box-image-repeat",new Set(["repeat","stretch","space","round"])],["-webkit-mask-clip",new Set(["text","border","border-box","content","content-box","padding","padding-box"])],["-webkit-mask-composite",new Set(["clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-lighter"])],["-webkit-mask-image",new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["-webkit-mask-origin",new Set(["border","border-box","content","content-box","padding","padding-box"])],["-webkit-mask-position",new Set(["top","bottom","left","right","center"])],["-webkit-mask-position-x",new Set(["left","right","center"])],["-webkit-mask-position-y",new Set(["top","bottom","center"])],["-webkit-mask-repeat",new Set(["repeat","repeat-x","repeat-y","no-repeat","space","round"])],["-webkit-mask-size",new Set(["contain","cover"])],["-webkit-max-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-max-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-min-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-min-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-perspective-origin-x",new Set(["left","right","center"])],["-webkit-perspective-origin-y",new Set(["top","bottom","center"])],["-webkit-text-decorations-in-effect",new Set(["blink","line-through","overline","underline"])],["-webkit-text-stroke",new Set(["medium","thick","thin"])],["-webkit-text-stroke-width",new Set(["medium","thick","thin"])],["-webkit-transform-origin-x",new Set(["left","right","center"])],["-webkit-transform-origin-y",new Set(["top","bottom","center"])],["width",new Set(["-webkit-fill-available"])],["contain-intrinsic-width",new Set(["auto none","auto 100px"])],["contain-intrinsic-height",new Set(["auto none","auto 100px"])],["contain-intrinsic-size",new Set(["auto none","auto 100px"])],["contain-intrinsic-inline-size",new Set(["auto none","auto 100px"])],["contain-intrinsic-block-size",new Set(["auto none","auto 100px"])],["white-space",new Set(["normal","pre","pre-wrap","pre-line","nowrap","break-spaces"])],["text-box-edge",new Set(["auto","text","cap","ex","text alphabetic","cap alphabetic","ex alphabetic"])],["corner-shape",new Set(["round","scoop","bevel","notch","straight","squircle","superellipse(0.5)","superellipse(infinity)"])]]),N=new Map([["align-content",57],["align-items",129],["align-self",55],["animation",175],["animation-delay",114],["animation-direction",113],["animation-duration",137],["animation-fill-mode",132],["animation-iteration-count",124],["animation-name",139],["animation-play-state",104],["animation-timing-function",141],["backface-visibility",123],["background",260],["background-attachment",119],["background-clip",165],["background-color",259],["background-image",246],["background-origin",107],["background-position",237],["background-position-x",108],["background-position-y",93],["background-repeat",234],["background-size",203],["border",263],["border-bottom",233],["border-bottom-color",190],["border-bottom-left-radius",186],["border-bottom-right-radius",185],["border-bottom-style",150],["border-bottom-width",179],["border-collapse",209],["border-color",226],["border-image",89],["border-image-outset",50],["border-image-repeat",49],["border-image-slice",58],["border-image-source",32],["border-image-width",52],["border-left",221],["border-left-color",174],["border-left-style",142],["border-left-width",172],["border-radius",224],["border-right",223],["border-right-color",182],["border-right-style",130],["border-right-width",178],["border-spacing",198],["border-style",206],["border-top",231],["border-top-color",192],["border-top-left-radius",187],["border-top-right-radius",189],["border-top-style",152],["border-top-width",180],["border-width",214],["bottom",227],["box-shadow",213],["box-sizing",216],["caption-side",96],["clear",229],["clip",173],["clip-rule",5],["color",256],["content",219],["counter-increment",111],["counter-reset",110],["cursor",250],["direction",176],["display",262],["empty-cells",99],["fill",140],["fill-opacity",82],["fill-rule",22],["filter",160],["flex",133],["flex-basis",66],["flex-direction",85],["flex-flow",94],["flex-grow",112],["flex-shrink",61],["flex-wrap",68],["float",252],["font",211],["font-family",254],["font-kerning",18],["font-size",264],["font-stretch",77],["font-style",220],["font-variant",161],["font-weight",257],["height",266],["image-rendering",90],["justify-content",127],["left",248],["letter-spacing",188],["line-height",244],["list-style",215],["list-style-image",145],["list-style-position",149],["list-style-type",199],["margin",267],["margin-bottom",241],["margin-left",243],["margin-right",238],["margin-top",253],["mask",20],["max-height",205],["max-width",225],["min-height",217],["min-width",218],["object-fit",33],["opacity",251],["order",117],["orphans",146],["outline",222],["outline-color",153],["outline-offset",147],["outline-style",151],["outline-width",148],["overflow",255],["overflow-wrap",105],["overflow-x",184],["overflow-y",196],["padding",265],["padding-bottom",230],["padding-left",235],["padding-right",232],["padding-top",240],["page",8],["page-break-after",120],["page-break-before",69],["page-break-inside",121],["perspective",92],["perspective-origin",103],["pointer-events",183],["position",261],["quotes",158],["resize",168],["right",245],["shape-rendering",38],["size",64],["speak",118],["src",170],["stop-color",42],["stop-opacity",31],["stroke",98],["stroke-dasharray",36],["stroke-dashoffset",3],["stroke-linecap",30],["stroke-linejoin",21],["stroke-miterlimit",12],["stroke-opacity",34],["stroke-width",87],["table-layout",171],["tab-size",46],["text-align",260],["text-anchor",35],["text-decoration",247],["text-indent",207],["text-overflow",204],["text-rendering",155],["text-shadow",208],["text-transform",202],["top",258],["touch-action",80],["transform",181],["transform-origin",162],["transform-style",86],["transition",193],["transition-delay",134],["transition-duration",135],["transition-property",131],["transition-timing-function",122],["unicode-bidi",156],["unicode-range",136],["vertical-align",236],["visibility",242],["-webkit-appearance",191],["-webkit-backface-visibility",154],["-webkit-background-clip",164],["-webkit-background-origin",40],["-webkit-background-size",163],["-webkit-border-end",9],["-webkit-border-horizontal-spacing",81],["-webkit-border-image",75],["-webkit-border-radius",212],["-webkit-border-start",10],["-webkit-border-start-color",16],["-webkit-border-start-width",13],["-webkit-border-vertical-spacing",43],["-webkit-box-align",101],["-webkit-box-direction",51],["-webkit-box-flex",128],["-webkit-box-ordinal-group",91],["-webkit-box-orient",144],["-webkit-box-pack",106],["-webkit-box-reflect",39],["-webkit-box-shadow",210],["-webkit-column-break-inside",60],["-webkit-column-count",84],["-webkit-column-gap",76],["-webkit-column-rule",25],["-webkit-column-rule-color",23],["-webkit-columns",44],["-webkit-column-span",29],["-webkit-column-width",47],["-webkit-filter",159],["-webkit-font-feature-settings",59],["-webkit-font-smoothing",177],["-webkit-line-break",45],["-webkit-line-clamp",126],["-webkit-margin-after",67],["-webkit-margin-before",70],["-webkit-margin-collapse",14],["-webkit-margin-end",65],["-webkit-margin-start",100],["-webkit-mask",19],["-webkit-mask-box-image",72],["-webkit-mask-image",88],["-webkit-mask-position",54],["-webkit-mask-repeat",63],["-webkit-mask-size",79],["-webkit-padding-after",15],["-webkit-padding-before",28],["-webkit-padding-end",48],["-webkit-padding-start",73],["-webkit-print-color-adjust",83],["-webkit-rtl-ordering",7],["-webkit-tap-highlight-color",169],["-webkit-text-emphasis-color",11],["-webkit-text-fill-color",71],["-webkit-text-security",17],["-webkit-text-stroke",56],["-webkit-text-stroke-color",37],["-webkit-text-stroke-width",53],["-webkit-user-drag",95],["-webkit-user-modify",62],["-webkit-user-select",194],["-webkit-writing-mode",4],["white-space",228],["widows",115],["width",268],["will-change",74],["word-break",166],["word-spacing",157],["word-wrap",197],["writing-mode",41],["z-index",239],["zoom",200]]),F=["auto","none"];var B=Object.freeze({__proto__:null,CSSMetadata:f,CSSWideKeywords:y,CubicBezierKeywordValues:b,CustomVariableRegex:/(var\(*--[\w\d]+-([\w]+-[\w]+)\))/g,GridAreaRowRegex:I,PositionTryOrderKeywords:v,URLRegex:/url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g,VariableNameRegex:/(\s*--.*?)/gs,VariableRegex:/(var\(\s*--.*?\))/gs,cssMetadata:S});const _="<opaque>";class H{#h;#u;#g;#p=new Map;#m=0;#f;#b=null;#y;constructor(e,t,n,r,s){this.#h=e,this.#u=t,this.#g=n,this.#f=r||"Medium",this.#y=s}static fromProtocolCookie(e){const t=new H(e.name,e.value,null,e.priority);return t.addAttribute("domain",e.domain),t.addAttribute("path",e.path),e.expires&&t.addAttribute("expires",1e3*e.expires),e.httpOnly&&t.addAttribute("http-only"),e.secure&&t.addAttribute("secure"),e.sameSite&&t.addAttribute("same-site",e.sameSite),"sourcePort"in e&&t.addAttribute("source-port",e.sourcePort),"sourceScheme"in e&&t.addAttribute("source-scheme",e.sourceScheme),"partitionKey"in e&&e.partitionKey&&t.setPartitionKey(e.partitionKey.topLevelSite,e.partitionKey.hasCrossSiteAncestor),"partitionKeyOpaque"in e&&e.partitionKeyOpaque&&t.addAttribute("partition-key",_),t.setSize(e.size),t}key(){return(this.domain()||"-")+" "+this.name()+" "+(this.path()||"-")+" "+(this.partitionKey()?this.topLevelSite()+" "+(this.hasCrossSiteAncestor()?"cross_site":"same_site"):"-")}name(){return this.#h}value(){return this.#u}type(){return this.#g}httpOnly(){return this.#p.has("http-only")}secure(){return this.#p.has("secure")}partitioned(){return this.#p.has("partitioned")||Boolean(this.partitionKey())||this.partitionKeyOpaque()}sameSite(){return this.#p.get("same-site")}partitionKey(){return this.#y}setPartitionKey(e,t){this.#y={topLevelSite:e,hasCrossSiteAncestor:t},this.#p.has("partitioned")||this.addAttribute("partitioned")}topLevelSite(){return this.#y?this.#y?.topLevelSite:""}setTopLevelSite(e,t){this.setPartitionKey(e,t)}hasCrossSiteAncestor(){return!!this.#y&&this.#y?.hasCrossSiteAncestor}setHasCrossSiteAncestor(e){this.partitionKey()&&Boolean(this.topLevelSite())&&this.setPartitionKey(this.topLevelSite(),e)}partitionKeyOpaque(){return!!this.#y&&this.topLevelSite()===_}setPartitionKeyOpaque(){this.addAttribute("partition-key",_),this.setPartitionKey(_,!1)}priority(){return this.#f}session(){return!(this.#p.has("expires")||this.#p.has("max-age"))}path(){return this.#p.get("path")}domain(){return this.#p.get("domain")}expires(){return this.#p.get("expires")}maxAge(){return this.#p.get("max-age")}sourcePort(){return this.#p.get("source-port")}sourceScheme(){return this.#p.get("source-scheme")}size(){return this.#m}url(){if(!this.domain()||!this.path())return null;let e="";const t=this.sourcePort();return t&&80!==t&&443!==t&&(e=`:${this.sourcePort()}`),(this.secure()?"https://":"http://")+this.domain()+e+this.path()}setSize(e){this.#m=e}expiresDate(e){return this.maxAge()?new Date(e.getTime()+1e3*this.maxAge()):this.expires()?new Date(this.expires()):null}addAttribute(e,t){if(e)if("priority"===e)this.#f=t;else this.#p.set(e,t)}hasAttribute(e){return this.#p.has(e)}getAttribute(e){return this.#p.get(e)}setCookieLine(e){this.#b=e}getCookieLine(){return this.#b}matchesSecurityOrigin(e){const t=new URL(e).hostname;return H.isDomainMatch(this.domain(),t)}static isDomainMatch(e,t){return t===e||!(!e||"."!==e[0])&&(e.substr(1)===t||t.length>e.length&&t.endsWith(e))}}var U,q=Object.freeze({__proto__:null,Cookie:H});class z extends l.InspectorBackend.TargetBase{#v;#h;#I=r.DevToolsPath.EmptyUrlString;#w="";#S;#g;#k;#C;#x=new Map;#R;#T=!1;#M;#P;constructor(t,n,r,s,i,o,a,l,d){switch(super(s===U.NODE,i,o,l),this.#v=t,this.#h=r,this.#S=0,s){case U.FRAME:this.#S=1027519,i?.type()!==U.FRAME&&(this.#S|=21056,e.ParsedURL.schemeIs(d?.url,"chrome-extension:")&&(this.#S&=-513));break;case U.ServiceWorker:this.#S=657468,i?.type()!==U.FRAME&&(this.#S|=1);break;case U.SHARED_WORKER:this.#S=919612;break;case U.SHARED_STORAGE_WORKLET:this.#S=526348;break;case U.Worker:this.#S=917820;break;case U.WORKLET:this.#S=524316;break;case U.NODE:this.#S=20;break;case U.AUCTION_WORKLET:this.#S=524292;break;case U.BROWSER:this.#S=131104;break;case U.TAB:this.#S=160}this.#g=s,this.#k=i,this.#C=n,this.#R=a,this.#M=d}createModels(e){this.#P=!0;const t=Array.from(h.registeredModels.entries());for(const[e,n]of t)n.early&&this.model(e);for(const[n,r]of t)(r.autostart||e.has(n))&&this.model(n);this.#P=!1}id(){return this.#C}name(){return this.#h||this.#w}setName(e){this.#h!==e&&(this.#h=e,this.#v.onNameChange(this))}type(){return this.#g}markAsNodeJSForTest(){super.markAsNodeJSForTest(),this.#g=U.NODE}targetManager(){return this.#v}hasAllCapabilities(e){return(this.#S&e)===e}decorateLabel(e){return this.#g===U.Worker||this.#g===U.ServiceWorker?"⚙ "+e:e}parentTarget(){return this.#k}outermostTarget(){let e=null,t=this;do{t.type()!==U.TAB&&t.type()!==U.BROWSER&&(e=t),t=t.parentTarget()}while(t);return e}dispose(e){super.dispose(e),this.#v.removeTarget(this);for(const e of this.#x.values())e.dispose()}model(e){if(!this.#x.get(e)){const t=h.registeredModels.get(e);if(void 0===t)throw new Error("Model class is not registered");if((this.#S&t.capabilities)===t.capabilities){const t=new e(this);this.#x.set(e,t),this.#P||this.#v.modelAdded(this,e,t,this.#v.isInScope(this))}}return this.#x.get(e)||null}models(){return this.#x}inspectedURL(){return this.#I}setInspectedURL(t){this.#I=t;const n=e.ParsedURL.ParsedURL.fromString(t);this.#w=n?n.lastPathComponentWithFragment():"#"+this.#C,this.#v.onInspectedURLChange(this),this.#h||this.#v.onNameChange(this)}hasCrashed(){return this.#T}setHasCrashed(e){const t=this.#T;this.#T=e,t&&!e&&this.resume()}async suspend(e){this.#R||(this.#R=!0,this.#T||(await Promise.all(Array.from(this.models().values(),(t=>t.preSuspendModel(e)))),await Promise.all(Array.from(this.models().values(),(t=>t.suspendModel(e))))))}async resume(){this.#R&&(this.#R=!1,this.#T||(await Promise.all(Array.from(this.models().values(),(e=>e.resumeModel()))),await Promise.all(Array.from(this.models().values(),(e=>e.postResumeModel())))))}suspended(){return this.#R}updateTargetInfo(e){this.#M=e}targetInfo(){return this.#M}}!function(e){e.FRAME="frame",e.ServiceWorker="service-worker",e.Worker="worker",e.SHARED_WORKER="shared-worker",e.SHARED_STORAGE_WORKLET="shared-storage-worklet",e.NODE="node",e.BROWSER="browser",e.AUCTION_WORKLET="auction-worklet",e.WORKLET="worklet",e.TAB="tab"}(U||(U={}));var j=Object.freeze({__proto__:null,Target:z,get Type(){return U}});let V;class W extends e.ObjectWrapper.ObjectWrapper{#E;#L;#A;#O;#D;#R;#N;#F;#B;#_;constructor(){super(),this.#E=new Set,this.#L=new Set,this.#A=new r.MapUtilities.Multimap,this.#O=new r.MapUtilities.Multimap,this.#R=!1,this.#N=null,this.#F=null,this.#D=new WeakSet,this.#B=!1,this.#_=new Set}static instance({forceNew:e}={forceNew:!1}){return V&&!e||(V=new W),V}static removeInstance(){V=void 0}onInspectedURLChange(e){e===this.#F&&(a.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(e.inspectedURL()||r.DevToolsPath.EmptyUrlString),this.dispatchEventToListeners("InspectedURLChanged",e))}onNameChange(e){this.dispatchEventToListeners("NameChanged",e)}async suspendAllTargets(e){if(this.#R)return;this.#R=!0,this.dispatchEventToListeners("SuspendStateChanged");const t=Array.from(this.#E.values(),(t=>t.suspend(e)));await Promise.all(t)}async resumeAllTargets(){if(!this.#R)return;this.#R=!1,this.dispatchEventToListeners("SuspendStateChanged");const e=Array.from(this.#E.values(),(e=>e.resume()));await Promise.all(e)}allTargetsSuspended(){return this.#R}models(e,t){const n=[];for(const r of this.#E){if(t?.scoped&&!this.isInScope(r))continue;const s=r.model(e);s&&n.push(s)}return n}inspectedURL(){const e=this.primaryPageTarget();return e?e.inspectedURL():""}observeModels(e,t,n){const r=this.models(e,n);this.#O.set(e,t),n?.scoped&&this.#D.add(t);for(const e of r)t.modelAdded(e)}unobserveModels(e,t){this.#O.delete(e,t),this.#D.delete(t)}modelAdded(e,t,n,r){for(const e of this.#O.get(t).values())this.#D.has(e)&&!r||e.modelAdded(n)}modelRemoved(e,t,n,r){for(const e of this.#O.get(t).values())this.#D.has(e)&&!r||e.modelRemoved(n)}addModelListener(e,t,n,r,s){const i=e=>{s?.scoped&&!this.isInScope(e)||n.call(r,e)};for(const n of this.models(e))n.addEventListener(t,i);this.#A.set(t,{modelClass:e,thisObject:r,listener:n,wrappedListener:i})}removeModelListener(e,t,n,r){if(!this.#A.has(t))return;let s=null;for(const i of this.#A.get(t))i.modelClass===e&&i.listener===n&&i.thisObject===r&&(s=i.wrappedListener,this.#A.delete(t,i));if(s)for(const n of this.models(e))n.removeEventListener(t,s)}observeTargets(e,t){if(this.#L.has(e))throw new Error("Observer can only be registered once");t?.scoped&&this.#D.add(e);for(const n of this.#E)t?.scoped&&!this.isInScope(n)||e.targetAdded(n);this.#L.add(e)}unobserveTargets(e){this.#L.delete(e),this.#D.delete(e)}createTarget(e,t,n,r,s,i,o,a){const l=new z(this,e,t,n,r,s||"",this.#R,o||null,a);i&&l.pageAgent().invoke_waitForDebugger(),l.createModels(new Set(this.#O.keysArray())),this.#E.add(l);const d=this.isInScope(l);for(const e of[...this.#L])this.#D.has(e)&&!d||e.targetAdded(l);for(const[e,t]of l.models().entries())this.modelAdded(l,e,t,d);for(const e of this.#A.keysArray())for(const t of this.#A.get(e)){const n=l.model(t.modelClass);n&&n.addEventListener(e,t.wrappedListener)}return l!==l.outermostTarget()||l.type()===U.FRAME&&l!==this.primaryPageTarget()||this.#B||this.setScopeTarget(l),l}removeTarget(e){if(!this.#E.has(e))return;const t=this.isInScope(e);this.#E.delete(e);for(const n of e.models().keys()){const r=e.models().get(n);s(r),this.modelRemoved(e,n,r,t)}for(const n of[...this.#L])this.#D.has(n)&&!t||n.targetRemoved(e);for(const t of this.#A.keysArray())for(const n of this.#A.get(t)){const r=e.model(n.modelClass);r&&r.removeEventListener(t,n.wrappedListener)}}targets(){return[...this.#E]}targetById(e){return this.targets().find((t=>t.id()===e))||null}rootTarget(){return 0===this.#E.size?null:this.#E.values().next().value??null}primaryPageTarget(){let e=this.rootTarget();return e?.type()===U.TAB&&(e=this.targets().find((t=>t.parentTarget()===e&&t.type()===U.FRAME&&!t.targetInfo()?.subtype?.length))||null),e}browserTarget(){return this.#N}async maybeAttachInitialTarget(){if(!Boolean(o.Runtime.Runtime.queryParam("browserConnection")))return!1;this.#N||(this.#N=new z(this,"main","browser",U.BROWSER,null,"",!1,null,void 0),this.#N.createModels(new Set(this.#O.keysArray())));const e=await a.InspectorFrontendHost.InspectorFrontendHostInstance.initialTargetId();return this.#N.targetAgent().invoke_autoAttachRelated({targetId:e,waitForDebuggerOnStart:!0}),!0}clearAllTargetsForTest(){this.#E.clear()}isInScope(e){if(!e)return!1;for(function(e){return"source"in e&&e.source instanceof h}(e)&&(e=e.source),e instanceof h&&(e=e.target());e&&e!==this.#F;)e=e.parentTarget();return Boolean(e)&&e===this.#F}setScopeTarget(e){if(e!==this.#F){for(const e of this.targets())if(this.isInScope(e)){for(const t of this.#O.keysArray()){const n=e.models().get(t);if(n)for(const e of[...this.#O.get(t)].filter((e=>this.#D.has(e))))e.modelRemoved(n)}for(const t of[...this.#L].filter((e=>this.#D.has(e))))t.targetRemoved(e)}this.#F=e;for(const e of this.targets())if(this.isInScope(e)){for(const t of[...this.#L].filter((e=>this.#D.has(e))))t.targetAdded(e);for(const[t,n]of e.models().entries())for(const e of[...this.#O.get(t)].filter((e=>this.#D.has(e))))e.modelAdded(n)}for(const e of this.#_)e();e&&e.inspectedURL()&&this.onInspectedURLChange(e)}}addScopeChangeListener(e){this.#_.add(e)}scopeTarget(){return this.#F}}var G=Object.freeze({__proto__:null,Observer:class{targetAdded(e){}targetRemoved(e){}},SDKModelObserver:class{modelAdded(e){}modelRemoved(e){}},TargetManager:W});const K={noContentForWebSocket:"Content for WebSockets is currently not supported",noContentForRedirect:"No content available because this request was redirected",noContentForPreflight:"No content available for preflight request",noThrottling:"No throttling",offline:"Offline",slowG:"3G",fastG:"Slow 4G",fast4G:"Fast 4G",requestWasBlockedByDevtoolsS:'Request was blocked by DevTools: "{PH1}"',sFailedLoadingSS:'{PH1} failed loading: {PH2} "{PH3}".',sFinishedLoadingSS:'{PH1} finished loading: {PH2} "{PH3}".',directSocketStatusOpening:"Opening",directSocketStatusOpen:"Open",directSocketStatusClosed:"Closed",directSocketStatusAborted:"Aborted"},Q=n.i18n.registerUIStrings("core/sdk/NetworkManager.ts",K),$=n.i18n.getLocalizedString.bind(void 0,Q),X=n.i18n.getLazilyComputedLocalizedString.bind(void 0,Q),J=new WeakMap,Y=new Map([["2g","cellular2g"],["3g","cellular3g"],["4g","cellular4g"],["bluetooth","bluetooth"],["wifi","wifi"],["wimax","wimax"]]);class Z extends h{dispatcher;fetchDispatcher;#H;#U;constructor(t){super(t),this.dispatcher=new le(this),this.fetchDispatcher=new ae(t.fetchAgent(),this),this.#H=t.networkAgent(),t.registerNetworkDispatcher(this.dispatcher),t.registerFetchDispatcher(this.fetchDispatcher),e.Settings.Settings.instance().moduleSetting("cache-disabled").get()&&this.#H.invoke_setCacheDisabled({cacheDisabled:!0}),o.Runtime.hostConfig.devToolsPrivacyUI?.enabled&&!0!==o.Runtime.hostConfig.thirdPartyCookieControls?.managedBlockThirdPartyCookies&&(e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).get()||e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).get()||e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).get())&&this.cookieControlFlagsSettingChanged(),this.#H.invoke_enable({maxPostDataSize:oe}),this.#H.invoke_setAttachDebugStack({enabled:!0}),this.#U=e.Settings.Settings.instance().createSetting("bypass-service-worker",!1),this.#U.get()&&this.bypassServiceWorkerChanged(),this.#U.addChangeListener(this.bypassServiceWorkerChanged,this),e.Settings.Settings.instance().moduleSetting("cache-disabled").addChangeListener(this.cacheDisabledSettingChanged,this),e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this),e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this),e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this)}static forRequest(e){return J.get(e)||null}static canReplayRequest(t){return Boolean(J.get(t))&&Boolean(t.backendRequestId())&&!t.isRedirect()&&t.resourceType()===e.ResourceType.resourceTypes.XHR}static replayRequest(e){const t=J.get(e),n=e.backendRequestId();t&&n&&!e.isRedirect()&&t.#H.invoke_replayXHR({requestId:n})}static async searchInRequest(e,n,r,s){const i=Z.forRequest(e),o=e.backendRequestId();if(!i||!o||e.isRedirect())return[];const a=await i.#H.invoke_searchInResponseBody({requestId:o,query:n,caseSensitive:r,isRegex:s});return t.TextUtils.performSearchInSearchMatches(a.result||[],n,r,s)}static async requestContentData(n){if(n.resourceType()===e.ResourceType.resourceTypes.WebSocket)return{error:$(K.noContentForWebSocket)};if(n.finished||await n.once(Ti.FINISHED_LOADING),n.isRedirect())return{error:$(K.noContentForRedirect)};if(n.isPreflightRequest())return{error:$(K.noContentForPreflight)};const r=Z.forRequest(n);if(!r)return{error:"No network manager for request"};const s=n.backendRequestId();if(!s)return{error:"No backend request id for request"};const i=await r.#H.invoke_getResponseBody({requestId:s}),o=i.getError();return o?{error:o}:new t.ContentData.ContentData(i.body,i.base64Encoded,n.mimeType,n.charset()??void 0)}static async streamResponseBody(e){if(e.finished)return{error:"Streaming the response body is only available for in-flight requests."};const n=Z.forRequest(e);if(!n)return{error:"No network manager for request"};const r=e.backendRequestId();if(!r)return{error:"No backend request id for request"};const s=await n.#H.invoke_streamResourceContent({requestId:r}),i=s.getError();return i?{error:i}:(await e.waitForResponseReceived(),new t.ContentData.ContentData(s.bufferedData,!0,e.mimeType,e.charset()??void 0))}static async requestPostData(e){const t=Z.forRequest(e);if(!t)return console.error("No network manager for request"),null;const n=e.backendRequestId();if(!n)return console.error("No backend request id for request"),null;try{const{postData:e}=await t.#H.invoke_getRequestPostData({requestId:n});return e}catch(e){return e.message}}static connectionType(e){if(!e.download&&!e.upload)return"none";try{const t="function"==typeof e.title?e.title().toLowerCase():e.title.toLowerCase();for(const[e,n]of Y)if(t.includes(e))return n}catch{return"none"}return"other"}static lowercaseHeaders(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}requestForURL(e){return this.dispatcher.requestForURL(e)}requestForId(e){return this.dispatcher.requestForId(e)}requestForLoaderId(e){return this.dispatcher.requestForLoaderId(e)}cacheDisabledSettingChanged({data:e}){this.#H.invoke_setCacheDisabled({cacheDisabled:e})}cookieControlFlagsSettingChanged(){const t=Boolean(e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).get()),n=!!t&&Boolean(e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).get()),r=!!t&&Boolean(e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).get());this.#H.invoke_setCookieControls({enableThirdPartyCookieRestriction:t,disableThirdPartyCookieMetadata:n,disableThirdPartyCookieHeuristics:r})}dispose(){e.Settings.Settings.instance().moduleSetting("cache-disabled").removeChangeListener(this.cacheDisabledSettingChanged,this)}bypassServiceWorkerChanged(){this.#H.invoke_setBypassServiceWorker({bypass:this.#U.get()})}async getSecurityIsolationStatus(e){const t=await this.#H.invoke_getSecurityIsolationStatus({frameId:e??void 0});return t.getError()?null:t.status}async enableReportingApi(e=!0){return await this.#H.invoke_enableReportingApi({enable:e})}async loadNetworkResource(e,t,n){const r=await this.#H.invoke_loadNetworkResource({frameId:e??void 0,url:t,options:n});if(r.getError())throw new Error(r.getError());return r.resource}clearRequests(){this.dispatcher.clearRequests()}}var ee;!function(e){e.RequestStarted="RequestStarted",e.RequestUpdated="RequestUpdated",e.RequestFinished="RequestFinished",e.RequestUpdateDropped="RequestUpdateDropped",e.ResponseReceived="ResponseReceived",e.MessageGenerated="MessageGenerated",e.RequestRedirected="RequestRedirected",e.LoadingFinished="LoadingFinished",e.ReportingApiReportAdded="ReportingApiReportAdded",e.ReportingApiReportUpdated="ReportingApiReportUpdated",e.ReportingApiEndpointsChangedForOrigin="ReportingApiEndpointsChangedForOrigin"}(ee||(ee={}));const te={title:X(K.noThrottling),i18nTitleKey:K.noThrottling,download:-1,upload:-1,latency:0},ne={title:X(K.offline),i18nTitleKey:K.offline,download:0,upload:0,latency:0},re={title:X(K.slowG),i18nTitleKey:K.slowG,download:5e4,upload:5e4,latency:2e3,targetLatency:400},se={title:X(K.fastG),i18nTitleKey:K.fastG,download:18e4,upload:84375,latency:562.5,targetLatency:150},ie={title:X(K.fast4G),i18nTitleKey:K.fast4G,download:1012500,upload:168750,latency:165,targetLatency:60},oe=65536;class ae{#q;#z;constructor(e,t){this.#q=e,this.#z=t}requestPaused({requestId:e,request:t,resourceType:n,responseStatusCode:r,responseHeaders:s,networkId:i}){const o=i?this.#z.requestForId(i):null;0===o?.originalResponseHeaders.length&&s&&(o.originalResponseHeaders=s),ce.instance().requestIntercepted(new he(this.#q,t,n,e,o,r,s))}authRequired({}){}}class le{#z;#j=new Map;#V=new Map;#W=new Map;#G=new Map;#K=new Map;constructor(e){this.#z=e,ce.instance().addEventListener("RequestIntercepted",this.#Q.bind(this))}#Q(e){const t=this.requestForId(e.data);t&&t.setWasIntercepted(!0)}headersMapToHeadersArray(e){const t=[];for(const n in e){const r=e[n].split("\n");for(let e=0;e<r.length;++e)t.push({name:n,value:r[e]})}return t}updateNetworkRequestWithRequest(e,t){e.requestMethod=t.method,e.setRequestHeaders(this.headersMapToHeadersArray(t.headers)),e.setRequestFormData(Boolean(t.hasPostData),t.postData||null),e.setInitialPriority(t.initialPriority),e.mixedContentType=t.mixedContentType||"none",e.setReferrerPolicy(t.referrerPolicy),e.setIsSameSite(t.isSameSite||!1)}updateNetworkRequestWithResponse(t,n){n.url&&t.url()!==n.url&&t.setUrl(n.url),t.mimeType=n.mimeType,t.setCharset(n.charset),t.statusCode&&!t.wasIntercepted()||(t.statusCode=n.status),t.statusText&&!t.wasIntercepted()||(t.statusText=n.statusText),t.hasExtraResponseInfo()&&!t.wasIntercepted()||(t.responseHeaders=this.headersMapToHeadersArray(n.headers)),n.encodedDataLength>=0&&t.setTransferSize(n.encodedDataLength),n.requestHeaders&&!t.hasExtraRequestInfo()&&(t.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),t.setRequestHeadersText(n.requestHeadersText||"")),t.connectionReused=n.connectionReused,t.connectionId=String(n.connectionId),n.remoteIPAddress&&t.setRemoteAddress(n.remoteIPAddress,n.remotePort||-1),n.fromServiceWorker&&(t.fetchedViaServiceWorker=!0),n.fromDiskCache&&t.setFromDiskCache(),n.fromPrefetchCache&&t.setFromPrefetchCache(),n.fromEarlyHints&&t.setFromEarlyHints(),n.cacheStorageCacheName&&t.setResponseCacheStorageCacheName(n.cacheStorageCacheName),n.serviceWorkerRouterInfo&&(t.serviceWorkerRouterInfo=n.serviceWorkerRouterInfo),n.responseTime&&t.setResponseRetrievalTime(new Date(n.responseTime)),t.timing=n.timing,t.protocol=n.protocol||"",t.alternateProtocolUsage=n.alternateProtocolUsage,n.serviceWorkerResponseSource&&t.setServiceWorkerResponseSource(n.serviceWorkerResponseSource),t.setSecurityState(n.securityState),n.securityDetails&&t.setSecurityDetails(n.securityDetails);const r=e.ResourceType.ResourceType.fromMimeTypeOverride(t.mimeType);r&&t.setResourceType(r),t.responseReceivedPromiseResolve?t.responseReceivedPromiseResolve():t.responseReceivedPromise=Promise.resolve()}requestForId(e){return this.#j.get(e)||null}requestForURL(e){return this.#V.get(e)||null}requestForLoaderId(e){return this.#W.get(e)||null}resourceChangedPriority({requestId:e,newPriority:t}){const n=this.#j.get(e);n&&n.setPriority(t)}signedExchangeReceived({requestId:t,info:n}){let r=this.#j.get(t);(r||(r=this.#V.get(n.outerResponse.url),r))&&(r.setSignedExchangeInfo(n),r.setResourceType(e.ResourceType.resourceTypes.SignedExchange),this.updateNetworkRequestWithResponse(r,n.outerResponse),this.updateNetworkRequest(r),this.#z.dispatchEventToListeners(ee.ResponseReceived,{request:r,response:n.outerResponse}))}requestWillBeSent({requestId:t,loaderId:n,documentURL:r,request:s,timestamp:i,wallTime:o,initiator:a,redirectResponse:l,type:d,frameId:c,hasUserGesture:h}){let u=this.#j.get(t);if(u){if(!l)return;u.signedExchangeInfo()||this.responseReceived({requestId:t,loaderId:n,timestamp:i,type:d||"Other",response:l,hasExtraInfo:!1,frameId:c}),u=this.appendRedirect(t,i,s.url),this.#z.dispatchEventToListeners(ee.RequestRedirected,u)}else u=Ri.create(t,s.url,r,c??null,n,a,h),J.set(u,this.#z);u.hasNetworkData=!0,this.updateNetworkRequestWithRequest(u,s),u.setIssueTime(i,o),u.setResourceType(d?e.ResourceType.resourceTypes[d]:e.ResourceType.resourceTypes.Other),s.trustTokenParams&&u.setTrustTokenParams(s.trustTokenParams);const g=this.#K.get(t);g&&(u.setTrustTokenOperationDoneEvent(g),this.#K.delete(t)),this.getExtraInfoBuilder(t).addRequest(u),this.startNetworkRequest(u,s)}requestServedFromCache({requestId:e}){const t=this.#j.get(e);t&&t.setFromMemoryCache()}responseReceived({requestId:t,loaderId:n,timestamp:r,type:s,response:i,frameId:o}){const a=this.#j.get(t),l=Z.lowercaseHeaders(i.headers);if(a)a.responseReceivedTime=r,a.setResourceType(e.ResourceType.resourceTypes[s]),this.updateNetworkRequestWithResponse(a,i),this.updateNetworkRequest(a),this.#z.dispatchEventToListeners(ee.ResponseReceived,{request:a,response:i});else{const e=l["last-modified"],t={url:i.url,frameId:o??null,loaderId:n,resourceType:s,mimeType:i.mimeType,lastModified:e?new Date(e):null};this.#z.dispatchEventToListeners(ee.RequestUpdateDropped,t)}}dataReceived(e){let t=this.#j.get(e.requestId);t||(t=this.maybeAdoptMainResourceRequest(e.requestId)),t&&(t.addDataReceivedEvent(e),this.updateNetworkRequest(t))}loadingFinished({requestId:e,timestamp:t,encodedDataLength:n}){let r=this.#j.get(e);r||(r=this.maybeAdoptMainResourceRequest(e)),r&&(this.getExtraInfoBuilder(e).finished(),this.finishNetworkRequest(r,t,n),this.#z.dispatchEventToListeners(ee.LoadingFinished,r))}loadingFailed({requestId:t,timestamp:n,type:r,errorText:s,canceled:i,blockedReason:o,corsErrorStatus:a}){const l=this.#j.get(t);if(l){if(l.failed=!0,l.setResourceType(e.ResourceType.resourceTypes[r]),l.canceled=Boolean(i),o&&(l.setBlockedReason(o),"inspector"===o)){const e=$(K.requestWasBlockedByDevtoolsS,{PH1:l.url()});this.#z.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:t,warning:!0})}a&&l.setCorsErrorStatus(a),l.localizedFailDescription=s,this.getExtraInfoBuilder(t).finished(),this.finishNetworkRequest(l,n,-1)}}webSocketCreated({requestId:t,url:n,initiator:r}){const s=Ri.createForWebSocket(t,n,r);J.set(s,this.#z),s.setResourceType(e.ResourceType.resourceTypes.WebSocket),this.startNetworkRequest(s,null)}webSocketWillSendHandshakeRequest({requestId:e,timestamp:t,wallTime:n,request:r}){const s=this.#j.get(e);s&&(s.requestMethod="GET",s.setRequestHeaders(this.headersMapToHeadersArray(r.headers)),s.setIssueTime(t,n),this.updateNetworkRequest(s))}webSocketHandshakeResponseReceived({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.statusCode=n.status,r.statusText=n.statusText,r.responseHeaders=this.headersMapToHeadersArray(n.headers),r.responseHeadersText=n.headersText||"",n.requestHeaders&&r.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),n.requestHeadersText&&r.setRequestHeadersText(n.requestHeadersText),r.responseReceivedTime=t,r.protocol="websocket",this.updateNetworkRequest(r))}webSocketFrameReceived({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.addProtocolFrame(n,t,!1),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameSent({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.addProtocolFrame(n,t,!0),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameError({requestId:e,timestamp:t,errorMessage:n}){const r=this.#j.get(e);r&&(r.addProtocolFrameError(n,t),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketClosed({requestId:e,timestamp:t}){const n=this.#j.get(e);n&&this.finishNetworkRequest(n,t,-1)}eventSourceMessageReceived({requestId:e,timestamp:t,eventName:n,eventId:r,data:s}){const i=this.#j.get(e);i&&i.addEventSourceMessage(t,n,r,s)}requestIntercepted({}){}requestWillBeSentExtraInfo({requestId:e,associatedCookies:t,headers:n,clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i}){const o=[],a=[];for(const{blockedReasons:e,exemptionReason:n,cookie:r}of t)0===e.length?a.push({exemptionReason:n,cookie:H.fromProtocolCookie(r)}):o.push({blockedReasons:e,cookie:H.fromProtocolCookie(r)});const l={blockedRequestCookies:o,includedRequestCookies:a,requestHeaders:this.headersMapToHeadersArray(n),clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i};this.getExtraInfoBuilder(e).addRequestExtraInfo(l)}responseReceivedEarlyHints({requestId:e,headers:t}){this.getExtraInfoBuilder(e).setEarlyHintsHeaders(this.headersMapToHeadersArray(t))}responseReceivedExtraInfo({requestId:e,blockedCookies:t,headers:n,headersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:o,cookiePartitionKeyOpaque:a,exemptedCookies:l}){const d={blockedResponseCookies:t.map((e=>({blockedReasons:e.blockedReasons,cookieLine:e.cookieLine,cookie:e.cookie?H.fromProtocolCookie(e.cookie):null}))),responseHeaders:this.headersMapToHeadersArray(n),responseHeadersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:o,cookiePartitionKeyOpaque:a,exemptedResponseCookies:l?.map((e=>({cookie:H.fromProtocolCookie(e.cookie),cookieLine:e.cookieLine,exemptionReason:e.exemptionReason})))};this.getExtraInfoBuilder(e).addResponseExtraInfo(d)}getExtraInfoBuilder(e){let t;return this.#G.has(e)?t=this.#G.get(e):(t=new ue,this.#G.set(e,t)),t}appendRedirect(e,t,n){const r=this.#j.get(e);if(!r)throw new Error(`Could not find original network request for ${e}`);let s=0;for(let e=r.redirectSource();e;e=e.redirectSource())s++;r.markAsRedirect(s),this.finishNetworkRequest(r,t,-1);const i=Ri.create(e,n,r.documentURL,r.frameId,r.loaderId,r.initiator(),r.hasUserGesture()??void 0);return J.set(i,this.#z),i.setRedirectSource(r),r.setRedirectDestination(i),i}maybeAdoptMainResourceRequest(e){const t=ce.instance().inflightMainResourceRequests.get(e);if(!t)return null;const n=Z.forRequest(t).dispatcher;n.#j.delete(e),n.#V.delete(t.url());const r=t.loaderId;r&&n.#W.delete(r);const s=n.#G.get(e);return n.#G.delete(e),this.#j.set(e,t),this.#V.set(t.url(),t),r&&this.#W.set(r,t),s&&this.#G.set(e,s),J.set(t,this.#z),t}startNetworkRequest(e,t){this.#j.set(e.requestId(),e),this.#V.set(e.url(),e);const n=e.loaderId;n&&this.#W.set(n,e),e.loaderId!==e.requestId()&&""!==e.loaderId||ce.instance().inflightMainResourceRequests.set(e.requestId(),e),this.#z.dispatchEventToListeners(ee.RequestStarted,{request:e,originalRequest:t})}updateNetworkRequest(e){this.#z.dispatchEventToListeners(ee.RequestUpdated,e)}finishNetworkRequest(t,n,r){if(t.endTime=n,t.finished=!0,r>=0){const e=t.redirectSource();e?.signedExchangeInfo()?(t.setTransferSize(0),e.setTransferSize(r),this.updateNetworkRequest(e)):t.setTransferSize(r)}if(this.#z.dispatchEventToListeners(ee.RequestFinished,t),ce.instance().inflightMainResourceRequests.delete(t.requestId()),e.Settings.Settings.instance().moduleSetting("monitoring-xhr-enabled").get()&&t.resourceType().category()===e.ResourceType.resourceCategories.XHR){let e;const n=t.failed||t.hasErrorStatusCode();e=$(n?K.sFailedLoadingSS:K.sFinishedLoadingSS,{PH1:t.resourceType().title(),PH2:t.requestMethod,PH3:t.url()}),this.#z.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:t.requestId(),warning:!1})}}clearRequests(){for(const[e,t]of this.#j)t.finished&&this.#j.delete(e);for(const[e,t]of this.#V)t.finished&&this.#V.delete(e);for(const[e,t]of this.#W)t.finished&&this.#W.delete(e);for(const[e,t]of this.#G)t.isFinished()&&this.#G.delete(e)}webTransportCreated({transportId:t,url:n,timestamp:r,initiator:s}){const i=Ri.createForWebSocket(t,n,s);i.hasNetworkData=!0,J.set(i,this.#z),i.setResourceType(e.ResourceType.resourceTypes.WebTransport),i.setIssueTime(r,0),this.startNetworkRequest(i,null)}webTransportConnectionEstablished({transportId:e,timestamp:t}){const n=this.#j.get(e);n&&(n.responseReceivedTime=t,n.endTime=t+.001,this.updateNetworkRequest(n))}webTransportClosed({transportId:e,timestamp:t}){const n=this.#j.get(e);n&&(n.endTime=t,this.finishNetworkRequest(n,t,0))}directTCPSocketCreated(t){const r=0===t.remotePort?t.remoteAddr:`${t.remoteAddr}:${t.remotePort}`,s=Ri.createForWebSocket(t.identifier,r,t.initiator);s.hasNetworkData=!0,s.setRemoteAddress(t.remoteAddr,t.remotePort),s.protocol=n.i18n.lockedString("tcp"),s.statusText=$(K.directSocketStatusOpening),s.directSocketInfo={type:Li.TCP,status:Ai.OPENING,createOptions:{remoteAddr:t.remoteAddr,remotePort:t.remotePort,noDelay:t.options.noDelay,keepAliveDelay:t.options.keepAliveDelay,sendBufferSize:t.options.sendBufferSize,receiveBufferSize:t.options.receiveBufferSize,dnsQueryType:t.options.dnsQueryType}},s.setResourceType(e.ResourceType.resourceTypes.DirectSocket),s.setIssueTime(t.timestamp,t.timestamp),J.set(s,this.#z),this.startNetworkRequest(s,null)}directTCPSocketOpened(e){const t=this.#j.get(e.identifier);if(!t?.directSocketInfo)return;t.responseReceivedTime=e.timestamp,t.directSocketInfo.status=Ai.OPEN,t.statusText=$(K.directSocketStatusOpen),t.directSocketInfo.openInfo={remoteAddr:e.remoteAddr,remotePort:e.remotePort,localAddr:e.localAddr,localPort:e.localPort},t.setRemoteAddress(e.remoteAddr,e.remotePort);const n=0===e.remotePort?e.remoteAddr:`${e.remoteAddr}:${e.remotePort}`;t.setUrl(n),this.updateNetworkRequest(t)}directTCPSocketAborted(e){const t=this.#j.get(e.identifier);t?.directSocketInfo&&(t.failed=!0,t.directSocketInfo.status=Ai.ABORTED,t.statusText=$(K.directSocketStatusAborted),t.directSocketInfo.errorMessage=e.errorMessage,this.finishNetworkRequest(t,e.timestamp,0))}directTCPSocketClosed(e){const t=this.#j.get(e.identifier);t?.directSocketInfo&&(t.statusText=$(K.directSocketStatusClosed),t.directSocketInfo.status=Ai.CLOSED,this.finishNetworkRequest(t,e.timestamp,0))}trustTokenOperationDone(e){const t=this.#j.get(e.requestId);t?t.setTrustTokenOperationDoneEvent(e):this.#K.set(e.requestId,e)}subresourceWebBundleMetadataReceived({requestId:e,urls:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({resourceUrls:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleMetadataError({requestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseParsed({innerRequestId:e,bundleRequestId:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({bundleRequestId:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseError({innerRequestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}reportingApiReportAdded(e){this.#z.dispatchEventToListeners(ee.ReportingApiReportAdded,e.report)}reportingApiReportUpdated(e){this.#z.dispatchEventToListeners(ee.ReportingApiReportUpdated,e.report)}reportingApiEndpointsChangedForOrigin(e){this.#z.dispatchEventToListeners(ee.ReportingApiEndpointsChangedForOrigin,e)}policyUpdated(){}createNetworkRequest(e,t,n,r,s,i){const o=Ri.create(e,r,s,t,n,i);return J.set(o,this.#z),o}}let de;class ce extends e.ObjectWrapper.ObjectWrapper{#$="";#X=null;#J=null;#Y=new Set;#Z=new Set;inflightMainResourceRequests=new Map;#ee=te;#te=null;#ne=e.Settings.Settings.instance().moduleSetting("request-blocking-enabled");#re=e.Settings.Settings.instance().createSetting("network-blocked-patterns",[]);#se=[];#ie=new r.MapUtilities.Multimap;#oe;#ae;constructor(){super();const e=()=>{this.updateBlockedPatterns(),this.dispatchEventToListeners("BlockedPatternsChanged")};this.#ne.addChangeListener(e),this.#re.addChangeListener(e),this.updateBlockedPatterns(),W.instance().observeModels(Z,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return de&&!t||(de=new ce),de}static dispose(){de=null}static patchUserAgentWithChromeVersion(e){const t=o.Runtime.getChromeVersion();if(t.length>0){const n=t.split(".",1)[0]+".0.100.0";return r.StringUtilities.sprintf(e,t,n)}return e}static patchUserAgentMetadataWithChromeVersion(e){if(!e.brands)return;const t=o.Runtime.getChromeVersion();if(0===t.length)return;const n=t.split(".",1)[0];for(const t of e.brands)t.version.includes("%s")&&(t.version=r.StringUtilities.sprintf(t.version,n));e.fullVersion&&e.fullVersion.includes("%s")&&(e.fullVersion=r.StringUtilities.sprintf(e.fullVersion,t))}modelAdded(e){const t=e.target().networkAgent(),n=e.target().fetchAgent();this.#oe&&t.invoke_setExtraHTTPHeaders({headers:this.#oe}),this.currentUserAgent()&&t.invoke_setUserAgentOverride({userAgent:this.currentUserAgent(),userAgentMetadata:this.#X||void 0}),this.#se.length&&t.invoke_setBlockedURLs({urls:this.#se}),this.isIntercepting()&&n.invoke_enable({patterns:this.#ie.valuesArray()}),null===this.#J?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:this.#J}),this.#Y.add(t),this.#Z.add(n),this.isThrottling()&&this.updateNetworkConditions(t)}modelRemoved(e){for(const t of this.inflightMainResourceRequests){Z.forRequest(t[1])===e&&this.inflightMainResourceRequests.delete(t[0])}this.#Y.delete(e.target().networkAgent()),this.#Z.delete(e.target().fetchAgent())}isThrottling(){return this.#ee.download>=0||this.#ee.upload>=0||this.#ee.latency>0}isOffline(){return!this.#ee.download&&!this.#ee.upload}setNetworkConditions(e){this.#ee=e;for(const e of this.#Y)this.updateNetworkConditions(e);this.dispatchEventToListeners("ConditionsChanged")}networkConditions(){return this.#ee}updateNetworkConditions(e){const t=this.#ee;this.isThrottling()?e.invoke_emulateNetworkConditions({offline:this.isOffline(),latency:t.latency,downloadThroughput:t.download<0?0:t.download,uploadThroughput:t.upload<0?0:t.upload,packetLoss:(t.packetLoss??0)<0?0:t.packetLoss,packetQueueLength:t.packetQueueLength,packetReordering:t.packetReordering,connectionType:Z.connectionType(t)}):e.invoke_emulateNetworkConditions({offline:!1,latency:0,downloadThroughput:0,uploadThroughput:0})}setExtraHTTPHeaders(e){this.#oe=e;for(const e of this.#Y)e.invoke_setExtraHTTPHeaders({headers:this.#oe})}currentUserAgent(){return this.#ae?this.#ae:this.#$}updateUserAgentOverride(){const e=this.currentUserAgent();for(const t of this.#Y)t.invoke_setUserAgentOverride({userAgent:e,userAgentMetadata:this.#X||void 0})}setUserAgentOverride(e,t){const n=this.#$!==e;this.#$=e,this.#ae?this.#X=null:(this.#X=t,this.updateUserAgentOverride()),n&&this.dispatchEventToListeners("UserAgentChanged")}userAgentOverride(){return this.#$}setCustomUserAgentOverride(e,t=null){this.#ae=e,this.#X=t,this.updateUserAgentOverride()}setCustomAcceptedEncodingsOverride(e){this.#J=e,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners("AcceptedEncodingsChanged")}clearCustomAcceptedEncodingsOverride(){this.#J=null,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners("AcceptedEncodingsChanged")}isAcceptedEncodingOverrideSet(){return null!==this.#J}updateAcceptedEncodingsOverride(){const e=this.#J;for(const t of this.#Y)null===e?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:e})}blockedPatterns(){return this.#re.get().slice()}blockingEnabled(){return this.#ne.get()}isBlocking(){return Boolean(this.#se.length)}setBlockedPatterns(e){this.#re.set(e)}setBlockingEnabled(e){this.#ne.get()!==e&&this.#ne.set(e)}updateBlockedPatterns(){const e=[];if(this.#ne.get())for(const t of this.#re.get())t.enabled&&e.push(t.url);if(e.length||this.#se.length){this.#se=e;for(const e of this.#Y)e.invoke_setBlockedURLs({urls:this.#se})}}isIntercepting(){return Boolean(this.#ie.size)}setInterceptionHandlerForPatterns(e,t){this.#ie.deleteAll(t);for(const n of e)this.#ie.set(t,n);return this.updateInterceptionPatternsOnNextTick()}updateInterceptionPatternsOnNextTick(){return this.#te||(this.#te=Promise.resolve().then(this.updateInterceptionPatterns.bind(this))),this.#te}async updateInterceptionPatterns(){e.Settings.Settings.instance().moduleSetting("cache-disabled").get()||e.Settings.Settings.instance().moduleSetting("cache-disabled").set(!0),this.#te=null;const t=[];for(const e of this.#Z)t.push(e.invoke_enable({patterns:this.#ie.valuesArray()}));this.dispatchEventToListeners("InterceptorsChanged"),await Promise.all(t)}async requestIntercepted(e){for(const t of this.#ie.keysArray())if(await t(e),e.hasResponded()&&e.networkRequest)return void this.dispatchEventToListeners("RequestIntercepted",e.networkRequest.requestId());e.hasResponded()||e.continueRequestWithoutChange()}clearBrowserCache(){for(const e of this.#Y)e.invoke_clearBrowserCache()}clearBrowserCookies(){for(const e of this.#Y)e.invoke_clearBrowserCookies()}async getCertificate(e){const t=W.instance().primaryPageTarget();if(!t)return[];const n=await t.networkAgent().invoke_getCertificate({origin:e});return n?n.tableNames:[]}async loadResource(t){const n={},r=this.currentUserAgent();r&&(n["User-Agent"]=r),e.Settings.Settings.instance().moduleSetting("cache-disabled").get()&&(n["Cache-Control"]="no-cache");const s=e.Settings.Settings.instance().moduleSetting("network.enable-remote-file-loading").get();return await new Promise((e=>a.ResourceLoader.load(t,n,((t,n,r,s)=>{e({success:t,content:r,errorDescription:s})}),s)))}}class he{#q;#le;request;resourceType;responseStatusCode;responseHeaders;requestId;networkRequest;constructor(e,t,n,r,s,i,o){this.#q=e,this.#le=!1,this.request=t,this.resourceType=n,this.responseStatusCode=i,this.responseHeaders=o,this.requestId=r,this.networkRequest=s}hasResponded(){return this.#le}static mergeSetCookieHeaders(e,t){const n=e=>{const t=new Map;for(const n of e){const e=n.value.match(/^([a-zA-Z0-9!#$%&'*+.^_`|~-]+=)(.*)$/);e?t.has(e[1])?t.get(e[1])?.push(n.value):t.set(e[1],[n.value]):t.has(n.value)?t.get(n.value)?.push(n.value):t.set(n.value,[n.value])}return t},r=n(e),s=n(t),i=[];for(const[e,t]of r)if(s.has(e))for(const t of s.get(e)||[])i.push({name:"set-cookie",value:t});else for(const e of t)i.push({name:"set-cookie",value:e});for(const[e,t]of s)if(!r.has(e))for(const e of t)i.push({name:"set-cookie",value:e});return i}async continueRequestWithContent(t,n,r,s){this.#le=!0;const i=n?await t.text():await e.Base64.encode(t).catch((e=>(console.error(e),""))),o=s?200:this.responseStatusCode||200;if(this.networkRequest){const e=this.networkRequest?.originalResponseHeaders.filter((e=>"set-cookie"===e.name))||[],t=r.filter((e=>"set-cookie"===e.name));this.networkRequest.setCookieHeaders=he.mergeSetCookieHeaders(e,t),this.networkRequest.hasOverriddenContent=s}this.#q.invoke_fulfillRequest({requestId:this.requestId,responseCode:o,body:i,responseHeaders:r}),ce.instance().dispatchEventToListeners("RequestFulfilled",this.request.url)}continueRequestWithoutChange(){console.assert(!this.#le),this.#le=!0,this.#q.invoke_continueRequest({requestId:this.requestId})}continueRequestWithError(e){console.assert(!this.#le),this.#le=!0,this.#q.invoke_failRequest({requestId:this.requestId,errorReason:e})}async responseBody(){const e=await this.#q.invoke_getResponseBody({requestId:this.requestId}),n=e.getError();if(n)return{error:n};const{mimeType:r,charset:s}=this.getMimeTypeAndCharset();return new t.ContentData.ContentData(e.body,e.base64Encoded,r??"application/octet-stream",s??void 0)}isRedirect(){return void 0!==this.responseStatusCode&&this.responseStatusCode>=300&&this.responseStatusCode<400}getMimeTypeAndCharset(){for(const e of this.responseHeaders??[])if("content-type"===e.name.toLowerCase())return r.MimeType.parseContentType(e.value);return{mimeType:this.networkRequest?.mimeType??null,charset:this.networkRequest?.charset()??null}}}class ue{#de;#ce;#he;#ue;#ge;#pe;#me;constructor(){this.#de=[],this.#ce=[],this.#ue=[],this.#he=[],this.#ge=!1,this.#pe=null,this.#me=null}addRequest(e){this.#de.push(e),this.sync(this.#de.length-1)}addRequestExtraInfo(e){this.#ce.push(e),this.sync(this.#ce.length-1)}addResponseExtraInfo(e){this.#he.push(e),this.sync(this.#he.length-1)}setEarlyHintsHeaders(e){this.#ue=e,this.updateFinalRequest()}setWebBundleInfo(e){this.#pe=e,this.updateFinalRequest()}setWebBundleInnerRequestInfo(e){this.#me=e,this.updateFinalRequest()}finished(){this.#ge=!0,this.updateFinalRequest()}isFinished(){return this.#ge}sync(e){const t=this.#de[e];if(!t)return;const n=this.#ce[e];n&&(t.addExtraRequestInfo(n),this.#ce[e]=null);const r=this.#he[e];r&&(t.addExtraResponseInfo(r),this.#he[e]=null)}finalRequest(){return this.#ge&&this.#de[this.#de.length-1]||null}updateFinalRequest(){if(!this.#ge)return;const e=this.finalRequest();e?.setWebBundleInfo(this.#pe),e?.setWebBundleInnerRequestInfo(this.#me),e?.setEarlyHintsHeaders(this.#ue)}}h.register(Z,{capabilities:16,autostart:!0});var ge=Object.freeze({__proto__:null,ConditionsSerializer:class{stringify(e){const t=e;return JSON.stringify({...t,title:"function"==typeof t.title?t.title():t.title})}parse(e){const t=JSON.parse(e);return{...t,title:t.i18nTitleKey?X(t.i18nTitleKey):t.title}}},get Events(){return ee},Fast4GConditions:ie,FetchDispatcher:ae,InterceptedRequest:he,MultitargetNetworkManager:ce,NetworkDispatcher:le,NetworkManager:Z,NoThrottlingConditions:te,OfflineConditions:ne,Slow3GConditions:re,Slow4GConditions:se,networkConditionsEqual:function(e,t){const n=e.i18nTitleKey||("function"==typeof e.title?e.title():e.title),r=t.i18nTitleKey||("function"==typeof t.title?t.title():t.title);return t.download===e.download&&t.upload===e.upload&&t.latency===e.latency&&e.packetLoss===t.packetLoss&&e.packetQueueLength===t.packetQueueLength&&e.packetReordering===t.packetReordering&&r===n}});class pe{#fe;#be;#ye=new Map;#ve;#Ie;constructor(e){this.#fe=e.fontFamily,this.#be=e.fontVariationAxes||[],this.#ve=e.src,this.#Ie=e.fontDisplay;for(const e of this.#be)this.#ye.set(e.tag,e)}getFontFamily(){return this.#fe}getSrc(){return this.#ve}getFontDisplay(){return this.#Ie}getVariationAxisByTag(e){return this.#ye.get(e)}}var me=Object.freeze({__proto__:null,CSSFontFace:pe});class fe{text;node;name;fallback;matching;computedTextCallback;constructor(e,t,n,r,s,i){this.text=e,this.node=t,this.name=n,this.fallback=r,this.matching=s,this.computedTextCallback=i}computedText(){return this.computedTextCallback(this,this.matching)}}class be extends(kt(fe)){#we;constructor(e){super(),this.#we=e}matches(e,t){const n=e.getChild("Callee"),r=e.getChild("ArgList");if("CallExpression"!==e.name||!n||"var"!==t.ast.text(n)||!r)return null;const[s,i,...o]=Pt.children(r);if("("!==s?.name||"VariableName"!==i?.name)return null;if(o.length<=1&&")"!==o[0]?.name)return null;let a=[];if(o.length>1){if(","!==o.shift()?.name)return null;if(")"!==o.pop()?.name)return null;if(a=o,0===a.length)return null;if(a.some((e=>","===e.name)))return null}const l=t.ast.text(i);return l.startsWith("--")?new fe(t.ast.text(e),e,l,a,t,this.#we):null}}class ye extends fe{matchedStyles;style;constructor(e,t,n,r,s,i,o){super(e,t,n,r,s,(()=>this.resolveVariable()?.value??this.fallbackValue())),this.matchedStyles=i,this.style=o}resolveVariable(){return this.matchedStyles.computeCSSVariable(this.style,this.name)}fallbackValue(){return 0===this.fallback.length||this.matching.hasUnresolvedVarsRange(this.fallback[0],this.fallback[this.fallback.length-1])?null:this.matching.getComputedTextRange(this.fallback[0],this.fallback[this.fallback.length-1])}}class ve extends(kt(ye)){matchedStyles;style;constructor(e,t){super(),this.matchedStyles=e,this.style=t}matches(e,t){const n=new be((()=>null)).matches(e,t);return n?new ye(n.text,n.node,n.name,n.fallback,n.matching,this.matchedStyles,this.style):null}}class Ie{text;node;constructor(e,t){this.text=e,this.node=t}}class we extends(kt(Ie)){accepts(){return!0}matches(e,t){return"BinaryExpression"===e.name?new Ie(t.ast.text(e),e):null}}class Se{text;node;computedText;constructor(e,t){this.text=e,this.node=t,"Comment"===t.name&&(this.computedText=()=>"")}render(){const e=document.createElement("span");return e.appendChild(document.createTextNode(this.text)),[e]}}class ke extends(kt(Se)){accepts(){return!0}matches(e,t){if(!e.firstChild||"NumberLiteral"===e.name){const n=t.ast.text(e);if(n.length)return new Se(n,e)}return null}}class Ce{text;node;constructor(e,t){this.text=e,this.node=t}computedText(){return this.text}}class xe extends(kt(Ce)){accepts(e){return S().isAngleAwareProperty(e)}matches(e,t){if("NumberLiteral"!==e.name)return null;const n=e.getChild("Unit");return n&&["deg","grad","rad","turn"].includes(t.ast.text(n))?new Ce(t.ast.text(e),e):null}}function Re(e,t){if("NumberLiteral"!==e.type.name)return null;const n=t.text(e);return Number(n.substring(0,n.length-t.text(e.getChild("Unit")).length))}class Te{text;node;space;color1;color2;constructor(e,t,n,r,s){this.text=e,this.node=t,this.space=n,this.color1=r,this.color2=s}}class Me extends(kt(Te)){accepts(e){return S().isColorAwareProperty(e)}matches(e,t){if("CallExpression"!==e.name||"color-mix"!==t.ast.text(e.getChild("Callee")))return null;const n=Lt("--property",t.getComputedText(e));if(!n)return null;const r=Pt.declValue(n.tree);if(!r)return null;const s=Pt.callArgs(r);if(3!==s.length)return null;const[i,o,a]=s;if(i.length<2||"in"!==n.text(Pt.stripComments(i).next().value)||o.length<1||a.length<1)return null;const l=o.filter((e=>"NumberLiteral"===e.type.name&&"%"===n.text(e.getChild("Unit")))),d=a.filter((e=>"NumberLiteral"===e.type.name&&"%"===n.text(e.getChild("Unit"))));if(l.length>1||d.length>1)return null;if(l[0]&&d[0]&&0===(Re(l[0],n)??0)&&0===(Re(d[0],n)??0))return null;const c=Pt.callArgs(e);return 3!==c.length?null:new Te(t.ast.text(e),e,c[0],c[1],c[2])}}class Pe{url;text;node;constructor(e,t,n){this.url=e,this.text=t,this.node=n}}class Ee extends(kt(Pe)){matches(e,t){if("CallLiteral"!==e.name)return null;const n=e.getChild("CallTag");if(!n||"url"!==t.ast.text(n))return null;const[,r,s,i]=Pt.siblings(n);if("("!==t.ast.text(r)||"ParenthesizedContent"!==s.name&&"StringLiteral"!==s.name||")"!==t.ast.text(i))return null;const o=t.ast.text(s),a="StringLiteral"===s.name?o.substr(1,o.length-2):o.trim();return new Pe(a,t.ast.text(e),e)}}class Le{text;node;constructor(e,t){this.text=e,this.node=t}}class Ae extends(kt(Le)){matches(e,t){const n=t.ast.text(e);return"CallExpression"===e.name&&"linear-gradient"===t.ast.text(e.getChild("Callee"))?new Le(n,e):null}accepts(e){return["background","background-image","-webkit-mask-image"].includes(e)}}class Oe{text;node;currentColorCallback;computedText;constructor(e,t,n){this.text=e,this.node=t,this.currentColorCallback=n,this.computedText=n}}class De extends(kt(Oe)){currentColorCallback;constructor(e){super(),this.currentColorCallback=e}accepts(e){return S().isColorAwareProperty(e)}matches(t,n){const r=n.ast.text(t);if("ColorLiteral"===t.name)return new Oe(r,t);if("ValueName"===t.name){if(e.Color.Nicknames.has(r))return new Oe(r,t);if("currentcolor"===r.toLowerCase()&&this.currentColorCallback){const e=this.currentColorCallback;return new Oe(r,t,(()=>e()??r))}}if("CallExpression"===t.name){const e=t.getChild("Callee");if(e&&n.ast.text(e).match(/^(rgba?|hsla?|hwba?|lab|lch|oklab|oklch|color)$/))return new Oe(r,t)}return null}}class Ne{text;node;light;dark;style;constructor(e,t,n,r,s){this.text=e,this.node=t,this.light=n,this.dark=r,this.style=s}}class Fe extends(kt(Ne)){style;constructor(e){super(),this.style=e}accepts(e){return S().isColorAwareProperty(e)}matches(e,t){if("CallExpression"!==e.name||"light-dark"!==t.ast.text(e.getChild("Callee")))return null;const n=Pt.callArgs(e);return 2!==n.length||0===n[0].length||0===n[1].length?null:new Ne(t.ast.text(e),e,n[0],n[1],this.style)}}class Be{text;node;auto;base;constructor(e,t,n,r){this.text=e,this.node=t,this.auto=n,this.base=r}}class _e extends(kt(Be)){matches(e,t){if("CallExpression"!==e.name||"-internal-auto-base"!==t.ast.text(e.getChild("Callee")))return null;const n=Pt.callArgs(e);return 2!==n.length||0===n[0].length||0===n[1].length?null:new Be(t.ast.text(e),e,n[0],n[1])}}class He{text;node;propertyName;constructor(e,t,n){this.text=e,this.node=t,this.propertyName=n}}class Ue extends(kt(He)){static isLinkableNameProperty(e){return["animation","animation-name","font-palette","position-try-fallbacks","position-try"].includes(e)}static identifierAnimationLonghandMap=new Map(Object.entries({normal:"direction",alternate:"direction",reverse:"direction","alternate-reverse":"direction",none:"fill-mode",forwards:"fill-mode",backwards:"fill-mode",both:"fill-mode",running:"play-state",paused:"play-state",infinite:"iteration-count",linear:"easing-function",ease:"easing-function","ease-in":"easing-function","ease-out":"easing-function","ease-in-out":"easing-function",steps:"easing-function","step-start":"easing-function","step-end":"easing-function"}));matchAnimationNameInShorthand(e,t){const n=t.ast.text(e);if(!Ue.identifierAnimationLonghandMap.has(n))return new He(n,e,"animation");const r=Pt.split(Pt.siblings(Pt.declValue(t.ast.tree))).find((t=>t[0].from<=e.from&&t[t.length-1].to>=e.to));if(!r)return null;const s=Lt("--p",t.getComputedTextRange(r[0],e));if(!s)return null;const i=Ue.identifierAnimationLonghandMap.get(n);for(let t=Pt.declValue(s.tree);t?.nextSibling;t=t.nextSibling)if("ValueName"===t.name){const r=Ue.identifierAnimationLonghandMap.get(s.text(t));if(r&&r===i)return new He(n,e,"animation")}return null}accepts(e){return Ue.isLinkableNameProperty(e)}matches(e,t){const{propertyName:n}=t.ast,r=t.ast.text(e),s=e.parent;if(!s)return null;const i="Declaration"===s.name,o="ArgList"===s.name&&"Callee"===s.prevSibling?.name&&"var"===t.ast.text(s.prevSibling),a=i||o,l="position-try"===n||"position-try-fallbacks"===n;return!n||"ValueName"!==e.name&&"VariableName"!==e.name||!a||"ValueName"===e.name&&l?null:"animation"===n?this.matchAnimationNameInShorthand(e,t):new He(r,e,n)}}class qe{text;node;constructor(e,t){this.text=e,this.node=t}}class ze extends(kt(qe)){accepts(e){return S().isBezierAwareProperty(e)}matches(e,t){const n=t.ast.text(e),r="ValueName"===e.name&&b.has(n),s="CallExpression"===e.name&&["cubic-bezier","linear"].includes(t.ast.text(e.getChild("Callee")));return r||s?new qe(n,e):null}}class je{text;node;constructor(e,t){this.text=e,this.node=t}}class Ve extends(kt(je)){matches(e,t){return"StringLiteral"===e.name?new je(t.ast.text(e),e):null}}class We{text;node;shadowType;constructor(e,t,n){this.text=e,this.node=t,this.shadowType=n}}class Ge extends(kt(We)){accepts(e){return S().isShadowProperty(e)}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(0===n.length)return null;const r=t.ast.textRange(n[0],n[n.length-1]);return new We(r,e,"text-shadow"===t.ast.propertyName?"textShadow":"boxShadow")}}class Ke{text;node;constructor(e,t){this.text=e,this.node=t}}class Qe extends(kt(Ke)){accepts(e){return S().isFontAwareProperty(e)}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(0===n.length)return null;const r="font-family"===t.ast.propertyName?["ValueName","StringLiteral","Comment",","]:["Comment","ValueName","NumberLiteral"];if(n.some((e=>!r.includes(e.name))))return null;const s=t.ast.textRange(n[0],n[n.length-1]);return new Ke(s,e)}}class $e{text;node;unit;constructor(e,t,n){this.text=e,this.node=t,this.unit=n}}class Xe extends(kt($e)){static LENGTH_UNITS=new Set(["em","ex","ch","cap","ic","lh","rem","rex","rch","rlh","ric","rcap","pt","pc","in","cm","mm","Q","vw","vh","vi","vb","vmin","vmax","dvw","dvh","dvi","dvb","dvmin","dvmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","cqw","cqh","cqi","cqb","cqmin","cqmax","cqem","cqlh","cqex","cqch"]);matches(e,t){if("NumberLiteral"!==e.name)return null;const n=t.ast.text(e.getChild("Unit"));if(!Xe.LENGTH_UNITS.has(n))return null;const r=t.ast.text(e);return new $e(r,e,n)}}class Je{text;node;func;args;constructor(e,t,n,r){this.text=e,this.node=t,this.func=n,this.args=r}}class Ye extends(kt(Je)){matches(e,t){if("CallExpression"!==e.name)return null;const n=t.ast.text(e.getChild("Callee"));if(!["min","max","clamp","calc"].includes(n))return null;const r=Pt.callArgs(e);if(r.some((e=>0===e.length||t.hasUnresolvedVarsRange(e[0],e[e.length-1]))))return null;const s=t.ast.text(e);return new Je(s,e,n,r)}}class Ze{text;node;isFlex;constructor(e,t,n){this.text=e,this.node=t,this.isFlex=n}}class et extends(kt(Ze)){static FLEX=["flex","inline-flex","block flex","inline flex"];static GRID=["grid","inline-grid","block grid","inline grid"];accepts(e){return"display"===e}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(n.length<1)return null;const r=n.filter((e=>"Important"!==e.name)).map((e=>t.getComputedText(e).trim())).filter((e=>e)),s=r.join(" ");return et.FLEX.includes(s)?new Ze(t.ast.text(e),e,!0):et.GRID.includes(s)?new Ze(t.ast.text(e),e,!1):null}}class tt{text;node;lines;constructor(e,t,n){this.text=e,this.node=t,this.lines=n}}class nt extends(kt(tt)){accepts(e){return S().isGridAreaDefiningProperty(e)}matches(e,t){if("Declaration"!==e.name||t.hasUnresolvedVars(e))return null;const n=[];let r=[],s=!1,i=!1;const o=Pt.siblings(Pt.declValue(e));!function e(o,a=!1){for(const l of o)if(t.getMatch(l)instanceof fe){const o=Lt("--property",t.getComputedText(l));if(!o)continue;const a=Pt.siblings(Pt.declValue(o.tree));if(0===a.length)continue;"StringLiteral"===a[0].name&&!s||"LineNames"===a[0].name&&!i?(n.push(r),r=[l]):r.push(l),e(a,!0)}else"BinaryExpression"===l.name?e(Pt.siblings(l.firstChild)):"StringLiteral"===l.name?(a||(s?r.push(l):(n.push(r),r=[l])),i=!0,s=!1):"LineNames"===l.name?(a||(i?r.push(l):(n.push(r),r=[l])),s=!i,i=!i):a||r.push(l)}(o),n.push(r);const a=t.ast.textRange(o[0],o[o.length-1]);return new tt(a,e,n.filter((e=>e.length>0)))}}class rt{text;node;functionName;constructor(e,t,n){this.text=e,this.node=t,this.functionName=n}}class st extends(kt(rt)){anchorFunction(e,t){if("CallExpression"!==e.name)return null;const n=t.ast.text(e.getChild("Callee"));return"anchor"===n||"anchor-size"===n?n:null}matches(e,t){if("VariableName"===e.name){let n=e.parent;return n&&"ArgList"===n.name?(n=n.parent,n&&this.anchorFunction(n,t)?new rt(t.ast.text(e),e,null):null):null}const n=this.anchorFunction(e,t);if(!n)return null;const r=Pt.children(e.getChild("ArgList"));return"anchor"===n&&r.length<=2||r.find((e=>"VariableName"===e.name))?null:new rt(t.ast.text(e),e,n)}}class it{text;matching;node;constructor(e,t,n){this.text=e,this.matching=t,this.node=n}}class ot extends(kt(it)){accepts(e){return"position-anchor"===e}matches(e,t){if("VariableName"!==e.name)return null;const n=t.ast.text(e);return new it(n,t,e)}}class at{text;node;property;matchedStyles;constructor(e,t,n,r){this.text=e,this.node=t,this.property=n,this.matchedStyles=r}resolveProperty(){return this.matchedStyles.resolveGlobalKeyword(this.property,this.text)}computedText(){return this.resolveProperty()?.value??null}}class lt extends(kt(at)){property;matchedStyles;constructor(e,t){super(),this.property=e,this.matchedStyles=t}matches(e,t){const n=e.parent;if("ValueName"!==e.name||"Declaration"!==n?.name)return null;if(Array.from(Pt.stripComments(Pt.siblings(Pt.declValue(n)))).some((t=>!Pt.equals(t,e))))return null;const r=t.ast.text(e);return f.isCSSWideKeyword(r)?new at(r,e,this.property,this.matchedStyles):null}}class dt{text;node;preamble;fallbacks;constructor(e,t,n,r){this.text=e,this.node=t,this.preamble=n,this.fallbacks=r}}class ct extends(kt(dt)){accepts(e){return"position-try"===e||"position-try-fallbacks"===e}matches(e,t){if("Declaration"!==e.name)return null;let n=[];const r=Pt.siblings(Pt.declValue(e)),s=Pt.split(r);if("position-try"===t.ast.propertyName)for(const[e,r]of s[0].entries()){const i=t.getComputedText(r);if(f.isCSSWideKeyword(i))return null;if(f.isPositionTryOrderKeyword(i)){n=s[0].splice(0,e+1);break}}const i=t.ast.textRange(r[0],r[r.length-1]);return new dt(i,e,n,s)}}var ht=Object.freeze({__proto__:null,AnchorFunctionMatch:rt,AnchorFunctionMatcher:st,AngleMatch:Ce,AngleMatcher:xe,AutoBaseMatch:Be,AutoBaseMatcher:_e,BaseVariableMatch:fe,BaseVariableMatcher:be,BezierMatch:qe,BezierMatcher:ze,BinOpMatch:Ie,BinOpMatcher:we,CSSWideKeywordMatch:at,CSSWideKeywordMatcher:lt,ColorMatch:Oe,ColorMatcher:De,ColorMixMatch:Te,ColorMixMatcher:Me,FlexGridMatch:Ze,FlexGridMatcher:et,FontMatch:Ke,FontMatcher:Qe,GridTemplateMatch:tt,GridTemplateMatcher:nt,LengthMatch:$e,LengthMatcher:Xe,LightDarkColorMatch:Ne,LightDarkColorMatcher:Fe,LinearGradientMatch:Le,LinearGradientMatcher:Ae,LinkableNameMatch:He,LinkableNameMatcher:Ue,MathFunctionMatch:Je,MathFunctionMatcher:Ye,PositionAnchorMatch:it,PositionAnchorMatcher:ot,PositionTryMatch:dt,PositionTryMatcher:ct,ShadowMatch:We,ShadowMatcher:Ge,StringMatch:je,StringMatcher:Ve,TextMatch:Se,TextMatcher:ke,URLMatch:Pe,URLMatcher:Ee,VariableMatch:ye,VariableMatcher:ve});const ut=new Set(["inherit","initial","unset"]),gt=/[\x20-\x7E]{4}/,pt=new RegExp(`(?:'(${gt.source})')|(?:"(${gt.source})")\\s+(${/[+-]?(?:\d*\.)?\d+(?:[eE]\d+)?/.source})`);const mt=/^"(.+)"|'(.+)'$/;function ft(e){return e.split(",").map((e=>e.trim()))}function bt(e){return e.replaceAll(/(\/\*(?:.|\s)*?\*\/)/g,"")}const yt=d.css.cssLanguage.parser;function vt(e,t){return It(e,e,t)}function It(e,t,n){return n.substring(e.from,t.to)}class wt{propertyValue;rule;tree;trailingNodes;propertyName;constructor(e,t,n,r,s=[]){this.propertyName=r,this.propertyValue=e,this.rule=t,this.tree=n,this.trailingNodes=s}text(e){return null===e?"":vt(e??this.tree,this.rule)}textRange(e,t){return It(e,t,this.rule)}subtree(e){return new wt(this.propertyValue,this.rule,e)}}class St{ast;constructor(e){this.ast=e}static walkExcludingSuccessors(e,...t){const n=new this(e,...t);return"Declaration"===e.tree.name?n.iterateDeclaration(e.tree):n.iterateExcludingSuccessors(e.tree),n}static walk(e,...t){const n=new this(e,...t);return"Declaration"===e.tree.name?n.iterateDeclaration(e.tree):n.iterate(e.tree),n}iterateDeclaration(e){if("Declaration"===e.name){if(this.enter(e))for(const t of Pt.siblings(Pt.declValue(e)))t.cursor().iterate(this.enter.bind(this),this.leave.bind(this));this.leave(e)}}iterate(e){for(const t of Pt.siblings(e))t.cursor().iterate(this.enter.bind(this),this.leave.bind(this))}iterateExcludingSuccessors(e){e.cursor().iterate(this.enter.bind(this),this.leave.bind(this))}enter(e){return!0}leave(e){}}function kt(e){return class{matchType=e;accepts(e){return!0}matches(e,t){return null}}}class Ct extends St{#Se=[];#ke=new Map;computedText;#Ce(e){return`${e.from}:${e.to}`}constructor(e,t){super(e),this.computedText=new Rt(e.rule.substring(e.tree.from)),this.#Se.push(...t.filter((t=>!e.propertyName||t.accepts(e.propertyName)))),this.#Se.push(new ke)}leave({node:e}){for(const t of this.#Se){const n=t.matches(e,this);if(n){this.computedText.push(n,e.from-this.ast.tree.from),this.#ke.set(this.#Ce(e),n);break}}}matchText(e){const t=this.#Se.splice(0);this.#Se.push(new ke),this.iterateExcludingSuccessors(e),this.#Se.push(...t)}hasMatches(...e){return Boolean(this.#ke.values().find((t=>e.some((e=>t instanceof e)))))}getMatch(e){return this.#ke.get(this.#Ce(e))}hasUnresolvedVars(e){return this.hasUnresolvedVarsRange(e,e)}hasUnresolvedVarsRange(e,t){return this.computedText.hasUnresolvedVars(e.from-this.ast.tree.from,t.to-this.ast.tree.from)}getComputedText(e,t){return this.getComputedTextRange(e,e,t)}getComputedPropertyValueText(){const[e,t]=Pt.range(Pt.siblings(Pt.declValue(this.ast.tree)));return this.getComputedTextRange(e??this.ast.tree,t??this.ast.tree)}getComputedTextRange(e,t,n){return this.computedText.get(e.from-this.ast.tree.from,t.to-this.ast.tree.from,n)}}class xt{match;offset;#xe=null;constructor(e,t){this.match=e,this.offset=t}get end(){return this.offset+this.length}get length(){return this.match.text.length}get computedText(){return null===this.#xe&&(this.#xe=this.match.computedText()),this.#xe}}class Rt{#Re=[];text;#Te=!0;constructor(e){this.text=e}clear(){this.#Re.splice(0)}get chunkCount(){return this.#Re.length}#Me(){this.#Te||(this.#Re.sort(((e,t)=>e.offset<t.offset?-1:t.offset<e.offset?1:e.end>t.end?-1:e.end<t.end?1:0)),this.#Te=!0)}push(e,t){if(!function(e){return Boolean(e.computedText)}(e)||t<0||t>=this.text.length)return;const n=new xt(e,t);n.end>this.text.length||(this.#Te=!1,this.#Re.push(n))}*#Pe(e,t){this.#Me();let n=this.#Re.findIndex((t=>t.offset>=e));for(;n>=0&&n<this.#Re.length&&this.#Re[n].end>e&&e<t;)if(this.#Re[n].end>t)n++;else for(yield this.#Re[n],e=this.#Re[n].end;e<t&&n<this.#Re.length&&this.#Re[n].offset<e;)n++}hasUnresolvedVars(e,t){for(const n of this.#Pe(e,t))if(null===n.computedText)return!0;return!1}*#Ee(e,t){for(const n of this.#Pe(e,t)){const r=this.text.substring(e,Math.min(n.offset,t));yield r,t>=n.end&&(yield n),e=n.end}if(e<t){const n=this.text.substring(e,t);yield n}}get(e,t,n){const r=[],s=e=>{if("string"==typeof e)return e;const t=n?.get(e.match);return t?s(t):e.computedText??e.match.text};for(const n of this.#Ee(e,t)){const e=s(n);0!==e.length&&(r.length>0&&Tt(r[r.length-1],e)&&r.push(" "),r.push(e))}return r.join("")}}function Tt(e,t){const n=Array.isArray(e)?e.findLast((e=>e.textContent))?.textContent:e,r=Array.isArray(t)?t.find((e=>e.textContent))?.textContent:t,s=n?n[n.length-1]:"",i=r?r[0]:"";return!(/\s/.test(s)||/\s/.test(i)||["","(","{","}",";","["].includes(s)||["","(",")",",",":","*","{",";","]"].includes(i))}const Mt=Map;var Pt;function Et(e){return yt.parse(e).topNode.getChild("RuleSet")?.getChild("Block")?.getChild("Declaration")??null}function Lt(e,t){const n=At(e);if(!n)return null;const r=`*{${n}: ${t};}`,s=Et(r);if(!s||s.type.isError)return null;const i=Pt.children(s);if(i.length<2)return null;const[o,a,l]=i;if(!o||o.type.isError||!a||a.type.isError||l?.type.isError)return null;const d=Pt.siblings(s).slice(1),[c,h]=d.splice(d.length-2,2);if(";"!==c?.name&&"}"!==h?.name)return null;const u=new wt(t,r,s,n,d);return u.text(o)!==n||":"!==a.name?null:u}function At(e){const t=`*{${e}: inherit;}`,n=Et(t);if(!n||n.type.isError)return null;const r=n.getChild("PropertyName")??n.getChild("VariableName");return r?vt(r,t):null}function Ot(e,t,n){const r=Lt(e,t),s=r&&Ct.walk(r,n);return r?.trailingNodes.forEach((e=>s?.matchText(e))),s}!function(e){function t(e){const t=[];for(;e;)t.push(e),e=e.nextSibling;return t}function n(e){return t(e?.firstChild??null)}function r(e){const t=[];let n=[];for(const r of e)","===r.name?(t.push(n),n=[]):n.push(r);return t.push(n),t}e.siblings=t,e.children=n,e.range=function(e){return[e[0],e[e.length-1]]},e.declValue=function(e){return"Declaration"!==e.name?null:n(e).find((e=>":"===e.name))?.nextSibling??null},e.stripComments=function*(e){for(const t of e)"Comment"!==t.type.name&&(yield t)},e.split=r,e.callArgs=function(e){const t=n(e.getChild("ArgList")),s=t.splice(0,1)[0],i=t.pop();return"("!==s?.name||")"!==i?.name?[]:r(t)},e.equals=function(e,t){return e.name===t.name&&e.from===t.from&&e.to===t.to}}(Pt||(Pt={}));class Dt extends St{#Le=null;#Ae;constructor(e,t){super(e),this.#Ae=t}enter({node:e}){return!this.#Le&&(!this.#Ae(e)||(this.#Le=this.#Le??e,!1))}static find(e,t){return Dt.walk(e,t).#Le}static findAll(e,t){const n=[];return Dt.walk(e,(e=>(t(e)&&n.push(e),!1))),n}}var Nt=Object.freeze({__proto__:null,get ASTUtils(){return Pt},BottomUpTreeMatching:Ct,CSSControlMap:Mt,ComputedText:Rt,SyntaxTree:wt,TreeSearch:Dt,TreeWalker:St,matchDeclaration:Ot,matcherBase:kt,parseFontFamily:function(e){if(ut.has(e.trim()))return[];const t=[];for(const n of ft(bt(e))){const e=n.match(mt);e?t.push(e[1]||e[2]):t.push(n)}return t},parseFontVariationSettings:function(e){if(ut.has(e.trim())||"normal"===e.trim())return[];const t=[];for(const n of ft(bt(e))){const e=n.match(pt);e&&t.push({tag:e[1]||e[2],value:parseFloat(e[3])})}return t},requiresSpace:Tt,splitByComma:ft,stripComments:bt,tokenizeDeclaration:Lt,tokenizePropertyName:At});class Ft extends e.ObjectWrapper.ObjectWrapper{ownerStyle;index;name;value;important;disabled;parsedOk;implicit;text;range;#Oe;#De;#Ne;#Fe;#Be=[];constructor(e,n,r,s,i,o,a,l,d,c,h){if(super(),this.ownerStyle=e,this.index=n,this.name=r,this.value=s,this.important=i,this.disabled=o,this.parsedOk=a,this.implicit=l,this.text=d,this.range=c?t.TextRange.TextRange.fromObject(c):null,this.#Oe=!0,this.#De=null,this.#Ne=null,h&&h.length>0)for(const t of h)this.#Be.push(new Ft(e,++n,t.name,t.value,i,o,a,!0));else{const t=S().getLonghands(r);for(const r of t||[])this.#Be.push(new Ft(e,++n,r,"",i,o,a,!0))}}static parsePayload(e,t,n){return new Ft(e,t,n.name,n.value,n.important||!1,n.disabled||!1,!("parsedOk"in n)||Boolean(n.parsedOk),Boolean(n.implicit),n.text,n.range,n.longhandProperties)}parseExpression(e,t,n){return this.parsedOk?Ot(this.name,e,this.#Se(t,n)):null}parseValue(e,t){return this.parsedOk?Ot(this.name,this.value,this.#Se(e,t)):null}#Se(e,t){const n=e.propertyMatchers(this.ownerStyle,t);return n.push(new lt(this,e)),o.Runtime.experiments.isEnabled("font-editor")&&n.push(new Qe),n}ensureRanges(){if(this.#De&&this.#Ne)return;const e=this.range,n=this.text?new t.Text.Text(this.text):null;if(!e||!n)return;const r=n.value().indexOf(this.name),s=n.value().lastIndexOf(this.value);if(-1===r||-1===s||r>s)return;const i=new t.TextRange.SourceRange(r,this.name.length),o=new t.TextRange.SourceRange(s,this.value.length);function a(e,t,n){return 0===e.startLine&&(e.startColumn+=n,e.endColumn+=n),e.startLine+=t,e.endLine+=t,e}this.#De=a(n.toTextRange(i),e.startLine,e.startColumn),this.#Ne=a(n.toTextRange(o),e.startLine,e.startColumn)}nameRange(){return this.ensureRanges(),this.#De}valueRange(){return this.ensureRanges(),this.#Ne}rebase(e){this.ownerStyle.styleSheetId===e.styleSheetId&&this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}setActive(e){this.#Oe=e}get propertyText(){return void 0!==this.text?this.text:""===this.name?"":this.name+": "+this.value+(this.important?" !important":"")+";"}activeInStyle(){return this.#Oe}async setText(n,s,i){if(!this.ownerStyle)throw new Error("No ownerStyle for property");if(!this.ownerStyle.styleSheetId)throw new Error("No owner style id");if(!this.range||!this.ownerStyle.range)throw new Error("Style not editable");if(s&&(a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited),this.ownerStyle.parentRule?.isKeyframeRule()&&a.userMetrics.actionTaken(a.UserMetrics.Action.StylePropertyInsideKeyframeEdited),this.name.startsWith("--")&&a.userMetrics.actionTaken(a.UserMetrics.Action.CustomPropertyEdited)),i&&n===this.propertyText)return this.ownerStyle.cssModel().domModel().markUndoableState(!s),!0;const o=this.range.relativeTo(this.ownerStyle.range.startLine,this.ownerStyle.range.startColumn),l=this.ownerStyle.cssText?this.detectIndentation(this.ownerStyle.cssText):e.Settings.Settings.instance().moduleSetting("text-editor-indent").get(),d=this.ownerStyle.cssText?l.substring(0,this.ownerStyle.range.endColumn):"",c=new t.Text.Text(this.ownerStyle.cssText||"").replaceRange(o,r.StringUtilities.sprintf(";%s;",n)),h=await Ft.formatStyle(c,l,d);return await this.ownerStyle.setText(h,s)}static async formatStyle(e,n,r){const s=n.substring(r.length)+n;n&&(n="\n"+n);let i="",o="",a="",l=!1,d=!1;const c=t.CodeMirrorUtils.createCssTokenizer();return await c("*{"+e+"}",(function(e,t){if(!l){const r=t?.includes("comment")&&function(e){const t=e.indexOf(":");if(-1===t)return!1;const n=e.substring(2,t).trim();return S().isCSSPropertyName(n)}(e),s=t?.includes("def")||t?.includes("string")||t?.includes("meta")||t?.includes("property")||t?.includes("variableName")&&"variableName.function"!==t;return r?i=i.trimEnd()+n+e:s?(l=!0,a=e):(";"!==e||d)&&(i+=e,e.trim()&&!t?.includes("comment")&&(d=";"!==e)),void("{"!==e||t||(d=!1))}if("}"===e||";"===e){const t=a.trim();return i=i.trimEnd()+n+t+(t.endsWith(":")?" ":"")+e,d=!1,l=!1,void(o="")}if(S().isGridAreaDefiningProperty(o)){const t=I.exec(e);t&&0===t.index&&!a.trimEnd().endsWith("]")&&(a=a.trimEnd()+"\n"+s)}o||":"!==e||(o=a);a+=e})),l&&(i+=a),i=i.substring(2,i.length-1).trimEnd(),i+(n?"\n"+r:"")}detectIndentation(e){const n=e.split("\n");return n.length<2?"":t.TextUtils.Utils.lineIndent(n[1])}setValue(e,t,n,r){const s=this.name+": "+e+(this.important?" !important":"")+";";this.setText(s,t,n).then(r)}setLocalValue(e){this.value=e,this.dispatchEventToListeners("localValueUpdated")}async setDisabled(e){if(!this.ownerStyle)return!1;if(e===this.disabled)return!0;if(!this.text)return!0;const t=this.text.trim(),n=e=>e+(e.endsWith(";")?"":";");let r;return r=e?"/* "+n(bt(t))+" */":n(this.text.substring(2,t.length-2).trim()),await this.setText(r,!0,!0)}setDisplayedStringForInvalidProperty(e){this.#Fe=e}getInvalidStringForInvalidProperty(){return this.#Fe}getLonghandProperties(){return this.#Be}}var Bt=Object.freeze({__proto__:null,CSSProperty:Ft});class _t{text="";range;styleSheetId;cssModel;constructor(e){this.cssModel=e}rebase(e){this.styleSheetId===e.styleSheetId&&this.range&&(e.oldRange.equal(this.range)?this.reinitialize(e.payload):this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}equal(e){return!!(this.styleSheetId&&this.range&&e.range)&&(this.styleSheetId===e.styleSheetId&&this.range.equal(e.range))}lineNumberInSource(){if(this.range)return this.header()?.lineNumberInSource(this.range.startLine)}columnNumberInSource(){if(this.range)return this.header()?.columnNumberInSource(this.range.startLine,this.range.startColumn)}header(){return this.styleSheetId?this.cssModel.styleSheetHeaderForId(this.styleSheetId):null}rawLocation(){const e=this.header();if(!e||void 0===this.lineNumberInSource())return null;const t=Number(this.lineNumberInSource());return new Ur(e,t,this.columnNumberInSource())}}var Ht=Object.freeze({__proto__:null,CSSQuery:_t});class Ut extends _t{name;physicalAxes;logicalAxes;queriesScrollState;static parseContainerQueriesPayload(e,t){return t.map((t=>new Ut(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.name=e.name,this.physicalAxes=e.physicalAxes,this.logicalAxes=e.logicalAxes,this.queriesScrollState=e.queriesScrollState}active(){return!0}async getContainerForNode(e){const t=await this.cssModel.domModel().getContainerForNode(e,this.name,this.physicalAxes,this.logicalAxes,this.queriesScrollState);if(t)return new qt(t)}}class qt{containerNode;constructor(e){this.containerNode=e}async getContainerSizeDetails(){const e=await this.containerNode.domModel().cssModel().getComputedStyle(this.containerNode.id);if(!e)return;const t=e.get("container-type"),n=e.get("writing-mode");if(!t||!n)return;const r=zt(`${t}`),s=jt(r,n);let i,o;return"Both"!==s&&"Horizontal"!==s||(i=e.get("width")),"Both"!==s&&"Vertical"!==s||(o=e.get("height")),{queryAxis:r,physicalAxis:s,width:i,height:o}}}const zt=e=>{const t=e.split(" ");let n=!1;for(const e of t){if("size"===e)return"size";n=n||"inline-size"===e}return n?"inline-size":""},jt=(e,t)=>{const n=t.startsWith("vertical");switch(e){case"":return"";case"size":return"Both";case"inline-size":return n?"Vertical":"Horizontal";case"block-size":return n?"Horizontal":"Vertical"}};var Vt=Object.freeze({__proto__:null,CSSContainerQuery:Ut,CSSContainerQueryContainer:qt,getPhysicalAxisFromQueryAxis:jt,getQueryAxisFromContainerType:zt});class Wt extends _t{static parseLayerPayload(e,t){return t.map((t=>new Wt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Gt=Object.freeze({__proto__:null,CSSLayer:Wt});class Kt{#_e;#He;constructor(e){this.#_e=e.active,this.#He=[];for(let t=0;t<e.expressions.length;++t)this.#He.push(Qt.parsePayload(e.expressions[t]))}static parsePayload(e){return new Kt(e)}active(){return this.#_e}expressions(){return this.#He}}class Qt{#u;#Ue;#qe;#Ne;#ze;constructor(e){this.#u=e.value,this.#Ue=e.unit,this.#qe=e.feature,this.#Ne=e.valueRange?t.TextRange.TextRange.fromObject(e.valueRange):null,this.#ze=e.computedLength||null}static parsePayload(e){return new Qt(e)}value(){return this.#u}unit(){return this.#Ue}feature(){return this.#qe}valueRange(){return this.#Ne}computedLength(){return this.#ze}}class $t extends _t{source;sourceURL;mediaList;static parseMediaArrayPayload(e,t){return t.map((t=>new $t(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){if(this.text=e.text,this.source=e.source,this.sourceURL=e.sourceURL||"",this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.mediaList=null,e.mediaList){this.mediaList=[];for(let t=0;t<e.mediaList.length;++t)this.mediaList.push(Kt.parsePayload(e.mediaList[t]))}}active(){if(!this.mediaList)return!0;for(let e=0;e<this.mediaList.length;++e)if(this.mediaList[e].active())return!0;return!1}}var Xt=Object.freeze({__proto__:null,CSSMedia:$t,CSSMediaQuery:Kt,CSSMediaQueryExpression:Qt,Source:{LINKED_SHEET:"linkedSheet",INLINE_SHEET:"inlineSheet",MEDIA_RULE:"mediaRule",IMPORT_RULE:"importRule"}});class Jt extends _t{static parseScopesPayload(e,t){return t.map((t=>new Jt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Yt,Zt=Object.freeze({__proto__:null,CSSScope:Jt});class en{#je;parentRule;#Ve;styleSheetId;range;cssText;#We=new Map;#Ge=new Set;#Ke=new Map;#Qe;type;#$e;constructor(e,t,n,r,s){this.#je=e,this.parentRule=t,this.#Xe(n),this.type=r,this.#$e=s}rebase(e){if(this.styleSheetId===e.styleSheetId&&this.range)if(e.oldRange.equal(this.range))this.#Xe(e.payload);else{this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange);for(let t=0;t<this.#Ve.length;++t)this.#Ve[t].rebase(e)}}animationName(){return this.#$e}#Xe(e){this.styleSheetId=e.styleSheetId,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null;const n=e.shorthandEntries;this.#We=new Map,this.#Ge=new Set;for(let e=0;e<n.length;++e)this.#We.set(n[e].name,n[e].value),n[e].important&&this.#Ge.add(n[e].name);if(this.#Ve=[],e.cssText&&this.range){const t=[];for(const n of e.cssProperties){if(!n.range)continue;const e=Ft.parsePayload(this,this.#Ve.length,n);this.#Ve.push(e);for(const n of e.getLonghandProperties())t.push(n)}for(const e of t)e.index=this.#Ve.length,this.#Ve.push(e)}else for(const t of e.cssProperties)this.#Ve.push(Ft.parsePayload(this,this.#Ve.length,t));this.#Je(),this.#Ye(),this.#Ke=new Map;for(const e of this.#Ve)e.activeInStyle()&&this.#Ke.set(e.name,e);this.cssText=e.cssText,this.#Qe=null}#Je(){if(this.range)return;if(!this.#We.size)return;const e=new Set;for(const t of this.#Ve)e.add(t.name);const t=[];for(const n of this.#Ve){const r=S().getShorthands(n.name)||[];for(const n of r){if(e.has(n))continue;const r=this.#We.get(n);if(!r)continue;const s=Boolean(this.#Ge.has(n)),i=new Ft(this,this.allProperties().length,n,r,s,!1,!0,!1);t.push(i),e.add(n)}}this.#Ve=this.#Ve.concat(t)}#Ze(){if(this.range)return this.#Ve.filter((function(e){return Boolean(e.range)}));const e=[];for(const t of this.#Ve){const n=S().getShorthands(t.name)||[];let r=!1;for(const e of n)if(this.#We.get(e)){r=!0;break}r||e.push(t)}return e}leadingProperties(){return this.#Qe||(this.#Qe=this.#Ze()),this.#Qe}target(){return this.#je.target()}cssModel(){return this.#je}#Ye(){const e=new Map,t=new Set;for(const n of this.#Ve){const r=S(),s=r.canonicalPropertyName(n.name);if(n.disabled||!n.parsedOk){!n.disabled&&r.isCustomProperty(n.name)&&(e.get(s)?.setActive(!1),e.delete(s)),n.setActive(!1);continue}if(t.has(n))continue;for(const r of n.getLonghandProperties()){const n=e.get(r.name);n?!n.important||r.important?(n.setActive(!1),e.set(r.name,r)):r.setActive(!1):e.set(r.name,r),t.add(r)}const i=e.get(s);i?!i.important||n.important?(i.setActive(!1),e.set(s,n)):n.setActive(!1):e.set(s,n)}}allProperties(){return this.#Ve}hasActiveProperty(e){return this.#Ke.has(e)}getPropertyValue(e){const t=this.#Ke.get(e);return t?t.value:""}isPropertyImplicit(e){const t=this.#Ke.get(e);return!!t&&t.implicit}propertyAt(e){return e<this.allProperties().length?this.allProperties()[e]:null}pastLastSourcePropertyIndex(){for(let e=this.allProperties().length-1;e>=0;--e)if(this.allProperties()[e].range)return e+1;return 0}#et(e){const t=this.propertyAt(e);if(t?.range)return t.range.collapseToStart();if(!this.range)throw new Error("CSSStyleDeclaration.range is null");return this.range.collapseToEnd()}newBlankProperty(e){e=void 0===e?this.pastLastSourcePropertyIndex():e;return new Ft(this,e,"","",!1,!1,!0,!1,"",this.#et(e))}setText(e,t){return this.range&&this.styleSheetId?this.#je.setStyleText(this.styleSheetId,this.range,e,t):Promise.resolve(!1)}insertPropertyAt(e,t,n,r){this.newBlankProperty(e).setText(t+": "+n+";",!1,!0).then(r)}appendProperty(e,t,n){this.insertPropertyAt(this.allProperties().length,e,t,n)}}!function(e){e.Regular="Regular",e.Inline="Inline",e.Attributes="Attributes",e.Pseudo="Pseudo",e.Transition="Transition",e.Animation="Animation"}(Yt||(Yt={}));var tn=Object.freeze({__proto__:null,CSSStyleDeclaration:en,get Type(){return Yt}});class nn extends _t{static parseSupportsPayload(e,t){return t.map((t=>new nn(e,t)))}#Oe=!0;constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.#Oe=e.active}active(){return this.#Oe}}var rn=Object.freeze({__proto__:null,CSSSupports:nn});class sn{cssModelInternal;styleSheetId;sourceURL;origin;style;constructor(e,t){if(this.cssModelInternal=e,this.styleSheetId=t.styleSheetId,this.styleSheetId){const e=this.getStyleSheetHeader(this.styleSheetId);this.sourceURL=e.sourceURL}this.origin=t.origin,this.style=new en(this.cssModelInternal,this,t.style,Yt.Regular)}rebase(e){this.styleSheetId===e.styleSheetId&&this.style.rebase(e)}resourceURL(){if(!this.styleSheetId)return r.DevToolsPath.EmptyUrlString;return this.getStyleSheetHeader(this.styleSheetId).resourceURL()}isUserAgent(){return"user-agent"===this.origin}isInjected(){return"injected"===this.origin}isViaInspector(){return"inspector"===this.origin}isRegular(){return"regular"===this.origin}isKeyframeRule(){return!1}cssModel(){return this.cssModelInternal}getStyleSheetHeader(e){const t=this.cssModelInternal.styleSheetHeaderForId(e);return console.assert(null!==t),t}}class on{text;range;specificity;constructor(e){this.text=e.text,e.range&&(this.range=t.TextRange.TextRange.fromObject(e.range)),e.specificity&&(this.specificity=e.specificity)}rebase(e){this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}}class an extends sn{selectors;nestingSelectors;media;containerQueries;supports;scopes;layers;ruleTypes;wasUsed;constructor(e,t,n){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeSelectors(t.selectorList),this.nestingSelectors=t.nestingSelectors,this.media=t.media?$t.parseMediaArrayPayload(e,t.media):[],this.containerQueries=t.containerQueries?Ut.parseContainerQueriesPayload(e,t.containerQueries):[],this.scopes=t.scopes?Jt.parseScopesPayload(e,t.scopes):[],this.supports=t.supports?nn.parseSupportsPayload(e,t.supports):[],this.layers=t.layers?Wt.parseLayerPayload(e,t.layers):[],this.ruleTypes=t.ruleTypes||[],this.wasUsed=n||!1}static createDummyRule(e,n){const r={selectorList:{text:"",selectors:[{text:n,value:void 0}]},style:{styleSheetId:"0",range:new t.TextRange.TextRange(0,0,0,0),shorthandEntries:[],cssProperties:[]},origin:"inspector"};return new an(e,r)}reinitializeSelectors(e){this.selectors=[];for(let t=0;t<e.selectors.length;++t)this.selectors.push(new on(e.selectors[t]))}setSelectorText(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.selectorRange();if(!n)throw new Error("Rule selector is not editable");return this.cssModelInternal.setSelectorText(t,n,e)}selectorText(){return this.selectors.map((e=>e.text)).join(", ")}selectorRange(){if(0===this.selectors.length)return null;const e=this.selectors[0].range,n=this.selectors[this.selectors.length-1].range;return e&&n?new t.TextRange.TextRange(e.startLine,e.startColumn,n.endLine,n.endColumn):null}lineNumberInSource(e){const t=this.selectors[e];if(!t?.range||!this.styleSheetId)return 0;return this.getStyleSheetHeader(this.styleSheetId).lineNumberInSource(t.range.startLine)}columnNumberInSource(e){const t=this.selectors[e];if(!t?.range||!this.styleSheetId)return;return this.getStyleSheetHeader(this.styleSheetId).columnNumberInSource(t.range.startLine,t.range.startColumn)}rebase(e){if(this.styleSheetId!==e.styleSheetId)return;const t=this.selectorRange();if(t?.equal(e.oldRange))this.reinitializeSelectors(e.payload);else for(let t=0;t<this.selectors.length;++t)this.selectors[t].rebase(e);this.media.forEach((t=>t.rebase(e))),this.containerQueries.forEach((t=>t.rebase(e))),this.scopes.forEach((t=>t.rebase(e))),this.supports.forEach((t=>t.rebase(e))),super.rebase(e)}}class ln extends sn{#tt;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#tt=new on(t.propertyName)}propertyName(){return this.#tt}initialValue(){return this.style.hasActiveProperty("initial-value")?this.style.getPropertyValue("initial-value"):null}syntax(){return this.style.getPropertyValue("syntax")}inherits(){return"true"===this.style.getPropertyValue("inherits")}setPropertyName(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.#tt.range;if(!n)throw new Error("Property name is not editable");return this.cssModelInternal.setPropertyRulePropertyName(t,n,e)}}class dn extends sn{#nt;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#nt=new on(t.fontPaletteName)}name(){return this.#nt}}class cn{#$e;#rt;constructor(e,t){this.#$e=new on(t.animationName),this.#rt=t.keyframes.map((t=>new hn(e,t)))}name(){return this.#$e}keyframes(){return this.#rt}}class hn extends sn{#st;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeKey(t.keyText)}key(){return this.#st}reinitializeKey(e){this.#st=new on(e)}rebase(e){this.styleSheetId===e.styleSheetId&&this.#st.range&&(e.oldRange.equal(this.#st.range)?this.reinitializeKey(e.payload):this.#st.rebase(e),super.rebase(e))}isKeyframeRule(){return!0}setKeyText(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.#st.range;if(!n)throw new Error("Keyframe key is not editable");return this.cssModelInternal.setKeyframeKey(t,n,e)}}class un extends sn{#tt;#Oe;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#tt=new on(t.name),this.#Oe=t.active}name(){return this.#tt}active(){return this.#Oe}}class gn extends sn{#tt;#it;#ot;constructor(e,t){super(e,{origin:t.origin,style:{cssProperties:[],shorthandEntries:[]},styleSheetId:t.styleSheetId}),this.#tt=new on(t.name),this.#it=t.parameters.map((({name:e})=>e)),this.#ot=this.protocolNodesToNestedStyles(t.children)}functionName(){return this.#tt}parameters(){return this.#it}children(){return this.#ot}protocolNodesToNestedStyles(e){const t=[];for(const n of e){const e=this.protocolNodeToNestedStyle(n);e&&t.push(e)}return t}protocolNodeToNestedStyle(e){if(e.style)return{style:new en(this.cssModelInternal,this,e.style,Yt.Regular)};if(e.condition){const t=this.protocolNodesToNestedStyles(e.condition.children);return e.condition.media?{children:t,media:new $t(this.cssModelInternal,e.condition.media)}:e.condition.containerQueries?{children:t,container:new Ut(this.cssModelInternal,e.condition.containerQueries)}:e.condition.supports?{children:t,supports:new nn(this.cssModelInternal,e.condition.supports)}:void console.error("A function rule condition must have a media, container, or supports")}console.error("A function rule node must have a style or condition")}}var pn=Object.freeze({__proto__:null,CSSFontPaletteValuesRule:dn,CSSFunctionRule:gn,CSSKeyframeRule:hn,CSSKeyframesRule:cn,CSSPositionTryRule:un,CSSPropertyRule:ln,CSSRule:sn,CSSStyleRule:an});function mn(e,t){if(!t.styleSheetId||!t.range)return!1;for(const n of e)if(t.styleSheetId===n.styleSheetId&&n.range&&t.range.equal(n.range))return!0;return!1}function fn(e){const t=e.allProperties();for(let e=0;e<t.length;++e){const n=t[e];if(n.activeInStyle()&&S().isPropertyInherited(n.name))return!0}return!1}function bn(e){for(const t of e)s(t);const t=[];for(const s of e){const e=t[t.length-1];e&&"user-agent"===s.rule.origin&&"user-agent"===e.rule.origin&&s.rule.selectorList.text===e.rule.selectorList.text&&r(s)===r(e)?n(s,e):t.push(s)}return t;function n(e,t){const n=new Map,r=new Map;for(const e of t.rule.style.shorthandEntries)n.set(e.name,e.value);for(const e of t.rule.style.cssProperties)r.set(e.name,e.value);for(const t of e.rule.style.shorthandEntries)n.set(t.name,t.value);for(const t of e.rule.style.cssProperties)r.set(t.name,t.value);t.rule.style.shorthandEntries=[...n.entries()].map((([e,t])=>({name:e,value:t}))),t.rule.style.cssProperties=[...r.entries()].map((([e,t])=>({name:e,value:t})))}function r(e){return e.rule.media?e.rule.media.map((e=>e.text)).join(", "):null}function s(e){const{matchingSelectors:t,rule:n}=e;"user-agent"===n.origin&&t.length&&(n.selectorList.selectors=n.selectorList.selectors.filter(((e,n)=>t.includes(n))),n.selectorList.text=n.selectorList.selectors.map((e=>e.text)).join(", "),e.matchingSelectors=t.map(((e,t)=>t)))}}function yn(e){const t=new Map;for(let n=0;n<e.matchingSelectors.length;n++){const r=e.matchingSelectors[n],s=e.rule.selectorList.selectors[r].text.match(/::highlight\((.*)\)/);if(s){const e=s[1],n=t.get(e);n?n.push(r):t.set(e,[r])}}return t}class vn{#at;#lt;#dt;constructor(e,t){this.#lt=e,this.#at=t}propertyName(){return this.#at instanceof ln?this.#at.propertyName().text:this.#at.propertyName}initialValue(){return this.#at instanceof ln?this.#at.initialValue():this.#at.initialValue?.text??null}inherits(){return this.#at instanceof ln?this.#at.inherits():this.#at.inherits}syntax(){return this.#at instanceof ln?this.#at.syntax():`"${this.#at.syntax}"`}parseValue(e,t){const n=this.initialValue();return n?Ot(this.propertyName(),n,e.propertyMatchers(this.style(),t)):null}#ct(){if(this.#at instanceof ln)return[];const{inherits:e,initialValue:t,syntax:n}=this.#at,r=[{name:"inherits",value:`${e}`},{name:"syntax",value:`"${n}"`}];return void 0!==t&&r.push({name:"initial-value",value:t.text}),r}style(){return this.#dt||(this.#dt=this.#at instanceof ln?this.#at.style:new en(this.#lt,null,{cssProperties:this.#ct(),shorthandEntries:[]},Yt.Pseudo)),this.#dt}}class In{#je;#ht;#ut=new Map;#gt=new Map;#rt=[];#pt;#mt=new Map;#ft=new Map;#bt=new Set;#yt=new Map;#vt;#It;#wt;#St;#kt;#Ct;#xt;#Rt;static async create(e){const t=new In(e);return await t.init(e),t}constructor({cssModel:e,node:t,animationsPayload:n,parentLayoutNodeId:r,positionTryRules:s,propertyRules:i,cssPropertyRegistrations:o,fontPaletteValuesRule:a,activePositionFallbackIndex:l,functionRules:d}){this.#je=e,this.#ht=t,this.#pt=[...i.map((t=>new ln(e,t))),...o].map((t=>new vn(e,t))),n&&(this.#rt=n.map((t=>new cn(e,t)))),this.#It=s.map((t=>new un(e,t))),this.#vt=r,this.#Rt=a?new dn(e,a):void 0,this.#wt=l,this.#xt=d.map((t=>new gn(e,t)))}async init({matchedPayload:e,inheritedPayload:t,inlinePayload:n,attributesPayload:r,pseudoPayload:s,inheritedPseudoPayload:i,animationStylesPayload:o,transitionsStylePayload:a,inheritedAnimatedPayload:l}){e=bn(e);for(const e of t)e.matchedCSSRules=bn(e.matchedCSSRules);this.#St=await this.buildMainCascade(n,r,e,t,o,a,l),[this.#kt,this.#Ct]=this.buildPseudoCascades(s,i);for(const e of Array.from(this.#Ct.values()).concat(Array.from(this.#kt.values())).concat(this.#St))for(const t of e.styles())this.#yt.set(t,e);for(const e of this.#pt)this.#mt.set(e.propertyName(),e)}async buildMainCascade(e,t,n,r,s,i,o){const a=[],l=[];function d(){if(!t)return;const e=new en(this.#je,null,t,Yt.Attributes);this.#ft.set(e,this.#ht),l.push(e)}if(i){const e=new en(this.#je,null,i,Yt.Transition);this.#ft.set(e,this.#ht),l.push(e)}for(const e of s){const t=new en(this.#je,null,e.style,Yt.Animation,e.name);this.#ft.set(t,this.#ht),l.push(t)}if(e&&this.#ht.nodeType()===Node.ELEMENT_NODE){const t=new en(this.#je,null,e,Yt.Inline);this.#ft.set(t,this.#ht),l.push(t)}let c;for(let e=n.length-1;e>=0;--e){const t=new an(this.#je,n[e].rule);!t.isInjected()&&!t.isUserAgent()||c||(c=!0,d.call(this)),this.#ft.set(t.style,this.#ht),l.push(t.style),this.addMatchingSelectors(this.#ht,t,n[e].matchingSelectors)}c||d.call(this),a.push(new wn(this,l,!1));let h=this.#ht.parentNode;const u=async e=>e.hasAssignedSlot()?await(e.assignedSlot?.deferredNode.resolvePromise())??null:e.parentNode;for(let e=0;h&&r&&e<r.length;++e){const t=[],n=r[e],s=o[e],i=n.inlineStyle?new en(this.#je,null,n.inlineStyle,Yt.Inline):null,d=s?.transitionsStyle?new en(this.#je,null,s?.transitionsStyle,Yt.Transition):null,c=s?.animationStyles?.map((e=>new en(this.#je,null,e.style,Yt.Animation,e.name)))??[];d&&fn(d)&&(this.#ft.set(d,h),t.push(d),this.#bt.add(d));for(const e of c)fn(e)&&(this.#ft.set(e,h),t.push(e),this.#bt.add(e));i&&fn(i)&&(this.#ft.set(i,h),t.push(i),this.#bt.add(i));const g=n.matchedCSSRules||[];for(let e=g.length-1;e>=0;--e){const n=new an(this.#je,g[e].rule);this.addMatchingSelectors(h,n,g[e].matchingSelectors),fn(n.style)&&((n.style.allProperties().some((e=>S().isCustomProperty(e.name)))||!mn(l,n.style)&&!mn(this.#bt,n.style))&&(this.#ft.set(n.style,h),t.push(n.style),this.#bt.add(n.style)))}h=await u(h),a.push(new wn(this,t,!0))}return new Tn(a,this.#pt)}buildSplitCustomHighlightCascades(e,t,n,r){const s=new Map;for(let r=e.length-1;r>=0;--r){const i=yn(e[r]);for(const[o,a]of i){const i=new an(this.#je,e[r].rule);this.#ft.set(i.style,t),n&&this.#bt.add(i.style),this.addMatchingSelectors(t,i,a);const l=s.get(o);l?l.push(i.style):s.set(o,[i.style])}}for(const[e,t]of s){const s=new wn(this,t,n,!0),i=r.get(e);i?i.push(s):r.set(e,[s])}}buildPseudoCascades(e,t){const n=new Map,r=new Map;if(!e)return[n,r];const s=new Map,i=new Map;for(let t=0;t<e.length;++t){const n=e[t],r=this.#ht.pseudoElements().get(n.pseudoType)?.at(-1)||null,o=[],a=n.matches||[];if("highlight"===n.pseudoType)this.buildSplitCustomHighlightCascades(a,this.#ht,!1,i);else{for(let e=a.length-1;e>=0;--e){const t=new an(this.#je,a[e].rule);o.push(t.style);const s=S().isHighlightPseudoType(n.pseudoType)?this.#ht:r;this.#ft.set(t.style,s),s&&this.addMatchingSelectors(s,t,a[e].matchingSelectors)}const e=S().isHighlightPseudoType(n.pseudoType),t=new wn(this,o,!1,e);s.set(n.pseudoType,[t])}}if(t){let e=this.#ht.parentNode;for(let n=0;e&&n<t.length;++n){const r=t[n].pseudoElements;for(let t=0;t<r.length;++t){const n=r[t],o=n.matches||[];if("highlight"===n.pseudoType)this.buildSplitCustomHighlightCascades(o,e,!0,i);else{const t=[];for(let n=o.length-1;n>=0;--n){const r=new an(this.#je,o[n].rule);t.push(r.style),this.#ft.set(r.style,e),this.#bt.add(r.style),this.addMatchingSelectors(e,r,o[n].matchingSelectors)}const r=S().isHighlightPseudoType(n.pseudoType),i=new wn(this,t,!0,r),a=s.get(n.pseudoType);a?a.push(i):s.set(n.pseudoType,[i])}}e=e.parentNode}}for(const[e,t]of s.entries())n.set(e,new Tn(t,this.#pt));for(const[e,t]of i.entries())r.set(e,new Tn(t,this.#pt));return[n,r]}addMatchingSelectors(e,t,n){for(const r of n){const n=t.selectors[r];n&&this.setSelectorMatches(e,n.text,!0)}}node(){return this.#ht}cssModel(){return this.#je}hasMatchingSelectors(e){return(0===e.selectors.length||this.getMatchingSelectors(e).length>0)&&function(e){if(!e.parentRule)return!0;const t=e.parentRule,n=[...t.media,...t.containerQueries,...t.supports,...t.scopes];for(const e of n)if(!e.active())return!1;return!0}(e.style)}getParentLayoutNodeId(){return this.#vt}getMatchingSelectors(e){const t=this.nodeForStyle(e.style);if(!t||"number"!=typeof t.id)return[];const n=this.#gt.get(t.id);if(!n)return[];const r=[];for(let t=0;t<e.selectors.length;++t)n.get(e.selectors[t].text)&&r.push(t);return r}async recomputeMatchingSelectors(e){const t=this.nodeForStyle(e.style);if(!t)return;const n=[];for(const s of e.selectors)n.push(r.call(this,t,s.text));async function r(e,t){const n=e.ownerDocument;if(!n)return;if("number"==typeof e.id){const n=this.#gt.get(e.id);if(n?.has(t))return}if("number"!=typeof n.id)return;const r=await this.#ht.domModel().querySelectorAll(n.id,t);r&&("number"==typeof e.id?this.setSelectorMatches(e,t,-1!==r.indexOf(e.id)):this.setSelectorMatches(e,t,!1))}await Promise.all(n)}addNewRule(e,t){return this.#ut.set(e.style,t),this.recomputeMatchingSelectors(e)}setSelectorMatches(e,t,n){if("number"!=typeof e.id)return;let r=this.#gt.get(e.id);r||(r=new Map,this.#gt.set(e.id,r)),r.set(t,n)}nodeStyles(){return r.assertNotNullOrUndefined(this.#St),this.#St.styles()}inheritedStyles(){return this.#St?.styles().filter((e=>this.isInherited(e)))??[]}animationStyles(){return this.#St?.styles().filter((e=>!this.isInherited(e)&&e.type===Yt.Animation))??[]}transitionsStyle(){return this.#St?.styles().find((e=>!this.isInherited(e)&&e.type===Yt.Transition))??null}registeredProperties(){return this.#pt}getRegisteredProperty(e){return this.#mt.get(e)}functionRules(){return this.#xt}fontPaletteValuesRule(){return this.#Rt}keyframes(){return this.#rt}positionTryRules(){return this.#It}activePositionFallbackIndex(){return this.#wt}pseudoStyles(e){r.assertNotNullOrUndefined(this.#kt);const t=this.#kt.get(e);return t?t.styles():[]}pseudoTypes(){return r.assertNotNullOrUndefined(this.#kt),new Set(this.#kt.keys())}customHighlightPseudoStyles(e){r.assertNotNullOrUndefined(this.#Ct);const t=this.#Ct.get(e);return t?t.styles():[]}customHighlightPseudoNames(){return r.assertNotNullOrUndefined(this.#Ct),new Set(this.#Ct.keys())}nodeForStyle(e){return this.#ut.get(e)||this.#ft.get(e)||null}availableCSSVariables(e){const t=this.#yt.get(e);return t?t.findAvailableCSSVariables(e):[]}computeCSSVariable(e,t){const n=this.#yt.get(e);return n?n.computeCSSVariable(e,t):null}resolveProperty(e,t){return this.#yt.get(t)?.resolveProperty(e,t)??null}resolveGlobalKeyword(e,t){const n=this.#yt.get(e.ownerStyle)?.resolveGlobalKeyword(e,t);return n?new kn(n):null}isInherited(e){return this.#bt.has(e)}propertyState(e){const t=this.#yt.get(e.ownerStyle);return t?t.propertyState(e):null}resetActiveProperties(){r.assertNotNullOrUndefined(this.#St),r.assertNotNullOrUndefined(this.#kt),r.assertNotNullOrUndefined(this.#Ct),this.#St.reset();for(const e of this.#kt.values())e.reset();for(const e of this.#Ct.values())e.reset()}propertyMatchers(e,t){return[new ve(this,e),new De((()=>t?.get("color")??null)),new Me,new Ee,new xe,new Ue,new ze,new Ve,new Ge,new Fe(e),new nt,new Ae,new st,new ot,new et,new ct,new Xe,new Ye,new _e,new we]}}class wn{#Tt;styles;#Mt;#Pt;propertiesState=new Map;activeProperties=new Map;constructor(e,t,n,r=!1){this.#Tt=e,this.styles=t,this.#Mt=n,this.#Pt=r}computeActiveProperties(){this.propertiesState.clear(),this.activeProperties.clear();for(let e=this.styles.length-1;e>=0;e--){const t=this.styles[e],n=t.parentRule;if((!n||n instanceof an)&&(!n||this.#Tt.hasMatchingSelectors(n)))for(const e of t.allProperties()){const n=S();if(this.#Mt&&!this.#Pt&&!n.isPropertyInherited(e.name))continue;if(t.range&&!e.range)continue;if(!e.activeInStyle()){this.propertiesState.set(e,"Overloaded");continue}if(this.#Mt){const t=this.#Tt.getRegisteredProperty(e.name);if(t&&!t.inherits()){this.propertiesState.set(e,"Overloaded");continue}}const r=n.canonicalPropertyName(e.name);this.updatePropertyState(e,r);for(const t of e.getLonghandProperties())n.isCSSPropertyName(t.name)&&this.updatePropertyState(t,t.name)}}}updatePropertyState(e,t){const n=this.activeProperties.get(t);!n?.important||e.important?(n&&this.propertiesState.set(n,"Overloaded"),this.propertiesState.set(e,"Active"),this.activeProperties.set(t,e)):this.propertiesState.set(e,"Overloaded")}}function Sn(e){return"ownerStyle"in e}class kn{declaration;constructor(e){this.declaration=e}get value(){return Sn(this.declaration)?this.declaration.value:this.declaration.initialValue()}get style(){return Sn(this.declaration)?this.declaration.ownerStyle:this.declaration.style()}get name(){return Sn(this.declaration)?this.declaration.name:this.declaration.propertyName()}}class Cn{nodeCascade;name;discoveryTime;rootDiscoveryTime;get isRootEntry(){return this.rootDiscoveryTime===this.discoveryTime}updateRoot(e){this.rootDiscoveryTime=Math.min(this.rootDiscoveryTime,e.rootDiscoveryTime)}constructor(e,t,n){this.nodeCascade=e,this.name=t,this.discoveryTime=n,this.rootDiscoveryTime=n}}class xn{#Et=0;#Lt=[];#At=new Map;get(e,t){return this.#At.get(e)?.get(t)}add(e,t){const n=this.get(e,t);if(n)return n;const r=new Cn(e,t,this.#Et++);this.#Lt.push(r);let s=this.#At.get(e);return s||(s=new Map,this.#At.set(e,s)),s.set(t,r),r}isInInProgressSCC(e){return this.#Lt.includes(e)}finishSCC(e){const t=this.#Lt.lastIndexOf(e);return console.assert(t>=0,"Root is not an in-progress scc"),this.#Lt.splice(t)}}function*Rn(e,t){for(let n=void 0!==t?e.indexOf(t)+1:0;n<e.length;++n)yield e[n]}class Tn{#Ot=new Map;#Dt=new Map;#Nt=new Map;#Ft=new Map;#Bt=!1;#_t;#pt;constructor(e,t){this.#_t=e,this.#pt=t;for(const t of e)for(const e of t.styles)this.#Ft.set(e,t)}findAvailableCSSVariables(e){const t=this.#Ft.get(e);if(!t)return[];this.ensureInitialized();const n=this.#Dt.get(t);return n?Array.from(n.keys()):[]}#Ht(e,t){const n=this.#Ft.get(e.ownerStyle);if(!n)return null;for(const r of Rn(n.styles,e.ownerStyle)){const n=r.allProperties().findLast((n=>n.name===e.name&&t(n)));if(n)return n}return null}resolveProperty(e,t){const n=this.#Ft.get(t);if(!n)return null;for(const r of function*(e,t){(void 0===t||e.includes(t))&&(void 0!==t&&(yield t),yield*Rn(e,t))}(n.styles,t)){const t=r.allProperties().findLast((t=>t.name===e));if(t)return t}return this.#Ut({name:e,ownerStyle:t})}#qt(e){const t=this.#Ft.get(e.ownerStyle);if(!t)return null;for(const n of Rn(this.#_t,t))for(const t of n.styles){const n=t.allProperties().findLast((t=>t.name===e.name));if(n)return n}return null}#Ut(e){return S().isPropertyInherited(e.name)&&(this.#zt(e.name)?.inherits()??1)?this.#qt(e):null}#zt(e){const t=this.#pt.find((t=>t.propertyName()===e));return t||null}resolveGlobalKeyword(e,t){const n=t=>t.ownerStyle.parentRule instanceof an&&(e.ownerStyle.type===Yt.Inline||e.ownerStyle.parentRule instanceof an&&"regular"===t.ownerStyle.parentRule?.origin&&JSON.stringify(t.ownerStyle.parentRule.layers)!==JSON.stringify(e.ownerStyle.parentRule.layers));switch(t){case"initial":return this.#zt(e.name);case"inherit":return this.#qt(e)??this.#zt(e.name);case"revert":return this.#Ht(e,(t=>null!==t.ownerStyle.parentRule&&t.ownerStyle.parentRule.origin!==(e.ownerStyle.parentRule?.origin??"regular")))??this.resolveGlobalKeyword(e,"unset");case"revert-layer":return this.#Ht(e,n)??this.resolveGlobalKeyword(e,"revert");case"unset":return this.#Ut(e)??this.#zt(e.name)}}computeCSSVariable(e,t){const n=this.#Ft.get(e);return n?(this.ensureInitialized(),this.innerComputeCSSVariable(n,t)):null}innerComputeCSSVariable(e,t,n=new xn){const r=this.#Dt.get(e),s=this.#Nt.get(e);if(!s||!r?.has(t))return null;if(s?.has(t))return s.get(t)||null;let i=r.get(t);if(null==i)return null;if(i.declaration.declaration instanceof Ft&&i.declaration.value&&f.isCSSWideKeyword(i.declaration.value)){const e=this.resolveGlobalKeyword(i.declaration.declaration,i.declaration.value);if(!e)return i;const t=new kn(e),{value:n}=t;if(!n)return i;i={declaration:t,value:n}}const o=Lt(`--${t}`,i.value);if(!o)return null;const a=n.add(e,t),l=Ct.walk(o,[new be((e=>{const t=i.declaration.style,r=this.#Ft.get(t);if(!r)return null;const s=n.get(r,e.name);if(s)return n.isInInProgressSCC(s)?(a.updateRoot(s),null):this.#Nt.get(r)?.get(e.name)?.value??null;const o=this.innerComputeCSSVariable(r,e.name,n),l=n.get(r,e.name);return l&&a.updateRoot(l),void 0!==o?.value?o.value:0===e.fallback.length||e.matching.hasUnresolvedVarsRange(e.fallback[0],e.fallback[e.fallback.length-1])?null:e.matching.getComputedTextRange(e.fallback[0],e.fallback[e.fallback.length-1])}))]),d=Pt.siblings(Pt.declValue(l.ast.tree)),c=d.length>0?l.getComputedTextRange(d[0],d[d.length-1]):"";if(a.isRootEntry){const t=n.finishSCC(a);if(t.length>1){for(const n of t)console.assert(n.nodeCascade===e,"Circles should be within the cascade"),s.set(n.name,null);return null}}if(d.length>0&&l.hasUnresolvedVarsRange(d[0],d[d.length-1]))return s.set(t,null),null;const h={value:c,declaration:i.declaration};return s.set(t,h),h}styles(){return Array.from(this.#Ft.keys())}propertyState(e){return this.ensureInitialized(),this.#Ot.get(e)||null}reset(){this.#Bt=!1,this.#Ot.clear(),this.#Dt.clear(),this.#Nt.clear()}ensureInitialized(){if(this.#Bt)return;this.#Bt=!0;const e=new Map;for(const t of this.#_t){t.computeActiveProperties();for(const[n,r]of t.propertiesState){if("Overloaded"===r){this.#Ot.set(n,"Overloaded");continue}const t=S().canonicalPropertyName(n.name);e.has(t)?this.#Ot.set(n,"Overloaded"):(e.set(t,n),this.#Ot.set(n,"Active"))}}for(const[t,n]of e){const r=n.ownerStyle,s=n.getLonghandProperties();if(!s.length)continue;let i=!1;for(const t of s){const n=S().canonicalPropertyName(t.name),s=e.get(n);if(s&&s.ownerStyle===r){i=!0;break}}i||(e.delete(t),this.#Ot.set(n,"Overloaded"))}const t=new Map;for(const e of this.#pt){const n=e.initialValue();t.set(e.propertyName(),null!==n?{value:n,declaration:new kn(e)}:null)}for(let e=this.#_t.length-1;e>=0;--e){const n=this.#_t[e],r=[];for(const e of n.activeProperties.entries()){const n=e[0],s=e[1];n.startsWith("--")&&(t.set(n,{value:s.value,declaration:new kn(s)}),r.push(n))}const s=new Map(t),i=new Map;this.#Dt.set(n,s),this.#Nt.set(n,i);for(const e of r){const r=t.get(e);t.delete(e);const s=this.innerComputeCSSVariable(n,e);r&&s?.value===r.value&&(s.declaration=r.declaration),t.set(e,s)}}}}var Mn=Object.freeze({__proto__:null,CSSMatchedStyles:In,CSSRegisteredProperty:vn,CSSValueSource:kn});const Pn={couldNotFindTheOriginalStyle:"Could not find the original style sheet.",thereWasAnErrorRetrievingThe:"There was an error retrieving the source styles."},En=n.i18n.registerUIStrings("core/sdk/CSSStyleSheetHeader.ts",Pn),Ln=n.i18n.getLocalizedString.bind(void 0,En);class An{#je;id;frameId;sourceURL;hasSourceURL;origin;title;disabled;isInline;isMutable;isConstructed;startLine;startColumn;endLine;endColumn;contentLength;ownerNode;sourceMapURL;loadingFailed;#jt;constructor(e,t){this.#je=e,this.id=t.styleSheetId,this.frameId=t.frameId,this.sourceURL=t.sourceURL,this.hasSourceURL=Boolean(t.hasSourceURL),this.origin=t.origin,this.title=t.title,this.disabled=t.disabled,this.isInline=t.isInline,this.isMutable=t.isMutable,this.isConstructed=t.isConstructed,this.startLine=t.startLine,this.startColumn=t.startColumn,this.endLine=t.endLine,this.endColumn=t.endColumn,this.contentLength=t.length,t.ownerNode&&(this.ownerNode=new js(e.target(),t.ownerNode)),this.sourceMapURL=t.sourceMapURL,this.loadingFailed=t.loadingFailed??!1,this.#jt=null}originalContentProvider(){if(!this.#jt){const e=async()=>{const e=await this.#je.originalStyleSheetText(this);return null===e?{error:Ln(Pn.couldNotFindTheOriginalStyle)}:new t.ContentData.ContentData(e,!1,"text/css")};this.#jt=new t.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),e)}return this.#jt}setSourceMapURL(e){this.sourceMapURL=e}cssModel(){return this.#je}isAnonymousInlineStyleSheet(){return!this.resourceURL()&&!this.#je.sourceMapManager().sourceMapForClient(this)}isConstructedByNew(){return this.isConstructed&&0===this.sourceURL.length}resourceURL(){return this.isViaInspector()?this.viaInspectorResourceURL():this.sourceURL}getFrameURLPath(){const t=this.#je.target().model(ii);if(console.assert(Boolean(t)),!t)return"";const n=t.frameForId(this.frameId);if(!n)return"";console.assert(Boolean(n));const r=new e.ParsedURL.ParsedURL(n.url);let s=r.host+r.folderPathComponents;return s.endsWith("/")||(s+="/"),s}viaInspectorResourceURL(){return`inspector:///inspector-stylesheet#${this.id}`}lineNumberInSource(e){return this.startLine+e}columnNumberInSource(e,t){return(e?0:this.startColumn)+t}containsLocation(e,t){const n=e===this.startLine&&t>=this.startColumn||e>this.startLine,r=e<this.endLine||e===this.endLine&&t<=this.endColumn;return n&&r}contentURL(){return this.resourceURL()}contentType(){return e.ResourceType.resourceTypes.Stylesheet}requestContent(){return this.requestContentData().then(t.ContentData.ContentData.asDeferredContent.bind(void 0))}async requestContentData(){const e=await this.#je.getStyleSheetText(this.id);return null===e?{error:Ln(Pn.thereWasAnErrorRetrievingThe)}:new t.ContentData.ContentData(e,!1,"text/css")}async searchInContent(e,n,r){const s=await this.requestContentData();return t.TextUtils.performSearchInContentData(s,e,n,r)}isViaInspector(){return"inspector"===this.origin}createPageResourceLoadInitiator(){return{target:this.#je.target(),frameId:this.frameId,initiatorUrl:this.hasSourceURL?r.DevToolsPath.EmptyUrlString:this.sourceURL}}}var On=Object.freeze({__proto__:null,CSSStyleSheetHeader:An});let Dn=null;class Nn extends e.ObjectWrapper.ObjectWrapper{#Vt=new WeakMap;#Wt=new Map;#Gt=new Map;#Kt=null;#Qt=new Map;#$t=new Map;constructor(){super(),W.instance().observeModels(ii,this)}static instance({forceNew:e}={forceNew:!1}){return Dn&&!e||(Dn=new Nn),Dn}static removeInstance(){Dn=null}modelAdded(e){const t=e.addEventListener(ri.FrameAdded,this.frameAdded,this),n=e.addEventListener(ri.FrameDetached,this.frameDetached,this),r=e.addEventListener(ri.FrameNavigated,this.frameNavigated,this),s=e.addEventListener(ri.ResourceAdded,this.resourceAdded,this);this.#Vt.set(e,[t,n,r,s]),this.#Gt.set(e.target().id(),new Set)}modelRemoved(t){const n=this.#Vt.get(t);n&&e.EventTarget.removeEventListeners(n);const r=this.#Gt.get(t.target().id());if(r)for(const e of r)this.decreaseOrRemoveFrame(e);this.#Gt.delete(t.target().id())}frameAdded(e){const t=e.data,n=this.#Wt.get(t.id);if(n)t.setCreationStackTrace(n.frame.getCreationStackTraceData()),this.#Wt.set(t.id,{frame:t,count:n.count+1});else{const e=this.#Qt.get(t.id);e?.creationStackTrace&&e?.creationStackTraceTarget&&t.setCreationStackTrace({creationStackTrace:e.creationStackTrace,creationStackTraceTarget:e.creationStackTraceTarget}),this.#Wt.set(t.id,{frame:t,count:1}),this.#Qt.delete(t.id)}this.resetOutermostFrame();const r=this.#Gt.get(t.resourceTreeModel().target().id());r&&r.add(t.id),this.dispatchEventToListeners("FrameAddedToTarget",{frame:t}),this.resolveAwaitedFrame(t)}frameDetached(e){const{frame:t,isSwap:n}=e.data;if(this.decreaseOrRemoveFrame(t.id),n&&!this.#Wt.get(t.id)){const e=t.getCreationStackTraceData(),n={...e.creationStackTrace&&{creationStackTrace:e.creationStackTrace},...e.creationStackTrace&&{creationStackTraceTarget:e.creationStackTraceTarget}};this.#Qt.set(t.id,n)}const r=this.#Gt.get(t.resourceTreeModel().target().id());r&&r.delete(t.id)}frameNavigated(e){const t=e.data;this.dispatchEventToListeners("FrameNavigated",{frame:t}),t.isOutermostFrame()&&this.dispatchEventToListeners("OutermostFrameNavigated",{frame:t})}resourceAdded(e){this.dispatchEventToListeners("ResourceAdded",{resource:e.data})}decreaseOrRemoveFrame(e){const t=this.#Wt.get(e);t&&(1===t.count?(this.#Wt.delete(e),this.resetOutermostFrame(),this.dispatchEventToListeners("FrameRemoved",{frameId:e})):t.count--)}resetOutermostFrame(){const e=this.getAllFrames().filter((e=>e.isOutermostFrame()));this.#Kt=e.length>0?e[0]:null}getFrame(e){const t=this.#Wt.get(e);return t?t.frame:null}getAllFrames(){return Array.from(this.#Wt.values(),(e=>e.frame))}getOutermostFrame(){return this.#Kt}async getOrWaitForFrame(e,t){const n=this.getFrame(e);return!n||t&&t===n.resourceTreeModel().target()?await new Promise((n=>{const r=this.#$t.get(e);r?r.push({notInTarget:t,resolve:n}):this.#$t.set(e,[{notInTarget:t,resolve:n}])})):n}resolveAwaitedFrame(e){const t=this.#$t.get(e.id);if(!t)return;const n=t.filter((({notInTarget:t,resolve:n})=>!(!t||t!==e.resourceTreeModel().target())||(n(e),!1)));n.length>0?this.#$t.set(e.id,n):this.#$t.delete(e.id)}}var Fn=Object.freeze({__proto__:null,FrameManager:Nn});class Bn{static fromLocalObject(e){return new zn(e)}static type(e){if(null===e)return"null";const t=typeof e;return"object"!==t&&"function"!==t?t:e.type}static isNullOrUndefined(e){if(void 0===e)return!0;switch(e.type){case"object":return"null"===e.subtype;case"undefined":return!0;default:return!1}}static arrayNameFromDescription(e){return e.replace(Gn,"").replace(Kn,"")}static arrayLength(e){if("array"!==e.subtype&&"typedarray"!==e.subtype)return 0;const t=e.description?.match(Gn),n=e.description?.match(Kn);return t?parseInt(t[1],10):n?parseInt(n[1],10):0}static arrayBufferByteLength(e){if("arraybuffer"!==e.subtype)return 0;const t=e.description?.match(Gn);return t?parseInt(t[1],10):0}static unserializableDescription(e){if("number"==typeof e){const t=String(e);if(0===e&&1/e<0)return"-0";if("NaN"===t||"Infinity"===t||"-Infinity"===t)return t}return"bigint"==typeof e?e+"n":null}static toCallArgument(e){const t=typeof e;if("undefined"===t)return{};const n=Bn.unserializableDescription(e);if("number"===t)return null!==n?{unserializableValue:n}:{value:e};if("bigint"===t)return{unserializableValue:n};if("string"===t||"boolean"===t)return{value:e};if(!e)return{value:null};const r=e;if(e instanceof Bn){const t=e.unserializableValue();if(void 0!==t)return{unserializableValue:t}}else if(void 0!==r.unserializableValue)return{unserializableValue:r.unserializableValue};return void 0!==r.objectId?{objectId:r.objectId}:{value:r.value}}static async loadFromObjectPerProto(e,t,n=!1){const r=await Promise.all([e.getAllProperties(!0,t,n),e.getOwnProperties(t,n)]),s=r[0].properties,i=r[1].properties,o=r[1].internalProperties;if(!i||!s)return{properties:null,internalProperties:null};const a=new Map,l=[];for(let e=0;e<s.length;e++){const t=s[e];t.symbol?l.push(t):(t.isOwn||"__proto__"!==t.name)&&a.set(t.name,t)}for(let e=0;e<i.length;e++){const t=i[e];t.isAccessorProperty()||(t.private||t.symbol?l.push(t):a.set(t.name,t))}return{properties:[...a.values()].concat(l),internalProperties:o||null}}customPreview(){return null}unserializableValue(){throw new Error("Not implemented")}get preview(){}get className(){return null}callFunction(e,t){throw new Error("Not implemented")}callFunctionJSON(e,t){throw new Error("Not implemented")}arrayBufferByteLength(){throw new Error("Not implemented")}deleteProperty(e){throw new Error("Not implemented")}setPropertyValue(e,t){throw new Error("Not implemented")}release(){}debuggerModel(){throw new Error("DebuggerModel-less object")}runtimeModel(){throw new Error("RuntimeModel-less object")}isNode(){return!1}isLinearMemoryInspectable(){return!1}webIdl}class _n extends Bn{runtimeModelInternal;#Xt;#g;#Jt;#Yt;#Zt;hasChildrenInternal;#en;#tn;#u;#nn;#rn;constructor(e,t,n,r,s,i,o,a,l,d){super(),this.runtimeModelInternal=e,this.#Xt=e.target().runtimeAgent(),this.#g=n,this.#Jt=r,t?(this.#Yt=t,this.#Zt=o,this.hasChildrenInternal="symbol"!==n,this.#en=a):(this.#Zt=o,!this.description&&i&&(this.#Zt=i),this.#Zt||"object"==typeof s&&null!==s||(this.#Zt=String(s)),this.hasChildrenInternal=!1,"string"==typeof i?(this.#tn=i,"Infinity"===i||"-Infinity"===i||"-0"===i||"NaN"===i?this.#u=Number(i):"bigint"===n&&i.endsWith("n")?this.#u=BigInt(i.substring(0,i.length-1)):this.#u=i):this.#u=s),this.#nn=l||null,this.#rn="string"==typeof d?d:null}customPreview(){return this.#nn}get objectId(){return this.#Yt}get type(){return this.#g}get subtype(){return this.#Jt}get value(){return this.#u}unserializableValue(){return this.#tn}get description(){return this.#Zt}set description(e){this.#Zt=e}get hasChildren(){return this.hasChildrenInternal}get preview(){return this.#en}get className(){return this.#rn}getOwnProperties(e,t=!1){return this.doGetProperties(!0,!1,t,e)}getAllProperties(e,t,n=!1){return this.doGetProperties(!1,e,n,t)}async createRemoteObject(e){return this.runtimeModelInternal.createRemoteObject(e)}async doGetProperties(e,t,n,r){if(!this.#Yt)return{properties:null,internalProperties:null};const s=await this.#Xt.invoke_getProperties({objectId:this.#Yt,ownProperties:e,accessorPropertiesOnly:t,nonIndexedPropertiesOnly:n,generatePreview:r});if(s.getError())return{properties:null,internalProperties:null};if(s.exceptionDetails)return this.runtimeModelInternal.exceptionThrown(Date.now(),s.exceptionDetails),{properties:null,internalProperties:null};const{result:i=[],internalProperties:o=[],privateProperties:a=[]}=s,l=[];for(const e of i){const t=e.value?await this.createRemoteObject(e.value):null,n=e.symbol?this.runtimeModelInternal.createRemoteObject(e.symbol):null,r=new qn(e.name,t,Boolean(e.enumerable),Boolean(e.writable),Boolean(e.isOwn),Boolean(e.wasThrown),n);void 0===e.value&&(e.get&&"undefined"!==e.get.type&&(r.getter=this.runtimeModelInternal.createRemoteObject(e.get)),e.set&&"undefined"!==e.set.type&&(r.setter=this.runtimeModelInternal.createRemoteObject(e.set))),l.push(r)}for(const e of a){const t=e.value?this.runtimeModelInternal.createRemoteObject(e.value):null,n=new qn(e.name,t,!0,!0,!0,!1,void 0,!1,void 0,!0);void 0===e.value&&(e.get&&"undefined"!==e.get.type&&(n.getter=this.runtimeModelInternal.createRemoteObject(e.get)),e.set&&"undefined"!==e.set.type&&(n.setter=this.runtimeModelInternal.createRemoteObject(e.set))),l.push(n)}const d=[];for(const e of o){if(!e.value)continue;const t=this.runtimeModelInternal.createRemoteObject(e.value);d.push(new qn(e.name,t,!0,!1,void 0,void 0,void 0,!0))}return{properties:l,internalProperties:d}}async setPropertyValue(e,t){if(!this.#Yt)return"Can’t set a property of non-object.";const n=await this.#Xt.invoke_evaluate({expression:t,silent:!0});if(n.getError()||n.exceptionDetails)return n.getError()||("string"!==n.result.type?n.result.description:n.result.value);"string"==typeof e&&(e=Bn.toCallArgument(e));const r=this.doSetObjectPropertyValue(n.result,e);return n.result.objectId&&this.#Xt.invoke_releaseObject({objectId:n.result.objectId}),await r}async doSetObjectPropertyValue(e,t){const n=[t,Bn.toCallArgument(e)],r=await this.#Xt.invoke_callFunctionOn({objectId:this.#Yt,functionDeclaration:"function(a, b) { this[a] = b; }",arguments:n,silent:!0}),s=r.getError();return s||r.exceptionDetails?s||r.result.description:void 0}async deleteProperty(e){if(!this.#Yt)return"Can’t delete a property of non-object.";const t=await this.#Xt.invoke_callFunctionOn({objectId:this.#Yt,functionDeclaration:"function(a) { delete this[a]; return !(a in this); }",arguments:[e],silent:!0});return t.getError()||t.exceptionDetails?t.getError()||t.result.description:t.result.value?void 0:"Failed to delete property."}async callFunction(e,t){const n=await this.#Xt.invoke_callFunctionOn({objectId:this.#Yt,functionDeclaration:e.toString(),arguments:t,silent:!0});return n.getError()?{object:null,wasThrown:!1}:{object:this.runtimeModelInternal.createRemoteObject(n.result),wasThrown:Boolean(n.exceptionDetails)}}async callFunctionJSON(e,t){const n=await this.#Xt.invoke_callFunctionOn({objectId:this.#Yt,functionDeclaration:e.toString(),arguments:t,silent:!0,returnByValue:!0});return n.getError()||n.exceptionDetails?null:n.result.value}release(){this.#Yt&&this.#Xt.invoke_releaseObject({objectId:this.#Yt})}arrayLength(){return Bn.arrayLength(this)}arrayBufferByteLength(){return Bn.arrayBufferByteLength(this)}debuggerModel(){return this.runtimeModelInternal.debuggerModel()}runtimeModel(){return this.runtimeModelInternal}isNode(){return Boolean(this.#Yt)&&"object"===this.type&&"node"===this.subtype}isLinearMemoryInspectable(){return"object"===this.type&&void 0!==this.subtype&&["webassemblymemory","typedarray","dataview","arraybuffer"].includes(this.subtype)}}class Hn extends _n{#sn;#in;constructor(e,t,n,r,s,i,o,a,l){super(e,t,r,s,i,o,a,l),this.#sn=n,this.#in=void 0}async doGetProperties(e,t,n){if(t)return{properties:[],internalProperties:[]};if(this.#in)return{properties:this.#in.slice(),internalProperties:null};const r=await super.doGetProperties(e,t,!1,!0);if(Array.isArray(r.properties)){this.#in=r.properties.slice();for(const e of this.#in)e.writable=!1}return r}async doSetObjectPropertyValue(e,t){const n=t.value,r=await this.debuggerModel().setVariableValue(this.#sn.number,n,Bn.toCallArgument(e),this.#sn.callFrameId);if(r)return r;if(this.#in)for(const t of this.#in)t.name===n&&(t.value=this.runtimeModel().createRemoteObject(e))}}class Un{number;callFrameId;constructor(e,t){this.number=e,this.callFrameId=t}}class qn{name;value;enumerable;writable;isOwn;wasThrown;symbol;synthetic;syntheticSetter;private;getter;setter;webIdl;constructor(e,t,n,r,s,i,o,a,l,d){this.name=e,this.value=null!==t?t:void 0,this.enumerable=void 0===n||n;const c=!a||Boolean(l);this.writable=void 0!==r?r:c,this.isOwn=Boolean(s),this.wasThrown=Boolean(i),o&&(this.symbol=o),this.synthetic=Boolean(a),l&&(this.syntheticSetter=l),this.private=Boolean(d)}async setSyntheticValue(e){if(!this.syntheticSetter)return!1;const t=await this.syntheticSetter(e);return t&&(this.value=t),Boolean(t)}isAccessorProperty(){return Boolean(this.getter||this.setter)}match({includeNullOrUndefinedValues:e,regex:t}){return!(null!==t&&!t.test(this.name)&&!t.test(this.value?.description??""))&&!(!e&&!this.isAccessorProperty()&&Bn.isNullOrUndefined(this.value))}cloneWithNewName(e){const t=new qn(e,this.value??null,this.enumerable,this.writable,this.isOwn,this.wasThrown,this.symbol,this.synthetic,this.syntheticSetter,this.private);return t.getter=this.getter,t.setter=this.setter,t}}class zn extends Bn{valueInternal;#on;#an;constructor(e){super(),this.valueInternal=e}get objectId(){}get value(){return this.valueInternal}unserializableValue(){return Bn.unserializableDescription(this.valueInternal)||void 0}get description(){if(this.#on)return this.#on;if("object"===this.type)switch(this.subtype){case"array":this.#on=this.concatenate("[","]",function(e){return this.formatValue(e.value||null)}.bind(this));break;case"date":this.#on=String(this.valueInternal);break;case"null":this.#on="null";break;default:this.#on=this.concatenate("{","}",function(e){let t=e.name;return/^\s|\s$|^$|\n/.test(t)&&(t='"'+t.replace(/\n/g,"↵")+'"'),t+": "+this.formatValue(e.value||null)}.bind(this))}else this.#on=String(this.valueInternal);return this.#on}formatValue(e){if(!e)return"undefined";const t=e.description||"";return"string"===e.type?'"'+t.replace(/\n/g,"↵")+'"':t}concatenate(e,t,n){let r=e;const s=this.children();for(let e=0;e<s.length;++e){const t=n(s[e]);if(r.length+t.length>100){r+=",…";break}e&&(r+=", "),r+=t}return r+=t,r}get type(){return typeof this.valueInternal}get subtype(){return null===this.valueInternal?"null":Array.isArray(this.valueInternal)?"array":this.valueInternal instanceof Date?"date":void 0}get hasChildren(){return"object"==typeof this.valueInternal&&null!==this.valueInternal&&Boolean(Object.keys(this.valueInternal).length)}async getOwnProperties(e,t=!1){let n=this.children();return t&&(n=n.filter((e=>!function(e){const t=Number(e)>>>0;return String(t)===e}(e.name)))),{properties:n,internalProperties:null}}async getAllProperties(e,t,n=!1){return e?{properties:[],internalProperties:null}:await this.getOwnProperties(t,n)}children(){return this.hasChildren?(this.#an||(this.#an=Object.entries(this.valueInternal).map((([e,t])=>new qn(e,t instanceof Bn?t:Bn.fromLocalObject(t))))),this.#an):[]}arrayLength(){return Array.isArray(this.valueInternal)?this.valueInternal.length:0}async callFunction(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s,i=!1;try{s=e.apply(n,r)}catch{i=!0}return{object:Bn.fromLocalObject(s),wasThrown:i}}async callFunctionJSON(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s;try{s=e.apply(n,r)}catch{s=null}return s}}class jn{#ln;constructor(e){this.#ln=e}static objectAsArray(e){if(!e||"object"!==e.type||"array"!==e.subtype&&"typedarray"!==e.subtype)throw new Error("Object is empty or not an array");return new jn(e)}static async createFromRemoteObjects(e){if(!e.length)throw new Error("Input array is empty");const t=await e[0].callFunction((function(...e){return e}),e.map(Bn.toCallArgument));if(t.wasThrown||!t.object)throw new Error("Call function throws exceptions or returns empty value");return jn.objectAsArray(t.object)}async at(e){if(e<0||e>this.#ln.arrayLength())throw new Error("Out of range");const t=await this.#ln.callFunction((function(e){return this[e]}),[Bn.toCallArgument(e)]);if(t.wasThrown||!t.object)throw new Error("Exception in callFunction or result value is empty");return t.object}length(){return this.#ln.arrayLength()}map(e){const t=[];for(let n=0;n<this.length();++n)t.push(this.at(n).then(e));return Promise.all(t)}object(){return this.#ln}}class Vn{#dn;constructor(e){this.#dn=e}static objectAsFunction(e){if("function"!==e.type)throw new Error("Object is empty or not a function");return new Vn(e)}async targetFunction(){const e=await this.#dn.getOwnProperties(!1),t=e.internalProperties?.find((({name:e})=>"[[TargetFunction]]"===e));return t?.value??this.#dn}async targetFunctionDetails(){const e=await this.targetFunction(),t=await e.debuggerModel().functionDetailsPromise(e);return this.#dn!==e&&e.release(),t}}class Wn{#dn;#cn;#hn;constructor(e){this.#dn=e}static objectAsError(e){if("error"!==e.subtype)throw new Error(`Object of type ${e.subtype} is not an error`);return new Wn(e)}get errorStack(){return this.#dn.description??""}exceptionDetails(){return this.#cn||(this.#cn=this.#un()),this.#cn}#un(){return this.#dn.objectId?this.#dn.runtimeModel().getExceptionDetails(this.#dn.objectId):Promise.resolve(void 0)}cause(){return this.#hn||(this.#hn=this.#gn()),this.#hn}async#gn(){const e=await this.#dn.getAllProperties(!1,!1),t=e.properties?.find((e=>"cause"===e.name));return t?.value}}const Gn=/\(([0-9]+)\)/,Kn=/\[([0-9]+)\]/;var Qn=Object.freeze({__proto__:null,LinearMemoryInspectable:class{object;expression;constructor(e,t){if(!e.isLinearMemoryInspectable())throw new Error("object must be linear memory inspectable");this.object=e,this.expression=t}},LocalJSONObject:zn,RemoteArray:jn,RemoteArrayBuffer:class{#ln;constructor(e){if("object"!==e.type||"arraybuffer"!==e.subtype)throw new Error("Object is not an arraybuffer");this.#ln=e}byteLength(){return this.#ln.arrayBufferByteLength()}async bytes(e=0,t=this.byteLength()){if(e<0||e>=this.byteLength())throw new RangeError("start is out of range");if(t<e||t>this.byteLength())throw new RangeError("end is out of range");return await this.#ln.callFunctionJSON((function(e,t){return[...new Uint8Array(this,e,t)]}),[{value:e},{value:t-e}])}object(){return this.#ln}},RemoteError:Wn,RemoteFunction:Vn,RemoteObject:Bn,RemoteObjectImpl:_n,RemoteObjectProperty:qn,ScopeRef:Un,ScopeRemoteObject:Hn});class $n extends h{constructor(e){super(e)}async read(t,n,r){const s=await this.target().ioAgent().invoke_read({handle:t,offset:r,size:n});if(s.getError())throw new Error(s.getError());return s.eof?null:s.base64Encoded?e.Base64.decode(s.data):s.data}async close(e){(await this.target().ioAgent().invoke_close({handle:e})).getError()&&console.error("Could not close stream.")}async resolveBlob(e){const t=e instanceof Bn?e.objectId:e;if(!t)throw new Error("Remote object has undefined objectId");const n=await this.target().ioAgent().invoke_resolveBlob({objectId:t});if(n.getError())throw new Error(n.getError());return`blob:${n.uuid}`}async readToString(e){const t=[],n=new TextDecoder;for(;;){const r=await this.read(e,4194304);if(null===r){t.push(n.decode());break}r instanceof ArrayBuffer?t.push(n.decode(r,{stream:!0})):t.push(r)}return t.join("")}}h.register($n,{capabilities:131072,autostart:!0});var Xn=Object.freeze({__proto__:null,IOModel:$n});const Jn={loadCanceledDueToReloadOf:"Load canceled due to reload of inspected page"},Yn=n.i18n.registerUIStrings("core/sdk/PageResourceLoader.ts",Jn),Zn=n.i18n.getLocalizedString.bind(void 0,Yn);function er(e){return"extensionId"in e}let tr=null;class nr extends e.ObjectWrapper.ObjectWrapper{#pn=0;#mn=new Map;#fn;#bn=new Map;#yn=[];#vn;constructor(e,t){super(),this.#fn=t,W.instance().addModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.#vn=e}static instance({forceNew:e,loadOverride:t,maxConcurrentLoads:n}={forceNew:!1,loadOverride:null,maxConcurrentLoads:500}){return tr&&!e||(tr=new nr(t,n)),tr}static removeInstance(){tr=null}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(!t.isOutermostFrame())return;for(const{reject:e}of this.#yn)e(new Error(Zn(Jn.loadCanceledDueToReloadOf)));this.#yn=[];const r=t.resourceTreeModel().target(),s=new Map;for(const[e,t]of this.#bn.entries())"Activation"===n&&r===t.initiator.target&&s.set(e,t);this.#bn=s,this.dispatchEventToListeners("Update")}getResourcesLoaded(){return this.#bn}getScopedResourcesLoaded(){return new Map([...this.#bn].filter((([e,t])=>W.instance().isInScope(t.initiator.target)||er(t.initiator))))}getNumberOfResources(){return{loading:this.#pn,queued:this.#yn.length,resources:this.#bn.size}}getScopedNumberOfResources(){const e=W.instance();let t=0;for(const[n,r]of this.#mn){const s=e.targetById(n);e.isInScope(s)&&(t+=r)}return{loading:t,resources:this.getScopedResourcesLoaded().size}}async acquireLoadSlot(e){if(this.#pn++,e){const t=this.#mn.get(e.id())||0;this.#mn.set(e.id(),t+1)}if(this.#pn>this.#fn){const{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.#yn.push({resolve:t,reject:n}),await e}}releaseLoadSlot(e){if(this.#pn--,e){const t=this.#mn.get(e.id());t&&this.#mn.set(e.id(),t-1)}const t=this.#yn.shift();t&&t.resolve()}static makeExtensionKey(e,t){if(er(t)&&t.extensionId)return`${e}-${t.extensionId}`;throw new Error("Invalid initiator")}static makeKey(e,t){if(t.frameId)return`${e}-${t.frameId}`;if(t.target)return`${e}-${t.target.id()}`;throw new Error("Invalid initiator")}resourceLoadedThroughExtension(e){const t=nr.makeExtensionKey(e.url,e.initiator);this.#bn.set(t,e),this.dispatchEventToListeners("Update")}async loadResource(e,t){if(er(t))throw new Error("Invalid initiator");const n=nr.makeKey(e,t),r={success:null,size:null,duration:null,errorMessage:void 0,url:e,initiator:t};this.#bn.set(n,r),this.dispatchEventToListeners("Update");const s=performance.now();try{await this.acquireLoadSlot(t.target);const n=this.dispatchLoad(e,t),s=await n;if(r.errorMessage=s.errorDescription.message,r.success=s.success,s.success)return r.size=s.content.length,{content:s.content};throw new Error(s.errorDescription.message)}catch(e){throw void 0===r.errorMessage&&(r.errorMessage=e.message),null===r.success&&(r.success=!1),e}finally{r.duration=performance.now()-s,this.releaseLoadSlot(t.target),this.dispatchEventToListeners("Update")}}async dispatchLoad(t,n){if(er(n))throw new Error("Invalid initiator");let r=null;if(this.#vn)return await this.#vn(t);const s=new e.ParsedURL.ParsedURL(t),i=rr().get()&&s&&"file"!==s.scheme&&"data"!==s.scheme&&"devtools"!==s.scheme;if(a.userMetrics.developerResourceScheme(this.getDeveloperResourceScheme(s)),i){try{if(n.target){a.userMetrics.developerResourceLoaded(0),a.rnPerfMetrics.developerResourceLoadingStarted(s,0);const e=await this.loadFromTarget(n.target,n.frameId,t);return a.rnPerfMetrics.developerResourceLoadingFinished(s,0,e),e}const e=Nn.instance().getFrame(n.frameId);if(e){a.userMetrics.developerResourceLoaded(1),a.rnPerfMetrics.developerResourceLoadingStarted(s,1);const r=await this.loadFromTarget(e.resourceTreeModel().target(),n.frameId,t);return a.rnPerfMetrics.developerResourceLoadingFinished(s,0,r),r}}catch(e){e instanceof Error&&(a.userMetrics.developerResourceLoaded(2),r=e.message),a.rnPerfMetrics.developerResourceLoadingFinished(s,2,{success:!1,errorDescription:{message:r}})}a.userMetrics.developerResourceLoaded(3),a.rnPerfMetrics.developerResourceLoadingStarted(s,3)}else{const e=rr().get()?6:5;a.userMetrics.developerResourceLoaded(e),a.rnPerfMetrics.developerResourceLoadingStarted(s,e)}const o=await ce.instance().loadResource(t);return i&&!o.success&&a.userMetrics.developerResourceLoaded(7),r&&(o.errorDescription.message=`Fetch through target failed: ${r}; Fallback: ${o.errorDescription.message}`),a.rnPerfMetrics.developerResourceLoadingFinished(s,4,o),o}getDeveloperResourceScheme(e){if(!e||""===e.scheme)return 1;const t="localhost"===e.host||e.host.endsWith(".localhost");switch(e.scheme){case"file":return 7;case"data":return 6;case"blob":return 8;case"http":return t?4:2;case"https":return t?5:3}return 0}async loadFromTarget(t,n,r){const s=t.model(Z),i=t.model($n),o=e.Settings.Settings.instance().moduleSetting("cache-disabled").get(),l=await s.loadNetworkResource(n,r,{disableCache:o,includeCredentials:!0});try{const e=l.stream?await i.readToString(l.stream):"";return{success:l.success,content:e,errorDescription:{statusCode:l.httpStatusCode||0,netError:l.netError,netErrorName:l.netErrorName,message:a.ResourceLoader.netErrorToMessage(l.netError,l.httpStatusCode,l.netErrorName)||"",urlValid:void 0}}}finally{l.stream&&i.close(l.stream)}}}function rr(){return e.Settings.Settings.instance().createSetting("load-through-target",!0)}var sr=Object.freeze({__proto__:null,PageResourceLoader:nr,ResourceKey:class{key;constructor(e){this.key=e}},getLoadThroughTargetSetting:rr});function ir(e,t){return e.line-t.line||e.column-t.column}function or(e,t={line:0,column:0}){if(!e.originalScopes||void 0===e.generatedRanges)throw new Error('Cant decode scopes without "originalScopes" or "generatedRanges"');const n=ar(e.originalScopes,e.names??[]);return{originalScopes:n.map((e=>e.root)),generatedRanges:dr(e.generatedRanges,n,e.names??[],t)}}function ar(e,t){return e.map((e=>function(e,t){const n=new Map,r=[];let s=0,i=0;for(const[o,a]of function*(e){const t=new Er(e);let n=0,r=0;for(;t.hasNext();){","===t.peek()&&t.next();const[e,s]=[t.nextVLQ(),t.nextVLQ()];if(0===e&&s<n)throw new Error("Malformed original scope encoding: start/end items must be ordered w.r.t. source positions");if(n=s,!t.hasNext()||","===t.peek()){yield[r++,{line:e,column:s}];continue}const i={line:e,column:s,flags:t.nextVLQ(),variables:[]};for(1&i.flags&&(i.name=t.nextVLQ()),2&i.flags&&(i.kind=t.nextVLQ());t.hasNext()&&","!==t.peek();)i.variables.push(t.nextVLQ());yield[r++,i]}}(e)){s+=a.line;const{column:e}=a;if(lr(a)){let l;void 0!==a.kind&&(i+=a.kind,l=ur(i,t));const d=ur(a.name,t),c=a.variables.map((e=>t[e])),h={start:{line:s,column:e},end:{line:s,column:e},kind:l,name:d,isStackFrame:Boolean(4&a.flags),variables:c,children:[]};r.push(h),n.set(o,h)}else{const t=r.pop();if(!t)throw new Error('Scope items not nested properly: encountered "end" item without "start" item');if(t.end={line:s,column:e},0===r.length)return{root:t,scopeForItemIndex:n};t.parent=r[r.length-1],r[r.length-1].children.push(t)}}throw new Error("Malformed original scope encoding")}(e,t)))}function lr(e){return"flags"in e}function dr(e,t,n,r={line:0,column:0}){const s=[{start:{line:0,column:0},end:{line:0,column:0},isStackFrame:!1,isHidden:!1,children:[],values:[]}],i=new Map;for(const o of function*(e,t){const n=new Er(e);let r=t.line;const s={line:t.line,column:t.column,defSourceIdx:0,defScopeIdx:0,callsiteSourceIdx:0,callsiteLine:0,callsiteColumn:0};for(;n.hasNext();){if(";"===n.peek()){n.next(),++r;continue}if(","===n.peek()){n.next();continue}if(s.column=n.nextVLQ()+(r===s.line?s.column:0),s.line=r,null===n.peekVLQ()){yield{line:r,column:s.column};continue}const e={line:r,column:s.column,flags:n.nextVLQ(),bindings:[]};if(1&e.flags){const t=n.nextVLQ(),r=n.nextVLQ();s.defScopeIdx=r+(0===t?s.defScopeIdx:0),s.defSourceIdx+=t,e.definition={sourceIdx:s.defSourceIdx,scopeIdx:s.defScopeIdx}}if(2&e.flags){const t=n.nextVLQ(),r=n.nextVLQ(),i=n.nextVLQ();s.callsiteColumn=i+(0===r&&0===t?s.callsiteColumn:0),s.callsiteLine=r+(0===t?s.callsiteLine:0),s.callsiteSourceIdx+=t,e.callsite={sourceIdx:s.callsiteSourceIdx,line:s.callsiteLine,column:s.callsiteColumn}}for(;n.hasNext()&&";"!==n.peek()&&","!==n.peek();){const t=[];e.bindings.push(t);const r=n.nextVLQ();if(r>=-1){t.push({line:e.line,column:e.column,nameIdx:r});continue}t.push({line:e.line,column:e.column,nameIdx:n.nextVLQ()});const s=-r;for(let e=0;e<s-1;++e){const e=n.nextVLQ(),r=n.nextVLQ(),s=n.nextVLQ(),i=t.at(-1)?.line??0,o=t.at(-1)?.column??0;t.push({line:e+i,column:r+(0===e?o:0),nameIdx:s})}}yield e}}(e,r))if(hr(o)){const e={start:{line:o.line,column:o.column},end:{line:o.line,column:o.column},isStackFrame:Boolean(4&o.flags),isHidden:Boolean(8&o.flags),values:[],children:[]};if(o.definition){const{scopeIdx:n,sourceIdx:r}=o.definition;if(!t[r])throw new Error("Invalid source index!");const s=t[r].scopeForItemIndex.get(n);if(!s)throw new Error("Invalid original scope index!");e.originalScope=s}if(o.callsite){const{sourceIdx:n,line:r,column:s}=o.callsite;if(!t[n])throw new Error("Invalid source index!");e.callsite={sourceIndex:n,line:r,column:s}}i.set(e,o),s.push(e)}else{const e=s.pop();if(!e)throw new Error('Range items not nested properly: encountered "end" item without "start" item');e.end={line:o.line,column:o.column},cr(e,n,i.get(e)?.bindings),s[s.length-1].children.push(e)}if(1!==s.length)throw new Error("Malformed generated range encoding");return s[0].children}function cr(e,t,n){void 0!==n&&(e.values=n.map((n=>{if(1===n.length)return ur(n[0].nameIdx,t);const r=n.map((e=>({from:{line:e.line,column:e.column},to:{line:e.line,column:e.column},value:ur(e.nameIdx,t)})));for(let e=1;e<r.length;++e)r[e-1].to={...r[e].from};return r[r.length-1].to={...e.end},r})))}function hr(e){return"flags"in e}function ur(e,t){if(!(void 0===e||e<0))return t[e]}var gr=Object.freeze({__proto__:null,comparePositions:ir,decodeGeneratedRanges:dr,decodeOriginalScopes:ar,decodeScopes:or});function pr(e){!function(e){for(const t of e)if(ir(t.start,t.end)>=0)throw new Error(`Invalid range. End before start: ${JSON.stringify(t)}`)}(e),e.sort(((e,t)=>ir(e.start,t.start)||ir(t.end,e.end)));const t={start:{line:0,column:0},end:{line:Number.POSITIVE_INFINITY,column:Number.POSITIVE_INFINITY},kind:"Global",isStackFrame:!1,children:[],variables:[]},n=[t];for(const t of e){let e=n.at(-1);for(;ir(e.end,t.start)<=0;)n.pop(),e=n.at(-1);if(ir(t.start,e.end)<0&&ir(e.end,t.end)<0)throw new Error(`Range ${JSON.stringify(t)} and ${JSON.stringify(e)} partially overlap.`);const r=mr(t);e.children.push(r),n.push(r)}const r=t.children.at(-1);return r&&(t.end=r.end),t}function mr(e){return{...e,kind:"Function",isStackFrame:!0,children:[],variables:[]}}function fr(e,t){const n=[];let r=0,s=0,i=0,o=0,a=0;const l=new Er(e);let d=!0;for(;l.hasNext();){if(d)d=!1;else{if(","!==l.peek())break;l.next()}r+=l.nextVLQ(),s=o+l.nextVLQ(),i+=l.nextVLQ(),o=s+l.nextVLQ(),a+=l.nextVLQ();const e=t[r];void 0!==e&&n.push({start:{line:s,column:i},end:{line:o,column:a},name:e})}return n}var br=Object.freeze({__proto__:null,buildOriginalScopes:pr,decodePastaRanges:fr});const yr={local:"Local",closure:"Closure",block:"Block",global:"Global",returnValue:"Return value"},vr=n.i18n.registerUIStrings("core/sdk/SourceMapScopeChainEntry.ts",yr),Ir=n.i18n.getLocalizedString.bind(void 0,vr);class wr{#In;#wn;#Pe;#Sn;#kn;constructor(e,t,n,r,s){this.#In=e,this.#wn=t,this.#Pe=n,this.#Sn=r,this.#kn=s}extraProperties(){return this.#kn?[new qn(Ir(yr.returnValue),this.#kn,void 0,void 0,void 0,void 0,void 0,!0)]:[]}callFrame(){return this.#In}type(){switch(this.#wn.kind){case"global":return"global";case"function":return this.#Sn?"local":"closure";case"block":return"block"}return this.#wn.kind??""}typeName(){switch(this.#wn.kind){case"global":return Ir(yr.global);case"function":return this.#Sn?Ir(yr.local):Ir(yr.closure);case"block":return Ir(yr.block)}return this.#wn.kind??""}name(){return this.#wn.name}range(){return null}object(){return new Sr(this.#In,this.#wn,this.#Pe)}description(){return""}icon(){}}class Sr extends _n{#In;#wn;#Pe;constructor(e,t,n){super(e.debuggerModel.runtimeModel(),void 0,"object",void 0,null),this.#In=e,this.#wn=t,this.#Pe=n}async doGetProperties(e,t,n){if(t)return{properties:[],internalProperties:[]};const r=[];for(const[e,t]of this.#wn.variables.entries()){const s=this.#Cn(e);if(null===s){r.push(Sr.#xn(t));continue}const i=await this.#In.evaluate({expression:s,generatePreview:n});"error"in i||i.exceptionDetails?r.push(Sr.#xn(t)):r.push(new qn(t,i.object,!1,!1,!0,!1))}return{properties:r,internalProperties:[]}}#Cn(e){if(!this.#Pe)return null;const t=this.#Pe.values[e];if("string"==typeof t)return t;if(void 0===t)return null;const n=this.#In.location();for(const e of t)if(xr({start:e.from,end:e.to},n.lineNumber,n.columnNumber))return e.value??null;return null}static#xn(e){return new qn(e,null,!1,!1,!0,!1)}}var kr=Object.freeze({__proto__:null,SourceMapScopeChainEntry:wr});class Cr{#Rn;#Tn;#Mn;#Pn=null;constructor(e,t,n){this.#Rn=e,this.#Tn=t,this.#Mn=n}addOriginalScopes(e){for(const t of e)this.#Tn.push(t)}addGeneratedRanges(e){for(const t of e)this.#Mn.push(t)}hasOriginalScopes(e){return Boolean(this.#Tn[e])}addOriginalScopesAtIndex(e,t){if(this.#Tn[e])throw new Error(`Trying to re-augment existing scopes for source at index: ${e}`);this.#Tn[e]=t}findInlinedFunctions(e,t){const n=this.#En(e,t),r={inlinedFunctions:[],originalFunctionName:""};for(let e=n.length-1;e>=0;--e){const t=n[e];if(t.callsite&&r.inlinedFunctions.push({name:t.originalScope?.name??"",callsite:t.callsite}),t.isStackFrame){r.originalFunctionName=t.originalScope?.name??"";break}}return r}expandCallFrame(e){const{originalFunctionName:t,inlinedFunctions:n}=this.findInlinedFunctions(e.location().lineNumber,e.location().columnNumber),r=[];for(const[t,s]of n.entries())r.push(e.createVirtualCallFrame(t,s.name));return r.push(e.createVirtualCallFrame(r.length,t)),r}#En(e,t){const n=[];return function r(s){for(const i of s)xr(i,e,t)&&(n.push(i),r(i.children))}(this.#Mn),n}hasVariablesAndBindings(){return null===this.#Pn&&(this.#Pn=this.#Ln()),this.#Pn}#Ln(){function e(t){for(const n of t)if(n){if("variables"in n&&n.variables.length>0)return!0;if("values"in n&&n.values.some((e=>void 0!==e)))return!0;if(e(n.children))return!0}return!1}return e(this.#Tn)&&e(this.#Mn)}resolveMappedScopeChain(e){const t=this.#An(e),n=t.at(-1)?.originalScope;if(void 0===n)return null;let r=!1;const s=[];for(let n=t.at(-1)?.originalScope;n;n=n.parent){const i=t.findLast((e=>e.originalScope===n)),o="function"===n.kind,a=o&&!r,l=a?e.returnValue():null;s.push(new wr(e,n,i,a,l??void 0)),r||=o}if(null!==e.returnValue())for(;s.length&&"local"!==s[0].type();)s.shift();return s}#An(e){const t=this.#En(e.location().lineNumber,e.location().columnNumber);if(0===e.inlineFrameIndex)return t;for(let n=0;n<e.inlineFrameIndex;){const e=t.pop();e?.callsite&&++n}return t}findOriginalFunctionName({line:e,column:t}){let n;if(this.#Mn.length>0){const r=this.#En(e,t);n=r.at(-1)?.originalScope}else{const r=this.#Rn.findEntry(e,t);if(void 0===r?.sourceIndex)return null;n=this.#On({sourceIndex:r.sourceIndex,line:r.sourceLineNumber,column:r.sourceColumnNumber}).at(-1)}for(let e=n;e;e=e.parent)if(e.isStackFrame)return e.name??"";return null}#On({sourceIndex:e,line:t,column:n}){const r=this.#Tn[e];if(!r)return[];const s=[];return function e(r){for(const i of r)xr(i,t,n)&&(s.push(i),e(i.children))}([r]),s}}function xr(e,t,n){return!(e.start.line>t||e.start.line===t&&e.start.column>n)&&!(e.end.line<t||e.end.line===t&&e.end.column<=n)}var Rr=Object.freeze({__proto__:null,SourceMapScopesInfo:Cr,contains:xr});function Tr(e){return e.startsWith(")]}")&&(e=e.substring(e.indexOf("\n"))),65279===e.charCodeAt(0)&&(e=e.slice(1)),JSON.parse(e)}class Mr{lineNumber;columnNumber;sourceIndex;sourceURL;sourceLineNumber;sourceColumnNumber;name;constructor(e,t,n,r,s,i,o){this.lineNumber=e,this.columnNumber=t,this.sourceIndex=n,this.sourceURL=r,this.sourceLineNumber=s,this.sourceColumnNumber=i,this.name=o}static compare(e,t){return e.lineNumber!==t.lineNumber?e.lineNumber-t.lineNumber:e.columnNumber-t.columnNumber}}class Pr{static retainRawSourceMaps=!1;#Dn;#Nn;#Fn;#Bn;#_n;#Hn=[];#Un=new Map;#qn=null;constructor(t,n,r){this.#Dn=r,this.#Nn=t,this.#Fn=n,this.#Bn=e.ParsedURL.schemeIs(n,"data:")?t:n,this.#_n=null,"sections"in this.#Dn&&this.#Dn.sections.find((e=>"url"in e))&&e.Console.Console.instance().warn(`SourceMap "${n}" contains unsupported "URL" field in one of its sections.`),this.eachSection(this.parseSources.bind(this))}json(){return this.#Dn}augmentWithScopes(e,t){if(this.#zn(),this.#Dn&&this.#Dn.version>3)throw new Error("Only support augmenting source maps up to version 3.");const n=this.#jn(e);if(!(n>=0))throw new Error(`Could not find sourceURL ${e} in sourceMap`);if(this.#qn||(this.#qn=new Cr(this,[],[])),!this.#qn.hasOriginalScopes(n)){const e=pr(t);this.#qn.addOriginalScopesAtIndex(n,e)}}#jn(e){return this.#Hn.findIndex((t=>t.sourceURL===e))}compiledURL(){return this.#Nn}url(){return this.#Fn}sourceURLs(){return[...this.#Un.keys()]}embeddedContentByURL(e){const t=this.#Un.get(e);return t?t.content:null}hasScopeInfo(){return this.#zn(),null!==this.#qn}findEntry(e,t,n){if(this.#zn(),n&&null!==this.#qn){const{inlinedFunctions:r}=this.#qn.findInlinedFunctions(e,t),{callsite:s}=r[n-1];return s?{lineNumber:e,columnNumber:t,sourceIndex:s.sourceIndex,sourceURL:this.sourceURLs()[s.sourceIndex],sourceLineNumber:s.line,sourceColumnNumber:s.column,name:void 0}:(console.error("Malformed source map. Expected to have a callsite info for index",n),null)}const s=this.mappings(),i=r.ArrayUtilities.upperBound(s,void 0,((n,r)=>e-r.lineNumber||t-r.columnNumber));return i?s[i-1]:null}findEntryRanges(e,n){const s=this.mappings(),i=r.ArrayUtilities.upperBound(s,void 0,((t,r)=>e-r.lineNumber||n-r.columnNumber));if(!i)return null;const o=i-1,a=s[o].sourceURL;if(!a)return null;const l=i<s.length?s[i].lineNumber:2**31-1,d=i<s.length?s[i].columnNumber:2**31-1,c=new t.TextRange.TextRange(s[o].lineNumber,s[o].columnNumber,l,d),h=this.reversedMappings(a),u=s[o].sourceLineNumber,g=s[o].sourceColumnNumber,p=r.ArrayUtilities.upperBound(h,void 0,((e,t)=>u-s[t].sourceLineNumber||g-s[t].sourceColumnNumber));if(!p)return null;const m=p<h.length?s[h[p]].sourceLineNumber:2**31-1,f=p<h.length?s[h[p]].sourceColumnNumber:2**31-1;return{range:c,sourceRange:new t.TextRange.TextRange(u,g,m,f),sourceURL:a}}sourceLineMapping(e,t,n){const s=this.mappings(),i=this.reversedMappings(e),o=r.ArrayUtilities.lowerBound(i,t,c),a=r.ArrayUtilities.upperBound(i,t,c);if(o>=i.length||s[i[o]].sourceLineNumber!==t)return null;const l=i.slice(o,a);if(!l.length)return null;const d=r.ArrayUtilities.lowerBound(l,n,((e,t)=>e-s[t].sourceColumnNumber));return d>=l.length?s[l[l.length-1]]:s[l[d]];function c(e,t){return e-s[t].sourceLineNumber}}findReverseIndices(e,t,n){const s=this.mappings(),i=this.reversedMappings(e),o=r.ArrayUtilities.upperBound(i,void 0,((e,r)=>t-s[r].sourceLineNumber||n-s[r].sourceColumnNumber));let a=o;for(;a>0&&s[i[a-1]].sourceLineNumber===s[i[o-1]].sourceLineNumber&&s[i[a-1]].sourceColumnNumber===s[i[o-1]].sourceColumnNumber;)--a;return i.slice(a,o)}findReverseEntries(e,t,n){const r=this.mappings();return this.findReverseIndices(e,t,n).map((e=>r[e]))}findReverseRanges(e,n,r){const s=this.mappings(),i=this.findReverseIndices(e,n,r),o=[];for(let e=0;e<i.length;++e){const n=i[e];let r=n+1;for(;e+1<i.length&&r===i[e+1];)++r,++e;const a=s[n].lineNumber,l=s[n].columnNumber,d=r<s.length?s[r].lineNumber:2**31-1,c=r<s.length?s[r].columnNumber:2**31-1;o.push(new t.TextRange.TextRange(a,l,d,c))}return o}mappings(){return this.#zn(),this.#_n??[]}reversedMappings(e){return this.#zn(),this.#Un.get(e)?.reverseMappings??[]}#zn(){if(null===this.#_n){this.#_n=[];try{this.eachSection(this.parseMap.bind(this))}catch(e){console.error("Failed to parse source map",e),this.#_n=[]}this.mappings().sort(Mr.compare),this.#Vn(this.#_n)}Pr.retainRawSourceMaps||(this.#Dn=null)}#Vn(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n].sourceURL;if(!r)continue;let s=t.get(r);s||(s=[],t.set(r,s)),s.push(n)}for(const[e,r]of t.entries()){const t=this.#Un.get(e);t&&(r.sort(n),t.reverseMappings=r)}function n(t,n){const r=e[t],s=e[n];return r.sourceLineNumber-s.sourceLineNumber||r.sourceColumnNumber-s.sourceColumnNumber||r.lineNumber-s.lineNumber||r.columnNumber-s.columnNumber}}eachSection(e){if(this.#Dn)if("sections"in this.#Dn){let t=0;for(const n of this.#Dn.sections)"map"in n&&(e(n.map,t,n.offset.line,n.offset.column),t+=n.map.sources.length)}else e(this.#Dn,0,0,0)}parseSources(t){const n=t.sourceRoot??"",r=new Set(t.ignoreList??t.x_google_ignoreList);for(let s=0;s<t.sources.length;++s){let i=t.sources[s];e.ParsedURL.ParsedURL.isRelativeURL(i)&&(i=n&&!n.endsWith("/")&&i&&!i.startsWith("/")?n.concat("/",i):n.concat(i));const o=e.ParsedURL.ParsedURL.completeURL(this.#Bn,i)||i,a=t.sourcesContent?.[s],l={sourceURL:o,content:a??null,ignoreListHint:r.has(s),reverseMappings:null};this.#Hn.push(l),this.#Un.has(o)||this.#Un.set(o,l)}}parseMap(e,t,n,r){let s=t,i=n,a=r,l=0,d=0,c=0;const h=e.names??[],u=new Er(e.mappings);let g=this.#Hn[s]?.sourceURL;for(;;){if(","===u.peek())u.next();else{for(;";"===u.peek();)i+=1,a=0,u.next();if(!u.hasNext())break}if(a+=u.nextVLQ(),!u.hasNext()||this.isSeparator(u.peek())){this.mappings().push(new Mr(i,a));continue}const e=u.nextVLQ();e&&(s+=e,g=this.#Hn[s]?.sourceURL),l+=u.nextVLQ(),d+=u.nextVLQ(),u.hasNext()&&!this.isSeparator(u.peek())?(c+=u.nextVLQ(),this.mappings().push(new Mr(i,a,s,g,l,d,h[c]))):this.mappings().push(new Mr(i,a,s,g,l,d))}if(o.Runtime.experiments.isEnabled("use-source-map-scopes"))if(this.#qn||(this.#qn=new Cr(this,[],[])),e.originalScopes&&e.generatedRanges){const{originalScopes:t,generatedRanges:s}=or(e,{line:n,column:r});this.#qn.addOriginalScopes(t),this.#qn.addGeneratedRanges(s)}else if(e.x_com_bloomberg_sourcesFunctionMappings){const t=this.parseBloombergScopes(e);this.#qn.addOriginalScopes(t)}else this.#qn.addOriginalScopes(new Array(e.sources.length))}parseBloombergScopes(e){const t=e.x_com_bloomberg_sourcesFunctionMappings;if(!t)throw new Error("Cant decode pasta scopes without x_com_bloomberg_sourcesFunctionMappings field");if(t.length!==e.sources.length)throw new Error(`x_com_bloomberg_sourcesFunctionMappings must have ${e.sources.length} scope trees`);const n=e.names??[];return t.map((e=>{if(!e)return;return pr(fr(e,n))}))}isSeparator(e){return","===e||";"===e}reverseMapTextRanges(e,n){const s=this.reversedMappings(e),i=this.mappings();if(0===s.length)return[];let o=r.ArrayUtilities.lowerBound(s,n,(({startLine:e,startColumn:t},n)=>{const{sourceLineNumber:r,sourceColumnNumber:s}=i[n];return e-r||t-s}));for(;o===s.length||o>0&&(i[s[o]].sourceLineNumber>n.startLine||i[s[o]].sourceColumnNumber>n.startColumn);)o--;let a=o+1;for(;a<s.length;++a){const{sourceLineNumber:e,sourceColumnNumber:t}=i[s[a]];if(!(e<n.endLine||e===n.endLine&&t<n.endColumn))break}const l=[];for(let e=o;e<a;++e){const n=s[e],r=n+1,o=t.TextRange.TextRange.createUnboundedFromLocation(i[n].lineNumber,i[n].columnNumber);r<i.length&&(o.endLine=i[r].lineNumber,o.endColumn=i[r].columnNumber),l.push(o)}l.sort(t.TextRange.TextRange.comparator);let d=0;for(let e=1;e<l.length;++e)l[d].immediatelyPrecedes(l[e])?(l[d].endLine=l[e].endLine,l[d].endColumn=l[e].endColumn):l[++d]=l[e];return l.length=d+1,l}mapsOrigin(){const e=this.mappings();if(e.length>0){const t=e[0];return 0===t?.lineNumber||0===t.columnNumber}return!1}hasIgnoreListHint(e){return this.#Un.get(e)?.ignoreListHint??!1}findRanges(e,n){const r=this.mappings(),s=[];if(!r.length)return[];let i=null;0===r[0].lineNumber&&0===r[0].columnNumber||!n?.isStartMatching||(i=t.TextRange.TextRange.createUnboundedFromLocation(0,0),s.push(i));for(const{sourceURL:n,lineNumber:o,columnNumber:a}of r){const r=n&&e(n);i||!r?i&&!r&&(i.endLine=o,i.endColumn=a,i=null):(i=t.TextRange.TextRange.createUnboundedFromLocation(o,a),s.push(i))}return s}compatibleForURL(e,t){return this.embeddedContentByURL(e)===t.embeddedContentByURL(e)&&this.hasIgnoreListHint(e)===t.hasIgnoreListHint(e)}expandCallFrame(e){return this.#zn(),null===this.#qn?[e]:this.#qn.expandCallFrame(e)}resolveScopeChain(e){return this.#zn(),null===this.#qn?null:this.#qn.resolveMappedScopeChain(e)}findOriginalFunctionName(e){return this.#zn(),this.#qn?.findOriginalFunctionName(e)??null}}class Er{#Wn;#Gn;constructor(e){this.#Wn=e,this.#Gn=0}next(){return this.#Wn.charAt(this.#Gn++)}nextCharCode(){return this.#Wn.charCodeAt(this.#Gn++)}peek(){return this.#Wn.charAt(this.#Gn)}hasNext(){return this.#Gn<this.#Wn.length}nextVLQ(){let t=0,n=0,r=32;for(;32&r;){if(!this.hasNext())throw new Error("Unexpected end of input while decodling VLQ number!");const s=this.nextCharCode();if(r=e.Base64.BASE64_CODES[s],65!==s&&0===r)throw new Error(`Unexpected char '${String.fromCharCode(s)}' encountered while decoding`);t+=(31&r)<<n,n+=5}const s=1&t;return t>>=1,s?-t:t}peekVLQ(){const e=this.#Gn;try{return this.nextVLQ()}catch{return null}finally{this.#Gn=e}}}var Lr,Ar=Object.freeze({__proto__:null,SourceMap:Pr,SourceMapEntry:Mr,TokenIterator:Er,parseSourceMap:Tr});class Or extends e.ObjectWrapper.ObjectWrapper{#Kn;#Qn=!0;#$n=new Map;#Xn=new Map;#Jn=null;constructor(e){super(),this.#Kn=e}setEnabled(e){if(e===this.#Qn)return;const t=[...this.#$n.entries()];for(const[e]of t)this.detachSourceMap(e);this.#Qn=e;for(const[e,{relativeSourceURL:n,relativeSourceMapURL:r}]of t)this.attachSourceMap(e,n,r)}static getBaseUrl(e){for(;e&&e.type()!==U.FRAME;)e=e.parentTarget();return e?.inspectedURL()??r.DevToolsPath.EmptyUrlString}static resolveRelativeSourceURL(t,n){return n=e.ParsedURL.ParsedURL.completeURL(Or.getBaseUrl(t),n)??n}sourceMapForClient(e){return this.#$n.get(e)?.sourceMap}sourceMapForClientPromise(e){const t=this.#$n.get(e);return t?t.sourceMapPromise:Promise.resolve(void 0)}clientForSourceMap(e){return this.#Xn.get(e)}attachSourceMap(t,n,r){if(this.#$n.has(t))throw new Error("SourceMap is already attached or being attached to client");if(!r)return;let s={relativeSourceURL:n,relativeSourceMapURL:r,sourceMap:void 0,sourceMapPromise:Promise.resolve(void 0)};if(this.#Qn){const i=Or.resolveRelativeSourceURL(this.#Kn,n),o=e.ParsedURL.ParsedURL.completeURL(i,r);if(o)if(this.#Jn&&console.error("Attaching source map may cancel previously attaching source map"),this.#Jn=t,this.dispatchEventToListeners(Lr.SourceMapWillAttach,{client:t}),this.#Jn===t){this.#Jn=null;const e=t.createPageResourceLoadInitiator();s.sourceMapPromise=Dr(o,e).then((e=>{const n=new Pr(i,o,e);return this.#$n.get(t)===s&&(s.sourceMap=n,this.#Xn.set(n,t),this.dispatchEventToListeners(Lr.SourceMapAttached,{client:t,sourceMap:n})),n}),(()=>{this.#$n.get(t)===s&&this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:t})}))}else this.#Jn&&console.error("Cancelling source map attach because another source map is attaching"),s=null,this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:t})}s&&this.#$n.set(t,s)}cancelAttachSourceMap(e){e===this.#Jn?this.#Jn=null:this.#Jn?console.error("cancel attach source map requested but a different source map was being attached"):console.error("cancel attach source map requested but no source map was being attached")}detachSourceMap(e){const t=this.#$n.get(e);if(!t)return;if(this.#$n.delete(e),!this.#Qn)return;const{sourceMap:n}=t;n?(this.#Xn.delete(n),this.dispatchEventToListeners(Lr.SourceMapDetached,{client:e,sourceMap:n})):this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:e})}}async function Dr(e,t){try{const{content:n}=await nr.instance().loadResource(e,t);return Tr(n)}catch(t){throw new Error(`Could not load content for ${e}: ${t.message}`,{cause:t})}}!function(e){e.SourceMapWillAttach="SourceMapWillAttach",e.SourceMapFailedToAttach="SourceMapFailedToAttach",e.SourceMapAttached="SourceMapAttached",e.SourceMapDetached="SourceMapDetached"}(Lr||(Lr={}));var Nr,Fr=Object.freeze({__proto__:null,get Events(){return Lr},SourceMapManager:Or,loadSourceMap:Dr,tryLoadSourceMap:async function(e,t){try{const{content:n}=await nr.instance().loadResource(e,t);return Tr(n)}catch(t){return console.error(`Could not load content for ${e}: ${t.message}`,{cause:t}),null}}});class Br extends h{agent;#Yn;#Zn=new Map;#er=new Map;#tr;#nr;#rr;#sr=new e.Throttler.Throttler(Wr);#ir=new Map;#or=new Map;#ar=null;#lr=null;#dr=null;#cr=!1;#Qn=!1;#hr=!1;#ur=!1;#gr;constructor(t){super(t),this.#Yn=t.model(Gs),this.#nr=new Or(t),this.agent=t.cssAgent(),this.#rr=new zr(this),this.#tr=t.model(ii),this.#tr&&this.#tr.addEventListener(ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),t.registerCSSDispatcher(new qr(this)),t.suspended()||this.enable(),this.#nr.setEnabled(e.Settings.Settings.instance().moduleSetting("css-source-maps-enabled").get()),e.Settings.Settings.instance().moduleSetting("css-source-maps-enabled").addChangeListener((e=>this.#nr.setEnabled(e.data)))}async colorScheme(){if(!this.#gr){const e=await(this.domModel()?.target().runtimeAgent().invoke_evaluate({expression:'window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches'}));!e||e.exceptionDetails||e.getError()||(this.#gr=e.result.value?"dark":"light")}return this.#gr}async resolveValues(e,...t){const n=await this.agent.invoke_resolveValues({values:t,nodeId:e});return n.getError()?null:n.results}headersForSourceURL(e){const t=[];for(const n of this.getStyleSheetIdsForURL(e)){const e=this.styleSheetHeaderForId(n);e&&t.push(e)}return t}createRawLocationsByURL(e,t,n=0){const s=this.headersForSourceURL(e);s.sort((function(e,t){return e.startLine-t.startLine||e.startColumn-t.startColumn||e.id.localeCompare(t.id)}));const i=r.ArrayUtilities.upperBound(s,void 0,((e,r)=>t-r.startLine||n-r.startColumn));if(!i)return[];const o=[],a=s[i-1];for(let e=i-1;e>=0&&s[e].startLine===a.startLine&&s[e].startColumn===a.startColumn;--e)s[e].containsLocation(t,n)&&o.push(new Ur(s[e],t,n));return o}sourceMapManager(){return this.#nr}static readableLayerName(e){return e||"<anonymous>"}static trimSourceURL(e){let t=e.lastIndexOf("/*# sourceURL=");if(-1===t&&(t=e.lastIndexOf("/*@ sourceURL="),-1===t))return e;const n=e.lastIndexOf("\n",t);if(-1===n)return e;const r=e.substr(n+1).split("\n",1)[0];return-1===r.search(/[\x20\t]*\/\*[#@] sourceURL=[\x20\t]*([^\s]*)[\x20\t]*\*\/[\x20\t]*$/)?e:e.substr(0,n)+e.substr(n+r.length+1)}domModel(){return this.#Yn}async trackComputedStyleUpdatesForNode(e){await this.agent.invoke_trackComputedStyleUpdatesForNode({nodeId:e})}async setStyleText(e,t,n,r){try{await this.ensureOriginalStyleSheetText(e);const{styles:s}=await this.agent.invoke_setStyleTexts({edits:[{styleSheetId:e,range:t.serializeToObject(),text:n}]});if(!s||1!==s.length)return!1;this.#Yn.markUndoableState(!r);const i=new Hr(e,t,n,s[0]);return this.fireStyleSheetChanged(e,i),!0}catch(e){return console.error(e),!1}}async setSelectorText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{selectorList:r}=await this.agent.invoke_setRuleSelector({styleSheetId:e,range:t,selector:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setPropertyRulePropertyName(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{propertyName:r}=await this.agent.invoke_setPropertyRulePropertyName({styleSheetId:e,range:t,propertyName:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setKeyframeKey(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{keyText:r}=await this.agent.invoke_setKeyframeKey({styleSheetId:e,range:t,keyText:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}startCoverage(){return this.#hr=!0,this.agent.invoke_startRuleUsageTracking()}async takeCoverageDelta(){const e=await this.agent.invoke_takeCoverageDelta();return{timestamp:e?.timestamp||0,coverage:e?.coverage||[]}}setLocalFontsEnabled(e){return this.agent.invoke_setLocalFontsEnabled({enabled:e})}async stopCoverage(){this.#hr=!1,await this.agent.invoke_stopRuleUsageTracking()}async getMediaQueries(){const{medias:e}=await this.agent.invoke_getMediaQueries();return e?$t.parseMediaArrayPayload(this,e):[]}async getRootLayer(e){const{rootLayer:t}=await this.agent.invoke_getLayersForNode({nodeId:e});return t}isEnabled(){return this.#Qn}async enable(){await this.agent.invoke_enable(),this.#Qn=!0,this.#hr&&await this.startCoverage(),this.dispatchEventToListeners(Nr.ModelWasEnabled)}async getAnimatedStylesForNode(e){const t=await this.agent.invoke_getAnimatedStylesForNode({nodeId:e});return t.getError()?null:t}async getMatchedStyles(e){const t=this.#Yn.nodeForId(e);if(!t)return null;const n=o.Runtime.hostConfig.devToolsAnimationStylesInStylesTab?.enabled,[r,s]=await Promise.all([this.agent.invoke_getMatchedStylesForNode({nodeId:e}),n?this.agent.invoke_getAnimatedStylesForNode({nodeId:e}):void 0]);if(r.getError())return null;const i={cssModel:this,node:t,inlinePayload:r.inlineStyle||null,attributesPayload:r.attributesStyle||null,matchedPayload:r.matchedCSSRules||[],pseudoPayload:r.pseudoElements||[],inheritedPayload:r.inherited||[],inheritedPseudoPayload:r.inheritedPseudoElements||[],animationsPayload:r.cssKeyframesRules||[],parentLayoutNodeId:r.parentLayoutNodeId,positionTryRules:r.cssPositionTryRules||[],propertyRules:r.cssPropertyRules??[],functionRules:r.cssFunctionRules??[],cssPropertyRegistrations:r.cssPropertyRegistrations??[],fontPaletteValuesRule:r.cssFontPaletteValuesRule,activePositionFallbackIndex:r.activePositionFallbackIndex??-1,animationStylesPayload:s?.animationStyles||[],inheritedAnimatedPayload:s?.inherited||[],transitionsStylePayload:s?.transitionsStyle||null};return await In.create(i)}async getClassNames(e){const{classNames:t}=await this.agent.invoke_collectClassNames({styleSheetId:e});return t||[]}async getComputedStyle(e){return this.isEnabled()||await this.enable(),await this.#rr.computedStylePromise(e)}async getLayoutPropertiesFromComputedStyle(e){const t=await this.getComputedStyle(e);if(!t)return null;const n=t.get("display"),r="flex"===n||"inline-flex"===n,s="grid"===n||"inline-grid"===n,i=(s&&(t.get("grid-template-columns")?.startsWith("subgrid")||t.get("grid-template-rows")?.startsWith("subgrid")))??!1,o=t.get("container-type");return{isFlex:r,isGrid:s,isSubgrid:i,isContainer:Boolean(o)&&""!==o&&"normal"!==o,hasScroll:Boolean(t.get("scroll-snap-type"))&&"none"!==t.get("scroll-snap-type")}}async getBackgroundColors(e){const t=await this.agent.invoke_getBackgroundColors({nodeId:e});return t.getError()?null:{backgroundColors:t.backgroundColors||null,computedFontSize:t.computedFontSize||"",computedFontWeight:t.computedFontWeight||""}}async getPlatformFonts(e){const{fonts:t}=await this.agent.invoke_getPlatformFontsForNode({nodeId:e});return t}allStyleSheets(){const e=[...this.#or.values()];return e.sort((function(e,t){return e.sourceURL<t.sourceURL?-1:e.sourceURL>t.sourceURL?1:e.startLine-t.startLine||e.startColumn-t.startColumn})),e}async getInlineStyles(e){const t=await this.agent.invoke_getInlineStylesForNode({nodeId:e});if(t.getError()||!t.inlineStyle)return null;const n=new en(this,null,t.inlineStyle,Yt.Inline),r=t.attributesStyle?new en(this,null,t.attributesStyle,Yt.Attributes):null;return new jr(n,r)}forcePseudoState(e,t,n){const s=e.marker(_r)||[],i=s.includes(t);if(n){if(i)return!1;s.push(t),e.setMarker(_r,s)}else{if(!i)return!1;r.ArrayUtilities.removeElement(s,t),s.length?e.setMarker(_r,s):e.setMarker(_r,null)}return void 0!==e.id&&(this.agent.invoke_forcePseudoState({nodeId:e.id,forcedPseudoClasses:s}),this.dispatchEventToListeners(Nr.PseudoStateForced,{node:e,pseudoClass:t,enable:n}),!0)}pseudoState(e){return e.marker(_r)||[]}async setMediaText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{media:r}=await this.agent.invoke_setMediaText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setContainerQueryText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{containerQuery:r}=await this.agent.invoke_setContainerQueryText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setSupportsText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{supports:r}=await this.agent.invoke_setSupportsText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setScopeText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{scope:r}=await this.agent.invoke_setScopeText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#Yn.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async addRule(e,t,n){try{await this.ensureOriginalStyleSheetText(e);const{rule:r}=await this.agent.invoke_addRule({styleSheetId:e,ruleText:t,location:n});if(!r)return null;this.#Yn.markUndoableState();const s=new Hr(e,n,t,r);return this.fireStyleSheetChanged(e,s),new an(this,r)}catch(e){return console.error(e),null}}async requestViaInspectorStylesheet(e){const t=e||(this.#tr&&this.#tr.mainFrame?this.#tr.mainFrame.id:null),n=[...this.#or.values()].find((e=>e.frameId===t&&e.isViaInspector()));if(n)return n;if(!t)return null;try{return await this.createInspectorStylesheet(t)}catch(e){return console.error(e),null}}async createInspectorStylesheet(e,t=!1){const n=await this.agent.invoke_createStyleSheet({frameId:e,force:t});if(n.getError())throw new Error(n.getError());return this.#or.get(n.styleSheetId)||null}mediaQueryResultChanged(){this.#gr=void 0,this.dispatchEventToListeners(Nr.MediaQueryResultChanged)}fontsUpdated(e){e&&this.#Zn.set(e.src,new pe(e)),this.dispatchEventToListeners(Nr.FontsUpdated)}fontFaces(){return[...this.#Zn.values()]}fontFaceForSource(e){return this.#Zn.get(e)}styleSheetHeaderForId(e){return this.#or.get(e)||null}styleSheetHeaders(){return[...this.#or.values()]}fireStyleSheetChanged(e,t){this.dispatchEventToListeners(Nr.StyleSheetChanged,{styleSheetId:e,edit:t})}ensureOriginalStyleSheetText(e){const t=this.styleSheetHeaderForId(e);if(!t)return Promise.resolve(null);let n=this.#er.get(t);return n||(n=this.getStyleSheetText(t.id),this.#er.set(t,n),this.originalContentRequestedForTest(t)),n}originalContentRequestedForTest(e){}originalStyleSheetText(e){return this.ensureOriginalStyleSheetText(e.id)}getAllStyleSheetHeaders(){return this.#or.values()}computedStyleUpdated(e){this.dispatchEventToListeners(Nr.ComputedStyleUpdated,{nodeId:e})}styleSheetAdded(e){console.assert(!this.#or.get(e.styleSheetId)),e.loadingFailed&&(e.hasSourceURL=!1,e.isConstructed=!0,e.isInline=!1,e.isMutable=!1,e.sourceURL="",e.sourceMapURL=void 0);const t=new An(this,e);this.#or.set(e.styleSheetId,t);const n=t.resourceURL();let r=this.#ir.get(n);if(r||(r=new Map,this.#ir.set(n,r)),r){let e=r.get(t.frameId);e||(e=new Set,r.set(t.frameId,e)),e.add(t.id)}this.#nr.attachSourceMap(t,t.sourceURL,t.sourceMapURL),this.dispatchEventToListeners(Nr.StyleSheetAdded,t)}styleSheetRemoved(e){const t=this.#or.get(e);if(console.assert(Boolean(t)),!t)return;this.#or.delete(e);const n=t.resourceURL(),r=this.#ir.get(n);if(console.assert(Boolean(r),"No frameId to styleSheetId map is available for given style sheet URL."),r){const s=r.get(t.frameId);s&&(s.delete(e),s.size||(r.delete(t.frameId),r.size||this.#ir.delete(n)))}this.#er.delete(t),this.#nr.detachSourceMap(t),this.dispatchEventToListeners(Nr.StyleSheetRemoved,t)}getStyleSheetIdsForURL(e){const t=this.#ir.get(e);if(!t)return[];const n=[];for(const e of t.values())n.push(...e);return n}async setStyleSheetText(e,t,n){const r=this.#or.get(e);if(!r)return"Unknown stylesheet in CSS.setStyleSheetText";t=Br.trimSourceURL(t),r.hasSourceURL&&(t+="\n/*# sourceURL="+r.sourceURL+" */"),await this.ensureOriginalStyleSheetText(e);const s=(await this.agent.invoke_setStyleSheetText({styleSheetId:r.id,text:t})).sourceMapURL;return this.#nr.detachSourceMap(r),r.setSourceMapURL(s),this.#nr.attachSourceMap(r,r.sourceURL,r.sourceMapURL),null===s?"Error in CSS.setStyleSheetText":(this.#Yn.markUndoableState(!n),this.fireStyleSheetChanged(e),null)}async getStyleSheetText(e){const t=await this.agent.invoke_getStyleSheetText({styleSheetId:e});if(t.getError())return null;const{text:n}=t;return n&&Br.trimSourceURL(n)}async onPrimaryPageChanged(e){e.data.frame.backForwardCacheDetails.restoredFromCache?(await this.suspendModel(),await this.resumeModel()):"Activation"!==e.data.type&&(this.resetStyleSheets(),this.resetFontFaces())}resetStyleSheets(){const e=[...this.#or.values()];this.#ir.clear(),this.#or.clear();for(const t of e)this.#nr.detachSourceMap(t),this.dispatchEventToListeners(Nr.StyleSheetRemoved,t)}resetFontFaces(){this.#Zn.clear()}async suspendModel(){this.#Qn=!1,await this.agent.invoke_disable(),this.resetStyleSheets(),this.resetFontFaces()}async resumeModel(){return await this.enable()}setEffectivePropertyValueForNode(e,t,n){this.agent.invoke_setEffectivePropertyValueForNode({nodeId:e,propertyName:t,value:n})}cachedMatchedCascadeForNode(e){if(this.#ar!==e&&this.discardCachedMatchedCascade(),this.#ar=e,!this.#lr){if(!e.id)return Promise.resolve(null);this.#lr=this.getMatchedStyles(e.id)}return this.#lr}discardCachedMatchedCascade(){this.#ar=null,this.#lr=null}createCSSPropertyTracker(e){return new Vr(this,e)}enableCSSPropertyTracker(e){const t=e.getTrackedProperties();0!==t.length&&(this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:t}),this.#cr=!0,this.#dr=e,this.pollComputedStyleUpdates())}disableCSSPropertyTracker(){this.#cr=!1,this.#dr=null,this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:[]})}async pollComputedStyleUpdates(){if(!this.#ur){if(this.#cr){this.#ur=!0;const e=await this.agent.invoke_takeComputedStyleUpdates();if(this.#ur=!1,e.getError()||!e.nodeIds||!this.#cr)return;this.#dr&&this.#dr.dispatchEventToListeners("TrackedCSSPropertiesUpdated",e.nodeIds.map((e=>this.#Yn.nodeForId(e))))}this.#cr&&this.#sr.schedule(this.pollComputedStyleUpdates.bind(this))}}dispose(){this.disableCSSPropertyTracker(),super.dispose(),this.dispatchEventToListeners(Nr.ModelDisposed,this)}getAgent(){return this.agent}}!function(e){e.FontsUpdated="FontsUpdated",e.MediaQueryResultChanged="MediaQueryResultChanged",e.ModelWasEnabled="ModelWasEnabled",e.ModelDisposed="ModelDisposed",e.PseudoStateForced="PseudoStateForced",e.StyleSheetAdded="StyleSheetAdded",e.StyleSheetChanged="StyleSheetChanged",e.StyleSheetRemoved="StyleSheetRemoved",e.ComputedStyleUpdated="ComputedStyleUpdated"}(Nr||(Nr={}));const _r="pseudo-state-marker";class Hr{styleSheetId;oldRange;newRange;newText;payload;constructor(e,n,r,s){this.styleSheetId=e,this.oldRange=n,this.newRange=t.TextRange.TextRange.fromEdit(n,r),this.newText=r,this.payload=s}}class Ur{#je;styleSheetId;url;lineNumber;columnNumber;constructor(e,t,n){this.#je=e.cssModel(),this.styleSheetId=e.id,this.url=e.resourceURL(),this.lineNumber=t,this.columnNumber=n||0}cssModel(){return this.#je}header(){return this.#je.styleSheetHeaderForId(this.styleSheetId)}}class qr{#lt;constructor(e){this.#lt=e}mediaQueryResultChanged(){this.#lt.mediaQueryResultChanged()}fontsUpdated({font:e}){this.#lt.fontsUpdated(e)}styleSheetChanged({styleSheetId:e}){this.#lt.fireStyleSheetChanged(e)}styleSheetAdded({header:e}){this.#lt.styleSheetAdded(e)}styleSheetRemoved({styleSheetId:e}){this.#lt.styleSheetRemoved(e)}computedStyleUpdated({nodeId:e}){this.#lt.computedStyleUpdated(e)}}class zr{#lt;#pr=new Map;constructor(e){this.#lt=e}computedStylePromise(e){let t=this.#pr.get(e);return t||(t=this.#lt.getAgent().invoke_getComputedStyleForNode({nodeId:e}).then((({computedStyle:t})=>{if(this.#pr.delete(e),!t?.length)return null;const n=new Map;for(const e of t)n.set(e.name,e.value);return n})),this.#pr.set(e,t),t)}}class jr{inlineStyle;attributesStyle;constructor(e,t){this.inlineStyle=e,this.attributesStyle=t}}class Vr extends e.ObjectWrapper.ObjectWrapper{#lt;#mr;constructor(e,t){super(),this.#lt=e,this.#mr=t}start(){this.#lt.enableCSSPropertyTracker(this)}stop(){this.#lt.disableCSSPropertyTracker()}getTrackedProperties(){return this.#mr}}const Wr=1e3;h.register(Br,{capabilities:2,autostart:!0});var Gr=Object.freeze({__proto__:null,CSSLocation:Ur,CSSModel:Br,CSSPropertyTracker:Vr,Edit:Hr,get Events(){return Nr},InlineStyleResult:jr});class Kr extends h{#fr;#br;#yr;#vr;constructor(e){super(e),e.registerHeapProfilerDispatcher(new Qr(this)),this.#fr=!1,this.#br=e.heapProfilerAgent(),this.#yr=e.model(Jr),this.#vr=0}debuggerModel(){return this.#yr.debuggerModel()}runtimeModel(){return this.#yr}async enable(){this.#fr||(this.#fr=!0,await this.#br.invoke_enable())}async startSampling(e){if(this.#vr++)return!1;const t=await this.#br.invoke_startSampling({samplingInterval:e||16384});return Boolean(t.getError())}async stopSampling(){if(!this.#vr)throw new Error("Sampling profiler is not running.");if(--this.#vr)return await this.getSamplingProfile();const e=await this.#br.invoke_stopSampling();return e.getError()?null:e.profile}async getSamplingProfile(){const e=await this.#br.invoke_getSamplingProfile();return e.getError()?null:e.profile}async collectGarbage(){const e=await this.#br.invoke_collectGarbage();return Boolean(e.getError())}async snapshotObjectIdForObjectId(e){const t=await this.#br.invoke_getHeapObjectId({objectId:e});return t.getError()?null:t.heapSnapshotObjectId}async objectForSnapshotObjectId(e,t){const n=await this.#br.invoke_getObjectByHeapObjectId({objectId:e,objectGroup:t});return n.getError()?null:this.#yr.createRemoteObject(n.result)}async addInspectedHeapObject(e){const t=await this.#br.invoke_addInspectedHeapObject({heapObjectId:e});return Boolean(t.getError())}async takeHeapSnapshot(e){const t=await this.#br.invoke_takeHeapSnapshot(e);return Boolean(t.getError())}async startTrackingHeapObjects(e){const t=await this.#br.invoke_startTrackingHeapObjects({trackAllocations:e});return Boolean(t.getError())}async stopTrackingHeapObjects(e){const t=await this.#br.invoke_stopTrackingHeapObjects({reportProgress:e});return Boolean(t.getError())}heapStatsUpdate(e){this.dispatchEventToListeners("HeapStatsUpdate",e)}lastSeenObjectId(e,t){this.dispatchEventToListeners("LastSeenObjectId",{lastSeenObjectId:e,timestamp:t})}addHeapSnapshotChunk(e){this.dispatchEventToListeners("AddHeapSnapshotChunk",e)}reportHeapSnapshotProgress(e,t,n){this.dispatchEventToListeners("ReportHeapSnapshotProgress",{done:e,total:t,finished:n})}resetProfiles(){this.dispatchEventToListeners("ResetProfiles",this)}}class Qr{#Ir;constructor(e){this.#Ir=e}heapStatsUpdate({statsUpdate:e}){this.#Ir.heapStatsUpdate(e)}lastSeenObjectId({lastSeenObjectId:e,timestamp:t}){this.#Ir.lastSeenObjectId(e,t)}addHeapSnapshotChunk({chunk:e}){this.#Ir.addHeapSnapshotChunk(e)}reportHeapSnapshotProgress({done:e,total:t,finished:n}){this.#Ir.reportHeapSnapshotProgress(e,t,n)}resetProfiles(){this.#Ir.resetProfiles()}}h.register(Kr,{capabilities:4,autostart:!1});var $r,Xr=Object.freeze({__proto__:null,HeapProfilerModel:Kr});class Jr extends h{agent;#wr=new Map;#Sr=Zr.comparator;constructor(t){super(t),this.agent=t.runtimeAgent(),this.target().registerRuntimeDispatcher(new Yr(this)),this.agent.invoke_enable(),e.Settings.Settings.instance().moduleSetting("custom-formatters").get()&&this.agent.invoke_setCustomObjectFormatterEnabled({enabled:!0}),e.Settings.Settings.instance().moduleSetting("custom-formatters").addChangeListener(this.customFormattersStateChanged.bind(this))}static isSideEffectFailure(e){const t="exceptionDetails"in e&&e.exceptionDetails;return Boolean(t&&t.exception?.description?.startsWith("EvalError: Possible side-effect in debug-evaluate"))}debuggerModel(){return this.target().model(ms)}heapProfilerModel(){return this.target().model(Kr)}executionContexts(){return[...this.#wr.values()].sort(this.executionContextComparator())}setExecutionContextComparator(e){this.#Sr=e}executionContextComparator(){return this.#Sr}defaultExecutionContext(){for(const e of this.executionContexts())if(e.isDefault)return e;return null}executionContext(e){return this.#wr.get(e)||null}executionContextCreated(e){const t=e.auxData||{isDefault:!0},n=new Zr(this,e.id,e.uniqueId,e.name,e.origin,t.isDefault,t.frameId);this.#wr.set(n.id,n),this.dispatchEventToListeners($r.ExecutionContextCreated,n)}executionContextDestroyed(e){const t=this.#wr.get(e);t&&(this.debuggerModel().executionContextDestroyed(t),this.#wr.delete(e),this.dispatchEventToListeners($r.ExecutionContextDestroyed,t))}fireExecutionContextOrderChanged(){this.dispatchEventToListeners($r.ExecutionContextOrderChanged,this)}executionContextsCleared(){this.debuggerModel().globalObjectCleared();const e=this.executionContexts();this.#wr.clear();for(let t=0;t<e.length;++t)this.dispatchEventToListeners($r.ExecutionContextDestroyed,e[t])}createRemoteObject(e){return console.assert("object"==typeof e,"Remote object payload should only be an object"),new _n(this,e.objectId,e.type,e.subtype,e.value,e.unserializableValue,e.description,e.preview,e.customPreview,e.className)}createScopeRemoteObject(e,t){return new Hn(this,e.objectId,t,e.type,e.subtype,e.value,e.unserializableValue,e.description,e.preview)}createRemoteObjectFromPrimitiveValue(e){const t=typeof e;let n;const r=Bn.unserializableDescription(e);return null!==r&&(n=r),void 0!==n&&(e=void 0),new _n(this,void 0,t,void 0,e,n)}createRemotePropertyFromPrimitiveValue(e,t){return new qn(e,this.createRemoteObjectFromPrimitiveValue(t))}discardConsoleEntries(){this.agent.invoke_discardConsoleEntries()}releaseObjectGroup(e){this.agent.invoke_releaseObjectGroup({objectGroup:e})}releaseEvaluationResult(e){if("object"in e&&e.object&&e.object.release(),"exceptionDetails"in e&&e.exceptionDetails?.exception){const t=e.exceptionDetails.exception;this.createRemoteObject({type:t.type,objectId:t.objectId}).release()}}runIfWaitingForDebugger(){this.agent.invoke_runIfWaitingForDebugger()}customFormattersStateChanged({data:e}){this.agent.invoke_setCustomObjectFormatterEnabled({enabled:e})}async compileScript(e,t,n,r){const s=await this.agent.invoke_compileScript({expression:e,sourceURL:t,persistScript:n,executionContextId:r});return s.getError()?(console.error(s.getError()),null):{scriptId:s.scriptId,exceptionDetails:s.exceptionDetails}}async runScript(e,t,n,r,s,i,o,a){const l=await this.agent.invoke_runScript({scriptId:e,executionContextId:t,objectGroup:n,silent:r,includeCommandLineAPI:s,returnByValue:i,generatePreview:o,awaitPromise:a}),d=l.getError();return d?(console.error(d),{error:d}):{object:this.createRemoteObject(l.result),exceptionDetails:l.exceptionDetails}}async queryObjects(e){if(!e.objectId)return{error:"Prototype should be an Object."};const t=await this.agent.invoke_queryObjects({prototypeObjectId:e.objectId,objectGroup:"console"}),n=t.getError();return n?(console.error(n),{error:n}):{objects:this.createRemoteObject(t.objects)}}async isolateId(){const e=await this.agent.invoke_getIsolateId();return e.getError()||!e.id?this.target().id():e.id}async heapUsage(){const e=await this.agent.invoke_getHeapUsage();return e.getError()?null:e}inspectRequested(t,n,r){const s=this.createRemoteObject(t);if(null!==n&&"object"==typeof n){if("copyToClipboard"in n&&Boolean(n.copyToClipboard))return void this.copyRequested(s);if("queryObjects"in n&&n.queryObjects)return void this.queryObjectsRequested(s,r)}s.isNode()?e.Revealer.reveal(s).then(s.release.bind(s)):"function"!==s.type?s.release():Vn.objectAsFunction(s).targetFunctionDetails().then((function(t){if(s.release(),!t?.location)return;e.Revealer.reveal(t.location)}))}async addBinding(e){return await this.agent.invoke_addBinding(e)}async removeBinding(e){return await this.agent.invoke_removeBinding(e)}bindingCalled(e){this.dispatchEventToListeners($r.BindingCalled,e)}copyRequested(t){if(!t.objectId)return void a.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(t.unserializableValue()||t.value);const n=e.Settings.Settings.instance().moduleSetting("text-editor-indent").get();t.callFunctionJSON((function(e){const t=e.subtype,n=e.indent;if("node"===t)return this instanceof Element?this.outerHTML:void 0;if(t&&void 0===this)return String(t);try{return JSON.stringify(this,null,n)}catch{return String(this)}}),[{value:{subtype:t.subtype,indent:n}}]).then(a.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(a.InspectorFrontendHost.InspectorFrontendHostInstance))}async queryObjectsRequested(t,n){const r=await this.queryObjects(t);t.release(),"error"in r?e.Console.Console.instance().error(r.error):this.dispatchEventToListeners($r.QueryObjectRequested,{objects:r.objects,executionContextId:n})}static simpleTextFromException(e){let t=e.text;if(e.exception?.description){let n=e.exception.description;-1!==n.indexOf("\n")&&(n=n.substring(0,n.indexOf("\n"))),t+=" "+n}return t}exceptionThrown(e,t){const n={timestamp:e,details:t};this.dispatchEventToListeners($r.ExceptionThrown,n)}exceptionRevoked(e){this.dispatchEventToListeners($r.ExceptionRevoked,e)}consoleAPICalled(e,t,n,r,s,i){const o={type:e,args:t,executionContextId:n,timestamp:r,stackTrace:s,context:i};this.dispatchEventToListeners($r.ConsoleAPICalled,o)}executionContextIdForScriptId(e){const t=this.debuggerModel().scriptForId(e);return t?t.executionContextId:0}executionContextForStackTrace(e){let t=e;for(;t&&!t.callFrames.length;)t=t.parent||null;return t?.callFrames.length?this.executionContextIdForScriptId(t.callFrames[0].scriptId):0}terminateExecution(){return this.agent.invoke_terminateExecution()}async getExceptionDetails(e){const t=await this.agent.invoke_getExceptionDetails({errorObjectId:e});if(!t.getError())return t.exceptionDetails}}!function(e){e.BindingCalled="BindingCalled",e.ExecutionContextCreated="ExecutionContextCreated",e.ExecutionContextDestroyed="ExecutionContextDestroyed",e.ExecutionContextChanged="ExecutionContextChanged",e.ExecutionContextOrderChanged="ExecutionContextOrderChanged",e.ExceptionThrown="ExceptionThrown",e.ExceptionRevoked="ExceptionRevoked",e.ConsoleAPICalled="ConsoleAPICalled",e.QueryObjectRequested="QueryObjectRequested"}($r||($r={}));class Yr{#kr;constructor(e){this.#kr=e}executionContextCreated({context:e}){this.#kr.executionContextCreated(e)}executionContextDestroyed({executionContextId:e}){this.#kr.executionContextDestroyed(e)}executionContextsCleared(){this.#kr.executionContextsCleared()}exceptionThrown({timestamp:e,exceptionDetails:t}){this.#kr.exceptionThrown(e,t)}exceptionRevoked({exceptionId:e}){this.#kr.exceptionRevoked(e)}consoleAPICalled({type:e,args:t,executionContextId:n,timestamp:r,stackTrace:s,context:i}){this.#kr.consoleAPICalled(e,t,n,r,s,i)}inspectRequested({object:e,hints:t,executionContextId:n}){this.#kr.inspectRequested(e,t,n)}bindingCalled(e){this.#kr.bindingCalled(e)}}class Zr{id;uniqueId;name;#Cr;origin;isDefault;runtimeModel;debuggerModel;frameId;constructor(e,t,n,r,s,i,o){this.id=t,this.uniqueId=n,this.name=r,this.#Cr=null,this.origin=s,this.isDefault=i,this.runtimeModel=e,this.debuggerModel=e.debuggerModel(),this.frameId=o,this.setLabelInternal("")}target(){return this.runtimeModel.target()}static comparator(e,t){function n(e){return e.parentTarget()?.type()!==U.FRAME?5:e.type()===U.FRAME?4:e.type()===U.ServiceWorker?3:e.type()===U.Worker||e.type()===U.SHARED_WORKER?2:1}function r(e){let t=e;const n=[];for(;t;)n.push(t),t=t.parentTarget();return n.reverse()}const s=r(e.target()),i=r(t.target());let o,a;for(let e=0;;e++)if(!s[e]||!i[e]||s[e]!==i[e]){o=s[e],a=i[e];break}if(!o&&a)return-1;if(!a&&o)return 1;if(o&&a){const e=n(o)-n(a);return e?-e:o.id().localeCompare(a.id())}return e.isDefault?-1:t.isDefault?1:e.name.localeCompare(t.name)}async evaluate(e,t,n){return this.debuggerModel.selectedCallFrame()?await this.debuggerModel.evaluateOnSelectedCallFrame(e):await this.evaluateGlobal(e,t,n)}globalObject(e,t){const n={expression:"this",objectGroup:e,includeCommandLineAPI:!1,silent:!0,returnByValue:!1,generatePreview:t};return this.evaluateGlobal(n,!1,!1)}async callFunctionOn(e){const t=await this.runtimeModel.agent.invoke_callFunctionOn({functionDeclaration:e.functionDeclaration,returnByValue:e.returnByValue,userGesture:e.userGesture,awaitPromise:e.awaitPromise,throwOnSideEffect:e.throwOnSideEffect,arguments:e.arguments,...this.uniqueId?{uniqueContextId:this.uniqueId}:{contextId:this.id}}),n=t.getError();return n?{error:n}:{object:this.runtimeModel.createRemoteObject(t.result),exceptionDetails:t.exceptionDetails}}async evaluateGlobal(e,t,n){e.expression||(e.expression="this");const r=await this.runtimeModel.agent.invoke_evaluate({expression:e.expression,objectGroup:e.objectGroup,includeCommandLineAPI:e.includeCommandLineAPI,silent:e.silent,returnByValue:e.returnByValue,generatePreview:e.generatePreview,userGesture:t,awaitPromise:n,throwOnSideEffect:e.throwOnSideEffect,timeout:e.timeout,disableBreaks:e.disableBreaks,replMode:e.replMode,allowUnsafeEvalBlockedByCSP:e.allowUnsafeEvalBlockedByCSP,...this.uniqueId?{uniqueContextId:this.uniqueId}:{contextId:this.id}}),s=r.getError();return s?(console.error(s),{error:s}):{object:this.runtimeModel.createRemoteObject(r.result),exceptionDetails:r.exceptionDetails}}async globalLexicalScopeNames(){const e=await this.runtimeModel.agent.invoke_globalLexicalScopeNames({executionContextId:this.id});return e.getError()?[]:e.names}label(){return this.#Cr}setLabel(e){this.setLabelInternal(e),this.runtimeModel.dispatchEventToListeners($r.ExecutionContextChanged,this)}setLabelInternal(t){if(t)return void(this.#Cr=t);if(this.name)return void(this.#Cr=this.name);const n=e.ParsedURL.ParsedURL.fromString(this.origin);this.#Cr=n?n.lastPathComponentWithFragment():""}}h.register(Jr,{capabilities:4,autostart:!0});var es=Object.freeze({__proto__:null,get Events(){return $r},ExecutionContext:Zr,RuntimeModel:Jr});const ts={scriptRemovedOrDeleted:"Script removed or deleted.",unableToFetchScriptSource:"Unable to fetch script source."},ns=n.i18n.registerUIStrings("core/sdk/Script.ts",ts),rs=n.i18n.getLocalizedString.bind(void 0,ns);let ss=null;class is{debuggerModel;scriptId;sourceURL;lineOffset;columnOffset;endLine;endColumn;executionContextId;hash;#xr;#Rr;sourceMapURL;debugSymbols;hasSourceURL;contentLength;originStackTrace;#Tr;#Mr;#Pr;#Er;isModule;constructor(e,t,n,r,s,i,o,a,l,d,c,h,u,g,p,m,f,b,y,v){this.debuggerModel=e,this.scriptId=t,this.sourceURL=n,this.lineOffset=r,this.columnOffset=s,this.endLine=i,this.endColumn=o,this.isModule=p,this.executionContextId=a,this.hash=l,this.#xr=d,this.#Rr=c,this.sourceMapURL=h,this.debugSymbols=y,this.hasSourceURL=u,this.contentLength=g,this.originStackTrace=m,this.#Tr=f,this.#Mr=b,this.#Pr=null,this.#Er=v}embedderName(){return this.#Er}target(){return this.debuggerModel.target()}static trimSourceURLComment(e){let t=e.lastIndexOf("//# sourceURL=");if(-1===t&&(t=e.lastIndexOf("//@ sourceURL="),-1===t))return e;const n=e.lastIndexOf("\n",t);if(-1===n)return e;return e.substr(n+1).match(as)?e.substr(0,n):e}isContentScript(){return this.#xr}codeOffset(){return this.#Tr}isJavaScript(){return"JavaScript"===this.#Mr}isWasm(){return"WebAssembly"===this.#Mr}scriptLanguage(){return this.#Mr}executionContext(){return this.debuggerModel.runtimeModel().executionContext(this.executionContextId)}isLiveEdit(){return this.#Rr}contentURL(){return this.sourceURL}contentType(){return e.ResourceType.resourceTypes.Script}async loadTextContent(){const n=await this.debuggerModel.target().debuggerAgent().invoke_getScriptSource({scriptId:this.scriptId});if(n.getError())throw new Error(n.getError());const{scriptSource:r,bytecode:s}=n;if(s)return new t.ContentData.ContentData(s,!0,"application/wasm");let i=r||"";return this.hasSourceURL&&e.ParsedURL.schemeIs(this.sourceURL,"snippet:")&&(i=is.trimSourceURLComment(i)),new t.ContentData.ContentData(i,!1,"text/javascript")}async loadWasmContent(){if(!this.isWasm())throw new Error("Not a wasm script");const e=await this.debuggerModel.target().debuggerAgent().invoke_disassembleWasmModule({scriptId:this.scriptId});if(e.getError()){const e=await this.loadTextContent();return await ls(e.base64)}const{streamId:n,functionBodyOffsets:r,chunk:{lines:s,bytecodeOffsets:i}}=e,o=[],a=[];let l=s.reduce(((e,t)=>e+t.length+1),0);const d="<truncated>";if(n)for(;;){const e=await this.debuggerModel.target().debuggerAgent().invoke_nextWasmDisassemblyChunk({streamId:n});if(e.getError())throw new Error(e.getError());const{chunk:{lines:t,bytecodeOffsets:r}}=e;if(l+=t.reduce(((e,t)=>e+t.length+1),0),0===t.length)break;if(l>=999999989){o.push([d]),a.push([0]);break}o.push(t),a.push(r)}const c=[];for(let e=0;e<r.length;e+=2)c.push({start:r[e],end:r[e+1]});return new t.WasmDisassembly.WasmDisassembly(s.concat(...o),i.concat(...a),c)}requestContentData(){if(!this.#Pr){const e=65535;if(this.hash&&!this.#Rr&&this.contentLength>e){ss||(ss={cache:new Map,registry:new FinalizationRegistry((e=>ss?.cache.delete(e)))});const e=[this.#Mr,this.contentLength,this.lineOffset,this.columnOffset,this.endLine,this.endColumn,this.#Tr,this.hash].join(":"),t=ss.cache.get(e)?.deref();t?this.#Pr=t:(this.#Pr=this.requestContentInternal(),ss.cache.set(e,new WeakRef(this.#Pr)),ss.registry.register(this.#Pr,e))}else this.#Pr=this.requestContentInternal()}return this.#Pr}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentInternal(){if(!this.scriptId)return{error:rs(ts.scriptRemovedOrDeleted)};try{return this.isWasm()?await this.loadWasmContent():await this.loadTextContent()}catch{return{error:rs(ts.unableToFetchScriptSource)}}}async getWasmBytecode(){const e=await this.debuggerModel.target().debuggerAgent().invoke_getWasmBytecode({scriptId:this.scriptId}),t=await fetch(`data:application/wasm;base64,${e.bytecode}`);return await t.arrayBuffer()}originalContentProvider(){return new t.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),(()=>this.requestContentData()))}async searchInContent(e,n,r){if(!this.scriptId)return[];const s=await this.debuggerModel.target().debuggerAgent().invoke_searchInContent({scriptId:this.scriptId,query:e,caseSensitive:n,isRegex:r});return t.TextUtils.performSearchInSearchMatches(s.result||[],e,n,r)}appendSourceURLCommentIfNeeded(e){return this.hasSourceURL?e+"\n //# sourceURL="+this.sourceURL:e}async editSource(e){e=is.trimSourceURLComment(e),e=this.appendSourceURLCommentIfNeeded(e);if(t.ContentData.ContentData.textOr(await this.requestContentData(),null)===e)return{changed:!1,status:"Ok"};const n=await this.debuggerModel.target().debuggerAgent().invoke_setScriptSource({scriptId:this.scriptId,scriptSource:e,allowTopFrameEditing:!0});if(n.getError())throw new Error(`Script#editSource failed for script with id ${this.scriptId}: ${n.getError()}`);return n.getError()||"Ok"!==n.status||(this.#Pr=Promise.resolve(new t.ContentData.ContentData(e,!1,"text/javascript"))),this.debuggerModel.dispatchEventToListeners(ys.ScriptSourceWasEdited,{script:this,status:n.status}),{changed:!0,status:n.status,exceptionDetails:n.exceptionDetails}}rawLocation(e,t){return this.containsLocation(e,t)?new Is(this.debuggerModel,this.scriptId,e,t):null}isInlineScript(){const e=!this.lineOffset&&!this.columnOffset;return!this.isWasm()&&Boolean(this.sourceURL)&&!e}isAnonymousScript(){return!this.sourceURL}async setBlackboxedRanges(e){return!(await this.debuggerModel.target().debuggerAgent().invoke_setBlackboxedRanges({scriptId:this.scriptId,positions:e})).getError()}containsLocation(e,t){const n=e===this.lineOffset&&t>=this.columnOffset||e>this.lineOffset,r=e<this.endLine||e===this.endLine&&t<=this.endColumn;return n&&r}get frameId(){return"string"!=typeof this[os]&&(this[os]=function(e){const t=e.executionContext();if(t)return t.frameId||null;const n=e.debuggerModel.target().model(ii);if(!n?.mainFrame)return null;return n.mainFrame.id}(this)),this[os]}get isBreakpointCondition(){return[Rs,xs].includes(this.sourceURL)}sourceMap(){return this.debuggerModel.sourceMapManager().sourceMapForClient(this)}createPageResourceLoadInitiator(){return{target:this.target(),frameId:this.frameId,initiatorUrl:this.embedderName()}}rawLocationToRelativeLocation(e){let{lineNumber:t,columnNumber:n}=e;return!this.hasSourceURL&&this.isInlineScript()&&(t-=this.lineOffset,0===t&&void 0!==n&&(n-=this.columnOffset)),{lineNumber:t,columnNumber:n}}relativeLocationToRawLocation(e){let{lineNumber:t,columnNumber:n}=e;return!this.hasSourceURL&&this.isInlineScript()&&(0===t&&void 0!==n&&(n+=this.columnOffset),t+=this.lineOffset),{lineNumber:t,columnNumber:n}}}const os=Symbol("frameid");const as=/^[\x20\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/;async function ls(n){const r=e.Worker.WorkerWrapper.fromURL(new URL("../../entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.js",import.meta.url)),s=new Promise(((e,n)=>{r.onmessage=({data:r})=>{if("method"in r&&"disassemble"===r.method)if("error"in r)n(r.error);else if("result"in r){const{lines:n,offsets:s,functionBodyOffsets:i}=r.result;e(new t.WasmDisassembly.WasmDisassembly(n,s,i))}},r.onerror=n}));r.postMessage({method:"disassemble",params:{content:n}});try{return await s}finally{r.terminate()}}var ds=Object.freeze({__proto__:null,Script:is,disassembleWasm:ls,sourceURLRegex:as});const cs={local:"Local",closure:"Closure",block:"Block",script:"Script",withBlock:"`With` block",catchBlock:"`Catch` block",global:"Global",module:"Module",expression:"Expression",exception:"Exception",returnValue:"Return value"},hs=n.i18n.registerUIStrings("core/sdk/DebuggerModel.ts",cs),us=n.i18n.getLocalizedString.bind(void 0,hs);function gs(e){function t(e,t){return e.lineNumber-t.lineNumber||e.columnNumber-t.columnNumber}function n(e,n){if(e.scriptId!==n.scriptId)return!1;const r=t(e.start,n.start);return r<0?t(e.end,n.start)>=0:!(r>0)||t(e.start,n.end)<=0}if(0===e.length)return[];e.sort(((e,n)=>e.scriptId<n.scriptId?-1:e.scriptId>n.scriptId?1:t(e.start,n.start)||t(e.end,n.end)));let r=e[0];const s=[];for(let i=1;i<e.length;++i){const o=e[i];n(r,o)?t(r.end,o.end)<=0&&(r={...r,end:o.end}):(s.push(r),r=o)}return s.push(r),s}const ps=["ExternalDWARF","EmbeddedDWARF","SourceMap"];class ms extends h{agent;runtimeModelInternal;#Lr;#Ar=null;#Or=new Map;#Dr=new Map;#Nr=[];continueToLocationCallback=null;#Fr=null;#Br=!1;#_r=null;#Hr=0;#Ur=null;#qr=null;#zr=null;evaluateOnCallFrameCallback=null;#jr=null;#Vr=new e.ObjectWrapper.ObjectWrapper;#Wr=null;#Gr=!1;constructor(t){super(t),t.registerDebuggerDispatcher(new vs(this)),this.agent=t.debuggerAgent(),this.runtimeModelInternal=t.model(Jr),this.#Lr=new Or(t),e.Settings.Settings.instance().moduleSetting("pause-on-exception-enabled").addChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("pause-on-caught-exception").addChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("pause-on-uncaught-exception").addChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("disable-async-stack-traces").addChangeListener(this.asyncStackTracesStateChanged,this),e.Settings.Settings.instance().moduleSetting("breakpoints-active").addChangeListener(this.breakpointsActiveChanged,this),t.suspended()||this.enableDebugger(),this.#Lr.setEnabled(e.Settings.Settings.instance().moduleSetting("js-source-maps-enabled").get()),e.Settings.Settings.instance().moduleSetting("js-source-maps-enabled").addChangeListener((e=>this.#Lr.setEnabled(e.data)));const n=t.model(ii);n&&n.addEventListener(ri.FrameNavigated,this.onFrameNavigated,this)}static selectSymbolSource(t){if(!t||0===t.length)return null;if("type"in t)return"None"===t.type?null:t;let n=null;const r=new Map(t.map((e=>[e.type,e])));for(const e of ps)if(r.has(e)){n=r.get(e)||null;break}return console.assert(null!==n,"Unknown symbol types. Front-end and back-end should be kept in sync regarding Protocol.Debugger.DebugSymbolTypes"),n&&t.length>1&&e.Console.Console.instance().warn(`Multiple debug symbols for script were found. Using ${n.type}`),n}sourceMapManager(){return this.#Lr}runtimeModel(){return this.runtimeModelInternal}debuggerEnabled(){return Boolean(this.#Br)}debuggerId(){return this.#_r}async enableDebugger(){if(this.#Br)return;this.#Br=!0;const t=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,n=this.agent.invoke_enable({maxScriptsCacheSize:t});let r;o.Runtime.experiments.isEnabled("instrumentation-breakpoints")&&(r=this.agent.invoke_setInstrumentationBreakpoint({instrumentation:"beforeScriptExecution"})),this.pauseOnExceptionStateChanged(),this.asyncStackTracesStateChanged(),e.Settings.Settings.instance().moduleSetting("breakpoints-active").get()||this.breakpointsActiveChanged(),this.dispatchEventToListeners(ys.DebuggerWasEnabled,this);const[s]=await Promise.all([n,r]);this.registerDebugger(s)}async syncDebuggerId(){const e=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,t=this.agent.invoke_enable({maxScriptsCacheSize:e});return t.then(this.registerDebugger.bind(this)),await t}onFrameNavigated(){ms.shouldResyncDebuggerId||(ms.shouldResyncDebuggerId=!0)}registerDebugger(e){if(e.getError())return void(this.#Br=!1);const{debuggerId:t}=e;fs.set(t,this),this.#_r=t,this.dispatchEventToListeners(ys.DebuggerIsReadyToPause,this)}isReadyToPause(){return Boolean(this.#_r)}static async modelForDebuggerId(e){return ms.shouldResyncDebuggerId&&(await ms.resyncDebuggerIdForModels(),ms.shouldResyncDebuggerId=!1),fs.get(e)||null}static async resyncDebuggerIdForModels(){const e=fs.values();for(const t of e)t.debuggerEnabled()&&await t.syncDebuggerId()}async disableDebugger(){this.#Br&&(this.#Br=!1,await this.asyncStackTracesStateChanged(),await this.agent.invoke_disable(),this.#Gr=!1,this.globalObjectCleared(),this.dispatchEventToListeners(ys.DebuggerWasDisabled,this),"string"==typeof this.#_r&&fs.delete(this.#_r),this.#_r=null)}skipAllPauses(e){this.#Hr&&(clearTimeout(this.#Hr),this.#Hr=0),this.agent.invoke_setSkipAllPauses({skip:e})}skipAllPausesUntilReloadOrTimeout(e){this.#Hr&&clearTimeout(this.#Hr),this.agent.invoke_setSkipAllPauses({skip:!0}),this.#Hr=window.setTimeout(this.skipAllPauses.bind(this,!1),e)}pauseOnExceptionStateChanged(){const t=e.Settings.Settings.instance().moduleSetting("pause-on-caught-exception").get();let n;const r=e.Settings.Settings.instance().moduleSetting("pause-on-uncaught-exception").get();n=t&&r?"all":t?"caught":r?"uncaught":"none",this.agent.invoke_setPauseOnExceptions({state:n})}asyncStackTracesStateChanged(){const t=!e.Settings.Settings.instance().moduleSetting("disable-async-stack-traces").get()&&this.#Br?32:0;return this.agent.invoke_setAsyncCallStackDepth({maxDepth:t})}breakpointsActiveChanged(){this.agent.invoke_setBreakpointsActive({active:e.Settings.Settings.instance().moduleSetting("breakpoints-active").get()})}setComputeAutoStepRangesCallback(e){this.#qr=e}async computeAutoStepSkipList(e){let t=[];if(this.#qr&&this.#Ar&&this.#Ar.callFrames.length>0){const[n]=this.#Ar.callFrames;t=await this.#qr.call(null,e,n)}return gs(t.map((({start:e,end:t})=>({scriptId:e.scriptId,start:{lineNumber:e.lineNumber,columnNumber:e.columnNumber},end:{lineNumber:t.lineNumber,columnNumber:t.columnNumber}}))))}async stepInto(){const e=await this.computeAutoStepSkipList("StepInto");this.agent.invoke_stepInto({breakOnAsyncCall:!1,skipList:e})}async stepOver(){this.#Wr=this.#Ar?.callFrames[0]?.functionLocation()??null;const e=await this.computeAutoStepSkipList("StepOver");this.agent.invoke_stepOver({skipList:e})}async stepOut(){const e=await this.computeAutoStepSkipList("StepOut");0!==e.length?this.agent.invoke_stepOver({skipList:e}):this.agent.invoke_stepOut()}scheduleStepIntoAsync(){this.computeAutoStepSkipList("StepInto").then((e=>{this.agent.invoke_stepInto({breakOnAsyncCall:!0,skipList:e})}))}resume(){this.agent.invoke_resume({terminateOnResume:!1}),this.#Gr=!1}pause(){this.#Gr=!0,this.skipAllPauses(!1),this.agent.invoke_pause()}async setBreakpointByURL(t,n,s,i){let o;if(this.target().type()===U.NODE&&e.ParsedURL.schemeIs(t,"file:")){const n=e.ParsedURL.ParsedURL.urlToRawPathString(t,a.Platform.isWin());o=`${r.StringUtilities.escapeForRegExp(n)}|${r.StringUtilities.escapeForRegExp(t)}`,a.Platform.isWin()&&n.match(/^.:\\/)&&(o=`[${n[0].toUpperCase()}${n[0].toLowerCase()}]`+o.substr(1))}let l=0;const d=this.#Dr.get(t)||[];for(let e=0,t=d.length;e<t;++e){const t=d[e];n===t.lineOffset&&(l=l?Math.min(l,t.columnOffset):t.columnOffset)}s=Math.max(s||0,l);const c=await this.agent.invoke_setBreakpointByUrl({lineNumber:n,url:o?void 0:t,urlRegex:o,columnNumber:s,condition:i});if(c.getError())return{locations:[],breakpointId:null};let h=[];return c.locations&&(h=c.locations.map((e=>Is.fromPayload(this,e)))),{locations:h,breakpointId:c.breakpointId}}async setBreakpointInAnonymousScript(e,t,n,r){const s=await this.agent.invoke_setBreakpointByUrl({lineNumber:t,scriptHash:e,columnNumber:n,condition:r});if(s.getError())return{locations:[],breakpointId:null};let i=[];return s.locations&&(i=s.locations.map((e=>Is.fromPayload(this,e)))),{locations:i,breakpointId:s.breakpointId}}async removeBreakpoint(e){await this.agent.invoke_removeBreakpoint({breakpointId:e})}async getPossibleBreakpoints(e,t,n){const r=await this.agent.invoke_getPossibleBreakpoints({start:e.payload(),end:t?t.payload():void 0,restrictToFunction:n});return r.getError()||!r.locations?[]:r.locations.map((e=>ws.fromPayload(this,e)))}async fetchAsyncStackTrace(e){const t=await this.agent.invoke_getStackTrace({stackTraceId:e});return t.getError()?null:t.stackTrace}breakpointResolved(e,t){this.#Vr.dispatchEventToListeners(e,Is.fromPayload(this,t))}globalObjectCleared(){this.resetDebuggerPausedDetails(),this.reset(),this.dispatchEventToListeners(ys.GlobalObjectCleared,this)}reset(){for(const e of this.#Or.values())this.#Lr.detachSourceMap(e);this.#Or.clear(),this.#Dr.clear(),this.#Nr=[],this.#Wr=null}scripts(){return Array.from(this.#Or.values())}scriptForId(e){return this.#Or.get(e)||null}scriptsForSourceURL(e){return this.#Dr.get(e)||[]}scriptsForExecutionContext(e){const t=[];for(const n of this.#Or.values())n.executionContextId===e.id&&t.push(n);return t}get callFrames(){return this.#Ar?this.#Ar.callFrames:null}debuggerPausedDetails(){return this.#Ar}async setDebuggerPausedDetails(e){return this.#Gr=!1,this.#Ar=e,!(this.#Ur&&!await this.#Ur.call(null,e,this.#Wr))&&(this.#Wr=null,this.dispatchEventToListeners(ys.DebuggerPaused,this),this.setSelectedCallFrame(e.callFrames[0]),!0)}resetDebuggerPausedDetails(){this.#Gr=!1,this.#Ar=null,this.setSelectedCallFrame(null)}setBeforePausedCallback(e){this.#Ur=e}setExpandCallFramesCallback(e){this.#zr=e}setEvaluateOnCallFrameCallback(e){this.evaluateOnCallFrameCallback=e}setSynchronizeBreakpointsCallback(e){this.#jr=e}async pausedScript(t,n,r,s,i,o){if("instrumentation"===n){const e=this.scriptForId(r.scriptId);return this.#jr&&e&&await this.#jr(e),void this.resume()}const a=new Cs(this,t,n,r,s,i,o);if(await this.#Kr(a),this.continueToLocationCallback){const e=this.continueToLocationCallback;if(this.continueToLocationCallback=null,e(a))return}await this.setDebuggerPausedDetails(a)?e.EventTarget.fireEvent("DevTools.DebuggerPaused"):this.#Wr?this.stepOver():this.stepInto()}async#Kr(e){if(this.#zr&&(e.callFrames=await this.#zr.call(null,e.callFrames)),!o.Runtime.experiments.isEnabled("use-source-map-scopes"))return;const t=[];for(const n of e.callFrames){const e=await this.sourceMapManager().sourceMapForClientPromise(n.script);e?.hasScopeInfo()?t.push(...e.expandCallFrame(n)):t.push(n)}e.callFrames=t}resumedScript(){this.resetDebuggerPausedDetails(),this.dispatchEventToListeners(ys.DebuggerResumed,this)}parsedScriptSource(e,t,n,r,s,i,o,a,l,d,c,h,u,g,p,m,f,b,y,v){const I=this.#Or.get(e);if(I)return I;let w=!1;l&&"isDefault"in l&&(w=!l.isDefault);const S=ms.selectSymbolSource(y),k=new is(this,e,t,n,r,s,i,o,a,w,d,c,h,g,p,m,f,b,S,v);this.registerScript(k),this.dispatchEventToListeners(ys.ParsedScriptSource,k),k.sourceMapURL&&!u&&this.#Lr.attachSourceMap(k,k.sourceURL,k.sourceMapURL);return u&&k.isAnonymousScript()&&(this.#Nr.push(k),this.collectDiscardedScripts()),k}setSourceMapURL(e,t){this.#Lr.detachSourceMap(e),e.sourceMapURL=t,this.#Lr.attachSourceMap(e,e.sourceURL,e.sourceMapURL)}async setDebugInfoURL(e,t){this.#zr&&this.#Ar&&(this.#Ar.callFrames=await this.#zr.call(null,this.#Ar.callFrames)),this.dispatchEventToListeners(ys.DebugInfoAttached,e)}executionContextDestroyed(e){for(const t of this.#Or.values())t.executionContextId===e.id&&this.#Lr.detachSourceMap(t)}registerScript(e){if(this.#Or.set(e.scriptId,e),e.isAnonymousScript())return;let t=this.#Dr.get(e.sourceURL);t||(t=[],this.#Dr.set(e.sourceURL,t)),t.unshift(e)}unregisterScript(e){console.assert(e.isAnonymousScript()),this.#Or.delete(e.scriptId)}collectDiscardedScripts(){if(this.#Nr.length<1e3)return;const e=this.#Nr.splice(0,100);for(const t of e)this.unregisterScript(t),this.dispatchEventToListeners(ys.DiscardedAnonymousScriptSource,t)}createRawLocation(e,t,n,r){return this.createRawLocationByScriptId(e.scriptId,t,n,r)}createRawLocationByURL(e,t,n,r,s){for(const i of this.#Dr.get(e)||[]){if(!s){if(i.lineOffset>t||i.lineOffset===t&&void 0!==n&&i.columnOffset>n)continue;if(i.endLine<t||i.endLine===t&&void 0!==n&&i.endColumn<=n)continue}return new Is(this,i.scriptId,t,n,r)}return null}createRawLocationByScriptId(e,t,n,r){return new Is(this,e,t,n,r)}createRawLocationsByStackTrace(e){const t=[];for(let n=e;n;n=n.parent)for(const{scriptId:e,lineNumber:r,columnNumber:s}of n.callFrames)t.push(this.createRawLocationByScriptId(e,r,s));return t}isPaused(){return Boolean(this.debuggerPausedDetails())}isPausing(){return this.#Gr}setSelectedCallFrame(e){this.#Fr!==e&&(this.#Fr=e,this.dispatchEventToListeners(ys.CallFrameSelected,this))}selectedCallFrame(){return this.#Fr}async evaluateOnSelectedCallFrame(e){const t=this.selectedCallFrame();if(!t)throw new Error("No call frame selected");return await t.evaluate(e)}functionDetailsPromise(e){return e.getAllProperties(!1,!1).then(function(e){if(!e)return null;let t=null;if(e.internalProperties)for(const n of e.internalProperties)"[[FunctionLocation]]"===n.name&&(t=n.value);let n=null;if(e.properties)for(const t of e.properties)"name"===t.name&&t.value&&"string"===t.value.type&&(n=t.value);let r=null;t&&(r=this.createRawLocationByScriptId(t.value.scriptId,t.value.lineNumber,t.value.columnNumber));return{location:r,functionName:n?n.value:""}}.bind(this))}async setVariableValue(e,t,n,r){return(await this.agent.invoke_setVariableValue({scopeNumber:e,variableName:t,newValue:n,callFrameId:r})).getError()}addBreakpointListener(e,t,n){this.#Vr.addEventListener(e,t,n)}removeBreakpointListener(e,t,n){this.#Vr.removeEventListener(e,t,n)}async setBlackboxPatterns(e,t){return!(await this.agent.invoke_setBlackboxPatterns({patterns:e,skipAnonymous:t})).getError()}async setBlackboxExecutionContexts(e){return!(await this.agent.invoke_setBlackboxExecutionContexts({uniqueIds:e})).getError()}dispose(){this.#_r&&fs.delete(this.#_r),e.Settings.Settings.instance().moduleSetting("pause-on-exception-enabled").removeChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("pause-on-caught-exception").removeChangeListener(this.pauseOnExceptionStateChanged,this),e.Settings.Settings.instance().moduleSetting("disable-async-stack-traces").removeChangeListener(this.asyncStackTracesStateChanged,this)}async suspendModel(){await this.disableDebugger()}async resumeModel(){await this.enableDebugger()}static shouldResyncDebuggerId=!1;getEvaluateOnCallFrameCallback(){return this.evaluateOnCallFrameCallback}}const fs=new Map;var bs,ys;!function(e){e.DontPauseOnExceptions="none",e.PauseOnAllExceptions="all",e.PauseOnCaughtExceptions="caught",e.PauseOnUncaughtExceptions="uncaught"}(bs||(bs={})),function(e){e.DebuggerWasEnabled="DebuggerWasEnabled",e.DebuggerWasDisabled="DebuggerWasDisabled",e.DebuggerPaused="DebuggerPaused",e.DebuggerResumed="DebuggerResumed",e.DebugInfoAttached="DebugInfoAttached",e.ParsedScriptSource="ParsedScriptSource",e.DiscardedAnonymousScriptSource="DiscardedAnonymousScriptSource",e.GlobalObjectCleared="GlobalObjectCleared",e.CallFrameSelected="CallFrameSelected",e.DebuggerIsReadyToPause="DebuggerIsReadyToPause",e.ScriptSourceWasEdited="ScriptSourceWasEdited"}(ys||(ys={}));class vs{#Qr;constructor(e){this.#Qr=e}paused({callFrames:e,reason:t,data:n,hitBreakpoints:r,asyncStackTrace:s,asyncStackTraceId:i}){this.#Qr.debuggerEnabled()&&this.#Qr.pausedScript(e,t,n,r||[],s,i)}resumed(){this.#Qr.debuggerEnabled()&&this.#Qr.resumedScript()}scriptParsed({scriptId:e,url:t,startLine:n,startColumn:r,endLine:s,endColumn:i,executionContextId:o,hash:a,executionContextAuxData:l,isLiveEdit:d,sourceMapURL:c,hasSourceURL:h,length:u,isModule:g,stackTrace:p,codeOffset:m,scriptLanguage:f,debugSymbols:b,embedderName:y}){this.#Qr.debuggerEnabled()&&this.#Qr.parsedScriptSource(e,t,n,r,s,i,o,a,l,Boolean(d),c,Boolean(h),!1,u||0,g||null,p||null,m||null,f||null,b||null,y||null)}scriptFailedToParse({scriptId:e,url:t,startLine:n,startColumn:r,endLine:s,endColumn:i,executionContextId:o,hash:a,executionContextAuxData:l,sourceMapURL:d,hasSourceURL:c,length:h,isModule:u,stackTrace:g,codeOffset:p,scriptLanguage:m,embedderName:f}){this.#Qr.debuggerEnabled()&&this.#Qr.parsedScriptSource(e,t,n,r,s,i,o,a,l,!1,d,Boolean(c),!0,h||0,u||null,g||null,p||null,m||null,null,f||null)}breakpointResolved({breakpointId:e,location:t}){this.#Qr.debuggerEnabled()&&this.#Qr.breakpointResolved(e,t)}}let Is=class e{debuggerModel;scriptId;lineNumber;columnNumber;inlineFrameIndex;constructor(e,t,n,r,s){this.debuggerModel=e,this.scriptId=t,this.lineNumber=n,this.columnNumber=r||0,this.inlineFrameIndex=s||0}static fromPayload(t,n,r){return new e(t,n.scriptId,n.lineNumber,n.columnNumber,r)}payload(){return{scriptId:this.scriptId,lineNumber:this.lineNumber,columnNumber:this.columnNumber}}script(){return this.debuggerModel.scriptForId(this.scriptId)}continueToLocation(e){e&&(this.debuggerModel.continueToLocationCallback=this.paused.bind(this,e)),this.debuggerModel.agent.invoke_continueToLocation({location:this.payload(),targetCallFrames:"current"})}paused(e,t){const n=t.callFrames[0].location();return n.scriptId===this.scriptId&&n.lineNumber===this.lineNumber&&n.columnNumber===this.columnNumber&&(e(),!0)}id(){return this.debuggerModel.target().id()+":"+this.scriptId+":"+this.lineNumber+":"+this.columnNumber}};class ws extends Is{type;constructor(e,t,n,r,s){super(e,t,n,r),s&&(this.type=s)}static fromPayload(e,t){return new ws(e,t.scriptId,t.lineNumber,t.columnNumber,t.type)}}class Ss{debuggerModel;script;payload;#$r;#Xr;#Jr;inlineFrameIndex;functionName;#Yr;#Zr;missingDebugInfoDetails;exception;canBeRestarted;constructor(e,t,n,r,s,i=null){this.debuggerModel=e,this.script=t,this.payload=n,this.#$r=Is.fromPayload(e,n.location,r),this.#Xr=[],this.#Jr=null,this.inlineFrameIndex=r||0,this.functionName=s??n.functionName,this.missingDebugInfoDetails=null,this.canBeRestarted=Boolean(n.canBeRestarted),this.exception=i;for(let e=0;e<n.scopeChain.length;++e){const t=new ks(this,e);this.#Xr.push(t),"local"===t.type()&&(this.#Jr=t)}n.functionLocation&&(this.#Yr=Is.fromPayload(e,n.functionLocation)),this.#Zr=n.returnValue?this.debuggerModel.runtimeModel().createRemoteObject(n.returnValue):null}static fromPayloadArray(e,t,n){const r=[];for(let s=0;s<t.length;++s){const i=t[s],o=e.scriptForId(i.location.scriptId);if(o){const t=0===s?n:null;r.push(new Ss(e,o,i,void 0,void 0,t))}}return r}createVirtualCallFrame(e,t){return new Ss(this.debuggerModel,this.script,this.payload,e,t,this.exception)}get id(){return this.payload.callFrameId}scopeChain(){return this.#Xr}localScope(){return this.#Jr}thisObject(){return this.payload.this?this.debuggerModel.runtimeModel().createRemoteObject(this.payload.this):null}returnValue(){return this.#Zr}async setReturnValue(e){if(!this.#Zr)return null;const t=await this.debuggerModel.agent.invoke_evaluateOnCallFrame({callFrameId:this.id,expression:e,silent:!0,objectGroup:"backtrace"});if(t.getError()||t.exceptionDetails)return null;return(await this.debuggerModel.agent.invoke_setReturnValue({newValue:t.result})).getError()?null:(this.#Zr=this.debuggerModel.runtimeModel().createRemoteObject(t.result),this.#Zr)}location(){return this.#$r}functionLocation(){return this.#Yr||null}async evaluate(e){const t=this.debuggerModel,n=t.runtimeModel(),r=t.getEvaluateOnCallFrameCallback();if(r){const t=await r(this,e);if(t)return t}const s=await this.debuggerModel.agent.invoke_evaluateOnCallFrame({callFrameId:this.id,expression:e.expression,objectGroup:e.objectGroup,includeCommandLineAPI:e.includeCommandLineAPI,silent:e.silent,returnByValue:e.returnByValue,generatePreview:e.generatePreview,throwOnSideEffect:e.throwOnSideEffect,timeout:e.timeout}),i=s.getError();return i?{error:i}:{object:n.createRemoteObject(s.result),exceptionDetails:s.exceptionDetails}}async restart(){console.assert(this.canBeRestarted,"This frame can not be restarted."),await this.debuggerModel.agent.invoke_restartFrame({callFrameId:this.id,mode:"StepInto"})}getPayload(){return this.payload}}class ks{#es;#ts;#g;#h;#ns;#rs;#ln;constructor(e,t){this.#es=e,this.#ts=e.getPayload().scopeChain[t],this.#g=this.#ts.type,this.#h=this.#ts.name,this.#ns=t,this.#ln=null;const n=this.#ts.startLocation?Is.fromPayload(e.debuggerModel,this.#ts.startLocation):null,r=this.#ts.endLocation?Is.fromPayload(e.debuggerModel,this.#ts.endLocation):null;n&&r&&n.scriptId===r.scriptId?this.#rs={start:n,end:r}:this.#rs=null}callFrame(){return this.#es}type(){return this.#g}typeName(){switch(this.#g){case"local":return us(cs.local);case"closure":return us(cs.closure);case"catch":return us(cs.catchBlock);case"eval":return n.i18n.lockedString("Eval");case"block":return us(cs.block);case"script":return us(cs.script);case"with":return us(cs.withBlock);case"global":return us(cs.global);case"module":return us(cs.module);case"wasm-expression-stack":return us(cs.expression)}return""}name(){return this.#h}range(){return this.#rs}object(){if(this.#ln)return this.#ln;const e=this.#es.debuggerModel.runtimeModel(),t="with"!==this.#g&&"global"!==this.#g;return this.#ln=t?e.createScopeRemoteObject(this.#ts.object,new Un(this.#ns,this.#es.id)):e.createRemoteObject(this.#ts.object),this.#ln}description(){return"with"!==this.#g&&"global"!==this.#g?"":this.#ts.object.description||""}icon(){}extraProperties(){if(0!==this.#ns||"local"!==this.#g||this.#es.script.isWasm())return[];const e=[],t=this.#es.exception;t&&e.push(new qn(us(cs.exception),t,void 0,void 0,void 0,void 0,void 0,!0));const n=this.#es.returnValue();return n&&e.push(new qn(us(cs.returnValue),n,void 0,void 0,void 0,void 0,void 0,!0,this.#es.setReturnValue.bind(this.#es))),e}}class Cs{debuggerModel;callFrames;reason;auxData;breakpointIds;asyncStackTrace;asyncStackTraceId;constructor(e,t,n,r,s,i,o){this.debuggerModel=e,this.reason=n,this.auxData=r,this.breakpointIds=s,i&&(this.asyncStackTrace=this.cleanRedundantFrames(i)),this.asyncStackTraceId=o,this.callFrames=Ss.fromPayloadArray(e,t,this.exception())}exception(){return"exception"!==this.reason&&"promiseRejection"!==this.reason?null:this.debuggerModel.runtimeModel().createRemoteObject(this.auxData)}cleanRedundantFrames(e){let t=e,n=null;for(;t;)n&&!t.callFrames.length?n.parent=t.parent:n=t,t=t.parent;return e}}h.register(ms,{capabilities:4,autostart:!0});const xs="debugger://logpoint",Rs="debugger://breakpoint";var Ts=Object.freeze({__proto__:null,BreakLocation:ws,COND_BREAKPOINT_SOURCE_URL:Rs,CallFrame:Ss,DebuggerModel:ms,DebuggerPausedDetails:Cs,get Events(){return ys},LOGPOINT_SOURCE_URL:xs,Location:Is,get PauseOnExceptionsState(){return bs},Scope:ks,WASM_SYMBOLS_PRIORITY:ps,sortAndMergeRanges:gs});class Ms{#ss;#is;constructor(){const t="rgba";this.#ss=[new e.Color.Legacy([.9607843137254902,.592156862745098,.5803921568627451,1],t),new e.Color.Legacy([.9411764705882353,.7490196078431373,.2980392156862745,1],t),new e.Color.Legacy([.8313725490196079,.9294117647058824,.19215686274509805,1],t),new e.Color.Legacy([.6196078431372549,.9215686274509803,.2784313725490196,1],t),new e.Color.Legacy([.3568627450980392,.8196078431372549,.8431372549019608,1],t),new e.Color.Legacy([.7372549019607844,.807843137254902,.984313725490196,1],t),new e.Color.Legacy([.7764705882352941,.7450980392156863,.9333333333333333,1],t),new e.Color.Legacy([.8156862745098039,.5803921568627451,.9176470588235294,1],t),new e.Color.Legacy([.9215686274509803,.5803921568627451,.8117647058823529,1],t)],this.#is=0}next(){const e=this.#ss[this.#is];return this.#is++,this.#is>=this.#ss.length&&(this.#is=0),e}}var Ps=Object.freeze({__proto__:null,OverlayColorGenerator:Ms});class Es{#os;#ss=new Map;#as=e.Settings.Settings.instance().createLocalSetting("persistent-highlight-setting",[]);#ls=new Map;#ds=new Map;#cs=new Map;#hs=new Map;#us=new Map;#gs=new Ms;#ps=new Ms;#ms=e.Settings.Settings.instance().moduleSetting("show-grid-line-labels");#fs=e.Settings.Settings.instance().moduleSetting("extend-grid-lines");#bs=e.Settings.Settings.instance().moduleSetting("show-grid-areas");#ys=e.Settings.Settings.instance().moduleSetting("show-grid-track-sizes");#vs;constructor(e,t){this.#os=e,this.#vs=t,this.#ms.addChangeListener(this.onSettingChange,this),this.#fs.addChangeListener(this.onSettingChange,this),this.#bs.addChangeListener(this.onSettingChange,this),this.#ys.addChangeListener(this.onSettingChange,this)}onSettingChange(){this.resetOverlay()}buildGridHighlightConfig(e){const t=this.colorOfGrid(e).asLegacyColor(),n=t.setAlpha(.1).asLegacyColor(),r=t.setAlpha(.3).asLegacyColor(),s=t.setAlpha(.8).asLegacyColor(),i=this.#fs.get(),o="lineNumbers"===this.#ms.get(),a=o,l="lineNames"===this.#ms.get();return{rowGapColor:r.toProtocolRGBA(),rowHatchColor:s.toProtocolRGBA(),columnGapColor:r.toProtocolRGBA(),columnHatchColor:s.toProtocolRGBA(),gridBorderColor:t.toProtocolRGBA(),gridBorderDash:!1,rowLineColor:t.toProtocolRGBA(),columnLineColor:t.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showGridExtensionLines:i,showPositiveLineNumbers:o,showNegativeLineNumbers:a,showLineNames:l,showAreaNames:this.#bs.get(),showTrackSizes:this.#ys.get(),areaBorderColor:t.toProtocolRGBA(),gridBackgroundColor:n.toProtocolRGBA()}}buildFlexContainerHighlightConfig(e){const t=this.colorOfFlex(e).asLegacyColor();return{containerBorder:{color:t.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:t.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:t.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:t.toProtocolRGBA()},crossDistributedSpace:{hatchColor:t.toProtocolRGBA()}}}buildScrollSnapContainerHighlightConfig(t){return{snapAreaBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),pattern:"dashed"},snapportBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA()},scrollMarginColor:e.Color.PageHighlight.Margin.toProtocolRGBA(),scrollPaddingColor:e.Color.PageHighlight.Padding.toProtocolRGBA()}}highlightGridInOverlay(e){this.#ls.set(e,this.buildGridHighlightConfig(e)),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#vs.onGridOverlayStateChanged({nodeId:e,enabled:!0})}isGridHighlighted(e){return this.#ls.has(e)}colorOfGrid(e){let t=this.#ss.get(e);return t||(t=this.#gs.next(),this.#ss.set(e,t)),t}setColorOfGrid(e,t){this.#ss.set(e,t)}hideGridInOverlay(e){this.#ls.has(e)&&(this.#ls.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#vs.onGridOverlayStateChanged({nodeId:e,enabled:!1}))}highlightScrollSnapInOverlay(e){this.#ds.set(e,this.buildScrollSnapContainerHighlightConfig(e)),this.updateHighlightsInOverlay(),this.#vs.onScrollSnapOverlayStateChanged({nodeId:e,enabled:!0}),this.savePersistentHighlightSetting()}isScrollSnapHighlighted(e){return this.#ds.has(e)}hideScrollSnapInOverlay(e){this.#ds.has(e)&&(this.#ds.delete(e),this.updateHighlightsInOverlay(),this.#vs.onScrollSnapOverlayStateChanged({nodeId:e,enabled:!1}),this.savePersistentHighlightSetting())}highlightFlexInOverlay(e){this.#cs.set(e,this.buildFlexContainerHighlightConfig(e)),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#vs.onFlexOverlayStateChanged({nodeId:e,enabled:!0})}isFlexHighlighted(e){return this.#cs.has(e)}colorOfFlex(e){let t=this.#ss.get(e);return t||(t=this.#ps.next(),this.#ss.set(e,t)),t}setColorOfFlex(e,t){this.#ss.set(e,t)}hideFlexInOverlay(e){this.#cs.has(e)&&(this.#cs.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#vs.onFlexOverlayStateChanged({nodeId:e,enabled:!1}))}highlightContainerQueryInOverlay(e){this.#hs.set(e,this.buildContainerQueryContainerHighlightConfig()),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#vs.onContainerQueryOverlayStateChanged({nodeId:e,enabled:!0})}hideContainerQueryInOverlay(e){this.#hs.has(e)&&(this.#hs.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#vs.onContainerQueryOverlayStateChanged({nodeId:e,enabled:!1}))}isContainerQueryHighlighted(e){return this.#hs.has(e)}buildContainerQueryContainerHighlightConfig(){return{containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},descendantBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}}highlightIsolatedElementInOverlay(e){this.#us.set(e,this.buildIsolationModeHighlightConfig()),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting()}hideIsolatedElementInOverlay(e){this.#us.has(e)&&(this.#us.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting())}isIsolatedElementHighlighted(e){return this.#us.has(e)}buildIsolationModeHighlightConfig(){return{resizerColor:e.Color.IsolationModeHighlight.Resizer.toProtocolRGBA(),resizerHandleColor:e.Color.IsolationModeHighlight.ResizerHandle.toProtocolRGBA(),maskColor:e.Color.IsolationModeHighlight.Mask.toProtocolRGBA()}}hideAllInOverlayWithoutSave(){this.#cs.clear(),this.#ls.clear(),this.#ds.clear(),this.#hs.clear(),this.#us.clear(),this.updateHighlightsInOverlay()}refreshHighlights(){const e=this.updateHighlightsForDeletedNodes(this.#ls),t=this.updateHighlightsForDeletedNodes(this.#cs),n=this.updateHighlightsForDeletedNodes(this.#ds),r=this.updateHighlightsForDeletedNodes(this.#hs),s=this.updateHighlightsForDeletedNodes(this.#us);(t||e||n||r||s)&&(this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting())}updateHighlightsForDeletedNodes(e){let t=!1;for(const n of e.keys())null===this.#os.getDOMModel().nodeForId(n)&&(e.delete(n),t=!0);return t}resetOverlay(){for(const e of this.#ls.keys())this.#ls.set(e,this.buildGridHighlightConfig(e));for(const e of this.#cs.keys())this.#cs.set(e,this.buildFlexContainerHighlightConfig(e));for(const e of this.#ds.keys())this.#ds.set(e,this.buildScrollSnapContainerHighlightConfig(e));for(const e of this.#hs.keys())this.#hs.set(e,this.buildContainerQueryContainerHighlightConfig());for(const e of this.#us.keys())this.#us.set(e,this.buildIsolationModeHighlightConfig());this.updateHighlightsInOverlay()}updateHighlightsInOverlay(){const e=this.#ls.size>0||this.#cs.size>0||this.#hs.size>0||this.#us.size>0;this.#os.setShowViewportSizeOnResize(!e),this.updateGridHighlightsInOverlay(),this.updateFlexHighlightsInOverlay(),this.updateScrollSnapHighlightsInOverlay(),this.updateContainerQueryHighlightsInOverlay(),this.updateIsolatedElementHighlightsInOverlay()}updateGridHighlightsInOverlay(){const e=this.#os,t=[];for(const[e,n]of this.#ls.entries())t.push({nodeId:e,gridHighlightConfig:n});e.target().overlayAgent().invoke_setShowGridOverlays({gridNodeHighlightConfigs:t})}updateFlexHighlightsInOverlay(){const e=this.#os,t=[];for(const[e,n]of this.#cs.entries())t.push({nodeId:e,flexContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowFlexOverlays({flexNodeHighlightConfigs:t})}updateScrollSnapHighlightsInOverlay(){const e=this.#os,t=[];for(const[e,n]of this.#ds.entries())t.push({nodeId:e,scrollSnapContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowScrollSnapOverlays({scrollSnapHighlightConfigs:t})}updateContainerQueryHighlightsInOverlay(){const e=this.#os,t=[];for(const[e,n]of this.#hs.entries())t.push({nodeId:e,containerQueryContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowContainerQueryOverlays({containerQueryHighlightConfigs:t})}updateIsolatedElementHighlightsInOverlay(){const e=this.#os,t=[];for(const[e,n]of this.#us.entries())t.push({nodeId:e,isolationModeHighlightConfig:n});e.target().overlayAgent().invoke_setShowIsolatedElements({isolatedElementHighlightConfigs:t})}async restoreHighlightsForDocument(){this.#cs=new Map,this.#ls=new Map,this.#ds=new Map,this.#hs=new Map,this.#us=new Map;const e=await this.#os.getDOMModel().requestDocument(),t=e?e.documentURL:r.DevToolsPath.EmptyUrlString;await Promise.all(this.#as.get().map((async e=>{if(e.url===t)return await this.#os.getDOMModel().pushNodeByPathToFrontend(e.path).then((t=>{const n=this.#os.getDOMModel().nodeForId(t);if(n)switch(e.type){case"GRID":this.#ls.set(n.id,this.buildGridHighlightConfig(n.id)),this.#vs.onGridOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"FLEX":this.#cs.set(n.id,this.buildFlexContainerHighlightConfig(n.id)),this.#vs.onFlexOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"CONTAINER_QUERY":this.#hs.set(n.id,this.buildContainerQueryContainerHighlightConfig()),this.#vs.onContainerQueryOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"SCROLL_SNAP":this.#ds.set(n.id,this.buildScrollSnapContainerHighlightConfig(n.id)),this.#vs.onScrollSnapOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"ISOLATED_ELEMENT":this.#us.set(n.id,this.buildIsolationModeHighlightConfig())}}))}))),this.updateHighlightsInOverlay()}currentUrl(){const e=this.#os.getDOMModel().existingDocument();return e?e.documentURL:r.DevToolsPath.EmptyUrlString}getPersistentHighlightSettingForOneType(e,t){const n=[];for(const r of e.keys()){const e=this.#os.getDOMModel().nodeForId(r);e&&n.push({url:this.currentUrl(),path:e.path(),type:t})}return n}savePersistentHighlightSetting(){const e=this.currentUrl(),t=[...this.#as.get().filter((t=>t.url!==e)),...this.getPersistentHighlightSettingForOneType(this.#ls,"GRID"),...this.getPersistentHighlightSettingForOneType(this.#cs,"FLEX"),...this.getPersistentHighlightSettingForOneType(this.#hs,"CONTAINER_QUERY"),...this.getPersistentHighlightSettingForOneType(this.#ds,"SCROLL_SNAP"),...this.getPersistentHighlightSettingForOneType(this.#us,"ISOLATED_ELEMENT")];this.#as.set(t)}}var Ls=Object.freeze({__proto__:null,OverlayPersistentHighlighter:Es});const As={pausedInDebugger:"Paused in debugger"},Os=n.i18n.registerUIStrings("core/sdk/OverlayModel.ts",As),Ds=n.i18n.getLocalizedString.bind(void 0,Os),Ns={mac:{x:85,y:0,width:185,height:40},linux:{x:0,y:0,width:196,height:34},windows:{x:0,y:0,width:238,height:33}};class Fs extends h{#Yn;overlayAgent;#Qr;#Is=!1;#ws=null;#Ss;#ks;#Cs;#xs;#Rs;#Ts;#Ms;#Ps;#Es=[];#Ls=!0;#As;#Os;#Ds=!1;#Ns;constructor(t){super(t),this.#Yn=t.model(Gs),t.registerOverlayDispatcher(this),this.overlayAgent=t.overlayAgent(),this.#Qr=t.model(ms),this.#Qr&&(e.Settings.Settings.instance().moduleSetting("disable-paused-state-overlay").addChangeListener(this.updatePausedInDebuggerMessage,this),this.#Qr.addEventListener(ys.DebuggerPaused,this.updatePausedInDebuggerMessage,this),this.#Qr.addEventListener(ys.DebuggerResumed,this.updatePausedInDebuggerMessage,this),this.#Qr.addEventListener(ys.GlobalObjectCleared,this.updatePausedInDebuggerMessage,this)),this.#Ss=new _s(this),this.#ks=this.#Ss,this.#Cs=e.Settings.Settings.instance().moduleSetting("show-paint-rects"),this.#xs=e.Settings.Settings.instance().moduleSetting("show-layout-shift-regions"),this.#Rs=e.Settings.Settings.instance().moduleSetting("show-ad-highlights"),this.#Ts=e.Settings.Settings.instance().moduleSetting("show-debug-borders"),this.#Ms=e.Settings.Settings.instance().moduleSetting("show-fps-counter"),this.#Ps=e.Settings.Settings.instance().moduleSetting("show-scroll-bottleneck-rects"),t.suspended()||(this.overlayAgent.invoke_enable(),this.wireAgentToSettings()),this.#As=new Es(this,{onGridOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentGridOverlayStateChanged",{nodeId:e,enabled:t}),onFlexOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentFlexContainerOverlayStateChanged",{nodeId:e,enabled:t}),onContainerQueryOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentContainerQueryOverlayStateChanged",{nodeId:e,enabled:t}),onScrollSnapOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentScrollSnapOverlayStateChanged",{nodeId:e,enabled:t})}),this.#Yn.addEventListener(Us.NodeRemoved,(()=>{this.#As&&this.#As.refreshHighlights()})),this.#Yn.addEventListener(Us.DocumentUpdated,(()=>{this.#As&&(this.#As.hideAllInOverlayWithoutSave(),t.suspended()||this.#As.restoreHighlightsForDocument())})),this.#Os=new Hs(this),this.#Ns=new Bs(this.#Yn.cssModel())}static highlightObjectAsDOMNode(e){const t=e.runtimeModel().target().model(Gs);t&&t.overlayModel().highlightInOverlay({object:e,selectorList:void 0})}static hideDOMNodeHighlight(){for(const e of W.instance().models(Fs))e.delayedHideHighlight(0)}static async muteHighlight(){return await Promise.all(W.instance().models(Fs).map((e=>e.suspendModel())))}static async unmuteHighlight(){return await Promise.all(W.instance().models(Fs).map((e=>e.resumeModel())))}static highlightRect(e){for(const t of W.instance().models(Fs))t.highlightRect(e)}static clearHighlight(){for(const e of W.instance().models(Fs))e.clearHighlight()}getDOMModel(){return this.#Yn}highlightRect({x:e,y:t,width:n,height:r,color:s,outlineColor:i}){const o=s||{r:255,g:0,b:255,a:.3},a=i||{r:255,g:0,b:255,a:.5};return this.overlayAgent.invoke_highlightRect({x:e,y:t,width:n,height:r,color:o,outlineColor:a})}clearHighlight(){return this.overlayAgent.invoke_hideHighlight()}async wireAgentToSettings(){this.#Es=[this.#Cs.addChangeListener((()=>this.overlayAgent.invoke_setShowPaintRects({result:this.#Cs.get()}))),this.#xs.addChangeListener((()=>this.overlayAgent.invoke_setShowLayoutShiftRegions({result:this.#xs.get()}))),this.#Rs.addChangeListener((()=>this.overlayAgent.invoke_setShowAdHighlights({show:this.#Rs.get()}))),this.#Ts.addChangeListener((()=>this.overlayAgent.invoke_setShowDebugBorders({show:this.#Ts.get()}))),this.#Ms.addChangeListener((()=>this.overlayAgent.invoke_setShowFPSCounter({show:this.#Ms.get()}))),this.#Ps.addChangeListener((()=>this.overlayAgent.invoke_setShowScrollBottleneckRects({show:this.#Ps.get()})))],this.#Cs.get()&&this.overlayAgent.invoke_setShowPaintRects({result:!0}),this.#xs.get()&&this.overlayAgent.invoke_setShowLayoutShiftRegions({result:!0}),this.#Rs.get()&&this.overlayAgent.invoke_setShowAdHighlights({show:!0}),this.#Ts.get()&&this.overlayAgent.invoke_setShowDebugBorders({show:!0}),this.#Ms.get()&&this.overlayAgent.invoke_setShowFPSCounter({show:!0}),this.#Ps.get()&&this.overlayAgent.invoke_setShowScrollBottleneckRects({show:!0}),this.#Qr&&this.#Qr.isPaused()&&this.updatePausedInDebuggerMessage(),await this.overlayAgent.invoke_setShowViewportSizeOnResize({show:this.#Ls}),this.#As?.resetOverlay()}async suspendModel(){e.EventTarget.removeEventListeners(this.#Es),await this.overlayAgent.invoke_disable()}async resumeModel(){await Promise.all([this.overlayAgent.invoke_enable(),this.wireAgentToSettings()])}setShowViewportSizeOnResize(e){this.#Ls!==e&&(this.#Ls=e,this.target().suspended()||this.overlayAgent.invoke_setShowViewportSizeOnResize({show:e}))}updatePausedInDebuggerMessage(){if(this.target().suspended())return;const t=this.#Qr&&this.#Qr.isPaused()&&!e.Settings.Settings.instance().moduleSetting("disable-paused-state-overlay").get()?Ds(As.pausedInDebugger):void 0;this.overlayAgent.invoke_setPausedInDebuggerMessage({message:t})}setHighlighter(e){this.#ks=e||this.#Ss}async setInspectMode(e,t=!0){await this.#Yn.requestDocument(),this.#Is="none"!==e,this.dispatchEventToListeners("InspectModeWillBeToggled",this),this.#ks.setInspectMode(e,this.buildHighlightConfig("all",t))}inspectModeEnabled(){return this.#Is}highlightInOverlay(e,t,n){if(this.#Ds)return;this.#ws&&(clearTimeout(this.#ws),this.#ws=null);const r=this.buildHighlightConfig(t);void 0!==n&&(r.showInfo=n),this.#ks.highlightInOverlay(e,r)}highlightInOverlayForTwoSeconds(e){this.highlightInOverlay(e),this.delayedHideHighlight(2e3)}highlightGridInPersistentOverlay(e){this.#As&&this.#As.highlightGridInOverlay(e)}isHighlightedGridInPersistentOverlay(e){return!!this.#As&&this.#As.isGridHighlighted(e)}hideGridInPersistentOverlay(e){this.#As&&this.#As.hideGridInOverlay(e)}highlightScrollSnapInPersistentOverlay(e){this.#As&&this.#As.highlightScrollSnapInOverlay(e)}isHighlightedScrollSnapInPersistentOverlay(e){return!!this.#As&&this.#As.isScrollSnapHighlighted(e)}hideScrollSnapInPersistentOverlay(e){this.#As&&this.#As.hideScrollSnapInOverlay(e)}highlightFlexContainerInPersistentOverlay(e){this.#As&&this.#As.highlightFlexInOverlay(e)}isHighlightedFlexContainerInPersistentOverlay(e){return!!this.#As&&this.#As.isFlexHighlighted(e)}hideFlexContainerInPersistentOverlay(e){this.#As&&this.#As.hideFlexInOverlay(e)}highlightContainerQueryInPersistentOverlay(e){this.#As&&this.#As.highlightContainerQueryInOverlay(e)}isHighlightedContainerQueryInPersistentOverlay(e){return!!this.#As&&this.#As.isContainerQueryHighlighted(e)}hideContainerQueryInPersistentOverlay(e){this.#As&&this.#As.hideContainerQueryInOverlay(e)}highlightSourceOrderInOverlay(t){const n={parentOutlineColor:e.Color.SourceOrderHighlight.ParentOutline.toProtocolRGBA(),childOutlineColor:e.Color.SourceOrderHighlight.ChildOutline.toProtocolRGBA()};this.#Os.highlightSourceOrderInOverlay(t,n)}colorOfGridInPersistentOverlay(e){return this.#As?this.#As.colorOfGrid(e).asString("hex"):null}setColorOfGridInPersistentOverlay(t,n){if(!this.#As)return;const r=e.Color.parse(n);r&&(this.#As.setColorOfGrid(t,r),this.#As.resetOverlay())}colorOfFlexInPersistentOverlay(e){return this.#As?this.#As.colorOfFlex(e).asString("hex"):null}setColorOfFlexInPersistentOverlay(t,n){if(!this.#As)return;const r=e.Color.parse(n);r&&(this.#As.setColorOfFlex(t,r),this.#As.resetOverlay())}hideSourceOrderInOverlay(){this.#Os.hideSourceOrderHighlight()}setSourceOrderActive(e){this.#Ds=e}sourceOrderModeActive(){return this.#Ds}delayedHideHighlight(e){null===this.#ws&&(this.#ws=window.setTimeout((()=>this.highlightInOverlay({clear:!0})),e))}highlightFrame(e){this.#ws&&(clearTimeout(this.#ws),this.#ws=null),this.#ks.highlightFrame(e)}showHingeForDualScreen(e){if(e){const{x:t,y:n,width:r,height:s,contentColor:i,outlineColor:o}=e;this.overlayAgent.invoke_setShowHinge({hingeConfig:{rect:{x:t,y:n,width:r,height:s},contentColor:i,outlineColor:o}})}else this.overlayAgent.invoke_setShowHinge({})}setWindowControlsPlatform(e){this.#Ns.selectedPlatform=e}setWindowControlsThemeColor(e){this.#Ns.themeColor=e}getWindowControlsConfig(){return this.#Ns.config}async toggleWindowControlsToolbar(e){const t=e?{windowControlsOverlayConfig:this.#Ns.config}:{},n=this.overlayAgent.invoke_setShowWindowControlsOverlay(t),r=this.#Ns.toggleEmulatedOverlay(e);await Promise.all([n,r]),this.setShowViewportSizeOnResize(!e)}buildHighlightConfig(t="all",n=!1){const r=e.Settings.Settings.instance().moduleSetting("show-metrics-rulers").get(),s={showInfo:"all"===t||"container-outline"===t,showRulers:r,showStyles:n,showAccessibilityInfo:n,showExtensionLines:r,gridHighlightConfig:{},flexContainerHighlightConfig:{},flexItemHighlightConfig:{},contrastAlgorithm:o.Runtime.experiments.isEnabled("apca")?"apca":"aa"};return"all"!==t&&"content"!==t||(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA()),"all"!==t&&"padding"!==t||(s.paddingColor=e.Color.PageHighlight.Padding.toProtocolRGBA()),"all"!==t&&"border"!==t||(s.borderColor=e.Color.PageHighlight.Border.toProtocolRGBA()),"all"!==t&&"margin"!==t||(s.marginColor=e.Color.PageHighlight.Margin.toProtocolRGBA()),"all"===t&&(s.eventTargetColor=e.Color.PageHighlight.EventTarget.toProtocolRGBA(),s.shapeColor=e.Color.PageHighlight.Shape.toProtocolRGBA(),s.shapeMarginColor=e.Color.PageHighlight.ShapeMargin.toProtocolRGBA(),s.gridHighlightConfig={rowGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),rowHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),columnGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),columnHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0},s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},rowGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},columnGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}},s.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),t.endsWith("gap")&&(s.gridHighlightConfig={gridBorderColor:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),gridBorderDash:!0},"gap"!==t&&"row-gap"!==t||(s.gridHighlightConfig.rowGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),s.gridHighlightConfig.rowHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA()),"gap"!==t&&"column-gap"!==t||(s.gridHighlightConfig.columnGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),s.gridHighlightConfig.columnHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA())),t.endsWith("gap")&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}},"gap"!==t&&"row-gap"!==t||(s.flexContainerHighlightConfig.rowGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}),"gap"!==t&&"column-gap"!==t||(s.flexContainerHighlightConfig.columnGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()})),"grid-areas"===t&&(s.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showAreaNames:!0,areaBorderColor:e.Color.PageHighlight.GridAreaBorder.toProtocolRGBA()}),"grid-template-columns"===t&&(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),s.gridHighlightConfig={columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineDash:!0}),"grid-template-rows"===t&&(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),s.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0}),"justify-content"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-content"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-items"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossAlignment:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"flexibility"===t&&(s.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"container-outline"===t&&(s.containerQueryContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}),s}nodeHighlightRequested({nodeId:e}){const t=this.#Yn.nodeForId(e);t&&this.dispatchEventToListeners("HighlightNodeRequested",t)}static setInspectNodeHandler(e){Fs.inspectNodeHandler=e}inspectNodeRequested({backendNodeId:t}){const n=new js(this.target(),t);Fs.inspectNodeHandler?n.resolvePromise().then((e=>{e&&Fs.inspectNodeHandler&&Fs.inspectNodeHandler(e)})):e.Revealer.reveal(n),this.dispatchEventToListeners("InspectModeExited")}screenshotRequested({viewport:e}){this.dispatchEventToListeners("ScreenshotRequested",e),this.dispatchEventToListeners("InspectModeExited")}inspectModeCanceled(){this.dispatchEventToListeners("InspectModeExited")}static inspectNodeHandler=null;getOverlayAgent(){return this.overlayAgent}async hasStyleSheetText(e){return await this.#Ns.initializeStyleSheetText(e)}}class Bs{#lt;#Fs;#Bs;#_s;#Hs={showCSS:!1,selectedPlatform:"Windows",themeColor:"#ffffff"};constructor(e){this.#lt=e}get selectedPlatform(){return this.#Hs.selectedPlatform}set selectedPlatform(e){this.#Hs.selectedPlatform=e}get themeColor(){return this.#Hs.themeColor}set themeColor(e){this.#Hs.themeColor=e}get config(){return this.#Hs}async initializeStyleSheetText(e){if(this.#Fs&&e===this.#_s)return!0;const t=this.#Us(e);if(!t)return!1;if(this.#Bs=this.#qs(t),!this.#Bs)return!1;const n=await this.#lt.getStyleSheetText(this.#Bs);return!!n&&(this.#Fs=n,this.#_s=e,!0)}async toggleEmulatedOverlay(e){if(this.#Bs&&this.#Fs)if(e){const e=Bs.#zs(this.#Hs.selectedPlatform.toLowerCase(),this.#Fs);e&&await this.#lt.setStyleSheetText(this.#Bs,e,!1)}else await this.#lt.setStyleSheetText(this.#Bs,this.#Fs,!1)}static#zs(e,t){const n=Ns[e];return Bs.#js(n.x,n.y,n.width,n.height,t)}#Us(t){const n=e.ParsedURL.ParsedURL.extractOrigin(t),r=this.#lt.styleSheetHeaders().find((e=>e.sourceURL&&e.sourceURL.includes(n)));return r?.sourceURL}#qs(e){const t=this.#lt.getStyleSheetIdsForURL(e);return t.length>0?t[0]:void 0}static#js(e,t,n,r,s){if(!s)return;return s.replace(/: env\(titlebar-area-x(?:,[^)]*)?\);/g,`: env(titlebar-area-x, ${e}px);`).replace(/: env\(titlebar-area-y(?:,[^)]*)?\);/g,`: env(titlebar-area-y, ${t}px);`).replace(/: env\(titlebar-area-width(?:,[^)]*)?\);/g,`: env(titlebar-area-width, calc(100% - ${n}px));`).replace(/: env\(titlebar-area-height(?:,[^)]*)?\);/g,`: env(titlebar-area-height, ${r}px);`)}transformStyleSheetforTesting(e,t,n,r,s){return Bs.#js(e,t,n,r,s)}}class _s{#os;constructor(e){this.#os=e}highlightInOverlay(e,t){const{node:n,deferredNode:r,object:s,selectorList:i}={node:void 0,deferredNode:void 0,object:void 0,selectorList:void 0,...e},o=n?n.id:void 0,a=r?r.backendNodeId():void 0,l=s?s.objectId:void 0;o||a||l?this.#os.target().overlayAgent().invoke_highlightNode({highlightConfig:t,nodeId:o,backendNodeId:a,objectId:l,selector:i}):this.#os.target().overlayAgent().invoke_hideHighlight()}async setInspectMode(e,t){await this.#os.target().overlayAgent().invoke_setInspectMode({mode:e,highlightConfig:t})}highlightFrame(t){this.#os.target().overlayAgent().invoke_highlightFrame({frameId:t,contentColor:e.Color.PageHighlight.Content.toProtocolRGBA(),contentOutlineColor:e.Color.PageHighlight.ContentOutline.toProtocolRGBA()})}}class Hs{#os;constructor(e){this.#os=e}highlightSourceOrderInOverlay(e,t){this.#os.setSourceOrderActive(!0),this.#os.setShowViewportSizeOnResize(!1),this.#os.getOverlayAgent().invoke_highlightSourceOrder({sourceOrderConfig:t,nodeId:e.id})}hideSourceOrderHighlight(){this.#os.setSourceOrderActive(!1),this.#os.setShowViewportSizeOnResize(!0),this.#os.clearHighlight()}}h.register(Fs,{capabilities:2,autostart:!0});var Us,qs=Object.freeze({__proto__:null,OverlayModel:Fs,SourceOrderHighlighter:Hs,WindowControls:Bs});class zs{#Vs;#Ws;ownerDocument;#Gs;id;index=void 0;#Ks;#Qs;#$s;#Xs;nodeValueInternal;#Js;#Ys;#Zs;#ei;#ti;#ni;#ri;#si=null;#ii=new Map;#oi=[];assignedSlot=null;shadowRootsInternal=[];#ai=new Map;#li=new Map;#di=0;childNodeCountInternal;childrenInternal=null;nextSibling=null;previousSibling=null;firstChild=null;lastChild=null;parentNode=null;templateContentInternal;contentDocumentInternal;childDocumentPromiseForTesting;#ci;publicId;systemId;internalSubset;name;value;constructor(e){this.#Vs=e,this.#Ws=this.#Vs.getAgent()}static create(e,t,n,r){const s=new zs(e);return s.init(t,n,r),s}init(e,t,n){if(this.#Ws=this.#Vs.getAgent(),this.ownerDocument=e,this.#Gs=t,this.id=n.nodeId,this.#Ks=n.backendNodeId,this.#Vs.registerNode(this),this.#Qs=n.nodeType,this.#$s=n.nodeName,this.#Xs=n.localName,this.nodeValueInternal=n.nodeValue,this.#Js=n.pseudoType,this.#Ys=n.pseudoIdentifier,this.#Zs=n.shadowRootType,this.#ei=n.frameId||null,this.#ti=n.xmlVersion,this.#ni=Boolean(n.isSVG),this.#ri=Boolean(n.isScrollable),n.attributes&&this.setAttributesPayload(n.attributes),this.childNodeCountInternal=n.childNodeCount||0,n.shadowRoots)for(let e=0;e<n.shadowRoots.length;++e){const t=n.shadowRoots[e],r=zs.create(this.#Vs,this.ownerDocument,!0,t);this.shadowRootsInternal.push(r),r.parentNode=this}n.templateContent&&(this.templateContentInternal=zs.create(this.#Vs,this.ownerDocument,!0,n.templateContent),this.templateContentInternal.parentNode=this,this.childrenInternal=[]);const r=new Set(["EMBED","IFRAME","OBJECT","FENCEDFRAME"]);n.contentDocument?(this.contentDocumentInternal=new Ws(this.#Vs,n.contentDocument),this.contentDocumentInternal.parentNode=this,this.childrenInternal=[]):n.frameId&&r.has(n.nodeName)&&(this.childDocumentPromiseForTesting=this.requestChildDocument(n.frameId,this.#Vs.target()),this.childrenInternal=[]),n.importedDocument&&(this.#ci=zs.create(this.#Vs,this.ownerDocument,!0,n.importedDocument),this.#ci.parentNode=this,this.childrenInternal=[]),n.distributedNodes&&this.setDistributedNodePayloads(n.distributedNodes),n.assignedSlot&&this.setAssignedSlot(n.assignedSlot),n.children&&this.setChildrenPayload(n.children),this.setPseudoElements(n.pseudoElements),this.#Qs===Node.ELEMENT_NODE?(this.ownerDocument&&!this.ownerDocument.documentElement&&"HTML"===this.#$s&&(this.ownerDocument.documentElement=this),this.ownerDocument&&!this.ownerDocument.body&&"BODY"===this.#$s&&(this.ownerDocument.body=this)):this.#Qs===Node.DOCUMENT_TYPE_NODE?(this.publicId=n.publicId,this.systemId=n.systemId,this.internalSubset=n.internalSubset):this.#Qs===Node.ATTRIBUTE_NODE&&(this.name=n.name,this.value=n.value)}async requestChildDocument(e,t){const n=await Nn.instance().getOrWaitForFrame(e,t),r=n.resourceTreeModel()?.target().model(Gs);return await(r?.requestDocument()||null)}isAdFrameNode(){if(this.isIframe()&&this.#ei){const e=Nn.instance().getFrame(this.#ei);return!!e&&"none"!==e.adFrameType()}return!1}isSVGNode(){return this.#ni}isScrollable(){return this.#ri}isMediaNode(){return"AUDIO"===this.#$s||"VIDEO"===this.#$s}isViewTransitionPseudoNode(){return!!this.#Js&&["view-transition","view-transition-group","view-transition-image-pair","view-transition-old","view-transition-new"].includes(this.#Js)}creationStackTrace(){if(this.#si)return this.#si;const e=this.#Ws.invoke_getNodeStackTraces({nodeId:this.id});return this.#si=e.then((e=>e.creation||null)),this.#si}get subtreeMarkerCount(){return this.#di}domModel(){return this.#Vs}backendNodeId(){return this.#Ks}children(){return this.childrenInternal?this.childrenInternal.slice():null}setChildren(e){this.childrenInternal=e}setIsScrollable(e){this.#ri=e}hasAttributes(){return this.#ai.size>0}childNodeCount(){return this.childNodeCountInternal}setChildNodeCount(e){this.childNodeCountInternal=e}shadowRoots(){return this.shadowRootsInternal.slice()}templateContent(){return this.templateContentInternal||null}contentDocument(){return this.contentDocumentInternal||null}setContentDocument(e){this.contentDocumentInternal=e}isIframe(){return"IFRAME"===this.#$s}importedDocument(){return this.#ci||null}nodeType(){return this.#Qs}nodeName(){return this.#$s}pseudoType(){return this.#Js}pseudoIdentifier(){return this.#Ys}hasPseudoElements(){return this.#ii.size>0}pseudoElements(){return this.#ii}checkmarkPseudoElement(){return this.#ii.get("checkmark")?.at(-1)}beforePseudoElement(){return this.#ii.get("before")?.at(-1)}afterPseudoElement(){return this.#ii.get("after")?.at(-1)}pickerIconPseudoElement(){return this.#ii.get("picker-icon")?.at(-1)}markerPseudoElement(){return this.#ii.get("marker")?.at(-1)}backdropPseudoElement(){return this.#ii.get("backdrop")?.at(-1)}viewTransitionPseudoElements(){return[...this.#ii.get("view-transition")||[],...this.#ii.get("view-transition-group")||[],...this.#ii.get("view-transition-image-pair")||[],...this.#ii.get("view-transition-old")||[],...this.#ii.get("view-transition-new")||[]]}carouselPseudoElements(){return[...this.#ii.get("scroll-button")||[],...this.#ii.get("column")||[],...this.#ii.get("scroll-marker")||[],...this.#ii.get("scroll-marker-group")||[]]}hasAssignedSlot(){return null!==this.assignedSlot}isInsertionPoint(){return!this.isXMLNode()&&("SHADOW"===this.#$s||"CONTENT"===this.#$s||"SLOT"===this.#$s)}distributedNodes(){return this.#oi}isInShadowTree(){return this.#Gs}ancestorShadowHost(){const e=this.ancestorShadowRoot();return e?e.parentNode:null}ancestorShadowRoot(){if(!this.#Gs)return null;let e=this;for(;e&&!e.isShadowRoot();)e=e.parentNode;return e}ancestorUserAgentShadowRoot(){const e=this.ancestorShadowRoot();return e&&e.shadowRootType()===zs.ShadowRootTypes.UserAgent?e:null}isShadowRoot(){return Boolean(this.#Zs)}shadowRootType(){return this.#Zs||null}nodeNameInCorrectCase(){const e=this.shadowRootType();return e?"#shadow-root ("+e+")":this.localName()?this.localName().length!==this.nodeName().length?this.nodeName():this.localName():this.nodeName()}setNodeName(e,t){this.#Ws.invoke_setNodeName({nodeId:this.id,name:e}).then((e=>{e.getError()||this.#Vs.markUndoableState(),t&&t(e.getError()||null,this.#Vs.nodeForId(e.nodeId))}))}localName(){return this.#Xs}nodeValue(){return this.nodeValueInternal}setNodeValueInternal(e){this.nodeValueInternal=e}setNodeValue(e,t){this.#Ws.invoke_setNodeValue({nodeId:this.id,value:e}).then((e=>{e.getError()||this.#Vs.markUndoableState(),t&&t(e.getError()||null)}))}getAttribute(e){const t=this.#ai.get(e);return t?t.value:void 0}setAttribute(e,t,n){this.#Ws.invoke_setAttributesAsText({nodeId:this.id,text:t,name:e}).then((e=>{e.getError()||this.#Vs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValue(e,t,n){this.#Ws.invoke_setAttributeValue({nodeId:this.id,name:e,value:t}).then((e=>{e.getError()||this.#Vs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValuePromise(e,t){return new Promise((n=>this.setAttributeValue(e,t,n)))}attributes(){return[...this.#ai.values()]}async removeAttribute(e){(await this.#Ws.invoke_removeAttribute({nodeId:this.id,name:e})).getError()||(this.#ai.delete(e),this.#Vs.markUndoableState())}getChildNodesPromise(){return new Promise((e=>this.getChildNodes((t=>e(t)))))}getChildNodes(e){this.childrenInternal?e(this.children()):this.#Ws.invoke_requestChildNodes({nodeId:this.id}).then((t=>{e(t.getError()?null:this.children())}))}async getSubtree(e,t){return(await this.#Ws.invoke_requestChildNodes({nodeId:this.id,depth:e,pierce:t})).getError()?null:this.childrenInternal}async getOuterHTML(){const{outerHTML:e}=await this.#Ws.invoke_getOuterHTML({nodeId:this.id});return e}setOuterHTML(e,t){this.#Ws.invoke_setOuterHTML({nodeId:this.id,outerHTML:e}).then((e=>{e.getError()||this.#Vs.markUndoableState(),t&&t(e.getError()||null)}))}removeNode(e){return this.#Ws.invoke_removeNode({nodeId:this.id}).then((t=>{t.getError()||this.#Vs.markUndoableState(),e&&e(t.getError()||null)}))}async copyNode(){const{outerHTML:e}=await this.#Ws.invoke_getOuterHTML({nodeId:this.id});return null!==e&&a.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e),e}path(){function e(e){return e.#$s.length?void 0!==e.index?e.index:e.parentNode?e.isShadowRoot()?e.shadowRootType()===zs.ShadowRootTypes.UserAgent?"u":"a":e.nodeType()===Node.DOCUMENT_NODE?"d":null:null:null}const t=[];let n=this;for(;n;){const r=e(n);if(null===r)break;t.push([r,n.#$s]),n=n.parentNode}return t.reverse(),t.join(",")}isAncestor(e){if(!e)return!1;let t=e.parentNode;for(;t;){if(this===t)return!0;t=t.parentNode}return!1}isDescendant(e){return e.isAncestor(this)}frameOwnerFrameId(){return this.#ei}frameId(){let e=this.parentNode||this;for(;!e.#ei&&e.parentNode;)e=e.parentNode;return e.#ei}setAttributesPayload(e){let t=!this.#ai||e.length!==2*this.#ai.size;const n=this.#ai||new Map;this.#ai=new Map;for(let r=0;r<e.length;r+=2){const s=e[r],i=e[r+1];if(this.addAttribute(s,i),t)continue;const o=n.get(s);o&&o.value===i||(t=!0)}return t}insertChild(e,t){if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");const n=zs.create(this.#Vs,this.ownerDocument,this.#Gs,t);return this.childrenInternal.splice(e?this.childrenInternal.indexOf(e)+1:0,0,n),this.renumber(),n}removeChild(e){const t=e.pseudoType();if(t){const n=this.#ii.get(t)?.filter((t=>t!==e));n&&n.length>0?this.#ii.set(t,n):this.#ii.delete(t)}else{const t=this.shadowRootsInternal.indexOf(e);if(-1!==t)this.shadowRootsInternal.splice(t,1);else{if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");if(-1===this.childrenInternal.indexOf(e))throw new Error("DOMNode._children is expected to contain the node to be removed.");this.childrenInternal.splice(this.childrenInternal.indexOf(e),1)}}e.parentNode=null,this.#di-=e.#di,e.#di&&this.#Vs.dispatchEventToListeners(Us.MarkersChanged,this),this.renumber()}setChildrenPayload(e){this.childrenInternal=[];for(let t=0;t<e.length;++t){const n=e[t],r=zs.create(this.#Vs,this.ownerDocument,this.#Gs,n);this.childrenInternal.push(r)}this.renumber()}setPseudoElements(e){if(e)for(let t=0;t<e.length;++t){const n=zs.create(this.#Vs,this.ownerDocument,this.#Gs,e[t]);n.parentNode=this;const r=n.pseudoType();if(!r)throw new Error("DOMNode.pseudoType() is expected to be defined.");const s=this.#ii.get(r);s?s.push(n):this.#ii.set(r,[n])}}setDistributedNodePayloads(e){this.#oi=[];for(const t of e)this.#oi.push(new Vs(this.#Vs.target(),t.backendNodeId,t.nodeType,t.nodeName))}setAssignedSlot(e){this.assignedSlot=new Vs(this.#Vs.target(),e.backendNodeId,e.nodeType,e.nodeName)}renumber(){if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");if(this.childNodeCountInternal=this.childrenInternal.length,0===this.childNodeCountInternal)return this.firstChild=null,void(this.lastChild=null);this.firstChild=this.childrenInternal[0],this.lastChild=this.childrenInternal[this.childNodeCountInternal-1];for(let e=0;e<this.childNodeCountInternal;++e){const t=this.childrenInternal[e];t.index=e,t.nextSibling=e+1<this.childNodeCountInternal?this.childrenInternal[e+1]:null,t.previousSibling=e-1>=0?this.childrenInternal[e-1]:null,t.parentNode=this}}addAttribute(e,t){const n={name:e,value:t,_node:this};this.#ai.set(e,n)}setAttributeInternal(e,t){const n=this.#ai.get(e);n?n.value=t:this.addAttribute(e,t)}removeAttributeInternal(e){this.#ai.delete(e)}copyTo(e,t,n){this.#Ws.invoke_copyTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Vs.markUndoableState(),n&&n(e.getError()||null,this.#Vs.nodeForId(e.nodeId))}))}moveTo(e,t,n){this.#Ws.invoke_moveTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Vs.markUndoableState(),n&&n(e.getError()||null,this.#Vs.nodeForId(e.nodeId))}))}isXMLNode(){return Boolean(this.#ti)}setMarker(e,t){if(null!==t){if(this.parentNode&&!this.#li.has(e))for(let e=this;e;e=e.parentNode)++e.#di;this.#li.set(e,t);for(let e=this;e;e=e.parentNode)this.#Vs.dispatchEventToListeners(Us.MarkersChanged,e)}else{if(!this.#li.has(e))return;this.#li.delete(e);for(let e=this;e;e=e.parentNode)--e.#di;for(let e=this;e;e=e.parentNode)this.#Vs.dispatchEventToListeners(Us.MarkersChanged,e)}}marker(e){return this.#li.get(e)||null}getMarkerKeysForTest(){return[...this.#li.keys()]}traverseMarkers(e){!function t(n){if(n.#di){for(const t of n.#li.keys())e(n,t);if(n.childrenInternal)for(const e of n.childrenInternal)t(e)}}(this)}resolveURL(t){if(!t)return t;for(let n=this;n;n=n.parentNode)if(n instanceof Ws&&n.baseURL)return e.ParsedURL.ParsedURL.completeURL(n.baseURL,t);return null}highlight(e){this.#Vs.overlayModel().highlightInOverlay({node:this,selectorList:void 0},e)}highlightForTwoSeconds(){this.#Vs.overlayModel().highlightInOverlayForTwoSeconds({node:this,selectorList:void 0})}async resolveToObject(e,t){const{object:n}=await this.#Ws.invoke_resolveNode({nodeId:this.id,backendNodeId:void 0,executionContextId:t,objectGroup:e});return n&&this.#Vs.runtimeModelInternal.createRemoteObject(n)||null}async boxModel(){const{model:e}=await this.#Ws.invoke_getBoxModel({nodeId:this.id});return e}async setAsInspectedNode(){let e=this;for(e?.pseudoType()&&(e=e.parentNode);e;){let t=e.ancestorUserAgentShadowRoot();if(!t)break;if(t=e.ancestorShadowHost(),!t)break;e=t}if(!e)throw new Error("In DOMNode.setAsInspectedNode: node is expected to not be null.");await this.#Ws.invoke_setInspectedNode({nodeId:e.id})}enclosingElementOrSelf(){let e=this;return e&&e.nodeType()===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e&&e.nodeType()!==Node.ELEMENT_NODE&&(e=null),e}async callFunction(e,t=[]){const n=await this.resolveToObject();if(!n)return null;const r=await n.callFunction(e,t.map((e=>Bn.toCallArgument(e))));return n.release(),r.wasThrown||!r.object?null:{value:r.object.value}}async scrollIntoView(){const e=this.enclosingElementOrSelf();if(!e)return;await e.callFunction((function(){this.scrollIntoViewIfNeeded(!0)}))&&e.highlightForTwoSeconds()}async focus(){const e=this.enclosingElementOrSelf();if(!e)throw new Error("DOMNode.focus expects node to not be null.");await e.callFunction((function(){this.focus()}))&&(e.highlightForTwoSeconds(),await this.#Vs.target().pageAgent().invoke_bringToFront())}simpleSelector(){const e=this.localName()||this.nodeName().toLowerCase();if(this.nodeType()!==Node.ELEMENT_NODE)return e;const t=this.getAttribute("type"),n=this.getAttribute("id"),r=this.getAttribute("class");if("input"===e&&t&&!n&&!r)return e+'[type="'+CSS.escape(t)+'"]';if(n)return e+"#"+CSS.escape(n);if(r){return("div"===e?"":e)+"."+r.trim().split(/\s+/g).map((e=>CSS.escape(e))).join(".")}return this.pseudoIdentifier()?`${e}(${this.pseudoIdentifier()})`:e}async getAnchorBySpecifier(e){const t=await this.#Ws.invoke_getAnchorElement({nodeId:this.id,anchorSpecifier:e});return t.getError()?null:this.domModel().nodeForId(t.nodeId)}classNames(){const e=this.getAttribute("class");return e?e.split(/\s+/):[]}}!function(e){let t;!function(e){e.UserAgent="user-agent",e.Open="open",e.Closed="closed"}(t=e.ShadowRootTypes||(e.ShadowRootTypes={}))}(zs||(zs={}));class js{#Vs;#Ks;constructor(e,t){this.#Vs=e.model(Gs),this.#Ks=t}resolve(e){this.resolvePromise().then(e)}async resolvePromise(){const e=await this.#Vs.pushNodesByBackendIdsToFrontend(new Set([this.#Ks]));return e?.get(this.#Ks)||null}backendNodeId(){return this.#Ks}domModel(){return this.#Vs}highlight(){this.#Vs.overlayModel().highlightInOverlay({deferredNode:this,selectorList:void 0})}}class Vs{nodeType;nodeName;deferredNode;constructor(e,t,n,r){this.nodeType=n,this.nodeName=r,this.deferredNode=new js(e,t)}}class Ws extends zs{body;documentElement;documentURL;baseURL;constructor(e,t){super(e),this.body=null,this.documentElement=null,this.init(this,!1,t),this.documentURL=t.documentURL||"",this.baseURL=t.baseURL||""}}class Gs extends h{agent;idToDOMNode=new Map;#hi=null;#ui=new Set;runtimeModelInternal;#gi;#pi=null;#mi;#fi;#bi;constructor(e){super(e),this.agent=e.domAgent(),e.registerDOMDispatcher(new Ks(this)),this.runtimeModelInternal=e.model(Jr),e.suspended()||this.agent.invoke_enable({}),o.Runtime.experiments.isEnabled("capture-node-creation-stacks")&&this.agent.invoke_setNodeStackTracesEnabled({enable:!0})}runtimeModel(){return this.runtimeModelInternal}cssModel(){return this.target().model(Br)}overlayModel(){return this.target().model(Fs)}static cancelSearch(){for(const e of W.instance().models(Gs))e.cancelSearch()}scheduleMutationEvent(e){this.hasEventListeners(Us.DOMMutated)&&(this.#gi=(this.#gi||0)+1,Promise.resolve().then(function(e,t){if(!this.hasEventListeners(Us.DOMMutated)||this.#gi!==t)return;this.dispatchEventToListeners(Us.DOMMutated,e)}.bind(this,e,this.#gi)))}requestDocument(){return this.#hi?Promise.resolve(this.#hi):(this.#pi||(this.#pi=this.requestDocumentInternal()),this.#pi)}async getOwnerNodeForFrame(e){const t=await this.agent.invoke_getFrameOwner({frameId:e});return t.getError()?null:new js(this.target(),t.backendNodeId)}async requestDocumentInternal(){const e=await this.agent.invoke_getDocument({});if(e.getError())return null;const{root:t}=e;if(this.#pi=null,t&&this.setDocument(t),!this.#hi)return console.error("No document"),null;const n=this.parentModel();if(n&&!this.#mi){await n.requestDocument();const e=this.target().model(ii)?.mainFrame;if(e){const t=await n.agent.invoke_getFrameOwner({frameId:e.id});!t.getError()&&t.nodeId&&(this.#mi=n.nodeForId(t.nodeId))}}if(this.#mi){const e=this.#mi.contentDocument();this.#mi.setContentDocument(this.#hi),this.#mi.setChildren([]),this.#hi?(this.#hi.parentNode=this.#mi,this.dispatchEventToListeners(Us.NodeInserted,this.#hi)):e&&this.dispatchEventToListeners(Us.NodeRemoved,{node:e,parent:this.#mi})}return this.#hi}existingDocument(){return this.#hi}async pushNodeToFrontend(e){await this.requestDocument();const{nodeId:t}=await this.agent.invoke_requestNode({objectId:e});return this.nodeForId(t)}pushNodeByPathToFrontend(e){return this.requestDocument().then((()=>this.agent.invoke_pushNodeByPathToFrontend({path:e}))).then((({nodeId:e})=>e))}async pushNodesByBackendIdsToFrontend(e){await this.requestDocument();const t=[...e],{nodeIds:n}=await this.agent.invoke_pushNodesByBackendIdsToFrontend({backendNodeIds:t});if(!n)return null;const r=new Map;for(let e=0;e<n.length;++e)n[e]&&r.set(t[e],this.nodeForId(n[e]));return r}attributeModified(e,t,n){const r=this.idToDOMNode.get(e);r&&(r.setAttributeInternal(t,n),this.dispatchEventToListeners(Us.AttrModified,{node:r,name:t}),this.scheduleMutationEvent(r))}attributeRemoved(e,t){const n=this.idToDOMNode.get(e);n&&(n.removeAttributeInternal(t),this.dispatchEventToListeners(Us.AttrRemoved,{node:n,name:t}),this.scheduleMutationEvent(n))}inlineStyleInvalidated(e){e.forEach((e=>this.#ui.add(e))),this.#fi||(this.#fi=window.setTimeout(this.loadNodeAttributes.bind(this),20))}loadNodeAttributes(){this.#fi=void 0;for(const e of this.#ui)this.agent.invoke_getAttributes({nodeId:e}).then((({attributes:t})=>{if(!t)return;const n=this.idToDOMNode.get(e);n&&n.setAttributesPayload(t)&&(this.dispatchEventToListeners(Us.AttrModified,{node:n,name:"style"}),this.scheduleMutationEvent(n))}));this.#ui.clear()}characterDataModified(e,t){const n=this.idToDOMNode.get(e);n?(n.setNodeValueInternal(t),this.dispatchEventToListeners(Us.CharacterDataModified,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}nodeForId(e){return e&&this.idToDOMNode.get(e)||null}documentUpdated(){const e=Boolean(this.#hi);this.setDocument(null),this.parentModel()&&e&&!this.#pi&&this.requestDocument()}setDocument(e){this.idToDOMNode=new Map,this.#hi=e&&"nodeId"in e?new Ws(this,e):null,$s.instance().dispose(this),this.parentModel()||this.dispatchEventToListeners(Us.DocumentUpdated,this)}setDocumentForTest(e){this.setDocument(e)}setDetachedRoot(e){"#document"===e.nodeName?new Ws(this,e):zs.create(this,null,!1,e)}setChildNodes(e,t){if(!e&&t.length)return void this.setDetachedRoot(t[0]);const n=this.idToDOMNode.get(e);n?.setChildrenPayload(t)}childNodeCountUpdated(e,t){const n=this.idToDOMNode.get(e);n?(n.setChildNodeCount(t),this.dispatchEventToListeners(Us.ChildNodeCountUpdated,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}childNodeInserted(e,t,n){const r=this.idToDOMNode.get(e),s=this.idToDOMNode.get(t);if(!r)return void console.error("parentId could not be resolved to a node");const i=r.insertChild(s,n);this.idToDOMNode.set(i.id,i),this.dispatchEventToListeners(Us.NodeInserted,i),this.scheduleMutationEvent(i)}childNodeRemoved(e,t){const n=this.idToDOMNode.get(e),r=this.idToDOMNode.get(t);n&&r?(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r)):console.error("parentId or nodeId could not be resolved to a node")}shadowRootPushed(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=zs.create(this,n.ownerDocument,!0,t);r.parentNode=n,this.idToDOMNode.set(r.id,r),n.shadowRootsInternal.unshift(r),this.dispatchEventToListeners(Us.NodeInserted,r),this.scheduleMutationEvent(r)}shadowRootPopped(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}pseudoElementAdded(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=zs.create(this,n.ownerDocument,!1,t);r.parentNode=n,this.idToDOMNode.set(r.id,r);const s=r.pseudoType();if(!s)throw new Error("DOMModel._pseudoElementAdded expects pseudoType to be defined.");const i=n.pseudoElements().get(s);if(i&&i.length>0){if(!s.startsWith("view-transition")&&!s.startsWith("scroll-")&&"column"!==s)throw new Error(`DOMModel.pseudoElementAdded expects parent to not already have this pseudo type added; only view-transition* and scrolling pseudo elements can coexist under the same parent. ${i.length} elements of type ${s} already exist on parent.`);i.push(r)}else n.pseudoElements().set(s,[r]);this.dispatchEventToListeners(Us.NodeInserted,r),this.scheduleMutationEvent(r)}scrollableFlagUpdated(e,t){const n=this.nodeForId(e);n&&n.isScrollable()!==t&&(n.setIsScrollable(t),this.dispatchEventToListeners(Us.ScrollableFlagUpdated,{node:n}))}topLayerElementsUpdated(){this.dispatchEventToListeners(Us.TopLayerElementsChanged)}pseudoElementRemoved(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}distributedNodesUpdated(e,t){const n=this.idToDOMNode.get(e);n&&(n.setDistributedNodePayloads(t),this.dispatchEventToListeners(Us.DistributedNodesChanged,n),this.scheduleMutationEvent(n))}unbind(e){this.idToDOMNode.delete(e.id);const t=e.children();for(let e=0;t&&e<t.length;++e)this.unbind(t[e]);for(let t=0;t<e.shadowRootsInternal.length;++t)this.unbind(e.shadowRootsInternal[t]);const n=e.pseudoElements();for(const e of n.values())for(const t of e)this.unbind(t);const r=e.templateContent();r&&this.unbind(r)}async getNodesByStyle(e,t=!1){if(await this.requestDocument(),!this.#hi)throw new Error("DOMModel.getNodesByStyle expects to have a document.");const n=await this.agent.invoke_getNodesForSubtreeByStyle({nodeId:this.#hi.id,computedStyles:e,pierce:t});if(n.getError())throw new Error(n.getError());return n.nodeIds}async performSearch(e,t){const n=await this.agent.invoke_performSearch({query:e,includeUserAgentShadowDOM:t});return n.getError()||(this.#bi=n.searchId),n.getError()?0:n.resultCount}async searchResult(e){if(!this.#bi)return null;const{nodeIds:t}=await this.agent.invoke_getSearchResults({searchId:this.#bi,fromIndex:e,toIndex:e+1});return t&&1===t.length?this.nodeForId(t[0]):null}cancelSearch(){this.#bi&&(this.agent.invoke_discardSearchResults({searchId:this.#bi}),this.#bi=void 0)}classNamesPromise(e){return this.agent.invoke_collectClassNamesFromSubtree({nodeId:e}).then((({classNames:e})=>e||[]))}querySelector(e,t){return this.agent.invoke_querySelector({nodeId:e,selector:t}).then((({nodeId:e})=>e))}querySelectorAll(e,t){return this.agent.invoke_querySelectorAll({nodeId:e,selector:t}).then((({nodeIds:e})=>e))}getTopLayerElements(){return this.agent.invoke_getTopLayerElements().then((({nodeIds:e})=>e))}getDetachedDOMNodes(){return this.agent.invoke_getDetachedDomNodes().then((({detachedNodes:e})=>e))}getElementByRelation(e,t){return this.agent.invoke_getElementByRelation({nodeId:e,relation:t}).then((({nodeId:e})=>e))}markUndoableState(e){$s.instance().markUndoableState(this,e||!1)}async nodeForLocation(e,t,n){const r=await this.agent.invoke_getNodeForLocation({x:e,y:t,includeUserAgentShadowDOM:n});return r.getError()||!r.nodeId?null:this.nodeForId(r.nodeId)}async getContainerForNode(e,t,n,r,s){const{nodeId:i}=await this.agent.invoke_getContainerForNode({nodeId:e,containerName:t,physicalAxes:n,logicalAxes:r,queriesScrollState:s});return i?this.nodeForId(i):null}pushObjectAsNodeToFrontend(e){return e.isNode()&&e.objectId?this.pushNodeToFrontend(e.objectId):Promise.resolve(null)}suspendModel(){return this.agent.invoke_disable().then((()=>this.setDocument(null)))}async resumeModel(){await this.agent.invoke_enable({})}dispose(){$s.instance().dispose(this)}parentModel(){const e=this.target().parentTarget();return e?e.model(Gs):null}getAgent(){return this.agent}registerNode(e){this.idToDOMNode.set(e.id,e)}}!function(e){e.AttrModified="AttrModified",e.AttrRemoved="AttrRemoved",e.CharacterDataModified="CharacterDataModified",e.DOMMutated="DOMMutated",e.NodeInserted="NodeInserted",e.NodeRemoved="NodeRemoved",e.DocumentUpdated="DocumentUpdated",e.ChildNodeCountUpdated="ChildNodeCountUpdated",e.DistributedNodesChanged="DistributedNodesChanged",e.MarkersChanged="MarkersChanged",e.TopLayerElementsChanged="TopLayerElementsChanged",e.ScrollableFlagUpdated="ScrollableFlagUpdated"}(Us||(Us={}));class Ks{#Yn;constructor(e){this.#Yn=e}documentUpdated(){this.#Yn.documentUpdated()}attributeModified({nodeId:e,name:t,value:n}){this.#Yn.attributeModified(e,t,n)}attributeRemoved({nodeId:e,name:t}){this.#Yn.attributeRemoved(e,t)}inlineStyleInvalidated({nodeIds:e}){this.#Yn.inlineStyleInvalidated(e)}characterDataModified({nodeId:e,characterData:t}){this.#Yn.characterDataModified(e,t)}setChildNodes({parentId:e,nodes:t}){this.#Yn.setChildNodes(e,t)}childNodeCountUpdated({nodeId:e,childNodeCount:t}){this.#Yn.childNodeCountUpdated(e,t)}childNodeInserted({parentNodeId:e,previousNodeId:t,node:n}){this.#Yn.childNodeInserted(e,t,n)}childNodeRemoved({parentNodeId:e,nodeId:t}){this.#Yn.childNodeRemoved(e,t)}shadowRootPushed({hostId:e,root:t}){this.#Yn.shadowRootPushed(e,t)}shadowRootPopped({hostId:e,rootId:t}){this.#Yn.shadowRootPopped(e,t)}pseudoElementAdded({parentId:e,pseudoElement:t}){this.#Yn.pseudoElementAdded(e,t)}pseudoElementRemoved({parentId:e,pseudoElementId:t}){this.#Yn.pseudoElementRemoved(e,t)}distributedNodesUpdated({insertionPointId:e,distributedNodes:t}){this.#Yn.distributedNodesUpdated(e,t)}topLayerElementsUpdated(){this.#Yn.topLayerElementsUpdated()}scrollableFlagUpdated({nodeId:e,isScrollable:t}){this.#Yn.scrollableFlagUpdated(e,t)}}let Qs=null;class $s{#Lt;#is;#yi;constructor(){this.#Lt=[],this.#is=0,this.#yi=null}static instance(e={forceNew:null}){const{forceNew:t}=e;return Qs&&!t||(Qs=new $s),Qs}async markUndoableState(e,t){this.#yi&&e!==this.#yi&&(this.#yi.markUndoableState(),this.#yi=null),t&&this.#yi===e||(this.#Lt=this.#Lt.slice(0,this.#is),this.#Lt.push(e),this.#is=this.#Lt.length,t?this.#yi=e:(await e.getAgent().invoke_markUndoableState(),this.#yi=null))}async undo(){if(0===this.#is)return await Promise.resolve();--this.#is,this.#yi=null,await this.#Lt[this.#is].getAgent().invoke_undo()}async redo(){if(this.#is>=this.#Lt.length)return await Promise.resolve();++this.#is,this.#yi=null,await this.#Lt[this.#is-1].getAgent().invoke_redo()}dispose(e){let t=0;for(let n=0;n<this.#is;++n)this.#Lt[n]===e&&++t;r.ArrayUtilities.removeElement(this.#Lt,e),this.#is-=t,this.#yi===e&&(this.#yi=null)}}h.register(Gs,{capabilities:2,autostart:!0});var Xs=Object.freeze({__proto__:null,DOMDocument:Ws,DOMModel:Gs,DOMModelUndoStack:$s,get DOMNode(){return zs},DOMNodeShortcut:Vs,DeferredDOMNode:js,get Events(){return Us}});class Js{#tr;#vi;#Ii;#wi;#Si;#ki;#Ci;#xi;#Ri;#Ti;#Mi;#Pi;#Ei=null;#Li=null;constructor(t,n,s,i,o,a,l,d,c,h){this.#tr=t,this.#vi=n,this.url=s,this.#wi=i,this.#Si=o,this.#ki=a,this.#Ci=l||e.ResourceType.resourceTypes.Other,this.#xi=d,this.#Ri=!1,this.#Ti=c&&r.DateUtilities.isValid(c)?c:null,this.#Mi=h}lastModified(){if(this.#Ti||!this.#vi)return this.#Ti;const e=this.#vi.responseLastModified(),t=e?new Date(e):null;return this.#Ti=t&&r.DateUtilities.isValid(t)?t:null,this.#Ti}contentSize(){return"number"!=typeof this.#Mi&&this.#vi?this.#vi.resourceSize:this.#Mi}get request(){return this.#vi}get url(){return this.#Ii}set url(t){this.#Ii=t,this.#Pi=new e.ParsedURL.ParsedURL(t)}get parsedURL(){return this.#Pi}get documentURL(){return this.#wi}get frameId(){return this.#Si}get loaderId(){return this.#ki}get displayName(){return this.#Pi?this.#Pi.displayName:""}resourceType(){return this.#vi?this.#vi.resourceType():this.#Ci}get mimeType(){return this.#vi?this.#vi.mimeType:this.#xi}get content(){return this.#Ei?.isTextContent?this.#Ei.text:this.#Ei?.base64??null}get isGenerated(){return this.#Ri}set isGenerated(e){this.#Ri=e}contentURL(){return this.#Ii}contentType(){return this.resourceType()===e.ResourceType.resourceTypes.Document&&-1!==this.mimeType.indexOf("javascript")?e.ResourceType.resourceTypes.Script:this.resourceType()}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentData(){return this.#Ei?this.#Ei:(this.#Li||(this.#Li=this.innerRequestContent().then((e=>(t.ContentData.ContentData.isError(e)||(this.#Ei=e),this.#Li=null,e)))),await this.#Li)}canonicalMimeType(){return this.contentType().canonicalMimeType()||this.mimeType}async searchInContent(e,n,r){if(!this.frameId)return[];if(this.request)return await this.request.searchInContent(e,n,r);const s=await this.#tr.target().pageAgent().invoke_searchInResource({frameId:this.frameId,url:this.url,query:e,caseSensitive:n,isRegex:r});return t.TextUtils.performSearchInSearchMatches(s.result||[],e,n,r)}async populateImageSource(e){const n=await this.requestContentData();t.ContentData.ContentData.isError(n)||(e.src=n.asDataUrl()??this.#Ii)}async innerRequestContent(){if(this.request)return await this.request.requestContentData();const e=await this.#tr.target().pageAgent().invoke_getResourceContent({frameId:this.frameId,url:this.url}),n=e.getError();return n?{error:n}:new t.ContentData.ContentData(e.content,e.base64Encoded,this.mimeType)}frame(){return this.#Si?this.#tr.frameForId(this.#Si):null}statusCode(){return this.#vi?this.#vi.statusCode:0}}var Ys,Zs=Object.freeze({__proto__:null,Resource:Js});class ei extends h{#Ai="";#Oi="";#Di=new Set;constructor(e){super(e)}updateSecurityOrigins(e){const t=this.#Di;this.#Di=e;for(const e of t)this.#Di.has(e)||this.dispatchEventToListeners(Ys.SecurityOriginRemoved,e);for(const e of this.#Di)t.has(e)||this.dispatchEventToListeners(Ys.SecurityOriginAdded,e)}securityOrigins(){return[...this.#Di]}mainSecurityOrigin(){return this.#Ai}unreachableMainSecurityOrigin(){return this.#Oi}setMainSecurityOrigin(e,t){this.#Ai=e,this.#Oi=t||null,this.dispatchEventToListeners(Ys.MainSecurityOriginChanged,{mainSecurityOrigin:this.#Ai,unreachableMainSecurityOrigin:this.#Oi})}}!function(e){e.SecurityOriginAdded="SecurityOriginAdded",e.SecurityOriginRemoved="SecurityOriginRemoved",e.MainSecurityOriginChanged="MainSecurityOriginChanged"}(Ys||(Ys={})),h.register(ei,{capabilities:0,autostart:!1});var ti=Object.freeze({__proto__:null,get Events(){return Ys},SecurityOriginManager:ei});class ni extends h{#Ni;#Fi;constructor(e){super(e),this.#Ni="",this.#Fi=new Set}updateStorageKeys(e){const t=this.#Fi;this.#Fi=e;for(const e of t)this.#Fi.has(e)||this.dispatchEventToListeners("StorageKeyRemoved",e);for(const e of this.#Fi)t.has(e)||this.dispatchEventToListeners("StorageKeyAdded",e)}storageKeys(){return[...this.#Fi]}mainStorageKey(){return this.#Ni}setMainStorageKey(e){this.#Ni=e,this.dispatchEventToListeners("MainStorageKeyChanged",{mainStorageKey:this.#Ni})}}h.register(ni,{capabilities:0,autostart:!1});var ri,si=Object.freeze({__proto__:null,StorageKeyManager:ni,parseStorageKey:function(t){const n=t.split("^"),r={origin:e.ParsedURL.ParsedURL.extractOrigin(n[0]),components:new Map};for(let e=1;e<n.length;++e)r.components.set(n[e].charAt(0),n[e].substring(1));return r}});class ii extends h{agent;storageAgent;#Bi;#_i;framesInternal=new Map;#Hi=!1;#Ui=null;#qi=0;isInterstitialShowing=!1;mainFrame=null;#zi=new Set;constructor(e){super(e);const t=e.model(Z);t&&(t.addEventListener(ee.RequestFinished,this.onRequestFinished,this),t.addEventListener(ee.RequestUpdateDropped,this.onRequestUpdateDropped,this)),this.agent=e.pageAgent(),this.storageAgent=e.storageAgent(),this.agent.invoke_enable({}),this.#Bi=e.model(ei),this.#_i=e.model(ni),e.registerPageDispatcher(new ai(this)),this.#ji()}async#ji(){return await this.agent.invoke_getResourceTree().then((e=>{this.processCachedResources(e.getError()?null:e.frameTree),this.mainFrame&&this.processPendingEvents(this.mainFrame)}))}static frameForRequest(e){const t=Z.forRequest(e),n=t?t.target().model(ii):null;return n&&e.frameId?n.frameForId(e.frameId):null}static frames(){const e=[];for(const t of W.instance().models(ii))e.push(...t.frames());return e}static resourceForURL(e){for(const t of W.instance().models(ii)){const n=t.mainFrame,r=n?n.resourceForURL(e):null;if(r)return r}return null}static reloadAllPages(e,t){for(const n of W.instance().models(ii))n.target().parentTarget()?.type()!==U.FRAME&&n.reloadPage(e,t)}async storageKeyForFrame(e){if(!this.framesInternal.has(e))return null;const t=await this.storageAgent.invoke_getStorageKeyForFrame({frameId:e});return"Frame tree node for given frame not found"===t.getError()?null:t.storageKey}domModel(){return this.target().model(Gs)}processCachedResources(e){e&&":"!==e.frame.url&&(this.dispatchEventToListeners(ri.WillLoadCachedResources),this.addFramesRecursively(null,e),this.target().setInspectedURL(e.frame.url)),this.#Hi=!0;const t=this.target().model(Jr);t&&(t.setExecutionContextComparator(this.executionContextComparator.bind(this)),t.fireExecutionContextOrderChanged()),this.dispatchEventToListeners(ri.CachedResourcesLoaded,this)}cachedResourcesLoaded(){return this.#Hi}addFrame(e,t){this.framesInternal.set(e.id,e),e.isMainFrame()&&(this.mainFrame=e),this.dispatchEventToListeners(ri.FrameAdded,e),this.updateSecurityOrigins(),this.updateStorageKeys()}frameAttached(e,t,n){const r=t&&this.framesInternal.get(t)||null;if(!this.#Hi&&r)return null;if(this.framesInternal.has(e))return null;const s=new oi(this,r,e,null,n||null);return t&&!r&&(s.crossTargetParentFrameId=t),s.isMainFrame()&&this.mainFrame&&this.frameDetached(this.mainFrame.id,!1),this.addFrame(s,!0),s}frameNavigated(e,t){const n=e.parentId&&this.framesInternal.get(e.parentId)||null;if(!this.#Hi&&n)return;let r=this.framesInternal.get(e.id)||null;if(!r&&(r=this.frameAttached(e.id,e.parentId||null),console.assert(Boolean(r)),!r))return;this.dispatchEventToListeners(ri.FrameWillNavigate,r),r.navigate(e),t&&(r.backForwardCacheDetails.restoredFromCache="BackForwardCacheRestore"===t),r.isMainFrame()&&this.target().setInspectedURL(r.url),this.dispatchEventToListeners(ri.FrameNavigated,r),r.isPrimaryFrame()&&this.primaryPageChanged(r,"Navigation");const s=r.resources();for(let e=0;e<s.length;++e)this.dispatchEventToListeners(ri.ResourceAdded,s[e]);this.updateSecurityOrigins(),this.updateStorageKeys(),r.backForwardCacheDetails.restoredFromCache&&(Nn.instance().modelRemoved(this),Nn.instance().modelAdded(this),this.#ji())}primaryPageChanged(e,t){this.processPendingEvents(e),this.dispatchEventToListeners(ri.PrimaryPageChanged,{frame:e,type:t});const n=this.target().model(Z);n&&e.isOutermostFrame()&&n.clearRequests()}documentOpened(t){this.frameNavigated(t,void 0);const n=this.framesInternal.get(t.id);if(n&&!n.getResourcesMap().get(t.url)){const r=this.createResourceFromFramePayload(t,t.url,e.ResourceType.resourceTypes.Document,t.mimeType,null,null);r.isGenerated=!0,n.addResource(r)}}frameDetached(e,t){if(!this.#Hi)return;const n=this.framesInternal.get(e);if(!n)return;const r=n.sameTargetParentFrame();r?r.removeChildFrame(n,t):n.remove(t),this.updateSecurityOrigins(),this.updateStorageKeys()}onRequestFinished(e){if(!this.#Hi)return;const t=e.data;if(t.failed)return;const n=t.frameId?this.framesInternal.get(t.frameId):null;n&&n.addRequest(t)}onRequestUpdateDropped(t){if(!this.#Hi)return;const n=t.data,r=n.frameId;if(!r)return;const s=this.framesInternal.get(r);if(!s)return;const i=n.url;if(s.getResourcesMap().get(i))return;const o=new Js(this,null,i,s.url,r,n.loaderId,e.ResourceType.resourceTypes[n.resourceType],n.mimeType,n.lastModified,null);s.addResource(o)}frameForId(e){return this.framesInternal.get(e)||null}forAllResources(e){return!!this.mainFrame&&this.mainFrame.callForFrameResources(e)}frames(){return[...this.framesInternal.values()]}addFramesRecursively(t,n){const r=n.frame;let s=this.framesInternal.get(r.id);s||(s=new oi(this,t,r.id,r,null)),!t&&r.parentId&&(s.crossTargetParentFrameId=r.parentId),this.addFrame(s);for(const e of n.childFrames||[])this.addFramesRecursively(s,e);for(let t=0;t<n.resources.length;++t){const i=n.resources[t],o=this.createResourceFromFramePayload(r,i.url,e.ResourceType.resourceTypes[i.type],i.mimeType,i.lastModified||null,i.contentSize||null);s.addResource(o)}if(!s.getResourcesMap().get(r.url)){const t=this.createResourceFromFramePayload(r,r.url,e.ResourceType.resourceTypes.Document,r.mimeType,null,null);s.addResource(t)}}createResourceFromFramePayload(e,t,n,r,s,i){const o="number"==typeof s?new Date(1e3*s):null;return new Js(this,null,t,e.url,e.id,e.loaderId,n,r,o,i)}suspendReload(){this.#qi++}resumeReload(){if(this.#qi--,console.assert(this.#qi>=0,"Unbalanced call to ResourceTreeModel.resumeReload()"),!this.#qi&&this.#Ui){const{ignoreCache:e,scriptToEvaluateOnLoad:t}=this.#Ui;this.reloadPage(e,t)}}reloadPage(e,t){const n=this.mainFrame?.loaderId;if(!n)return;if(this.#Ui||this.dispatchEventToListeners(ri.PageReloadRequested,this),this.#qi)return void(this.#Ui={ignoreCache:e,scriptToEvaluateOnLoad:t});this.#Ui=null;const r=this.target().model(Z);r&&r.clearRequests(),this.dispatchEventToListeners(ri.WillReloadPage),this.agent.invoke_reload({ignoreCache:e,scriptToEvaluateOnLoad:t,loaderId:n})}navigate(e){return this.agent.invoke_navigate({url:e})}async navigationHistory(){const e=await this.agent.invoke_getNavigationHistory();return e.getError()?null:{currentIndex:e.currentIndex,entries:e.entries}}navigateToHistoryEntry(e){this.agent.invoke_navigateToHistoryEntry({entryId:e.id})}setLifecycleEventsEnabled(e){return this.agent.invoke_setLifecycleEventsEnabled({enabled:e})}async fetchAppManifest(){const e=await this.agent.invoke_getAppManifest({});return e.getError()?{url:e.url,data:null,errors:[]}:{url:e.url,data:e.data||null,errors:e.errors}}async getInstallabilityErrors(){return(await this.agent.invoke_getInstallabilityErrors()).installabilityErrors||[]}async getAppId(){return await this.agent.invoke_getAppId()}executionContextComparator(e,t){function n(e){let t=e;const n=[];for(;t;)n.push(t),t=t.sameTargetParentFrame();return n.reverse()}if(e.target()!==t.target())return Zr.comparator(e,t);const r=e.frameId?n(this.frameForId(e.frameId)):[],s=t.frameId?n(this.frameForId(t.frameId)):[];let i,o;for(let e=0;;e++)if(!r[e]||!s[e]||r[e]!==s[e]){i=r[e],o=s[e];break}return!i&&o?-1:!o&&i?1:i&&o?i.id.localeCompare(o.id):Zr.comparator(e,t)}getSecurityOriginData(){const t=new Set;let n=null,r=null;for(const s of this.framesInternal.values()){const i=s.securityOrigin;if(i&&(t.add(i),s.isMainFrame()&&(n=i,s.unreachableUrl()))){r=new e.ParsedURL.ParsedURL(s.unreachableUrl()).securityOrigin()}}return{securityOrigins:t,mainSecurityOrigin:n,unreachableMainSecurityOrigin:r}}async getStorageKeyData(){const e=new Set;let t=null;for(const{isMainFrame:n,storageKey:r}of await Promise.all([...this.framesInternal.values()].map((e=>e.getStorageKey(!1).then((t=>({isMainFrame:e.isMainFrame(),storageKey:t})))))))n&&(t=r),r&&e.add(r);return{storageKeys:e,mainStorageKey:t}}updateSecurityOrigins(){const e=this.getSecurityOriginData();this.#Bi.setMainSecurityOrigin(e.mainSecurityOrigin||"",e.unreachableMainSecurityOrigin||""),this.#Bi.updateSecurityOrigins(e.securityOrigins)}async updateStorageKeys(){const e=await this.getStorageKeyData();this.#_i.setMainStorageKey(e.mainStorageKey||""),this.#_i.updateStorageKeys(e.storageKeys)}async getMainStorageKey(){return this.mainFrame?await this.mainFrame.getStorageKey(!1):null}getMainSecurityOrigin(){const e=this.getSecurityOriginData();return e.mainSecurityOrigin||e.unreachableMainSecurityOrigin}onBackForwardCacheNotUsed(e){this.mainFrame&&this.mainFrame.id===e.frameId&&this.mainFrame.loaderId===e.loaderId?(this.mainFrame.setBackForwardCacheDetails(e),this.dispatchEventToListeners(ri.BackForwardCacheDetailsUpdated,this.mainFrame)):this.#zi.add(e)}processPendingEvents(e){if(e.isMainFrame())for(const t of this.#zi)if(e.id===t.frameId&&e.loaderId===t.loaderId){e.setBackForwardCacheDetails(t),this.#zi.delete(t);break}}}!function(e){e.FrameAdded="FrameAdded",e.FrameNavigated="FrameNavigated",e.FrameDetached="FrameDetached",e.FrameResized="FrameResized",e.FrameWillNavigate="FrameWillNavigate",e.PrimaryPageChanged="PrimaryPageChanged",e.ResourceAdded="ResourceAdded",e.WillLoadCachedResources="WillLoadCachedResources",e.CachedResourcesLoaded="CachedResourcesLoaded",e.DOMContentLoaded="DOMContentLoaded",e.LifecycleEvent="LifecycleEvent",e.Load="Load",e.PageReloadRequested="PageReloadRequested",e.WillReloadPage="WillReloadPage",e.InterstitialShown="InterstitialShown",e.InterstitialHidden="InterstitialHidden",e.BackForwardCacheDetailsUpdated="BackForwardCacheDetailsUpdated",e.JavaScriptDialogOpening="JavaScriptDialogOpening"}(ri||(ri={}));class oi{#os;#Vi;#C;crossTargetParentFrameId=null;#ki;#h;#Ii;#Wi;#Gi;#Ki;#Qi;#$i;#Xi;#Ji;#Yi;#Zi;#eo;#to=null;#no=new Set;resourcesMap=new Map;backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};constructor(e,t,n,s,i){this.#os=e,this.#Vi=t,this.#C=n,this.#ki=s?.loaderId??"",this.#h=s?.name,this.#Ii=s&&s.url||r.DevToolsPath.EmptyUrlString,this.#Wi=s?.domainAndRegistry||"",this.#Gi=s?.securityOrigin??null,this.#Ki=s?.securityOriginDetails,this.#$i=s&&s.unreachableUrl||r.DevToolsPath.EmptyUrlString,this.#Xi=s?.adFrameStatus,this.#Ji=s?.secureContextType??null,this.#Yi=s?.crossOriginIsolatedContextType??null,this.#Zi=s?.gatedAPIFeatures??null,this.#eo=i,this.#Vi&&this.#Vi.#no.add(this)}isSecureContext(){return null!==this.#Ji&&this.#Ji.startsWith("Secure")}getSecureContextType(){return this.#Ji}isCrossOriginIsolated(){return null!==this.#Yi&&this.#Yi.startsWith("Isolated")}getCrossOriginIsolatedContextType(){return this.#Yi}getGatedAPIFeatures(){return this.#Zi}getCreationStackTraceData(){return{creationStackTrace:this.#eo,creationStackTraceTarget:this.#to||this.resourceTreeModel().target()}}navigate(e){this.#ki=e.loaderId,this.#h=e.name,this.#Ii=e.url,this.#Wi=e.domainAndRegistry,this.#Gi=e.securityOrigin,this.#Ki=e.securityOriginDetails,this.getStorageKey(!0),this.#$i=e.unreachableUrl||r.DevToolsPath.EmptyUrlString,this.#Xi=e?.adFrameStatus,this.#Ji=e.secureContextType,this.#Yi=e.crossOriginIsolatedContextType,this.#Zi=e.gatedAPIFeatures,this.backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};const t=this.resourcesMap.get(this.#Ii);this.resourcesMap.clear(),this.removeChildFrames(),t&&t.loaderId===this.#ki&&this.addResource(t)}resourceTreeModel(){return this.#os}get id(){return this.#C}get name(){return this.#h||""}get url(){return this.#Ii}domainAndRegistry(){return this.#Wi}async getAdScriptId(e){return(await this.#os.agent.invoke_getAdScriptId({frameId:e})).adScriptId||null}get securityOrigin(){return this.#Gi}get securityOriginDetails(){return this.#Ki??null}getStorageKey(e){return this.#Qi&&!e||(this.#Qi=this.#os.storageKeyForFrame(this.#C)),this.#Qi}unreachableUrl(){return this.#$i}get loaderId(){return this.#ki}adFrameType(){return this.#Xi?.adFrameType||"none"}adFrameStatus(){return this.#Xi}get childFrames(){return[...this.#no]}sameTargetParentFrame(){return this.#Vi}crossTargetParentFrame(){if(!this.crossTargetParentFrameId)return null;const e=this.#os.target().parentTarget();if(e?.type()!==U.FRAME)return null;const t=e.model(ii);return t&&t.framesInternal.get(this.crossTargetParentFrameId)||null}parentFrame(){return this.sameTargetParentFrame()||this.crossTargetParentFrame()}isMainFrame(){return!this.#Vi}isOutermostFrame(){return this.#os.target().parentTarget()?.type()!==U.FRAME&&!this.#Vi&&!this.crossTargetParentFrameId}isPrimaryFrame(){return!this.#Vi&&this.#os.target()===W.instance().primaryPageTarget()}removeChildFrame(e,t){this.#no.delete(e),e.remove(t)}removeChildFrames(){const e=this.#no;this.#no=new Set;for(const t of e)t.remove(!1)}remove(e){this.removeChildFrames(),this.#os.framesInternal.delete(this.id),this.#os.dispatchEventToListeners(ri.FrameDetached,{frame:this,isSwap:e})}addResource(e){this.resourcesMap.get(e.url)!==e&&(this.resourcesMap.set(e.url,e),this.#os.dispatchEventToListeners(ri.ResourceAdded,e))}addRequest(e){let t=this.resourcesMap.get(e.url());t&&t.request===e||(t=new Js(this.#os,e,e.url(),e.documentURL,e.frameId,e.loaderId,e.resourceType(),e.mimeType,null,null),this.resourcesMap.set(t.url,t),this.#os.dispatchEventToListeners(ri.ResourceAdded,t))}resources(){return Array.from(this.resourcesMap.values())}resourceForURL(e){const t=this.resourcesMap.get(e);if(t)return t;for(const t of this.#no){const n=t.resourceForURL(e);if(n)return n}return null}callForFrameResources(e){for(const t of this.resourcesMap.values())if(e(t))return!0;for(const t of this.#no)if(t.callForFrameResources(e))return!0;return!1}displayName(){if(this.isOutermostFrame())return n.i18n.lockedString("top");const t=new e.ParsedURL.ParsedURL(this.#Ii).displayName;return t?this.#h?this.#h+" ("+t+")":t:n.i18n.lockedString("iframe")}async getOwnerDeferredDOMNode(){const e=this.parentFrame();return e?await e.resourceTreeModel().domModel().getOwnerNodeForFrame(this.#C):null}async getOwnerDOMNodeOrDocument(){const e=await this.getOwnerDeferredDOMNode();return e?await e.resolvePromise():this.isOutermostFrame()?await this.resourceTreeModel().domModel().requestDocument():null}async highlight(){const e=this.parentFrame(),t=this.resourceTreeModel().target().parentTarget(),n=async e=>{const t=await e.getOwnerNodeForFrame(this.#C);t&&e.overlayModel().highlightInOverlay({deferredNode:t,selectorList:""},"all",!0)};if(e)return await n(e.resourceTreeModel().domModel());if(t?.type()===U.FRAME){const e=t.model(Gs);if(e)return await n(e)}const r=await this.resourceTreeModel().domModel().requestDocument();r&&this.resourceTreeModel().domModel().overlayModel().highlightInOverlay({node:r,selectorList:""},"all",!0)}async getPermissionsPolicyState(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getPermissionsPolicyState({frameId:this.#C});return e.getError()?null:e.states}async getOriginTrials(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getOriginTrials({frameId:this.#C});return e.getError()?[]:e.originTrials}setCreationStackTrace(e){this.#eo=e.creationStackTrace,this.#to=e.creationStackTraceTarget}setBackForwardCacheDetails(e){this.backForwardCacheDetails.restoredFromCache=!1,this.backForwardCacheDetails.explanations=e.notRestoredExplanations,this.backForwardCacheDetails.explanationsTree=e.notRestoredExplanationsTree}getResourcesMap(){return this.resourcesMap}}class ai{#tr;constructor(e){this.#tr=e}backForwardCacheNotUsed(e){this.#tr.onBackForwardCacheNotUsed(e)}domContentEventFired({timestamp:e}){this.#tr.dispatchEventToListeners(ri.DOMContentLoaded,e)}loadEventFired({timestamp:e}){this.#tr.dispatchEventToListeners(ri.Load,{resourceTreeModel:this.#tr,loadTime:e})}lifecycleEvent({frameId:e,name:t}){this.#tr.dispatchEventToListeners(ri.LifecycleEvent,{frameId:e,name:t})}frameAttached({frameId:e,parentFrameId:t,stack:n}){this.#tr.frameAttached(e,t,n)}frameNavigated({frame:e,type:t}){this.#tr.frameNavigated(e,t)}documentOpened({frame:e}){this.#tr.documentOpened(e)}frameDetached({frameId:e,reason:t}){this.#tr.frameDetached(e,"swap"===t)}frameSubtreeWillBeDetached(e){}frameStartedLoading({}){}frameStoppedLoading({}){}frameRequestedNavigation({}){}frameScheduledNavigation({}){}frameClearedScheduledNavigation({}){}frameStartedNavigating({}){}navigatedWithinDocument({}){}frameResized(){this.#tr.dispatchEventToListeners(ri.FrameResized)}javascriptDialogOpening(e){this.#tr.dispatchEventToListeners(ri.JavaScriptDialogOpening,e),e.hasBrowserHandler||this.#tr.agent.invoke_handleJavaScriptDialog({accept:!1})}javascriptDialogClosed({}){}screencastFrame({}){}screencastVisibilityChanged({}){}interstitialShown(){this.#tr.isInterstitialShowing=!0,this.#tr.dispatchEventToListeners(ri.InterstitialShown)}interstitialHidden(){this.#tr.isInterstitialShowing=!1,this.#tr.dispatchEventToListeners(ri.InterstitialHidden)}windowOpen({}){}compilationCacheProduced({}){}fileChooserOpened({}){}downloadWillBegin({}){}downloadProgress(){}}h.register(ii,{capabilities:2,autostart:!0,early:!0});var li=Object.freeze({__proto__:null,get Events(){return ri},PageDispatcher:ai,ResourceTreeFrame:oi,ResourceTreeModel:ii});class di extends h{#ro=new Map;#so=new Map;#io=new e.Throttler.Throttler(300);#oo=new Map;constructor(e){super(e),e.model(ii)?.addEventListener(ri.PrimaryPageChanged,this.#ao,this),e.model(Z)?.addEventListener(ee.ResponseReceived,this.#lo,this),e.model(Z)?.addEventListener(ee.LoadingFinished,this.#do,this)}addBlockedCookie(e,t){const n=e.key(),r=this.#ro.get(n);this.#ro.set(n,e),t?this.#so.set(e,t):this.#so.delete(e),r&&this.#so.delete(r)}removeBlockedCookie(e){this.#ro.delete(e.key())}async#ao(){this.#ro.clear(),this.#so.clear(),await this.#co()}getCookieToBlockedReasonsMap(){return this.#so}async#ho(e){const t=this.target().networkAgent(),n=new Map(await Promise.all(e.keysArray().map((n=>t.invoke_getCookies({urls:[...e.get(n).values()]}).then((({cookies:e})=>[n,e.map(H.fromProtocolCookie)])))))),r=this.#uo(n);this.#oo=n,r&&this.dispatchEventToListeners("CookieListUpdated")}async deleteCookie(e){await this.deleteCookies([e])}async clear(e,t){this.#go()||await this.#po();const n=e?this.#oo.get(e)||[]:[...this.#oo.values()].flat();if(n.push(...this.#ro.values()),t){const e=n.filter((e=>e.matchesSecurityOrigin(t)));await this.deleteCookies(e)}else await this.deleteCookies(n)}async saveCookie(e){let t,n=e.domain();n.startsWith(".")||(n=""),e.expires()&&(t=Math.floor(Date.parse(`${e.expires()}`)/1e3));const r=o.Runtime.experiments.isEnabled("experimental-cookie-features"),s={name:e.name(),value:e.value(),url:e.url()||void 0,domain:n,path:e.path(),secure:e.secure(),httpOnly:e.httpOnly(),sameSite:e.sameSite(),expires:t,priority:e.priority(),partitionKey:e.partitionKey(),sourceScheme:r?e.sourceScheme():(i=e.sourceScheme(),"Unset"===i?i:void 0),sourcePort:r?e.sourcePort():void 0};var i;const a=await this.target().networkAgent().invoke_setCookie(s);return!(a.getError()||!a.success)&&(await this.#po(),a.success)}async getCookiesForDomain(e,t){this.#go()&&!t||await this.#po();return(this.#oo.get(e)||[]).concat(Array.from(this.#ro.values()))}async deleteCookies(e){const t=this.target().networkAgent();this.#ro.clear(),this.#so.clear(),await Promise.all(e.map((e=>t.invoke_deleteCookies({name:e.name(),url:void 0,domain:e.domain(),path:e.path(),partitionKey:e.partitionKey()})))),await this.#po()}#go(){return Boolean(this.listeners?.size)}#uo(e){if(e.size!==this.#oo.size)return!0;for(const[t,n]of e){if(!this.#oo.has(t))return!0;const e=this.#oo.get(t)||[];if(n.length!==e.length)return!0;const r=e=>e.key()+" "+e.value(),s=new Set(e.map(r));for(const e of n)if(!s.has(r(e)))return!0}return!1}#po(){return this.#io.schedule((()=>this.#co()))}#co(){const t=new r.MapUtilities.Multimap;const n=this.target().model(ii);if(n){const r=n.mainFrame?.unreachableUrl();if(r){const n=e.ParsedURL.ParsedURL.fromString(r);n&&t.set(n.securityOrigin(),r)}n.forAllResources((function(n){const r=e.ParsedURL.ParsedURL.fromString(n.documentURL);return r&&t.set(r.securityOrigin(),n.url),!1}))}return this.#ho(t)}#lo(){this.#go()&&this.#po()}#do(){this.#go()&&this.#po()}}h.register(di,{capabilities:16,autostart:!1});var ci=Object.freeze({__proto__:null,CookieModel:di});class hi{#mo;#fo;#bo;#yo;#vo;#Io;#wo;constructor(e){e&&(this.#mo=e.toLowerCase().replace(/^\./,"")),this.#fo=[],this.#yo=0}static parseSetCookie(e,t){return new hi(t).parseSetCookie(e)}getCookieAttribute(e){if(!e)return null;switch(e.toLowerCase()){case"domain":return"domain";case"expires":return"expires";case"max-age":return"max-age";case"httponly":return"http-only";case"name":return"name";case"path":return"path";case"samesite":return"same-site";case"secure":return"secure";case"value":return"value";case"priority":return"priority";case"sourceport":return"source-port";case"sourcescheme":return"source-scheme";case"partitioned":return"partitioned";default:return console.error("Failed getting cookie attribute: "+e),null}}cookies(){return this.#fo}parseSetCookie(e){if(!this.initialize(e))return null;for(let e=this.extractKeyValue();e;e=this.extractKeyValue())this.#vo?this.#vo.addAttribute(this.getCookieAttribute(e.key),e.value):this.addCookie(e,1),this.advanceAndCheckCookieDelimiter()&&this.flushCookie();return this.flushCookie(),this.#fo}initialize(e){return this.#bo=e,"string"==typeof e&&(this.#fo=[],this.#vo=null,this.#Io="",this.#yo=this.#bo.length,!0)}flushCookie(){this.#vo&&(this.#vo.setSize(this.#yo-this.#bo.length-this.#wo),this.#vo.setCookieLine(this.#Io.replace("\n",""))),this.#vo=null,this.#Io=""}extractKeyValue(){if(!this.#bo||!this.#bo.length)return null;const e=/^[ \t]*([^=;\n]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this.#bo);if(!e)return console.error("Failed parsing cookie header before: "+this.#bo),null;const t=new ui(e[1]?.trim(),e[2]?.trim(),this.#yo-this.#bo.length);return this.#Io+=e[0],this.#bo=this.#bo.slice(e[0].length),t}advanceAndCheckCookieDelimiter(){if(!this.#bo)return!1;const e=/^\s*[\n;]\s*/.exec(this.#bo);return!!e&&(this.#Io+=e[0],this.#bo=this.#bo.slice(e[0].length),null!==e[0].match("\n"))}addCookie(e,t){this.#vo&&this.#vo.setSize(e.position-this.#wo),this.#vo="string"==typeof e.value?new H(e.key,e.value,t):new H("",e.key,t),this.#mo&&this.#vo.addAttribute("domain",this.#mo),this.#wo=e.position,this.#fo.push(this.#vo)}}class ui{key;value;position;constructor(e,t,n){this.key=e,this.value=t,this.position=n}}var gi=Object.freeze({__proto__:null,CookieParser:hi});class pi{#So;#ko;#Co=!1;#xo="";#Ro="";#To="";#Mo="";constructor(e,t){this.#So=e,this.#ko=new mi(this.#Po.bind(this),t)}async addBase64Chunk(e){await this.#ko.addBase64Chunk(e)}#Po(e){let t=0;for(let n=0;n<e.length;++n)this.#Co&&"\n"===e[n]?(this.#Co=!1,++t):(this.#Co=!1,"\r"!==e[n]&&"\n"!==e[n]||(this.#xo+=e.substring(t,n),this.#Eo(),this.#xo="",t=n+1,this.#Co="\r"===e[n]));this.#xo+=e.substring(t)}#Eo(){if(0===this.#xo.length){if(this.#To.length>0){const e=this.#To.slice(0,-1);this.#So(this.#Mo||"message",e,this.#Ro),this.#To=""}return void(this.#Mo="")}let e,t=this.#xo.indexOf(":");t<0?(t=this.#xo.length,e=t):(e=t+1,e<this.#xo.length&&" "===this.#xo[e]&&++e);const n=this.#xo.substring(0,t);"event"!==n?("data"===n&&(this.#To+=this.#xo.substring(e),this.#To+="\n"),"id"===n&&(this.#Ro=this.#xo.substring(e))):this.#Mo=this.#xo.substring(e)}}class mi{#ko;#Lo;constructor(e,t){this.#ko=new TextDecoderStream(t),this.#Lo=this.#ko.writable.getWriter(),this.#ko.readable.pipeTo(new WritableStream({write:e}))}async addBase64Chunk(e){const t=window.atob(e),n=Uint8Array.from(t,(e=>e.codePointAt(0)));await this.#Lo.ready,await this.#Lo.write(n)}}var fi=Object.freeze({__proto__:null,ServerSentEventsParser:pi});class bi{#Ao;#Oo;#Do=0;#No=[];constructor(e,n){this.#Ao=e,n&&(this.#Do=e.pseudoWallTime(e.startTime),this.#Oo=new pi(this.#Fo.bind(this),e.charset()??void 0),this.#Ao.requestStreamingContent().then((n=>{t.StreamingContentData.isError(n)||(this.#Oo?.addBase64Chunk(n.content().base64),n.addEventListener("ChunkAdded",(({data:{chunk:t}})=>{this.#Do=e.pseudoWallTime(e.endTime),this.#Oo?.addBase64Chunk(t)})))})))}get eventSourceMessages(){return this.#No}onProtocolEventSourceMessageReceived(e,t,n,r){this.#Bo({eventName:e,eventId:n,data:t,time:r})}#Fo(e,t,n){this.#Bo({eventName:e,eventId:n,data:t,time:this.#Do})}#Bo(e){this.#No.push(e),this.#Ao.dispatchEventToListeners(Ti.EVENT_SOURCE_MESSAGE_ADDED,e)}}const yi={deprecatedSyntaxFoundPleaseUse:"Deprecated syntax found. Please use: <name>;dur=<duration>;desc=<description>",duplicateParameterSIgnored:'Duplicate parameter "{PH1}" ignored.',noValueFoundForParameterS:'No value found for parameter "{PH1}".',unrecognizedParameterS:'Unrecognized parameter "{PH1}".',extraneousTrailingCharacters:"Extraneous trailing characters.",unableToParseSValueS:'Unable to parse "{PH1}" value "{PH2}".'},vi=n.i18n.registerUIStrings("core/sdk/ServerTiming.ts",yi),Ii=n.i18n.getLocalizedString.bind(void 0,vi);class wi{metric;value;description;constructor(e,t,n){this.metric=e,this.value=t,this.description=n}static parseHeaders(e){const t=e.filter((e=>"server-timing"===e.name.toLowerCase()));if(!t.length)return null;const n=t.reduce(((e,t)=>{const n=this.createFromHeaderValue(t.value);return e.push(...n.map((function(e){return new wi(e.name,e.hasOwnProperty("dur")?e.dur:null,e.hasOwnProperty("desc")?e.desc:"")}))),e}),[]);return n.sort(((e,t)=>r.StringUtilities.compare(e.metric.toLowerCase(),t.metric.toLowerCase()))),n}static createFromHeaderValue(e){function t(){e=e.replace(/^\s*/,"")}function n(n){return console.assert(1===n.length),t(),e.charAt(0)===n&&(e=e.substring(1),!0)}function r(){const t=/^(?:\s*)([\w!#$%&'*+\-.^`|~]+)(?:\s*)(.*)/.exec(e);return t?(e=t[2],t[1]):null}function s(){return t(),'"'===e.charAt(0)?function(){console.assert('"'===e.charAt(0)),e=e.substring(1);let t="";for(;e.length;){const n=/^([^"\\]*)(.*)/.exec(e);if(!n)return null;if(t+=n[1],'"'===n[2].charAt(0))return e=n[2].substring(1),t;console.assert("\\"===n[2].charAt(0)),t+=n[2].charAt(1),e=n[2].substring(2)}return null}():r()}function i(){const t=/([,;].*)/.exec(e);t&&(e=t[1])}const o=[];let a;for(;null!==(a=r());){const t={name:a};for("="===e.charAt(0)&&this.showWarning(Ii(yi.deprecatedSyntaxFoundPleaseUse));n(";");){let e;if(null===(e=r()))continue;e=e.toLowerCase();const o=this.getParserForParameter(e);let a=null;if(n("=")&&(a=s(),i()),o){if(t.hasOwnProperty(e)){this.showWarning(Ii(yi.duplicateParameterSIgnored,{PH1:e}));continue}null===a&&this.showWarning(Ii(yi.noValueFoundForParameterS,{PH1:e})),o.call(this,t,a)}else this.showWarning(Ii(yi.unrecognizedParameterS,{PH1:e}))}if(o.push(t),!n(","))break}return e.length&&this.showWarning(Ii(yi.extraneousTrailingCharacters)),o}static getParserForParameter(e){switch(e){case"dur":{function t(t,n){if(t.dur=0,null!==n){const r=parseFloat(n);if(isNaN(r))return void wi.showWarning(Ii(yi.unableToParseSValueS,{PH1:e,PH2:n}));t.dur=r}}return t}case"desc":{function n(e,t){e.desc=t||""}return n}default:return null}}static showWarning(t){e.Console.Console.instance().warn(`ServerTiming: ${t}`)}}var Si=Object.freeze({__proto__:null,ServerTiming:wi});const ki={binary:"(binary)",secureOnly:'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure.',notOnPath:"This cookie was blocked because its path was not an exact match for or a superdirectory of the request url's path.",domainMismatch:"This cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value.",sameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites.',sameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation.',sameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored and was defaulted to "SameSite=Lax," and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',sameSiteNoneInsecure:'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "Secure". Cookies without SameSite restrictions must be marked "Secure" and sent over a secure connection.',userPreferences:"This cookie was blocked due to user preferences.",thirdPartyPhaseout:"This cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.",unknownError:"An unknown error was encountered when trying to send this cookie.",schemefulSameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored, was defaulted to "`SameSite=Lax"`, and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',samePartyFromCrossPartyContext:"This cookie was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",nameValuePairExceedsMaxSize:"This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters.",thisSetcookieWasBlockedDueToUser:"This attempt to set a cookie via a `Set-Cookie` header was blocked due to user preferences.",thisSetcookieWasBlockedDueThirdPartyPhaseout:"Setting this cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.",thisSetcookieHadInvalidSyntax:"This `Set-Cookie` header had invalid syntax.",thisSetcookieHadADisallowedCharacter:"This `Set-Cookie` header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value).",theSchemeOfThisConnectionIsNot:"The scheme of this connection is not allowed to store cookies.",anUnknownErrorWasEncounteredWhenTrying:"An unknown error was encountered when trying to store this cookie.",thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieDidntSpecifyASamesite:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute, was defaulted to "`SameSite=Lax"`, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieWasBlockedBecauseItHadTheSameparty:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but also had other conflicting attributes. Chrome requires cookies that use the "`SameParty`" attribute to also have the "Secure" attribute, and to not be restricted to "`SameSite=Strict`".',blockedReasonSecureOnly:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "Secure" attribute but was not received over a secure connection.',blockedReasonSameSiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation.',blockedReasonSameSiteUnspecifiedTreatedAsLax:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax,`" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The `Set-Cookie` had to have been set with "`SameSite=None`" to enable cross-site usage.',blockedReasonSameSiteNoneInsecure:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameSite=None`" attribute but did not have the "Secure" attribute, which is required in order to use "`SameSite=None`".',blockedReasonOverwriteSecure:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute.",blockedReasonInvalidDomain:"This attempt to set a cookie via a `Set-Cookie` header was blocked because its Domain attribute was invalid with regards to the current host url.",blockedReasonInvalidPrefix:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`.',thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize:"This attempt to set a cookie via a `Set-Cookie` header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters.",setcookieHeaderIsIgnoredIn:"Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters.",exemptionReasonUserSetting:"This cookie is allowed by user preference.",exemptionReasonTPCDMetadata:"This cookie is allowed by a third-party cookie deprecation trial grace period. Learn more: goo.gle/dt-grace.",exemptionReasonTPCDDeprecationTrial:"This cookie is allowed by third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.",exemptionReasonTopLevelTPCDDeprecationTrial:"This cookie is allowed by top-level third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.",exemptionReasonTPCDHeuristics:"This cookie is allowed by third-party cookie heuristics. Learn more: goo.gle/hbe",exemptionReasonEnterprisePolicy:"This cookie is allowed by Chrome Enterprise policy. Learn more: goo.gle/ce-3pc",exemptionReasonStorageAccessAPI:"This cookie is allowed by the Storage Access API. Learn more: goo.gle/saa",exemptionReasonTopLevelStorageAccessAPI:"This cookie is allowed by the top-level Storage Access API. Learn more: goo.gle/saa-top",exemptionReasonScheme:"This cookie is allowed by the top-level url scheme"},Ci=n.i18n.registerUIStrings("core/sdk/NetworkRequest.ts",ki),xi=n.i18n.getLocalizedString.bind(void 0,Ci);class Ri extends e.ObjectWrapper.ObjectWrapper{#_o;#Ho;#wi;#Si;#ki;#Uo;#qo;#zo;#jo;#Vo;#Wo;#Go;#Ko;#Qo;#$o;#Xo;#Jo;statusCode;statusText;requestMethod;requestTime;protocol;alternateProtocolUsage;mixedContentType;#Yo;#Zo;#ea;#ta;#na;#ra;#sa;#ia;#oa;#aa;#la;#da;#ca;#ha;#ua;#ga;#pa;#ma;#fa;#ba;#ya;connectionId;connectionReused;hasNetworkData;#va;#Ia;#wa;#Sa;#ka;#Ca;#xa;#Ra;#Ta;#Ma;#Pa;localizedFailDescription;#Ii;#Ea;#La;#ge;#Aa;#Oa;#Da;#xi;#Na;#Pi;#h;#Fa;#Ba;#_a;#Ha;#Ua;#qa;#za;#ja;#Va;#Wa;#Ga;#Ka;#Qa;#$a;#Xa;#Ja;#Ya;#Za;#el;#tl;#nl;#rl;#sl;#il;#ol;#al;#ll;#dl=new Map;#cl;#hl;#ul;responseReceivedPromise;responseReceivedPromiseResolve;directSocketInfo;constructor(t,n,r,s,i,o,a,l){super(),this.#_o=t,this.#Ho=n,this.setUrl(r),this.#wi=s,this.#Si=i,this.#ki=o,this.#qo=a,this.#Uo=l,this.#zo=null,this.#jo=null,this.#Vo=null,this.#Wo=!1,this.#Go=null,this.#Ko=-1,this.#Qo=-1,this.#$o=-1,this.#Xo=void 0,this.#Jo=void 0,this.statusCode=0,this.statusText="",this.requestMethod="",this.requestTime=0,this.protocol="",this.alternateProtocolUsage=void 0,this.mixedContentType="none",this.#Yo=null,this.#Zo=null,this.#ea=null,this.#ta=null,this.#na=null,this.#ra=e.ResourceType.resourceTypes.Other,this.#sa=null,this.#ia=null,this.#oa=[],this.#aa={},this.#la="",this.#da=[],this.#ha=[],this.#ua=[],this.#ga={},this.#pa="",this.#ma="Unknown",this.#fa=null,this.#ba="unknown",this.#ya=null,this.connectionId="0",this.connectionReused=!1,this.hasNetworkData=!1,this.#va=null,this.#Ia=Promise.resolve(null),this.#wa=!1,this.#Sa=!1,this.#ka=[],this.#Ca=[],this.#xa=[],this.#Ra=[],this.#Pa=!1,this.#Ta=null,this.#Ma=null,this.localizedFailDescription=null,this.#al=null,this.#ll=!1,this.#cl=!1,this.#hl=!1}static create(e,t,n,r,s,i,o){return new Ri(e,e,t,n,r,s,i,o)}static createForWebSocket(e,t,n){return new Ri(e,e,t,r.DevToolsPath.EmptyUrlString,null,null,n||null)}static createWithoutBackendRequest(e,t,n,r){return new Ri(e,void 0,t,n,null,null,r)}identityCompare(e){const t=this.requestId(),n=e.requestId();return t>n?1:t<n?-1:0}requestId(){return this.#_o}backendRequestId(){return this.#Ho}url(){return this.#Ii}isBlobRequest(){return e.ParsedURL.schemeIs(this.#Ii,"blob:")}setUrl(t){this.#Ii!==t&&(this.#Ii=t,this.#Pi=new e.ParsedURL.ParsedURL(t),this.#sl=void 0,this.#il=void 0,this.#h=void 0,this.#Fa=void 0)}get documentURL(){return this.#wi}get parsedURL(){return this.#Pi}get frameId(){return this.#Si}get loaderId(){return this.#ki}setRemoteAddress(e,t){this.#pa=e+":"+t,this.dispatchEventToListeners(Ti.REMOTE_ADDRESS_CHANGED,this)}remoteAddress(){return this.#pa}remoteAddressSpace(){return this.#ma}getResponseCacheStorageCacheName(){return this.#Ua}setResponseCacheStorageCacheName(e){this.#Ua=e}serviceWorkerResponseSource(){return this.#qa}setServiceWorkerResponseSource(e){this.#qa=e}setReferrerPolicy(e){this.#fa=e}referrerPolicy(){return this.#fa}securityState(){return this.#ba}setSecurityState(e){this.#ba=e}securityDetails(){return this.#ya}securityOrigin(){return this.#Pi.securityOrigin()}setSecurityDetails(e){this.#ya=e}get startTime(){return this.#Qo||-1}setIssueTime(e,t){this.#Ko=e,this.#za=t,this.#Qo=e}issueTime(){return this.#Ko}pseudoWallTime(e){return this.#za?this.#za-this.#Ko+e:e}get responseReceivedTime(){return this.#Ea||-1}set responseReceivedTime(e){this.#Ea=e}getResponseRetrievalTime(){return this.#ja}setResponseRetrievalTime(e){this.#ja=e}get endTime(){return this.#$o||-1}set endTime(e){this.timing?.requestTime?this.#$o=Math.max(e,this.responseReceivedTime):(this.#$o=e,this.#Ea>e&&(this.#Ea=e)),this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}get duration(){return-1===this.#$o||-1===this.#Qo?-1:this.#$o-this.#Qo}get latency(){return-1===this.#Ea||-1===this.#Qo?-1:this.#Ea-this.#Qo}get resourceSize(){return this.#Va||0}set resourceSize(e){this.#Va=e}get transferSize(){return this.#La||0}increaseTransferSize(e){this.#La=(this.#La||0)+e}setTransferSize(e){this.#La=e}get finished(){return this.#ge}set finished(e){this.#ge!==e&&(this.#ge=e,e&&this.dispatchEventToListeners(Ti.FINISHED_LOADING,this))}get failed(){return this.#Aa}set failed(e){this.#Aa=e}get canceled(){return this.#Oa}set canceled(e){this.#Oa=e}get preserved(){return this.#Da}set preserved(e){this.#Da=e}blockedReason(){return this.#Xo}setBlockedReason(e){this.#Xo=e}corsErrorStatus(){return this.#Jo}setCorsErrorStatus(e){this.#Jo=e}wasBlocked(){return Boolean(this.#Xo)}cached(){return(Boolean(this.#Wa)||Boolean(this.#Ga))&&!this.#La}cachedInMemory(){return Boolean(this.#Wa)&&!this.#La}fromPrefetchCache(){return Boolean(this.#Ka)}setFromMemoryCache(){this.#Wa=!0,this.#Ja=void 0}get fromDiskCache(){return this.#Ga}setFromDiskCache(){this.#Ga=!0}setFromPrefetchCache(){this.#Ka=!0}fromEarlyHints(){return Boolean(this.#Qa)}setFromEarlyHints(){this.#Qa=!0}get fetchedViaServiceWorker(){return Boolean(this.#$a)}set fetchedViaServiceWorker(e){this.#$a=e}get serviceWorkerRouterInfo(){return this.#Xa}set serviceWorkerRouterInfo(e){this.#Xa=e}initiatedByServiceWorker(){const e=Z.forRequest(this);return!!e&&e.target().type()===U.ServiceWorker}get timing(){return this.#Ja}set timing(e){if(!e||this.#Wa)return;this.#Qo=e.requestTime;const t=e.requestTime+e.receiveHeadersEnd/1e3;((this.#Ea||-1)<0||this.#Ea>t)&&(this.#Ea=t),this.#Qo>this.#Ea&&(this.#Ea=this.#Qo),this.#Ja=e,this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}setConnectTimingFromExtraInfo(e){this.#Qo=e.requestTime,this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}get mimeType(){return this.#xi}set mimeType(t){if(this.#xi=t,"text/event-stream"===t&&!this.#ul){const t=this.resourceType()!==e.ResourceType.resourceTypes.EventSource;this.#ul=new bi(this,t)}}get displayName(){return this.#Pi.displayName}name(){return this.#h||this.parseNameAndPathFromURL(),this.#h}path(){return this.#Fa||this.parseNameAndPathFromURL(),this.#Fa}parseNameAndPathFromURL(){if(this.#Pi.isDataURL())this.#h=this.#Pi.dataURLDisplayName(),this.#Fa="";else if(this.#Pi.isBlobURL())this.#h=this.#Pi.url,this.#Fa="";else if(this.#Pi.isAboutBlank())this.#h=this.#Pi.url,this.#Fa="";else{this.#Fa=this.#Pi.host+this.#Pi.folderPathComponents;const t=Z.forRequest(this),n=t?e.ParsedURL.ParsedURL.fromString(t.target().inspectedURL()):null;this.#Fa=r.StringUtilities.trimURL(this.#Fa,n?n.host:""),this.#Pi.lastPathComponent||this.#Pi.queryParams?this.#h=this.#Pi.lastPathComponent+(this.#Pi.queryParams?"?"+this.#Pi.queryParams:""):this.#Pi.folderPathComponents?(this.#h=this.#Pi.folderPathComponents.substring(this.#Pi.folderPathComponents.lastIndexOf("/")+1)+"/",this.#Fa=this.#Fa.substring(0,this.#Fa.lastIndexOf("/"))):(this.#h=this.#Pi.host,this.#Fa="")}}get folder(){let e=this.#Pi.path;const t=e.indexOf("?");-1!==t&&(e=e.substring(0,t));const n=e.lastIndexOf("/");return-1!==n?e.substring(0,n):""}get pathname(){return this.#Pi.path}resourceType(){return this.#ra}setResourceType(e){this.#ra=e}get domain(){return this.#Pi.host}get scheme(){return this.#Pi.scheme}getInferredStatusText(){return this.statusText||(e=this.statusCode,n.i18n.lockedString({100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"}[e]??""));var e}redirectSource(){return this.#zo}setRedirectSource(e){this.#zo=e}preflightRequest(){return this.#jo}setPreflightRequest(e){this.#jo=e}preflightInitiatorRequest(){return this.#Vo}setPreflightInitiatorRequest(e){this.#Vo=e}isPreflightRequest(){return null!==this.#qo&&void 0!==this.#qo&&"preflight"===this.#qo.type}redirectDestination(){return this.#Go}setRedirectDestination(e){this.#Go=e}requestHeaders(){return this.#ua}setRequestHeaders(e){this.#ua=e,this.dispatchEventToListeners(Ti.REQUEST_HEADERS_CHANGED)}requestHeadersText(){return this.#Ya}setRequestHeadersText(e){this.#Ya=e,this.dispatchEventToListeners(Ti.REQUEST_HEADERS_CHANGED)}requestHeaderValue(e){return this.#ga[e]||(this.#ga[e]=this.computeHeaderValue(this.requestHeaders(),e)),this.#ga[e]}requestFormData(){return this.#Ia||(this.#Ia=Z.requestPostData(this)),this.#Ia}setRequestFormData(e,t){this.#Ia=e&&null===t?null:Promise.resolve(t),this.#va=null}filteredProtocolName(){const e=this.protocol.toLowerCase();return"h2"===e?"http/2.0":e.replace(/^http\/2(\.0)?\+/,"http/2.0+")}requestHttpVersion(){const e=this.requestHeadersText();if(!e){const e=this.requestHeaderValue("version")||this.requestHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/(HTTP\/\d+\.\d+)$/);return t?t[1]:"HTTP/0.9"}get responseHeaders(){return this.#Za||[]}set responseHeaders(e){this.#Za=e,this.#tl=void 0,this.#rl=void 0,this.#nl=void 0,this.#aa={},this.dispatchEventToListeners(Ti.RESPONSE_HEADERS_CHANGED)}get earlyHintsHeaders(){return this.#el||[]}set earlyHintsHeaders(e){this.#el=e}get originalResponseHeaders(){return this.#da}set originalResponseHeaders(e){this.#da=e,this.#ca=void 0}get setCookieHeaders(){return this.#ha}set setCookieHeaders(e){this.#ha=e}get responseHeadersText(){return this.#la}set responseHeadersText(e){this.#la=e,this.dispatchEventToListeners(Ti.RESPONSE_HEADERS_CHANGED)}get sortedResponseHeaders(){return void 0!==this.#tl?this.#tl:(this.#tl=this.responseHeaders.slice(),this.#tl.sort((function(e,t){return r.StringUtilities.compare(e.name.toLowerCase(),t.name.toLowerCase())})))}get sortedOriginalResponseHeaders(){return void 0!==this.#ca?this.#ca:(this.#ca=this.originalResponseHeaders.slice(),this.#ca.sort((function(e,t){return r.StringUtilities.compare(e.name.toLowerCase(),t.name.toLowerCase())})))}get overrideTypes(){const e=[];return this.hasOverriddenContent&&e.push("content"),this.hasOverriddenHeaders()&&e.push("headers"),e}get hasOverriddenContent(){return this.#cl}set hasOverriddenContent(e){this.#cl=e}#gl(e){const t=[];for(const n of e)t.length&&t[t.length-1].name===n.name?t[t.length-1].value+=`, ${n.value}`:t.push({name:n.name,value:n.value});return t}hasOverriddenHeaders(){if(!this.#da.length)return!1;const e=this.#gl(this.sortedResponseHeaders),t=this.#gl(this.sortedOriginalResponseHeaders);if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){if(e[n].name.toLowerCase()!==t[n].name.toLowerCase())return!0;if(e[n].value!==t[n].value)return!0}return!1}responseHeaderValue(e){return e in this.#aa||(this.#aa[e]=this.computeHeaderValue(this.responseHeaders,e)),this.#aa[e]}wasIntercepted(){return this.#ll}setWasIntercepted(e){this.#ll=e}setEarlyHintsHeaders(e){this.earlyHintsHeaders=e}get responseCookies(){if(!this.#nl)if(this.#nl=hi.parseSetCookie(this.responseHeaderValue("Set-Cookie"),this.domain)||[],this.#Ta)for(const e of this.#nl)e.partitioned()&&e.setPartitionKey(this.#Ta.topLevelSite,this.#Ta.hasCrossSiteAncestor);else if(this.#Ma)for(const e of this.#nl)e.setPartitionKeyOpaque();return this.#nl}responseLastModified(){return this.responseHeaderValue("last-modified")}allCookiesIncludingBlockedOnes(){return[...this.includedRequestCookies().map((e=>e.cookie)),...this.responseCookies,...this.blockedRequestCookies().map((e=>e.cookie)),...this.blockedResponseCookies().map((e=>e.cookie))].filter((e=>!!e))}get serverTimings(){return void 0===this.#rl&&(this.#rl=wi.parseHeaders(this.responseHeaders)),this.#rl}queryString(){if(void 0!==this.#sl)return this.#sl;let e=null;const t=this.url(),n=t.indexOf("?");if(-1!==n){e=t.substring(n+1);const r=e.indexOf("#");-1!==r&&(e=e.substring(0,r))}return this.#sl=e,this.#sl}get queryParameters(){if(this.#il)return this.#il;const e=this.queryString();return e?(this.#il=this.parseParameters(e),this.#il):null}async parseFormParameters(){const e=this.requestContentType();if(!e)return null;if(e.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)){const e=await this.requestFormData();return e?this.parseParameters(e):null}const t=e.match(/^multipart\/form-data\s*;\s*boundary\s*=\s*(\S+)\s*$/);if(!t)return null;const n=t[1];if(!n)return null;const r=await this.requestFormData();return r?this.parseMultipartFormDataParameters(r,n):null}formParameters(){return this.#va||(this.#va=this.parseFormParameters()),this.#va}responseHttpVersion(){const e=this.#la;if(!e){const e=this.responseHeaderValue("version")||this.responseHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/^(HTTP\/\d+\.\d+)/);return t?t[1]:"HTTP/0.9"}parseParameters(e){return e.split("&").map((function(e){const t=e.indexOf("=");return-1===t?{name:e,value:""}:{name:e.substring(0,t),value:e.substring(t+1)}}))}parseMultipartFormDataParameters(e,t){const n=r.StringUtilities.escapeForRegExp(t),s=new RegExp('^\\r\\ncontent-disposition\\s*:\\s*form-data\\s*;\\s*name="([^"]*)"(?:\\s*;\\s*filename="([^"]*)")?(?:\\r\\ncontent-type\\s*:\\s*([^\\r\\n]*))?\\r\\n\\r\\n(.*)\\r\\n$',"is");return e.split(new RegExp(`--${n}(?:--s*$)?`,"g")).reduce((function(e,t){const[n,r,i,o,a]=t.match(s)||[];if(!n)return e;const l=i||o?xi(ki.binary):a;return e.push({name:r,value:l}),e}),[])}computeHeaderValue(e,t){t=t.toLowerCase();const n=[];for(let r=0;r<e.length;++r)e[r].name.toLowerCase()===t&&n.push(e[r].value);if(n.length)return"set-cookie"===t?n.join("\n"):n.join(", ")}requestContentData(){return this.#sa||(this.#ol?this.#sa=this.#ol():this.#sa=Z.requestContentData(this)),this.#sa}setContentDataProvider(e){console.assert(!this.#sa,"contentData can only be set once."),this.#ol=e}requestStreamingContent(){if(this.#ia)return this.#ia;const e=this.finished?this.requestContentData():Z.streamResponseBody(this);return this.#ia=e.then((e=>t.ContentData.ContentData.isError(e)?e:t.StreamingContentData.StreamingContentData.from(e))),this.#ia}contentURL(){return this.#Ii}contentType(){return this.#ra}async requestContent(){return t.ContentData.ContentData.asDeferredContent(await this.requestContentData())}async searchInContent(e,n,r){if(!this.#ol)return await Z.searchInRequest(this,e,n,r);const s=await this.requestContentData();return t.ContentData.ContentData.isError(s)||!s.isTextContent?[]:t.TextUtils.performSearchInContentData(s,e,n,r)}requestContentType(){return this.requestHeaderValue("Content-Type")}hasErrorStatusCode(){return this.statusCode>=400}setInitialPriority(e){this.#Yo=e}initialPriority(){return this.#Yo}setPriority(e){this.#Zo=e}priority(){return this.#Zo||this.#Yo||null}setSignedExchangeInfo(e){this.#ea=e}signedExchangeInfo(){return this.#ea}setWebBundleInfo(e){this.#ta=e}webBundleInfo(){return this.#ta}setWebBundleInnerRequestInfo(e){this.#na=e}webBundleInnerRequestInfo(){return this.#na}async populateImageSource(e){const n=await this.requestContentData();if(t.ContentData.ContentData.isError(n))return;let r=n.asDataUrl();if(null===r&&!this.#Aa){(this.responseHeaderValue("cache-control")||"").includes("no-cache")||(r=this.#Ii)}null!==r&&(e.src=r)}initiator(){return this.#qo||null}hasUserGesture(){return this.#Uo??null}frames(){return this.#oa}addProtocolFrameError(e,t){this.addFrame({type:Mi.Error,text:e,time:this.pseudoWallTime(t),opCode:-1,mask:!1})}addProtocolFrame(e,t,n){const r=n?Mi.Send:Mi.Receive;this.addFrame({type:r,text:e.payloadData,time:this.pseudoWallTime(t),opCode:e.opcode,mask:e.mask})}addFrame(e){this.#oa.push(e),this.dispatchEventToListeners(Ti.WEBSOCKET_FRAME_ADDED,e)}eventSourceMessages(){return this.#ul?.eventSourceMessages??[]}addEventSourceMessage(e,t,n,r){this.#ul?.onProtocolEventSourceMessageReceived(t,r,n,this.pseudoWallTime(e))}markAsRedirect(e){this.#Wo=!0,this.#_o=`${this.#Ho}:redirected.${e}`}isRedirect(){return this.#Wo}setRequestIdForTest(e){this.#Ho=e,this.#_o=e}charset(){return this.#Na??null}setCharset(e){this.#Na=e}addExtraRequestInfo(e){this.#ka=e.blockedRequestCookies,this.#Ca=e.includedRequestCookies,this.setRequestHeaders(e.requestHeaders),this.#wa=!0,this.setRequestHeadersText(""),this.#Ba=e.clientSecurityState,this.setConnectTimingFromExtraInfo(e.connectTiming),this.#Pa=e.siteHasCookieInOtherPartition??!1,this.#hl=this.#ka.some((e=>e.blockedReasons.includes("ThirdPartyPhaseout")))}hasExtraRequestInfo(){return this.#wa}blockedRequestCookies(){return this.#ka}includedRequestCookies(){return this.#Ca}hasRequestCookies(){return this.#Ca.length>0||this.#ka.length>0}siteHasCookieInOtherPartition(){return this.#Pa}static parseStatusTextFromResponseHeadersText(e){return e.split("\r")[0].split(" ").slice(2).join(" ")}addExtraResponseInfo(e){if(this.#xa=e.blockedResponseCookies,e.exemptedResponseCookies&&(this.#Ra=e.exemptedResponseCookies),this.#Ta=e.cookiePartitionKey?e.cookiePartitionKey:null,this.#Ma=e.cookiePartitionKeyOpaque||null,this.responseHeaders=e.responseHeaders,this.originalResponseHeaders=e.responseHeaders.map((e=>({...e}))),e.responseHeadersText){if(this.responseHeadersText=e.responseHeadersText,!this.requestHeadersText()){let e=`${this.requestMethod} ${this.parsedURL.path}`;this.parsedURL.queryParams&&(e+=`?${this.parsedURL.queryParams}`),e+=" HTTP/1.1\r\n";for(const{name:t,value:n}of this.requestHeaders())e+=`${t}: ${n}\r\n`;this.setRequestHeadersText(e)}this.statusText=Ri.parseStatusTextFromResponseHeadersText(e.responseHeadersText)}this.#ma=e.resourceIPAddressSpace,e.statusCode&&(this.statusCode=e.statusCode),this.#Sa=!0;const t=Z.forRequest(this);if(!t)return;for(const e of this.#xa)if(e.blockedReasons.includes("NameValuePairExceedsMaxSize")){const e=xi(ki.setcookieHeaderIsIgnoredIn,{PH1:this.url()});t.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:this.#_o,warning:!0})}const n=t.target().model(di);if(n){for(const e of this.#Ra)n.removeBlockedCookie(e.cookie);for(const e of this.#xa){const t=e.cookie;t&&(e.blockedReasons.includes("ThirdPartyPhaseout")&&(this.#hl=!0),n.addBlockedCookie(t,e.blockedReasons.map((e=>({attribute:Ei(e),uiString:Pi(e)})))))}}}hasExtraResponseInfo(){return this.#Sa}blockedResponseCookies(){return this.#xa}exemptedResponseCookies(){return this.#Ra}nonBlockedResponseCookies(){const e=this.blockedResponseCookies().map((e=>e.cookieLine));return this.responseCookies.filter((t=>{const n=e.indexOf(t.getCookieLine());return-1===n||(e[n]=null,!1)}))}responseCookiesPartitionKey(){return this.#Ta}responseCookiesPartitionKeyOpaque(){return this.#Ma}redirectSourceSignedExchangeInfoHasNoErrors(){return null!==this.#zo&&null!==this.#zo.#ea&&!this.#zo.#ea.errors}clientSecurityState(){return this.#Ba}setTrustTokenParams(e){this.#_a=e}trustTokenParams(){return this.#_a}setTrustTokenOperationDoneEvent(e){this.#Ha=e,this.dispatchEventToListeners(Ti.TRUST_TOKEN_RESULT_ADDED)}trustTokenOperationDoneEvent(){return this.#Ha}setIsSameSite(e){this.#al=e}isSameSite(){return this.#al}getAssociatedData(e){return this.#dl.get(e)||null}setAssociatedData(e,t){this.#dl.set(e,t)}deleteAssociatedData(e){this.#dl.delete(e)}hasThirdPartyCookiePhaseoutIssue(){return this.#hl}addDataReceivedEvent({timestamp:e,dataLength:n,encodedDataLength:r,data:s}){this.resourceSize+=n,-1!==r&&this.increaseTransferSize(r),this.endTime=e,s&&this.#ia?.then((e=>{t.StreamingContentData.isError(e)||e.addChunk(s)}))}waitForResponseReceived(){if(this.responseReceivedPromise)return this.responseReceivedPromise;const{promise:e,resolve:t}=Promise.withResolvers();return this.responseReceivedPromise=e,this.responseReceivedPromiseResolve=t,this.responseReceivedPromise}}var Ti,Mi;!function(e){e.FINISHED_LOADING="FinishedLoading",e.TIMING_CHANGED="TimingChanged",e.REMOTE_ADDRESS_CHANGED="RemoteAddressChanged",e.REQUEST_HEADERS_CHANGED="RequestHeadersChanged",e.RESPONSE_HEADERS_CHANGED="ResponseHeadersChanged",e.WEBSOCKET_FRAME_ADDED="WebsocketFrameAdded",e.EVENT_SOURCE_MESSAGE_ADDED="EventSourceMessageAdded",e.TRUST_TOKEN_RESULT_ADDED="TrustTokenResultAdded"}(Ti||(Ti={})),function(e){e.Send="send",e.Receive="receive",e.Error="error"}(Mi||(Mi={}));const Pi=function(e){switch(e){case"SecureOnly":return xi(ki.blockedReasonSecureOnly);case"SameSiteStrict":return xi(ki.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Strict"});case"SameSiteLax":return xi(ki.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Lax"});case"SameSiteUnspecifiedTreatedAsLax":return xi(ki.blockedReasonSameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return xi(ki.blockedReasonSameSiteNoneInsecure);case"UserPreferences":return xi(ki.thisSetcookieWasBlockedDueToUser);case"SyntaxError":return xi(ki.thisSetcookieHadInvalidSyntax);case"SchemeNotSupported":return xi(ki.theSchemeOfThisConnectionIsNot);case"OverwriteSecure":return xi(ki.blockedReasonOverwriteSecure);case"InvalidDomain":return xi(ki.blockedReasonInvalidDomain);case"InvalidPrefix":return xi(ki.blockedReasonInvalidPrefix);case"UnknownError":return xi(ki.anUnknownErrorWasEncounteredWhenTrying);case"SchemefulSameSiteStrict":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Strict"});case"SchemefulSameSiteLax":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Lax"});case"SchemefulSameSiteUnspecifiedTreatedAsLax":return xi(ki.thisSetcookieDidntSpecifyASamesite);case"SamePartyFromCrossPartyContext":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSameparty);case"SamePartyConflictsWithOtherAttributes":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute);case"NameValuePairExceedsMaxSize":return xi(ki.thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize);case"DisallowedCharacter":return xi(ki.thisSetcookieHadADisallowedCharacter);case"ThirdPartyPhaseout":return xi(ki.thisSetcookieWasBlockedDueThirdPartyPhaseout)}return""},Ei=function(e){switch(e){case"SecureOnly":case"OverwriteSecure":return"secure";case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return"same-site";case"InvalidDomain":return"domain";case"InvalidPrefix":return"name";case"SamePartyConflictsWithOtherAttributes":case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"ThirdPartyPhaseout":case"SyntaxError":case"SchemeNotSupported":case"UnknownError":case"DisallowedCharacter":return null}return null};var Li,Ai;!function(e){e[e.TCP=1]="TCP",e[e.UDP_BOUND=2]="UDP_BOUND",e[e.UDP_CONNECTED=3]="UDP_CONNECTED"}(Li||(Li={})),function(e){e[e.OPENING=1]="OPENING",e[e.OPEN=2]="OPEN",e[e.CLOSED=3]="CLOSED",e[e.ABORTED=4]="ABORTED"}(Ai||(Ai={}));var Oi=Object.freeze({__proto__:null,get DirectSocketStatus(){return Ai},get DirectSocketType(){return Li},get Events(){return Ti},NetworkRequest:Ri,get WebSocketFrameType(){return Mi},cookieBlockedReasonToAttribute:function(e){switch(e){case"SecureOnly":return"secure";case"NotOnPath":return"path";case"DomainMismatch":return"domain";case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return"same-site";case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"ThirdPartyPhaseout":case"UnknownError":return null}return null},cookieBlockedReasonToUiString:function(e){switch(e){case"SecureOnly":return xi(ki.secureOnly);case"NotOnPath":return xi(ki.notOnPath);case"DomainMismatch":return xi(ki.domainMismatch);case"SameSiteStrict":return xi(ki.sameSiteStrict);case"SameSiteLax":return xi(ki.sameSiteLax);case"SameSiteUnspecifiedTreatedAsLax":return xi(ki.sameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return xi(ki.sameSiteNoneInsecure);case"UserPreferences":return xi(ki.userPreferences);case"UnknownError":return xi(ki.unknownError);case"SchemefulSameSiteStrict":return xi(ki.schemefulSameSiteStrict);case"SchemefulSameSiteLax":return xi(ki.schemefulSameSiteLax);case"SchemefulSameSiteUnspecifiedTreatedAsLax":return xi(ki.schemefulSameSiteUnspecifiedTreatedAsLax);case"SamePartyFromCrossPartyContext":return xi(ki.samePartyFromCrossPartyContext);case"NameValuePairExceedsMaxSize":return xi(ki.nameValuePairExceedsMaxSize);case"ThirdPartyPhaseout":return xi(ki.thirdPartyPhaseout)}return""},cookieExemptionReasonToUiString:function(e){switch(e){case"UserSetting":return xi(ki.exemptionReasonUserSetting);case"TPCDMetadata":return xi(ki.exemptionReasonTPCDMetadata);case"TopLevelTPCDDeprecationTrial":return xi(ki.exemptionReasonTopLevelTPCDDeprecationTrial);case"TPCDDeprecationTrial":return xi(ki.exemptionReasonTPCDDeprecationTrial);case"TPCDHeuristics":return xi(ki.exemptionReasonTPCDHeuristics);case"EnterprisePolicy":return xi(ki.exemptionReasonEnterprisePolicy);case"StorageAccess":return xi(ki.exemptionReasonStorageAccessAPI);case"TopLevelStorageAccess":return xi(ki.exemptionReasonTopLevelStorageAccessAPI);case"Scheme":return xi(ki.exemptionReasonScheme)}return""},setCookieBlockedReasonToAttribute:Ei,setCookieBlockedReasonToUiString:Pi});class Di{#pl;#C;#ml;#fl;#bl;#yl;#vl;#h;#Zt;#u;#Il;#wl;#Sl;#kl;constructor(e,t){this.#pl=e,this.#C=t.nodeId,e.setAXNodeForAXId(this.#C,this),t.backendDOMNodeId?(e.setAXNodeForBackendDOMNodeId(t.backendDOMNodeId,this),this.#ml=t.backendDOMNodeId,this.#fl=new js(e.target(),t.backendDOMNodeId)):(this.#ml=null,this.#fl=null),this.#bl=t.ignored,this.#bl&&"ignoredReasons"in t&&(this.#yl=t.ignoredReasons),this.#vl=t.role||null,this.#h=t.name||null,this.#Zt=t.description||null,this.#u=t.value||null,this.#Il=t.properties||null,this.#kl=[...new Set(t.childIds)],this.#wl=t.parentId||null,t.frameId&&!t.parentId?(this.#Sl=t.frameId,e.setRootAXNodeForFrameId(t.frameId,this)):this.#Sl=null}id(){return this.#C}accessibilityModel(){return this.#pl}ignored(){return this.#bl}ignoredReasons(){return this.#yl||null}role(){return this.#vl||null}coreProperties(){const e=[];return this.#h&&e.push({name:"name",value:this.#h}),this.#Zt&&e.push({name:"description",value:this.#Zt}),this.#u&&e.push({name:"value",value:this.#u}),e}name(){return this.#h||null}description(){return this.#Zt||null}value(){return this.#u||null}properties(){return this.#Il||null}parentNode(){return this.#wl?this.#pl.axNodeForId(this.#wl):null}isDOMNode(){return Boolean(this.#ml)}backendDOMNodeId(){return this.#ml}deferredDOMNode(){return this.#fl}highlightDOMNode(){const e=this.deferredDOMNode();e&&e.highlight()}children(){if(!this.#kl)return[];const e=[];for(const t of this.#kl){const n=this.#pl.axNodeForId(t);n&&e.push(n)}return e}numChildren(){return this.#kl?this.#kl.length:0}hasOnlyUnloadedChildren(){return!(!this.#kl||!this.#kl.length)&&this.#kl.every((e=>null===this.#pl.axNodeForId(e)))}hasUnloadedChildren(){return!(!this.#kl||!this.#kl.length)&&this.#kl.some((e=>null===this.#pl.axNodeForId(e)))}getFrameId(){return this.#Sl||this.parentNode()?.getFrameId()||null}}class Ni extends h{agent;#Cl=new Map;#xl=new Map;#Rl=new Map;#Tl=new Map;#Ml=null;constructor(e){super(e),e.registerAccessibilityDispatcher(this),this.agent=e.accessibilityAgent(),this.resumeModel()}clear(){this.#Ml=null,this.#Cl.clear(),this.#xl.clear(),this.#Rl.clear()}async resumeModel(){await this.agent.invoke_enable()}async suspendModel(){await this.agent.invoke_disable()}async requestPartialAXTree(e){const{nodes:t}=await this.agent.invoke_getPartialAXTree({nodeId:e.id,fetchRelatives:!0});if(!t)return;const n=[];for(const e of t)n.push(new Di(this,e))}loadComplete({root:e}){this.clear(),this.#Ml=new Di(this,e),this.dispatchEventToListeners("TreeUpdated",{root:this.#Ml})}nodesUpdated({nodes:e}){this.createNodesFromPayload(e),this.dispatchEventToListeners("TreeUpdated",{})}createNodesFromPayload(e){return e.map((e=>new Di(this,e)))}async requestRootNode(e){if(e&&this.#Rl.has(e))return this.#Rl.get(e);if(!e&&this.#Ml)return this.#Ml;const{node:t}=await this.agent.invoke_getRootAXNode({frameId:e});return t?this.createNodesFromPayload([t])[0]:void 0}async requestAXChildren(e,t){const n=this.#Cl.get(e);if(!n)throw new Error("Cannot request children before parent");if(!n.hasUnloadedChildren())return n.children();const r=this.#Tl.get(e);if(r)await r;else{const n=this.agent.invoke_getChildAXNodes({id:e,frameId:t});this.#Tl.set(e,n);const r=await n;r.getError()||(this.createNodesFromPayload(r.nodes),this.#Tl.delete(e))}return n.children()}async requestAndLoadSubTreeToNode(e){const t=[];let n=this.axNodeForDOMNode(e);for(;n;){t.push(n);const e=n.parentNode();if(!e)return t;n=e}const{nodes:r}=await this.agent.invoke_getAXNodeAndAncestors({backendNodeId:e.backendNodeId()});if(!r)return null;return this.createNodesFromPayload(r)}axNodeForId(e){return this.#Cl.get(e)||null}setRootAXNodeForFrameId(e,t){this.#Rl.set(e,t)}setAXNodeForAXId(e,t){this.#Cl.set(e,t)}axNodeForDOMNode(e){return e?this.#xl.get(e.backendNodeId())??null:null}setAXNodeForBackendDOMNodeId(e,t){this.#xl.set(e,t)}getAgent(){return this.agent}}h.register(Ni,{capabilities:2,autostart:!1});var Fi=Object.freeze({__proto__:null,AccessibilityModel:Ni,AccessibilityNode:Di});class Bi extends h{#Ws;#Pl=1;#El=[];constructor(e){super(e),this.#Ws=e.pageAgent(),e.registerPageDispatcher(this)}async startScreencast(e,t,n,r,s,i,o){this.#El.at(-1)&&await this.#Ws.invoke_stopScreencast();const a={id:this.#Pl++,request:{format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s},callbacks:{onScreencastFrame:i,onScreencastVisibilityChanged:o}};return this.#El.push(a),this.#Ws.invoke_startScreencast({format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s}),a.id}stopScreencast(e){const t=this.#El.pop();if(!t)throw new Error("There is no screencast operation to stop.");if(t.id!==e)throw new Error("Trying to stop a screencast operation that is not being served right now.");this.#Ws.invoke_stopScreencast();const n=this.#El.at(-1);n&&this.#Ws.invoke_startScreencast({format:n.request.format,quality:n.request.quality,maxWidth:n.request.maxWidth,maxHeight:n.request.maxHeight,everyNthFrame:n.request.everyNthFrame})}async captureScreenshot(e,t,n,r){const s={format:e,quality:t,fromSurface:!0};switch(n){case"fromClip":s.captureBeyondViewport=!0,s.clip=r;break;case"fullpage":s.captureBeyondViewport=!0;break;case"fromViewport":s.captureBeyondViewport=!1;break;default:throw new Error("Unexpected or unspecified screnshotMode")}await Fs.muteHighlight();const i=await this.#Ws.invoke_captureScreenshot(s);return await Fs.unmuteHighlight(),i.data}screencastFrame({data:e,metadata:t,sessionId:n}){this.#Ws.invoke_screencastFrameAck({sessionId:n});const r=this.#El.at(-1);r&&r.callbacks.onScreencastFrame.call(null,e,t)}screencastVisibilityChanged({visible:e}){const t=this.#El.at(-1);t&&t.callbacks.onScreencastVisibilityChanged.call(null,e)}backForwardCacheNotUsed(e){}domContentEventFired(e){}loadEventFired(e){}lifecycleEvent(e){}navigatedWithinDocument(e){}frameAttached(e){}frameNavigated(e){}documentOpened(e){}frameDetached(e){}frameStartedLoading(e){}frameStoppedLoading(e){}frameRequestedNavigation(e){}frameStartedNavigating(e){}frameSubtreeWillBeDetached(e){}frameScheduledNavigation(e){}frameClearedScheduledNavigation(e){}frameResized(){}javascriptDialogOpening(e){}javascriptDialogClosed(e){}interstitialShown(){}interstitialHidden(){}windowOpen(e){}fileChooserOpened(e){}compilationCacheProduced(e){}downloadWillBegin(e){}downloadProgress(){}prefetchStatusUpdated(e){}prerenderStatusUpdated(e){}}h.register(Bi,{capabilities:64,autostart:!1});var _i=Object.freeze({__proto__:null,ScreenCaptureModel:Bi});const Hi="devtools_animations",Ui="__devtools_report_scroll_position__",qi=e=>`__devtools_scroll_listener_${e}__`;async function zi(e,t){const n=e.domModel().target().model(ii),r=e.domModel().target().pageAgent();for(const s of n.frames()){const{executionContextId:n}=await r.invoke_createIsolatedWorld({frameId:s.id,worldName:t}),i=await e.resolveToObject(void 0,n);if(i)return i}return null}class ji{#Ll;#Al=new Map;#Ol;static lastAddedListenerId=0;constructor(e){this.#Ll=e}async#Dl(){if(this.#Ol)return;this.#Ol=e=>{const{name:t,payload:n}=e.data;if(t!==Ui)return;const{scrollTop:r,scrollLeft:s,id:i}=JSON.parse(n),o=this.#Al.get(i);o&&o({scrollTop:r,scrollLeft:s})};const e=this.#Ll.domModel().target().model(Jr);await e.addBinding({name:Ui,executionContextName:Hi}),e.addEventListener($r.BindingCalled,this.#Ol)}async#Nl(){if(!this.#Ol)return;const e=this.#Ll.domModel().target().model(Jr);await e.removeBinding({name:Ui}),e.removeEventListener($r.BindingCalled,this.#Ol),this.#Ol=void 0}async addScrollEventListener(e){ji.lastAddedListenerId++;const t=ji.lastAddedListenerId;this.#Al.set(t,e),this.#Ol||await this.#Dl();const n=await zi(this.#Ll,Hi);return n?(await n.callFunction((function(e,t,n){if("scrollingElement"in this&&!this.scrollingElement)return;const r="scrollingElement"in this?this.scrollingElement:this;this[n]=()=>{globalThis[t](JSON.stringify({scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,id:e}))},this.addEventListener("scroll",this[n],!0)}),[t,Ui,qi(t)].map((e=>Bn.toCallArgument(e)))),n.release(),t):null}async removeScrollEventListener(e){const t=await zi(this.#Ll,Hi);t&&(await t.callFunction((function(e){this.removeEventListener("scroll",this[e]),delete this[e]}),[qi(e)].map((e=>Bn.toCallArgument(e)))),t.release(),this.#Al.delete(e),0===this.#Al.size&&await this.#Nl())}async scrollTop(){return await this.#Ll.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollTop:0;return this.scrollTop})).then((e=>e?.value??null))}async scrollLeft(){return await this.#Ll.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollLeft:0;return this.scrollLeft})).then((e=>e?.value??null))}async setScrollTop(e){await this.#Ll.callFunction((function(e){if("scrollingElement"in this){if(!this.scrollingElement)return;this.scrollingElement.scrollTop=e}else this.scrollTop=e}),[e])}async setScrollLeft(e){await this.#Ll.callFunction((function(e){if("scrollingElement"in this){if(!this.scrollingElement)return;this.scrollingElement.scrollLeft=e}else this.scrollLeft=e}),[e])}async verticalScrollRange(){return await this.#Ll.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollHeight-this.scrollingElement.clientHeight:0;return this.scrollHeight-this.clientHeight})).then((e=>e?.value??null))}async horizontalScrollRange(){return await this.#Ll.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollWidth-this.scrollingElement.clientWidth:0;return this.scrollWidth-this.clientWidth})).then((e=>e?.value??null))}}function Vi(e,t){const n=e.viewOrScrollTimeline(),r=t.viewOrScrollTimeline();return n?Boolean(r&&n.sourceNodeId===r.sourceNodeId&&n.axis===r.axis):!r&&e.startTime()===t.startTime()}class Wi extends h{runtimeModel;agent;#Fl=new Map;animationGroups=new Map;#Bl=new Set;playbackRate=1;#_l;#Hl;constructor(t){super(t),this.runtimeModel=t.model(Jr),this.agent=t.animationAgent(),t.registerAnimationDispatcher(new Yi(this)),t.suspended()||this.agent.invoke_enable();t.model(ii).addEventListener(ri.PrimaryPageChanged,this.reset,this);const n=t.model(Bi);n&&(this.#_l=new Zi(this,n)),this.#Hl=e.Debouncer.debounce((()=>{for(;this.#Bl.size;)this.matchExistingGroups(this.createGroupFromPendingAnimations())}),100)}reset(){this.#Fl.clear(),this.animationGroups.clear(),this.#Bl.clear(),this.dispatchEventToListeners(Gi.ModelReset)}async devicePixelRatio(){const e=await this.target().runtimeAgent().invoke_evaluate({expression:"window.devicePixelRatio"});return"number"===e?.result.type?e?.result.value??1:1}async getAnimationGroupForAnimation(e,t){for(const n of this.animationGroups.values())for(const r of n.animations())if(r.name()===e){const e=await r.source().node();if(e?.id===t)return n}return null}animationCanceled(e){this.#Bl.delete(e)}async animationUpdated(e){let t,n;for(const r of this.animationGroups.values())if(n=r.animations().find((t=>t.id()===e.id)),n){t=r;break}n&&t&&(await n.setPayload(e),this.dispatchEventToListeners(Gi.AnimationGroupUpdated,t))}async animationStarted(e){if(!e.source||!e.source.backendNodeId)return;const t=await Ki.parsePayload(this,e),n=t.source().keyframesRule();"WebAnimation"===t.type()&&n&&0===n.keyframes().length?this.#Bl.delete(t.id()):(this.#Fl.set(t.id(),t),this.#Bl.add(t.id())),this.#Hl()}matchExistingGroups(e){let t=null;for(const n of this.animationGroups.values()){if(n.matches(e)){t=n,n.rebaseTo(e);break}if(n.shouldInclude(e)){t=n,n.appendAnimations(e.animations());break}}return t?this.dispatchEventToListeners(Gi.AnimationGroupUpdated,t):(this.animationGroups.set(e.id(),e),this.#_l&&this.#_l.captureScreenshots(e.finiteDuration(),e.screenshotsInternal),this.dispatchEventToListeners(Gi.AnimationGroupStarted,e)),Boolean(t)}createGroupFromPendingAnimations(){console.assert(this.#Bl.size>0);const e=this.#Bl.values().next().value;this.#Bl.delete(e);const t=this.#Fl.get(e);if(!t)throw new Error("Unable to locate first animation");const n=[t],r=new Set;for(const e of this.#Bl){const s=this.#Fl.get(e);Vi(t,s)?n.push(s):r.add(e)}return this.#Bl=r,n.sort(((e,t)=>e.startTime()-t.startTime())),new Ji(this,e,n)}setPlaybackRate(e){this.playbackRate=e,this.agent.invoke_setPlaybackRate({playbackRate:e})}async releaseAllAnimations(){const e=[...this.animationGroups.values()].flatMap((e=>e.animations().map((e=>e.id()))));await this.agent.invoke_releaseAnimations({animations:e})}releaseAnimations(e){this.agent.invoke_releaseAnimations({animations:e})}async suspendModel(){await this.agent.invoke_disable().then((()=>this.reset()))}async resumeModel(){await this.agent.invoke_enable()}}var Gi;!function(e){e.AnimationGroupStarted="AnimationGroupStarted",e.AnimationGroupUpdated="AnimationGroupUpdated",e.ModelReset="ModelReset"}(Gi||(Gi={}));class Ki{#Ul;#ql;#zl;#jl;constructor(e){this.#Ul=e}static async parsePayload(e,t){const n=new Ki(e);return await n.setPayload(t),n}async setPayload(e){if(e.viewOrScrollTimeline){const t=await this.#Ul.devicePixelRatio();e.viewOrScrollTimeline.startOffset&&(e.viewOrScrollTimeline.startOffset/=t),e.viewOrScrollTimeline.endOffset&&(e.viewOrScrollTimeline.endOffset/=t)}this.#ql=e,this.#zl&&e.source?this.#zl.setPayload(e.source):!this.#zl&&e.source&&(this.#zl=new Qi(this.#Ul,e.source))}percentageToPixels(e,t){const{startOffset:n,endOffset:r}=t;if(void 0===n||void 0===r)throw new Error("startOffset or endOffset does not exist in viewOrScrollTimeline");return e/100*(r-n)}viewOrScrollTimeline(){return this.#ql.viewOrScrollTimeline}id(){return this.#ql.id}name(){return this.#ql.name}paused(){return this.#ql.pausedState}playState(){return this.#jl||this.#ql.playState}playbackRate(){return this.#ql.playbackRate}startTime(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.playbackRate()>0?this.#ql.startTime:100-this.#ql.startTime,e)+(this.viewOrScrollTimeline()?.startOffset??0):this.#ql.startTime}iterationDuration(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.source().duration(),e):this.source().duration()}endTime(){return this.source().iterations?this.viewOrScrollTimeline()?this.startTime()+this.iterationDuration()*this.source().iterations():this.startTime()+this.source().delay()+this.source().duration()*this.source().iterations()+this.source().endDelay():1/0}finiteDuration(){const e=Math.min(this.source().iterations(),3);return this.viewOrScrollTimeline()?this.iterationDuration()*e:this.source().delay()+this.source().duration()*e}currentTime(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.#ql.currentTime,e):this.#ql.currentTime}source(){return this.#zl}type(){return this.#ql.type}overlaps(e){if(!this.source().iterations()||!e.source().iterations())return!0;const t=this.startTime()<e.startTime()?this:e,n=t===this?e:this;return t.endTime()>=n.startTime()}delayOrStartTime(){return this.viewOrScrollTimeline()?this.startTime():this.source().delay()}setTiming(e,t){this.#zl.node().then((n=>{if(!n)throw new Error("Unable to find node");this.updateNodeStyle(e,t,n)})),this.#zl.durationInternal=e,this.#zl.delayInternal=t,this.#Ul.agent.invoke_setTiming({animationId:this.id(),duration:e,delay:t})}updateNodeStyle(e,t,n){let r;if("CSSTransition"===this.type())r="transition-";else{if("CSSAnimation"!==this.type())return;r="animation-"}if(!n.id)throw new Error("Node has no id");const s=n.domModel().cssModel();s.setEffectivePropertyValueForNode(n.id,r+"duration",e+"ms"),s.setEffectivePropertyValueForNode(n.id,r+"delay",t+"ms")}async remoteObjectPromise(){const e=await this.#Ul.agent.invoke_resolveAnimation({animationId:this.id()});return e?this.#Ul.runtimeModel.createRemoteObject(e.remoteObject):null}cssId(){return this.#ql.cssId||""}}class Qi{#Ul;#ts;delayInternal;durationInternal;#Vl;#Wl;constructor(e,t){this.#Ul=e,this.setPayload(t)}setPayload(e){this.#ts=e,!this.#Vl&&e.keyframesRule?this.#Vl=new $i(e.keyframesRule):this.#Vl&&e.keyframesRule&&this.#Vl.setPayload(e.keyframesRule),this.delayInternal=e.delay,this.durationInternal=e.duration}delay(){return this.delayInternal}endDelay(){return this.#ts.endDelay}iterations(){return this.delay()||this.endDelay()||this.duration()?this.#ts.iterations||1/0:0}duration(){return this.durationInternal}direction(){return this.#ts.direction}fill(){return this.#ts.fill}node(){return this.#Wl||(this.#Wl=new js(this.#Ul.target(),this.backendNodeId())),this.#Wl.resolvePromise()}deferredNode(){return new js(this.#Ul.target(),this.backendNodeId())}backendNodeId(){return this.#ts.backendNodeId}keyframesRule(){return this.#Vl||null}easing(){return this.#ts.easing}}class $i{#ts;#rt;constructor(e){this.setPayload(e)}setPayload(e){this.#ts=e,this.#rt?this.#ts.keyframes.forEach(((e,t)=>{this.#rt[t]?.setPayload(e)})):this.#rt=this.#ts.keyframes.map((e=>new Xi(e)))}name(){return this.#ts.name}keyframes(){return this.#rt}}class Xi{#ts;#Gl;constructor(e){this.setPayload(e)}setPayload(e){this.#ts=e,this.#Gl=e.offset}offset(){return this.#Gl}setOffset(e){this.#Gl=100*e+"%"}offsetAsNumber(){return parseFloat(this.#Gl)/100}easing(){return this.#ts.easing}}class Ji{#Ul;#C;#Kl;#Ql;#$l;screenshotsInternal;#Xl;constructor(e,t,n){this.#Ul=e,this.#C=t,this.#Ql=n,this.#$l=!1,this.screenshotsInternal=[],this.#Xl=[]}isScrollDriven(){return Boolean(this.#Ql[0]?.viewOrScrollTimeline())}id(){return this.#C}animations(){return this.#Ql}release(){this.#Ul.animationGroups.delete(this.id()),this.#Ul.releaseAnimations(this.animationIds())}animationIds(){return this.#Ql.map((function(e){return e.id()}))}startTime(){return this.#Ql[0].startTime()}groupDuration(){let e=0;for(const t of this.#Ql)e=Math.max(e,t.delayOrStartTime()+t.iterationDuration());return e}finiteDuration(){let e=0;for(let t=0;t<this.#Ql.length;++t)e=Math.max(e,this.#Ql[t].finiteDuration());return e}scrollOrientation(){const e=this.#Ql[0]?.viewOrScrollTimeline();return e?e.axis:null}async scrollNode(){if(this.#Kl)return this.#Kl;if(!this.isScrollDriven())return null;const e=this.#Ql[0]?.viewOrScrollTimeline()?.sourceNodeId;if(!e)return null;const t=new js(this.#Ul.target(),e),n=await t.resolvePromise();return n?(this.#Kl=new ji(n),this.#Kl):null}seekTo(e){this.#Ul.agent.invoke_seekAnimations({animations:this.animationIds(),currentTime:e})}paused(){return this.#$l}togglePause(e){e!==this.#$l&&(this.#$l=e,this.#Ul.agent.invoke_setPaused({animations:this.animationIds(),paused:e}))}currentTimePromise(){let e=null;for(const t of this.#Ql)(!e||t.endTime()>e.endTime())&&(e=t);if(!e)throw new Error("No longest animation found");return this.#Ul.agent.invoke_getCurrentTime({id:e.id()}).then((({currentTime:e})=>e||0))}matches(e){function t(e){const t=(e.viewOrScrollTimeline()?.sourceNodeId??"")+(e.viewOrScrollTimeline()?.axis??"");return("WebAnimation"===e.type()?e.type()+e.id():e.cssId())+t}if(this.#Ql.length!==e.#Ql.length)return!1;const n=this.#Ql.map(t).sort(),r=e.#Ql.map(t).sort();for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}shouldInclude(e){const[t]=e.#Ql,[n]=this.#Ql;return Vi(n,t)}appendAnimations(e){this.#Ql.push(...e)}rebaseTo(e){this.#Ul.releaseAnimations(this.animationIds()),this.#Ql=e.#Ql,this.#Kl=void 0}screenshots(){for(let e=0;e<this.screenshotsInternal.length;++e){const t=new Image;t.src="data:image/jpeg;base64,"+this.screenshotsInternal[e],this.#Xl.push(t)}return this.screenshotsInternal=[],this.#Xl}}class Yi{#Ul;constructor(e){this.#Ul=e}animationCreated(e){}animationCanceled({id:e}){this.#Ul.animationCanceled(e)}animationStarted({animation:e}){this.#Ul.animationStarted(e)}animationUpdated({animation:e}){this.#Ul.animationUpdated(e)}}class Zi{#de;#Jl;#Ul;#Yl=!1;#Zl;#ed;#td;constructor(e,t){this.#de=[],this.#Jl=t,this.#Ul=e,this.#Ul.addEventListener(Gi.ModelReset,this.stopScreencast,this)}async captureScreenshots(e,t){const n=Math.min(e/this.#Ul.playbackRate,3e3),r=n+window.performance.now();this.#de.push({endTime:r,screenshots:t}),(!this.#td||r>this.#td)&&(clearTimeout(this.#ed),this.#ed=window.setTimeout(this.stopScreencast.bind(this),n),this.#td=r),this.#Yl||(this.#Yl=!0,this.#Zl=await this.#Jl.startScreencast("jpeg",80,void 0,300,2,this.screencastFrame.bind(this),(e=>{})))}screencastFrame(e,t){if(!this.#Yl)return;const n=window.performance.now();this.#de=this.#de.filter((function(e){return e.endTime>=n}));for(const t of this.#de)t.screenshots.push(e)}stopScreencast(){this.#Zl&&(this.#Jl.stopScreencast(this.#Zl),this.#ed=void 0,this.#td=void 0,this.#de=[],this.#Yl=!1,this.#Zl=void 0)}}h.register(Wi,{capabilities:2,autostart:!0});var eo=Object.freeze({__proto__:null,AnimationDOMNode:ji,AnimationDispatcher:Yi,AnimationEffect:Qi,AnimationGroup:Ji,AnimationImpl:Ki,AnimationModel:Wi,get Events(){return Gi},KeyframeStyle:Xi,KeyframesRule:$i,ScreenshotCapture:Zi});class to extends h{agent;#fr;#nd;constructor(t){super(t),this.agent=t.autofillAgent(),this.#nd=e.Settings.Settings.instance().createSetting("show-test-addresses-in-autofill-menu-on-event",!1),t.registerAutofillDispatcher(this),this.enable()}setTestAddresses(){this.agent.invoke_setAddresses({addresses:this.#nd.get()?[{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"US"},{name:"NAME_FULL",value:"Jon Stewart Doe"},{name:"NAME_FIRST",value:"Jon"},{name:"NAME_MIDDLE",value:"Stewart"},{name:"NAME_LAST",value:"Doe"},{name:"COMPANY_NAME",value:"Fake Company"},{name:"ADDRESS_HOME_LINE1",value:"1600 Fake Street"},{name:"ADDRESS_HOME_LINE2",value:"Apartment 1"},{name:"ADDRESS_HOME_ZIP",value:"94043"},{name:"ADDRESS_HOME_CITY",value:"Mountain View"},{name:"ADDRESS_HOME_STATE",value:"CA"},{name:"EMAIL_ADDRESS",value:"test@example.us"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+16019521325"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"BR"},{name:"NAME_FULL",value:"João Souza Silva"},{name:"NAME_FIRST",value:"João"},{name:"NAME_LAST",value:"Souza Silva"},{name:"NAME_LAST_FIRST",value:"Souza"},{name:"NAME_LAST_SECOND",value:"Silva"},{name:"COMPANY_NAME",value:"Empresa Falsa"},{name:"ADDRESS_HOME_STREET_ADDRESS",value:"Rua Inexistente, 2000\nAndar 2, Apartamento 1"},{name:"ADDRESS_HOME_STREET_LOCATION",value:"Rua Inexistente, 2000"},{name:"ADDRESS_HOME_STREET_NAME",value:"Rua Inexistente"},{name:"ADDRESS_HOME_HOUSE_NUMBER",value:"2000"},{name:"ADDRESS_HOME_SUBPREMISE",value:"Andar 2, Apartamento 1"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_FLOOR",value:"2"},{name:"ADDRESS_HOME_APT",value:"Apartamento 1"},{name:"ADDRESS_HOME_APT_TYPE",value:"Apartamento"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_DEPENDENT_LOCALITY",value:"Santa Efigênia"},{name:"ADDRESS_HOME_LANDMARK",value:"Próximo à estação Santa Efigênia"},{name:"ADDRESS_HOME_OVERFLOW",value:"Andar 2, Apartamento 1"},{name:"ADDRESS_HOME_ZIP",value:"30260-080"},{name:"ADDRESS_HOME_CITY",value:"Belo Horizonte"},{name:"ADDRESS_HOME_STATE",value:"MG"},{name:"EMAIL_ADDRESS",value:"teste@exemplo.us"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+553121286800"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"MX"},{name:"NAME_FULL",value:"Juan Francisco García Flores"},{name:"NAME_FIRST",value:"Juan Francisco"},{name:"NAME_LAST",value:"García Flores"},{name:"NAME_LAST_FIRST",value:"García"},{name:"NAME_LAST_SECOND",value:"Flores"},{name:"COMPANY_NAME",value:"Empresa Falsa"},{name:"ADDRESS_HOME_STREET_ADDRESS",value:"C. Falsa 445\nPiso 2, Apartamento 1\nEntre calle Volcán y calle Montes Blancos, cerca de la estación de metro"},{name:"ADDRESS_HOME_STREET_LOCATION",value:"C. Falsa 445"},{name:"ADDRESS_HOME_STREET_NAME",value:"C. Falsa"},{name:"ADDRESS_HOME_HOUSE_NUMBER",value:"445"},{name:"ADDRESS_HOME_SUBPREMISE",value:"Piso 2, Apartamento 1"},{name:"ADDRESS_HOME_FLOOR",value:"2"},{name:"ADDRESS_HOME_APT",value:"Apartamento 1"},{name:"ADDRESS_HOME_APT_TYPE",value:"Apartamento"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_DEPENDENT_LOCALITY",value:"Lomas de Chapultepec"},{name:"ADDRESS_HOME_OVERFLOW",value:"Entre calle Volcán y calle Montes Celestes, cerca de la estación de metro"},{name:"ADDRESS_HOME_BETWEEN_STREETS_OR_LANDMARK",value:"Entre calle Volcán y calle Montes Blancos, cerca de la estación de metro"},{name:"ADDRESS_HOME_LANDMARK",value:"Cerca de la estación de metro"},{name:"ADDRESS_HOME_BETWEEN_STREETS",value:"Entre calle Volcán y calle Montes Blancos"},{name:"ADDRESS_HOME_BETWEEN_STREETS_1",value:"calle Volcán"},{name:"ADDRESS_HOME_BETWEEN_STREETS_2",value:"calle Montes Blancos"},{name:"ADDRESS_HOME_ADMIN_LEVEL2",value:"Miguel Hidalgo"},{name:"ADDRESS_HOME_ZIP",value:"11001"},{name:"ADDRESS_HOME_CITY",value:"Ciudad de México"},{name:"ADDRESS_HOME_STATE",value:"Distrito Federal"},{name:"EMAIL_ADDRESS",value:"ejemplo@ejemplo.mx"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+525553428400"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"DE"},{name:"NAME_FULL",value:"Gottfried Wilhelm Leibniz"},{name:"NAME_FIRST",value:"Gottfried"},{name:"NAME_MIDDLE",value:"Wilhelm"},{name:"NAME_LAST",value:"Leibniz"},{name:"COMPANY_NAME",value:"Erfundenes Unternehmen"},{name:"ADDRESS_HOME_LINE1",value:"Erfundene Straße 33"},{name:"ADDRESS_HOME_LINE2",value:"Wohnung 1"},{name:"ADDRESS_HOME_ZIP",value:"80732"},{name:"ADDRESS_HOME_CITY",value:"München"},{name:"EMAIL_ADDRESS",value:"test@beispiel.de"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+4930303986300"}]}]:[]})}enable(){this.#fr||a.InspectorFrontendHost.isUnderTest()||(this.agent.invoke_enable(),this.setTestAddresses(),this.#fr=!0)}disable(){this.#fr&&!a.InspectorFrontendHost.isUnderTest()&&(this.#fr=!1,this.agent.invoke_disable())}addressFormFilled(e){this.dispatchEventToListeners("AddressFormFilled",{autofillModel:this,event:e})}}h.register(to,{capabilities:2,autostart:!0});var no=Object.freeze({__proto__:null,AutofillModel:to});class ro{name;#rd;enabledInternal;constructor(e,t){this.#rd=e,this.name=t,this.enabledInternal=!1}category(){return this.#rd}enabled(){return this.enabledInternal}setEnabled(e){this.enabledInternal=e}}var so=Object.freeze({__proto__:null,CategorizedBreakpoint:ro});class io{#sd;#id=[];#od=new Map;#ad=new Map;#ld=new Map;#dd=new Map;#cd=new Map;#hd=[];#ud=[];#gd=[];static enhancedTraceVersion=1;constructor(e){this.#sd=e;try{this.parseEnhancedTrace()}catch(e){throw new i.UserVisibleError(e)}}parseEnhancedTrace(){for(const e of this.#sd.traceEvents)if(this.isTargetRundownEvent(e)){const t=e.args?.data;this.#od.set(this.getScriptIsolateId(t.isolate,t.scriptId),t.v8context),this.#ad.set(this.getScriptIsolateId(t.isolate,t.scriptId),t.frame),this.#hd.find((e=>e.targetId===t.frame))||this.#hd.push({targetId:t.frame,type:t.frameType,isolate:t.isolate,pid:e.pid,url:t.url}),this.#ud.find((e=>e.v8Context===t.v8context))||this.#ud.push({id:-1,origin:t.origin,v8Context:t.v8context,auxData:{frameId:t.frame,isDefault:t.isDefault,type:t.contextType},isolate:t.isolate})}else if(this.isScriptRundownEvent(e)){this.#id.push(e);const t=e.args.data;this.#gd.find((e=>e.scriptId===t.scriptId&&e.isolate===t.isolate))||this.#gd.push({scriptId:t.scriptId,isolate:t.isolate,executionContextId:t.executionContextId,startLine:t.startLine,startColumn:t.startColumn,endLine:t.endLine,endColumn:t.endColumn,hash:t.hash,isModule:t.isModule,url:t.url,hasSourceURL:t.hasSourceUrl,sourceURL:t.sourceUrl,sourceMapURL:t.sourceMapUrl})}else if(this.isScriptRundownSourceEvent(e)){const t=e.args.data,n=this.getScriptIsolateId(t.isolate,t.scriptId);if("splitIndex"in t&&"splitCount"in t){this.#dd.has(n)||this.#dd.set(n,new Array(t.splitCount).fill(""));const e=this.#dd.get(n);e&&t.sourceText&&(e[t.splitIndex]=t.sourceText)}else t.sourceText&&this.#ld.set(n,t.sourceText),t.length&&this.#cd.set(n,t.length)}}data(){const e=new Map;this.#id.forEach((t=>{const n=t.args.data,r=this.#od.get(this.getScriptIsolateId(n.isolate,n.scriptId));r&&e.set(r,n.executionContextId)})),this.#ud.forEach((t=>{if(t.v8Context){const n=e.get(t.v8Context);n&&(t.id=n)}})),this.#gd.forEach((e=>{const t=this.getScriptIsolateId(e.isolate,e.scriptId);if(this.#ld.has(t))e.sourceText=this.#ld.get(t),e.length=this.#cd.get(t);else if(this.#dd.has(t)){const n=this.#dd.get(t);n&&(e.sourceText=n.join(""),e.length=e.sourceText.length)}e.auxData=this.#ud.find((t=>t.id===e.executionContextId&&t.isolate===e.isolate))?.auxData}));for(const e of this.#gd)e.sourceMapURL=this.getEncodedSourceMapUrl(e);const t=new Map;for(const e of this.#hd)t.set(e,this.groupContextsAndScriptsUnderTarget(e,this.#ud,this.#gd));return t}getEncodedSourceMapUrl(e){if(e.sourceMapURL?.startsWith("data:"))return e.sourceMapURL;const t=this.getSourceMapFromMetadata(e);if(t)try{return`data:text/plain;base64,${btoa(JSON.stringify(t))}`}catch{return}}getSourceMapFromMetadata(t){const{hasSourceURL:n,sourceURL:r,url:s,sourceMapURL:i,isolate:o,scriptId:a}=t;if(!i||!this.#sd.metadata.sourceMaps)return;const l=this.#ad.get(this.getScriptIsolateId(o,a));if(!l)return;const d=this.#hd.find((e=>e.targetId===l));if(!d)return;let c=s;if(n&&r){const t=d.url;c=e.ParsedURL.ParsedURL.completeURL(t,r)??r}const h=e.ParsedURL.ParsedURL.completeURL(c,i);if(!h)return;const{sourceMap:u}=this.#sd.metadata.sourceMaps.find((e=>e.sourceMapUrl===h))??{};return u}getScriptIsolateId(e,t){return t+"@"+e}isTraceEvent(e){return"cat"in e&&"pid"in e&&"args"in e&&"data"in e.args}isTargetRundownEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.target-rundown"===e.cat}isScriptRundownEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.v8-source-rundown"===e.cat}isScriptRundownSourceEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.v8-source-rundown-sources"===e.cat}groupContextsAndScriptsUnderTarget(e,t,n){const r=[],s=[];for(const n of t)n.auxData?.frameId===e.targetId&&r.push(n);for(const t of n)null===t.auxData&&console.error(t+" missing aux data"),t.auxData?.frameId===e.targetId&&s.push(t);return[r,s]}}var oo=Object.freeze({__proto__:null,EnhancedTracesParser:io});class ao{traceEvents;metadata;constructor(e,t={}){this.traceEvents=e,this.metadata=t}}class lo{networkRequest;constructor(e){this.networkRequest=e}static create(t){const n=t.args.data.url,r=e.ParsedURL.ParsedURL.urlWithoutHash(n),s=ii.resourceForURL(n)??ii.resourceForURL(r),i=s?.request;return i?new lo(i):null}}var co=Object.freeze({__proto__:null,RevealableEvent:class{event;constructor(e){this.event=e}},RevealableNetworkRequest:lo,TraceObject:ao});const ho={noSourceText:"No source text available",noHostWindow:"Can not find host window",errorLoadingLog:"Error loading log"},uo=n.i18n.registerUIStrings("core/sdk/RehydratingConnection.ts",ho),go=n.i18n.getLocalizedString.bind(void 0,uo);class po{rehydratingConnectionState=1;onDisconnect=null;onMessage=null;trace=null;sessions=new Map;#pd;#md;#fd=this.#bd.bind(this);constructor(e){this.#pd=e,this.#md=window,this.#yd()}#yd(){this.#md.addEventListener("message",this.#fd),this.#md.opener||this.#pd({reason:go(ho.noHostWindow)}),this.#md.opener.postMessage({type:"REHYDRATING_WINDOW_READY"})}#bd(e){if("REHYDRATING_TRACE_FILE"===e.data.type){const{traceFile:t}=e.data,n=new FileReader;n.onload=async()=>{await this.startHydration(n.result)},n.onerror=()=>{this.#pd({reason:go(ho.errorLoadingLog)})},n.readAsText(t)}this.#md.removeEventListener("message",this.#fd)}async startHydration(e){if(!this.onMessage||2!==this.rehydratingConnectionState)return!1;const t=JSON.parse(e);if(!("traceEvents"in t))return console.error("RehydratingConnection failed to initialize due to missing trace events in payload"),!1;this.trace=t;const n=new io(t).data();let r=0;this.sessions.set(r,new mo(this));for(const[e,[t,s]]of n.entries())this.postToFrontend({method:"Target.targetCreated",params:{targetInfo:{targetId:e.targetId,type:e.type,title:e.url,url:e.url,attached:!1,canAccessOpener:!1}}}),r+=1,this.sessions.set(r,new fo(r,e,t,s,this));return await this.#vd(),!0}async#vd(){if(!this.trace)return;this.rehydratingConnectionState=3;const t=new ao(this.trace.traceEvents,this.trace.metadata);await e.Revealer.reveal(t)}setOnMessage(e){this.onMessage=e,this.rehydratingConnectionState=2}setOnDisconnect(e){this.onDisconnect=e}sendRawMessage(e){"string"==typeof e&&(e=JSON.parse(e));const t=e;if(void 0!==t.sessionId){const e=this.sessions.get(t.sessionId);e?e.handleFrontendMessageAsFakeCDPAgent(t):console.error("Invalid SessionId: "+t.sessionId)}else this.sessions.get(0)?.handleFrontendMessageAsFakeCDPAgent(t)}postToFrontend(e){this.onMessage?this.onMessage(e):console.error("onMessage was not initialized")}disconnect(){return Promise.reject()}}class mo{connection=null;constructor(e){this.connection=e}sendMessageToFrontend(e){requestAnimationFrame((()=>{this.connection&&this.connection.postToFrontend(e)}))}handleFrontendMessageAsFakeCDPAgent(e){this.sendMessageToFrontend({id:e.id,result:{}})}}class fo extends mo{sessionId;target;executionContexts=[];scripts=[];constructor(e,t,n,r,s){super(s),this.sessionId=e,this.target=t,this.executionContexts=n,this.scripts=r,this.sessionAttachToTarget()}sendMessageToFrontend(e,t=!0){0!==this.sessionId&&t&&(e.sessionId=this.sessionId),super.sendMessageToFrontend(e)}handleFrontendMessageAsFakeCDPAgent(e){switch(e.method){case"Runtime.enable":this.handleRuntimeEnabled(e.id);break;case"Debugger.enable":this.handleDebuggerEnable(e.id);break;case"Debugger.getScriptSource":if(e.params){const t=e.params;this.handleDebuggerGetScriptSource(e.id,t.scriptId)}break;default:this.sendMessageToFrontend({id:e.id,result:{}})}}sessionAttachToTarget(){this.sendMessageToFrontend({method:"Target.attachedToTarget",params:{sessionId:this.sessionId,waitingForDebugger:!1,targetInfo:{targetId:this.target.targetId,type:this.target.type,title:this.target.url,url:this.target.url,attached:!0,canAccessOpener:!1}}},!1)}handleRuntimeEnabled(e){for(const e of this.executionContexts)e.name=e.origin,this.sendMessageToFrontend({method:"Runtime.executionContextCreated",params:{context:e}});this.sendMessageToFrontend({id:e,result:{}})}handleDebuggerGetScriptSource(e,t){const n=this.scripts.find((e=>e.scriptId===t));n?this.sendMessageToFrontend({id:e,result:{scriptSource:void 0===n.sourceText?go(ho.noSourceText):n.sourceText}}):console.error("No script for id: "+t)}handleDebuggerEnable(e){for(const e of this.scripts)this.sendMessageToFrontend({method:"Debugger.scriptParsed",params:e});this.sendMessageToFrontend({id:e,result:{debuggerId:"7777777777777777777.8888888888888888888"}})}}const bo={websocketDisconnected:"WebSocket disconnected"},yo=n.i18n.registerUIStrings("core/sdk/Connections.ts",bo),vo=n.i18n.getLocalizedString.bind(void 0,yo);class Io{onMessage;#Id;#wd;#Sd;#Vt;constructor(){this.onMessage=null,this.#Id=null,this.#wd="",this.#Sd=0,this.#Vt=[a.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(a.InspectorFrontendHostAPI.Events.DispatchMessage,this.dispatchMessage,this),a.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(a.InspectorFrontendHostAPI.Events.DispatchMessageChunk,this.dispatchMessageChunk,this)]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Id=e}sendRawMessage(e){this.onMessage&&a.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(e)}dispatchMessage(e){this.onMessage&&this.onMessage.call(null,e.data)}dispatchMessageChunk(e){const{messageChunk:t,messageSize:n}=e.data;n&&(this.#wd="",this.#Sd=n),this.#wd+=t,this.#wd.length===this.#Sd&&this.onMessage&&(this.onMessage.call(null,this.#wd),this.#wd="",this.#Sd=0)}async disconnect(){const t=this.#Id;e.EventTarget.removeEventListeners(this.#Vt),this.#Id=null,this.onMessage=null,t&&t.call(null,"force disconnect")}}class wo{#kd;onMessage;#Id;#Cd;#xd;#Rd;constructor(e,t){this.#kd=new WebSocket(e),this.#kd.onerror=this.onError.bind(this),this.#kd.onopen=this.onOpen.bind(this),this.#kd.onmessage=e=>{this.onMessage&&this.onMessage.call(null,e.data)},this.#kd.onclose=this.onClose.bind(this),this.onMessage=null,this.#Id=null,this.#Cd=t,this.#xd=!1,this.#Rd=[]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Id=e}onError(e){this.#Cd&&this.#Cd.call(null,{reason:vo(bo.websocketDisconnected),errorType:e.type}),this.#Id&&this.#Id.call(null,"connection failed"),this.close()}onOpen(){if(this.#xd=!0,this.#kd){this.#kd.onerror=console.error;for(const e of this.#Rd)this.#kd.send(e)}this.#Rd=[]}onClose(e){this.#Cd&&this.#Cd.call(null,{reason:e.reason,code:String(e.code||0)}),this.#Id&&this.#Id.call(null,"websocket closed"),this.close()}close(e){this.#kd&&(this.#kd.onerror=null,this.#kd.onopen=null,this.#kd.onclose=e||null,this.#kd.onmessage=null,this.#kd.close(),this.#kd=null),this.#Cd=null}sendRawMessage(e){this.#xd&&this.#kd?this.#kd.send(e):this.#Rd.push(e)}disconnect(){return new Promise((e=>{this.close((()=>{this.#Id&&this.#Id.call(null,"force disconnect"),e()}))}))}}class So{onMessage;#Id;constructor(){this.onMessage=null,this.#Id=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Id=e}sendRawMessage(e){window.setTimeout(this.respondWithError.bind(this,e),0)}respondWithError(e){const t=JSON.parse(e),n={message:"This is a stub connection, can't dispatch message.",code:l.InspectorBackend.DevToolsStubErrorCode,data:t};this.onMessage&&this.onMessage.call(null,{id:t.id,error:n})}async disconnect(){this.#Id&&this.#Id.call(null,"force disconnect"),this.#Id=null,this.onMessage=null}}class ko{#Td;#Md;onMessage;#Id;constructor(e,t){this.#Td=e,this.#Md=t,this.onMessage=null,this.#Id=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Id=e}getOnDisconnect(){return this.#Id}sendRawMessage(e){const t=JSON.parse(e);t.sessionId||(t.sessionId=this.#Md),this.#Td.sendRawMessage(JSON.stringify(t))}getSessionId(){return this.#Md}async disconnect(){this.#Id&&this.#Id.call(null,"force disconnect"),this.#Id=null,this.onMessage=null}}function Co(e){if(o.Runtime.getPathName().includes("rehydrated_devtools_app"))return new po(e);const t=o.Runtime.Runtime.queryParam("ws"),n=o.Runtime.Runtime.queryParam("wss");if(t||n){const r=t?"ws":"wss";let s=t||n;a.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()&&s.startsWith("/")&&(s=`${window.location.host}${s}`);return new wo(`${r}://${s}`,e)}return a.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()?new So:new Io}var xo=Object.freeze({__proto__:null,MainConnection:Io,ParallelConnection:ko,StubConnection:So,WebSocketConnection:wo,initMainConnection:async function(e,t){l.InspectorBackend.Connection.setFactory(Co.bind(null,t)),await e(),a.InspectorFrontendHost.InspectorFrontendHostInstance.connectionReady()}});const Ro={main:"Main"},To=n.i18n.registerUIStrings("core/sdk/ChildTargetManager.ts",Ro),Mo=n.i18n.getLocalizedString.bind(void 0,To);class Po extends h{#Pd;#Ed;#Ld;#Ad=new Map;#Od=new Map;#Dd=new Map;#Nd=new Map;#Fd=null;constructor(e){super(e),this.#Pd=e.targetManager(),this.#Ed=e,this.#Ld=e.targetAgent(),e.registerTargetDispatcher(this);const t=this.#Pd.browserTarget();t?t!==e&&t.targetAgent().invoke_autoAttachRelated({targetId:e.id(),waitForDebuggerOnStart:!0}):this.#Ld.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0}),e.parentTarget()?.type()===U.FRAME||a.InspectorFrontendHost.isUnderTest()||(this.#Ld.invoke_setDiscoverTargets({discover:!0}),this.#Ld.invoke_setRemoteLocations({locations:[{host:"localhost",port:9229}]}))}static install(e){Po.attachCallback=e,h.register(Po,{capabilities:32,autostart:!0})}childTargets(){return Array.from(this.#Od.values())}async suspendModel(){await this.#Ld.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0})}async resumeModel(){await this.#Ld.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0})}dispose(){for(const e of this.#Od.keys())this.detachedFromTarget({sessionId:e,targetId:void 0})}targetCreated({targetInfo:e}){this.#Ad.set(e.targetId,e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetCreated",e)}targetInfoChanged({targetInfo:e}){this.#Ad.set(e.targetId,e);const t=this.#Dd.get(e.targetId);if(t)if(t.setHasCrashed(!1),"prerender"!==t.targetInfo()?.subtype||e.subtype)t.updateTargetInfo(e);else{const n=t.model(ii);t.updateTargetInfo(e),n?.mainFrame&&n.primaryPageChanged(n.mainFrame,"Activation"),t.setName(Mo(Ro.main))}this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetInfoChanged",e)}targetDestroyed({targetId:e}){this.#Ad.delete(e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetDestroyed",e)}targetCrashed({targetId:e}){const t=this.#Dd.get(e);t&&t.setHasCrashed(!0)}fireAvailableTargetsChanged(){W.instance().dispatchEventToListeners("AvailableTargetsChanged",[...this.#Ad.values()])}async getParentTargetId(){return this.#Fd||(this.#Fd=(await this.#Ed.targetAgent().invoke_getTargetInfo({})).targetInfo.targetId),this.#Fd}async getTargetInfo(){return(await this.#Ed.targetAgent().invoke_getTargetInfo({})).targetInfo}async attachedToTarget({sessionId:t,targetInfo:n,waitingForDebugger:r}){if(this.#Fd===n.targetId)return;let s=U.BROWSER,i="";if("worker"===n.type&&n.title&&n.title!==n.url)i=n.title;else if(!["page","iframe","webview"].includes(n.type)){if(["^chrome://print/$","^chrome://file-manager/","^chrome://feedback/","^chrome://.*\\.top-chrome/$","^chrome://view-cert/$","^devtools://"].some((e=>n.url.match(e))))s=U.FRAME;else{const t=e.ParsedURL.ParsedURL.fromString(n.url);i=t?t.lastPathComponentWithFragment():"#"+ ++Po.lastAnonymousTargetId}}"iframe"===n.type||"webview"===n.type||"background_page"===n.type||"app"===n.type||"popup_page"===n.type||"page"===n.type?s=U.FRAME:"worker"===n.type?s=U.Worker:"worklet"===n.type?s=U.WORKLET:"shared_worker"===n.type?s=U.SHARED_WORKER:"shared_storage_worklet"===n.type?s=U.SHARED_STORAGE_WORKLET:"service_worker"===n.type?s=U.ServiceWorker:"auction_worklet"===n.type&&(s=U.AUCTION_WORKLET);const o=this.#Pd.createTarget(n.targetId,i,s,this.#Ed,t,void 0,void 0,n);this.#Od.set(t,o),this.#Dd.set(o.id(),o),Po.attachCallback&&await Po.attachCallback({target:o,waitingForDebugger:r}),r&&o.runtimeAgent().invoke_runIfWaitingForDebugger()}detachedFromTarget({sessionId:e}){if(this.#Nd.has(e))this.#Nd.delete(e);else{const t=this.#Od.get(e);t&&(t.dispose("target terminated"),this.#Od.delete(e),this.#Dd.delete(t.id()))}}receivedMessageFromTarget({}){}async createParallelConnection(e){const t=await this.getParentTargetId(),{connection:n,sessionId:r}=await this.createParallelConnectionAndSessionForTarget(this.#Ed,t);return n.setOnMessage(e),this.#Nd.set(r,n),{connection:n,sessionId:r}}async createParallelConnectionAndSessionForTarget(e,t){const n=e.targetAgent(),r=e.router(),s=(await n.invoke_attachToTarget({targetId:t,flatten:!0})).sessionId,i=new ko(r.connection(),s);return r.registerSession(e,s,i),i.setOnDisconnect((()=>{r.unregisterSession(s),n.invoke_detachFromTarget({sessionId:s})})),{connection:i,sessionId:s}}targetInfos(){return Array.from(this.#Ad.values())}static lastAnonymousTargetId=0;static attachCallback}var Eo=Object.freeze({__proto__:null,ChildTargetManager:Po});const Lo={couldNotLoadContentForSS:"Could not load content for {PH1} ({PH2})"},Ao=n.i18n.registerUIStrings("core/sdk/CompilerSourceMappingContentProvider.ts",Lo),Oo=n.i18n.getLocalizedString.bind(void 0,Ao);var Do,No=Object.freeze({__proto__:null,CompilerSourceMappingContentProvider:class{#Bd;#_d;#Hd;constructor(e,t,n){this.#Bd=e,this.#_d=t,this.#Hd=n}contentURL(){return this.#Bd}contentType(){return this.#_d}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentData(){try{const{content:e}=await nr.instance().loadResource(this.#Bd,this.#Hd);return new t.ContentData.ContentData(e,!1,this.#_d.canonicalMimeType())}catch(e){const t=Oo(Lo.couldNotLoadContentForSS,{PH1:this.#Bd,PH2:e.message});return console.error(t),{error:t}}}async searchInContent(e,n,r){const s=await this.requestContentData();return t.TextUtils.performSearchInContentData(s,e,n,r)}}});!function(e){e.Result="result",e.Command="command",e.System="system",e.QueryObjectResult="queryObjectResult"}(Do||(Do={}));const Fo={profileD:"Profile {PH1}"},Bo=n.i18n.registerUIStrings("core/sdk/CPUProfilerModel.ts",Fo),_o=n.i18n.getLocalizedString.bind(void 0,Bo);class Ho extends h{#Ud;#qd;#zd;#jd;#Vd;registeredConsoleProfileMessages=[];constructor(e){super(e),this.#Ud=1,this.#qd=new Map,this.#zd=e.profilerAgent(),this.#jd=null,e.registerProfilerDispatcher(this),this.#zd.invoke_enable(),this.#Vd=e.model(ms)}runtimeModel(){return this.#Vd.runtimeModel()}debuggerModel(){return this.#Vd}consoleProfileStarted({id:e,location:t,title:n}){n||(n=_o(Fo.profileD,{PH1:this.#Ud++}),this.#qd.set(e,n));const r=this.createEventDataFrom(e,t,n);this.dispatchEventToListeners("ConsoleProfileStarted",r)}consoleProfileFinished({id:e,location:t,profile:n,title:r}){r||(r=this.#qd.get(e),this.#qd.delete(e));const s={...this.createEventDataFrom(e,t,r),cpuProfile:n};this.registeredConsoleProfileMessages.push(s),this.dispatchEventToListeners("ConsoleProfileFinished",s)}createEventDataFrom(e,t,n){const r=Is.fromPayload(this.#Vd,t);return{id:this.target().id()+"."+e,scriptLocation:r,title:n||"",cpuProfilerModel:this}}startRecording(){return this.#zd.invoke_setSamplingInterval({interval:100}),this.#zd.invoke_start()}stopRecording(){return this.#zd.invoke_stop().then((e=>e.profile||null))}startPreciseCoverage(e,t){this.#jd=t;return this.#zd.invoke_startPreciseCoverage({callCount:!1,detailed:e,allowTriggeredUpdates:!0})}async takePreciseCoverage(){const e=await this.#zd.invoke_takePreciseCoverage();return{timestamp:e?.timestamp||0,coverage:e?.result||[]}}stopPreciseCoverage(){return this.#jd=null,this.#zd.invoke_stopPreciseCoverage()}preciseCoverageDeltaUpdate({timestamp:e,occasion:t,result:n}){this.#jd&&this.#jd(e,t,n)}}h.register(Ho,{capabilities:4,autostart:!0});var Uo=Object.freeze({__proto__:null,CPUProfilerModel:Ho});class qo extends h{#Wd;constructor(e){super(e),e.registerLogDispatcher(this),this.#Wd=e.logAgent(),this.#Wd.invoke_enable(),a.InspectorFrontendHost.isUnderTest()||this.#Wd.invoke_startViolationsReport({config:[{name:"longTask",threshold:200},{name:"longLayout",threshold:30},{name:"blockedEvent",threshold:100},{name:"blockedParser",threshold:-1},{name:"handler",threshold:150},{name:"recurringHandler",threshold:50},{name:"discouragedAPIUse",threshold:-1}]})}entryAdded({entry:e}){this.dispatchEventToListeners("EntryAdded",{logModel:this,entry:e})}requestClear(){this.#Wd.invoke_clear()}}h.register(qo,{capabilities:8,autostart:!0});var zo=Object.freeze({__proto__:null,LogModel:qo});const jo={navigatedToS:"Navigated to {PH1}",bfcacheNavigation:"Navigation to {PH1} was restored from back/forward cache (see https://web.dev/bfcache/)",profileSStarted:"Profile ''{PH1}'' started.",profileSFinished:"Profile ''{PH1}'' finished.",failedToSaveToTempVariable:"Failed to save to temp variable."},Vo=n.i18n.registerUIStrings("core/sdk/ConsoleModel.ts",jo),Wo=n.i18n.getLocalizedString.bind(void 0,Vo);class Go extends h{#Gd=[];#Kd=new r.MapUtilities.Multimap;#Qd=new Map;#$d=0;#Xd=0;#Jd=0;#Yd=0;#Zd=new WeakMap;constructor(t){super(t);const n=t.model(ii);if(!n||n.cachedResourcesLoaded())return void this.initTarget(t);const r=n.addEventListener(ri.CachedResourcesLoaded,(()=>{e.EventTarget.removeEventListeners([r]),this.initTarget(t)}))}initTarget(e){const t=[],n=e.model(Ho);n&&(t.push(n.addEventListener("ConsoleProfileStarted",this.consoleProfileStarted.bind(this,n))),t.push(n.addEventListener("ConsoleProfileFinished",this.consoleProfileFinished.bind(this,n))));const r=e.model(ii);r&&e.parentTarget()?.type()!==U.FRAME&&t.push(r.addEventListener(ri.PrimaryPageChanged,this.primaryPageChanged,this));const s=e.model(Jr);s&&(t.push(s.addEventListener($r.ExceptionThrown,this.exceptionThrown.bind(this,s))),t.push(s.addEventListener($r.ExceptionRevoked,this.exceptionRevoked.bind(this,s))),t.push(s.addEventListener($r.ConsoleAPICalled,this.consoleAPICalled.bind(this,s))),e.parentTarget()?.type()!==U.FRAME&&t.push(s.debuggerModel().addEventListener(ys.GlobalObjectCleared,this.clearIfNecessary,this)),t.push(s.addEventListener($r.QueryObjectRequested,this.queryObjectRequested.bind(this,s)))),this.#Zd.set(e,t)}targetRemoved(t){const n=t.model(Jr);n&&this.#Qd.delete(n),e.EventTarget.removeEventListeners(this.#Zd.get(t)||[])}async evaluateCommandInConsole(t,n,r,s){const i=await t.evaluate({expression:r,objectGroup:"console",includeCommandLineAPI:s,silent:!1,returnByValue:!1,generatePreview:!0,replMode:!0,allowUnsafeEvalBlockedByCSP:!1},e.Settings.Settings.instance().moduleSetting("console-user-activation-eval").get(),!1);a.userMetrics.actionTaken(a.UserMetrics.Action.ConsoleEvaluated),"error"in i||(await e.Console.Console.instance().showPromise(),this.dispatchEventToListeners(Ko.CommandEvaluated,{result:i.object,commandMessage:n,exceptionDetails:i.exceptionDetails}))}addCommandMessage(e,t){const n=new $o(e.runtimeModel,"javascript",null,t,{type:Do.Command});return n.setExecutionContextId(e.id),this.addMessage(n),n}addMessage(t){t.setPageLoadSequenceNumber(this.#Yd),t.source===e.Console.FrontendMessageSource.ConsoleAPI&&"clear"===t.type&&this.clearIfNecessary(),this.#Gd.push(t),this.#Kd.set(t.timestamp,t);const n=t.runtimeModel(),r=t.getExceptionId();if(r&&n){let e=this.#Qd.get(n);e||(e=new Map,this.#Qd.set(n,e)),e.set(r,t)}this.incrementErrorWarningCount(t),this.dispatchEventToListeners(Ko.MessageAdded,t)}exceptionThrown(e,t){const n=t.data,r=function(e){if(!e)return;return{requestId:e.requestId||void 0,issueId:e.issueId||void 0}}(n.details.exceptionMetaData),s=$o.fromException(e,n.details,void 0,n.timestamp,void 0,r);s.setExceptionId(n.details.exceptionId),this.addMessage(s)}exceptionRevoked(e,t){const n=t.data,r=this.#Qd.get(e),s=r?r.get(n):null;s&&(this.#Xd--,s.level="verbose",this.dispatchEventToListeners(Ko.MessageUpdated,s))}consoleAPICalled(t,n){const r=n.data;let s="info";"debug"===r.type?s="verbose":"error"===r.type||"assert"===r.type?s="error":"warning"===r.type?s="warning":"info"!==r.type&&"log"!==r.type||(s="info");let i="";r.args.length&&r.args[0].unserializableValue?i=r.args[0].unserializableValue:r.args.length&&("object"!=typeof r.args[0].value&&void 0!==r.args[0].value||null===r.args[0].value)?i=String(r.args[0].value):r.args.length&&r.args[0].description&&(i=r.args[0].description);const o=r.stackTrace?.callFrames.length?r.stackTrace.callFrames[0]:null,a={type:r.type,url:o?.url,line:o?.lineNumber,column:o?.columnNumber,parameters:r.args,stackTrace:r.stackTrace,timestamp:r.timestamp,executionContextId:r.executionContextId,context:r.context},l=new $o(t,e.Console.FrontendMessageSource.ConsoleAPI,s,i,a);for(const e of this.#Kd.get(l.timestamp).values())if(l.isEqual(e))return;this.addMessage(l)}queryObjectRequested(t,n){const{objects:r,executionContextId:s}=n.data,i={type:Do.QueryObjectResult,parameters:[r],executionContextId:s},o=new $o(t,e.Console.FrontendMessageSource.ConsoleAPI,"info","",i);this.addMessage(o)}clearIfNecessary(){e.Settings.Settings.instance().moduleSetting("preserve-console-log").get()||this.clear(),++this.#Yd}primaryPageChanged(t){if(e.Settings.Settings.instance().moduleSetting("preserve-console-log").get()){const{frame:n}=t.data;n.backForwardCacheDetails.restoredFromCache?e.Console.Console.instance().log(Wo(jo.bfcacheNavigation,{PH1:n.url})):e.Console.Console.instance().log(Wo(jo.navigatedToS,{PH1:n.url}))}}consoleProfileStarted(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profile",n.scriptLocation,Wo(jo.profileSStarted,{PH1:n.title}))}consoleProfileFinished(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profileEnd",n.scriptLocation,Wo(jo.profileSFinished,{PH1:n.title}))}addConsoleProfileMessage(t,n,r,s){const i=r.script(),o=[{functionName:"",scriptId:r.scriptId,url:i?i.contentURL():"",lineNumber:r.lineNumber,columnNumber:r.columnNumber||0}];this.addMessage(new $o(t.runtimeModel(),e.Console.FrontendMessageSource.ConsoleAPI,"info",s,{type:n,stackTrace:{callFrames:o}}))}incrementErrorWarningCount(e){if("violation"!==e.source)switch(e.level){case"warning":this.#$d++;break;case"error":this.#Xd++}else this.#Jd++}messages(){return this.#Gd}static allMessagesUnordered(){const e=[];for(const t of W.instance().targets()){const n=t.model(Go)?.messages()||[];e.push(...n)}return e}static requestClearMessages(){for(const e of W.instance().models(qo))e.requestClear();for(const e of W.instance().models(Jr))e.discardConsoleEntries(),e.releaseObjectGroup("live-expression");for(const e of W.instance().targets())e.model(Go)?.clear()}clear(){this.#Gd=[],this.#Kd.clear(),this.#Qd.clear(),this.#Xd=0,this.#$d=0,this.#Jd=0,this.dispatchEventToListeners(Ko.ConsoleCleared)}errors(){return this.#Xd}static allErrors(){let e=0;for(const t of W.instance().targets())e+=t.model(Go)?.errors()||0;return e}warnings(){return this.#$d}static allWarnings(){let e=0;for(const t of W.instance().targets())e+=t.model(Go)?.warnings()||0;return e}violations(){return this.#Jd}async saveToTempVariable(t,n){if(!n||!t)return void a(null);const r=t,s=await r.globalObject("",!1);if("error"in s||Boolean(s.exceptionDetails)||!s.object)return void a("object"in s&&s.object||null);const i=s.object,o=await i.callFunction((function(e){const t="temp";let n=1;for(;t+n in this;)++n;const r=t+n;return this[r]=e,r}),[Bn.toCallArgument(n)]);if(i.release(),o.wasThrown||!o.object||"string"!==o.object.type)a(o.object||null);else{const e=o.object.value,t=this.addCommandMessage(r,e);this.evaluateCommandInConsole(r,t,e,!1)}function a(t){let n=Wo(jo.failedToSaveToTempVariable);t&&(n=n+" "+t.description),e.Console.Console.instance().error(n)}o.object&&o.object.release()}}var Ko;function Qo(e,t){if(!e!=!t)return!1;if(!e||!t)return!0;const n=e.callFrames,r=t.callFrames;if(n.length!==r.length)return!1;for(let e=0,t=n.length;e<t;++e)if(n[e].scriptId!==r[e].scriptId||n[e].functionName!==r[e].functionName||n[e].lineNumber!==r[e].lineNumber||n[e].columnNumber!==r[e].columnNumber)return!1;return Qo(e.parent,t.parent)}!function(e){e.ConsoleCleared="ConsoleCleared",e.MessageAdded="MessageAdded",e.MessageUpdated="MessageUpdated",e.CommandEvaluated="CommandEvaluated"}(Ko||(Ko={}));class $o{#yr;source;level;messageText;type;url;line;column;parameters;stackTrace;timestamp;#ec;scriptId;workerId;context;#tc=null;#Yd=void 0;#nc=void 0;#rc;category;isCookieReportIssue=!1;stackFrameWithBreakpoint=null;#sc=null;constructor(e,t,n,r,s){if(this.#yr=e,this.source=t,this.level=n,this.messageText=r,this.type=s?.type||"log",this.url=s?.url,this.line=s?.line||0,this.column=s?.column||0,this.parameters=s?.parameters,this.stackTrace=s?.stackTrace,this.timestamp=s?.timestamp||Date.now(),this.#ec=s?.executionContextId||0,this.scriptId=s?.scriptId,this.workerId=s?.workerId,this.#rc=s?.affectedResources,this.category=s?.category,this.isCookieReportIssue=Boolean(s?.isCookieReportIssue),!this.#ec&&this.#yr&&(this.scriptId?this.#ec=this.#yr.executionContextIdForScriptId(this.scriptId):this.stackTrace&&(this.#ec=this.#yr.executionContextForStackTrace(this.stackTrace))),s?.context){const e=s?.context.match(/[^#]*/);this.context=e?.[0]}if(this.stackTrace){const{callFrame:e,type:t}=$o.#ic(this.stackTrace);this.stackFrameWithBreakpoint=e,this.#sc=t}}getAffectedResources(){return this.#rc}setPageLoadSequenceNumber(e){this.#Yd=e}static fromException(e,t,n,r,s,i){const o={type:n,url:s||t.url,line:t.lineNumber,column:t.columnNumber,parameters:t.exception?[Bn.fromLocalObject(t.text),t.exception]:void 0,stackTrace:t.stackTrace,timestamp:r,executionContextId:t.executionContextId,scriptId:t.scriptId,affectedResources:i};return new $o(e,"javascript","error",Jr.simpleTextFromException(t),o)}runtimeModel(){return this.#yr}target(){return this.#yr?this.#yr.target():null}setOriginatingMessage(e){this.#tc=e,this.#ec=e.#ec}originatingMessage(){return this.#tc}setExecutionContextId(e){this.#ec=e}getExecutionContextId(){return this.#ec}getExceptionId(){return this.#nc}setExceptionId(e){this.#nc=e}isGroupMessage(){return"startGroup"===this.type||"startGroupCollapsed"===this.type||"endGroup"===this.type}isGroupStartMessage(){return"startGroup"===this.type||"startGroupCollapsed"===this.type}isErrorOrWarning(){return"warning"===this.level||"error"===this.level}isGroupable(){const t="error"===this.level&&("javascript"===this.source||"network"===this.source);return this.source!==e.Console.FrontendMessageSource.ConsoleAPI&&this.type!==Do.Command&&this.type!==Do.Result&&this.type!==Do.System&&!t}groupCategoryKey(){return[this.source,this.level,this.type,this.#Yd].join(":")}isEqual(e){if(!e)return!1;if(this.parameters){if(!e.parameters||this.parameters.length!==e.parameters.length)return!1;for(let t=0;t<e.parameters.length;++t){const n=e.parameters[t],r=this.parameters[t];if("string"==typeof n||"string"==typeof r)return!1;if("object"===n.type&&"error"!==n.subtype&&(!n.objectId||n.objectId!==r.objectId||e.timestamp!==this.timestamp))return!1;if(r.type!==n.type||r.value!==n.value||r.description!==n.description)return!1}}return this.runtimeModel()===e.runtimeModel()&&this.source===e.source&&this.type===e.type&&this.level===e.level&&this.line===e.line&&this.url===e.url&&this.scriptId===e.scriptId&&this.messageText===e.messageText&&this.#ec===e.#ec&&(t=this.#rc,n=e.#rc,t?.requestId===n?.requestId)&&Qo(this.stackTrace,e.stackTrace);var t,n}get originatesFromLogpoint(){return"LOGPOINT"===this.#sc}get originatesFromConditionalBreakpoint(){return"CONDITIONAL_BREAKPOINT"===this.#sc}static#ic({callFrames:e}){const t=[Rs,xs],n=e.findLastIndex((({url:e})=>t.includes(e)));if(-1===n||n===e.length-1)return{callFrame:null,type:null};const r=e[n].url===xs?"LOGPOINT":"CONDITIONAL_BREAKPOINT";return{callFrame:e[n+1],type:r}}}h.register(Go,{capabilities:4,autostart:!0});const Xo=new Map([["xml","xml"],["javascript","javascript"],["network","network"],[e.Console.FrontendMessageSource.ConsoleAPI,"console-api"],["storage","storage"],["appcache","appcache"],["rendering","rendering"],[e.Console.FrontendMessageSource.CSS,"css"],["security","security"],["deprecation","deprecation"],["worker","worker"],["violation","violation"],["intervention","intervention"],["recommendation","recommendation"],["other","other"],[e.Console.FrontendMessageSource.ISSUE_PANEL,"issue-panel"]]);var Jo=Object.freeze({__proto__:null,ConsoleMessage:$o,ConsoleModel:Go,get Events(){return Ko},get FrontendMessageType(){return Do},MessageSourceDisplayName:Xo});class Yo extends h{#oc;#ac;#lt;#lc;#dc;#cc;#hc;#uc;#gc;#pc;#mc;constructor(t){super(t),this.#oc=t.emulationAgent(),this.#ac=t.deviceOrientationAgent(),this.#lt=t.model(Br),this.#lc=t.model(Fs),this.#lc&&this.#lc.addEventListener("InspectModeWillBeToggled",(()=>{this.updateTouch()}),this);const n=e.Settings.Settings.instance().moduleSetting("java-script-disabled");n.addChangeListener((async()=>await this.#oc.invoke_setScriptExecutionDisabled({value:n.get()}))),n.get()&&this.#oc.invoke_setScriptExecutionDisabled({value:!0});const r=e.Settings.Settings.instance().moduleSetting("emulation.touch");r.addChangeListener((()=>{const e=r.get();this.overrideEmulateTouch("force"===e)}));const s=e.Settings.Settings.instance().moduleSetting("emulation.idle-detection");s.addChangeListener((async()=>{const e=s.get();if("none"===e)return void await this.clearIdleOverride();const t=JSON.parse(e);await this.setIdleOverride(t)}));const i=e.Settings.Settings.instance().moduleSetting("emulation.cpu-pressure");i.addChangeListener((async()=>{const e=i.get();if("none"===e)return await this.setPressureSourceOverrideEnabled(!1),void(this.#cc=!1);this.#cc||(this.#cc=!0,await this.setPressureSourceOverrideEnabled(!0)),await this.setPressureStateOverride(e)}));const o=e.Settings.Settings.instance().moduleSetting("emulated-css-media"),a=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-color-gamut"),l=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-color-scheme"),d=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-forced-colors"),c=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-contrast"),h=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-data"),u=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-transparency"),g=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-motion");this.#dc=new Map([["type",o.get()],["color-gamut",a.get()],["prefers-color-scheme",l.get()],["forced-colors",d.get()],["prefers-contrast",c.get()],["prefers-reduced-data",h.get()],["prefers-reduced-motion",g.get()],["prefers-reduced-transparency",u.get()]]),o.addChangeListener((()=>{this.#dc.set("type",o.get()),this.updateCssMedia()})),a.addChangeListener((()=>{this.#dc.set("color-gamut",a.get()),this.updateCssMedia()})),l.addChangeListener((()=>{this.#dc.set("prefers-color-scheme",l.get()),this.updateCssMedia()})),d.addChangeListener((()=>{this.#dc.set("forced-colors",d.get()),this.updateCssMedia()})),c.addChangeListener((()=>{this.#dc.set("prefers-contrast",c.get()),this.updateCssMedia()})),h.addChangeListener((()=>{this.#dc.set("prefers-reduced-data",h.get()),this.updateCssMedia()})),g.addChangeListener((()=>{this.#dc.set("prefers-reduced-motion",g.get()),this.updateCssMedia()})),u.addChangeListener((()=>{this.#dc.set("prefers-reduced-transparency",u.get()),this.updateCssMedia()})),this.updateCssMedia();const p=e.Settings.Settings.instance().moduleSetting("emulate-auto-dark-mode");p.addChangeListener((()=>{const e=p.get();l.setDisabled(e),l.set(e?"dark":""),this.emulateAutoDarkMode(e)})),p.get()&&(l.setDisabled(!0),l.set("dark"),this.emulateAutoDarkMode(!0));const m=e.Settings.Settings.instance().moduleSetting("emulated-vision-deficiency");m.addChangeListener((()=>this.emulateVisionDeficiency(m.get()))),m.get()&&this.emulateVisionDeficiency(m.get());const f=e.Settings.Settings.instance().moduleSetting("local-fonts-disabled");f.addChangeListener((()=>this.setLocalFontsDisabled(f.get()))),f.get()&&this.setLocalFontsDisabled(f.get());const b=e.Settings.Settings.instance().moduleSetting("avif-format-disabled"),y=e.Settings.Settings.instance().moduleSetting("webp-format-disabled"),v=()=>{const e=[];b.get()&&e.push("avif"),y.get()&&e.push("webp"),this.setDisabledImageTypes(e)};b.addChangeListener(v),y.addChangeListener(v),(b.get()||y.get())&&v(),this.#cc=!1,this.#gc=!0,this.#hc=!1,this.#uc=!1,this.#pc=!1,this.#mc={enabled:!1,configuration:"mobile"}}setTouchEmulationAllowed(e){this.#gc=e}supportsDeviceEmulation(){return this.target().hasAllCapabilities(4096)}async resetPageScaleFactor(){await this.#oc.invoke_resetPageScaleFactor()}async emulateDevice(e){e?await this.#oc.invoke_setDeviceMetricsOverride(e):await this.#oc.invoke_clearDeviceMetricsOverride()}overlayModel(){return this.#lc}async setPressureSourceOverrideEnabled(e){await this.#oc.invoke_setPressureSourceOverrideEnabled({source:"cpu",enabled:e})}async setPressureStateOverride(e){await this.#oc.invoke_setPressureStateOverride({source:"cpu",state:e})}async emulateLocation(e){if(e)if(e.unavailable)await Promise.all([this.#oc.invoke_setGeolocationOverride({}),this.#oc.invoke_setTimezoneOverride({timezoneId:""}),this.#oc.invoke_setLocaleOverride({locale:""}),this.#oc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent()})]);else{function t(e,t){const n=t.getError();return n?Promise.reject({type:e,message:n}):Promise.resolve()}await Promise.all([this.#oc.invoke_setGeolocationOverride({latitude:e.latitude,longitude:e.longitude,accuracy:Zo.defaultGeoMockAccuracy}).then((e=>t("emulation-set-location",e))),this.#oc.invoke_setTimezoneOverride({timezoneId:e.timezoneId}).then((e=>t("emulation-set-timezone",e))),this.#oc.invoke_setLocaleOverride({locale:e.locale}).then((e=>t("emulation-set-locale",e))),this.#oc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent(),acceptLanguage:e.locale}).then((e=>t("emulation-set-user-agent",e)))])}else await Promise.all([this.#oc.invoke_clearGeolocationOverride(),this.#oc.invoke_setTimezoneOverride({timezoneId:""}),this.#oc.invoke_setLocaleOverride({locale:""}),this.#oc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent()})])}async emulateDeviceOrientation(e){e?await this.#ac.invoke_setDeviceOrientationOverride({alpha:e.alpha,beta:e.beta,gamma:e.gamma}):await this.#ac.invoke_clearDeviceOrientationOverride()}async setIdleOverride(e){await this.#oc.invoke_setIdleOverride(e)}async clearIdleOverride(){await this.#oc.invoke_clearIdleOverride()}async emulateCSSMedia(e,t){await this.#oc.invoke_setEmulatedMedia({media:e,features:t}),this.#lt&&this.#lt.mediaQueryResultChanged()}async emulateAutoDarkMode(e){e&&(this.#dc.set("prefers-color-scheme","dark"),await this.updateCssMedia()),await this.#oc.invoke_setAutoDarkModeOverride({enabled:e||void 0})}async emulateVisionDeficiency(e){await this.#oc.invoke_setEmulatedVisionDeficiency({type:e})}setLocalFontsDisabled(e){this.#lt&&this.#lt.setLocalFontsEnabled(!e)}setDisabledImageTypes(e){this.#oc.invoke_setDisabledImageTypes({imageTypes:e})}async setCPUThrottlingRate(e){await this.#oc.invoke_setCPUThrottlingRate({rate:e})}async setHardwareConcurrency(e){if(e<1)throw new Error("hardwareConcurrency must be a positive value");await this.#oc.invoke_setHardwareConcurrencyOverride({hardwareConcurrency:e})}async emulateTouch(e,t){this.#hc=e&&this.#gc,this.#uc=t&&this.#gc,await this.updateTouch()}async overrideEmulateTouch(e){this.#pc=e&&this.#gc,await this.updateTouch()}async updateTouch(){let e={enabled:this.#hc,configuration:this.#uc?"mobile":"desktop"};this.#pc&&(e={enabled:!0,configuration:"mobile"}),this.#lc&&this.#lc.inspectModeEnabled()&&(e={enabled:!1,configuration:"mobile"}),(this.#mc.enabled||e.enabled)&&(this.#mc.enabled&&e.enabled&&this.#mc.configuration===e.configuration||(this.#mc=e,await this.#oc.invoke_setTouchEmulationEnabled({enabled:e.enabled,maxTouchPoints:1}),await this.#oc.invoke_setEmitTouchEventsForMouse({enabled:e.enabled,configuration:e.configuration})))}async updateCssMedia(){const e=this.#dc.get("type")??"",t=[{name:"color-gamut",value:this.#dc.get("color-gamut")??""},{name:"prefers-color-scheme",value:this.#dc.get("prefers-color-scheme")??""},{name:"forced-colors",value:this.#dc.get("forced-colors")??""},{name:"prefers-contrast",value:this.#dc.get("prefers-contrast")??""},{name:"prefers-reduced-data",value:this.#dc.get("prefers-reduced-data")??""},{name:"prefers-reduced-motion",value:this.#dc.get("prefers-reduced-motion")??""},{name:"prefers-reduced-transparency",value:this.#dc.get("prefers-reduced-transparency")??""}];return await this.emulateCSSMedia(e,t)}}class Zo{latitude;longitude;timezoneId;locale;unavailable;constructor(e,t,n,r,s){this.latitude=e,this.longitude=t,this.timezoneId=n,this.locale=r,this.unavailable=s}static parseSetting(e){if(e){const[t,n,r,s]=e.split(":"),[i,o]=t.split("@");return new Zo(parseFloat(i),parseFloat(o),n,r,Boolean(s))}return new Zo(0,0,"","",!1)}static parseUserInput(e,t,n,r){if(!e&&!t)return null;const{valid:s}=Zo.latitudeValidator(e),{valid:i}=Zo.longitudeValidator(t);if(!s&&!i)return null;const o=s?parseFloat(e):-1,a=i?parseFloat(t):-1;return new Zo(o,a,n,r,!1)}static latitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-90&&t<=90,errorMessage:void 0}}static longitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-180&&t<=180,errorMessage:void 0}}static timezoneIdValidator(e){return{valid:""===e||/[a-zA-Z]/.test(e),errorMessage:void 0}}static localeValidator(e){return{valid:""===e||/[a-zA-Z]{2}/.test(e),errorMessage:void 0}}toSetting(){return`${this.latitude}@${this.longitude}:${this.timezoneId}:${this.locale}:${this.unavailable||""}`}static defaultGeoMockAccuracy=150}class ea{alpha;beta;gamma;constructor(e,t,n){this.alpha=e,this.beta=t,this.gamma=n}static parseSetting(e){if(e){const t=JSON.parse(e);return new ea(t.alpha,t.beta,t.gamma)}return new ea(0,0,0)}static parseUserInput(e,t,n){if(!e&&!t&&!n)return null;const{valid:r}=ea.alphaAngleValidator(e),{valid:s}=ea.betaAngleValidator(t),{valid:i}=ea.gammaAngleValidator(n);if(!r&&!s&&!i)return null;const o=r?parseFloat(e):-1,a=s?parseFloat(t):-1,l=i?parseFloat(n):-1;return new ea(o,a,l)}static angleRangeValidator(e,t){const n=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&n>=t.minimum&&n<t.maximum,errorMessage:void 0}}static alphaAngleValidator(e){return ea.angleRangeValidator(e,{minimum:0,maximum:360})}static betaAngleValidator(e){return ea.angleRangeValidator(e,{minimum:-180,maximum:180})}static gammaAngleValidator(e){return ea.angleRangeValidator(e,{minimum:-90,maximum:90})}toSetting(){return JSON.stringify(this)}}h.register(Yo,{capabilities:256,autostart:!0});var ta=Object.freeze({__proto__:null,DeviceOrientation:ea,EmulationModel:Yo,Location:Zo});const na={noThrottling:"No throttling",dSlowdown:"{PH1}× slowdown",calibratedMidTierMobile:"Mid-tier mobile",calibratedLowTierMobile:"Low-tier mobile",calibrationErrorDeviceTooWeak:"Device is not powerful enough"},ra=n.i18n.registerUIStrings("core/sdk/CPUThrottlingManager.ts",na),sa=n.i18n.getLocalizedString.bind(void 0,ra),ia=n.i18n.getLazilyComputedLocalizedString.bind(void 0,ra);let oa;class aa extends e.ObjectWrapper.ObjectWrapper{#fc;#bc;#yc;#vc;constructor(){super(),this.#fc=ca,this.#bc=e.Settings.Settings.instance().createSetting("calibrated-cpu-throttling",{},"Global"),this.#bc.addChangeListener(this.#Ic,this),W.instance().observeModels(Yo,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return oa&&!t||(oa=new aa),oa}cpuThrottlingRate(){return this.#fc.rate()}cpuThrottlingOption(){return this.#fc}#Ic(){if(!this.#fc.calibratedDeviceType)return;const e=this.#fc.rate();if(0!==e){for(const t of W.instance().models(Yo))t.setCPUThrottlingRate(e);this.dispatchEventToListeners("RateChanged",e)}else this.setCPUThrottlingOption(ca)}setCPUThrottlingOption(e){if(e!==this.#fc){this.#fc=e;for(const e of W.instance().models(Yo))e.setCPUThrottlingRate(this.#fc.rate());this.dispatchEventToListeners("RateChanged",this.#fc.rate())}}setHardwareConcurrency(e){this.#yc=e;for(const t of W.instance().models(Yo))t.setHardwareConcurrency(e);this.dispatchEventToListeners("HardwareConcurrencyChanged",this.#yc)}hasPrimaryPageTargetSet(){try{return null!==W.instance().primaryPageTarget()}catch{return!1}}async getHardwareConcurrency(){const e=W.instance().primaryPageTarget(),t=this.#vc;if(!e)return t?await new Promise((e=>{this.#vc=n=>{e(n),t(n)}})):await new Promise((e=>{this.#vc=e}));const n=await e.runtimeAgent().invoke_evaluate({expression:"navigator.hardwareConcurrency",returnByValue:!0,silent:!0,throwOnSideEffect:!0}),r=n.getError();if(r)throw new Error(r);const{result:s,exceptionDetails:i}=n;if(i)throw new Error(i.text);return s.value}modelAdded(e){if(this.#fc!==ca&&e.setCPUThrottlingRate(this.#fc.rate()),void 0!==this.#yc&&e.setHardwareConcurrency(this.#yc),this.#vc){const e=this.#vc;this.#vc=void 0,this.getHardwareConcurrency().then(e)}}modelRemoved(e){}}var la;function da(e){return{title:1===e?ia(na.noThrottling):ia(na.dSlowdown,{PH1:e}),rate:()=>e,jslogContext:1===e?"cpu-no-throttling":`cpu-throttled-${e}`}}!function(e){e[e.NO_THROTTLING=1]="NO_THROTTLING",e[e.MID_TIER_MOBILE=4]="MID_TIER_MOBILE",e[e.LOW_TIER_MOBILE=6]="LOW_TIER_MOBILE",e[e.EXTRA_SLOW=20]="EXTRA_SLOW",e[e.MidTierMobile=4]="MidTierMobile",e[e.LowEndMobile=6]="LowEndMobile"}(la||(la={}));const ca=da(la.NO_THROTTLING),ha=da(la.MID_TIER_MOBILE),ua=da(la.LOW_TIER_MOBILE),ga=da(la.EXTRA_SLOW);function pa(t){const n=()=>{const n=e.Settings.Settings.instance().createSetting("calibrated-cpu-throttling",{},"Global").get();return"low-tier-mobile"===t?n.low??null:"mid-tier-mobile"===t?n.mid??null:null};return{title(){const e=sa("low-tier-mobile"===t?na.calibratedLowTierMobile:na.calibratedMidTierMobile),r=n();return"number"==typeof r?`${e} – ${r.toFixed(1)}×`:e},rate(){const e=n();return"number"==typeof e?e:0},calibratedDeviceType:t,jslogContext:`cpu-throttled-calibrated-${t}`}}const ma=pa("low-tier-mobile"),fa=pa("mid-tier-mobile");var ba;!function(e){e.DEVICE_TOO_WEAK="DEVICE_TOO_WEAK"}(ba||(ba={}));var ya=Object.freeze({__proto__:null,CPUThrottlingManager:aa,get CPUThrottlingRates(){return la},CalibratedLowTierMobileThrottlingOption:ma,CalibratedMidTierMobileThrottlingOption:fa,get CalibrationError(){return ba},ExtraSlowThrottlingOption:ga,LowTierThrottlingOption:ua,MidTierThrottlingOption:ha,NoThrottlingOption:ca,calibrationErrorToString:function(e){return e===ba.DEVICE_TOO_WEAK?sa(na.calibrationErrorDeviceTooWeak):e},throttlingManager:function(){return aa.instance()}});class va extends h{agent;#yr;#Yn;#wc;#Sc;suspended=!1;constructor(t){super(t),this.agent=t.domdebuggerAgent(),this.#yr=t.model(Jr),this.#Yn=t.model(Gs),this.#Yn.addEventListener(Us.DocumentUpdated,this.documentUpdated,this),this.#Yn.addEventListener(Us.NodeRemoved,this.nodeRemoved,this),this.#wc=[],this.#Sc=e.Settings.Settings.instance().createLocalSetting("dom-breakpoints",[]),this.#Yn.existingDocument()&&this.documentUpdated()}runtimeModel(){return this.#yr}async suspendModel(){this.suspended=!0}async resumeModel(){this.suspended=!1}async eventListeners(e){if(console.assert(e.runtimeModel()===this.#yr),!e.objectId)return[];const t=await this.agent.invoke_getEventListeners({objectId:e.objectId}),n=[];for(const r of t.listeners||[]){const t=this.#yr.debuggerModel().createRawLocationByScriptId(r.scriptId,r.lineNumber,r.columnNumber);t&&n.push(new Sa(this,e,r.type,r.useCapture,r.passive,r.once,r.handler?this.#yr.createRemoteObject(r.handler):null,r.originalHandler?this.#yr.createRemoteObject(r.originalHandler):null,t,null))}return n}retrieveDOMBreakpoints(){this.#Yn.requestDocument()}domBreakpoints(){return this.#wc.slice()}hasDOMBreakpoint(e,t){return this.#wc.some((n=>n.node===e&&n.type===t))}setDOMBreakpoint(e,t){for(const n of this.#wc)if(n.node===e&&n.type===t)return this.toggleDOMBreakpoint(n,!0),n;const n=new wa(this,e,t,!0);return this.#wc.push(n),this.saveDOMBreakpoints(),this.enableDOMBreakpoint(n),this.dispatchEventToListeners("DOMBreakpointAdded",n),n}removeDOMBreakpoint(e,t){this.removeDOMBreakpoints((n=>n.node===e&&n.type===t))}removeAllDOMBreakpoints(){this.removeDOMBreakpoints((e=>!0))}toggleDOMBreakpoint(e,t){t!==e.enabled&&(e.enabled=t,t?this.enableDOMBreakpoint(e):this.disableDOMBreakpoint(e),this.dispatchEventToListeners("DOMBreakpointToggled",e))}enableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_setDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(Ia,!0))}disableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_removeDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(Ia,!!this.nodeHasBreakpoints(e.node)||null))}nodeHasBreakpoints(e){for(const t of this.#wc)if(t.node===e&&t.enabled)return!0;return!1}resolveDOMBreakpointData(e){const t=e.type,n=this.#Yn.nodeForId(e.nodeId);if(!t||!n)return null;let r=null,s=!1;return"subtree-modified"===t&&(s=e.insertion||!1,r=this.#Yn.nodeForId(e.targetNodeId)),{type:t,node:n,targetNode:r,insertion:s}}currentURL(){const e=this.#Yn.existingDocument();return e?e.documentURL:r.DevToolsPath.EmptyUrlString}async documentUpdated(){if(this.suspended)return;const e=this.#wc;this.#wc=[],this.dispatchEventToListeners("DOMBreakpointsRemoved",e);const t=await this.#Yn.requestDocument(),n=t?t.documentURL:r.DevToolsPath.EmptyUrlString;for(const e of this.#Sc.get())e.url===n&&this.#Yn.pushNodeByPathToFrontend(e.path).then(s.bind(this,e));function s(e,t){const n=t?this.#Yn.nodeForId(t):null;if(!n)return;const r=new wa(this,n,e.type,e.enabled);this.#wc.push(r),e.enabled&&this.enableDOMBreakpoint(r),this.dispatchEventToListeners("DOMBreakpointAdded",r)}}removeDOMBreakpoints(e){const t=[],n=[];for(const r of this.#wc)e(r)?(t.push(r),r.enabled&&(r.enabled=!1,this.disableDOMBreakpoint(r))):n.push(r);t.length&&(this.#wc=n,this.saveDOMBreakpoints(),this.dispatchEventToListeners("DOMBreakpointsRemoved",t))}nodeRemoved(e){if(this.suspended)return;const{node:t}=e.data,n=t.children()||[];this.removeDOMBreakpoints((e=>e.node===t||-1!==n.indexOf(e.node)))}saveDOMBreakpoints(){const e=this.currentURL(),t=this.#Sc.get().filter((t=>t.url!==e));for(const n of this.#wc)t.push({url:e,path:n.node.path(),type:n.type,enabled:n.enabled});this.#Sc.set(t)}}const Ia="breakpoint-marker";class wa{domDebuggerModel;node;type;enabled;constructor(e,t,n,r){this.domDebuggerModel=e,this.node=t,this.type=n,this.enabled=r}}class Sa{#kc;#Cc;#g;#xc;#Rc;#Tc;#Mc;#Pc;#$r;#Ec;#Lc;#Ac;constructor(e,t,n,s,i,o,a,l,d,c,h){this.#kc=e,this.#Cc=t,this.#g=n,this.#xc=s,this.#Rc=i,this.#Tc=o,this.#Mc=a,this.#Pc=l||a,this.#$r=d;const u=d.script();this.#Ec=u?u.contentURL():r.DevToolsPath.EmptyUrlString,this.#Lc=c,this.#Ac=h||"Raw"}domDebuggerModel(){return this.#kc}type(){return this.#g}useCapture(){return this.#xc}passive(){return this.#Rc}once(){return this.#Tc}handler(){return this.#Mc}location(){return this.#$r}sourceURL(){return this.#Ec}originalHandler(){return this.#Pc}canRemove(){return Boolean(this.#Lc)||"FrameworkUser"!==this.#Ac}remove(){if(!this.canRemove())return Promise.resolve(void 0);if("FrameworkUser"!==this.#Ac){function e(e,t,n){this.removeEventListener(e,t,n),this["on"+e]&&(this["on"+e]=void 0)}return this.#Cc.callFunction(e,[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Pc),Bn.toCallArgument(this.#xc)]).then((()=>{}))}if(this.#Lc){function t(e,t,n,r){this.call(null,e,t,n,r)}return this.#Lc.callFunction(t,[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Pc),Bn.toCallArgument(this.#xc),Bn.toCallArgument(this.#Rc)]).then((()=>{}))}return Promise.resolve(void 0)}canTogglePassive(){return"FrameworkUser"!==this.#Ac}togglePassive(){return this.#Cc.callFunction((function(e,t,n,r){this.removeEventListener(e,t,{capture:n}),this.addEventListener(e,t,{capture:n,passive:!r})}),[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Pc),Bn.toCallArgument(this.#xc),Bn.toCallArgument(this.#Rc)]).then((()=>{}))}origin(){return this.#Ac}markAsFramework(){this.#Ac="Framework"}isScrollBlockingType(){return"touchstart"===this.#g||"touchmove"===this.#g||"mousewheel"===this.#g||"wheel"===this.#g}}class ka extends ro{#g;constructor(e,t){super(e,t),this.#g=t}type(){return this.#g}}class Ca extends ro{eventTargetNames;constructor(e,t,n){super(n,e),this.eventTargetNames=t}setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of W.instance().models(va))this.updateOnModel(e)}}updateOnModel(e){for(const t of this.eventTargetNames)this.enabled()?e.agent.invoke_setEventListenerBreakpoint({eventName:this.name,targetName:t}):e.agent.invoke_removeEventListenerBreakpoint({eventName:this.name,targetName:t})}static listener="listener:"}let xa;class Ra{#Oc;#Dc=new Map;#Nc=[];#Fc=[];constructor(){this.#Oc=e.Settings.Settings.instance().createLocalSetting("xhr-breakpoints",[]);for(const e of this.#Oc.get())this.#Dc.set(e.url,e.enabled);this.#Nc.push(new ka("trusted-type-violation","trustedtype-sink-violation")),this.#Nc.push(new ka("trusted-type-violation","trustedtype-policy-violation")),this.createEventListenerBreakpoints("media",["play","pause","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange","loadstart","progress","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","waiting"],["audio","video"]),this.createEventListenerBreakpoints("picture-in-picture",["enterpictureinpicture","leavepictureinpicture"],["video"]),this.createEventListenerBreakpoints("picture-in-picture",["resize"],["PictureInPictureWindow"]),this.createEventListenerBreakpoints("picture-in-picture",["enter"],["documentPictureInPicture"]),this.createEventListenerBreakpoints("clipboard",["copy","cut","paste","beforecopy","beforecut","beforepaste"],["*"]),this.createEventListenerBreakpoints("control",["resize","scroll","scrollend","scrollsnapchange","scrollsnapchanging","zoom","focus","blur","select","change","submit","reset"],["*"]),this.createEventListenerBreakpoints("device",["deviceorientation","devicemotion"],["*"]),this.createEventListenerBreakpoints("dom-mutation",["DOMActivate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","DOMContentLoaded"],["*"]),this.createEventListenerBreakpoints("drag-drop",["drag","dragstart","dragend","dragenter","dragover","dragleave","drop"],["*"]),this.createEventListenerBreakpoints("keyboard",["keydown","keyup","keypress","input"],["*"]),this.createEventListenerBreakpoints("load",["load","beforeunload","unload","abort","error","hashchange","popstate","navigate","navigatesuccess","navigateerror","currentchange","navigateto","navigatefrom","finish","dispose"],["*"]),this.createEventListenerBreakpoints("mouse",["auxclick","click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","mouseenter","mouseleave","mousewheel","wheel","contextmenu"],["*"]),this.createEventListenerBreakpoints("pointer",["pointerover","pointerout","pointerenter","pointerleave","pointerdown","pointerup","pointermove","pointercancel","gotpointercapture","lostpointercapture","pointerrawupdate"],["*"]),this.createEventListenerBreakpoints("touch",["touchstart","touchmove","touchend","touchcancel"],["*"]),this.createEventListenerBreakpoints("worker",["message","messageerror"],["*"]),this.createEventListenerBreakpoints("xhr",["readystatechange","load","loadstart","loadend","abort","error","progress","timeout"],["xmlhttprequest","xmlhttprequestupload"]),W.instance().observeModels(va,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return xa&&!t||(xa=new Ra),xa}cspViolationBreakpoints(){return this.#Nc.slice()}createEventListenerBreakpoints(e,t,n){for(const r of t)this.#Fc.push(new Ca(r,n,e))}resolveEventListenerBreakpoint({eventName:e,targetName:t}){const n="listener:";if(!e.startsWith(n))return null;e=e.substring(9),t=(t||"*").toLowerCase();let r=null;for(const n of this.#Fc)e&&n.name===e&&-1!==n.eventTargetNames.indexOf(t)&&(r=n),!r&&e&&n.name===e&&-1!==n.eventTargetNames.indexOf("*")&&(r=n);return r}eventListenerBreakpoints(){return this.#Fc.slice()}updateCSPViolationBreakpoints(){const e=this.#Nc.filter((e=>e.enabled())).map((e=>e.type()));for(const t of W.instance().models(va))this.updateCSPViolationBreakpointsForModel(t,e)}updateCSPViolationBreakpointsForModel(e,t){e.agent.invoke_setBreakOnCSPViolation({violationTypes:t})}xhrBreakpoints(){return this.#Dc}saveXHRBreakpoints(){const e=[];for(const t of this.#Dc.keys())e.push({url:t,enabled:this.#Dc.get(t)||!1});this.#Oc.set(e)}addXHRBreakpoint(e,t){if(this.#Dc.set(e,t),t)for(const t of W.instance().models(va))t.agent.invoke_setXHRBreakpoint({url:e});this.saveXHRBreakpoints()}removeXHRBreakpoint(e){const t=this.#Dc.get(e);if(this.#Dc.delete(e),t)for(const t of W.instance().models(va))t.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}toggleXHRBreakpoint(e,t){this.#Dc.set(e,t);for(const n of W.instance().models(va))t?n.agent.invoke_setXHRBreakpoint({url:e}):n.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}modelAdded(e){for(const t of this.#Dc.keys())this.#Dc.get(t)&&e.agent.invoke_setXHRBreakpoint({url:t});for(const t of this.#Fc)t.enabled()&&t.updateOnModel(e);const t=this.#Nc.filter((e=>e.enabled())).map((e=>e.type()));this.updateCSPViolationBreakpointsForModel(e,t)}modelRemoved(e){}}h.register(va,{capabilities:2,autostart:!1});var Ta=Object.freeze({__proto__:null,CSPViolationBreakpoint:ka,DOMBreakpoint:wa,DOMDebuggerManager:Ra,DOMDebuggerModel:va,DOMEventListenerBreakpoint:Ca,EventListener:Sa});class Ma extends h{agent;constructor(e){super(e),this.agent=e.eventBreakpointsAgent()}}class Pa extends ro{setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of W.instance().models(Ma))this.updateOnModel(e)}}updateOnModel(e){this.enabled()?e.agent.invoke_setInstrumentationBreakpoint({eventName:this.name}):e.agent.invoke_removeInstrumentationBreakpoint({eventName:this.name})}static instrumentationPrefix="instrumentation:"}let Ea;class La{#Fc=[];constructor(){this.createInstrumentationBreakpoints("auction-worklet",["beforeBidderWorkletBiddingStart","beforeBidderWorkletReportingStart","beforeSellerWorkletScoringStart","beforeSellerWorkletReportingStart"]),this.createInstrumentationBreakpoints("animation",["requestAnimationFrame","cancelAnimationFrame","requestAnimationFrame.callback"]),this.createInstrumentationBreakpoints("canvas",["canvasContextCreated","webglErrorFired","webglWarningFired"]),this.createInstrumentationBreakpoints("geolocation",["Geolocation.getCurrentPosition","Geolocation.watchPosition"]),this.createInstrumentationBreakpoints("notification",["Notification.requestPermission"]),this.createInstrumentationBreakpoints("parse",["Element.setInnerHTML","Document.write"]),this.createInstrumentationBreakpoints("script",["scriptFirstStatement","scriptBlockedByCSP"]),this.createInstrumentationBreakpoints("shared-storage-worklet",["sharedStorageWorkletScriptFirstStatement"]),this.createInstrumentationBreakpoints("timer",["setTimeout","clearTimeout","setTimeout.callback","setInterval","clearInterval","setInterval.callback"]),this.createInstrumentationBreakpoints("window",["DOMWindow.close"]),this.createInstrumentationBreakpoints("web-audio",["audioContextCreated","audioContextClosed","audioContextResumed","audioContextSuspended"]),W.instance().observeModels(Ma,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return Ea&&!t||(Ea=new La),Ea}createInstrumentationBreakpoints(e,t){for(const n of t)this.#Fc.push(new Pa(e,n))}eventListenerBreakpoints(){return this.#Fc.slice()}resolveEventListenerBreakpoint({eventName:e}){if(!e.startsWith(Pa.instrumentationPrefix))return null;const t=e.substring(Pa.instrumentationPrefix.length);return this.#Fc.find((e=>e.name===t))||null}modelAdded(e){for(const t of this.#Fc)t.enabled()&&t.updateOnModel(e)}modelRemoved(e){}}h.register(Ma,{capabilities:524288,autostart:!1});var Aa=Object.freeze({__proto__:null,EventBreakpointsManager:La,EventBreakpointsModel:Ma}),Oa=Object.freeze({__proto__:null});let Da;class Na extends e.ObjectWrapper.ObjectWrapper{#Bc=new Map;#_c=new Map;#L=new Set;#Hc=0;constructor(){super(),W.instance().observeModels(Jr,this)}static instance({forceNew:e}={forceNew:!1}){return Da&&!e||(Da=new Na),Da}observeIsolates(e){if(this.#L.has(e))throw new Error("Observer can only be registered once");this.#L.size||this.poll(),this.#L.add(e);for(const t of this.#Bc.values())e.isolateAdded(t)}modelAdded(e){this.modelAddedInternal(e)}async modelAddedInternal(e){this.#_c.set(e,null);const t=await e.isolateId();if(!this.#_c.has(e))return;if(!t)return void this.#_c.delete(e);this.#_c.set(e,t);let n=this.#Bc.get(t);if(n||(n=new _a(t),this.#Bc.set(t,n)),n.modelsInternal.add(e),1===n.modelsInternal.size)for(const e of this.#L)e.isolateAdded(n);else for(const e of this.#L)e.isolateChanged(n)}modelRemoved(e){const t=this.#_c.get(e);if(this.#_c.delete(e),!t)return;const n=this.#Bc.get(t);if(n)if(n.modelsInternal.delete(e),n.modelsInternal.size)for(const e of this.#L)e.isolateChanged(n);else{for(const e of this.#L)e.isolateRemoved(n);this.#Bc.delete(t)}}isolateByModel(e){return this.#Bc.get(this.#_c.get(e)||"")||null}isolates(){return this.#Bc.values()}async poll(){const e=this.#Hc;for(;e===this.#Hc;)await Promise.all(Array.from(this.isolates(),(e=>e.update()))),await new Promise((e=>window.setTimeout(e,Ba)))}}const Fa=12e4,Ba=2e3;class _a{#C;modelsInternal;#Uc;#qc;constructor(e){this.#C=e,this.modelsInternal=new Set,this.#Uc=0;const t=Fa/Ba;this.#qc=new Ha(t)}id(){return this.#C}models(){return this.modelsInternal}runtimeModel(){return this.modelsInternal.values().next().value||null}heapProfilerModel(){const e=this.runtimeModel();return e?.heapProfilerModel()??null}async update(){const e=this.runtimeModel(),t=e&&await e.heapUsage();t&&(this.#Uc=t.usedSize+(t.embedderHeapUsedSize??0)+(t.backingStorageSize??0),this.#qc.add(this.#Uc),Na.instance().dispatchEventToListeners("MemoryChanged",this))}samplesCount(){return this.#qc.count()}usedHeapSize(){return this.#Uc}usedHeapSizeGrowRate(){return this.#qc.fitSlope()}}class Ha{#zc;#jc;#is;#Vc;#Wc;#Gc;#Kc;#Qc;#$c;constructor(e){this.#zc=0|e,this.reset()}reset(){this.#jc=Date.now(),this.#is=0,this.#Vc=[],this.#Wc=[],this.#Gc=0,this.#Kc=0,this.#Qc=0,this.#$c=0}count(){return this.#Vc.length}add(e,t){const n="number"==typeof t?t:Date.now()-this.#jc,r=e;if(this.#Vc.length===this.#zc){const e=this.#Vc[this.#is],t=this.#Wc[this.#is];this.#Gc-=e,this.#Kc-=t,this.#Qc-=e*e,this.#$c-=e*t}this.#Gc+=n,this.#Kc+=r,this.#Qc+=n*n,this.#$c+=n*r,this.#Vc[this.#is]=n,this.#Wc[this.#is]=r,this.#is=(this.#is+1)%this.#zc}fitSlope(){const e=this.count();return e<2?0:(this.#$c-this.#Gc*this.#Kc/e)/(this.#Qc-this.#Gc*this.#Gc/e)}}var Ua=Object.freeze({__proto__:null,Isolate:_a,IsolateManager:Na,MemoryTrend:Ha,MemoryTrendWindowMs:Fa});class qa extends h{#Xc=!1;#fr=!1;constructor(e){super(e),this.ensureEnabled()}async ensureEnabled(){if(this.#fr)return;this.#fr=!0,this.target().registerAuditsDispatcher(this);const e=this.target().auditsAgent();await e.invoke_enable()}issueAdded(e){this.dispatchEventToListeners("IssueAdded",{issuesModel:this,inspectorIssue:e.issue})}dispose(){super.dispose(),this.#Xc=!0}getTargetIfNotDisposed(){return this.#Xc?null:this.target()}}h.register(qa,{capabilities:32768,autostart:!0});var za=Object.freeze({__proto__:null,IssuesModel:qa});var ja=Object.freeze({__proto__:null,LayerTreeBase:class{#e;#Yn;layersById=new Map;#Jc=null;#Yc=null;#Zc=new Map;#eh;constructor(e){this.#e=e,this.#Yn=e?e.model(Gs):null}target(){return this.#e}root(){return this.#Jc}setRoot(e){this.#Jc=e}contentRoot(){return this.#Yc}setContentRoot(e){this.#Yc=e}forEachLayer(e,t){return!(!t&&!(t=this.root()))&&(e(t)||t.children().some(this.forEachLayer.bind(this,e)))}layerById(e){return this.layersById.get(e)||null}async resolveBackendNodeIds(e){if(!e.size||!this.#Yn)return;const t=await this.#Yn.pushNodesByBackendIdsToFrontend(e);if(t)for(const e of t.keys())this.#Zc.set(e,t.get(e)||null)}backendNodeIdToNode(){return this.#Zc}setViewportSize(e){this.#eh=e}viewportSize(){return this.#eh}nodeForId(e){return this.#Yn?this.#Yn.nodeForId(e):null}},StickyPositionConstraint:class{#th;#nh;#rh;#sh;constructor(e,t){this.#th=t.stickyBoxRect,this.#nh=t.containingBlockRect,this.#rh=null,e&&t.nearestLayerShiftingStickyBox&&(this.#rh=e.layerById(t.nearestLayerShiftingStickyBox)),this.#sh=null,e&&t.nearestLayerShiftingContainingBlock&&(this.#sh=e.layerById(t.nearestLayerShiftingContainingBlock))}stickyBoxRect(){return this.#th}containingBlockRect(){return this.#nh}nearestLayerShiftingStickyBox(){return this.#rh}nearestLayerShiftingContainingBlock(){return this.#sh}}});class Va{id;url;startTime;loadTime;contentLoadTime;mainRequest;constructor(e){this.id=++Va.lastIdentifier,this.url=e.url(),this.startTime=e.startTime,this.mainRequest=e}static forRequest(e){return Wa.get(e)||null}bindRequest(e){Wa.set(e,this)}static lastIdentifier=0}const Wa=new WeakMap;var Ga=Object.freeze({__proto__:null,PageLoad:Va});class Ka extends h{layerTreeAgent;constructor(e){super(e),this.layerTreeAgent=e.layerTreeAgent()}async loadSnapshotFromFragments(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_loadSnapshot({tiles:e});return t?new Qa(this,t):null}loadSnapshot(e){const t={x:0,y:0,picture:e};return this.loadSnapshotFromFragments([t])}async makeSnapshot(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_makeSnapshot({layerId:e});return t?new Qa(this,t):null}}class Qa{#ih;#Ro;#oh;constructor(e,t){this.#ih=e,this.#Ro=t,this.#oh=1}release(){console.assert(this.#oh>0,"release is already called on the object"),--this.#oh||this.#ih.layerTreeAgent.invoke_releaseSnapshot({snapshotId:this.#Ro})}addReference(){++this.#oh,console.assert(this.#oh>0,"Referencing a dead object")}async replay(e,t,n){return(await this.#ih.layerTreeAgent.invoke_replaySnapshot({snapshotId:this.#Ro,fromStep:t,toStep:n,scale:e||1})).dataURL}async profile(e){return(await this.#ih.layerTreeAgent.invoke_profileSnapshot({snapshotId:this.#Ro,minRepeatCount:5,minDuration:1,clipRect:e||void 0})).timings}async commandLog(){const e=await this.#ih.layerTreeAgent.invoke_snapshotCommandLog({snapshotId:this.#Ro});return e.commandLog?e.commandLog.map(((e,t)=>new $a(e,t))):null}}class $a{method;params;commandIndex;constructor(e,t){this.method=e.method,this.params=e.params,this.commandIndex=t}}h.register(Ka,{capabilities:2,autostart:!1});var Xa=Object.freeze({__proto__:null,PaintProfilerLogItem:$a,PaintProfilerModel:Ka,PaintProfilerSnapshot:Qa});class Ja extends h{#Ws;#ah=new Map([["TaskDuration","CumulativeTime"],["ScriptDuration","CumulativeTime"],["LayoutDuration","CumulativeTime"],["RecalcStyleDuration","CumulativeTime"],["LayoutCount","CumulativeCount"],["RecalcStyleCount","CumulativeCount"]]);#lh=new Map;constructor(e){super(e),this.#Ws=e.performanceAgent()}enable(){return this.#Ws.invoke_enable({})}disable(){return this.#Ws.invoke_disable()}async requestMetrics(){const e=await this.#Ws.invoke_getMetrics()||[],t=new Map,n=performance.now();for(const s of e.metrics){let e,i=this.#lh.get(s.name);switch(i||(i={lastValue:void 0,lastTimestamp:void 0},this.#lh.set(s.name,i)),this.#ah.get(s.name)){case"CumulativeTime":e=i.lastTimestamp&&i.lastValue?r.NumberUtilities.clamp(1e3*(s.value-i.lastValue)/(n-i.lastTimestamp),0,1):0,i.lastValue=s.value,i.lastTimestamp=n;break;case"CumulativeCount":e=i.lastTimestamp&&i.lastValue?Math.max(0,1e3*(s.value-i.lastValue)/(n-i.lastTimestamp)):0,i.lastValue=s.value,i.lastTimestamp=n;break;default:e=s.value}t.set(s.name,e)}return{metrics:t,timestamp:n}}}h.register(Ja,{capabilities:2,autostart:!1});var Ya=Object.freeze({__proto__:null,PerformanceMetricsModel:Ja});class Za extends Map{getOrInsert(e,t){return this.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return this.has(e)||this.set(e,t(e)),this.get(e)}}class el extends h{agent;loaderIds=[];targetJustAttached=!0;lastPrimaryPageModel=null;documents=new Map;constructor(e){super(e),e.registerPreloadDispatcher(new tl(this)),this.agent=e.preloadAgent(),this.agent.invoke_enable();const t=e.targetInfo();void 0!==t&&"prerender"===t.subtype&&(this.lastPrimaryPageModel=W.instance().primaryPageTarget()?.model(el)||null),W.instance().addModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this)}dispose(){super.dispose(),W.instance().removeModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.agent.invoke_disable()}ensureDocumentPreloadingData(e){void 0===this.documents.get(e)&&this.documents.set(e,new nl)}currentLoaderId(){if(this.targetJustAttached)return null;if(0===this.loaderIds.length)throw new Error("unreachable");return this.loaderIds[this.loaderIds.length-1]}currentDocument(){const e=this.currentLoaderId();return null===e?null:this.documents.get(e)||null}getRuleSetById(e){return this.currentDocument()?.ruleSets.getById(e)||null}getAllRuleSets(){return this.currentDocument()?.ruleSets.getAll()||[]}getPreloadCountsByRuleSetId(){const e=new Map;for(const{value:t}of this.getRepresentativePreloadingAttempts(null))for(const n of[null,...t.ruleSetIds]){void 0===e.get(n)&&e.set(n,new Map);const r=e.get(n);s(r);const i=r.get(t.status)||0;r.set(t.status,i+1)}return e}getPreloadingAttemptById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getById(e,t.sources)||null}getRepresentativePreloadingAttempts(e){const t=this.currentDocument();return null===t?[]:t.preloadingAttempts.getAllRepresentative(e,t.sources)}getRepresentativePreloadingAttemptsOfPreviousPage(){if(this.loaderIds.length<=1)return[];const e=this.documents.get(this.loaderIds[this.loaderIds.length-2]);return void 0===e?[]:e.preloadingAttempts.getAllRepresentative(null,e.sources)}getPipelineById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getPipeline(e,t.sources)}getPipeline(e){let t=null;if(null!==e.pipelineId&&(t=this.getPipelineById(e.pipelineId)),null===t){const t=new Map;return t.set(e.action,e),new ol(t)}return new ol(t)}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(null===this.lastPrimaryPageModel&&"Activation"===n)return;if(null!==this.lastPrimaryPageModel&&"Activation"!==n)return;if(null!==this.lastPrimaryPageModel&&"Activation"===n){this.loaderIds=this.lastPrimaryPageModel.loaderIds;for(const[e,t]of this.lastPrimaryPageModel.documents.entries())this.ensureDocumentPreloadingData(e),this.documents.get(e)?.mergePrevious(t)}this.lastPrimaryPageModel=null;const r=t.loaderId;this.loaderIds.push(r),this.loaderIds=this.loaderIds.slice(-2),this.ensureDocumentPreloadingData(r);for(const e of this.documents.keys())this.loaderIds.includes(e)||this.documents.delete(e);this.dispatchEventToListeners("ModelUpdated")}onRuleSetUpdated(e){const t=e.ruleSet,n=t.loaderId;null===this.currentLoaderId()&&(this.loaderIds=[n],this.targetJustAttached=!1),this.ensureDocumentPreloadingData(n),this.documents.get(n)?.ruleSets.upsert(t),this.dispatchEventToListeners("ModelUpdated")}onRuleSetRemoved(e){const t=e.id;for(const e of this.documents.values())e.ruleSets.delete(t);this.dispatchEventToListeners("ModelUpdated")}onPreloadingAttemptSourcesUpdated(e){const t=e.loaderId;this.ensureDocumentPreloadingData(t);const n=this.documents.get(t);void 0!==n&&(n.sources.update(e.preloadingAttemptSources),n.preloadingAttempts.maybeRegisterNotTriggered(n.sources),n.preloadingAttempts.cleanUpRemovedAttempts(n.sources),this.dispatchEventToListeners("ModelUpdated"))}onPrefetchStatusUpdated(e){if("PrefetchEvictedAfterCandidateRemoved"===e.prefetchStatus)return;const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prefetch",key:e.key,pipelineId:e.pipelineId,status:sl(e.status),prefetchStatus:e.prefetchStatus||null,requestId:e.requestId};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners("ModelUpdated")}onPrerenderStatusUpdated(e){const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prerender",key:e.key,pipelineId:e.pipelineId,status:sl(e.status),prerenderStatus:e.prerenderStatus||null,disallowedMojoInterface:e.disallowedMojoInterface||null,mismatchedHeaders:e.mismatchedHeaders||null};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners("ModelUpdated")}onPreloadEnabledStateUpdated(e){this.dispatchEventToListeners("WarningsUpdated",e)}}h.register(el,{capabilities:2,autostart:!1});class tl{model;constructor(e){this.model=e}ruleSetUpdated(e){this.model.onRuleSetUpdated(e)}ruleSetRemoved(e){this.model.onRuleSetRemoved(e)}preloadingAttemptSourcesUpdated(e){this.model.onPreloadingAttemptSourcesUpdated(e)}prefetchStatusUpdated(e){this.model.onPrefetchStatusUpdated(e)}prerenderStatusUpdated(e){this.model.onPrerenderStatusUpdated(e)}preloadEnabledStateUpdated(e){this.model.onPreloadEnabledStateUpdated(e)}}class nl{ruleSets=new rl;preloadingAttempts=new al;sources=new ll;mergePrevious(e){if(!this.ruleSets.isEmpty()||!this.sources.isEmpty())throw new Error("unreachable");this.ruleSets=e.ruleSets,this.preloadingAttempts.mergePrevious(e.preloadingAttempts),this.sources=e.sources}}class rl{map=new Map;isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}getAll(){return Array.from(this.map.entries()).map((([e,t])=>({id:e,value:t})))}upsert(e){this.map.set(e.id,e)}delete(e){this.map.delete(e)}}function sl(e){switch(e){case"Pending":return"Pending";case"Running":return"Running";case"Ready":return"Ready";case"Success":return"Success";case"Failure":return"Failure";case"NotSupported":return"NotSupported"}throw new Error("unreachable")}function il(e){let t,n;switch(e.action){case"Prefetch":t="Prefetch";break;case"Prerender":t="Prerender"}switch(e.targetHint){case void 0:n="undefined";break;case"Blank":n="Blank";break;case"Self":n="Self"}return`${e.loaderId}:${t}:${e.url}:${n}`}class ol{inner;constructor(e){if(0===e.size)throw new Error("unreachable");this.inner=e}static newFromAttemptsForTesting(e){const t=new Map;for(const n of e)t.set(n.action,n);return new ol(t)}getOriginallyTriggered(){const e=this.getPrerender()||this.getPrefetch();return s(e),e}getPrefetch(){return this.inner.get("Prefetch")||null}getPrerender(){return this.inner.get("Prerender")||null}getAttempts(){const e=[],t=this.getPrefetch();null!==t&&e.push(t);const n=this.getPrerender();if(null!==n&&e.push(n),0===e.length)throw new Error("unreachable");return e}}class al{map=new Map;pipelines=new Za;enrich(e,t){let n=[],r=[];return null!==t&&(n=t.ruleSetIds,r=t.nodeIds),{...e,ruleSetIds:n,nodeIds:r}}isAttemptRepresentative(e){function t(e){switch(e){case"Prefetch":return 0;case"Prerender":return 1}}if(null===e.pipelineId)return!0;const n=this.pipelines.get(e.pipelineId);if(s(n),0===n.size)throw new Error("unreachable");return[...n.keys()].every((n=>t(n)<=t(e.action)))}getById(e,t){const n=this.map.get(e)||null;return null===n?null:this.enrich(n,t.getById(e))}getAllRepresentative(e,t){return[...this.map.entries()].map((([e,n])=>({id:e,value:this.enrich(n,t.getById(e))}))).filter((({value:t})=>!e||t.ruleSetIds.includes(e))).filter((({value:e})=>this.isAttemptRepresentative(e)))}getPipeline(e,t){const n=this.pipelines.get(e);if(void 0===n||0===n.size)return null;const r={};for(const[e,t]of this.map.entries())r[e]=t;return new Map(n.entries().map((([e,n])=>{const r=this.getById(n,t);return s(r),[e,r]})))}upsert(e){const t=il(e.key);this.map.set(t,e),null!==e.pipelineId&&this.pipelines.getOrInsertComputed(e.pipelineId,(()=>new Map)).set(e.action,t)}reconstructPipelines(){this.pipelines.clear();for(const[e,t]of this.map.entries()){if(null===t.pipelineId)continue;this.pipelines.getOrInsertComputed(t.pipelineId,(()=>new Map)).set(t.action,e)}}maybeRegisterNotTriggered(e){for(const[t,{key:n}]of e.entries()){if(void 0!==this.map.get(t))continue;let e;switch(n.action){case"Prefetch":e={action:"Prefetch",key:n,pipelineId:null,status:"NotTriggered",prefetchStatus:null,requestId:""};break;case"Prerender":e={action:"Prerender",key:n,pipelineId:null,status:"NotTriggered",prerenderStatus:null,disallowedMojoInterface:null,mismatchedHeaders:null}}this.map.set(t,e)}}cleanUpRemovedAttempts(e){const t=Array.from(this.map.keys()).filter((t=>!e.getById(t)));for(const e of t)this.map.delete(e);this.reconstructPipelines()}mergePrevious(e){for(const[t,n]of this.map.entries())e.map.set(t,n);this.map=e.map,this.reconstructPipelines()}}class ll{map=new Map;entries(){return this.map.entries()}isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}update(e){this.map=new Map(e.map((e=>[il(e.key),e])))}}var dl=Object.freeze({__proto__:null,PreloadPipeline:ol,PreloadingModel:el});var cl=Object.freeze({__proto__:null,ReactNativeApplicationModel:class extends h{#fr;#Ws;metadataCached=null;constructor(e){super(e),a.rnPerfMetrics.fuseboxSetClientMetadataStarted(),this.#fr=!1,this.#Ws=e.reactNativeApplicationAgent(),e.registerReactNativeApplicationDispatcher(this),this.ensureEnabled()}ensureEnabled(){this.#fr||(this.#Ws.invoke_enable().then((e=>{const t=e.getError(),n=!t;a.rnPerfMetrics.fuseboxSetClientMetadataFinished(n,t)})).catch((e=>{a.rnPerfMetrics.fuseboxSetClientMetadataFinished(!1,e)})),this.#fr=!0)}metadataUpdated(e){this.metadataCached=e,this.dispatchEventToListeners("MetadataUpdated",e)}}});class hl extends h{enabled=!1;storageAgent;storageKeyManager;bucketsById=new Map;trackedStorageKeys=new Set;constructor(e){super(e),e.registerStorageDispatcher(this),this.storageAgent=e.storageAgent(),this.storageKeyManager=e.model(ni)}getBuckets(){return new Set(this.bucketsById.values())}getBucketsForStorageKey(e){const t=[...this.bucketsById.values()];return new Set(t.filter((({bucket:t})=>t.storageKey===e)))}getDefaultBucketForStorageKey(e){return[...this.bucketsById.values()].find((({bucket:t})=>t.storageKey===e&&void 0===t.name))??null}getBucketById(e){return this.bucketsById.get(e)??null}getBucketByName(e,t){if(!t)return this.getDefaultBucketForStorageKey(e);return[...this.bucketsById.values()].find((({bucket:n})=>n.storageKey===e&&n.name===t))??null}deleteBucket(e){this.storageAgent.invoke_deleteStorageBucket({bucket:e})}enable(){if(!this.enabled){if(this.storageKeyManager){this.storageKeyManager.addEventListener("StorageKeyAdded",this.storageKeyAdded,this),this.storageKeyManager.addEventListener("StorageKeyRemoved",this.storageKeyRemoved,this);for(const e of this.storageKeyManager.storageKeys())this.addStorageKey(e)}this.enabled=!0}}storageKeyAdded(e){this.addStorageKey(e.data)}storageKeyRemoved(e){this.removeStorageKey(e.data)}addStorageKey(e){if(this.trackedStorageKeys.has(e))throw new Error("Can't call addStorageKey for a storage key if it has already been added.");this.trackedStorageKeys.add(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!0})}removeStorageKey(e){if(!this.trackedStorageKeys.has(e))throw new Error("Can't call removeStorageKey for a storage key if it hasn't already been added.");const t=this.getBucketsForStorageKey(e);for(const e of t)this.bucketRemoved(e);this.trackedStorageKeys.delete(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!1})}bucketAdded(e){this.bucketsById.set(e.id,e),this.dispatchEventToListeners("BucketAdded",{model:this,bucketInfo:e})}bucketRemoved(e){this.bucketsById.delete(e.id),this.dispatchEventToListeners("BucketRemoved",{model:this,bucketInfo:e})}bucketChanged(e){this.dispatchEventToListeners("BucketChanged",{model:this,bucketInfo:e})}bucketInfosAreEqual(e,t){return e.bucket.storageKey===t.bucket.storageKey&&e.id===t.id&&e.bucket.name===t.bucket.name&&e.expiration===t.expiration&&e.quota===t.quota&&e.persistent===t.persistent&&e.durability===t.durability}storageBucketCreatedOrUpdated({bucketInfo:e}){const t=this.getBucketById(e.id);t?this.bucketInfosAreEqual(t,e)||this.bucketChanged(e):this.bucketAdded(e)}storageBucketDeleted({bucketId:e}){const t=this.getBucketById(e);if(!t)throw new Error(`Received an event that Storage Bucket '${e}' was deleted, but it wasn't in the StorageBucketsModel.`);this.bucketRemoved(t)}attributionReportingTriggerRegistered(e){}interestGroupAccessed(e){}interestGroupAuctionEventOccurred(e){}interestGroupAuctionNetworkRequestCreated(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}cacheStorageListUpdated(e){}cacheStorageContentUpdated(e){}sharedStorageAccessed(e){}attributionReportingSourceRegistered(e){}}h.register(hl,{capabilities:8192,autostart:!1});var ul=Object.freeze({__proto__:null,StorageBucketsModel:hl});const gl={serviceworkercacheagentError:"`ServiceWorkerCacheAgent` error deleting cache entry {PH1} in cache: {PH2}"},pl=n.i18n.registerUIStrings("core/sdk/ServiceWorkerCacheModel.ts",gl),ml=n.i18n.getLocalizedString.bind(void 0,pl);class fl extends h{cacheAgent;#dh;#ch;#hh=new Map;#uh=new Set;#gh=new Set;#ph=new e.Throttler.Throttler(2e3);#fr=!1;#mh=!1;constructor(e){super(e),e.registerStorageDispatcher(this),this.cacheAgent=e.cacheStorageAgent(),this.#dh=e.storageAgent(),this.#ch=e.model(hl)}enable(){if(!this.#fr){this.#ch.addEventListener("BucketAdded",this.storageBucketAdded,this),this.#ch.addEventListener("BucketRemoved",this.storageBucketRemoved,this);for(const e of this.#ch.getBuckets())this.addStorageBucket(e.bucket);this.#fr=!0}}clearForStorageKey(e){for(const[t,n]of this.#hh.entries())n.storageKey===e&&(this.#hh.delete(t),this.cacheRemoved(n));for(const t of this.#ch.getBucketsForStorageKey(e))this.loadCacheNames(t.bucket)}refreshCacheNames(){for(const e of this.#hh.values())this.cacheRemoved(e);this.#hh.clear();const e=this.#ch.getBuckets();for(const t of e)this.loadCacheNames(t.bucket)}async deleteCache(e){const t=await this.cacheAgent.invoke_deleteCache({cacheId:e.cacheId});t.getError()?console.error(`ServiceWorkerCacheAgent error deleting cache ${e.toString()}: ${t.getError()}`):(this.#hh.delete(e.cacheId),this.cacheRemoved(e))}async deleteCacheEntry(t,n){const r=await this.cacheAgent.invoke_deleteEntry({cacheId:t.cacheId,request:n});r.getError()&&e.Console.Console.instance().error(ml(gl.serviceworkercacheagentError,{PH1:t.toString(),PH2:String(r.getError())}))}loadCacheData(e,t,n,r,s){this.requestEntries(e,t,n,r,s)}loadAllCacheData(e,t,n){this.requestAllEntries(e,t,n)}caches(){return[...this.#hh.values()]}dispose(){for(const e of this.#hh.values())this.cacheRemoved(e);this.#hh.clear(),this.#fr&&(this.#ch.removeEventListener("BucketAdded",this.storageBucketAdded,this),this.#ch.removeEventListener("BucketRemoved",this.storageBucketRemoved,this))}addStorageBucket(e){this.loadCacheNames(e),this.#uh.has(e.storageKey)||(this.#uh.add(e.storageKey),this.#dh.invoke_trackCacheStorageForStorageKey({storageKey:e.storageKey}))}removeStorageBucket(e){let t=0;for(const[n,r]of this.#hh.entries())e.storageKey===r.storageKey&&t++,r.inBucket(e)&&(t--,this.#hh.delete(n),this.cacheRemoved(r));0===t&&(this.#uh.delete(e.storageKey),this.#dh.invoke_untrackCacheStorageForStorageKey({storageKey:e.storageKey}))}async loadCacheNames(e){const t=await this.cacheAgent.invoke_requestCacheNames({storageBucket:e});t.getError()||this.updateCacheNames(e,t.caches)}updateCacheNames(e,t){const n=new Set,r=new Map,s=new Map;for(const e of t){const t=e.storageBucket??this.#ch.getDefaultBucketForStorageKey(e.storageKey)?.bucket;if(!t)continue;const s=new bl(this,t,e.cacheName,e.cacheId);n.add(s.cacheId),this.#hh.has(s.cacheId)||(r.set(s.cacheId,s),this.#hh.set(s.cacheId,s))}this.#hh.forEach((function(t){t.inBucket(e)&&!n.has(t.cacheId)&&(s.set(t.cacheId,t),this.#hh.delete(t.cacheId))}),this),r.forEach(this.cacheAdded,this),s.forEach(this.cacheRemoved,this)}storageBucketAdded({data:{bucketInfo:{bucket:e}}}){this.addStorageBucket(e)}storageBucketRemoved({data:{bucketInfo:{bucket:e}}}){this.removeStorageBucket(e)}cacheAdded(e){this.dispatchEventToListeners("CacheAdded",{model:this,cache:e})}cacheRemoved(e){this.dispatchEventToListeners("CacheRemoved",{model:this,cache:e})}async requestEntries(e,t,n,r,s){const i=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,skipCount:t,pageSize:n,pathFilter:r});i.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",i.getError()):s(i.cacheDataEntries,i.returnCount)}async requestAllEntries(e,t,n){const r=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,pathFilter:t});r.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",r.getError()):n(r.cacheDataEntries,r.returnCount)}cacheStorageListUpdated({bucketId:e}){const t=this.#ch.getBucketById(e)?.bucket;t&&(this.#gh.add(t),this.#ph.schedule((()=>{const e=Array.from(this.#gh,(e=>this.loadCacheNames(e)));return this.#gh.clear(),Promise.all(e)}),this.#mh?"AsSoonAsPossible":"Default"))}cacheStorageContentUpdated({bucketId:e,cacheName:t}){const n=this.#ch.getBucketById(e)?.bucket;n&&this.dispatchEventToListeners("CacheStorageContentUpdated",{storageBucket:n,cacheName:t})}attributionReportingTriggerRegistered(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}interestGroupAuctionEventOccurred(e){}interestGroupAccessed(e){}interestGroupAuctionNetworkRequestCreated(e){}sharedStorageAccessed(e){}storageBucketCreatedOrUpdated(e){}storageBucketDeleted(e){}setThrottlerSchedulesAsSoonAsPossibleForTest(){this.#mh=!0}attributionReportingSourceRegistered(e){}}class bl{#os;storageKey;storageBucket;cacheName;cacheId;constructor(e,t,n,r){this.#os=e,this.storageBucket=t,this.storageKey=t.storageKey,this.cacheName=n,this.cacheId=r}inBucket(e){return this.storageKey===e.storageKey&&this.storageBucket.name===e.name}equals(e){return this.cacheId===e.cacheId}toString(){return this.storageKey+this.cacheName}async requestCachedResponse(e,t){const n=await this.#os.cacheAgent.invoke_requestCachedResponse({cacheId:this.cacheId,requestURL:e,requestHeaders:t});return n.getError()?null:n.response}}h.register(fl,{capabilities:8192,autostart:!1});var yl=Object.freeze({__proto__:null,Cache:bl,ServiceWorkerCacheModel:fl});const vl={running:"running",starting:"starting",stopped:"stopped",stopping:"stopping",activated:"activated",activating:"activating",installed:"installed",installing:"installing",new:"new",redundant:"redundant",sSS:"{PH1} #{PH2} ({PH3})"},Il=n.i18n.registerUIStrings("core/sdk/ServiceWorkerManager.ts",vl),wl=n.i18n.getLocalizedString.bind(void 0,Il),Sl=n.i18n.getLazilyComputedLocalizedString.bind(void 0,Il);class kl extends h{#Ws;#fh=new Map;#fr=!1;#bh;serviceWorkerNetworkRequestsPanelStatus={isOpen:!1,openedAt:0};constructor(t){super(t),t.registerServiceWorkerDispatcher(new Cl(this)),this.#Ws=t.serviceWorkerAgent(),this.enable(),this.#bh=e.Settings.Settings.instance().createSetting("service-worker-update-on-reload",!1),this.#bh.get()&&this.forceUpdateSettingChanged(),this.#bh.addChangeListener(this.forceUpdateSettingChanged,this),new Pl(t,this)}async enable(){this.#fr||(this.#fr=!0,await this.#Ws.invoke_enable())}async disable(){this.#fr&&(this.#fr=!1,this.#fh.clear(),await this.#Ws.invoke_enable())}registrations(){return this.#fh}findVersion(e){for(const t of this.registrations().values()){const n=t.versions.get(e);if(n)return n}return null}deleteRegistration(e){const t=this.#fh.get(e);if(t){if(t.isRedundant())return this.#fh.delete(e),void this.dispatchEventToListeners("RegistrationDeleted",t);t.deleting=!0;for(const e of t.versions.values())this.stopWorker(e.id);this.unregister(t.scopeURL)}}async updateRegistration(e){const t=this.#fh.get(e);t&&await this.#Ws.invoke_updateRegistration({scopeURL:t.scopeURL})}async deliverPushMessage(t,n){const r=this.#fh.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ws.invoke_deliverPushMessage({origin:s,registrationId:t,data:n})}async dispatchSyncEvent(t,n,r){const s=this.#fh.get(t);if(!s)return;const i=e.ParsedURL.ParsedURL.extractOrigin(s.scopeURL);await this.#Ws.invoke_dispatchSyncEvent({origin:i,registrationId:t,tag:n,lastChance:r})}async dispatchPeriodicSyncEvent(t,n){const r=this.#fh.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ws.invoke_dispatchPeriodicSyncEvent({origin:s,registrationId:t,tag:n})}async unregister(e){await this.#Ws.invoke_unregister({scopeURL:e})}async startWorker(e){await this.#Ws.invoke_startWorker({scopeURL:e})}async skipWaiting(e){await this.#Ws.invoke_skipWaiting({scopeURL:e})}async stopWorker(e){await this.#Ws.invoke_stopWorker({versionId:e})}async inspectWorker(e){await this.#Ws.invoke_inspectWorker({versionId:e})}workerRegistrationUpdated(e){for(const t of e){let e=this.#fh.get(t.registrationId);e?(e.update(t),e.shouldBeRemoved()?(this.#fh.delete(e.id),this.dispatchEventToListeners("RegistrationDeleted",e)):this.dispatchEventToListeners("RegistrationUpdated",e)):(e=new Ml(t),this.#fh.set(t.registrationId,e),this.dispatchEventToListeners("RegistrationUpdated",e))}}workerVersionUpdated(e){const t=new Set;for(const n of e){const e=this.#fh.get(n.registrationId);e&&(e.updateVersion(n),t.add(e))}for(const e of t)e.shouldBeRemoved()?(this.#fh.delete(e.id),this.dispatchEventToListeners("RegistrationDeleted",e)):this.dispatchEventToListeners("RegistrationUpdated",e)}workerErrorReported(e){const t=this.#fh.get(e.registrationId);t&&(t.errors.push(e),this.dispatchEventToListeners("RegistrationErrorAdded",{registration:t,error:e}))}forceUpdateSettingChanged(){const e=this.#bh.get();this.#Ws.invoke_setForceUpdateOnPageLoad({forceUpdateOnPageLoad:e})}}class Cl{#z;constructor(e){this.#z=e}workerRegistrationUpdated({registrations:e}){this.#z.workerRegistrationUpdated(e)}workerVersionUpdated({versions:e}){this.#z.workerVersionUpdated(e)}workerErrorReported({errorMessage:e}){this.#z.workerErrorReported(e)}}class xl{runningStatus;status;lastUpdatedTimestamp;previousState;constructor(e,t,n,r){this.runningStatus=e,this.status=t,this.lastUpdatedTimestamp=r,this.previousState=n}}class Rl{condition;source;id;constructor(e,t,n){this.condition=e,this.source=t,this.id=n}}class Tl{id;scriptURL;parsedURL;securityOrigin;scriptLastModified;scriptResponseTime;controlledClients;targetId;routerRules;currentState;registration;constructor(e,t){this.registration=e,this.update(t)}update(t){this.id=t.versionId,this.scriptURL=t.scriptURL;const n=new e.ParsedURL.ParsedURL(t.scriptURL);this.securityOrigin=n.securityOrigin(),this.currentState=new xl(t.runningStatus,t.status,this.currentState,Date.now()),this.scriptLastModified=t.scriptLastModified,this.scriptResponseTime=t.scriptResponseTime,t.controlledClients?this.controlledClients=t.controlledClients.slice():this.controlledClients=[],this.targetId=t.targetId||null,this.routerRules=null,t.routerRules&&(this.routerRules=this.parseJSONRules(t.routerRules))}isStartable(){return!this.registration.isDeleted&&this.isActivated()&&this.isStopped()}isStoppedAndRedundant(){return"stopped"===this.runningStatus&&"redundant"===this.status}isStopped(){return"stopped"===this.runningStatus}isStarting(){return"starting"===this.runningStatus}isRunning(){return"running"===this.runningStatus}isStopping(){return"stopping"===this.runningStatus}isNew(){return"new"===this.status}isInstalling(){return"installing"===this.status}isInstalled(){return"installed"===this.status}isActivating(){return"activating"===this.status}isActivated(){return"activated"===this.status}isRedundant(){return"redundant"===this.status}get status(){return this.currentState.status}get runningStatus(){return this.currentState.runningStatus}mode(){return this.isNew()||this.isInstalling()?"installing":this.isInstalled()?"waiting":this.isActivating()||this.isActivated()?"active":"redundant"}parseJSONRules(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return console.error("Parse error: `routerRules` in ServiceWorkerVersion should be an array"),null;const n=[];for(const e of t){const{condition:t,source:r,id:s}=e;if(void 0===t||void 0===r||void 0===s)return console.error("Parse error: Missing some fields of `routerRules` in ServiceWorkerVersion"),null;n.push(new Rl(JSON.stringify(t),JSON.stringify(r),s))}return n}catch{return console.error("Parse error: Invalid `routerRules` in ServiceWorkerVersion"),null}}}!function(e){e.RunningStatus={running:Sl(vl.running),starting:Sl(vl.starting),stopped:Sl(vl.stopped),stopping:Sl(vl.stopping)},e.Status={activated:Sl(vl.activated),activating:Sl(vl.activating),installed:Sl(vl.installed),installing:Sl(vl.installing),new:Sl(vl.new),redundant:Sl(vl.redundant)}}(Tl||(Tl={}));class Ml{#yh;id;scopeURL;securityOrigin;isDeleted;versions=new Map;deleting=!1;errors=[];constructor(e){this.update(e)}update(t){this.#yh=Symbol("fingerprint"),this.id=t.registrationId,this.scopeURL=t.scopeURL;const n=new e.ParsedURL.ParsedURL(t.scopeURL);this.securityOrigin=n.securityOrigin(),this.isDeleted=t.isDeleted}fingerprint(){return this.#yh}versionsByMode(){const e=new Map;for(const t of this.versions.values())e.set(t.mode(),t);return e}updateVersion(e){this.#yh=Symbol("fingerprint");let t=this.versions.get(e.versionId);return t?(t.update(e),t):(t=new Tl(this,e),this.versions.set(e.versionId,t),t)}isRedundant(){for(const e of this.versions.values())if(!e.isStoppedAndRedundant())return!1;return!0}shouldBeRemoved(){return this.isRedundant()&&(!this.errors.length||this.deleting)}canBeRemoved(){return this.isDeleted||this.deleting}}class Pl{#Kn;#vh;#Ih=new Map;constructor(e,t){this.#Kn=e,this.#vh=t,t.addEventListener("RegistrationUpdated",this.registrationsUpdated,this),t.addEventListener("RegistrationDeleted",this.registrationsUpdated,this),W.instance().addModelListener(Jr,$r.ExecutionContextCreated,this.executionContextCreated,this)}registrationsUpdated(){this.#Ih.clear();const e=this.#vh.registrations().values();for(const t of e)for(const e of t.versions.values())e.targetId&&this.#Ih.set(e.targetId,e);this.updateAllContextLabels()}executionContextCreated(e){const t=e.data,n=this.serviceWorkerTargetId(t.target());n&&this.updateContextLabel(t,this.#Ih.get(n)||null)}serviceWorkerTargetId(e){return e.parentTarget()!==this.#Kn||e.type()!==U.ServiceWorker?null:e.id()}updateAllContextLabels(){for(const e of W.instance().targets()){const t=this.serviceWorkerTargetId(e);if(!t)continue;const n=this.#Ih.get(t)||null,r=e.model(Jr),s=r?r.executionContexts():[];for(const e of s)this.updateContextLabel(e,n)}}updateContextLabel(t,n){if(!n)return void t.setLabel("");const r=e.ParsedURL.ParsedURL.fromString(t.origin),s=r?r.lastPathComponentWithFragment():t.name,i=Tl.Status[n.status];t.setLabel(wl(vl.sSS,{PH1:s,PH2:n.id,PH3:i()}))}}h.register(kl,{capabilities:16384,autostart:!0});var El=Object.freeze({__proto__:null,ServiceWorkerManager:kl,ServiceWorkerRegistration:Ml,ServiceWorkerRouterRule:Rl,get ServiceWorkerVersion(){return Tl},ServiceWorkerVersionState:xl});class Ll extends h{#Ws;constructor(e){super(e),this.#Ws=e.webAuthnAgent(),e.registerWebAuthnDispatcher(new Al(this))}setVirtualAuthEnvEnabled(e){return e?this.#Ws.invoke_enable({enableUI:!0}):this.#Ws.invoke_disable()}async addAuthenticator(e){return(await this.#Ws.invoke_addVirtualAuthenticator({options:e})).authenticatorId}async removeAuthenticator(e){await this.#Ws.invoke_removeVirtualAuthenticator({authenticatorId:e})}async setAutomaticPresenceSimulation(e,t){await this.#Ws.invoke_setAutomaticPresenceSimulation({authenticatorId:e,enabled:t})}async getCredentials(e){return(await this.#Ws.invoke_getCredentials({authenticatorId:e})).credentials}async removeCredential(e,t){await this.#Ws.invoke_removeCredential({authenticatorId:e,credentialId:t})}credentialAdded(e){this.dispatchEventToListeners("CredentialAdded",e)}credentialAsserted(e){this.dispatchEventToListeners("CredentialAsserted",e)}credentialDeleted(e){this.dispatchEventToListeners("CredentialDeleted",e)}credentialUpdated(e){this.dispatchEventToListeners("CredentialUpdated",e)}}class Al{#os;constructor(e){this.#os=e}credentialAdded(e){this.#os.credentialAdded(e)}credentialAsserted(e){this.#os.credentialAsserted(e)}credentialDeleted(e){this.#os.credentialDeleted(e)}credentialUpdated(e){this.#os.credentialUpdated(e)}}h.register(Ll,{capabilities:65536,autostart:!1});var Ol=Object.freeze({__proto__:null,WebAuthnModel:Ll});export{Fi as AccessibilityModel,eo as AnimationModel,no as AutofillModel,Uo as CPUProfilerModel,ya as CPUThrottlingManager,Vt as CSSContainerQuery,me as CSSFontFace,Gt as CSSLayer,Mn as CSSMatchedStyles,Xt as CSSMedia,B as CSSMetadata,Gr as CSSModel,Bt as CSSProperty,Nt as CSSPropertyParser,ht as CSSPropertyParserMatchers,Ht as CSSQuery,pn as CSSRule,Zt as CSSScope,tn as CSSStyleDeclaration,On as CSSStyleSheetHeader,rn as CSSSupports,so as CategorizedBreakpoint,Eo as ChildTargetManager,No as CompilerSourceMappingContentProvider,xo as Connections,Jo as ConsoleModel,q as Cookie,ci as CookieModel,gi as CookieParser,Ta as DOMDebuggerModel,Xs as DOMModel,Ts as DebuggerModel,ta as EmulationModel,oo as EnhancedTracesParser,Aa as EventBreakpointsModel,Oa as FrameAssociated,Fn as FrameManager,Xr as HeapProfilerModel,Xn as IOModel,Ua as IsolateManager,za as IssuesModel,ja as LayerTreeBase,zo as LogModel,ge as NetworkManager,Oi as NetworkRequest,Ps as OverlayColorGenerator,qs as OverlayModel,Ls as OverlayPersistentHighlighter,Ga as PageLoad,sr as PageResourceLoader,Xa as PaintProfiler,Ya as PerformanceMetricsModel,dl as PreloadingModel,cl as ReactNativeApplicationModel,Qn as RemoteObject,Zs as Resource,li as ResourceTreeModel,es as RuntimeModel,u as SDKModel,_i as ScreenCaptureModel,ds as Script,ti as SecurityOriginManager,fi as ServerSentEventProtocol,Si as ServerTiming,yl as ServiceWorkerCacheModel,El as ServiceWorkerManager,Ar as SourceMap,br as SourceMapFunctionRanges,Fr as SourceMapManager,kr as SourceMapScopeChainEntry,gr as SourceMapScopes,Rr as SourceMapScopesInfo,ul as StorageBucketsModel,si as StorageKeyManager,j as Target,G as TargetManager,co as TraceObject,Ol as WebAuthnModel};
