PageSourceSearch

https://www.geico.com/_next/static/chunks/gds-gds-secondary-menu-item-js.2fff0b5b55fda200.js

js geico.com collected 2026-09-24 08:34:52 UTC 15,978 bytes, 433 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[47521],{1747:(e,t,o)=>{var s=o(98314),n=o(24291),i=o(85065),l=o(40629),r=o(11598),a=(0,l.b)`
2  :host {
3    display: grid;
4    grid-template-rows: 0fr;
5    /* Override from the light DOM: --gds-utils-expand-collapse-transition */
6    transition: var(
7      --gds-utils-expand-collapse-transition,
8      grid-template-rows 0.5s ease-out
9    );
10  }
11
12  :host([expanded]) {
13    grid-template-rows: 1fr;
14  }
15
16  .content {
17    overflow: hidden;
18  }
19
20  /* Allow focus outlines to be visible */
21  .content:focus-within {
22    overflow: visible;
23  }
24
25  .content:has(:focus-visible) {
26    overflow: visible;
27  }
28`,c=class extends l.g{constructor(){super(...arguments),this.expanded=!1}render(){return(0,l.c)`
29      <div class="content">
30        <slot @slotchange="${this.handleSlotChange}"></slot>
31      </div>
32    `}handleSlotChange(){this.requestUpdate()}updated(e){super.updated(e);let t=new CSSStyleSheet;t.replaceSync(a.cssText),this.shadowRoot.adoptedStyleSheets=[s.g,t]}toggleExpand(){this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent("expand-collapse-toggled",{detail:{expanded:this.expanded}}))}_getContentHeight(){let e=this.renderRoot.querySelector(".content");return e?e.scrollHeight:0}};(0,r.c)([(0,n.b)({type:Boolean,reflect:!0})],c.prototype,"expanded",2),c=(0,r.c)([(0,i.a)("gds-utils-expand-collapse")],c)},23827:(e,t,o)=>{o.d(t,{a:()=>h});var s=o(41088),n=o(98314),i=o(24291),l=o(85065),r=o(40629),a=o(11598),c=e=>(0,r.b)`
33    width: ${e};
34    height: ${e};
35    font-size: ${e};
36    line-height: ${e};
37  `,d=(0,r.b)`
38  :host {
39    --icon-size-value-xxsmall: var(--icon-xxsmall-dimensions);
40    --icon-size-value-xsmall: var(--icon-xsmall-dimensions);
41    --icon-size-value-small: var(--icon-small-dimensions);
42    --icon-size-value-medium: var(--icon-medium-dimensions);
43    --icon-size-value-large: var(--icon-large-dimensions);
44    --icon-size-value-xlarge: var(--icon-xlarge-dimensions);
45    display: inline-block;
46    line-height: 0;
47  }
48
49  :host span.geico-icon:before {
50    display: inline-block;
51    margin: 0 auto;
52  }
53
54  :host([size="xxsmall"]) span {
55    ${c((0,r.b)`var(--icon-size-value-xxsmall)`)}
56  }
57
58  :host([size="xsmall"]) span {
59    ${c((0,r.b)`var(--icon-size-value-xsmall)`)}
60  }
61
62  :host([size="small"]) span {
63    ${c((0,r.b)`var(--icon-size-value-small)`)}
64  }
65
66  :host([size="medium"]) span {
67    ${c((0,r.b)`var(--icon-size-value-medium)`)}
68  }
69
70  :host([size="large"]) span {
71    ${c((0,r.b)`var(--icon-size-value-large)`)}
72  }
73
74  :host([size="xlarge"]) span {
75    ${c((0,r.b)`var(--icon-size-value-xlarge)`)}
76  }
77
78  span[color="default"] {
79    color: var(--icon-default-color, var(--text-color));
80  }
81
82  span[color="brand"] {
83    color: var(--color-brand-standalone-icon);
84  }
85
86  span[color="brand-alt"] {
87    color: var(--color-brand-secondary-accent);
88  }
89
90  span[color="action"] {
91    color: var(--color-action-standalone-icon);
92  }
93
94  span[color="warning"] {
95    color: var(--color-warning-standalone-icon);
96  }
97
98  span[color="success"] {
99    color: var(--color-success-standalone-icon);
100  }
101
102  span[color="danger"] {
103    color: var(--color-danger-standalone-icon);
104  }
105
106  span[color="purple"] {
107    color: var(--color-accent-purple);
108  }
109
110  span[color="teal"] {
111    color: var(--color-accent-teal);
112  }
113
114  span[color="magenta"] {
115    color: var(--color-accent-magenta);
116  }
117
118  span[color="neutral"] {
119    color: var(--color-neutral-standalone-icon);
120  }
121
122  span[color="reverse"] {
123    color: var(--text-color-reverse);
124  }
125
126  span[color="always-white"] {
127    color: var(--icon-color-reverse);
128  }
129
130  span[color="always-black"] {
131    color: var(--icon-color-black);
132  }
133
134  a {
135    text-decoration: none;
136  }
137
138  :host([type="link"]) a {
139    cursor: pointer;
140  }
141
142  :host button {
143    background: transparent;
144    border: none;
145    cursor: pointer;
146
147    &:focus:not(:focus-visible) {
148      outline: none;
149    }
150
151    &:focus-visible {
152      outline: var(--focus-outline);
153      outline-offset: var(--focus-outline-offset);
154    }
155  }
156
157  :host(.reset-padding) {
158    button {
159      padding: 0;
160    }
161  }
162
163  :host([type="button"]) button {
164    color: var(--color-action);
165    &:active {
166      color: var(--color-action-active);
167    }
168    &:hover {
169      color: var(--color-action-hover);
170    }
171  }
172
173  :host([type="destructive"]) button {
174    color: var(--color-neutral-standalone-text);
175    &:active {
176      color: var(--icon-destructive-active-color);
177    }
178    &:hover {
179      color: var(--icon-destructive-hover-color);
180    }
181  }
182`,p=(0,r.b)`
183  :host-context([data-gdstheme*="dark"]):host([type="button"]) button:active {
184    color: var(--color-action);
185  }
186
187  :host-context([data-gdstheme*="dark"]):host([type="button"]) button:hover {
188    color: var(--color-action);
189  }
190`,h=class extends r.g{constructor(){super(...arguments),this.iconType="vehicle",this.color="default",this.size="medium"}render(){let e=(0,r.c)`
191      <span
192        class="geico-icon icon-${this.iconType||"vehicle"}"
193        color="${this.type?r.e:this.color||"default"}"
194      ></span>
195    `;return this.type?"link"===this.type?(0,r.c)`
196        <a href="${this.href}" target="${this.target||r.e}">
197          ${e}
198        </a>
199      `:"button"===this.type||"destructive"===this.type?(0,r.c)`
200        <button
201          type="button"
202          @click="${this.iconButtonClick}"
203          aria-label="${this.buttonAriaLabel||r.e}"
204        >
205          ${e}
206        </button>
207      `:void 0:(0,r.c)` ${e} `}connectedCallback(){super.connectedCallback();let e=new CSSStyleSheet;e.replaceSync(d.cssText);let t=new CSSStyleSheet;t.replaceSync(p.cssText),this.shadowRoot.adoptedStyleSheets=[n.d,n.b,e,t,n.c]}updated(e){(e.has("size")||e.has("type"))&&this.type&&"medium"!==this.size&&"small"!==this.size&&(this.size="medium")}iconButtonClick(){this.dispatchEvent(new CustomEvent("icon-button-click",s.a))}};(0,a.c)([(0,i.b)({reflect:!0})],h.prototype,"type",2),(0,a.c)([(0,i.b)({type:String,attribute:"icon-type"})],h.prototype,"iconType",2),(0,a.c)([(0,i.b)({type:String,reflect:!0})],h.prototype,"color",2),(0,a.c)([(0,i.b)({type:String,reflect:!0})],h.prototype,"size",2),(0,a.c)([(0,i.b)()],h.prototype,"href",2),(0,a.c)([(0,i.b)()],h.prototype,"target",2),(0,a.c)([(0,i.b)({type:String,attribute:"button-aria-label"})],h.prototype,"buttonAriaLabel",2),h=(0,a.c)([(0,l.a)("gds-icon")],h)},41088:(e,t,o)=>{o.d(t,{a:()=>s});var s={bubbles:!0,cancelable:!1,composed:!0}},43011:(e,t,o)=>{o.r(t),o.d(t,{GdsSecondaryMenuItem:()=>s.a});var s=o(97014);o(1747),o(23827),o(41088),o(98314),o(24291),o(8802),o(40629),o(11598)},97014:(e,t,o)=>{o.d(t,{a:()=>c});var s=o(24291),n=o(85065),i=o(40629),l=o(11598),r=(0,i.b)`
208  :host {
209    display: block;
210    overflow-x: clip;
211  }
212
213  :host(:focus-within) {
214    overflow: visible;
215  }
216
217  :host([type="menu"]) span,
218  :host([type="link"]) span {
219    border-left: var(--sec-menu-item-default-border-left-style);
220    font: var(--sec-menu-first-level-typography);
221    &:active {
222      border-left: var(--sec-menu-selected-border-left-style);
223    }
224  }
225
226  :host([level="2"]) span {
227    padding-left: var(--sec-menu-second-level-padding-left);
228  }
229
230  :host([level="3"]) span {
231    padding-left: var(--sec-menu-third-level-padding-left);
232  }
233
234  :host(:not([collapseddrawer])[type="menu"][level="1"]) li,
235  :host(:not([collapseddrawer])[type="link"][level="1"]) li {
236    &:hover {
237      background: var(--color-brand-receded);
238    }
239  }
240
241  :host([type="menu"][level="2"]) span,
242  :host([type="link"][level="2"]) span,
243  :host([type="menu"][level="3"]) span,
244  :host([type="link"][level="3"]) span {
245    font: var(--sec-menu-second-level-typography);
246
247    &:hover {
248      font-weight: 700;
249    }
250  }
251
252  :host slot {
253    display: block;
254  }
255
256  :host([collapseddrawer][side="left"]) slot,
257  :host([collapseddrawer][side="left"]) gds-icon:last-child {
258    visibility: hidden;
259    opacity: 0;
260    background: var(--color-brand-secondary);
261    color: var(--color-on-action);
262    padding: var(--sec-menu-item-padding);
263    border-radius: var(--sec-menu-item-hover-text-popup-border-radius);
264  }
265
266  :host([collapseddrawer][side="left"]) slot:before {
267    content: " ";
268    display: block;
269    width: 0;
270    height: 0;
271    border-top: var(--sec-menu-item-hover-text-popup-border-top-style);
272    border-bottom: var(--sec-menu-item-hover-text-popup-border-bottom);
273    border-right: var(--sec-menu-item-hover-text-popup-border-right);
274    float: left;
275    top: var(--sec-menu-item-hover-text-popup-top);
276    position: relative;
277    right: var(--sec-menu-item-hover-text-popup-right);
278  }
279
280  :host(:not([icon])[collapseddrawer]) li {
281    pointer-events: none;
282  }
283
284  :host([collapseddrawer]) li {
285    min-width: var(--sec-menu-item-min-width);
286  }
287
288  :host([collapseddrawer][hover]) slot {
289    visibility: visible;
290    opacity: 1;
291  }
292
293  :host([type="link"]) li > a {
294    text-decoration: none;
295    color: var(--text-color);
296    &:visited {
297      color: var(--text-color);
298    }
299    &:focus-visible {
300      display: block;
301      outline: var(--focus-outline);
302      outline-offset: var(--focus-outline-offset);
303    }
304    &:focus:not(:focus-visible) {
305      outline: none;
306    }
307    &:active {
308      outline: none;
309    }
310  }
311
312  :host li {
313    list-style: none;
314    transition: background 0.5s ease;
315    overflow-x: clip;
316    position: relative;
317  }
318
319  :host li:focus-within {
320    overflow: visible;
321  }
322
323  /* Apply overflow fix to any level */
324  :host([level]:focus-within) {
325    overflow: visible;
326  }
327
328  :host([level]) li:focus-within {
329    overflow: visible;
330  }
331
332  /* Universal fix - ensure any element with focus-within shows outline */
333  :host *:focus-within {
334    overflow: visible !important;
335  }
336
337  :host li span {
338    display: flex;
339    align-items: center;
340    gap: var(--sec-menu-gap);
341    padding: var(--sec-menu-first-level-padding);
342    padding-left: 0.8rem;
343  }
344
345  :host li > div {
346    display: flex;
347    justify-content: space-between;
348    align-items: center;
349    cursor: pointer;
350    &:focus-visible {
351      outline: var(--focus-outline);
352      outline-offset: var(--focus-outline-offset);
353    }
354    &:focus:not(:focus-visible) {
355      outline: none;
356    }
357    &:active {
358      outline: none;
359    }
360  }
361
362  :host li > div > gds-icon {
363    padding-right: var(--sec-menu-first-level-padding);
364  }
365`,a=(0,i.b)`
366  :host-context([data-gdstheme*="dark"]):host(
367      :not([collapseddrawer])[type="menu"][level="1"]
368    )
369    li:hover,
370  :host-context([data-gdstheme*="dark"]):host(
371      :not([collapseddrawer])[type="link"][level="1"]
372    )
373    li:hover {
374    background: var(--color-brand-saturated);
375  }
376`,c=class extends i.g{constructor(){super(),this.type="link",this._internalVars={count:0}}connectedCallback(){super.connectedCallback();let e=new CSSStyleSheet;e.replaceSync(r.cssText);let t=new CSSStyleSheet;t.replaceSync(a.cssText),this.shadowRoot.adoptedStyleSheets=[e,t],"GDS-DRAWER"==this.parentElement.parentElement.tagName&&("menu"===this.type||"link"===this.type)&&(this.parentElement.parentElement.getAttribute("expanded")||(this.collapseddrawer=!0),this.hasAttribute("icon")||this.setAttribute("tabindex","-1")),this._assignMenuLevel(),(2==this.level||3==this.level)&&this.setAttribute("tabindex","-1"),this.setAttribute("role","menuitem")}updated(e){if(e.has("expanded")){if("menu"!=this.type||this.expanded||this.querySelectorAll("[level='2'][type='menu']").forEach(e
376=>{e.hasAttribute("expanded")&&e.removeAttribute("expanded")}),"menu"==this.type&&this.expanded){let e=this.parentElement.parentElement;"GDS-DRAWER"==e.tagName&&(e.getAttribute("expanded")||e.setAttribute("expanded",""))}"menu"==this.type&&this.expanded?this.querySelectorAll(":scope > gds-secondary-menu > gds-secondary-menu-item").forEach(e=>{e.removeAttribute("tabindex")}):"menu"!=this.type||this.expanded||this.querySelectorAll(":scope > gds-secondary-menu > gds-secondary-menu-item").forEach(e=>{e.setAttribute("tabindex","-1")})}e.has("icon")&&(this.icon?this.parentElement.querySelectorAll("gds-secondary-menu-item").forEach(e=>{Promise.resolve().then(()=>{e.hasAttribute("icon")||e.setAttribute("icon","extra-empty")})}):this.parentElement.querySelectorAll("gds-secondary-menu-item").forEach(e=>{e.hasAttribute("icon")&&e.removeAttribute("icon")}))}render(){return(0,i.c)`${"menu"===this.type&&1===this.level?(0,i.c)`<li role="none">
377          <div
378            @click="${this._handleExpandTrigger}"
379            @keypress="${this.checkKey}"
380            tabindex="0"
381            role="button"
382            aria-expanded="${this.expanded?this.expanded:"false"}"
383          >
384            <span part="item-text">
385              ${this.icon?(0,i.c)`<gds-icon
386                    @mouseover="${this._handleIconHoverTrigger}"
387                    @mouseout="${this._handleIconNoHoverTrigger}"
388                    icon-type="${this.icon}"
389                    size="small"
390                  ></gds-icon>`:""}
391              <slot></slot
392            ></span>
393            <gds-icon
394              icon-type="${this.expanded?"chevron-down":"chevron-right"}"
395              size="xsmall"
396            ></gds-icon>
397          </div>
398          <gds-utils-expand-collapse ?expanded="${this.expanded}">
399            <slot name="submenu"></slot>
400          </gds-utils-expand-collapse>
401        </li>`:"link"===this.type&&1!==this.level?(0,i.c)`<li role="none">
402            <a href="${this.href}" target="${this.target}"
403              ><span part="item-text"><slot></slot></span
404            ></a>
405          </li>`:"menu"===this.type&&1!==this.level?(0,i.c)`<li role="none">
406              <div
407                @click="${this._handleExpandTrigger}"
408                @keypress="${this.checkKey}"
409                tabindex="0"
410                role="button"
411                aria-expanded="${this.expanded?this.expanded:"false"}"
412              >
413                <span part="item-text"><slot></slot></span>
414                <gds-icon
415                  icon-type="${this.expanded?"chevron-down":"chevron-right"}"
416                  size="xsmall"
417                ></gds-icon>
418              </div>
419              <gds-utils-expand-collapse ?expanded="${this.expanded}">
420                <slot name="submenu"></slot>
421              </gds-utils-expand-collapse>
422            </li>`:(0,i.c)`<li role="none">
423              <a href="${this.href}" target="${this.target}"
424                ><span part="item-text">
425                  ${this.icon?(0,i.c)`<gds-icon
426                        @mouseover="${this._handleIconHoverTrigger}"
427                        @mouseout="${this._handleIconNoHoverTrigger}"
428                        icon-type="${this.icon}"
429                        size="small"
430                      ></gds-icon>`:""}
431                  <slot></slot></span
432              ></a>
433            </li>`}`}_assignMenuLevel(){let e=this.closest("gds-secondary-menu:not([slot])"),t=this.parentElement;for(;t;){if(t==e){switch(this._internalVars.count){case 0:this._internalVars.count=1;break;case 2:this._internalVars.count=2;break;case 4:this._internalVars.count=3}this.level=this._internalVars.count}t=t.parentElement,this._internalVars.count+=1}return null}_handleExpandTrigger(){this.expanded=!this.expanded}_handleIconHoverTrigger(){this.hover=!0,this.parentElement.parentElement.setAttribute("overflow","true")}_handleIconNoHoverTrigger(){this.hover=!1,this.parentElement.parentElement.removeAttribute("overflow")}checkKey(e){"Enter"===e.key&&this._handleExpandTrigger()}};(0,l.c)([(0,s.b)({type:Boolean,reflect:!0})],c.prototype,"expanded",2),(0,l.c)([(0,s.b)({reflect:!0})],c.prototype,"type",2),(0,l.c)([(0,s.b)({type:Boolean,reflect:!0})],c.prototype,"hover",2),(0,l.c)([(0,s.b)({type:Boolean,reflect:!0})],c.prototype,"collapseddrawer",2),(0,l.c)([(0,s.b)({reflect:!0})],c.prototype,"icon",2),(0,l.c)([(0,s.b)({reflect:!0})],c.prototype,"href",2),(0,l.c)([(0,s.b)({reflect:!0})],c.prototype,"target",2),(0,l.c)([(0,s.b)({type:Number,reflect:!0})],c.prototype,"level",2),c=(0,l.c)([(0,n.a)("gds-secondary-menu-item")],c)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.