PageSourceSearch

https://www.archerandolive.com/cdn/shop/t/287/assets/localization.js?v=12865072705958511111783008205

js archerandolive.com collected 2026-09-27 21:36:37 UTC 7,405 bytes, 1 lines download raw bytes

1var W=Object.defineProperty;var M=i=>{throw TypeError(i)};var _=(i,r,t)=>r in i?W(i,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[r]=t;var k=(i,r,t)=>_(i,typeof r!="symbol"?r+"":r,t),D=(i,r,t)=>r.has(i)||M("Cannot "+t);var h=(i,r,t)=>(D(i,r,"read from private field"),t?t.call(i):r.get(i)),d=(i,r,t)=>r.has(i)?M("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,t);var L=(i,r,t)=>(D(i,r,"access private method"),t);import{C as z}from"./component.js";import{n as y,o as T,i as $}from"./utilities.js";var b,m,F,H,x,C,v;class B extends z{constructor(){super(...arguments);d(this,m);d(this,b,t=>{const{countryInput:s,countryListItems:e,form:n}=this.refs;switch(t.key){case"ArrowUp":t.preventDefault(),t.stopPropagation(),L(this,m,x).call(this,"UP");break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),L(this,m,x).call(this,"DOWN");break;case"Enter":t.preventDefault(),t.stopPropagation();const o=e.find(a=>a.getAttribute("aria-selected")==="true");o&&(s.value=o.dataset.value??"",n.submit());break}this.refs.search&&setTimeout(()=>{const o=this.refs.countryListItems.filter(f=>!f.hasAttribute("hidden")),a=o.findIndex(f=>f===document.activeElement),l=o[a];l?this.refs.search.setAttribute("aria-activedescendant",l.id):this.refs.search.setAttribute("aria-activedescendant","")})});k(this,"selectCountry",(t,s)=>{s.preventDefault();const{countryInput:e,form:n}=this.refs;e.value=t,n==null||n.submit()});d(this,C,t=>{if(t.key==="Enter"){t.preventDefault(),t.stopPropagation();return}h(this,b).call(this,t)});k(this,"focusSearchInput",()=>{const{search:t}=this.refs;t==null||t.focus()});d(this,v,t=>{const s=this.querySelector(".country-filter"),e=t.target instanceof HTMLElement?t.target:null;if(s&&e){const n=e.scrollTop>0;s.classList.toggle("is-scrolled",n)}})}connectedCallback(){super.connectedCallback(),this.refs.search&&this.refs.search.addEventListener("keydown",h(this,C)),this.refs.countryList&&this.refs.countryList.addEventListener("keydown",h(this,b)),this.refs.countryList&&this.refs.countryList.addEventListener("scroll",h(this,v)),this.resizeLanguageInput()}disconnectedCallback(){super.disconnectedCallback(),this.refs.search&&this.refs.search.removeEventListener("keydown",h(this,C)),this.refs.countryList&&this.refs.countryList.removeEventListener("keydown",h(this,b)),this.refs.countryList&&this.refs.countryList.removeEventListener("scroll",h(this,v))}changeLanguage(t){const{form:s,languageInput:e}=this.refs,n=t.target instanceof HTMLSelectElement?t.target.value:null;n&&(e.value=n,this.resizeLanguageInput(),s.submit())}resizeLanguageInput(){const{languageInput:t}=this.refs;if(!t)return;for(const e of t.options)e.selected||(e.dataset.optionLabel=e.textContent||"",e.innerText="");t.style.width="fit-content";const s=`${Math.ceil(t.offsetWidth)+1}px`;t.offsetWidth>0&&(t.style.width=s);for(const e of t.options)e.dataset.optionLabel&&(e.textContent=e.dataset.optionLabel,delete e.dataset.optionLabel)}filterCountries(){const{countryList:t,countryListItems:s,liveRegion:e,noResultsMessage:n,popularCountries:o,resetButton:a,search:l}=this.refs,{labelResultsCount:f}=this.dataset,c=y(l.value);let u=0;a.toggleAttribute("hidden",!c),o&&o.toggleAttribute("hidden",!!c);const P=this.querySelector(".country-selector-form__wrapper");P&&P.classList.toggle("is-searching",!!c);for(const g of s)if(c===""){g.removeAttribute("hidden");const p=g.querySelector(".country");p&&(p.textContent=p.textContent),u++}else{const p=L(this,m,F).call(this,c,g);if(p.label||p.alias||p.iso||p.currency){g.removeAttribute("hidden");const S=g.querySelector(".country");S&&(S.innerHTML=L(this,m,H).call(this,S.textContent,c)),u++}else g.setAttribute("hidden","")}e&&f&&(e.innerText=f.replace("[count]",`${u}`)),n.hidden=u>0,t.scrollTop=0}resetCountriesFilter(t){const{search:s}=this.refs;t.stopPropagation(),s.value="",this.filterCountries(),s.setAttribute("aria-activedescendant",""),s.focus()}resetForm(){const{search:t}=this.refs;t&&t.value!=""&&(t.value="",this.filterCountries(),t.setAttribute("aria-activedescendant",""))}}b=new WeakMap,m=new WeakSet,F=function(t,s,e={matchLabel:!0,matchAlias:!0,matchIso:!0,matchCurrency:!0,labelMatchStart:!1,aliasExactMatch:!1}){var l,f;let n={};const{aliases:o,value:a}=s.dataset;if(e.matchLabel){const c=y(((l=s.querySelector(".country"))==null?void 0:l.textContent)??"");if(!c)return n;n.label=e.labelMatchStart?c.startsWith(t):c.includes(t)}if(e.matchCurrency){const c=y(((f=s.querySelector(".localization-form__currency"))==null?void 0:f.textContent)??"");n.currency=c.includes(t)}if(e.matchIso&&(n.iso=y(a??"")==t),e.matchAlias){const c=o==null?void 0:o.split(",").map(u=>y(u));if(!c)return n;n.alias=c.length>0&&c.find(u=>e.aliasExactMatch?u===t:u.startsWith(t))!==void 0}return n},H=function(t,s){if(!t||!s)return t??"";const e=y(t),n=y(s),o=e.indexOf(n);if(o===-1)return t;const a=o+n.length,l=t.slice(0,o),f=t.slice(o,a),c=t.slice(a);let u="";return l&&(u+=`<mark>${l}</mark>`),u+=f,c&&(u+=`<mark>${c}</mark>`),u},x=function(t){const{countryListItems:s}=this.refs,e=s.filter(l=>!l.hasAttribute("hidden")),n=e.findIndex(l=>l===document.activeElement),o=e[n];let a;t==="UP"?a=n>0?e[n-1]:e[e.length-1]:a=n<e.length-1?e[n+1]:e[0],o&&o.setAttribute("aria-selected","false"),a==null||a.setAttribute("aria-selected","true"),a==null||a.focus()},C=new WeakMap,v=new WeakMap;var E,A,q,I;class O extends z{constructor(){super(...arguments);d(this,A);k(this,"hidePanel",()=>{var t,s;this.isHidden||(this.removeEventListener("keyup",h(this,I)),document.removeEventListener("click",h(this,E)),(t=this.refs.button)==null||t.setAttribute("aria-expanded","fal
1se"),this.refs.panel.setAttribute("hidden",""),(s=this.refs.localizationForm)==null||s.resetForm())});d(this,E,t=>{$(t,this)&&this.hidePanel()});d(this,I,t=>{var s;switch(t.key){case"Escape":this.hidePanel(),t.stopPropagation(),(s=this.refs.button)==null||s.focus();break}})}get isHidden(){return this.refs.panel.hasAttribute("hidden")}toggleSelector(){return this.isHidden?this.showPanel():this.hidePanel()}showPanel(){this.isHidden&&(this.addEventListener("keyup",h(this,I)),document.addEventListener("click",h(this,E)),this.refs.panel.removeAttribute("hidden"),this.refs.button.setAttribute("aria-expanded","true"),T(this.refs.panel,()=>{var t;L(this,A,q).call(this),(t=this.refs.localizationForm)==null||t.focusSearchInput()}))}}E=new WeakMap,A=new WeakSet,q=function(){this.style.setProperty("--width",`${this.refs.localizationForm.offsetWidth}px`)},I=new WeakMap;var w;class U extends z{constructor(){super(...arguments);d(this,w,t=>{const s=this.querySelector(".country-filter"),e=t.target instanceof HTMLElement?t.target:null;if(s&&e){const n=e.scrollTop>0;s.classList.toggle("is-scrolled",n)}})}toggle(t){const{target:s}=t,{localizationForm:e}=this.refs;if(!e||!(s instanceof HTMLDetailsElement))return;const n=e.querySelector(".country-selector-form__wrapper");s.open?(n&&n.addEventListener("scroll",h(this,w)),T(s,e.focusSearchInput)):(n==null||n.removeEventListener("scroll",h(this,w)),e.resetForm())}}w=new WeakMap;customElements.get("localization-form-component")||customElements.define("localization-form-component",B);customElements.get("dropdown-localization-component")||customElements.define("dropdown-localization-component",O);customElements.get("drawer-localization-component")||customElements.define("drawer-localization-component",U);

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.