PageSourceSearch

https://www.geico.com/_next/static/chunks/gds-gds-select-box-js.0280bab27e2d7597.js

js geico.com collected 2026-09-24 08:34:09 UTC 14,858 bytes, 282 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[23169],{12009:(e,t,o)=>{o.d(t,{a:()=>r});var r=e=>e?.assignedNodes?.()?.some(e=>"#text"!==e.nodeName||l(e.textContent)),l=e=>{let t=e.length;if(""===e[t]||" "===e[t]||e===`
2`)return!1;for(;t--;)if(""!==e[t]&&" "!==e[t]&&e[t]!==`
3`)return!0;return!1}},24291:(e,t,o)=>{o.d(t,{a:()=>r,b:()=>l,c:()=>s,d:()=>n,e:()=>d});var r=e=>t=>"function"==typeof t?(customElements.define(e,t),t):((e,t)=>{let{kind:o,elements:r}=t;return{kind:o,elements:r,finisher(t){customElements.define(e,t)}}})(e,t);function l(e){return(t,o)=>void 0!==o?void t.constructor.createProperty(o,e):"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(o){o.createProperty(t.key,e)}}:{...t,finisher(o){o.createProperty(t.key,e)}}}function s(e){return l({...e,state:!0})}var i=({finisher:e,descriptor:t})=>(o,r)=>{var l;if(void 0===r){let r=null!=(l=o.originalKey)?l:o.key,s=null!=t?{kind:"method",placement:"prototype",key:r,descriptor:t(o.key)}:{...o,key:r};return null!=e&&(s.finisher=function(t){e(t,r)}),s}{let l=o.constructor;void 0!==t&&Object.defineProperty(o,r,t(r)),e?.(l,r)}};function n(e,t){return i({descriptor:o=>{let r={get(){var t,o;return null!=(o=null==(t=this.renderRoot)?void 0:t.querySelector(e))?o:null},enumerable:!0,configurable:!0};if(t){let t="symbol"==typeof o?Symbol():"__"+o;r.get=function(){var o,r;return void 0===this[t]&&(this[t]=null!=(r=null==(o=this.renderRoot)?void 0:o.querySelector(e))?r:null),this[t]}}return r}})}var a,c=(null==(a=window.HTMLSlotElement)?void 0:a.prototype.assignedElements)!=null?(e,t)=>e.assignedElements(t):(e,t)=>e.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);function d(e){let{slot:t,selector:o}=e??{};return i({descriptor:r=>({get(){var r;let l="slot"+(t?`[name=${t}]`:":not([name])"),s=null==(r=this.renderRoot)?void 0:r.querySelector(l),i=null!=s?c(s,e):[];return o?i.filter(e=>e.matches(o)):i},enumerable:!0,configurable:!0})})}},31864:(e,t,o)=>{o.d(t,{a:()=>a});var r=o(24291),l=o(85065),s=o(40629),i=o(11598),n=(0,s.b)`
4  :host {
5    flex-basis: 100%;
6    display: block;
7    margin-bottom: var(--label-margin-bottom);
8  }
9
10  :host([hidden]) {
11    display: none;
12  }
13
14  :host([size="small"]) {
15    margin-bottom: var(--label-small-margin-bottom);
16  }
17
18  :host([size="small"]) slot:not([name]) {
19    font: var(--label-small-typography);
20  }
21
22  :host([size="small"]) slot[name="description"] {
23    margin-top: var(--label-small-description-margin-top);
24  }
25
26  :host([size="small"]) .label-optional-text-wrapper {
27    font: var(--text-xsmall-typography);
28    font-style: var(--font-style-italic);
29  }
30
31  :host([size="small"]) .label-required-asterisk-wrapper {
32    font: var(--label-small-required-typography);
33  }
34
35  :host([size="small"]) slot:not([name])::slotted(gds-tooltip) {
36    --tooltip-trigger-width: var(--tooltip-trigger-small-width);
37    --tooltip-trigger-height: var(--tooltip-trigger-small-height);
38    --font-size-xsmall: var(--font-size-xxsmall);
39    --line-height-150: var(--tooltip-trigger-small-container-line-height);
40    --icon-medium-dimensions: var(--font-size-xxsmall);
41  }
42
43  .label-legend {
44    padding: 0;
45    margin: 0;
46  }
47
48  slot:not([name]) {
49    font: var(--label-typography);
50    color: var(--text-color);
51  }
52
53  slot[name="description"] {
54    display: block;
55    font: var(--label-description-typography);
56    color: var(--text-color);
57    margin-top: var(--label-description-margin-top);
58    /* Default to visible - let JavaScript hide if empty */
59    visibility: visible;
60  }
61
62  slot[name="description"].gds-empty-slot {
63    display: none !important;
64    margin: 0 !important;
65    padding: 0 !important;
66    height: 0 !important;
67    overflow: hidden !important;
68    visibility: hidden !important;
69  }
70
71  /* Emergency fallback - show description slot even if JavaScript fails */
72  slot[name="description"]:not(.gds-empty-slot) {
73    display: block !important;
74    visibility: visible !important;
75  }
76
77  .label-optional-text-wrapper {
78    font: var(--text-small-typography);
79    color: var(--color-neutral-standalone-text);
80    font-style: var(--font-style-italic);
81    margin-left: var(--label-notation-margin-left);
82  }
83
84  .label-required-asterisk-wrapper {
85    font: var(--label-required-typography);
86    color: var(--color-danger-standalone-text);
87    margin-left: var(--label-notation-margin-left);
88  }
89`,a=class extends s.g{constructor(){super(...arguments),this.element="label",this.hasDescriptionContent=!1,this._slotOb
89server=null,this._retryAttempts=0,this._maxRetries=10,this.size="large"}render(){let e=(0,s.c)`
90      <slot></slot>
91      ${"optional"===this.marker?(0,s.c)`<span class="label-optional-text-wrapper">(Optional)</span>`:s.e}
92      ${"required"===this.marker?(0,s.c)`<span class="label-required-asterisk-wrapper">*</span>`:s.e}
93      <slot
94        name="description"
95        @slotchange="${this._handleDescriptionSlotChange}"
96      ></slot>
97    `;return"label"===this.element?(0,s.c)`
98          <label for="${this.for}" class="label-legend"> ${e}</label>
99        `:(0,s.c)` <legend class="label-legend">${e}</legend> `}_handleDescriptionSlotChange(e){let t=e.target;this.hasDescriptionContent=this._hasActualDescriptionContent(t),this._updateSlotVisibility(t)}_hasTextContent(e){if(e.textContent?.trim()!=="")return!0;if(e.nodeType===Node.ELEMENT_NODE){for(let t of e.querySelectorAll("slot"))if(t.assignedNodes({flatten:!0}).some(e=>this._hasTextContent(e)))return!0}return!1}_hasActualDescriptionContent(e){let t=e.assignedNodes({flatten:!0});return 0!==t.length&&t.some(e=>(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE)&&this._hasTextContent(e))}_updateSlotVisibility(e){this.hasDescriptionContent?e.classList.remove("gds-empty-slot"):e.classList.add("gds-empty-slot")}_checkDescriptionSlotContent(){let e=this.renderRoot?.querySelector("slot[name='description']");if(e){if(this.hasDescriptionContent=this._hasActualDescriptionContent(e),!this.hasDescriptionContent&&this._retryAttempts<this._maxRetries){this._retryAttempts++,setTimeout(()=>{this._checkDescriptionSlotContent()},10);return}this._retryAttempts=0,this._updateSlotVisibility(e),this._setupSlotObserver(e)}}_setupSlotObserver(e){this._slotObserver&&this._slotObserver.disconnect(),this._slotObserver=new MutationObserver(()=>{let t=this._hasActualDescriptionContent(e);t!==this.hasDescriptionContent&&(this.hasDescriptionContent=t,this._updateSlotVisibility(e))}),e.assignedNodes().forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&this._slotObserver.observe(e,{childList:!0,subtree:!0,characterData:!0})})}firstUpdated(e){super.firstUpdated(e),setTimeout(()=>{this._checkDescriptionSlotContent()},0)}updated(e){super.updated(e),setTimeout(()=>{this._checkDescriptionSlotContent()},0)}connectedCallback(){super.connectedCallback();let e=new CSSStyleSheet;e.replaceSync(n.cssText),this.shadowRoot.adoptedStyleSheets=[e]}disconnectedCallback(){super.disconnectedCallback(),this._slotObserver&&(this._slotObserver.disconnect(),this._slotObserver=null)}attributeChangedCallback(e,t,o){super.attributeChangedCallback(e,t,o),"element"===e&&"label"!==o&&"legend"!==o&&(this.element="label")}};(0,i.c)([(0,r.b)({type:String,reflect:!0})],a.prototype,"element",2),(0,i.c)([(0,r.b)({type:String,reflect:!0})],a.prototype,"for",2),(0,i.c)([(0,r.c)()],a.prototype,"hasDescriptionContent",2),(0,i.c)([(0,r.b)({type:String,reflect:!0})],a.prototype,"marker",2),(0,i.c)([(0,r.b)({type:String,reflect:!0})],a.prototype,"size",2),a=(0,i.c)([(0,l.a)("gds-label-legend")],a)},41088:(e,t,o)=>{o.d(t,{a:()=>r});var r={bubbles:!0,cancelable:!1,composed:!0}},46058:(e,t,o)=>{o.d(t,{a:()=>l});var r=o(40629),l=e=>e??r.e},63058:(e,t,o)=>{o.r(t),o.d(t,{GdsSelectBox:()=>h});var r=o(46058),l=o(12009),s=o(41088),i=o(24291),n=o(85065),a=o(40629),c=o(11598),d=(0,a.b)`
100  :host {
101    display: block;
102    margin-bottom: var(--select-box-container-margin-bottom);
103  }
104
105  :host slot:not([name]) {
106    display: none;
107    visibility: hidden;
108    color: transparent;
109  }
110
111  :host select {
112    font-family: var(--font-family);
113  }
114
115  :host([error]) .select-box select,
116  :host([error]) .select-box {
117    margin-bottom: var(--select-box-error-select-margin-bottom);
118  }
119
120  :host([error]) .select-box select {
121    background-color: var(
122      --container-form-control-selection-error-background-color
123    );
124    border: var(--select-box-error-select-border-style);
125
126    &:focus,
127    &:hover,
128    &:active {
129      background-color: var(
130        --container-form-control-selection-error-background-color
131      );
132      border: var(--select-box-error-select-border-style);
133    }
134  }
135
136  [name="error-message"]::slotted(*) {
137    display: block;
138    color: var(--text-error-color);
139    font-size: var(--text-error-font-size);
140    margin-bottom: var(--input-error-message-margin-bottom);
141  }
142
143  :host([disabled]) select {
144    cursor: not-allowed;
145    color: var(--select-box-disabled-select-color);
146    background-color: var(--container-form-control-disabled-background-color);
147    border: var(--select-box-disabled-select-border-style);
148
149    &:hover,
150    &:focus,
151    &:active {
152      background-color: var(--container-form-control-disabled-background-color);
153      border: var(--select-box-disabled-select-border-style);
154    }
155  }
156
157  :host([disabled]) .select-box:after {
158    border-color: var(--container-form-control-disabled-color);
159    color: var(--container-form-control-disabled-color);
160  }
161
162  :host([extend-full-width]) select {
163    width: fit-content;
164  }
165
166  .select-box {
167    position: relative;
168    display: inline-block;
169    height: var(--select-box-container-height);
170    text-indent: 0.01px;
171    text-overflow: "";
172
173    &:after {
174      font-family: "geico";
175      speak: none;
176      font-style: normal;
177      font-weight: normal;
178      font-variant: normal;
179      text-transform: none;
180      -webkit-font-smoothing: antialiased;
181      -moz-osx-font-smoothing: grayscale;
182      display: block;
183      content: "\\e214";
184      width: var(--select-box-arrow-width);
185      height: var(--select-box-arrow-height);
186      line-height: var(--select-box-arrow-line-height);
187      font-size: var(--select-box-arrow-font-size);
188      backface-visibility: hidden;
189      position: absolute;
190      color: var(--text-color);
191      right: var(--select-box-arrow-right);
192      pointer-events: none;
193      text-align: center;
194      top: var(--select-box-arrow-top);
195      z-index: 1;
196    }
197
198    select {
199      position: relative;
200      z-index: 1;
201      background-color: var(--container-form-control-default-background-color);
202      border-radius: var(--select-box-select-border-radius);
203      border: var(--select-box-select-border-style);
204      outline: none;
205      -webkit-appearance: none;
206      -ms-appearance: none;
207      appearance: none;
208      box-sizing: border-box;
209      height: var(--select-box-select-height);
210      font-size: var(--text-placeholder-font-size);
211      padding-left: var(--select-box-select-padding-left);
212      padding-right: var(--select-box-select-padding-right);
213      padding-bottom: var(--select-box-select-padding-bottom);
214      color: var(--text-color);
215      cursor: pointer;
216      width: var(--select-box-select-width);
217      word-break: normal;
218      word-wrap: normal;
219      @include transition(border $geico-speed-super $geico-ease-in);
220
221      &:hover {
222        border: var(--select-box-hover-select-border-style);
223      }
224
225      &:active {
226        background-color: var(
227          --container-form-control-selection-selected-background-color
228        );
229        border: var(--select-box-active-select-border-style);
230      }
231
232      &:focus {
233        background-color: var(
234          --container-form-control-selection-selected-background-color
235        );
236        border: var(--select-box-focus-select-border-style);
237      }
238    }
239
240    select:focus::-ms-value {
241      background: transparent;
242      color: var(--text-color);
243    }
244
245    select::-ms-expand {
246      display: none;
247    }
248  }
249
250  :host([height="small"]) .select-box select,
251  :host([height="small"]) .select-box select option {
252    font-size: var(--text-small-placeholder-font-size);
253  }
254
255  @media (max-width: 480px) {
256    .select-box {
257      width: var(--select-box-select-width);
258    }
259  }
260`,h=class extends a.g{constructor(){super(...arguments),this.disabled=!1,this.extendFullWidth=!1,this.error=!1,this.slotChangeCount=0}render(){return(0,a.c)`
261      <gds-label-legend
262        element="label"
263        for="select-box-${this.selectId}"
264        marker="${(0,r.a)(this.labelLegendMarker)}"
265      >
266        <slot name="label"></slot>
267        <span slot="description"><slot name="descriptive-copy"></slot></span>
268      </gds-label-legend>
269      <div class="select-box">
270        <select
271          id="select-box-${this.selectId}"
272          name="${(0,r.a)(this.name)}"
273          ?disabled="${this.disabled}"
274          @change="${this._onChange}"
275          aria-invalid="${this.error}"
276          aria-errormessage="${this.error?`error-select-box-${this.selectId}`:a.e}"
277        ></select>
278      </div>
279
280      <slot @slotchange="${this._onSlotChange}"></slot>
281      <slot name="error-message" @slotchange="${this._handleSlot
281Change}"></slot>
282    `}_onSlotChange(){this.slotChangeCount=this.slotChangeCount+1,this.setupOptions()}connectedCallback(){super.connectedCallback();let e=new CSSStyleSheet;e.replaceSync(d.cssText),this.shadowRoot.adoptedStyleSheets=[e]}updated(e){super.updated(e)}setupOptions(){let e=this.slotChangeCount>1,t=this.shadowRoot.querySelector("select");e&&(this.shadowRoot.querySelectorAll("select option").forEach(e=>e.remove()),t.innerHTML=""),(this.shadowRoot?.querySelector("slot:not([name])")).assignedNodes({flatten:!0}).forEach(e=>{let o=e.cloneNode(!0);e.selected&&(o.selected=!0),t.appendChild(o)})}_onChange(e){this.dispatchEvent(new CustomEvent("select-box-change",{detail:{value:e.target.value},...s.a}))}_handleSlotChange(e){let t=e.target,o=(0,l.a)(t);this.error=o,o?(this.setAttribute("error",""),t.setAttribute("id",`${this.selectId}-error-message`),t.setAttribute("aria-live","polite")):(this.removeAttribute("error"),t.removeAttribute("id"),t.removeAttribute("aria-live"))}};(0,c.c)([(0,i.b)({type:String,attribute:"select-id"})],h.prototype,"selectId",2),(0,c.c)([(0,i.b)()],h.prototype,"name",2),(0,c.c)([(0,i.b)({type:Boolean,reflect:!0})],h.prototype,"disabled",2),(0,c.c)([(0,i.b)({type:Boolean,reflect:!0,attribute:"extend-full-width"})],h.prototype,"extendFullWidth",2),(0,c.c)([(0,i.b)({type:String,reflect:!0,attribute:"label-legend-marker"})],h.prototype,"labelLegendMarker",2),(0,c.c)([(0,i.c)()],h.prototype,"error",2),(0,c.c)([(0,i.c)()],h.prototype,"slotChangeCount",2),h=(0,c.c)([(0,n.a)("gds-select-box")],h),o(31864),o(8802)}}]);

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.