1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 2(function(Drupal){'use strict';Drupal.behaviors.addToAny={attach:function(context,settings){if(context!==document&&window.a2a)a2a.init_all();}};})(Drupal);; 3(function($,Drupal){Drupal.theme.progressBar=function(id){const escapedId=Drupal.checkPlain(id);return (`<div id="${escapedId}" class="progress" aria-live="polite">`+'<div class="progress__label"> </div>'+'<div class="progress__track"><div class="progress__bar"></div></div>'+'<div class="progress__percentage"></div>'+'<div class="progress__description"> </div>'+'</div>');};Drupal.ProgressBar=function(id,updateCallback,method,errorCallback){this.id=id;this.method=method||'GET';this.updateCallback=updateCallback;this.errorCallback=errorCallback;this.element=$(Drupal.theme('progressBar',id));};$.extend(Drupal.ProgressBar.prototype,{setProgress(percentage,message,label){if(percentage>=0&&percentage<=100){$(this.element).find('div.progress__bar').each(function(){this.style.width=`${percentage}%`;});$(this.element).find('div.progress__percentage').html(`${percentage}%`);}$('div.progress__description',this.element).html(message);$('div.progress__label',this.element).html(label);if(this.updateCallback)this.updateCallback(percentage,message,this);},startMonitoring(uri,delay){this.delay=delay;this.uri=uri;this.sendPing();},stopMonitoring(){clearTimeout(this.timer);this.uri=null;},sendPing(){if(this.timer)clearTimeout(this.timer);if(this.uri){const pb=this;let uri=this.uri;if(!uri.includes('?'))uri+='?';else uri+='&';uri+='_format=json';$.ajax({type:this.method,url:uri,data:'',dataType:'json',success(progress){if(progress.status===0){pb.displayError(progress.data);return;}pb.setProgress(progress.percentage,progress.message,progress.label);pb.timer=setTimeout(()=>{pb.sendPing();},pb.delay);},error(xmlhttp){const e=new Drupal.AjaxError(xmlhttp,pb.uri);pb.displayError(`<pre>${e.message}</pre>`);}});}},displayError(string){const error=$('<div class="messages messages--error"></div>').html(string);$(this.element).before(error).hide();if(this.errorCallback)this.errorCallback(this);}});})(jQuery,Drupal);; 4/* @license MIT https://raw.githubusercontent.com/muicss/loadjs/4.3.0/LICENSE.txt */ 5loadjs=function(){var h=function(){},o={},c={},f={};function u(e,n){if(e){var t=f[e];if(c[e]=n,t)for(;t.length;)t[0](e,n),t.splice(0,1)}}function l(e,n){e.call&&(e={success:e}),n.length?(e.error||h)(n):(e.success||h)(e)}function p(t,r,i,s){var o,e,u,n=document,c=i.async,f=(i.numRetries||0)+1,l=i.before||h,a=t.replace(/[\?|#].*$/,""),d=t.replace(/^(css|img|module|nomodule)!/,"");if(s=s||0,/(^css!|\.css$)/.test(a))(u=n.createElement("link")).rel="stylesheet",u.href=d,(o="hideFocus"in u)&&u.relList&&(o=0,u.rel="preload",u.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(a))(u=n.createElement("img")).src=d;else if((u=n.createElement("script")).src=d,u.async=void 0===c||c,e="noModule"in u,/^module!/.test(a)){if(!e)return r(t,"l");u.type="module"}else if(/^nomodule!/.test(a)&&e)return r(t,"l");!(u.onload=u.onerror=u.onbeforeload=function(e){var n=e.type[0];if(o)try{u.sheet.cssText.length||(n="e")}catch(e){18!=e.code&&(n="e")}if("e"==n){if((s+=1)<f)return p(t,r,i,s)}else if("preload"==u.rel&&"style"==u.as)return u.rel="stylesheet";r(t,n,e.defaultPrevented)})!==l(t,u)&&n.head.appendChild(u)}function t(e,n,t){var r,i;if(n&&n.trim&&(r=n),i=(r?t:n)||{},r){if(r in o)throw"LoadJS";o[r]=!0}function s(n,t){!function(e,r,n){var t,i,s=(e=e.push?e:[e]).length,o=s,u=[];for(t=function(e,n,t){if("e"==n&&u.push(e),"b"==n){if(!t)return;u.push(e)}--s||r(u)},i=0;i<o;i++)p(e[i],t,n)}(e,function(e){l(i,e),n&&l({success:n,error:t},e),u(r,e)},i)}if(i.returnPromise)return new Promise(s);s()}return t.ready=function(e,n){return function(e,t){e=e.push?e:[e];var n,r,i,s=[],o=e.length,u=o;
5for(n=function(e,n){n.length&&s.push(e),--u||t(s)};o--;)r=e[o],(i=c[r])?n(r,i):(f[r]=f[r]||[]).push(n)}(e,function(e){l(n,e)}),t},t.done=function(e){u(e,[])},t.reset=function(){o={},c={},f={}},t.isDefined=function(e){return e in o},t}();; 6/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 7Drupal.debounce=function(func,wait,immediate){let timeout;let result;return function(...args){const context=this;const later=function(){timeout=null;if(!immediate)result=func.apply(context,args);};const callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow)result=func.apply(context,args);return result;};};; 8(function(Drupal,debounce){let liveElement;const announcements=[];Drupal.behaviors.drupalAnnounce={attach(context){if(!liveElement){liveElement=document.createElement('div');liveElement.id='drupal-live-announce';liveElement.className='visually-hidden';liveElement.setAttribute('aria-live','polite');liveElement.setAttribute('aria-busy','false');document.body.appendChild(liveElement);}}};function announce(){const text=[];let priority='polite';let announcement;const il=announcements.length;for(let i=0;i<il;i++){announcement=announcements.pop();text.unshift(announcement.text);if(announcement.priority==='assertive')priority='assertive';}if(text.length){liveElement.innerHTML='';liveElement.setAttribute('aria-busy','true');liveElement.setAttribute('aria-live',priority);liveElement.innerHTML=text.join('\n');liveElement.setAttribute('aria-busy','false');}}Drupal.announce=function(text,priority){announcements.push({text,priority});return debounce(announce,200)();};})(Drupal,Drupal.debounce);; 9((Drupal)=>{Drupal.Message=class{constructor(messageWrapper=null){if(!messageWrapper)this.messageWrapper=Drupal.Message.defaultWrapper();else this.messageWrapper=messageWrapper;}static defaultWrapper(){let wrapper=document.querySelector('[data-drupal-messages]')||document.querySelector('[data-drupal-messages-fallback]');if(!wrapper){wrapper=document.createElement('div');document.body.appendChild(wrapper);}if(wrapper.hasAttribute('data-drupal-messages-fallback')){wrapper.removeAttribute('data-drupal-messages-fallback');wrapper.classList.remove('hidden');}wrapper.setAttribute('data-drupal-messages','');return wrapper.innerHTML===''?Drupal.Message.messageInternalWrapper(wrapper):wrapper.firstElementChild;}static getMessageTypeLabels(){return {status:Drupal.t('Status message'),error:Drupal.t('Error message'),warning:Drupal.t('Warning message')};}add(message,options={}){if(!options.hasOwnProperty('type'))options.type='status';if(typeof message!=='string')throw new Error('Message must be a string.');Drupal.Message.announce(message,options);options.id=options.id?String(options.id):`${options.type}-${Math.random().toFixed(15).replace('0.','')}`;if(!Drupal.Message.getMessageTypeLabels().hasOwnProperty(options.type)){const {type}=options;throw new Error(`The message type, ${type}, is not present in Drupal.Message.getMessageTypeLabels().`);}this.messageWrapper.appendChild(Drupal.theme('message',{text:message},options));return options.id;}select(id){return this.messageWrapper.querySelector(`[data-drupal-message-id^="${id}"]`);}remove(id){return this.messageWrapper.removeChild(this.select(id));}clear(){Array.prototype.forEach.call(this.messageWrapper.querySelectorAll('[data-drupal-message-id]'),(message)=>{this.messageWrapper.removeChild(message);});}static announce(message,options){if(!options.priority&&(options.type==='warning'||options.type==='error'))options.priority='assertive';if(options.announce!=='')Drupal.announce(options.announce||message,options.priority);}static messageInternalWrapper(messageWrapper){const innerWrapper=document.createElement('div');innerWrapper.setAttribute('class','messages__wrapper');messageWrapper.insertAdjacentElement('afterbegin',innerWrapper);return innerWrapper;}};Drupal.theme.message=({text},{type,id})=>{const messagesTypes=Drupal.Message.getMessageTypeLabels();const messageWrapper=document.createElement('div');messageWrapper.setAttribute('class',`messages messages--${type}`);messageWrapper.setAttribute('role',type==='error'||type==='warning'?'alert':'status');messageWrapper.setAttribute('data-drupal-message-id',id);messageWrapper.setAttribute('data-drupal-message-type',type);messageWrapper.setAttribute('aria-label',messagesTypes[type]);messageWrapper.innerHTML=`${text}`;return messageWrapper;};})(Drupal);; 10(function($,window,Drupal,drupalSettings,loadjs,{isFocusable,tabbable}){Drupal.behaviors.AJAX={attach(context,settings){function loadAjaxBehavior(base){const elementSettings=settings.ajax[base];if(typeof elementSettings.selector==='undefined')elementSettings.selector=`#${base}`;
10once('drupal-ajax',$(elementSettings.selector)).forEach((el)=>{elementSettings.element=el;elementSettings.base=base;Drupal.ajax(elementSettings);});}Object.keys(settings.ajax||{}).forEach(loadAjaxBehavior);Drupal.ajax.bindAjaxLinks(document.body);once('ajax','.use-ajax-submit').forEach((el)=>{const elementSettings={};elementSettings.url=$(el.form).attr('action');elementSettings.setClick=true;elementSettings.event='click';elementSettings.progress={type:'throbber'};elementSettings.base=el.id;elementSettings.element=el;Drupal.ajax(elementSettings);});},detach(context,settings,trigger){if(trigger==='unload')Drupal.ajax.expired().forEach((instance)=>{Drupal.ajax.instances[instance.instanceIndex]=null;});}};Drupal.AjaxError=function(xmlhttp,uri,customMessage){let statusCode;let statusText;let responseText;if(xmlhttp.status)statusCode=`\n${Drupal.t('An AJAX HTTP error occurred.')}\n${Drupal.t('HTTP Result Code: !status',{'!status':xmlhttp.status})}`;else statusCode=`\n${Drupal.t('An AJAX HTTP request terminated abnormally.')}`;statusCode+=`\n${Drupal.t('Debugging information follows.')}`;const pathText=`\n${Drupal.t('Path: !uri',{'!uri':uri})}`;statusText='';try{statusText=`\n${Drupal.t('StatusText: !statusText',{'!statusText':xmlhttp.statusText.trim()})}`;}catch(e){}responseText='';try{responseText=`\n${Drupal.t('ResponseText: !responseText',{'!responseText':xmlhttp.responseText.trim()})}`;}catch(e){}responseText=responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi,'');responseText=responseText.replace(/[\n]+\s+/g,'\n');const readyStateText=xmlhttp.status===0?`\n${Drupal.t('ReadyState: !readyState',{'!readyState':xmlhttp.readyState})}`:'';customMessage=customMessage?`\n${Drupal.t('CustomMessage: !customMessage',{'!customMessage':customMessage})}`:'';this.message=statusCode+pathText+statusText+customMessage+responseText+readyStateText;this.name='AjaxError';if(!Drupal.AjaxError.messages)Drupal.AjaxError.messages=new Drupal.Message();Drupal.AjaxError.messages.add(Drupal.t("Oops, something went wrong. Check your browser's developer console for more details."),{type:'error'});};Drupal.AjaxError.prototype=new Error();Drupal.AjaxError.prototype.constructor=Drupal.AjaxError;Drupal.ajax=function(settings){if(arguments.length!==1)throw new Error('Drupal.ajax() function must be called with one configuration object only');const base=settings.base||false;const element=settings.element||false;delete settings.base;delete settings.element;if(!settings.progress&&!element)settings.progress=false;const ajax=new Drupal.Ajax(base,element,settings);ajax.instanceIndex=Drupal.ajax.instances.length;Drupal.ajax.instances.push(ajax);return ajax;};Drupal.ajax.instances=[];Drupal.ajax.expired=function(){return Drupal.ajax.instances.filter((instance)=>instance&&instance.element!==false&&!document.body.contains(instance.element));};Drupal.ajax.bindAjaxLinks=(element)=>{once('ajax','.use-ajax',element).forEach((ajaxLink)=>{const $linkElement=$(ajaxLink);const elementSettings={progress:{type:'throbber'},dialogType:$linkElement.data('dialog-type'),dialog:$linkElement.data('dialog-options'),dialogRenderer:$linkElement.data('dialog-renderer'),base:$linkElement.attr('id'),element:ajaxLink};const href=$linkElement.attr('href');if(href){elementSettings.url=href;elementSettings.event='click';}const httpMethod=$linkElement.data('ajax-http-method');if(httpMethod)elementSettings.httpMethod=httpMethod;Drupal.ajax(elementSettings);});};Drupal.Ajax=function(base,element,elementSettings){const defaults={httpMethod:'POST',event:element?'mousedown':null,keypress:true,selector:base?`#${base}`:null,effect:'none',speed:'none',method:'replaceWith',progress:{type:'throbber',message:Drupal.t('Processing...')},submit:{js:true}};$.extend(this,defaults,elementSettings);this.commands=new Drupal.AjaxCommands();this.instanceIndex=false;if(this.wrapper)this.wrapper=`#${this.wrapper}`;this.element=element;this.preCommandsFocusedElementSelector=null;this.elementSettings=elementSettings;if(this.element&&this.element.form)this.$form=$(this.element.form);if(!this.url){const $element=$(this.element);if(this.element.tagName==='A')this.url=$element.attr('href');else{if(this.element&&element.form)this.url=this.$form.attr('action');}}const originalUrl=this.url;this.url=this.url.replace(/\/nojs(\/|$|\?|#)/,'/ajax$1');if(drupalSettings.ajaxTrustedUrl[originalUrl])drupalSettings.ajaxTrustedUrl[this.url]=true;const ajax=this;ajax.options={url:ajax.url,data:ajax.submit,isInProgress(){return ajax.ajaxing;},beforeSerialize(elementSettings,options){return ajax.beforeSerialize(elementSettings,options);},beforeSubmit(formValues,elementSettings,options){ajax.ajaxing=true;ajax.preCommandsFocusedElementSelector=null;return ajax.beforeSubmit(formValues,elementSettings,options);},beforeSend(xmlhttprequest,options){ajax.ajaxing=true;return ajax.beforeSend(xmlhttprequest,options);},success(response,status,xmlhttprequest){ajax.preCommandsFocusedElementSelector=document.activeElement.getAttribute('data-drupal-selector');if(typeof response==='string')response=$.parseJSON(response);if(response!==null&&!drupalSettings.ajaxTrustedUrl[ajax.url])if(xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token')!=='1'){const customMessage=Drupal.t('The response failed verification so will not be processed.');return ajax.error(xmlhttprequest,ajax.url,customMessage);}return (Promise.resolve(ajax.success(response,status)).then(()=>{ajax.ajaxing=false;
10$(document).trigger('ajaxSuccess',[xmlhttprequest,this]);$(document).trigger('ajaxComplete',[xmlhttprequest,this]);if(--$.active===0)$(document).trigger('ajaxStop');}));},error(xmlhttprequest,status,error){ajax.ajaxing=false;},complete(xmlhttprequest,status){if(status==='error'||status==='parsererror')return ajax.error(xmlhttprequest,ajax.url);},dataType:'json',jsonp:false,method:ajax.httpMethod};if(elementSettings.dialog)ajax.options.data.dialogOptions=elementSettings.dialog;if(!ajax.options.url.includes('?'))ajax.options.url+='?';else ajax.options.url+='&';let wrapper=`drupal_${elementSettings.dialogType||'ajax'}`;if(elementSettings.dialogRenderer)wrapper+=`.${elementSettings.dialogRenderer}`;ajax.options.url+=`${Drupal.ajax.WRAPPER_FORMAT}=${wrapper}`;$(ajax.element).on(elementSettings.event,function(event){if(!drupalSettings.ajaxTrustedUrl[ajax.url]&&!Drupal.url.isLocal(ajax.url))throw new Error(Drupal.t('The callback URL is not local and not trusted: !url',{'!url':ajax.url}));return ajax.eventResponse(this,event);});if(elementSettings.keypress)$(ajax.element).on('keypress',function(event){return ajax.keypressResponse(this,event);});if(elementSettings.prevent)$(ajax.element).on(elementSettings.prevent,false);};Drupal.ajax.WRAPPER_FORMAT='_wrapper_format';Drupal.Ajax.AJAX_REQUEST_PARAMETER='_drupal_ajax';Drupal.Ajax.prototype.execute=function(){if(this.ajaxing)return;try{this.beforeSerialize(this.element,this.options);return $.ajax(this.options);}catch(e){this.ajaxing=false;window.alert(`An error occurred while attempting to process ${this.options.url}: ${e.message}`);return $.Deferred().reject();}};Drupal.Ajax.prototype.keypressResponse=function(element,event){const ajax=this;if(event.which===13||(event.which===32&&element.type!=='text'&&element.type!=='textarea'&&element.type!=='tel'&&element.type!=='number')){event.preventDefault();event.stopPropagation();$(element).trigger(ajax.elementSettings.event);}};Drupal.Ajax.prototype.eventResponse=function(element,event){event.preventDefault();event.stopPropagation();const ajax=this;if(ajax.ajaxing)return;try{if(ajax.$form){if(ajax.setClick)element.form.clk=element;ajax.$form.ajaxSubmit(ajax.options);}else{ajax.beforeSerialize(ajax.element,ajax.options);$.ajax(ajax.options);}}catch(e){ajax.ajaxing=false;window.alert(`An error occurred while attempting to process ${ajax.options.url}: ${e.message}`);}};Drupal.Ajax.prototype.beforeSerialize=function(element,options){if(this.$form&&document.body.contains(this.$form.get(0))){const settings=this.settings||drupalSettings;Drupal.detachBehaviors(this.$form.get(0),settings,'serialize');}options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER]=1;const pageState=drupalSettings.ajaxPageState;options.data['ajax_page_state[theme]']=pageState.theme;options.data['ajax_page_state[theme_token]']=pageState.theme_token;options.data['ajax_page_state[libraries]']=pageState.libraries;};Drupal.Ajax.prototype.beforeSubmit=function(formValues,element,options){};Drupal.Ajax.prototype.beforeSend=function(xmlhttprequest,options){if(this.$form){options.extraData=options.extraData||{};options.extraData.ajax_iframe_upload='1';const v=$.fieldValue(this.element);if(v!==null)options.extraData[this.element.name]=v;}$(this.element).prop('disabled',true);if(!this.progress||!this.progress.type)return;const progressIndicatorMethod=`setProgressIndicator${this.progress.type.slice(0,1).toUpperCase()}${this.progress.type.slice(1).toLowerCase()}`;if(progressIndicatorMethod in this&&typeof this[progressIndicatorMethod]==='function')this[progressIndicatorMethod].call(this);};Drupal.theme.ajaxProgressThrobber=(message)=>{const messageMarkup=typeof message==='string'?Drupal.theme('ajaxProgressMessage',message):'';const throbber='<div class="throbber"> </div>';return `<div class="ajax-progress ajax-progress-throbber">${throbber}${messageMarkup}</div>`;};Drupal.theme.ajaxProgressIndicatorFullscreen=()=>'<div class="ajax-progress ajax-progress-fullscreen"> </div>';Drupal.theme.ajaxProgressMessage=(message)=>`<div class="message">${message}</div>`;Drupal.theme.ajaxProgressBar=($element)=>$('<div class="ajax-progress ajax-progress-bar"></div>').append($element);Drupal.Ajax.prototype.setProgressIndicatorBar=function(){const progressBar=new Drupal.ProgressBar(`ajax-progress-${this.element.i
10d}`,$.noop,this.progress.method,$.noop);if(this.progress.message)progressBar.setProgress(-1,this.progress.message);if(this.progress.url)progressBar.startMonitoring(this.progress.url,this.progress.interval||1500);this.progress.element=$(Drupal.theme('ajaxProgressBar',progressBar.element));this.progress.object=progressBar;$(this.element).after(this.progress.element);};Drupal.Ajax.prototype.setProgressIndicatorThrobber=function(){this.progress.element=$(Drupal.theme('ajaxProgressThrobber',this.progress.message));if($(this.element).closest('[data-drupal-ajax-container]').length)$(this.element).closest('[data-drupal-ajax-container]').after(this.progress.element);else $(this.element).after(this.progress.element);};Drupal.Ajax.prototype.setProgressIndicatorFullscreen=function(){this.progress.element=$(Drupal.theme('ajaxProgressIndicatorFullscreen'));$('body').append(this.progress.element);};Drupal.Ajax.prototype.commandExecutionQueue=function(response,status){const ajaxCommands=this.commands;return Object.keys(response||{}).reduce((executionQueue,key)=>executionQueue.then(()=>{const {command}=response[key];if(command&&ajaxCommands[command])return ajaxCommands[command](this,response[key],status);}),Promise.resolve());};Drupal.Ajax.prototype.success=function(response,status){if(this.progress.element)$(this.progress.element).remove();if(this.progress.object)this.progress.object.stopMonitoring();$(this.element).prop('disabled',false);const elementParents=$(this.element).parents('[data-drupal-selector]').addBack().toArray();const focusChanged=Object.keys(response||{}).some((key)=>{const {command,method}=response[key];return (command==='focusFirst'||command==='openDialog'||(command==='invoke'&&method==='focus'));});return (this.commandExecutionQueue(response,status).then(()=>{if(!focusChanged){let target=false;if(this.element){if($(this.element).data('refocus-blur')&&this.preCommandsFocusedElementSelector)target=document.querySelector(`[data-drupal-selector="${this.preCommandsFocusedElementSelector}"]`);if(!target&&!$(this.element).data('disable-refocus')){for(let n=elementParents.length-1;!target&&n>=0;n--)target=document.querySelector(`[data-drupal-selector="${elementParents[n].getAttribute('data-drupal-selector')}"]`);}}if(target)$(target).trigger('focus');}if(this.$form&&document.body.contains(this.$form.get(0))){const settings=this.settings||drupalSettings;Drupal.attachBehaviors(this.$form.get(0),settings);}this.settings=null;}).catch((error)=>console.error(Drupal.t('An error occurred during the execution of the Ajax response: !error',{'!error':error}))));};Drupal.Ajax.prototype.getEffect=function(response){const type=response.effect||this.effect;const speed=response.speed||this.speed;const effect={};if(type==='none'){effect.showEffect='show';effect.hideEffect='hide';effect.showSpeed='';}else if(type==='fade'){effect.showEffect='fadeIn';effect.hideEffect='fadeOut';effect.showSpeed=speed;}else{effect.showEffect=`${type}Toggle`;effect.hideEffect=`${type}Toggle`;effect.showSpeed=speed;}return effect;};Drupal.Ajax.prototype.error=function(xmlhttprequest,uri,customMessage){if(this.progress.element)$(this.progress.element).remove();if(this.progress.object)this.progress.object.stopMonitoring();$(this.wrapper).show();$(this.element).prop('disabled',false);if(this.$form&&document.body.contains(this.$form.get(0))){const settings=this.settings||drupalSettings;Drupal.attachBehaviors(this.$form.get(0),settings);}throw new Drupal.AjaxError(xmlhttprequest,uri,customMessage);};Drupal.theme.ajaxWrapperNewContent=($newContent,ajax,response)=>(response.effect||ajax.effect)!=='none'&&$newContent.filter((i)=>!(($newContent[i].nodeName==='#comment'||($newContent[i].nodeName==='#text'&&/^(\s|\n|\r)*$/.test($newContent[i].textContent))))).length>1?Drupal.theme('ajaxWrapperMultipleRootElements',$newContent):$newContent;Drupal.theme.ajaxWrapperMultipleRootElements=($elements)=>$('<div></div>').append($elements);Drupal.AjaxCommands=function(){};Drupal.AjaxCommands.prototype={insert(ajax,response){const $wrapper=response.selector?$(response.selector):$(ajax.wrapper);const method=response.method||ajax.method;const effect=ajax.getEffect(response);const settings=response.settings||ajax.settings||drupalSettings;const parseHTML=(htmlString)=>{const fragment=document.createDocumentFragment();const template=fragment.appendChild(document.createElement('template'));template.innerHTML=htmlString;return template.content.childNodes;};let $newContent=$(parseHTML(response.data));
10$newContent=Drupal.theme('ajaxWrapperNewContent',$newContent,ajax,response);switch(method){case 'html':case 'replaceWith':case 'replaceAll':case 'empty':case 'remove':Drupal.detachBehaviors($wrapper.get(0),settings);break;default:break;}$wrapper[method]($newContent);if(effect.showEffect!=='show')$newContent.hide();const $ajaxNewContent=$newContent.find('.ajax-new-content');if($ajaxNewContent.length){$ajaxNewContent.hide();$newContent.show();$ajaxNewContent[effect.showEffect](effect.showSpeed);}else{if(effect.showEffect!=='show')$newContent[effect.showEffect](effect.showSpeed);}$newContent.each((index,element)=>{if(element.nodeType===Node.ELEMENT_NODE&&document.documentElement.contains(element))Drupal.attachBehaviors(element,settings);});},remove(ajax,response,status){const settings=response.settings||ajax.settings||drupalSettings;$(response.selector).each(function(){Drupal.detachBehaviors(this,settings);}).remove();},changed(ajax,response,status){const $element=$(response.selector);if(!$element.hasClass('ajax-changed')){$element.addClass('ajax-changed');if(response.asterisk)$element.find(response.asterisk).append(` <abbr class="ajax-changed" title="${Drupal.t('Changed')}">*</abbr> `);}},alert(ajax,response,status){window.alert(response.text);},announce(ajax,response){if(response.priority)Drupal.announce(response.text,response.priority);else Drupal.announce(response.text);},redirect(ajax,response,status){window.location=response.url;},css(ajax,response,status){$(response.selector).css(response.argument);},settings(ajax,response,status){const ajaxSettings=drupalSettings.ajax;if(ajaxSettings)Drupal.ajax.expired().forEach((instance)=>{if(instance.selector){const selector=instance.selector.replace('#','');if(selector in ajaxSettings)delete ajaxSettings[selector];}});if(response.merge)$.extend(true,drupalSettings,response.settings);else ajax.settings=response.settings;},data(ajax,response,status){$(response.selector).data(response.name,response.value);},focusFirst(ajax,response,status){let focusChanged=false;const container=document.querySelector(response.selector);if(container){const tabbableElements=tabbable(container);if(tabbableElements.length){tabbableElements[0].focus();focusChanged=true;}else{if(isFocusable(container)){container.focus();focusChanged=true;}}}if(ajax.hasOwnProperty('element')&&!focusChanged)ajax.element.focus();},invoke(ajax,response,status){const $element=$(response.selector);$element[response.method](...response.args);},restripe(ajax,response,status){$(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even');},update_build_id(ajax,response,status){document.querySelectorAll(`input[name="form_build_id"][value="${response.old}"]`).forEach((item)=>{item.value=response.new;});},add_css(ajax,response,status){if(typeof response.data==='string'){Drupal.deprecationError({message:'Passing a string to the Drupal.ajax.add_css() method is deprecated in 10.1.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3154948.'});$('head').prepend(response.data);return;}const allUniqueBundleIds=response.data.map(function(style){const uniqueBundleId=style.href;if(!loadjs.isDefined(uniqueBundleId))loadjs(`css!${style.href}`,uniqueBundleId,{before(path,styleEl){Object.keys(style).forEach((attributeKey)=>{styleEl.setAttribute(attributeKey,style[attributeKey]);});}});return uniqueBundleId;});return new Promise((resolve,reject)=>{loadjs.ready(allUniqueBundleIds,{success(){resolve();},error(depsNotFound){const message=Drupal.t(`The following files could not be loaded: @dependencies`,{'@dependencies':depsNotFound.join(', ')});reject(message);}});});},message(ajax,response){const messages=new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector));if(response.clearPrevious)messages.clear();messages.add(response.message,response.messageOptions);},add_js(ajax,response,status){const parentEl=document.querySelector(response.selector||'body');const settings=ajax.settings||drupalSettings;const allUniqueBundleIds=response.data.map((script)=>{const uniqueBundleId=script.src;
10if(!loadjs.isDefined(uniqueBundleId))loadjs(script.src,uniqueBundleId,{async:false,before(path,scriptEl){Object.keys(script).forEach((attributeKey)=>{scriptEl.setAttribute(attributeKey,script[attributeKey]);});parentEl.appendChild(scriptEl);return false;}});return uniqueBundleId;});return new Promise((resolve,reject)=>{loadjs.ready(allUniqueBundleIds,{success(){Drupal.attachBehaviors(parentEl,settings);resolve();},error(depsNotFound){const message=Drupal.t(`The following files could not be loaded: @dependencies`,{'@dependencies':depsNotFound.join(', ')});reject(message);}});});},scrollTop(ajax,response){document.querySelector(response.selector)?.scrollIntoView();}};const stopEvent=(xhr,settings)=>{return (xhr.getResponseHeader('X-Drupal-Ajax-Token')==='1'&&settings.isInProgress&&settings.isInProgress());};$.extend(true,$.event.special,{ajaxSuccess:{trigger(event,xhr,settings){if(stopEvent(xhr,settings))return false;}},ajaxComplete:{trigger(event,xhr,settings){if(stopEvent(xhr,settings)){$.active++;return false;}}}});})(jQuery,window,Drupal,drupalSettings,loadjs,window.tabbable);; 11(($,Drupal,{isTabbable})=>{$.extend($.expr[':'],{tabbable(element){Drupal.deprecationError({message:'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 11.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730'});return isTabbable(element);}});})(jQuery,Drupal,window.tabbable);; 12(($)=>{let cachedScrollbarWidth=null;const {max,abs}=Math;const regexHorizontal=/left|center|right/;const regexVertical=/top|center|bottom/;const regexOffset=/[+-]\d+(\.[\d]+)?%?/;const regexPosition=/^\w+/;const _position=$.fn.position;function getOffsets(offsets,width,height){return [parseFloat(offsets[0])*(typeof offsets[0]==='string'&&offsets[0].endsWith('%')?width/100:1),parseFloat(offsets[1])*(typeof offsets[1]==='string'&&offsets[1].endsWith('%')?height/100:1)];}function parseCss(element,property){return parseInt(window.getComputedStyle(element)[property],10)||0;}function getDimensions(elem){const raw=elem[0];if(raw.nodeType===9)return {width:elem.width(),height:elem.height(),offset:{top:0,left:0}};if(!!raw&&raw===raw.window)return {width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}};if(raw.preventDefault)return {width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}};return {width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};}const collisions={fit:{left(position,data){const {within}=data;const withinOffset=within.isWindow?within.scrollLeft:within.offset.left;const outerWidth=within.width;const collisionPosLeft=position.left-data.collisionPosition.marginLeft;const overLeft=withinOffset-collisionPosLeft;const overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset;let newOverRight;if(data.collisionWidth>outerWidth)if(overLeft>0&&overRight<=0){newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset;position.left+=overLeft-newOverRight;}else if(overRight>0&&overLeft<=0)position.left=withinOffset;else if(overLeft>overRight)position.left=withinOffset+outerWidth-data.collisionWidth;else position.left=withinOffset;else if(overLeft>0)position.left+=overLeft;else if(overRight>0)position.left-=overRight;else position.left=max(position.left-collisionPosLeft,position.left);},top(position,data){const {within}=data;const withinOffset=within.isWindow?within.scrollTop:within.offset.top;const outerHeight=data.within.height;const collisionPosTop=position.top-data.collisionPosition.marginTop;const overTop=withinOffset-collisionPosTop;const overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset;let newOverBottom;if(data.collisionHeight>outerHeight)if(overTop>0&&overBottom<=0){newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset;position.top+=overTop-newOverBottom;}else if(overBottom>0&&overTop<=0)position.top=withinOffset;else if(overTop>overBottom)position.top=withinOffset+outerHeight-data.collisionHeight;else position.top=withinOffset;else if(overTop>0)position.top+=overTop;else if(overBottom>0)position.top-=overBottom;else position.top=max(position.top-collisionPosTop,position.top);}},flip:{left(position,data){const {within}=data;const withinOffset=within.offset.left+within.scrollLeft;const outerWidth=within.width;const offsetLeft=within.isWindow?within.scrollLeft:within.offset.left;const collisionPosLeft=position.left-data.collisionPosition.marginLeft;const overLeft=collisionPosLeft-offsetLeft;const overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft;const myOffset=data.my[0]==='left'?-data.elemWidth:data.my[0]==='right'?data.elemWidth:0;const atOffset=data.at[0]==='left'?data.targetWidth:data.at[0]==='right'?-data.targetWidth:0;const offset=-2*data.offset[0];let newOverRight;let newOverLeft;if(overLeft<0){newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft))position.left+=myOffset+atOffset+offset;}else{if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft;if(newOverLeft>0||abs(newOverLeft)<overRight)position.left+=myOffset+atOffset+offset;}}},top(position,data){const {within}=data;const withinOffset=within.offset.top+within.scrollTop;const outerHeight=within.height;const offsetTop=within.isWindow?within.scrollTop:within.offset.top;const collisionPosTop=position.top-data.collisionPosition.marginTop;const overTop=collisionPosTop-offsetTop;const overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop;const top=data.my[1]==='top';const myOffset=top?-data.elemHeight:data.my[1]==='bottom'?data.elemHeight:0;const atOffset=data.at[1]==='top'?data.targetHeight:data.at[1]==='bottom'?-data.targetHeight:0;const offset=-2*data.offset[1];let newOverTop;let newOverBottom;if(overTop<0){newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset;if(newOverBottom<0||newOverBottom<abs(overTop))position.top+=myOffset+atOffset+offset;}else{if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop;if(newOverTop>0||abs(newOverTop)<overBottom)position.top+=myOffset+atOffset+offset;}}}},flipfit:{left(...args){collisions.flip.left.apply(this,args);collisions.fit.left.apply(this,args);},top(...args){collisions.flip.top.apply(this,args);collisions.fit.top.apply(this,args);}}};$.position={scrollbarWidth(){if(cachedScrollbarWidth!==undefined)return cachedScrollbarWidth;const div=$('<div '+"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>"+"<div style='height:100px;width:auto;'></div></div>");const innerDiv=div.children()[0];$('body').append(div);const w1=innerDiv.offsetWidth;div[0].style.overflow='scroll';let w2=innerDiv.offsetWidth;if(w1===w2)w2=div[0].clientWidth;div.remove();cachedScrollbarWidth=w1-w2;return cachedScrollbarWidth;},getScrollInfo(within){const overflowX=within.isWindow||within.isDocument?'':window.getComputedStyle(within.element[0])['overflow-x'];const overflowY=within.isWindow||within.isDocument?'':window.getComputedStyle(within.element[0])['overflow-y'];const hasOverflowX=overflowX==='scroll'||(overflowX==='auto'&&within.width<within.element[0].scrollWidth);const hasOverflowY=overflowY==='scroll'||(overflowY==='auto'&&within.height<within.element[0].scrollHeight);return {width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0};},getWithinInfo(element){const withinElement=$(element||window);const isWindow=!!withinElement[0]&&withinElement[0]===withinElement[0].window;const isDocument=!!withinElement[0]&&withinElement[0].nodeType===9;const hasOffset=!isWindow&&!isDocument;return {element:withinElement,isWindow,isDocument,offset:hasOffset?$(element).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:withinElement.outerWidth(),height:withinElement.outerHeight()};}};$.fn.position=function(options){if(!options||!options.of)return _position.apply(this,arguments);options=$.extend({},options);const within=$.position.getWithinInfo(options.within);const scrollInfo=$.position.getScrollInfo(within);const collision=(options.collision||'flip').split(' ');const offsets={};const target=typeof options.of==='string'?$(document).find(options.of):$(options.of);const dimensions=getDimensions(target);const targetWidth=dimensions.width;const targetHeight=dimensions.height;const targetOffset=dimensions.offset;if(target[0].preventDefault)options.at='left top';const basePosition=$.extend({},targetOffset);$.each(['my','at'],function(){let pos=(options[this]||'').split(' ');
12if(pos.length===1)pos=regexHorizontal.test(pos[0])?pos.concat(['center']):regexVertical.test(pos[0])?['center'].concat(pos):['center','center'];pos[0]=regexHorizontal.test(pos[0])?pos[0]:'center';pos[1]=regexVertical.test(pos[1])?pos[1]:'center';const horizontalOffset=regexOffset.exec(pos[0]);const verticalOffset=regexOffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0];options[this]=[regexPosition.exec(pos[0])[0],regexPosition.exec(pos[1])[0]];});if(collision.length===1)collision[1]=collision[0];if(options.at[0]==='right')basePosition.left+=targetWidth;else{if(options.at[0]==='center')basePosition.left+=targetWidth/2;}if(options.at[1]==='bottom')basePosition.top+=targetHeight;else{if(options.at[1]==='center')basePosition.top+=targetHeight/2;}const atOffset=getOffsets(offsets.at,targetWidth,targetHeight);basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){let using;const elem=$(this);const elemWidth=elem.outerWidth();const elemHeight=elem.outerHeight();const marginLeft=parseCss(this,'marginLeft');const marginTop=parseCss(this,'marginTop');const collisionWidth=elemWidth+marginLeft+parseCss(this,'marginRight')+scrollInfo.width;const collisionHeight=elemHeight+marginTop+parseCss(this,'marginBottom')+scrollInfo.height;const position=$.extend({},basePosition);const myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());if(options.my[0]==='right')position.left-=elemWidth;else{if(options.my[0]==='center')position.left-=elemWidth/2;}if(options.my[1]==='bottom')position.top-=elemHeight;else{if(options.my[1]==='center')position.top-=elemHeight/2;}position.left+=myOffset[0];position.top+=myOffset[1];const collisionPosition={marginLeft,marginTop};$.each(['left','top'],function(i,dir){if(collisions[collision[i]])collisions[collision[i]][dir](position,{targetWidth,targetHeight,elemWidth,elemHeight,collisionPosition,collisionWidth,collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within,elem});});if(options.using)using=function(props){const left=targetOffset.left-position.left;const right=left+targetWidth-elemWidth;const top=targetOffset.top-position.top;const bottom=top+targetHeight-elemHeight;const feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?'left':left>0?'right':'center',vertical:bottom<0?'top':top>0?'bottom':'middle'};if(targetWidth<elemWidth&&abs(left+right)<targetWidth)feedback.horizontal='center';if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight)feedback.vertical='middle';if(max(abs(left),abs(right))>max(abs(top),abs(bottom)))feedback.important='horizontal';else feedback.important='vertical';options.using.call(this,props,feedback);};elem.offset($.extend(position,{using}));});};if(!$.hasOwnProperty('ui'))$.ui={};$.ui.position=collisions;})(jQuery);; 13/* @license Apache License Version 2.0 https://github.com/cure53/DOMPurify/blob/main/LICENSE */ 14/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */ 15!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;c||(c=function(e,t,n){return e.apply(t,n)}),i||(i=function(e){return e}),a||(a=function(e){return e}),s||(s=function(e,t){return new e(...t)});const m=b(Array.prototype.forEach),u=b(Array.prototype.pop),f=b(Array.prototype.push),p=b(String.prototype.toLowerCase),d=b(String.prototype.toString),h=b(String.prototype.match),g=b(String.prototype.replace),T=b(String.prototype.indexOf),y=b(String.prototype.trim),E=b(RegExp.prototype.test),A=(_=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(_,t)});var _;function b(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function N(e,o,r){var i;r=null!==(i=r)&&void 0!==i?i:p,t&&t(e,null);let a=o.length;for(;a--;){let t=o[a];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[a]=e),t=e)}e[t]=!0}return e}function S(t){const n=l(null);for(const[o,r]of e(t))n[o]=r;return n}function R(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return b(n.get);if("function"==typeof n.value)return b(n.value)}e=o(e)}return function(e){return console.warn("fallback value for",e),null}}const w=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),L=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),v=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),x=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),C=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=i(["#text"]),O=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
15spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),I=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),M=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),P=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),F=a(/<%[\w\W]*|[\w\W]*%>/gm),H=a(/\${[\w\W]*}/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),B=a(/^aria-[\-\w]+$/),W=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=a(/^(?:\w+script|data):/i),Y=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),j=a(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:P,ERB_EXPR:F,TMPLIT_EXPR:H,DATA_ATTR:z,ARIA_ATTR:B,IS_ALLOWED_URI:W,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:Y,DOCTYPE_NAME:j});const X=()=>"undefined"==typeof window?null:window,K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var V=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X();const o=e=>t(e);if(o.version="3.0.3",o.removed=[],!n||!n.document||9!==n.document.nodeType)return o.isSupported=!1,o;const r=n.document,a=r.currentScript;let{document:l}=n;const{DocumentFragment:c,HTMLTemplateElement:s,Node:_,Element:b,NodeFilter:P,NamedNodeMap:F=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:z,trustedTypes:B}=n,G=b.prototype,Y=R(G,"cloneNode"),V=R(G,"nextSibling"),$=R(G,"childNodes"),Z=R(G,"parentNode");if("function"==typeof s){const e=l.createElement("template");e.content&&e.content.ownerDocument&&(l=e.content.ownerDocument)}let J,Q="";const{implementation:ee,createNodeIterator:te,createDocumentFragment:ne,getElementsByTagName:oe}=l,{importNode:re}=r;let ie={};o.isSupported="function"==typeof e&&"function"==typeof Z&&ee&&void 0!==ee.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:se,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:ue,ATTR_WHITESPACE:fe}=q;let{IS_ALLOWED_URI:pe}=q,de=null;const he=N({},[...w,...D,...L,...x,...k]);let ge=null;const Te=N({},[...O,...I,...M,...U]);let ye=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,Ae=null,_e=!0,be=!0,Ne=!1,Se=!0,Re=!1,we=!1,De=!1,Le=!1,ve=!1,xe=!1,Ce=!1,ke=!0,Oe=!1;const Ie="user-content-";let Me=!0,Ue=!1,Pe={},Fe=null;const He=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ze=null;const Be=N({},["audio","video","img","source","image","track"]);let We=null;const Ge=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",je="http://www.w3.org/2000/svg",qe="http://www.w3.org/1999/xhtml";let Xe=qe,Ke=!1,Ve=null;const $e=N({},[Ye,je,qe],d);let Ze;const Je=["application/xhtml+xml","text/html"],Qe="text/html";let et,tt=null;const nt=l.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},rt=function(e){if(!tt||tt!==e){if(e&&"object"==typeof e||(e={}
15),e=S(e),Ze=Ze=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?Qe:e.PARSER_MEDIA_TYPE,et="application/xhtml+xml"===Ze?d:p,de="ALLOWED_TAGS"in e?N({},e.ALLOWED_TAGS,et):he,ge="ALLOWED_ATTR"in e?N({},e.ALLOWED_ATTR,et):Te,Ve="ALLOWED_NAMESPACES"in e?N({},e.ALLOWED_NAMESPACES,d):$e,We="ADD_URI_SAFE_ATTR"in e?N(S(Ge),e.ADD_URI_SAFE_ATTR,et):Ge,ze="ADD_DATA_URI_TAGS"in e?N(S(Be),e.ADD_DATA_URI_TAGS,et):Be,Fe="FORBID_CONTENTS"in e?N({},e.FORBID_CONTENTS,et):He,Ee="FORBID_TAGS"in e?N({},e.FORBID_TAGS,et):{},Ae="FORBID_ATTR"in e?N({},e.FORBID_ATTR,et):{},Pe="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,be=!1!==e.ALLOW_DATA_ATTR,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Re=e.SAFE_FOR_TEMPLATES||!1,we=e.WHOLE_DOCUMENT||!1,ve=e.RETURN_DOM||!1,xe=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,ke=!1!==e.SANITIZE_DOM,Oe=e.SANITIZE_NAMED_PROPS||!1,Me=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,pe=e.ALLOWED_URI_REGEXP||W,Xe=e.NAMESPACE||qe,ye=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ye.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ye.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ye.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(be=!1),xe&&(ve=!0),Pe&&(de=N({},[...k]),ge=[],!0===Pe.html&&(N(de,w),N(ge,O)),!0===Pe.svg&&(N(de,D),N(ge,I),N(ge,U)),!0===Pe.svgFilters&&(N(de,L),N(ge,I),N(ge,U)),!0===Pe.mathMl&&(N(de,x),N(ge,M),N(ge,U))),e.ADD_TAGS&&(de===he&&(de=S(de)),N(de,e.ADD_TAGS,et)),e.ADD_ATTR&&(ge===Te&&(ge=S(ge)),N(ge,e.ADD_ATTR,et)),e.ADD_URI_SAFE_ATTR&&N(We,e.ADD_URI_SAFE_ATTR,et),e.FORBID_CONTENTS&&(Fe===He&&(Fe=S(Fe)),N(Fe,e.FORBID_CONTENTS,et)),Me&&(de["#text"]=!0),we&&N(de,["html","head","body"]),de.table&&(N(de,["tbody"]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,Q=J.createHTML("")}else void 0===J&&(J=K(B,a)),null!==J&&"string"==typeof Q&&(Q=J.createHTML(""));i&&i(e),tt=e}},it=N({},["mi","mo","mn","ms","mtext"]),at=N({},["foreignobject","desc","title","annotation-xml"]),lt=N({},["title","style","font","a","script"]),ct=N({},D);N(ct,L),N(ct,v);const st=N({},x);N(st,C);const mt=function(e){let t=Z(e);t&&t.tagName||(t={namespaceURI:Xe,tagName:"template"});const n=p(e.tagName),o=p(t.tagName);return!!Ve[e.namespaceURI]&&(e.namespaceURI===je?t.namespaceURI===qe?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===o||it[o]):Boolean(ct[n]):e.namespaceURI===Ye?t.namespaceURI===qe?"math"===n:t.namespaceURI===je?"math"===n&&at[o]:Boolean(st[n]):e.namespaceURI===qe?!(t.namespaceURI===je&&!at[o])&&(!(t.namespaceURI===Ye&&!it[o])&&(!st[n]&&(lt[n]||!ct[n]))):!("application/xhtml+xml"!==Ze||!Ve[e.namespaceURI]))},ut=function(e){f(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ft=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ge[e])if(ve||xe)try{ut(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},pt=function(e){let t,n;if(Le)e="<remove></remove>"+e;else{const t=h(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ze&&Xe===qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=J?J.createHTML(e):e;if(Xe===qe)try{t=(new z).parseFromString(o,Ze)}catch(e){}if(!t||!t.documentElement){t=ee.createDocument(Xe,"template",null);try{t.documentElement.innerHTML=Ke?Q:o}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(l.createTextNode(n),r.childNodes[0]||null),Xe===qe?oe.call(t,we?"html":"body")[0]:we?t.documentElement:r},dt=function(e){return te.call(e.ownerDocument||e,e,P.SHOW_ELEMENT|P.SHOW_COMMENT|P.SHOW_TEXT,null,!1)},ht=function(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof F)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},gt=function(e){return"object"==typeof _?e instanceof _:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Tt=function(e,t,n){ie[e]&&m(ie[e],(e=>{e.call(o,t,n,tt)}))},yt=function(e){let t;if(Tt("beforeSanitizeElements",e,null),ht(e))return ut(e),!0;const n=et(e.nodeName);if(Tt("uponSanitizeElement",e,{tagName:n,allowedTags:de}),e.hasChildNodes()&&!gt(e.firstElementChild)&&(!gt(e.content)||!gt(e.content.firstElementChild))&&E(/<[/\w]/g,e.innerHTML)&&E(/<[/\w]/g,e.textContent))return ut(e),!0;
15if(!de[n]||Ee[n]){if(!Ee[n]&&At(n)){if(ye.tagNameCheck instanceof RegExp&&E(ye.tagNameCheck,n))return!1;if(ye.tagNameCheck instanceof Function&&ye.tagNameCheck(n))return!1}if(Me&&!Fe[n]){const t=Z(e)||e.parentNode,n=$(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o)t.insertBefore(Y(n[o],!0),V(e))}}return ut(e),!0}return e instanceof b&&!mt(e)?(ut(e),!0):"noscript"!==n&&"noembed"!==n||!E(/<\/no(script|embed)/i,e.innerHTML)?(Re&&3===e.nodeType&&(t=e.textContent,t=g(t,ae," "),t=g(t,le," "),t=g(t,ce," "),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Tt("afterSanitizeElements",e,null),!1):(ut(e),!0)},Et=function(e,t,n){if(ke&&("id"===t||"name"===t)&&(n in l||n in nt))return!1;if(be&&!Ae[t]&&E(se,t));else if(_e&&E(me,t));else if(!ge[t]||Ae[t]){if(!(At(e)&&(ye.tagNameCheck instanceof RegExp&&E(ye.tagNameCheck,e)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(e))&&(ye.attributeNameCheck instanceof RegExp&&E(ye.attributeNameCheck,t)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(t))||"is"===t&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&E(ye.tagNameCheck,n)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(n))))return!1}else if(We[t]);else if(E(pe,g(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==T(n,"data:")||!ze[e]){if(Ne&&!E(ue,g(n,fe,"")));else if(n)return!1}else;return!0},At=function(e){return e.indexOf("-")>0},_t=function(e){let t,n,r,i;Tt("beforeSanitizeAttributes",e,null);const{attributes:a}=e;if(!a)return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge};for(i=a.length;i--;){t=a[i];const{name:c,namespaceURI:s}=t;if(n="value"===c?t.value:y(t.value),r=et(c),l.attrName=r,l.attrValue=n,l.keepAttr=!0,l.forceKeepAttr=void 0,Tt("uponSanitizeAttribute",e,l),n=l.attrValue,l.forceKeepAttr)continue;if(ft(c,e),!l.keepAttr)continue;if(!Se&&E(/\/>/i,n)){ft(c,e);continue}Re&&(n=g(n,ae," "),n=g(n,le," "),n=g(n,ce," "));const m=et(e.nodeName);if(Et(m,r,n)){if(!Oe||"id"!==r&&"name"!==r||(ft(c,e),n=Ie+n),J&&"object"==typeof B&&"function"==typeof B.getAttributeType)if(s);else switch(B.getAttributeType(m,r)){case"TrustedHTML":n=J.createHTML(n);break;case"TrustedScriptURL":n=J.createScriptURL(n)}try{s?e.setAttributeNS(s,c,n):e.setAttribute(c,n),u(o.removed)}catch(e){}}}Tt("afterSanitizeAttributes",e,null)},bt=function e(t){let n;const o=dt(t);for(Tt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)Tt("uponSanitizeShadowNode",n,null),yt(n)||(n.content instanceof c&&e(n.content),_t(n));Tt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t,n,i,a,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ke=!e,Ke&&(e="\x3c!--\x3e"),"string"!=typeof e&&!gt(e)){if("function"!=typeof e.toString)throw A("toString is not a function");if("string"!=typeof(e=e.toString()))throw A("dirty is not a string, aborting")}if(!o.isSupported)return e;if(De||rt(l),o.removed=[],"string"==typeof e&&(Ue=!1),Ue){if(e.nodeName){const t=et(e.nodeName);if(!de[t]||Ee[t])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof _)t=pt("\x3c!----\x3e"),n=t.ownerDocument.importNode(e,!0),1===n.nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?t=n:t.appendChild(n);else{if(!ve&&!Re&&!we&&-1===e.indexOf("<"))return J&&Ce?J.createHTML(e):e;if(t=pt(e),!t)return ve?null:Ce?Q:""}t&&Le&&ut(t.firstChild);const s=dt(Ue?e:t);for(;i=s.nextNode();)yt(i)||(i.content instanceof c&&bt(i.content),_t(i));if(Ue)return e;if(ve){if(xe)for(a=ne.call(t.ownerDocument);t.firstChild;)a.appendChild(t.firstChild);else a=t;return(ge.shadowroot||ge.shadowrootmod)&&(a=re.call(r,a,!0)),a}let m=we?t.outerHTML:t.innerHTML;return we&&de["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&E(j,t.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+t.ownerDocument.doctype.name+">\n"+m),Re&&(m=g(m,ae," "),m=g(m,le," "),m=g(m,ce," ")),J&&Ce?J.createHTML(m):m},o.setConfig=function(e){rt(e),De=!0},o.clearConfig=function(){tt=null,De=!1},o.isValidAttribute=function(e,t,n){tt||rt({});const o=et(e),r=et(t);return Et(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&(ie[e]=ie[e]||[],f(ie[e],t))},o.removeHook=function(e){if(ie[e])return u(ie[e])},o.removeHooks=function(e){ie[e]&&(ie[e]=[])},o.removeAllHooks=function(){ie={}},o}();return V})); 16 17; 18/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 19(function($,Drupal,drupalSettings,once){'use strict';var DOMPurify=window.DOMPurify;if(typeof DOMPurify!=='undefined')DOMPurify.addHook('uponSanitizeElement',function(node,data){if(data.tagName==='script'){node.outerHTML=Drupal.checkPlain(node.outerHTML);return node;}});var autocomplete;function escapeRegExp(str){str=str.trim();return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,'\\$&');}function autocompleteSplitValues(value){var result=[];var quote=false;var current='';var valueLength=value.length;var i,character;for(i=0;i<valueLength;i++){character=value.charAt(i);if(character==='"'){current+=character;quote=!quote;}else if(character===','&&!quote){result.push(current.trim());current='';}else current+=character;}if(value.length>0)result.push(current.trim());return result;}function extractLastTerm(terms){return autocomplete.splitValues(terms).pop();}function searchHandler(event){var options=autocomplete.options;var term=autocomplete.extractLastTerm(event.target.value);if(term.length>0&&options.firstCharacterBlacklist.indexOf(term[0])!==-1)return false;return term.length>=options.minLength;}function sourceData(request,response){var elementId=this.element.attr('id');if(!(elementId in autocomplete.cache))autocomplete.cache[elementId]={};var key=this.element.data('key');function showSuggestions(suggestions){var tagged=autocomplete.splitValues(request.term);for(var i=0,il=tagged.length;i<il;i++){var index=suggestions.indexOf(tagged[i]);if(index>=0)suggestions.splice(index,1);}response(suggestions);}function sourceCallbackHandler(data){const length=data.length;if(key)data=data.slice(0,autocomplete.options.forms[key].maxSuggestions);if(key)if(data.length){var moreResults=replaceInObject(autocomplete.options.forms[key].moreResults,'\\[search-phrase\\]',request.term);moreResults=replaceInObject(moreResults,'\\[search-count\\]',length);data.push(moreResults);}else{var noResult=replaceInObject(autocomplete.options.forms[key].noResult,'\\[search-phrase\\]',request.term);data.push(noResult);}autocomplete.cache[elementId][term]=data;showSuggestions(data);}var term=autocomplete.extractLastTerm(request.term);if(autocomplete.cache[elementId].hasOwnProperty(term))showSuggestions(autocomplete.cache[elementId][term]);else{var data={};var path='';if(key&&autocomplete.options.forms[key]){path=autocomplete.options.forms[key].source;$.each(autocomplete.options.forms[key].filters,function(key,value){data[value]=term;});}else{path=this.element.attr('data-autocomplete-path');data.q=term;}var options=$.extend({success:sourceCallbackHandler,data},autocomplete.ajax);
19$.ajax(path,options);}}function focusHandler(){return false;}function modifyHtml(html,mode,regex){let regexHtml=/(<("[^"]*"|\'[^\']*\'|[^\'">])*>)/g;switch(mode){case 'remove_html_tags':html=html.replace(regexHtml,'');break;case 'highlight':{let nullStrings='';let detachedTags={};html=html.replace(regexHtml,(match)=>{nullStrings+=`\0`;let detachedMark=`\v${nullStrings}\v`;detachedTags[detachedMark]=match;return detachedMark;}).replace(regex,'<span class="ui-autocomplete-field-term">$1</span>').replace(/(\v\0+\v)/g,(match)=>detachedTags[match]);break;}}return html.replaceAll(/\s+/g,' ').trim();}function selectHandler(event,ui){var terms=autocomplete.splitValues(event.target.value);terms.pop();const helper=document.createElement('textarea');helper.innerHTML=ui.item.value;ui.item.value=modifyHtml(helper.value,'remove_html_tags');if(ui.item.value.search(',')>0)terms.push('"'+ui.item.value+'"');else terms.push(ui.item.value);event.target.value=terms.join(', ');var key=$(event.target).data('key');if(key&&autocomplete.options.forms[key].autoRedirect&&ui.item.link){helper.innerHTML=ui.item.link;document.location.href=helper.value;}else{if(key&&autocomplete.options.forms[key].autoSubmit&&ui.item.value){$(this).val(ui.item.value);const form=$(this).closest('form');const submit=$('[type="submit"]',form);if(submit.length===1)submit.click();else form.submit();}}return false;}function renderMenu(ul,items){var that=this;let currentGroup=null;const content=$('<div class="ui-autocomplete-content"></div>');ul.append(content);$.each(items,function(index,item){if('group' in item){currentGroup=$('<div class="ui-autocomplete-container ui-autocomplete-container-'+item.group.group_id+'"></div>');if(item.group.group_id==='more_results'||item.group.group_id==='no_results')ul.append(currentGroup);else content.append(currentGroup);}that._renderItemData(currentGroup||ul,item);});}function renderItem(ul,item){var term=this.term;var first=('group' in item)?'first':'';let innerHTML='';var regex=new RegExp('('+escapeRegExp(term)+')','gi');if(!item.fields)item.fields=[item.label];var helper=document.createElement('textarea');innerHTML='<div class="ui-autocomplete-fields '+first+'">';$.each(item.fields,function(key,value){helper.innerHTML=value;let output=value;if(typeof DOMPurify!=='undefined')output=DOMPurify.sanitize(helper.value,{ADD_TAGS:['script']});else{let parser=new DOMParser();let doc=parser.parseFromString(helper.value,'text/html');output=doc.body.textContent;}if(output.indexOf('src=')===-1&&output.indexOf('href=')===-1)output=modifyHtml(output,'highlight',regex);innerHTML+=('<div class="ui-autocomplete-field-'+key+'">'+output+'</div>');});innerHTML+='</div>';if('group' in item){var groupId=typeof (item.group.group_id)!=='undefined'?item.group.group_id:'';var groupName=typeof (item.group.group_name)!=='undefined'?item.group.group_name:'';$('<div class="ui-autocomplete-field-group ui-state-disabled '+groupId+'">'+groupName+'</div>').appendTo(ul);}var isSearchAutoComplete=ul.closest('ul[data-input-ref]').data('input-ref');var uiMenuItemClass=(isSearchAutoComplete?'':' ui-menu-item');var elem=$('<li class="ui-menu-item-'+first+uiMenuItemClass+'"></li>').append('<a>'+innerHTML+'</a>');if(item.value==='')elem=$('<li class="ui-state-disabled ui-menu-item-'+first+uiMenuItemClass+'">'+item.label+'</li>');elem.data('item.autocomplete',item).appendTo(ul);return elem;}function resizeMenu(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width('').outerWidth()+5,this.options.position.of==null?this.element.outerWidth():this.options.position.of.outerWidth()));const parent=ul.parent()[0];ul.css({"maxHeight":(window.innerHeight-parent.offsetHeight-parent.getBoundingClientRect().top)+'px'});}function replaceInObject(stash,needle,replacement){var regex=new RegExp(needle,'g');var input=Drupal.checkPlain(replacement);var result={};$.each(stash,function(index,value){if(typeof (value)==='string')result[index]=value.replace(regex,input);else result[index]=value;});return result;}Drupal.behaviors.autocomplete={attach:function(context){var $autocomplete=$(context).find('input.form-autocomplete');$.each(autocomplete.options.forms,function(key,value){var elem=$(context).find(autocomplete.options.forms[key].selector).data('key',key).addClass('form-autocomplete').attr('data-id',key);$autocomplete=$.merge($autocomplete,elem);});$.each($autocomplete,function(_,value){value=$(value);var key=value.data('key');once('autocomplete',value);if(value.length){var blacklist=value.attr('data-autocomplete-first-character-blacklist');var formId='#'+$(this).closest('form').attr('id');$.extend(autocomplete.options,{firstCharacterBlacklist:(blacklist)?blacklist:'',minLength:(typeof key!=='undefined')?autocomplete.options.forms[key].minChars:autocomplete.options.minLength,appendTo:(formId)?formId:'body'});value.autocomplete(autocomplete.options).autocomplete('widget').menu('option','items','.ui-autocomplete-container > *');value.autocomplete(autocomplete.options).data('ui-autocomplete')._renderItem=autocomplete.options.renderItem;value.autocomplete(autocomplete.options).data('ui-autocomplete')._renderMenu=autocomplete.options.renderMenu;value.autocomplete(autocomplete.options).data('ui-autocomplete')._resizeMenu=autocomplete.options.resizeMenu;if(key){value.autocomplete('widget').attr('data-sa-theme',autocomplete.options.forms[key].theme);value.autocomplete('widget').attr('data-input-ref',key);}}});},detach:function(context,settings,trigger){if(trigger==='unload')$(once.remove('autocomplete','input.form-autocomplete',context)).autocomplete('destroy');}};autocomplete={cache:{},splitValues:autocompleteSplitValues,extractLastTerm,options:{source:sourceData,focus:focusHandler,search:searchHandler,select:selectHandler,renderItem,renderMenu,resizeMenu,minLength:1,firstCharacterBlacklist:'',forms:drupalSettings.search_autocomplete?drupalSettings.search_autocomplete:[]},ajax:{dataType:'json'}};Drupal.autocomplete=autocomplete;})(jQuery,Drupal,drupalSettings,once);;
vendor: 80,448 bytes, lines 20-25
20/*! 21 * Bootstrap v5.3.8 (https://getbootstrap.com/) 22 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 23 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 24 */ 25!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),s=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),o=t=>{t.dispatchEvent(new Event(i))},r=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),a=t=>r(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,l=t=>{if(!r(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},c=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?h(t.parentNode):null},d=()=>{},u=t=>{t.offsetHeight},f=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,p=[],m=()=>"rtl"===document.documentElement.dir,g=t=>{var e;e=()=>{const e=f();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(p.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of p)t()}),p.push(e)):e()},_=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,b=(t,e,n=!0)=>{if(!n)return void _(t);const s=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),_(t))};e.addEventListener(i,a),setTimeout(()=>{r||o(e)},s)},v=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},y=/[^.]*(?=\..*)\.|.*/,w=/\..*/,A=/::\d+$/,E={};let T=1;const C={mouseenter:"mouseover",mouseleave:"mouseout"},O=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function x(t,e){return e&&`${e}::${T++}`||t.uidEvent||T++}function k(t){const e=x(t);return t.uidEvent=e,E[e]=E[e]||{},E[e]}function L(t,e,i=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===i)}function S(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=N(t);return O.has(o)||(o=t),[n,s,o]}function D(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=S(e,i,n);if(e in C){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=k(t),c=l[a]||(l[a]={}),h=L(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=x(r,e.replace(y,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return j(s,{delegateTarget:r}),n.oneOff&&P.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return j(n,{delegateTarget:t}),i.oneOff&&P.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function $(t,e,i,n,s){const o=L(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function I(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&$(t,e,i,r.callable,r.delegationSelector)}function N(t){return t=t.replace(w,""),C[t]||t}const P={on(t,e,i,n){D(t,e,i,n,!1)},one(t,e,i,n){D(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=S(e,i,n),a=r!==e,l=k(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))I(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(A,"");a&&!e.includes(s)||$(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;$(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=f();let s=null,o=!0,r=!0,a=!1;e!==N(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=j(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function j(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function M(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function F(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const H={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${F(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${F(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=M(t.dataset[n])}return e},getDataAttribute:(t,e)=>M(t.getAttribute(`data-bs-${F(e)}`))};class W{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=r(e)?H.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...r(e)?H.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,n]of Object.entries(e)){const e=t[i],o=r(e)?"element":s(e);if(!new RegExp(n).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${o}" but expected type "${n}".`)}}}class B extends W{constructor(t,i){super(),(t=a(t))&&(this._element=t,this._config=this._getConfig(i),e.set(this._element,this.constructor.DATA_KEY,this))}dispose(){e.remove(this._element,this.constructor.DATA_KEY),P.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){b(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return e.get(a(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const z=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map(t=>n(t)).join(","):null},R={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(t=>!c(t)&&l(t))},getSelectorFromElement(t){const e=z(t);return e&&R.findOne(e)?e:null},getElementFromSelector(t){const e=z(t);return e?R.findOne(e):null},getMultipleElementsFromSelector(t){const e=z(t);return e?R.find(e):[]}},q=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;P.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),c(this))return;const s=R.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()})},V=".bs.alert",K=`close${V}`,Q=`closed${V}`;class X extends B{static get NAME(){return"alert"}close(){if(P.trigger(this._element,K).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),P.trigger(this._element,Q),this.dispose()}static jQueryInterface(t){return this.each(function(){const e=X.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}q(X,"close"),g(X);const Y='[data-bs-toggle="button"]';class U extends B{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each(function(){const e=U.getOrCreateInstance(this);"toggle"===t&&e[t]()})}}P.on(document,"click.bs.button.data-api",Y,t=>{t.preventDefault();const e=t.target.closest(Y);U.getOrCreateInstance(e).toggle()}),g(U);const G=".bs.swipe",J=`touchstart${G}`,Z=`touchmove${G}`,tt=`touchend${G}`,et=`pointerdown${G}`,it=`pointerup${G}`,nt={endCallback:null,leftCallback:null,rightCallback:null},st={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ot extends W{constructor(t,e){super(),this._element=t,t&&ot.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return nt}static get DefaultType(){return st}static get NAME(){return"swipe"}dispose(){P.off(this._element,G)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),_(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&_(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(P.on(this._element,et,t=>this._start(t)),P.on(this._element,it,t=>this._end(t)),this._element.classList.add("pointer-event")):(P.on(this._element,J,t=>this._start(t)),P.on(this._element,Z,t=>this._move(t)),P.on(this._element,tt,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const rt=".bs.carousel",at=".data-api",lt="ArrowLeft",ct="ArrowRight",ht="next",dt="prev",ut="left",ft="right",pt=`slide${rt}`,mt=`slid${rt}`,gt=`keydown${rt}`,_t=`mouseenter${rt}`,bt=`mouseleave${rt}`,vt=`dragstart${rt}`,yt=`load${rt}${at}`,wt=`click${rt}${at}`,At="carousel",Et="active",Tt=".active",Ct=".carousel-item",Ot=Tt+Ct,xt={[lt]:ft,[ct]:ut},kt={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Lt={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class St extends B{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=R.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===At&&this.cycle()}static get Default(){return kt}static get DefaultType(){return Lt}static get NAME(){return"carousel"}next(){this._slide(ht)}nextWhenVisible(){!document.hidden&&l(this._element)&&this.next()}prev(){this._slide(dt)}pause(){this._isSliding&&o(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?P.one(this._element,mt,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void P.one(this._element,mt,()=>this.to(t));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?ht:dt;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&P.on(this._element,gt,t=>this._keydown(t)),"hover"===this._config.pause&&(P.on(this._element,_t,()=>this.pause()),P.on(this._element,bt,()=>this._maybeEnableCycle())),this._config.touch&&ot.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of R.find(".carousel-item img",this._element))P.on(t,vt,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(ut)),rightCallback:()=>this._slide(this._directionToOrder(ft)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ot(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=xt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=R.findOne(Tt,this._indicatorsElement);e.classList.remove(Et),e.removeAttribute("aria-current");const i=R.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(Et),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===ht,s=e||v(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>P.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(pt).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),u(s),i.classList.add(l),s.classList.add(l),this._queueCallback(()=>{s.classList.remove(l,c),s.classList.add(Et),i.classList.remove(Et,c,l),this._isSliding=!1,r(mt)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return R.findOne(Ot,this._element)}_getItems(){return R.find(Ct,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return m()?t===ut?dt:ht:t===ut?ht:dt}_orderToDirection(t){return m()?t===dt?ut:ft:t===dt?ft:ut}static jQueryInterface(t){return this.each(function(){const e=St.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)})}}P.on(document,wt,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=R.getElementFromSelector(this);if(!e||!e.classList.contains(At))return;t.preventDefault();const i=St.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===H.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),P.on(window,yt,()=>{const t=R.find('[data-bs-ride="carousel"]');for(const e of t)St.getOrCreateInstance(e)}),g(St);const Dt=".bs.collapse",$t=`show${Dt}`,It=`shown${Dt}`,Nt=`hide${Dt}`,Pt=`hidden${Dt}`,jt=`click${Dt}.data-api`,Mt="show",Ft="collapse",Ht="collapsing",Wt=`:scope .${Ft} .${Ft}`,Bt='[data-bs-toggle="collapse"]',zt={parent:null,toggle:!0},Rt={parent:"(null|element)",toggle:"boolean"};class qt extends B{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=R.find(Bt);for(const t of i){const e=R.getSelectorFromElement(t),i=R.find(e).filter(t=>t===this._element);null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return zt}static get DefaultType(){return Rt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>qt.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(P.trigger(this._element,$t).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Ft),this._element.classList.add(Ht),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ht),this._element.classList.add(Ft,Mt),this._element.style[e]="",P.trigger(this._element,It)},this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(P.trigger(this._element,Nt).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,u(this._element),this._element.classList.add(Ht),this._element.classList.remove(Ft,Mt);for(const t of this._triggerArray){const e=R.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Ht),this._element.classList.add(Ft),P.trigger(this._element,Pt)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(Mt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=a(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Bt);for(const e of t){const t=R.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=R.find(Wt,this._config.parent);return R.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each(function(){const i=qt.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}})}}P.on(document,jt,Bt,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of R.getMultipleElementsFromSelector(this))qt.getOrCreateInstance(t,{toggle:!1}).toggle()}),g(qt);var Vt="top",Kt="bottom",Qt="right",Xt="left",Yt="auto",Ut=[Vt,Kt,Qt,Xt],Gt="start",Jt="end",Zt="clippingParents",te="viewport",ee="popper",ie="reference",ne=Ut.reduce(function(t,e){return t.concat([e+"-"+Gt,e+"-"+Jt])},[]),se=[].concat(Ut,[Yt]).reduce(function(t,e){return t.concat([e,e+"-"+Gt,e+"-"+Jt])},[]),oe="beforeRead",re="read",ae="afterRead",le="beforeMain",ce="main",he="afterMain",de="beforeWrite",ue="write",fe="afterWrite",pe=[oe,re,ae,le,ce,he,de,ue,fe];function me(t){return t?(t.nodeName||"").toLowerCase():null}function ge(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function _e(t){return t instanceof ge(t).Element||t instanceof Element}function be(t){return t instanceof ge(t).HTMLElement||t instanceof HTMLElement}function ve(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ge(t).ShadowRoot||t instanceof ShadowRoot)}const ye={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];be(s)&&me(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});be(n)&&me(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function we(t){return t.split("-")[0]}var Ae=Math.max,Ee=Math.min,Te=Math.round;function Ce(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Oe(){return!/^((?!chrome|android).)*safari/i.test(Ce())}function xe(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&be(t)&&(s=t.offsetWidth>0&&Te(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Te(n.height)/t.offsetHeight||1);var r=(_e(t)?ge(t):window).visualViewport,a=!Oe()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function ke(t){var e=xe(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Le(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ve(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Se(t){return ge(t).getComputedStyle(t)}function De(t){return["table","td","th"].indexOf(me(t))>=0}function $e(t){return((_e(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ie(t){return"html"===me(t)?t:t.assignedSlot||t.parentNode||(ve(t)?t.host:null)||$e(t)}function Ne(t){return be(t)&&"fixed"!==Se(t).position?t.offsetParent:null}function Pe(t){for(var e=ge(t),i=Ne(t);i&&De(i)&&"static"===Se(i).position;)i=Ne(i);return i&&("html"===me(i)||"body"===me(i)&&"static"===Se(i).position)?e:i||function(t){var e=/firefox/i.test(Ce());if(/Trident/i.test(Ce())&&be(t)&&"fixed"===Se(t).position)return null;var i=Ie(t);for(ve(i)&&(i=i.host);be(i)&&["html","body"].indexOf(me(i))<0;){var n=Se(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function je(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Me(t,e,i){return Ae(t,Ee(e,i))}function Fe(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function He(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}const We={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=we(i.placement),l=je(a),c=[Xt,Qt].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return Fe("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:He(t,Ut))}(s.padding,i),d=ke(o),u="y"===l?Vt:Xt,f="y"===l?Kt:Qt,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],m=r[l]-i.rects.reference[l],g=Pe(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,v=h[u],y=_-d[c]-h[f],w=_/2-d[c]/2+b,A=Me(v,w,y),E=l;i.modifiersData[n]=((e={})[E]=A,e.centerOffset=A-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Le(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Be(t){return t.split("-")[1]}var ze={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Re(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,m=void 0===p?0:p,g="function"==typeof h?h({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var _=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),v=Xt,y=Vt,w=window;if(c){var A=Pe(i),E="clientHeight",T="clientWidth";A===ge(i)&&"static"!==Se(A=$e(i)).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth"),(s===Vt||(s===Xt||s===Qt)&&o===Jt)&&(y=Kt,m-=(d&&A===w&&w.visualViewport?w.visualViewport.height:A[E])-n.height,m*=l?1:-1),s!==Xt&&(s!==Vt&&s!==Kt||o!==Jt)||(v=Qt,f-=(d&&A===w&&w.visualViewport?w.visualViewport.width:A[T])-n.width,f*=l?1:-1)}var C,O=Object.assign({position:a},c&&ze),x=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:Te(i*s)/s||0,y:Te(n*s)/s||0}}({x:f,y:m},ge(i)):{x:f,y:m};return f=x.x,m=x.y,l?Object.assign({},O,((C={})[y]=b?"0":"",C[v]=_?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",C)):Object.assign({},O,((e={})[y]=b?m+"px":"",e[v]=_?f+"px":"",e.transform="",e))}const qe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:we(e.placement),variation:Be(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Re(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Re(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var Ve={passive:!0};const Ke={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=ge(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,Ve)}),a&&l.addEventListener("resize",i.update,Ve),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,Ve)}),a&&l.removeEventListener("resize",i.update,Ve)}},data:{}};var Qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Xe(t){return t.replace(/left|right|bottom|top/g,function(t){return Qe[t]})}var Ye={start:"end",end:"start"};function Ue(t){return t.replace(/start|end/g,function(t){return Ye[t]})}function Ge(t){var e=ge(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Je(t){return xe($e(t)).left+Ge(t).scrollLeft}function Ze(t){var e=Se(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function ti(t){return["html","body","#document"].indexOf(me(t))>=0?t.ownerDocument.body:be(t)&&Ze(t)?t:ti(Ie(t))}function ei(t,e){var i;void 0===e&&(e=[]);var n=ti(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=ge(n),r=s?[o].concat(o.visualViewport||[],Ze(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(ei(Ie(r)))}function ii(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ni(t,e,i){return e===te?ii(function(t,e){var i=ge(t),n=$e(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Oe();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Je(t),y:l}}(t,i)):_e(e)?function(t,e){var i=xe(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):ii(function(t){var e,i=$e(t),n=Ge(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=Ae(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=Ae(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Je(t),l=-n.scrollTop;return"rtl"===Se(s||i).direction&&(a+=Ae(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}($e(t)))}function si(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?we(s):null,r=s?Be(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case Vt:e={x:a,y:i.y-n.height};break;case Kt:e={x:a,y:i.y+i.height};break;case Qt:e={x:i.x+i.width,y:l};break;case Xt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?je(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case Gt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Jt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function oi(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?Zt:a,c=i.rootBoundary,h=void 0===c?te:c,d=i.elementContext,u=void 0===d?ee:d,f=i.altBoundary,p=void 0!==f&&f,m=i.padding,g=void 0===m?0:m,_=Fe("number"!=typeof g?g:He(g,Ut)),b=u===ee?ie:ee,v=t.rects.popper,y=t.elements[p?b:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=ei(Ie(t)),i=["absolute","fixed"].indexOf(Se(t).position)>=0&&be(t)?Pe(t):t;return _e(i)?e.filter(function(t){return _e(t)&&Le(t,i)&&"body"!==me(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=ni(t,i,n);return e.top=Ae(s.top,e.top),e.right=Ee(s.right,e.right),e.bottom=Ee(s.bottom,e.bottom),e.left=Ae(s.left,e.left),e},ni(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(_e(y)?y:y.contextElement||$e(t.elements.popper),l,h,r),A=xe(t.elements.reference),E=si({reference:A,element:v,placement:s}),T=ii(Object.assign({},v,E)),C=u===ee?T:A,O={top:w.top-C.top+_.top,bottom:C.bottom-w.bottom+_.bottom,left:w.left-C.left+_.left,right:C.right-w.right+_.right},x=t.modifiersData.offset;if(u===ee&&x){var k=x[s];Object.keys(O).forEach(function(t){var e=[Qt,Kt].indexOf(t)>=0?1:-1,i=[Vt,Kt].indexOf(t)>=0?"y":"x";O[t]+=k[i]*e})}return O}function ri(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?se:l,h=Be(n),d=h?a?ne:ne.filter(function(t){return Be(t)===h}):Ut,u=d.filter(function(t){return c.indexOf(t)>=0});0===u.length&&(u=d);var f=u.reduce(function(e,i){return e[i]=oi(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[we(i)],e},{});return Object.keys(f).sort(function(t,e){return f[t]-f[e]})}const ai={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,m=i.allowedAutoPlacements,g=e.options.placement,_=we(g),b=l||(_!==g&&p?function(t){if(we(t)===Yt)return[];var e=Xe(t);return[Ue(t),e,Ue(e)]}(g):[Xe(g)]),v=[g].concat(b).reduce(function(t,i){return t.concat(we(i)===Yt?ri(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):i)},[]),y=e.rects.reference,w=e.rects.popper,A=new Map,E=!0,T=v[0],C=0;C<v.length;C++){var O=v[C],x=we(O),k=Be(O)===Gt,L=[Vt,Kt].indexOf(x)>=0,S=L?"width":"height",D=oi(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),$=L?k?Qt:Xt:k?Kt:Vt;y[S]>w[S]&&($=Xe($));var I=Xe($),N=[];if(o&&N.push(D[x]<=0),a&&N.push(D[$]<=0,D[I]<=0),N.every(function(t){return t})){T=O,E=!1;break}A.set(O,N)}if(E)for(var P=function(t){var e=v.find(function(e){var i=A.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return T=e,"break"},j=p?3:1;j>0&&"break"!==P(j);j--);e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function li(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function ci(t){return[Vt,Qt,Kt,Xt].some(function(e){return t[e]>=0})}const hi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=oi(e,{elementContext:"reference"}),a=oi(e,{altBoundary:!0}),l=li(r,n),c=li(a,s,o),h=ci(l),d=ci(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},di={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=se.reduce(function(t,i){return t[i]=function(t,e,i){var n=we(t),s=[Xt,Vt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Xt,Qt].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t},{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}},ui={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=si({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},fi={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,m=void 0===p?0:p,g=oi(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),_=we(e.placement),b=Be(e.placement),v=!b,y=je(_),w="x"===y?"y":"x",A=e.modifiersData.popperOffsets,E=e.rects.reference,T=e.rects.popper,C="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),x=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(A){if(o){var L,S="y"===y?Vt:Xt,D="y"===y?Kt:Qt,$="y"===y?"height":"width",I=A[y],N=I+g[S],P=I-g[D],j=f?-T[$]/2:0,M=b===Gt?E[$]:T[$],F=b===Gt?-T[$]:-E[$],H=e.elements.arrow,W=f&&H?ke(H):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[S],R=B[D],q=Me(0,E[$],W[$]),V=v?E[$]/2-j-q-z-O.mainAxis:M-q-z-O.mainAxis,K=v?-E[$]/2+j+q+R+O.mainAxis:F+q+R+O.mainAxis,Q=e.elements.arrow&&Pe(e.elements.arrow),X=Q?"y"===y?Q.clientTop||0:Q.clientLeft||0:0,Y=null!=(L=null==x?void 0:x[y])?L:0,U=I+K-Y,G=Me(f?Ee(N,I+V-Y-X):N,I,f?Ae(P,U):P);A[y]=G,k[y]=G-I}if(a){var J,Z="x"===y?Vt:Xt,tt="x"===y?Kt:Qt,et=A[w],it="y"===w?"height":"width",nt=et+g[Z],st=et-g[tt],ot=-1!==[Vt,Xt].indexOf(_),rt=null!=(J=null==x?void 0:x[w])?J:0,at=ot?nt:et-E[it]-T[it]-rt+O.altAxis,lt=ot?et+E[it]+T[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=Me(t,e,i);return n>i?i:n}(at,et,lt):Me(f?at:nt,et,f?lt:st);A[w]=ct,k[w]=ct-et}e.modifiersData[n]=k}},requiresIfExists:["offset"]};function pi(t,e,i){void 0===i&&(i=!1);var n,s,o=be(e),r=be(e)&&function(t){var e=t.getBoundingClientRect(),i=Te(e.width)/t.offsetWidth||1,n=Te(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=$e(e),l=xe(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==me(e)||Ze(a))&&(c=(n=e)!==ge(n)&&be(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Ge(n)),be(e)?((h=xe(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Je(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function mi(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var gi={placement:"bottom",modifiers:[],strategy:"absolute"};function _i(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function bi(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,s=e.defaultOptions,o=void 0===s?gi:s;return function(t,e,i){void 0===i&&(i=o);var s,r,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},gi,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,h={state:a,setOptions:function(i){var s="function"==typeof i?i(a.options):i;d(),a.options=Object.assign({},o,a.options,s),a.scrollParents={reference:_e(t)?ei(t):t.contextElement?ei(t.contextElement):[],popper:ei(e)};var r,c,u=function(t){var e=mi(t);return pe.reduce(function(t,i){return t.concat(e.filter(function(t){return t.phase===i}))},[])}((r=[].concat(n,a.options.modifiers),c=r.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),Object.keys(c).map(function(t){return c[t]})));return a.orderedModifiers=u.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,s=t.effect;if("function"==typeof s){var o=s({state:a,name:e,instance:h,options:n});l.push(o||function(){})}}),h.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,i=t.popper;if(_i(e,i)){a.rects={reference:pi(e,Pe(i),"fixed"===a.options.strategy),popper:ke(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var s=a.orderedModifiers[n],o=s.fn,r=s.options,l=void 0===r?{}:r,d=s.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:h})||a)}else a.reset=!1,n=-1}}},update:(s=function(){return new Promise(function(t){h.forceUpdate(),t(a)})},function(){return r||(r=new Promise(function(t){Promise.resolve().then(function(){r=void 0,t(s())})})),r}),destroy:function(){d(),c=!0}};if(!_i(t,e))return h;function d(){l.forEach(function(t){return t()}),l=[]}return h.setOptions(i).then(function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)}),h}}var vi=bi(),yi=bi({defaultModifiers:[Ke,ui,qe,ye]}),wi=bi({defaultModifiers:[Ke,ui,qe,ye,di,ai,fi,We,hi]});const Ai=Object.freeze(Object.defineProperty({__proto__:null,afterMain:he,afterRead:ae,afterWrite:fe,applyStyles:ye,arrow:We,auto:Yt,basePlacements:Ut,beforeMain:le,beforeRead:oe,beforeWrite:de,bottom:Kt,clippingParents:Zt,computeStyles:qe,createPopper:wi,createPopperBase:vi,createPopperLite:yi,detectOverflow:oi,end:Jt,eventListeners:Ke,flip:ai,hide:hi,left:Xt,main:ce,modifierPhases:pe,offset:di,placements:se,popper:ee,popperGenerator:bi,popperOffsets:ui,preventOverflow:fi,read:re,reference:ie,right:Qt,start:Gt,top:Vt,variationPlacements:ne,viewport:te,write:ue},Symbol.toStringTag,{value:"Module"})),Ei="dropdown",Ti=".bs.dropdown",Ci=".data-api",Oi="ArrowUp",xi="ArrowDown",ki=`hide${Ti}`,Li=`hidden${Ti}`,Si=`show${Ti}`,Di=`shown${Ti}`,$i=`click${Ti}${Ci}`,Ii=`keydown${Ti}${Ci}`,Ni=`keyup${Ti}${Ci}`,Pi="show",ji='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Mi=`${ji}.${Pi}`,Fi=".dropdown-menu",Hi=m()?"top-end":"top-start",Wi=m()?"top-start":"top-end",Bi=m()?"bottom-end":"bottom-start",zi=m()?"bottom-start":"bottom-end",Ri=m()?"left-start":"right-start",qi=m()?"right-start":"left-start",Vi={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Ki={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Qi extends B{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=R.next(this._element,Fi)[0]||R.prev(this._element,Fi)[0]||R.findOne(Fi,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Vi}static get DefaultType(){return Ki}static get NAME(){return Ei}toggle(){return this._isShown()?this.hide():this.show()}show(){if(c(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!P.trigger(this._element,Si,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))P.on(t,"mouseover",d);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Pi),this._element.classList.add(Pi),P.trigger(this._element,Di,t)}}hide(){if(c(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!P.trigger(this._element,ki,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))P.off(t,"mouseover",d);this._popper&&this._popper.destroy(),this._menu.classList.remove(Pi),this._element.classList.remove(Pi),this._element.setAttribute("aria-expanded","false"),H.removeDataAttribute(this._menu,"popper"),P.trigger(this._element,Li,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!r(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Ei.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===Ai)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let t=this._element;"parent"===this._config.reference?t=this._parent:r(this._config.reference)?t=a(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=wi(t,this._menu,e)}_isShown(){return this._menu.classList.contains(Pi)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return Ri;if(t.classList.contains("dropstart"))return qi;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?Wi:Hi:e?zi:Bi}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(H.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,..._(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=R.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>l(t));i.length&&v(i,e,t===xi,!i.includes(e)).focus()}static jQueryInterface(t){return this.each(function(){const e=Qi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=R.find(Mi);for(const i of e){const e=Qi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Oi,xi].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(ji)?this:R.prev(this,ji)[0]||R.next(this,ji)[0]||R.findOne(ji,t.delegateTarget.parentNode),o=Qi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}P.on(document,Ii,ji,Qi.dataApiKeydownHandler),P.on(document,Ii,Fi,Qi.dataApiKeydownHandler),P.on(document,$i,Qi.clearMenus),P.on(document,Ni,Qi.clearMenus),P.on(document,$i,ji,function(t){t.preventDefault(),Qi.getOrCreateInstance(this).toggle()}),g(Qi);const Xi="backdrop",Yi="show",Ui=`mousedown.bs.${Xi}`,Gi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ji={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Zi extends W{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Gi}static get DefaultType(){return Ji}static get NAME(){return Xi}show(t){if(!this._config.isVisible)return void _(t);this._append();const e=this._getElement();this._config.isAnimated&&u(e),e.classList.add(Yi),this._emulateAnimation(()=>{_(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(Yi),this._emulateAnimation(()=>{this.dispose(),_(t)})):_(t)}dispose(){this._isAppended&&(P.off(this._element,Ui),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=a(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),P.on(t,Ui,()=>{_(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){b(t,this._getElement(),this._config.isAnimated)}}const tn=".bs.focustrap",en=`focusin${tn}`,nn=`keydown.tab${tn}`,sn="backward",on={autofocus:!0,trapElement:null},rn={autofocus:"boolean",trapElement:"element"};class an extends W{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return on}static get DefaultType(){return rn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),P.off(document,tn),P.on(document,en,t=>this._handleFocusin(t)),P.on(document,nn,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,P.off(document,tn))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=R.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===sn?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?sn:"forward")}}const ln=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",cn=".sticky-top",hn="padding-right",dn="margin-right";class un{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,hn,e=>e+t),this._setElementAttributes(ln,hn,e=>e+t),this._setElementAttributes(cn,dn,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,hn),this._resetElementAttributes(ln,hn),this._resetElementAttributes(cn,dn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)})}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&H.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const i=H.getDataAttribute(t,e);null!==i?(H.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(r(t))e(t);else for(const i of R.find(t,this._element))e(i)}}const fn=".bs.modal",pn=`hide${fn}`,mn=`hidePrevented${fn}`,gn=`hidden${fn}`,_n=`show${fn}`,bn=`shown${fn}`,vn=`resize${fn}`,yn=`click.dismiss${fn}`,wn=`mousedown.dismiss${fn}`,An=`keydown.dismiss${fn}`,En=`click${fn}.data-api`,Tn="modal-open",Cn="show",On="modal-static",xn={backdrop:!0,focus:!0,keyboard:!0},kn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ln extends B{constructor(t,e){super(t,e),this._dialog=R.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new un,this._addEventListeners()}static get Default(){return xn}static get DefaultType(){return kn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||P.trigger(this._element,_n,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Tn),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){this._isShown&&!this._isTransitioning&&(P.trigger(this._element,pn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Cn),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){P.off(window,fn),P.off(this._dialog,fn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Zi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new an({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=R.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),u(this._element),this._element.classList.add(Cn),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,P.trigger(this._element,bn,{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){P.on(this._element,An,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),P.on(window,vn,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),P.on(this._element,wn,t=>{P.one(this._element,yn,e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Tn),this._resetAdjustments(),this._scrollBar.reset(),P.trigger(this._element,gn)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(P.trigger(this._element,mn).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(On)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(On),this._queueCallback(()=>{this._element.classList.remove(On),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=m()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=m()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each(function(){const i=Ln.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}})}}P.on(document,En,'[data-bs-toggle="modal"]',function(t){const e=R.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),P.one(e,_n,t=>{t.defaultPrevented||P.one(e,gn,()=>{l(this)&&this.focus()})});const i=R.findOne(".modal.show");i&&Ln.getInstance(i).hide(),Ln.getOrCreateInstance(e).toggle(this)}),q(Ln),g(Ln);const Sn=".bs.offcanvas",Dn=".data-api",$n=`load${Sn}${Dn}`,In="show",Nn="showing",Pn="hiding",jn=".offcanvas.show",Mn=`show${Sn}`,Fn=`shown${Sn}`,Hn=`hide${Sn}`,Wn=`hidePrevented${Sn}`,Bn=`hidden${Sn}`,zn=`resize${Sn}`,Rn=`click${Sn}${Dn}`,qn=`keydown.dismiss${Sn}`,Vn={backdrop:!0,keyboard:!0,scroll:!1},Kn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Qn extends B{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Vn}static get DefaultType(){return Kn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||P.trigger(this._element,Mn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new un).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Nn),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(In),this._element.classList.remove(Nn),P.trigger(this._element,Fn,{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&(P.trigger(this._element,Hn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Pn),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(In,Pn),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new un).reset(),P.trigger(this._element,Bn)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Zi({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():P.trigger(this._element,Wn)}:null})}_initializeFocusTrap(){return new an({trapElement:this._element})}_addEventListeners(){P.on(this._element,qn,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():P.trigger(this._element,Wn))})}static jQueryInterface(t){return this.each(function(){const e=Qn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}P.on(document,Rn,'[data-bs-toggle="offcanvas"]',function(t){const e=R.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),c(this))return;P.one(e,Bn,()=>{l(this)&&this.focus()});const i=R.findOne(jn);i&&i!==e&&Qn.getInstance(i).hide(),Qn.getOrCreateInstance(e).toggle(this)}),P.on(window,$n,()=>{for(const t of R.find(jn))Qn.getOrCreateInstance(t).show()}),P.on(window,zn,()=>{for(const t of R.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Qn.getOrCreateInstance(t).hide()}),q(Qn),g(Qn);const Xn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Yn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Un=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Gn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Yn.has(i)||Boolean(Un.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(i))},Jn={allowList:Xn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Zn={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},ts={entry:"(string|element|function|null)",selector:"(string|element)"};class es extends W{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Jn}static get DefaultType(){return Zn}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},ts)}_setContent(t,e,i){const n=R.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?r(e)?this._putElementInTemplate(a(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Gn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return _(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const is=new Set(["sanitize","allowList","sanitizeFn"]),ns="fade",ss="show",os=".tooltip-inner",rs=".modal",as="hide.bs.modal",ls="hover",cs="focus",hs="click",ds={AUTO:"auto",TOP:"top",RIGHT:m()?"left":"right",BOTTOM:"bottom",LEFT:m()?"right":"left"},us={allowList:Xn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},fs={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class ps extends B{constructor(t,e){if(void 0===Ai)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return us}static get DefaultType(){return fs}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),P.off(this._element.closest(rs),as,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=P.trigger(this._element,this.constructor.eventName("show")),e=(h(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),P.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(ss),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))P.on(t,"mouseover",d);this._queueCallback(()=>{P.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!P.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(ss),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))P.off(t,"mouseover",d);this._activeTrigger[hs]=!1,this._activeTrigger[cs]=!1,this._activeTrigger[ls]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),P.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ns,ss),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ns),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new es({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[os]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ns)}_isShown(){return this.tip&&this.tip.classList.contains(ss)}_createPopper(t){const e=_(this._config.placement,[this,t,this._element]),i=ds[e.toUpperCase()];return wi(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return _(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,..._(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)P.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[hs]=!(e._isShown()&&e._activeTrigger[hs]),e.toggle()});else if("manual"!==e){const t=e===ls?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===ls?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");P.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?cs:ls]=!0,e._enter()}),P.on(this._element,i,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?cs:ls]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},P.on(this._element.closest(rs),as,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=H.getDataAttributes(this._element);for(const t of Object.keys(e))is.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:a(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const e=ps.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}g(ps);const ms=".popover-header",gs=".popover-body",_s={...ps.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},bs={...ps.DefaultType,content:"(null|string|element|function)"};class vs extends ps{static get Default(){return _s}static get DefaultType(){return bs}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[ms]:this._getTitle(),[gs]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const e=vs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}g(vs);const ys=".bs.scrollspy",ws=`activate${ys}`,As=`click${ys}`,Es=`load${ys}.data-api`,Ts="active",Cs="[href]",Os=".nav-link",xs=`${Os}, .nav-item > ${Os}, .list-group-item`,ks={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ls={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ss extends B{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ks}static get DefaultType(){return Ls}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=a(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(P.off(this._config.target,As),P.on(this._config.target,As,Cs,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=R.find(Cs,this._config.target);for(const e of t){if(!e.hash||c(e))continue;const t=R.findOne(decodeURI(e.hash),this._element);l(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Ts),this._activateParents(t),P.trigger(this._element,ws,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))R.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(Ts);else for(const e of R.parents(t,".nav, .list-group"))for(const t of R.prev(e,xs))t.classList.add(Ts)}_clearActiveClass(t){t.classList.remove(Ts);const e=R.find(`${Cs}.${Ts}`,t);for(const t of e)t.classList.remove(Ts)}static jQueryInterface(t){return this.each(function(){const e=Ss.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}P.on(window,Es,()=>{for(const t of R.find('[data-bs-spy="scroll"]'))Ss.getOrCreateInstance(t)}),g(Ss);const Ds=".bs.tab",$s=`hide${Ds}`,Is=`hidden${Ds}`,Ns=`show${Ds}`,Ps=`shown${Ds}`,js=`click${Ds}`,Ms=`keydown${Ds}`,Fs=`load${Ds}`,Hs="ArrowLeft",Ws="ArrowRight",Bs="ArrowUp",zs="ArrowDown",Rs="Home",qs="End",Vs="active",Ks="fade",Qs="show",Xs=".dropdown-toggle",Ys=`:not(${Xs})`,Us='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Gs=`.nav-link${Ys}, .list-group-item${Ys}, [role="tab"]${Ys}, ${Us}`,Js=`.${Vs}[data-bs-toggle="tab"], .${Vs}[data-bs-toggle="pill"], .${Vs}[data-bs-toggle="list"]`;class Zs extends B{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),P.on(this._element,Ms,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?P.trigger(e,$s,{relatedTarget:t}):null;P.trigger(t,Ns,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(Vs),this._activate(R.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),P.trigger(t,Ps,{relatedTarget:e})):t.classList.add(Qs)},t,t.classList.contains(Ks)))}_deactivate(t,e){t&&(t.classList.remove(Vs),t.blur(),this._deactivate(R.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),P.trigger(t,Is,{relatedTarget:e})):t.classList.remove(Qs)},t,t.classList.contains(Ks)))}_keydown(t){if(![Hs,Ws,Bs,zs,Rs,qs].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!c(t));let i;if([Rs,qs].includes(t.key))i=e[t.key===Rs?0:e.length-1];else{const n=[Ws,zs].includes(t.key);i=v(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Zs.getOrCreateInstance(i).show())}_getChildren(){return R.find(Gs,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=R.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=R.findOne(t,i);s&&s.classList.toggle(n,e)};n(Xs,Vs),n(".dropdown-menu",Qs),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Vs)}_getInnerElement(t){return t.matches(Gs)?t:R.findOne(Gs,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each(function(){const e=Zs.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}P.on(document,js,Us,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),c(this)||Zs.getOrCreateInstance(this).show()}),P.on(window,Fs,()=>{for(const t of R.find(Js))Zs.getOrCreateInstance(t)}),g(Zs);const to=".bs.toast",eo=`mouseover${to}`,io=`mouseout${to}`,no=`focusin${to}`,so=`focusout${to}`,oo=`hide${to}`,ro=`hidden${to}`,ao=`show${to}`,lo=`shown${to}`,co="hide",ho="show",uo="showing",fo={animation:"boolean",autohide:"boolean",delay:"number"},po={animation:!0,autohide:!0,delay:5e3};class mo extends B{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return po}static get DefaultType(){return fo}static get NAME(){return"toast"}show(){P.trigger(this._element,ao).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(co),u(this._element),this._element.classList.add(ho,uo),this._queueCallback(()=>{this._element.classList.remove(uo),P.trigger(this._element,lo),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(P.trigger(this._element,oo).defaultPrevented||(this._element.classList.add(uo),this._queueCallback(()=>{this._element.classList.add(co),this._element.classList.remove(uo,ho),P.trigger(this._element,ro)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(ho),super.dispose()}isShown(){return this._element.classList.contains(ho)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){P.on(this._element,eo,t=>this._onInteraction(t,!0)),P.on(this._element,io,t=>this._onInteraction(t,!1)),P.on(this._element,no,t=>this._onInteraction(t,!0)),P.on(this._element,so,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const e=mo.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}})}}return q(mo),g(mo),{Alert:X,Button:U,Carousel:St,Collapse:qt,Dropdown:Qi,Modal:Ln,Offcanvas:Qn,Popover:vs,ScrollSpy:Ss,Tab:Zs,Toast:mo,Tooltip:ps}});
vendor: 8,084 bytes, lines 26-27
26 27!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.o
vendor: 3,442 bytes, line 27
27ptions.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
27slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:
27parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
27,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0}
vendor: 5,619 bytes, line 27
27,100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};
27!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}
27):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+
27o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
vendor: 6,117 bytes, lines 27-36
27,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}}); 28; 29/* 30 * anime.js v3.2.2 31 * (c) 2023 Julian Garnier 32 * Released under the MIT license 33 * animejs.com 34 */ 35 36!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):n.anime=e()}(this,function(){"use strict";var i={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},M={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},j=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],l={CSS:{},springs:{}};function C(n,e,t){return Math.min(Math.max(n,e),t)}function u(n,e){return-1<n.indexOf(e)}function o(n,e){return n.apply(null,e)}var w={arr:function(n){return Array.isArray(n)},obj:function(n){return u(Object.prototype.toString.call(n),"Object")},pth:function(n){return w.obj(n)&&n.hasOwnProperty("totalLength")},svg:function(n){return n instanceof SVGElement},inp:function(n){return n instanceof HTMLInputElement},dom:function(n){return n.nodeType||w.svg(n)},str:function(n){return"string"==typeof n},fnc:function(n){return"function"==typeof n},und:function(n){return void 0===n},nil:function(n){return w.und(n)||null===n},hex:function(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)},rgb:function(n){return/^rgb/.test(n)},hsl:function(n){return/^hsl/.test(n)},col:function(n){return w.hex(n)||w.rgb(n)||w.hsl(n)},key:function(n){return!i.hasOwnProperty(n)&&!M.hasOwnProperty(n)&&"targets"!==n&&"keyframes"!==n}};function d(n){n=/\(([^)]+)\)/.exec(n);return n?n[1].split(",").map(function(n){return parseFloat(n)}):[]}function c(r,t){var n=d(r),e=C(w.und(n[0])?1:n[0],.1,100),a=C(w.und(n[1])?100:n[1],.1,100),o=C(w.und(n[2])?10:n[2],.1,100),n=C(w.und(n[3])?0:n[3],.1,100),u=Math.sqrt(a/e),i=o/(2*Math.sqrt(a*e)),c=i<1?u*Math.sqrt(1-i*i):0,s=i<1?(i*u-n)/c:-n+u;function f(n){var e=t?t*n/1e3:n,e=i<1?Math.exp(-e*i*u)*(+Math.cos(c*e)+s*Math.sin(c*e)):(1+s*e)*Math.exp(-e*u);return 0===n||1===n?n:1-e}return t?f:function(){var n=l.springs[r];if(n)return n;for(var e=0,t=0;;)if(1===f(e+=1/6)){if(16<=++t)break}else t=0;return n=e*(1/6)*1e3,l.springs[r]=n}}function q(e){return void 0===e&&(e=10),function(n){return Math.ceil(C(n,1e-6,1)*e)*(1/e)}}var H=function(b,e,M,t){if(0<=b&&b<=1&&0<=M&&M<=1){var x=new Float32Array(11);if(b!==e||M!==t)for(var n=0;n<11;++n)x[n]=k(.1*n,b,M);return function(n){return b===e&&M===t||0===n||1===n?n:k(r(n),e,t)}}function r(n){for(var e=0,t=1;10!==t&&x[t]<=n;++t)e+=.1;var r=e+.1*((n-x[--t])/(x[t+1]-x[t])),a=O(r,b,M);if(.001<=a){for(var o=n,u=r,i=b,c=M,s=0;s<4;++s){var f=O(u,i,c);if(0===f)return u;u-=(k(u,i,c)-o)/f}return u}if(0===a)return r;for(var l,d,p=n,h=e,g=e+.1,m=b,v=M,y=0;0<(l=k(d=h+(g-h)/2,m,v)-p)?g=d:h=d,1e-7<Math.abs(l)&&++y<10;);return d}};function r(n,e){return 1-3*e+3*n}function k(n,e,t){return((r(e,t)*n+(3*t-6*e))*n+3*e)*n}function O(n,e,t){return 3*r(e,t)*n*n+2*(3*t-6*e)*n+3*e}e={linear:function(){return function(n){return n}}},t={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Expo:function(){return function(n){return n?Math.pow(2,10*n-10):0}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var e,t=4;n<((e=Math.pow(2,--t))-1)/11;);return 1/Math.pow(4,3-t)-7.5625*Math.pow((3*e-2)/22-n,2)}},Elastic:function(n,e){void 0===e&&(e=.5);var t=C(n=void 0===n?1:n,1,10),r=C(e,.1,2);return function(n){return 0===n||1===n?n:-t*Math.pow(2,10*(n-1))*Math.sin((n-1-r/(2*Math.PI)*Math.asin(1/t))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint"].forEach(function(n,e){t[n]=function(){return function(n){return Math.pow(n,e+2)}}}),Object.keys(t).forEach(function(n){var r=t[n];e["easeIn"+n]=r,e["easeOut"+n]=function(e,t){return function(n){return 1-r(e,t)(1-n)}},e["easeInOut"+n]=function(e,t){return function(n){return n<.5?r(e,t)(2*n)/2:1-r(e,t)(-2*n+2)/2}},e["easeOutIn"+n]=function(e,t){return function(n){return n<.5?(1-r(e,t)(1-2*n))/2:(r(e,t)(2*n-1)+1)/2}}});var e,t,s=e;function P(n,e){if(w.fnc(n))return n;var t=n.split("(")[0],r=s[t],a=d(n);switch(t){case"spring":return c(n,e);case"cubicBezier":return o(H,a);case"steps":return o(q,a);default:return o(r,a)}}function a(n){try{return document.querySelectorAll(n)}catch(n){}}function I(n,e){for(var t,r=n.length,a=2<=arguments.length?e:void 0,o=[],u=0;u<r;
36u++)u in n&&(t=n[u],e.call(a,t,u,n))&&o.push(t);return o}function f(n){return n.reduce(function(n,e){return n.concat(w.arr(e)?f(e):e)},[])}function p(n){return w.arr(n)?n:(n=w.str(n)?a(n)||n:n)instanceof NodeList||n instanceof HTMLCollection?[].slice.call(n):[n]}function h(n,e){return n.some(function(n){return n===e})}function g(n){var e,t={};for(e in n)t[e]=n[e];return t}function x(n,e){var t,r=g(n);for(t in n)r[t]=(e.hasOwnProperty(t)?e:n)[t];return r}function D(n,e){var t,r=g(n);for(t in e)r[t]=(w.und(n[t])?e:n)[t];return r}function V(n){var e,t,r,a,o,u,i;return w.rgb(n)?(e=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t=n))?"rgba("+e[1]+",1)":t:w.hex(n)?(e=(e=n).replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(n,e,t,r){return e+e+t+t+r+r}),e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),"rgba("+parseInt(e[1],16)+","+parseInt(e[2],16)+","+parseInt(e[3],16)+",1)"):w.hsl(n)?(t=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t=n)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),n=parseInt(t[1],10)/360,u=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,t=t[4]||1,0==u?r=a=o=i:(r=c(u=2*i-(i=i<.5?i*(1+u):i+u-i*u),i,n+1/3),a=c(u,i,n),o=c(u,i,n-1/3)),"rgba("+255*r+","+255*a+","+255*o+","+t+")"):void 0;function c(n,e,t){return t<0&&(t+=1),1<t&&--t,t<1/6?n+6*(e-n)*t:t<.5?e:t<2/3?n+(e-n)*(2/3-t)*6:n}}function B(n){n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(n);if(n)return n[1]}function m(n,e){return w.fnc(n)?n(e.target,e.id,e.total):n}function v(n,e){return n.getAttribute(e)}function y(n,e,t){var r,a,o;return h([t,"deg","rad","turn"],B(e))?e:(r=l.CSS[e+t],w.und(r)?(a=document.createElement(n.tagName),(n=n.parentNode&&n.parentNode!==document?n.parentNode:document.body).appendChild(a),a.style.position="absolute",a.style.width=100+t,o=100/a.offsetWidth,n.removeChild(a),n=o*parseFloat(e),l.CSS[e+t]=n):r)}function $(n,e,t){var r;if(e in n.style)return r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e=n.style[e]||getComputedStyle(n).getPropertyValue(r)||"0",t?y(n,e,t):e}function b(n,e){return w.dom(n)&&!w.inp(n)&&(!w.nil(v(n,e))||w.svg(n)&&n[e])?"attribute":w.dom(n)&&h(j,e)?"transform":w.dom(n)&&"transform"!==e&&$(n,e)?"css":null!=n[e]?"object":void 0}function W(n){if(w.dom(n)){for(var e,t=n.style.transform||"",r=/(\w+)\(([^)]*)\)/g,a=new Map;e=r.exec(t);)a.set(e[1],e[2]);return a}}function X(n,e,t,r){var a=u(e,"scale")?1:0+(u(a=e,"translate")||"perspective"===a?"px":u(a,"rotate")||u(a,"skew")?"deg":void 0),o=W(n).get(e)||a;return t&&(t.transforms.list.set(e,o),t.transforms.last=e),r?y(n,o,r):o}function T(n,e,t,r){switch(b(n,e)){case"transform":return X(n,e,r,t);case"css":return $(n,e,t);case"attribute":return v(n,e);default:return n[e]||0}}function E(n,e){var t=/^(\*=|\+=|-=)/.exec(n);if(!t)return n;var r=B(n)||0,a=parseFloat(e),o=parseFloat(n.replace(t[0],""));switch(t[0][0]){case"+":return a+o+r;case"-":return a-o+r;case"*":return a*o+r}}function Y(n,e){var t;return w.col(n)?V(n):/\s/g.test(n)?n:(t=(t=B(n))?n.substr(0,n.length-t.length):n,e?t+e:t)}function F(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Z(n){for(var e,t=n.points,r=0,a=0;a<t.numberOfItems;a++){var o=t.getItem(a);0<a&&(r+=F(e,o)),e=o}return r}function G(n){if(n.getTotalLength)return n.getTotalLength();switch(n.tagName.toLowerCase()){case"circle":return 2*Math.PI*v(n,"r");case"rect":return 2*v(t=n,"width")+2*v(t,"height");case"line":return F({x:v(t=n,"x1"),y:v(t,"y1")},{x:v(t,"x2"),y:v(t,"y2")});case"polyline":return Z(n);case"polygon":return e=n.points,Z(n)+F(e.getItem(e.numberOfItems-1),e.getItem(0))}var e,t}function Q(n,e){var e=e||{},n=e.el||function(n){for(var e=n.parentNode;w.svg(e)&&w.svg(e.parentNode);)e=e.parentNode;return e}(n),t=n.getBoundingClientRect(),r=v(n,"viewBox"),a=t.width,t=t.height,e=e.viewBox||(r?r.split(" "):[0,0,a,t]);return{el:n,viewBox:e,x:+e[0],y:+e[1],w:a,h:t,vW:e[2],vH:e[3]}}function z(n,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=Y(w.pth(n)?n.totalLength:n,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:w.str(n)||e?r.split(t):[]}}function A(n){return I(n?f(w.arr(n)?n.map(p):p(n)):[],function(n,e,t){return t.indexOf(n)===e})}function _(n){var t=A(n);return t.map(function(n,e){return{target:n,id:e,total:t.length,transforms:{list:W(n)}}})}function R(e){for(var t=I(f(e.map(function(n){return Object.keys(n)})),function(n){return w.key(n)}).reduce(function(n,e){return n.indexOf(e)<0&&n.push(e),n},[]),a={},n=0;n<t.length;n++)!function(n){var r=t[n];a[r]=e.map(function(n){var e,t={};for(e in n)w.key(e)?e==r&&(t.value=n[e]):t[e]=n[e];return t})}(n);return a}function J(n,e){var t,r=[],a=e.keyframes;for(t in e=a?D(R(a),e):e)w.key(t)&&r.push({name:t,tweens:function(n,t){var e,r=g(t),a=(/^spring/.test(r.easing)&&(r.duration=c(r.easing)),w.arr(n)&&(2===(e=n.length)&&!w.obj(n[0])?n={value:n}:w.fnc(t.duration)||(r.duration=t.duration/e)),w.arr(n)?n:[n]);return a.map(function(n,e){n=w.obj(n)&&!w.pth(n)?n:{value:n};return w.und(n.delay)&&(n.delay=e?0:t.delay),w.und(n.endDelay)&&(n.endDelay=e===a.length-1?t.endDelay:0),n}).map(function(n){return D(n,r)})}(e[t],n)});return r}function K(i,c){var s;return i.tweens.map(function(n){var n=function(n,e){var t,r={};for(t in n){var a=m(n[t],e);w.arr(a)&&1===(a=a.map(function(n){return m(n,e)})).length&&(a=a[0]),r[t]=a}return r.duration=parseFloat(r.duration),r.delay=parseFloat(r.delay),r}(n,c),e=n.value,t=w.arr(e)?e[1]:e,r=B(t),a=T(c.target,i.name,r,c),o=s?s.to.original:a,u=w.arr(e)?e[0]:o,a=B(u)||B(a),r
36=r||a;return w.und(t)&&(t=o),n.from=z(u,r),n.to=z(E(t,u),r),n.start=s?s.end:0,n.end=n.start+n.delay+n.duration+n.endDelay,n.easing=P(n.easing,n.duration),n.isPath=w.pth(e),n.isPathTargetInsideSVG=n.isPath&&w.svg(c.target),n.isColor=w.col(n.from.original),n.isColor&&(n.round=1),s=n})}var U={css:function(n,e,t){return n.style[e]=t},attribute:function(n,e,t){return n.setAttribute(e,t)},object:function(n,e,t){return n[e]=t},transform:function(n,e,t,r,a){var o;r.list.set(e,t),e!==r.last&&!a||(o="",r.list.forEach(function(n,e){o+=e+"("+n+") "}),n.style.transform=o)}};function nn(n,u){_(n).forEach(function(n){for(var e in u){var t=m(u[e],n),r=n.target,a=B(t),o=T(r,e,a,n),t=E(Y(t,a||B(o)),o),a=b(r,e);U[a](r,e,t,n.transforms,!0)}})}function en(n,e){return I(f(n.map(function(o){return e.map(function(n){var e,t,r=o,a=b(r.target,n.name);if(a)return t=(e=K(n,r))[e.length-1],{type:a,property:n.name,animatable:r,tweens:e,duration:t.end,delay:e[0].delay,endDelay:t.endDelay}})})),function(n){return!w.und(n)})}function tn(n,e){function t(n){return n.timelineOffset||0}var r=n.length,a={};return a.duration=r?Math.max.apply(Math,n.map(function(n){return t(n)+n.duration})):e.duration,a.delay=r?Math.min.apply(Math,n.map(function(n){return t(n)+n.delay})):e.delay,a.endDelay=r?a.duration-Math.max.apply(Math,n.map(function(n){return t(n)+n.duration-n.endDelay})):e.endDelay,a}var rn=0;var N,S=[],an=("undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){L.suspendWhenDocumentHidden&&(n()?N=cancelAnimationFrame(N):(S.forEach(function(n){return n._onDocumentVisibility()}),an()))}),function(){!(N||n()&&L.suspendWhenDocumentHidden)&&0<S.length&&(N=requestAnimationFrame(on))});function on(n){for(var e=S.length,t=0;t<e;){var r=S[t];r.paused?(S.splice(t,1),e--):(r.tick(n),t++)}N=0<t?requestAnimationFrame(on):void 0}function n(){return document&&document.hidden}function L(n){var c,s=0,f=0,l=0,d=0,p=null;function h(n){var e=window.Promise&&new Promise(function(n){return p=n});return n.finished=e}e=x(i,n=n=void 0===n?{}:n),t=J(r=x(M,n),n),n=_(n.targets),r=tn(t=en(n,t),r),a=rn,rn++;var e,t,r,a,k=D(e,{id:a,children:[],animatables:n,animations:t,duration:r.duration,delay:r.delay,endDelay:r.endDelay});h(k);function g(){var n=k.direction;"alternate"!==n&&(k.direction="normal"!==n?"normal":"reverse"),k.reversed=!k.reversed,c.forEach(function(n){return n.reversed=k.reversed})}function m(n){return k.reversed?k.duration-n:n}function o(){s=0,f=m(k.currentTime)*(1/L.speed)}function v(n,e){e&&e.seek(n-e.timelineOffset)}function y(e){for(var n=0,t=k.animations,r=t.length;n<r;){for(var a=t[n],o=a.animatable,u=a.tweens,i=u.length-1,c=u[i],i=(i&&(c=I(u,function(n){return e<n.end})[0]||c),C(e-c.start-c.delay,0,c.duration)/c.duration),s=isNaN(i)?1:c.easing(i),f=c.to.strings,l=c.round,d=[],p=c.to.numbers.length,h=void 0,g=0;g<p;g++){var m=void 0,v=c.to.numbers[g],y=c.from.numbers[g]||0,m=c.isPath?function(e,t,n){function r(n){return e.el.getPointAtLength(1<=t+(n=void 0===n?0:n)?t+n:0)}var a=Q(e.el,e.svg),o=r(),u=r(-1),i=r(1),c=n?1:a.w/a.vW,s=n?1:a.h/a.vH;switch(e.property){case"x":return(o.x-a.x)*c;case"y":return(o.y-a.y)*s;case"angle":return 180*Math.atan2(i.y-u.y,i.x-u.x)/Math.PI}}(c.value,s*v,c.isPathTargetInsideSVG):y+s*(v-y);!l||c.isColor&&2<g||(m=Math.round(m*l)/l),d.push(m)}var b=f.length;if(b)for(var h=f[0],M=0;M<b;M++){f[M];var x=f[M+1],w=d[M];isNaN(w)||(h+=x?w+x:w+" ")}else h=d[0];U[a.type](o.target,a.property,h,o.transforms),a.currentValue=h,n++}}function b(n){k[n]&&!k.passThrough&&k[n](k)}function u(n){var e=k.duration,t=k.delay,r=e-k.endDelay,a=m(n);if(k.progress=C(a/e*100,0,100),k.reversePlayback=a<k.currentTime,c){var o=a;if(k.reversePlayback)for(var u=d;u--;)v(o,c[u]);else for(var i=0;i<d;i++)v(o,c[i])}!k.began&&0<k.currentTime&&(k.began=!0,b("begin")),!k.loopBegan&&0<k.currentTime&&(k.loopBegan=!0,b("loopBegin")),a<=t&&0!==k.currentTime&&y(0),(r<=a&&k.currentTime!==e||!e)&&y(e),t<a&&a<r?(k.changeBegan||(k.changeBegan=!0,k.changeCompleted=!1,b("changeBegin")),b("change"),y(a)
vendor: 1,793 bytes, line 36
36):k.changeBegan&&(k.changeCompleted=!0,k.changeBegan=!1,b("changeComplete")),k.currentTime=C(a,0,e),k.began&&b("update"),e<=n&&(f=0,k.remaining&&!0!==k.remaining&&k.remaining--,k.remaining?(s=l,b("loopComplete"),k.loopBegan=!1,"alternate"===k.direction&&g()):(k.paused=!0,k.completed||(k.completed=!0,b("loopComplete"),b("complete"),!k.passThrough&&"Promise"in window&&(p(),h(k)))))}return k.reset=function(){var n=k.direction;k.passThrough=!1,k.currentTime=0,k.progress=0,k.paused=!0,k.began=!1,k.loopBegan=!1,k.changeBegan=!1,k.completed=!1,k.changeCompleted=!1,k.reversePlayback=!1,k.reversed="reverse"===n,k.remaining=k.loop,c=k.children;for(var e=d=c.length;e--;)k.children[e].reset();(k.reversed&&!0!==k.loop||"alternate"===n&&1===k.loop)&&k.remaining++,y(k.reversed?k.duration:0)},k._onDocumentVisibility=o,k.set=function(n,e){return nn(n,e),k},k.tick=function(n){u(((l=n)+(f-(s=s||l)))*L.speed)},k.seek=function(n){u(m(n))},k.pause=function(){k.paused=!0,o()},k.play=function(){k.paused&&(k.completed&&k.reset(),k.paused=!1,S.push(k),o(),an())},k.reverse=function(){g(),k.completed=!k.reversed,o()},k.restart=function(){k.reset(),k.play()},k.remove=function(n){cn(A(n),k)},k.reset(),k.autoplay&&k.play(),k}function un(n,e){for(var t=e.length;t--;)h(n,e[t].animatable.target)&&e.splice(t,1)}function cn(n,e){var t=e.animations,r=e.children;un(n,t);for(var a=r.length;a--;){var o=r[a],u=o.animations;un(n,u),u.length||o.children.length||r.splice(a,1)}t.length||r.length||e.pause()}return L.version="3.2.1",L.speed=1,L.suspendWhenDocumentHidden=!0,L.running=S,L.remove=function(n){for(var e=A(n),t=S.length;t--;)cn(e,S[t])},L.get=T,L.set=nn,L.convertPx=y,L.path=function(n,e){var t=w.str(n)?a(n)[0]:n,r=e||100;return function(n){return{property:n,el:t,svg:Q(t),totalLength:G(t)*(r/100)}}}
36,L.setDashoffset=function(n){var e=G(n);return n.setAttribute("stroke-dasharray",e),e},L.stagger=function(n,e){var i=(e=void 0===e?{}:e).direction||"normal",c=e.easing?P(e.easing):null,s=e.grid,f=e.axis,l=e.from||0,d="first"===l,p="center"===l,h="last"===l,g=w.arr(n),m=g?parseFloat(n[0]):parseFloat(n),v=g?parseFloat(n[1]):0,y=B(g?n[1]:n)||0,b=e.start||0+(g?m:0),M=[],x=0;return function(n,e,t){if(d&&(l=0),p&&(l=(t-1)/2),h&&(l=t-1),!M.length){for(var r,a,o,u=0;u<t;u++)s?(r=p?(s[0]-1)/2:l%s[0],a=p?(s[1]-1)/2:Math.floor(l/s[0]),r=r-u%s[0],a=a-Math.floor(u/s[0]),o=Math.sqrt(r*r+a*a),"x"===f&&(o=-r),M.push(o="y"===f?-a:o)):M.push(Math.abs(l-u)),x=Math.max.apply(Math,M);c&&(M=M.map(function(n){return c(n/x)*x})),"reverse"===i&&(M=M.map(function(n){return f?n<0?-1*n:-n:Math.abs(x-n)}))}return b+(g?(v-m)/x:m)*(Math.round(100*M[e])/100)+y}},L.timeline=function(u){var i=L(u=void 0===u?{}:u);return i.duration=0,i.add=function(n,e){var t=S.indexOf(i),r=i.children;function a(n){n.passThrough=!0}-1<t&&S.splice(t,1);for(var o=0;o<r.length;o++)a(r[o]);t=D(n,x(M,u)),t.targets=t.targets||u.targets,n=i.duration,t.autoplay=!1,t.direction=i.direction,t.timelineOffset=w.und(e)?n:E(e,n),a(i),i.seek(t.timelineOffset),e=L(t),a(e),r.push(e),n=tn(r,u);return i.delay=n.delay,i.endDelay=n.endDelay,i.duration=n.duration,i.seek(0),i.reset(),i.autoplay&&i.play(),i},i},L.easing=P,L.penner=s,L.random=function(n,e){return Math.floor(Math.random()*(e-n+1))+n},L});; 37(function(window){"use strict";const TRANSLATE_CACHE=new Map();const PREPARE_PROMISES=Object.create(null);function applyVars(text,vars){if(!vars||typeof vars!=="object")return text;let result=text;Object.keys(vars).forEach(function(name){const value=vars[name]==null?"":String(vars[name]);result=result.split(`{${name}}`).join(value);});return result;}function getCatalog(namespace){const root=document.getElementById(`ct-i18n-${namespace}`);const strings={};const html={};if(root){root.querySelectorAll("[data-i18n-key]").forEach(function(el){const key=el.getAttribute("data-i18n-key");if(key)strings[key]=el.textContent.replace(/\s+/g," ").trim();});root.querySelectorAll("[data-i18n-html]").forEach(function(el){const key=el.getAttribute("data-i18n-html");if(key)html[key]=el.innerHTML.trim();});}return {strings,html};}function hasActivePageGoogleTranslate(){const match=document.cookie.match(/(^|;) ?googtrans=([^;]*)(;|$)/);if(!match||!match[2])return false;const parts=decodeURIComponent(match[2]).split("/");return parts.length>=3&&parts[2]&&parts[2]!==parts[1];}function getDrupalLang(){if(window.drupalSettings&&window.drupalSettings.ctLanguageSelector&&window.drupalSettings.ctLanguageSelector.drupalLang)return window.drupalSettings.ctLanguageSelector.drupalLang;return document.documentElement.getAttribute("lang")||"en";}function getSelectiveTargetLang(){if(hasActivePageGoogleTranslate())return null;const drupalLang=getDrupalLang();if(drupalLang==="es-419"||drupalLang==="es")return "es";return null;}function extractTranslatedText(payload){if(!Array.isArray(payload)||!Array.isArray(payload[0]))return "";return payload[0].map(function(chunk){return chunk&&chunk[0]?chunk[0]:"";}).join("");}function protectPlaceholders(text){const tokens=[];const protectedText=String(text).replace(/\{[a-zA-Z0-9_]+\}/g,function(match){const id=tokens.length;tokens.push(match);return "CTPH"+id+"CTPH";});return {text:protectedText,tokens};}function restorePlaceholders(text,tokens){return String(text).replace(/CTPH(\d+)CTPH/gi,function(_,index){return tokens[Number(index)]||"";});}async function translateText(text,targetLang){const trimmed=String(text||"").trim();if(!trimmed)return text;const cacheKey=targetLang+"\n"+trimmed;if(TRANSLATE_CACHE.has(cacheKey))return TRANSLATE_CACHE.get(cacheKey);const protectedText=protectPlaceholders(trimmed);const url="https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl="+encodeURIComponent(targetLang)+"&dt=t&q="+encodeURIComponent(protectedText.text);const response=await fetch(url);if(!response.ok)throw new Error("Translate request failed: "+response.status);const payload=await response.json();const translated=restorePlaceholders(extractTranslatedText(payload)||protectedText.text,protectedText.tokens);TRANSLATE_CACHE.set(cacheKey,translated);return translated;}async function translateTextNode(node,targetLang){if(!node||!node.nodeValue||!node.nodeValue.trim())return;const original=node.nodeValue;const trimmed=original.trim();const translated=await translateText(trimmed,targetLang);node.nodeValue=original.replace(trimmed,translated);}function prepare(namespace){if(PREPARE_PROMISES[namespace])return PREPARE_PROMISES[namespace];PREPARE_PROMISES[namespace]=(async function(){const root=document.getElementById(`ct-i18n-${namespace}`);const targetLang=getSelectiveTargetLang();if(!root||!targetLang)return;if(root.getAttribute("data-ct-gtranslated")===targetLang)return;const keyNodes=root.querySelectorAll("[data-i18n-key]");for(let i=0;i<keyNodes.length;i++)try{const el=keyNodes[i];const original=(el.textContent||"").replace(/\s+/g," ").trim();if(!original)continue;el.textContent=await translateText(original,targetLang);}catch(e){}const htmlNodes=root.querySelectorAll("[data-i18n-html]");for(let i=0;i<htmlNodes.length;i++){const el=htmlNodes[i];const walker=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null);const textNodes=[];let node;while((node=walker.nextNode()))if(node.nodeValue&&node.nodeValue.trim())textNodes.push(node);try{for(let n=0;n<textNodes.length;n++)await translateTextNode(textNodes[n],targetLang);}catch(e){}}root.setAttribute("data-ct-gtranslated",targetLang);root.setAttribute("lang",targetLang);})();return PREPARE_PROMISES[namespace];}function t(namespace,key,vars,fallback){const catalog=getCatalog(namespace);let text=catalog.strings[key]||(typeof fallback==="string"?fallback:key);return applyVars(text,vars);}function html(namespace,key,fallback){const catalog=getCatalog(namespace);return catalog.html[key]||fallback||"";}function htmlWithVars(namespace,key,vars,fallback){const catalog=getCatalog(namespace);const template=catalog.html[key]||fallback||"";return applyVars(template,vars);}window.CTI18n={t,html,htmlWithVars,prepare};})(window);; 38(function(window){"use strict";var PROD_KEY="AIzaSyCBLgtHkfabqOSGwdCP7-6Ru00kg0XT-Po";var DEV_KEY="AIzaSyCTR8L0Mg8you3Hlujumj1uge_36jaDCRw";var loadPromise=null;function isProductionHost(hostname){return /^(www\.)?cttransit\.com$/i.test(hostname||"");}function getApiKey(){var fromSettings=window.drupalSettings&&window.drupalSettings.cttransit&&window.drupalSettings.cttransit.googleMapsApiKey;if(fromSettings)return fromSettings;return isProductionHost(window.location.hostname)?PROD_KEY:DEV_KEY;}function load(libraries){if(window.google&&window.google.maps)return Promise.resolve(window.google.maps);if(loadPromise)return loadPromise;var libs=libraries||"places,geometry,marker";
38loadPromise=new Promise(function(resolve,reject){var existing=document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]');if(existing){var attempts=0;var maxAttempts=50;var checkInterval=setInterval(function(){attempts+=1;if(window.google&&window.google.maps){clearInterval(checkInterval);resolve(window.google.maps);}else{if(attempts>=maxAttempts){clearInterval(checkInterval);reject(new Error("Google Maps API failed to load"));}}},100);return;}var script=document.createElement("script");script.src="https://maps.googleapis.com/maps/api/js?key="+encodeURIComponent(getApiKey())+"&libraries="+encodeURIComponent(libs);script.async=true;script.onerror=function(){loadPromise=null;reject(new Error("Google Maps API failed to load"));};script.onload=function(){if(window.google&&window.google.maps)resolve(window.google.maps);else{loadPromise=null;reject(new Error("Google Maps API failed to load"));}};document.head.appendChild(script);});return loadPromise;}window.CTGoogleMaps={getApiKey,isProductionHost,load};})(window);; 39(function(Drupal){"use strict";const ctRouteTypes={"Bristol":{label:"Bristol",routes:[{id:"102",label:"102 Hartford/New Britain/Bristol"},{id:"502",label:"502 New Britain/Bristol"},{id:"541",label:"541 Bristol Local"},{id:"542",label:"542 Bristol Hospital"},{id:"543",label:"543 West Street"}]},"Hartford":{label:"Hartford",routes:[{id:"24",label:"24 Windsor Locks/Bradley Int'l Airport"},{id:"30",label:"30 Bradley Flyer"},{id:"31",label:"31 Park Street"},{id:"32",label:"32 Windsor Avenue"},{id:"33",label:"33 Park Street"},{id:"34",label:"34 Kennedy Road"},{id:"36",label:"36 Day Hill Road"},{id:"37",label:"37 New Britain Avenue"},{id:"38",label:"38 Weston Street"},{id:"39",label:"39 New Britain Avenue"},{id:"40",label:"40 North Main Street"},{id:"42",label:"42 Barbour Street"},{id:"43",label:"43 Campfield Avenue"},{id:"44",label:"44 Garden Street"},{id:"46",label:"46 Vine Street"},{id:"47",label:"47 Franklin Avenue"},{id:"50",label:"50 Blue Hills Avenue"},{id:"52",label:"52 Blue Hills Avenue"},{id:"53",label:"53 Wethersfield Avenue"},{id:"54",label:"54 Blue Hills Avenue"},{id:"55",label:"55 Hartford/Middletown"},{id:"56",label:"56 Bloomfield Avenue"},{id:"58",label:"58 Albany Avenue"},{id:"59",label:"59 Locust Street"},{id:"60",label:"60 Farmington Avenue"},{id:"61",label:"61 Broad Street"},{id:"62",label:"62 Farmington Avenue"},{id:"63",label:"63 Hillside Avenue"},{id:"64",label:"64 Farmington Avenue"},{id:"66",label:"66 Farmington Avenue"},{id:"69",label:"69 Capitol Avenue"},{id:"72",label:"72 Asylum Avenue"},{id:"74",label:"74 Granby Street"},{id:"76",label:"76 Ashley Street"},{id:"80",label:"80 Buckland Hills via I-84"},{id:"82",label:"82 Tolland Street"},{id:"83",label:"83 Silver Lane"},{id:"84",label:"84 Tolland Street"},{id:"86",label:"86 Burnside Avenue"},{id:"87",label:"87 Brewer Street"},{id:"88",label:"88 Burnside Avenue"},{id:"91",label:"91 Forbes Street"},{id:"92",label:"92 Tower Avenue"},{id:"94",label:"94 Park Avenue"},{id:"95",label:"95 Hartford/Glastonbury"},{id:"96",label:"96 John Fitch Boulevard"},{id:"101",label:"101 Hartford/New Britain"},{id:"102",label:"102 Hartford/New Britain/Bristol"},{id:"121",label:"121 CT State Manchester/Hartford/UConn Health"},{id:"125",label:"125 Hartford/Berlin Turnpike"},{id:"128",label:"128 Hartford/Westfarms/New Britain"},{id:"144",label:"144 Wetherfield/Westfarms"},{id:"153",label:"153 Elmwood/Copaco"},{id:"161",label:"161 Hospital Connector"},{id:"901",label:"901 Hartford/Avon/Canton"},{id:"903",label:"903 Hartford/Buckland"},{id:"904",label:"904 Hartford/Glastonbury"},{id:"905",label:"905 Hartford/Windsor Locks/Enfield"},{id:"906",label:"906 Hartford/Cromwell"},{id:"910",label:"910 Hartford/Rocky Hill"},{id:"912",label:"912 Hartford/Simsbury/Granby"},{id:"913",label:"913 Hartford/Buckland/Storrs"},{id:"914",label:"914 Hartford/Marlborough/Colchester"},{id:"918",label:"918 Hartford/Coventry/Willimantic"},{id:"919",label:"919 Hartford/Meriden"},{id:"921",label:"921 Hartford/Middletown/Old Saybrook"},{id:"923",label:"923 Hartford/Bristol"},{id:"926",label:"926 Hartford/Winsted"},{id:"927",label:"927 Hartford/Torrington"},{id:"928",label:"928 Hartford/Waterbury"},{id:"950",label:"950 New Haven/Hartford"},{id:"AH",label:"AH Asylum Hill Connector"},{id:"CB",label:"CB Columbus Boulevard Connector"},{id:"dash",label:"dash Downtown Area Shuttle"},{id:"dash",label:"dash East Hartford Hotel Shuttle"},{id:"PPB",label:"PPB Hartford/Providence"},{id:"SC",label:"SC State Capitol Connector"}]},"Meriden":{label:"Meriden",routes:[{id:"215",label:"215 New Haven/Wallingford/Meriden"},{id:"561",label:"561 Meriden Mall"},{id:"563",label:"563 Yale Acres"},{id:"564",label:"564 South Meriden"},{id:"565",label:"565 West Main Street"},{id:"566",label:"566 East Main Street"},{id:"567",label:"567 Meriden/Wallingford"},{id:"919",label:"919 Hartford/Meriden"},{id:"940",label:"940 Waterbury/Meriden"},{id:"950",label:"950 New Haven/Hartford"}]},"New Britain":{label:"New Britain",routes:[{id:"101",label:"101 Hartford/New Britain"},{id:"102",label:"102 Hartford/New Britain/Bristol"},{id:"128",label:"128 Hartford/Westfarms/New Britain"},{id:"501",label:"501 Arch Street"},{id:"502",label:"502 New Britain/Bristol"},{id:"503",label:"503 Corbin Avenue"},{id:"505",label:"505 Burritt Street"},{id:"506",label:"506 Farmington Avenue"},{id:"507",label:"507 Oak Street"},{id:"508",label:"508 East Main Street"},{id:"509",label:"509 East Street"},{id:"510",label:"510 South Street"},{id:"511",label:"511 New Britain/Meriden"},{id:"512",label:"512 Berlin Turnpike"},{id:"513",label:"513 New Britain/Cromwell"},{id:"532",label:"532 Queen Street"},{id:"923",label:"923 Hartford/Bristol"},{id:"928",label:"928 Hartford/Waterbury"}]},"New Haven":{label:"New Haven",routes:[{id:"201",label:"201 New Haven/Madison"},{id:"204",label:"204 New Haven/East Haven"},{id:"206",label:"206 East Chapel Street"},{id:"212",label:"212 Grand Avenue"},{id:"213",label:"213 New Haven/North Branford"},{id:"215",label:"215 New Haven/Wallingford/Meriden"},{id:"223",label:"223 Lombard Street"},{id:"224",label:"224 State Street"},{id:"228",label:"228 Whitney Avenue"},{id:"229",label:"229 New Haven/Waterbury"},{id:"234",label:"234 Winchester Avenue"},{id:"237",label:"237 Shelton Avenue"},{id:"238",label:"238 Dixwell Avenue"},{id:"241",label:"241 Goffe Street"},{id:"243",label:"243 Whalley Avenue"},{id:"246",label:"246 Edgewood Avenue"},{id:"254",label:"254 West Chapel Street"},{id:"255",label:"255 New Haven/Ansonia/Seymour"},{id:"261",label:"261 Boston Post Road"},{id:"262",label:"262 New Haven/Orange/Milford"},{id:"265",label:"265 Congress Avenue"},{id:"268",label:"268 Washington Avenue"},{id:"271",label:"271 Kimberly Avenue"},{id:"272",label:"272 Union Avenue"},{id:"274",label:"274 Sargent Drive"},{id:"278",label:"278 New Haven Connector"},{id:"282",label:"282 East Grand Avenue"},{id:"950",label:"950 New Haven/Hartford"}]}
39,"Stamford":{label:"Stamford",routes:[{id:"311",label:"311 Stamford/Port Chester"},{id:"312",label:"312 West Main Street"},{id:"313",label:"313 West Broad Street"},{id:"321",label:"321 West Avenue"},{id:"324",label:"324 Fairfield Avenue"},{id:"326",label:"326 Pacific Street"},{id:"327",label:"327 Shippan Avenue"},{id:"328",label:"328 Cove Road"},{id:"331",label:"331 High Ridge Road"},{id:"333",label:"333 Newfield Avenue"},{id:"334",label:"334 Hope Street"},{id:"335",label:"335 Washington Boulevard"},{id:"336",label:"336 Long Ridge Road"},{id:"341",label:"341 Stamford/Norwalk"},{id:"342",label:"342 East Main Street"},{id:"344",label:"344 Glenbrook Road"},{id:"345",label:"345 CT State Norwalk via I-95"},{id:"349",label:"349 Cove/Glenbrook/Springdale"},{id:"351",label:"351 Stamford Connector"},{id:"355",label:"355 UConn Stamford Connector"},{id:"971",label:"971 Stamford/White Plains"}]},"Wallingford":{label:"Wallingford",routes:[{id:"215",label:"215 New Haven/Wallingford/Meriden"},{id:"291",label:"291 Center Street"},{id:"292",label:"292 North Colony Road"},{id:"567",label:"567 Meriden/Wallingford"}]},"Waterbury":{label:"Waterbury",routes:[{id:"229",label:"229 New Haven/Waterbury"},{id:"411",label:"411 Willow Street"},{id:"412",label:"412 Hill Street"},{id:"413",label:"413 Cooke Street"},{id:"416",label:"416 North Main Street"},{id:"417",label:"417 Thomaston Avenue"},{id:"418",label:"418 Long Hill Road"},{id:"421",label:"421 Walnut Street"},{id:"422",label:"422 Wolcott Street"},{id:"425",label:"425 Meriden Road"},{id:"426",label:"426 East Main Street"},{id:"428",label:"428 East Main Street"},{id:"431",label:"431 Hamilton Avenue"},{id:"432",label:"432 Sylvan Avenue"},{id:"433",label:"433 Baldwin Street"},{id:"436",label:"436 Congress Avenue"},{id:"441",label:"441 Highland Avenue"},{id:"442",label:"442 Chase Parkway"},{id:"444",label:"444 Bunker Hill Avenue"},{id:"445",label:"445 Watertown Avenue"},{id:"446",label:"446 Watertown Industrial Park"},{id:"447",label:"447 Straits Turnpike"},{id:"450",label:"450 Waterbury/Torrington"},{id:"460",label:"460 Waterbury/Cheshire"},{id:"470",label:"470 Waterbury/Naugatuck"},{id:"471",label:"471 Rubber Avenue"},{id:"472",label:"472 New Haven Road"},{id:"473",label:"473 Spring Street"},{id:"479",label:"479 Waterbury/Beacon Falls"},{id:"480",label:"480 Waterbury/Southbury"},{id:"928",label:"928 Hartford/Waterbury"},{id:"940",label:"940 Waterbury/Meriden"}]},"Local":{label:"Local",routes:[{id:"24",label:"24 Windsor Locks/Bradley Int'l Airport"},{id:"30",label:"30 Bradley Flyer"},{id:"31",label:"31 Park Street"},{id:"32",label:"32 Windsor Avenue"},{id:"33",label:"33 Park Street"},{id:"34",label:"34 Kennedy Road"},{id:"36",label:"36 Day Hill Road"},{id:"37",label:"37 New Britain Avenue"},{id:"38",label:"38 Weston Street"},{id:"39",label:"39 New Britain Avenue"},{id:"40",label:"40 North Main Street"},{id:"42",label:"42 Barbour Street"},{id:"43",label:"43 Campfield Avenue"},{id:"44",label:"44 Garden Street"},{id:"46",label:"46 Vine Street"},{id:"47",label:"47 Franklin Avenue"},{id:"50",label:"50 Blue Hills Avenue"},{id:"52",label:"52 Blue Hills Avenue"},{id:"53",label:"53 Wethersfield Avenue"},{id:"54",label:"54 Blue Hills Avenue"},{id:"55",label:"55 Hartford/Middletown"},{id:"56",label:"56 Bloomfield Avenue"},{id:"58",label:"58 Albany Avenue"},{id:"59",label:"59 Locust Street"},{id:"60",label:"60 Farmington Avenue"},{id:"61",label:"61 Broad Street"},{id:"62",label:"62 Farmington Avenue"},{id:"63",label:"63 Hillside Avenue"},{id:"64",label:"64 Farmington Avenue"},{id:"66",label:"66 Farmington Avenue"},{id:"69",label:"69 Capitol Avenue"},{id:"72",label:"72 Asylum Avenue"},{id:"74",label:"74 Granby Street"},{id:"76",label:"76 Ashley Street"},{id:"80",label:"80 Buckland Hills via I-84"},{id:"82",label:"82 Tolland Street"},{id:"83",label:"83 Silver Lane"},{id:"84",label:"84 Tolland Street"},{id:"86",label:"86 Burnside Avenue"},{id:"87",label:"87 Brewer Street"},{id:"88",label:"88 Burnside Avenue"},{id:"91",label:"91 Forbes Street"},{id:"92",label:"92 Tower Avenue"},{id:"94",label:"94 Park Avenue"},{id:"95",label:"95 Hartford/Glastonbury"},{id:"96",label:"96 John Fitch Boulevard"},{id:"201",label:"201 New Haven/Madison"},{id:"204",label:"204 New Haven/East Haven"},{id:"206",label:"206 East Chapel Street"},{id:"212",label:"212 Grand Avenue"},{id:"213",label:"213 New Haven/North Branford"},{id:"215",label:"215 New Haven/Wallingford/Meriden"},{id:"223",label:"223 Lombard Street"},{id:"224",label:"224 State Street"},{id:"228",label:"228 Whitney Avenue"},{id:"229",label:"229 New Haven/Waterbury"},{id:"234",label:"234 Winchester Avenue"},{id:"237",label:"237 Shelton Avenue"},{id:"238",label:"238 Dixwell Avenue"},{id:"241",label:"241 Goffe Street"},{id:"243",label:"243 Whalley Avenue"},{id:"246",label:"246 Edgewood Avenue"},{id:"254",label:"254 West Chapel Street"},{id:"255",label:"255 New Haven/Ansonia/Seymour"},{id:"261",label:"261 Boston Post Road"},{id:"262",label:"262 New Haven/Orange/Milford"},{id:"265",label:"265 Congress Avenue"},{id:"268",label:"268 Washington Avenue"},{id:"271",label:"271 Kimberly Avenue"},{id:"272",label:"272 Union Avenue"},{id:"274",label:"274 Sargent Drive"},{id:"278",label:"278 New Haven Connector"},{id:"282",label:"282 East Grand Avenue"},{id:"291",label:"291 Center Street"},{id:"292",label:"292 North Colony Road"},{id:"311",label:"311 Stamford/Port Chester"},{id:"312",label:"312 West Main Street"},{id:"313",label:"313 West Broad Street"},{id:"321",label:"321 West Avenue"},{id:"324",label:"324 Fairfield Avenue"},{id:"326",label:"326 Pacific Street"},{id:"327",label:"327 Shippan Avenue"},{id:"328",label:"328 Cove Road"},{id:"331",label:"331 High Ridge Road"},{id:"333",label:"333 Newfield Avenue"},{id:"334",label:"334 Hope Street"},{id:"335",label:"335 Washington Boulevard"},{id:"336",label:"336 Long Ridge Road"}
39,{id:"341",label:"341 Stamford/Norwalk"},{id:"342",label:"342 East Main Street"},{id:"344",label:"344 Glenbrook Road"},{id:"345",label:"345 CT State Norwalk via I-95"},{id:"349",label:"349 Cove/Glenbrook/Springdale"},{id:"351",label:"351 Stamford Connector"},{id:"355",label:"355 UConn Stamford Connector"},{id:"411",label:"411 Willow Street"},{id:"412",label:"412 Hill Street"},{id:"413",label:"413 Cooke Street"},{id:"416",label:"416 North Main Street"},{id:"417",label:"417 Thomaston Avenue"},{id:"418",label:"418 Long Hill Road"},{id:"421",label:"421 Walnut Street"},{id:"422",label:"422 Wolcott Street"},{id:"425",label:"425 Meriden Road"},{id:"426",label:"426 East Main Street"},{id:"428",label:"428 East Main Street"},{id:"431",label:"431 Hamilton Avenue"},{id:"432",label:"432 Sylvan Avenue"},{id:"433",label:"433 Baldwin Street"},{id:"436",label:"436 Congress Avenue"},{id:"441",label:"441 Highland Avenue"},{id:"442",label:"442 Chase Parkway"},{id:"444",label:"444 Bunker Hill Avenue"},{id:"445",label:"445 Watertown Avenue"},{id:"446",label:"446 Watertown Industrial Park"},{id:"447",label:"447 Straits Turnpike"},{id:"450",label:"450 Waterbury/Torrington"},{id:"460",label:"460 Waterbury/Cheshire"},{id:"470",label:"470 Waterbury/Naugatuck"},{id:"471",label:"471 Rubber Avenue"},{id:"472",label:"472 New Haven Road"},{id:"473",label:"473 Spring Street"},{id:"479",label:"479 Waterbury/Beacon Falls"},{id:"480",label:"480 Waterbury/Southbury"},{id:"501",label:"501 Arch Street"},{id:"502",label:"502 New Britain/Bristol"},{id:"503",label:"503 Corbin Avenue"},{id:"505",label:"505 Burritt Street"},{id:"506",label:"506 Farmington Avenue"},{id:"507",label:"507 Oak Street"},{id:"508",label:"508 East Main Street"},{id:"509",label:"509 East Street"},{id:"510",label:"510 South Street"},{id:"511",label:"511 New Britain/Meriden"},{id:"512",label:"512 Berlin Turnpike"},{id:"513",label:"513 New Britain/Cromwell"},{id:"532",label:"532 Queen Street"},{id:"541",label:"541 Bristol Local"},{id:"542",label:"542 Bristol Hospital"},{id:"543",label:"543 West Street"},{id:"561",label:"561 Meriden Mall"},{id:"563",label:"563 Yale Acres"},{id:"564",label:"564 South Meriden"},{id:"565",label:"565 West Main Street"},{id:"566",label:"566 East Main Street"},{id:"567",label:"567 Meriden/Wallingford"}]},"Express":{label:"Express",routes:[{id:"901",label:"901 Hartford/Avon/Canton"},{id:"903",label:"903 Hartford/Buckland"},{id:"904",label:"904 Hartford/Glastonbury"},{id:"905",label:"905 Hartford/Windsor Locks/Enfield"},{id:"906",label:"906 Hartford/Cromwell"},{id:"910",label:"910 Hartford/Rocky Hill"},{id:"912",label:"912 Hartford/Simsbury/Granby"},{id:"913",label:"913 Hartford/Buckland/Storrs"},{id:"914",label:"914 Hartford/Marlborough/Colchester"},{id:"918",label:"918 Hartford/Coventry/Willimantic"},{id:"919",label:"919 Hartford/Meriden"},{id:"921",label:"921 Hartford/Middletown/Old Saybrook"},{id:"923",label:"923 Hartford/Bristol"},{id:"926",label:"926 Hartford/Winsted"},{id:"927",label:"927 Hartford/Torrington"},{id:"928",label:"928 Hartford/Waterbury"},{id:"940",label:"940 Waterbury/Meriden"},{id:"950",label:"950 New Haven/Hartford"},{id:"971",label:"971 Stamford/White Plains"},{id:"PPB",label:"PPB Hartford/Providence"}]},"CTfastrak":{label:"CTfastrak",routes:[{id:"101",label:"101 Hartford/New Britain"},{id:"102",label:"102 Hartford/New Britain/Bristol"},{id:"121",label:"121 CT State Manchester/Hartford/UConn Health"},{id:"125",label:"125 Hartford/Berlin Turnpike"},{id:"128",label:"128 Hartford/Westfarms/New Britain"},{id:"144",label:"144 Wetherfield/Westfarms"},{id:"153",label:"153 Elmwood/Copaco"},{id:"161",label:"161 Hospital Connector"}]},"Shuttle":{label:"Shuttle",routes:[{id:"AH",label:"AH Asylum Hill Connector"},{id:"CB",label:"CB Columbus Boulevard Connector"},{id:"dash",label:"dash Downtown Area Shuttle"},{id:"dash",label:"dash East Hartford Hotel Shuttle"},{id:"SC",label:"SC State Capitol Connector"},{id:"USS",label:"USS Union Station Shuttle"}]},"Airport":{label:"Airport",routes:[{id:"24",label:"24 Windsor Locks/Bradley Int'l Airport"},{id:"30",label:"30 Bradley Flyer"},{id:"206",label:"206 East Chapel Street"}]}};if(typeof window!=="undefined")window.ctRouteTypes=ctRouteTypes;Drupal.behaviors.ctRouteTypes={attach(context){const root=context&&context.querySelectorAll?context:document;const filterContainer=root.querySelector(".ct-gtfs-filters");if(!filterContainer)return;function sortRouteIds(ids){return ids.slice().sort((a,b)=>{const matchA=String(a).match(/^(\d+)(.*)$/);const matchB=String(b).match(/^(\d+)(.*)$/);const numA=matchA?parseInt(matchA[1],10):Number.MAX_SAFE_INTEGER;const numB=matchB?parseInt(matchB[1],10):Number.MAX_SAFE_INTEGER;if(numA!==numB)return numA-numB;const suffixA=matchA?matchA[2]:"";const suffixB=matchB?matchB[2]:"";return suffixA.localeCompare(suffixB);});}const SERVICE_TYPE_KEYS=new Set(["Local","Express","CTfastrak","Shuttle","Airport"]);const pills=filterContainer.querySelectorAll(".ct-gtfs-pill[data-category]");
39pills.forEach((pill)=>{const category=pill.getAttribute("data-category");if(!category||category==="all"){pill.removeAttribute("data-routes");return;}if(!SERVICE_TYPE_KEYS.has(category))return;const group=ctRouteTypes[category];if(!group||!Array.isArray(group.routes))return;const ids=group.routes.map((route)=>route&&typeof route.id==="string"?route.id.trim():"").filter(Boolean);const sorted=sortRouteIds(ids);if(sorted.length)pill.setAttribute("data-routes",sorted.join(","));else pill.removeAttribute("data-routes");});}};})(Drupal);; 40window.eventsMonthState=window.eventsMonthState||{month:null};(function(Drupal,once){Drupal.behaviors.monthFilter={attach(context){once('monthFilter','.events-month-nav',context).forEach((wrapper)=>{let currentMonth=window.eventsMonthState.month||wrapper.dataset.month;window.eventsMonthState.month=currentMonth;function updateLabel(){const date=new Date(currentMonth+'-01');wrapper.querySelector('.month-label').innerText=date.toLocaleString('default',{month:'long',year:'numeric'});const view=wrapper.closest('.view');if(!view)return;const label=view.querySelector('.ct-events-list-header .month-label');if(!label)return;label.innerText=date.toLocaleString('default',{month:'long',year:'numeric'});}function onMonthChange(direction){const d=new Date(currentMonth+'-01');if(direction==='prev')d.setMonth(d.getMonth()-1);else{if(direction==='next')d.setMonth(d.getMonth()+1);}currentMonth=d.toISOString().slice(0,7);window.eventsMonthState.month=currentMonth;updateLabel();reloadView();}function reloadView(){const view=wrapper.closest('.view');if(!view||!Drupal.ajax||!Drupal.ajax.instances){console.warn('View or Drupal.ajax not found');return;}const ajaxObject=Drupal.ajax.instances.filter((a)=>a&&a.element).find((a)=>a.element===view);if(!ajaxObject){console.warn('Views AJAX object not found');return;}ajaxObject.options.data=ajaxObject.options.data||{};ajaxObject.options.data.month=currentMonth;console.log('Month sent to PHP:',currentMonth);ajaxObject.execute();}wrapper.querySelector('.month-prev').addEventListener('click',()=>onMonthChange('prev'));wrapper.querySelector('.month-next').addEventListener('click',()=>onMonthChange('next'));updateLabel();});}};})(Drupal,once);; 41(function(Drupal,drupalSettings){"use strict";const ANIMATION_CONFIG={dashedLineSpeed:6,radialGradientSpeed:240,radialGradientRangeMultiplier:1.8,radialGradientsStaggered:90,linearGradientSpeed:400,linearGradientRangeMultiplier:2.0,linearGradientsStaggered:85};const DASHED_SELECTOR=".ct-hero-bg-pattern path[stroke-dasharray]";const RADIAL_GRADIENT_SELECTOR=".ct-hero-bg-pattern radialGradient";const HERO_LINEAR_PATTERN_SELECTOR=".ct-hero-v2-bg-pattern, .ct-hero-v3-bg-pattern";const LINEAR_GRADIENT_SELECTOR=".ct-hero-v2-bg-pattern linearGradient, .ct-hero-v3-bg-pattern linearGradient";const heroAnimationsGlobal=(window.heroAnimations=window.heroAnimations||{});let visibilityListenerAttached=false;function animateDashedLines(selector,speed=null){const paths=document.querySelectorAll(selector);if(paths.length===0){console.warn(`No paths found with selector: ${selector}`);return null;}const animationSpeed=speed||ANIMATION_CONFIG.dashedLineSpeed;const dashPatternLength=12;let offset=0;let animationFrameId=null;let lastTime=performance.now();function animate(currentTime){const deltaTime=(currentTime-lastTime)/1000;lastTime=currentTime;offset+=animationSpeed*deltaTime;if(offset>=dashPatternLength)offset=offset%dashPatternLength;paths.forEach((path)=>{path.style.strokeDashoffset=-offset;});animationFrameId=requestAnimationFrame(animate);}animationFrameId=requestAnimationFrame(animate);return function stop(){if(animationFrameId){cancelAnimationFrame(animationFrameId);animationFrameId=null;}};}function animateRadialGradientCenters(selector,speed=null,rangeMultiplier=null,svgWidth=null,staggered=null){const gradients=document.querySelectorAll(selector);if(gradients.length===0){console.warn(`No radial gradients found with selector: ${selector}`);return null;}const gradientData=[];gradients.forEach((gradient)=>{const originalTransform=gradient.getAttribute("gradientTransform")||"";if(!gradient.dataset.originalTransform)gradient.dataset.originalTransform=originalTransform;const translateMatch=originalTransform.match(/translate\(([^)]+)\)/i);let baseX=0;let baseY=0;let remainingTransform=originalTransform.trim();if(translateMatch){const coords=translateMatch[1].trim().split(/\s+/);baseX=parseFloat(coords[0])||0;baseY=parseFloat(coords[1])||0;remainingTransform=originalTransform.replace(translateMatch[0],"").trim();}gradient.dataset.baseTranslateX=String(baseX);gradient.dataset.baseTranslateY=String(baseY);gradient.dataset.restTransform=remainingTransform;gradientData.push({gradient,baseX,baseY,remainingTransform});});let calculatedSvgWidth=svgWidth;if(!calculatedSvgWidth){const heroPattern=document.querySelector(".ct-hero-bg-pattern");if(heroPattern)calculatedSvgWidth=getHeroSvgWidth(heroPattern);}if(!calculatedSvgWidth){console.warn("Could not determine SVG width for gradient animation");return null;}const animationSpeed=typeof speed==="number"?speed:ANIMATION_CONFIG.radialGradientSpeed;const rangeMult=typeof rangeMultiplier==="number"?rangeMultiplier:ANIMATION_CONFIG.radialGradientRangeMultiplier;const travelRange=calculatedSvgWidth*rangeMult;const staggerSetting=typeof staggered==="number"?Math.min(Math.max(staggered,0),100):Math.min(Math.max(ANIMATION_CONFIG.radialGradientsStaggered,0),100);const halfRange=travelRange/2;const startOffset=-halfRange;const overlapFactor=staggerSetting/100;const gradientCount=gradientData.length;const hasMultipleGradients=gradientCount>1;const delayBetweenGradients=hasMultipleGradients&&overlapFactor<1?travelRange*(1-overlapFactor):0;const sequentialMode=hasMultipleGradients&&delayBetweenGradients>0&&travelRange>0;const totalSequentialCycle=sequentialMode&&travelRange>0?delayBetweenGradients*(gradientCount-1)+travelRange:travelRange;let globalProgress=0;let animationFrameId=null;let lastTime=performance.now();
41function animate(currentTime){const deltaTime=(currentTime-lastTime)/1000;lastTime=currentTime;globalProgress+=animationSpeed*deltaTime;if(sequentialMode&&totalSequentialCycle>0)globalProgress=globalProgress%totalSequentialCycle;else{if(travelRange>0)globalProgress=globalProgress%travelRange;}gradientData.forEach(({gradient,baseX,baseY,remainingTransform},index)=>{let gradientOffset=startOffset;if(sequentialMode){const gradientStartProgress=index*delayBetweenGradients;const gradientEndProgress=gradientStartProgress+travelRange;if(globalProgress>=gradientStartProgress&&globalProgress<=gradientEndProgress){const gradientProgress=globalProgress-gradientStartProgress;gradientOffset=startOffset+gradientProgress;}else if(globalProgress>gradientEndProgress)gradientOffset=halfRange;else gradientOffset=startOffset;}else{const baseOffset=startOffset+globalProgress;gradientOffset=Math.max(startOffset,Math.min(baseOffset,halfRange));}const translateValue=`translate(${baseX+gradientOffset} ${baseY})`;const transformString=remainingTransform?`${translateValue} ${remainingTransform}`.trim():translateValue;gradient.setAttribute("gradientTransform",transformString);});animationFrameId=requestAnimationFrame(animate);}animationFrameId=requestAnimationFrame(animate);return function stop(){if(animationFrameId){cancelAnimationFrame(animationFrameId);animationFrameId=null;}gradientData.forEach(({gradient})=>{const original=gradient.dataset.originalTransform;if(typeof original!=="undefined")gradient.setAttribute("gradientTransform",original);});};}function animateLinearGradients(selector,speed=null,rangeMultiplier=null,svgWidth=null,staggered=null){const gradients=document.querySelectorAll(selector);if(gradients.length===0){console.warn(`No linear gradients found with selector: ${selector}`);return null;}const gradientData=[];gradients.forEach((gradient)=>{const originalX1=parseFloat(gradient.getAttribute("x1"))||0;const originalY1=parseFloat(gradient.getAttribute("y1"))||0;const originalX2=parseFloat(gradient.getAttribute("x2"))||0;const originalY2=parseFloat(gradient.getAttribute("y2"))||0;if(!gradient.dataset.originalX1){gradient.dataset.originalX1=String(originalX1);gradient.dataset.originalY1=String(originalY1);gradient.dataset.originalX2=String(originalX2);gradient.dataset.originalY2=String(originalY2);}gradientData.push({gradient,baseX1:originalX1,baseY1:originalY1,baseX2:originalX2,baseY2:originalY2});});let calculatedSvgWidth=svgWidth;if(!calculatedSvgWidth){const heroLinearPattern=document.querySelector(HERO_LINEAR_PATTERN_SELECTOR);if(heroLinearPattern)calculatedSvgWidth=getHeroSvgWidth(heroLinearPattern);}if(!calculatedSvgWidth){console.warn("Could not determine SVG width for linear gradient animation");return null;}const animationSpeed=typeof speed==="number"?speed:ANIMATION_CONFIG.linearGradientSpeed;const rangeMult=typeof rangeMultiplier==="number"?rangeMultiplier:ANIMATION_CONFIG.linearGradientRangeMultiplier;const travelRange=calculatedSvgWidth*rangeMult;const staggerSetting=typeof staggered==="number"?Math.min(Math.max(staggered,0),100):Math.min(Math.max(ANIMATION_CONFIG.linearGradientsStaggered,0),100);const halfRange=travelRange/2;const startOffset=-halfRange;const overlapFactor=staggerSetting/100;const gradientCount=gradientData.length;const hasMultipleGradients=gradientCount>1;const delayBetweenGradients=hasMultipleGradients&&overlapFactor<1?travelRange*(1-overlapFactor):0;const sequentialMode=hasMultipleGradients&&delayBetweenGradients>0&&travelRange>0;const totalSequentialCycle=sequentialMode&&travelRange>0?delayBetweenGradients*(gradientCount-1)+travelRange:travelRange;const initialProgressOffset=animationSpeed*1;let globalProgress=initialProgressOffset;let animationFrameId=null;let lastTime=performance.now();function animate(currentTime){const deltaTime=(currentTime-lastTime)/1000;lastTime=currentTime;globalProgress+=animationSpeed*deltaTime;if(sequentialMode&&totalSequentialCycle>0)globalProgress=globalProgress%totalSequentialCycle;else{if(travelRange>0)globalProgress=globalProgress%travelRange;}gradientData.forEach(({gradient,baseX1,baseY1,baseX2,baseY2},index)=>
41{let gradientOffset=startOffset;if(sequentialMode){const gradientStartProgress=index*delayBetweenGradients;const gradientEndProgress=gradientStartProgress+travelRange;if(globalProgress>=gradientStartProgress&&globalProgress<=gradientEndProgress){const gradientProgress=globalProgress-gradientStartProgress;gradientOffset=startOffset+gradientProgress;}else if(globalProgress>gradientEndProgress)gradientOffset=halfRange;else gradientOffset=startOffset;}else{const baseOffset=startOffset+globalProgress;gradientOffset=Math.max(startOffset,Math.min(baseOffset,halfRange));}const newX1=baseX1+gradientOffset;const newX2=baseX2+gradientOffset;gradient.setAttribute("x1",newX1);gradient.setAttribute("x2",newX2);});animationFrameId=requestAnimationFrame(animate);}let initialProgress=initialProgressOffset;if(sequentialMode&&totalSequentialCycle>0)initialProgress=initialProgressOffset%totalSequentialCycle;else{if(travelRange>0)initialProgress=initialProgressOffset%travelRange;}gradientData.forEach(({gradient,baseX1,baseX2},index)=>
41{let gradientOffset=startOffset;if(sequentialMode){const gradientStartProgress=index*delayBetweenGradients;const gradientEndProgress=gradientStartProgress+travelRange;if(initialProgress>=gradientStartProgress&&initialProgress<=gradientEndProgress){const gradientProgress=initialProgress-gradientStartProgress;gradientOffset=startOffset+gradientProgress;}else if(initialProgress>gradientEndProgress)gradientOffset=halfRange;else gradientOffset=startOffset;}else{const baseOffset=startOffset+initialProgress;gradientOffset=Math.max(startOffset,Math.min(baseOffset,halfRange));}const newX1=baseX1+gradientOffset;const newX2=baseX2+gradientOffset;gradient.setAttribute("x1",newX1);gradient.setAttribute("x2",newX2);});animationFrameId=requestAnimationFrame(animate);return function stop(){if(animationFrameId){cancelAnimationFrame(animationFrameId);animationFrameId=null;}gradientData.forEach(({gradient})=>{const originalX1=gradient.dataset.originalX1;const originalY1=gradient.dataset.originalY1;const originalX2=gradient.dataset.originalX2;const originalY2=gradient.dataset.originalY2;if(typeof originalX1!=="undefined")gradient.setAttribute("x1",originalX1);if(typeof originalY1!=="undefined")gradient.setAttribute("y1",originalY1);if(typeof originalX2!=="undefined")gradient.setAttribute("x2",originalX2);if(typeof originalY2!=="undefined")gradient.setAttribute("y2",originalY2);});};}function stopAllHeroAnimations(){if(heroAnimationsGlobal.stopDashedLines){heroAnimationsGlobal.stopDashedLines();heroAnimationsGlobal.stopDashedLines=null;}if(heroAnimationsGlobal.stopRadialGradients){heroAnimationsGlobal.stopRadialGradients();heroAnimationsGlobal.stopRadialGradients=null;}if(heroAnimationsGlobal.stopLinearGradients){heroAnimationsGlobal.stopLinearGradients();heroAnimationsGlobal.stopLinearGradients=null;}}function getHeroSvgWidth(heroPattern){const svg=heroPattern.querySelector("svg");if(!svg)return null;const viewBox=svg.getAttribute("viewBox");if(viewBox){const parts=viewBox.trim().split(/\s+/).map((value)=>parseFloat(value));if(parts.length===4&&!Number.isNaN(parts[2]))return parts[2];}const explicitWidth=parseFloat(svg.getAttribute("width"));if(!Number.isNaN(explicitWidth))return explicitWidth;return null;}function startHeroAnimations(heroPattern){let animationsStarted=false;const dashedPaths=heroPattern.querySelectorAll("path[stroke-dasharray]");if(dashedPaths.length>0){const stopDashed=animateDashedLines(DASHED_SELECTOR);if(stopDashed){heroAnimationsGlobal.stopDashedLines=stopDashed;animationsStarted=true;}}const radialGradients=heroPattern.querySelectorAll("radialGradient");if(radialGradients.length>0){const svgWidth=getHeroSvgWidth(heroPattern);const stopRadial=animateRadialGradientCenters(RADIAL_GRADIENT_SELECTOR,null,null,svgWidth||undefined,ANIMATION_CONFIG.radialGradientsStaggered);if(stopRadial){heroAnimationsGlobal.stopRadialGradients=stopRadial;animationsStarted=true;}}return animationsStarted;}function startHeroV2Animations(heroPattern){let animationsStarted=false;const linearGradients=heroPattern.querySelectorAll("linearGradient");if(linearGradients.length>0){const svgWidth=getHeroSvgWidth(heroPattern);const stopLinear=animateLinearGradients(LINEAR_GRADIENT_SELECTOR,null,null,svgWidth||undefined,ANIMATION_CONFIG.linearGradientsStaggered);if(stopLinear){heroAnimationsGlobal.stopLinearGradients=stopLinear;animationsStarted=true;}}return animationsStarted;}function handleVisibilityChange(){if(document.hidden)stopAllHeroAnimations();else{const heroPattern=document.querySelector(".ct-hero-bg-pattern");if(heroPattern)startHeroAnimations(heroPattern);const heroLinearPattern=document.querySelector(HERO_LINEAR_PATTERN_SELECTOR);if(heroLinearPattern)startHeroV2Animations(heroLinearPattern);}}function initHeroAnimations(){let animationsStarted=false;const heroPattern=document.querySelector(".ct-hero-bg-pattern");if(heroPattern){stopAllHeroAnimations();const v1Started=startHeroAnimations(heroPattern);if(v1Started)animationsStarted=true;}const heroLinearPattern=document.querySelector(HERO_LINEAR_PATTERN_SELECTOR);if(heroLinearPattern){const v2Started=startHeroV2Animations(heroLinearPattern);if(v2Started)animationsStarted=true;}if(!animationsStarted)return;if(!visibilityListenerAttached){document.addEventListener("visibilitychange",handleVisibilityChange);visibilityListenerAttached=true;}heroAnimationsGlobal.initialized=true;}function setDashedLineSpeed(speed){if(typeof speed!=="number"||speed<0){console.warn("Invalid speed value. Speed must be a positive number.");return;}ANIMATION_CONFIG.dashedLineSpeed=speed;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopDashedLines){heroAnimationsGlobal.stopDashedLines();const stopDashed=animateDashedLines(DASHED_SELECTOR,speed);if(stopDashed)heroAnimationsGlobal.stopDashedLines=stopDashed;}}function setRadialGradientSpeed(speed){if(typeof speed!=="number"||speed<0){console.warn("Invalid speed value. Speed must be a positive number.");return;}ANIMATION_CONFIG.radialGradientSpeed=speed;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopRadialGradients){heroAnimationsGlobal.stopRadialGradients();const heroPattern=document.querySelector(".ct-hero-bg-pattern");const svgWidth=heroPattern?getHeroSvgWidth(heroPattern):null;const stopRadial=animateRadialGradientCenters(RADIAL_GRADIENT_SELECTOR,speed,null,svgWidth||undefined,ANIMATION_CONFIG.radialGradientsStaggered);
41if(stopRadial)heroAnimationsGlobal.stopRadialGradients=stopRadial;}}function setRadialGradientRangeMultiplier(multiplier){if(typeof multiplier!=="number"||multiplier<=0){console.warn("Invalid multiplier value. Multiplier must be greater than zero.");return;}ANIMATION_CONFIG.radialGradientRangeMultiplier=multiplier;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopRadialGradients){heroAnimationsGlobal.stopRadialGradients();const heroPattern=document.querySelector(".ct-hero-bg-pattern");const svgWidth=heroPattern?getHeroSvgWidth(heroPattern):null;const stopRadial=animateRadialGradientCenters(RADIAL_GRADIENT_SELECTOR,null,multiplier,svgWidth||undefined,ANIMATION_CONFIG.radialGradientsStaggered);if(stopRadial)heroAnimationsGlobal.stopRadialGradients=stopRadial;}}function setRadialGradientsStaggered(value){if(typeof value!=="number"){console.warn("Invalid value. Staggered setting must be a number.");return;}const clampedValue=Math.min(Math.max(value,0),100);ANIMATION_CONFIG.radialGradientsStaggered=clampedValue;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopRadialGradients){heroAnimationsGlobal.stopRadialGradients();const heroPattern=document.querySelector(".ct-hero-bg-pattern");const svgWidth=heroPattern?getHeroSvgWidth(heroPattern):null;const stopRadial=animateRadialGradientCenters(RADIAL_GRADIENT_SELECTOR,null,null,svgWidth||undefined,clampedValue);if(stopRadial)heroAnimationsGlobal.stopRadialGradients=stopRadial;}}function setLinearGradientSpeed(speed){if(typeof speed!=="number"||speed<0){console.warn("Invalid speed value. Speed must be a positive number.");return;}ANIMATION_CONFIG.linearGradientSpeed=speed;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopLinearGradients){heroAnimationsGlobal.stopLinearGradients();const heroLinearPattern=document.querySelector(HERO_LINEAR_PATTERN_SELECTOR);const svgWidth=heroLinearPattern?getHeroSvgWidth(heroLinearPattern):null;const stopLinear=animateLinearGradients(LINEAR_GRADIENT_SELECTOR,speed,null,svgWidth||undefined,ANIMATION_CONFIG.linearGradientsStaggered);if(stopLinear)heroAnimationsGlobal.stopLinearGradients=stopLinear;}}function setLinearGradientRangeMultiplier(multiplier){if(typeof multiplier!=="number"||multiplier<=0){console.warn("Invalid multiplier value. Multiplier must be greater than zero.");return;}ANIMATION_CONFIG.linearGradientRangeMultiplier=multiplier;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopLinearGradients){heroAnimationsGlobal.stopLinearGradients();const heroLinearPattern=document.querySelector(HERO_LINEAR_PATTERN_SELECTOR);const svgWidth=heroLinearPattern?getHeroSvgWidth(heroLinearPattern):null;const stopLinear=animateLinearGradients(LINEAR_GRADIENT_SELECTOR,null,multiplier,svgWidth||undefined,ANIMATION_CONFIG.linearGradientsStaggered);if(stopLinear)heroAnimationsGlobal.stopLinearGradients=stopLinear;}}function setLinearGradientsStaggered(value){if(typeof value!=="number"){console.warn("Invalid value. Staggered setting must be a number.");return;}const clampedValue=Math.min(Math.max(value,0),100);ANIMATION_CONFIG.linearGradientsStaggered=clampedValue;if(heroAnimationsGlobal&&heroAnimationsGlobal.stopLinearGradients){heroAnimationsGlobal.stopLinearGradients();const heroLinearPattern=document.querySelector(HERO_LINEAR_PATTERN_SELECTOR);const svgWidth=heroLinearPattern?getHeroSvgWidth(heroLinearPattern):null;const stopLinear=animateLinearGradients(LINEAR_GRADIENT_SELECTOR,null,null,svgWidth||undefined,clampedValue);if(stopLinear)heroAnimationsGlobal.stopLinearGradients=stopLinear;}}heroAnimationsGlobal.setDashedLineSpeed=setDashedLineSpeed;heroAnimationsGlobal.setRadialGradientSpeed=setRadialGradientSpeed;heroAnimationsGlobal.setRadialGradientRangeMultiplier=setRadialGradientRangeMultiplier;heroAnimationsGlobal.setRadialGradientsStaggered=setRadialGradientsStaggered;heroAnimationsGlobal.setLinearGradientSpeed=setLinearGradientSpeed;heroAnimationsGlobal.setLinearGradientRangeMultiplier=setLinearGradientRangeMultiplier;heroAnimationsGlobal.setLinearGradientsStaggered=setLinearGradientsStaggered;heroAnimationsGlobal.getConfig=function(){return {...ANIMATION_CONFIG};};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initHeroAnimations);else initHeroAnimations();if(typeof Drupal!=="undefined"&&Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.heroAnimations={attach:function(context,settings){if(context===document||context.body)initHeroAnimations();}};})(typeof Drupal!=="undefined"&&Drupal?Drupal:{},typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{});; 42(function(Drupal,drupalSettings){"use strict";function initNewsListing(context){const root=context&&context!==document?context:document;const tabs=root.querySelectorAll(".ct-news-filter__tab");const layouts=root.querySelectorAll(".ct-news-layout");
42if(tabs.length&&layouts.length)tabs.forEach((tab,index)=>{tab.addEventListener("click",()=>{tabs.forEach((t,i)=>{const isActive=i===index;t.classList.toggle("ct-news-filter__tab--active",isActive);t.setAttribute("aria-selected",isActive?"true":"false");});layouts.forEach((layout,i)=>{layout.classList.toggle("is-active",i===index);});});});root.querySelectorAll(".ct-news-layout").forEach((layout)=>{const slides=Array.from(layout.querySelectorAll(".ct-news-feature"));if(!slides.length)return;let current=slides.findIndex((slide)=>slide.classList.contains("is-active"));if(current===-1){current=0;slides[0].classList.add("is-active");}const showSlide=(index)=>{slides.forEach((slide,i)=>{slide.classList.toggle("is-active",i===index);});};layout.addEventListener("click",(event)=>{const prev=event.target.closest(".ct-news-feature-partner-logo--prev");const next=event.target.closest(".ct-news-feature-partner-logo--next");if(!prev&&!next)return;event.preventDefault();if(prev)current=(current-1+slides.length)%slides.length;else{if(next)current=(current+1)%slides.length;}showSlide(current);});});}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){initNewsListing(document);});else initNewsListing(document);if(typeof Drupal!=="undefined"&&Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.ctNewsListing={attach:function(context,settings){initNewsListing(context);}};})(typeof Drupal!=="undefined"&&Drupal?Drupal:{},typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{});; 43(function(Drupal,$,window){"use strict";function initMegamenu(context){if(typeof jQuery==="undefined"){console.error("Megamenu requires jQuery");return;}const $=jQuery;context=context||document;const $menuBtn=$(".ct-menu-btn",context);const $megamenu=$("#ct-megamenu",context);const $menuItems=$(".ct-megamenu-item",context);const $carousels=$(".ct-megamenu-carousel",context);const $quickAccessCarousel=$(".ct-megamenu-carousel-quick-access",context);const initialMenuIconHtml=$menuBtn.html();const openMenuLabel=Drupal.t("Menu");const closeMenuLabel=Drupal.t("Menu");const closeMenuIconHtml='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">'+'<path d="M18 6L6 18M6 6L18 18" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>'+"</svg>"+'<span class="menu-text" aria-hidden="true">'+Drupal.t("Menu")+"</span>";let currentSlideIndex=0;let currentCarousel=$quickAccessCarousel;function setMenuBtnLabel(label){$menuBtn.attr("aria-label",label);$menuBtn.attr("data-ct-original-aria-label",label);}initMenu();function initMenu(){$menuBtn.on("click",function(e){e.preventDefault();e.stopPropagation();toggleMenu();var $searchBlock=$(".search-block-form");if($searchBlock.hasClass("is-expanded"))$searchBlock.removeClass("is-expanded");});$megamenu.find(".ct-megamenu-overlay").on("click",function(){closeMenu();});$(document).on("keydown.megamenu",function(e){if(e.key==="Escape"&&$megamenu.hasClass("is-open"))closeMenu();});if(window.matchMedia("(min-width: 992px)").matches)initDesktopMenu();if(window.matchMedia("(max-width: 991px)").matches)initMobileMenu();$(window).on("resize.megamenu",debounce(function(){if(window.matchMedia("(min-width: 992px)").matches){initDesktopMenu();$menuItems.off("click.mobile");}else{initMobileMenu();$menuItems.off("mouseenter.desktop mouseleave.desktop");}},250));initCarousel();}function initDesktopMenu(){$menuItems.off("click.mobile");let hoverTimeout=null;let currentActiveSubmenu=null;function setActiveMenuItem($activeItem){$menuItems.removeClass("is-active");$activeItem.addClass("is-active");}$menuItems.on("mouseenter.desktop",function(){if(hoverTimeout){clearTimeout(hoverTimeout);hoverTimeout=null;}const submenuId=$(this).data("submenu");if(submenuId){showSubmenuCarousel(submenuId);setActiveMenuItem($(this));currentActiveSubmenu=submenuId;}}).on("mouseleave.desktop",function(){});$(".ct-megamenu-nav, .ct-megamenu-carousel-wrapper").on("mouseenter.desktop",function(){if(hoverTimeout){clearTimeout(hoverTimeout);hoverTimeout=null;}}
43);$("#ct-megamenu").on("mouseleave.desktop",function(e){const relatedTarget=e.relatedTarget;if(!$(relatedTarget).closest("#ct-megamenu").length&&!$(relatedTarget).is("#ct-megamenu"))hoverTimeout=setTimeout(function(){hideAllSubmenus();currentActiveSubmenu=null;},150);}).on("mouseenter.desktop",function(){if(hoverTimeout){clearTimeout(hoverTimeout);hoverTimeout=null;}});}function initMobileMenu(){$menuItems.off("mouseenter.desktop mouseleave.desktop");$(".ct-megamenu-nav").off("mouseleave.desktop");$(".ct-megamenu-carousel-wrapper").off("mouseenter.desktop mouseleave.desktop");$menuItems.off("click.mobile");markMobileLeafItems();$menuItems.on("click.mobile",function(e){const $item=$(this);const submenuId=$item.data("submenu");if(!submenuId||!window.matchMedia("(max-width: 991px)").matches||!hasMobileSubmenu($item,submenuId))return;e.preventDefault();toggleMobileSubmenu($item,submenuId);});}function hasMobileSubmenu($item,submenuId){if(!submenuId)return false;const $existingSubmenu=$item.next(".ct-megamenu-mobile-submenu");if($existingSubmenu.length&&$existingSubmenu.data("submenu")===submenuId)return true;return !!generateMobileSubmenu(submenuId);}function markMobileLeafItems(){$menuItems.each(function(){const $item=$(this);const submenuId=$item.data("submenu");const isLeaf=!hasMobileSubmenu($item,submenuId);$item.toggleClass("ct-megamenu-item--no-submenu",isLeaf);$item.find(".ct-megamenu-arrow.d-lg-none").toggleClass("d-none",isLeaf);});}function toggleMobileSubmenu($item,submenuId){const $existingSubmenu=$item.next(".ct-megamenu-mobile-submenu");$(".ct-megamenu-items").find(".ct-megamenu-mobile-submenu.is-open").not($existingSubmenu).removeClass("is-open");$menuItems.not($item).removeClass("is-active");if($existingSubmenu.length&&$existingSubmenu.data("submenu")===submenuId){$existingSubmenu.toggleClass("is-open");$item.toggleClass("is-active",$existingSubmenu.hasClass("is-open"));}else{$existingSubmenu.remove();const submenuHtml=generateMobileSubmenu(submenuId);if(!submenuHtml){const href=$item.find("a.ct-megamenu-link").attr("href");if(href)window.location.href=href;return;}const $newSubmenu=$(submenuHtml);$item.after($newSubmenu);$item.addClass("is-active");$item.removeClass("ct-megamenu-item--no-submenu");$item.find(".ct-megamenu-arrow.d-lg-none").removeClass("d-none");$newSubmenu[0].offsetHeight;$newSubmenu.addClass("is-open");}}function generateMobileSubmenu(submenuId){const $submenuCarousel=$(`.ct-megamenu-carousel[data-carousel="${submenuId}"]`);let items=[];if($submenuCarousel.length)$submenuCarousel.find(".ct-megamenu-card-title").each(function(){const title=$(this).text().trim();const $card=$(this).closest(".ct-megamenu-card");const $link=$card.find("a");let url=$link.attr("href")||`/${submenuId}/${title.toLowerCase().replace(/\s+/g,"-")}`;if(!url||url==="#")url=`/${submenuId}/${title.toLowerCase().replace(/\s+/g,"-")}`;items.push({title,url});});if(items.length===0)return "";const itemsHtml=items.map((item)=>`<li><a href="${item.url}">${item.title}</a></li>`).join("");return ` 44 <div class="ct-megamenu-mobile-submenu" data-submenu="${submenuId}"> 45 <ul>${itemsHtml}</ul> 46 </div> 47 `;}function showSubmenuCarousel(submenuId){const $submenuCarousel=$(`.ct-megamenu-carousel[data-carousel="${submenuId}"]`);if($submenuCarousel.length){$quickAccessCarousel.removeClass("active");$carousels.not($quickAccessCarousel).removeClass("active");$submenuCarousel.addClass("active");currentCarousel=$submenuCarousel;currentSlideIndex=0;updateCarouselSlides();updateCarouselCounter();}}function hideAllSubmenus(){$menuItems.removeClass("is-active");$carousels.not($quickAccessCarousel).removeClass("active");$quickAccessCarousel.addClass("active");currentCarousel=$quickAccessCarousel;currentSlideIndex=0;updateCarouselSlides();updateCarouselCounter();}function showQuickAccess(){hideAllSubmenus();$quickAccessCarousel.addClass("active");currentCarousel=$quickAccessCarousel;updateCarouselCounter();}function toggleMenu(){const isOpen=$megamenu.hasClass("is-open");if(isOpen)closeMenu();else openMenu();}function openMenu(){$megamenu.addClass("is-open");$menuBtn.attr("aria-expanded","true");setMenuBtnLabel(closeMenuLabel);$menuBtn.html(closeMenuIconHtml);$("body").addClass("ct-megamenu-open");showQuickAccess();currentSlideIndex=0;updateCarouselSlides();}function closeMenu(){$megamenu.removeClass("is-open");
47$menuBtn.attr("aria-expanded","false");setMenuBtnLabel(openMenuLabel);$menuBtn.html(initialMenuIconHtml);$("body").removeClass("ct-megamenu-open");$(".ct-megamenu-mobile-submenu").removeClass("is-open");$menuItems.removeClass("is-active");}function initCarousel(){$(".ct-megamenu-carousel-prev").on("click",function(){navigateCarousel(-1);});$(".ct-megamenu-carousel-next").on("click",function(){navigateCarousel(1);});updateCarouselCounter();updateCarouselSlides();$(window).on("resize.megamenuCarousel",debounce(function(){if(!currentCarousel||!currentCarousel.length)return;const $track=currentCarousel.find(".ct-megamenu-carousel-track");const totalSlides=$track.find(".ct-megamenu-carousel-slide").length;const slidesPerView=getSlidesPerView();const maxIndex=Math.max(0,totalSlides-slidesPerView);if(currentSlideIndex>maxIndex)currentSlideIndex=maxIndex;updateCarouselSlides();updateCarouselCounter();},200));}function navigateCarousel(direction){const $track=currentCarousel.find(".ct-megamenu-carousel-track");const $slides=$track.find(".ct-megamenu-carousel-slide");const totalSlides=$slides.length;const slidesPerView=getSlidesPerView();const maxIndex=Math.max(0,totalSlides-slidesPerView);if(direction===1){if(currentSlideIndex<maxIndex)currentSlideIndex++;}else{if(currentSlideIndex>0)currentSlideIndex--;}updateCarouselSlides();updateCarouselCounter();}function getSlideMetrics(){if(!currentCarousel||!currentCarousel.length)return {stepWidth:384,containerWidth:0};const $track=currentCarousel.find(".ct-megamenu-carousel-track");const $slides=$track.find(".ct-megamenu-carousel-slide");if(!$slides.length)return {stepWidth:384,containerWidth:0};let stepWidth;if($slides.length>1){const firstLeft=$slides.eq(0).position().left;const secondLeft=$slides.eq(1).position().left;stepWidth=Math.abs(secondLeft-firstLeft);}else stepWidth=$slides.eq(0).outerWidth(true)||384;const $wrapper=currentCarousel.closest(".ct-megamenu-carousel-wrapper");const containerWidth=($wrapper.length?$wrapper.width():currentCarousel.width())||0;return {stepWidth:stepWidth||384,containerWidth};}function getSlidesPerView(){const isDesktop=window.matchMedia("(min-width: 992px)").matches;if(!isDesktop)return 1;const {stepWidth,containerWidth}=getSlideMetrics();if(!stepWidth||!containerWidth)return 3;const raw=containerWidth/stepWidth;const slidesPerView=Math.max(1,Math.floor(raw));return Math.min(3,slidesPerView);}function updateCarouselSlides(){const $track=currentCarousel.find(".ct-megamenu-carousel-track");const {stepWidth,containerWidth}=getSlideMetrics();const $slides=$track.find(".ct-megamenu-carousel-slide");const totalSlides=$slides.length;const slidesPerView=getSlidesPerView();const maxIndex=Math.max(0,totalSlides-slidesPerView);let offset;if(containerWidth&&totalSlides>0&¤tSlideIndex===maxIndex&&slidesPerView>0){const trackWidth=totalSlides*stepWidth;const maxOffset=trackWidth-containerWidth;const extraOffset=24;offset=-Math.max(0,maxOffset+extraOffset);}else offset=-currentSlideIndex*stepWidth;$track.css("transform",`translateX(${offset}px)`);}function updateCarouselCounter(){const $track=currentCarousel.find(".ct-megamenu-carousel-track");const $slides=$track.find(".ct-megamenu-carousel-slide");const totalSlides=$slides.length;const slidesPerView=getSlidesPerView();const maxIndex=Math.max(0,totalSlides-slidesPerView);const visibleLastIndex=Math.min(totalSlides,currentSlideIndex+slidesPerView);const current=visibleLastIndex;const total=totalSlides;$(".ct-megamenu-carousel-current").text(current);$(".ct-megamenu-carousel-total").text(total);$(".ct-megamenu-carousel-prev").prop("disabled",currentSlideIndex===0);$(".ct-megamenu-carousel-next").prop("disabled",currentSlideIndex>=maxIndex);}function debounce(func,wait){let timeout;return function executedFunction(...args){const later=()=>{clearTimeout(timeout);func(...args);};clearTimeout(timeout);timeout=setTimeout(later,wait);};}}if(Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.cttransitMegamenu={attach:function(context,settings){initMegamenu(context);}};else if(typeof jQuery!=="undefined")$(document).ready(function(){initMegamenu(document);});else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){if(typeof jQuery==="undefined")console.warn("Megamenu requires jQuery. Please include jQuery before this script.");else initMegamenu(document);});else{if(typeof jQuery!=="undefined")initMegamenu(document);}})(typeof window.Drupal!=="undefined"?window.Drupal:{},typeof window.jQuery!=="undefined"?window.jQuery:null,window);; 48(function(Drupal,drupalSettings){"use strict";function initAppCarousel(){const carousel=document.querySelector(".ct-app-carousel");const slides=document.querySelectorAll(".ct-app-slide");const indicators=document.querySelectorAll(".ct-app-indicators .ct-indicator");const images=document.querySelectorAll(".ct-app-image");if(!carousel||slides.length===0||indicators.length===0){console.warn("App carousel elements not found");return;}let currentSlide=0;let autoRotateInterval=null;const ROTATION_INTERVAL=10000;function showSlide(index){if(index<0||index>=slides.length)return;
48slides.forEach((slide,i)=>{const isActive=i===index;slide.classList.toggle("ct-app-slide-active",isActive);slide.setAttribute("aria-hidden",!isActive);if(isActive)slide.removeAttribute("inert");else slide.setAttribute("inert","");slide.querySelectorAll("a, button").forEach((el)=>{if(isActive)el.removeAttribute("tabindex");else el.setAttribute("tabindex","-1");});});images.forEach((image,i)=>{const isActive=i===index;image.classList.toggle("ct-app-image-active",isActive);image.setAttribute("aria-hidden",!isActive);});indicators.forEach((indicator,i)=>{const isActive=i===index;indicator.classList.toggle("ct-indicator-active",isActive);indicator.setAttribute("aria-current",isActive);});currentSlide=index;}function nextSlide(){const nextIndex=(currentSlide+1)%slides.length;showSlide(nextIndex);}function startAutoRotate(){stopAutoRotate();autoRotateInterval=setInterval(nextSlide,ROTATION_INTERVAL);}function stopAutoRotate(){if(autoRotateInterval){clearInterval(autoRotateInterval);autoRotateInterval=null;}}function setupIndicators(){indicators.forEach((indicator,index)=>{indicator.addEventListener("click",function(){showSlide(index);startAutoRotate();});indicator.addEventListener("keydown",function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();showSlide(index);startAutoRotate();}else if(e.key==="ArrowLeft"){e.preventDefault();const prevIndex=index>0?index-1:slides.length-1;showSlide(prevIndex);indicators[prevIndex].focus();startAutoRotate();}else{if(e.key==="ArrowRight"){e.preventDefault();const nextIndex=(index+1)%slides.length;showSlide(nextIndex);indicators[nextIndex].focus();startAutoRotate();}}});});}function setupHoverPause(){carousel.addEventListener("mouseenter",stopAutoRotate);carousel.addEventListener("mouseleave",startAutoRotate);}setupIndicators();setupHoverPause();startAutoRotate();document.addEventListener("visibilitychange",function(){if(document.hidden)stopAutoRotate();else startAutoRotate();});return function destroy(){stopAutoRotate();indicators.forEach((indicator)=>{indicator.replaceWith(indicator.cloneNode(true));});};}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initAppCarousel);else initAppCarousel();if(typeof Drupal!=="undefined"&&Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.appCarousel={attach:function(context,settings){if(context===document||context.body)initAppCarousel();}};})(typeof Drupal!=="undefined"&&Drupal?Drupal:{},typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{});; 49(function(Drupal){"use strict";function i18n(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.t==="function")return window.CTI18n.t("trip-planner",key,vars,fallback);return typeof fallback==="string"?fallback:key;}function initTripPlanner(){const originInput=document.getElementById("ct-origin-input");const destinationInput=document.getElementById("ct-destination-input");const detectLocationBtn=document.getElementById("ct-detect-location-btn");const timeInput=document.getElementById("ct-time-input");const preferencesInput=document.getElementById("ct-preferences-input");const goBtn=document.getElementById("ct-trip-planner-go-btn");const originError=document.getElementById("ct-origin-error");const destinationError=document.getElementById("ct-destination-error");
49const CONNECTICUT_TIMEZONE="America/New_York";if(!originInput||!destinationInput||!detectLocationBtn||!timeInput||!goBtn||!preferencesInput){console.warn("Trip planner elements not found");return;}function getDateTimePartsInTimeZone(date,timeZone){const formatter=new Intl.DateTimeFormat("en-US",{timeZone,hour12:false,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});const parts=formatter.formatToParts(date);const values={};parts.forEach((part)=>{if(part.type!=="literal")values[part.type]=Number(part.value);});return values;}function getConnecticutNowParts(){return getDateTimePartsInTimeZone(new Date(),CONNECTICUT_TIMEZONE);}let originAutocomplete=null;let destinationAutocomplete=null;function initAutocomplete(){function waitForGoogleMaps(callback,maxAttempts=20){if(typeof google!=="undefined"&&typeof google.maps!=="undefined"&&typeof google.maps.places!=="undefined")callback();else if(maxAttempts>0)setTimeout(function(){waitForGoogleMaps(callback,maxAttempts-1);},250);else console.warn("Google Maps Places API not available after waiting");}waitForGoogleMaps(setupAutocomplete);}function setupAutocomplete(){if(typeof google==="undefined"||typeof google.maps==="undefined"||typeof google.maps.places==="undefined"){console.error("Google Maps Places API not available");return;}const ctBounds=new google.maps.LatLngBounds(new google.maps.LatLng(41.0,-73.7),new google.maps.LatLng(42.05,-71.8));originAutocomplete=new google.maps.places.Autocomplete(originInput,{types:["geocode","establishment"],fields:["formatted_address","geometry","name"],bounds:ctBounds,componentRestrictions:{country:"us"},strictBounds:false});destinationAutocomplete=new google.maps.places.Autocomplete(destinationInput,{types:["geocode","establishment"],fields:["formatted_address","geometry","name"],bounds:ctBounds,componentRestrictions:{country:"us"},strictBounds:false});originAutocomplete.addListener("place_changed",function(){const place=originAutocomplete.getPlace();if(place&&place.formatted_address){originInput.value=place.formatted_address;announceToScreenReader(i18n("originLocationSet",{address:place.formatted_address},`Origin location set to ${place.formatted_address}`));}});destinationAutocomplete.addListener("place_changed",function(){const place=destinationAutocomplete.getPlace();if(place&&place.formatted_address){destinationInput.value=place.formatted_address;announceToScreenReader(i18n("destinationLocationSet",{address:place.formatted_address},`Destination location set to ${place.formatted_address}`));}});makeAutocompleteAccessible(originInput,originAutocomplete);makeAutocompleteAccessible(destinationInput,destinationAutocomplete);}function makeAutocompleteAccessible(input,autocomplete){input.addEventListener("keydown",function(e){const pacContainer=document.querySelector(".pac-container");if(!pacContainer)return;const suggestions=pacContainer.querySelectorAll(".pac-item");if(suggestions.length===0)return;let currentIndex=Array.from(suggestions).findIndex((item)=>item.classList.contains("pac-item-selected"));if(e.key==="ArrowDown"){e.preventDefault();currentIndex=currentIndex<suggestions.length-1?currentIndex+1:0;selectSuggestion(suggestions,currentIndex);}else if(e.key==="ArrowUp"){e.preventDefault();currentIndex=currentIndex>0?currentIndex-1:suggestions.length-1;selectSuggestion(suggestions,currentIndex);}else if(e.key==="Enter"&¤tIndex>=0){e.preventDefault();suggestions[currentIndex].click();}else{if(e.key==="Escape")pacContainer.style.display="none";}});}function selectSuggestion(suggestions,index){suggestions.forEach((item,i)=>{if(i===index){item.classList.add("pac-item-selected");item.setAttribute("aria-selected","true");item.focus();}else{item.classList.remove("pac-item-selected");item.setAttribute("aria-selected","false");}});}function setupGeolocation(){detectLocationBtn.addEventListener("click",function(){if(!navigator.geolocation){announceToScreenReader(i18n("geolocationUnsupported",null,"Geolocation is not supported by your browser"));return;}const originalAriaLabel=detectLocationBtn.getAttribute("aria-label");detectLocationBtn.setAttribute("aria-label",i18n("detectingLocation",null,"Detecting location..."));detectLocationBtn.disabled=true;navigator.geolocation.getCurrentPosition(function(position){const lat=position.coords.latitude;const lng=position.coords.longitude;if(typeof google!=="undefined"&&typeof google.maps!=="undefined"){const geocoder=new google.maps.Geocoder();geocoder.geocode({location:{lat,lng}},function(results,status){detectLocationBtn.disabled=false;detectLocationBtn.setAttribute("aria-label",originalAriaLabel);
49if(status==="OK"&&results[0]){originInput.value=results[0].formatted_address;announceToScreenReader(i18n("locationDetected",{address:results[0].formatted_address},`Location detected: ${results[0].formatted_address}`));}else{originInput.value=`${lat}, ${lng}`;announceToScreenReader(i18n("locationDetectedCoords",{lat,lng},`Location detected at coordinates ${lat}, ${lng}`));}});}else{originInput.value=`${lat}, ${lng}`;detectLocationBtn.disabled=false;detectLocationBtn.setAttribute("aria-label",originalAriaLabel);announceToScreenReader(i18n("locationDetectedCoords",{lat,lng},`Location detected at coordinates ${lat}, ${lng}`));}},function(error){detectLocationBtn.disabled=false;detectLocationBtn.setAttribute("aria-label",originalAriaLabel);let errorMessage=i18n("unableToDetectLocation",null,"Unable to detect your location");switch(error.code){case error.PERMISSION_DENIED:errorMessage=i18n("locationAccessDenied",null,"Location access denied. Please enable location permissions.");break;case error.POSITION_UNAVAILABLE:errorMessage=i18n("locationUnavailable",null,"Location information unavailable.");break;case error.TIMEOUT:errorMessage=i18n("locationTimeout",null,"Location request timed out.");break;}announceToScreenReader(errorMessage);console.error("Geolocation error:",error);},{enableHighAccuracy:true,timeout:10000,maximumAge:0});});detectLocationBtn.addEventListener("keydown",function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();detectLocationBtn.click();}});}function setupTimeInput(){const now=getConnecticutNowParts();const twelveHour=now.hour%12||12;const minutes=String(now.minute).padStart(2,"0");const period=now.hour>=12?i18n("periodPm",null,"PM"):i18n("periodAm",null,"AM");const defaultTime=`${twelveHour}:${minutes} ${period}`;if(typeof flatpickr!=="undefined"){if(!timeInput._flatpickr)flatpickr(timeInput,{enableTime:true,
49noCalendar:true,dateFormat:"h:i K",time_24hr:false,allowInput:true,clickOpens:true,defaultDate:defaultTime,onReady:function(){if(!timeInput.value)timeInput.value=defaultTime;}});return;}timeInput.value=defaultTime;timeInput.addEventListener("keydown",function(e){if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","Enter"].includes(e.key))return;if(/[0-9:apmAPM]/.test(e.key)||["Backspace","Delete"].includes(e.key))return;e.preventDefault();});}function clearFieldError(input,errorEl){if(!input)return;input.removeAttribute("aria-invalid");if(errorEl)errorEl.hidden=true;}function showFieldError(input,errorEl){if(!input)return;input.setAttribute("aria-invalid","true");if(errorEl)errorEl.hidden=false;}function validateTripPlannerFields(){const origin=originInput.value.trim();const destination=destinationInput.value.trim();let isValid=true;let firstInvalidInput=null;if(!origin){showFieldError(originInput,originError);firstInvalidInput=originInput;isValid=false;}else clearFieldError(originInput,originError);if(!destination){showFieldError(destinationInput,destinationError);if(!firstInvalidInput)firstInvalidInput=destinationInput;isValid=false;}else clearFieldError(destinationInput,destinationError);if(!isValid){announceToScreenReader(i18n("enterOriginAndDestination",null,"Please enter both origin and destination locations"));if(firstInvalidInput)firstInvalidInput.focus();}return isValid;}originInput.addEventListener("input",function(){if(originInput.value.trim())clearFieldError(originInput,originError);});destinationInput.addEventListener("input",function(){if(destinationInput.value.trim())clearFieldError(destinationInput,destinationError);});function setupGoButton(){goBtn.addEventListener("click",function(){const origin=originInput.value.trim();const destination=destinationInput.value.trim();const time=timeInput.value;const preference=preferencesInput.value==="arrive"?"arrive":"depart";const now=getConnecticutNowParts();const date=`${String(now.month).padStart(2,"0")}/${String(now.day).padStart(2,"0")}/${now.year}`;if(!validateTripPlannerFields())return;const tripPlannerData={origin,destination,transitPreference:preference,date,time,timestamp:new Date().getTime()};try{localStorage.setItem("ctTripPlannerData",JSON.stringify(tripPlannerData));}catch(e){console.warn("Failed to save trip planner data to localStorage:",e);}window.location.href="/trip-planner";});goBtn.addEventListener("keydown",function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();goBtn.click();}});}function announceToScreenReader(message){const announcement=document.createElement("div");announcement.setAttribute("role","status");announcement.setAttribute("aria-live","polite");announcement.setAttribute("aria-atomic","true");announcement.className="sr-only";announcement.style.cssText="position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden;";announcement.textContent=message;document.body.appendChild(announcement);setTimeout(function(){document.body.removeChild(announcement);},1000);}setupGeolocation();setupTimeInput();if(typeof flatpickr==="undefined"){let attemptsRemaining=20;const waitForFlatpickr=function(){if(typeof flatpickr!=="undefined"){setupTimeInput();return;}attemptsRemaining-=1;if(attemptsRemaining>0)setTimeout(waitForFlatpickr,250);};waitForFlatpickr();}setupGoButton();initAutocomplete();const tabButtons=document.querySelectorAll('.ct-trip-planner-tabs button[role="tab"]');tabButtons.forEach(function(button){button.addEventListener("keydown",function(e){const tabs=Array.from(tabButtons);const currentIndex=tabs.indexOf(button);if(e.key==="ArrowLeft"){e.preventDefault();const prevIndex=currentIndex>0?currentIndex-1:tabs.length-1;tabs[prevIndex].focus();tabs[prevIndex].click();}else if(e.key==="ArrowRight"){e.preventDefault();const nextIndex=currentIndex<tabs.length-1?currentIndex+1:0;tabs[nextIndex].focus();tabs[nextIndex].click();}else if(e.key==="Home"){e.preventDefault();tabs[0].focus();tabs[0].click();}else{if(e.key==="End"){e.preventDefault();tabs[tabs.length-1].focus();tabs[tabs.length-1].click();}}});});}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initTripPlanner);else initTripPlanner();Drupal.behaviors.tripPlanner={attach:function(context){if(context===document||context.body)initTripPlanner();}};})(Drupal);; 50(function(Drupal,once){"use strict";Drupal.behaviors.alertsFilter={attach:function(context,settings){const filterContainer=context.querySelector("[data-ct-alerts-filters]");
50const alertsGrid=context.querySelector("[data-ct-alerts-grid]");if(!filterContainer||!alertsGrid)return;const allDivisions=new Set();const alertCards=alertsGrid.querySelectorAll(".ct-alert-card");alertCards.forEach((card)=>{const divisionsAttr=card.getAttribute("data-divisions");if(divisionsAttr){const divisions=divisionsAttr.split(",").filter((d)=>d.trim());divisions.forEach((division)=>allDivisions.add(division.trim()));}});const sortedDivisions=Array.from(allDivisions).sort();if(sortedDivisions.length>0)sortedDivisions.forEach((division)=>{const pill=document.createElement("button");pill.type="button";pill.className="ct-alerts-filter__tab";pill.setAttribute("role","tab");pill.setAttribute("aria-selected","false");pill.setAttribute("data-division",division);pill.textContent=division;filterContainer.appendChild(pill);});const tabs=filterContainer.querySelectorAll(".ct-alerts-filter__tab");tabs.forEach((tab)=>{tab.addEventListener("click",()=>{const selectedDivision=tab.getAttribute("data-division");tabs.forEach((t)=>{const isActive=t===tab;t.classList.toggle("ct-alerts-filter__tab--active",isActive);t.setAttribute("aria-selected",isActive?"true":"false");});alertCards.forEach((card)=>{const cardDivisions=card.getAttribute("data-divisions");if(selectedDivision==="all")card.style.display="";else if(cardDivisions){const divisions=cardDivisions.split(",").map((d)=>d.trim());if(divisions.includes(selectedDivision))card.style.display="";else card.style.display="none";}else if(selectedDivision==="all")card.style.display="";else card.style.display="none";});});});}};function updateCardRoutesScrollFade(scroller,items,label){const maxScroll=Math.max(0,items.scrollWidth-items.clientWidth);const left=items.scrollLeft;scroller.classList.toggle("has-scroll-left",left>1);scroller.classList.toggle("has-scroll-right",maxScroll-left>1);if(maxScroll>1){items.setAttribute("tabindex","0");items.setAttribute("role","region");if(label){if(!label.id)label.id="ct-card-routes-label-"+String(Math.random()).slice(2,10);items.setAttribute("aria-labelledby",label.id);}else{if(!items.getAttribute("aria-label"))items.setAttribute("aria-label","Routes");}}else{items.removeAttribute("tabindex");items.removeAttribute("role");items.removeAttribute("aria-labelledby");}}Drupal.behaviors.ctCardRoutesScrollFade={attach:function(context){const roots=once("ct-card-routes-fade",".ct-card-routes",context);roots.forEach(function(root){const items=root.querySelector(".routes-items");if(!items)return;let scroller=root.querySelector(".ct-card-routes-scroller");if(!scroller){scroller=document.createElement("div");scroller.className="ct-card-routes-scroller";items.parentNode.insertBefore(scroller,items);scroller.appendChild(items);}const label=root.querySelector("p.label");const update=function(){updateCardRoutesScrollFade(scroller,items,label);};items.addEventListener("scroll",update,{passive:true});items.addEventListener("keydown",function(event){if(event.key!=="ArrowRight"&&event.key!=="ArrowLeft")return;const delta=event.key==="ArrowRight"?80:-80;items.scrollBy({left:delta,behavior:"smooth"});event.preventDefault();});window.addEventListener("resize",update);if(typeof ResizeObserver==="function"){const observer=new ResizeObserver(update);observer.observe(items);observer.observe(scroller);}update();});}};})(Drupal,once);; 51(function(Drupal){"use strict";const API_BASE_URL="https://cttransit.alerts.api.exemplifi.io/api/v1";const API_HEADERS={Accept:"application/json","X-API-KEY":"sk_live_SOdoS2lNrADb82dOIDtRcz_t33L3Zx0t"};function getApiUrl(endpoint){return `${API_BASE_URL}${endpoint}`;}function initSubscribeForm(){const routeSelect=document.getElementById("ct-route-select");if(!routeSelect)return;function getSharedRoutes(){if(typeof window!=="undefined"&&window.ctGtfsRoutesPromise instanceof Promise)return window.ctGtfsRoutesPromise;const routesPromise=(async()=>{const apiUrl=getApiUrl("/gtfs/routes");const response=await fetch(apiUrl,{method:"GET",headers:API_HEADERS});if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);const data=await response.json();let routesData;if(typeof data==="string")routesData=JSON.parse(data);else routesData=data;const routesList=Array.isArray(routesData)?routesData:routesData.routes||[];return routesList;})();if(typeof window!=="undefined")window.ctGtfsRoutesPromise=routesPromise;return routesPromise;}async function loadRoutes(){try{const routes=await getSharedRoutes();
51routes.forEach((route)=>{const routeName=route.route_short_name?`${route.route_short_name} ${route.route_long_name||""}`.trim():route.route_long_name||"Unknown Route";const option=document.createElement("option");option.value=route.route_id||route.route_short_name||"";option.textContent=routeName;routeSelect.appendChild(option);});routeSelect.disabled=false;}catch(error){console.error("Error loading routes for subscribe form:",error);const errorOption=document.createElement("option");errorOption.value="";errorOption.textContent="Unable to load routes";errorOption.disabled=true;routeSelect.appendChild(errorOption);}}routeSelect.disabled=true;if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",loadRoutes);else loadRoutes();const radioButtons=document.querySelectorAll('input[name="all-alerts"]');radioButtons.forEach((radio)=>{radio.addEventListener("change",(e)=>{if(e.target.value==="yes"){routeSelect.disabled=true;routeSelect.value="";}else routeSelect.disabled=false;});});}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initSubscribeForm);else initSubscribeForm();Drupal.behaviors.subscribeForm={attach:function(context){if(context===document||context.body)initSubscribeForm();}};})(Drupal);; 52(function(Drupal){"use strict";function i18n(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.t==="function")return window.CTI18n.t("service-map",key,vars,fallback);return typeof fallback==="string"?fallback:key;}const API_BASE_URL="https://cttransit.alerts.api.exemplifi.io/api/v1";const API_HEADERS={Accept:"application/json","X-API-KEY":"sk_live_SOdoS2lNrADb82dOIDtRcz_t33L3Zx0t"};function getApiUrl(endpoint){return `${API_BASE_URL}${endpoint}`;}function initServiceMapBehavior(context){const mapElement=context.getElementById?context.getElementById("ct-service-map"):document.getElementById("ct-service-map");if(!mapElement||mapElement.dataset.initialized)return;mapElement.dataset.initialized="true";let map=null;let routes=[];let currentRoute=null;let routePolyline=null;let routeMarkers=[];let selectedRouteIds=new Set();let routeDetailsCache={};let selectedRoutesContainer=null;function getRouteLookupKey(route){if(!route)return "";return String(route.route_short_name||route.route_id||"").trim();}function fetchRoutesIndexRaw(){if(typeof window!=="undefined"&&window.ctGtfsRoutesIndexPromise instanceof Promise)return window.ctGtfsRoutesIndexPromise;const routesIndexPromise=fetch(getApiUrl("/routes"),{method:"GET",headers:API_HEADERS}).then((response)=>{if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);return response.json();});if(typeof window!=="undefined")window.ctGtfsRoutesIndexPromise=routesIndexPromise;return routesIndexPromise;}function getSharedRoutes(){if(typeof window!=="undefined"&&window.ctGtfsRoutesPromise instanceof Promise)return window.ctGtfsRoutesPromise;const routesPromise=(async()=>{const data=await fetchRoutesIndexRaw();const routesData=typeof data==="string"?JSON.parse(data):data;const landingRoutes=routesData&&routesData.landing?Array.isArray(routesData.landing)?routesData.landing:routesData.landing.routes||routesData.landing.data||routesData.landing.items||[]:[];const routesList=Array.isArray(routesData)?routesData:routesData.routes||routesData.data||routesData.items||landingRoutes||[];const normalizeRouteIndexItem=(item)=>{if(item&&(item.shortName!==undefined||item.longName!==undefined||item.routeId!==undefined))return {...item,route_id:item.routeId!==undefined&&item.routeId!==null?String(item.routeId):item.code!==undefined&&item.code!==null?String(item.code):String(item.id||""),route_short_name:item.shortName!==undefined&&item.shortName!==null?String(item.shortName):String(item.routeId||""),route_long_name:item.longName!==undefined&&item.longName!==null?String(item.longName):"",route_color:item.routeColor!==undefined&&item.routeColor!==null?String(item.routeColor):item.route_color,textColor:item.textColor!==undefined&&item.textColor!==null?String(item.textColor):item.textColor};return item;};const normalized=Array.isArray(routesList)?routesList.map(normalizeRouteIndexItem):[];const seen=new Map();normalized.forEach((route)=>{const key=String((route&&route.route_short_name)||(route&&route.shortName)||"").trim().toLowerCase();if(!key||seen.has(key))return;seen.set(key,route);});return Array.from(seen.values());})();if(typeof window!=="undefined")window.ctGtfsRoutesPromise=routesPromise;return routesPromise;}function getRouteDisplayName(route){if(!route)return i18n("unknownRoute",null,"Unknown Route");return route.route_short_name?`${route.route_short_name} ${route.route_long_name||""}`.trim():route.route_long_name||i18n("unknownRoute",null,"Unknown Route");}function updateSelectedRoutesUI(){if(!selectedRoutesContainer)selectedRoutesContainer=document.getElementById("ct-selected-routes")||null;if(!selectedRoutesContainer)return;selectedRoutesContainer.innerHTML="";if(!selectedRouteIds||selectedRouteIds.size===0)return;selectedRouteIds.forEach((routeId)=>{const route=routes.find((r)=>r.route_id===routeId)||routeDetailsCache[routeId]||null;const routeNameFull=getRouteDisplayName(route);const routeNumber=(route&&route.route_short_name)||(route&&route.route_id)||"";const chip=document.createElement("div");
52chip.className="ct-selected-route-chip";chip.setAttribute("data-route-id",routeId);chip.setAttribute("aria-label",i18n("ariaShowRouteChip",{route:routeNameFull},`Show route ${routeNameFull} on map and remove if needed`));chip.setAttribute("tabindex","0");chip.style.display="inline-flex";chip.style.alignItems="center";chip.style.padding="4px 8px";chip.style.marginRight="4px";chip.style.marginTop="4px";chip.style.borderRadius="999px";chip.style.backgroundColor="#e6f2ff";chip.style.color="#000000";chip.style.fontSize="0.875rem";chip.style.cursor="pointer";const iconSpan=document.createElement("span");iconSpan.className="ct-selected-route-icon";iconSpan.setAttribute("aria-hidden","true");iconSpan.style.display="inline-block";iconSpan.style.width="8px";iconSpan.style.height="8px";iconSpan.style.borderRadius="50%";iconSpan.style.backgroundColor="#000000";iconSpan.style.marginRight="6px";chip.appendChild(iconSpan);const labelSpan=document.createElement("span");labelSpan.textContent=routeNumber||routeId;chip.appendChild(labelSpan);const removeBtn=document.createElement("button");removeBtn.type="button";removeBtn.className="ct-selected-route-remove";removeBtn.setAttribute("aria-label",i18n("ariaRemoveRouteFromMap",{route:routeNameFull},`Remove ${routeNameFull} from map`));removeBtn.style.marginLeft="6px";removeBtn.style.border="none";removeBtn.style.background="transparent";removeBtn.style.cursor="pointer";removeBtn.style.fontSize="0.875rem";removeBtn.textContent="Ã";removeBtn.addEventListener("click",()=>{if(selectedRouteIds.has(routeId)){selectedRouteIds.delete(routeId);updateSelectedRoutesUI();redrawSelectedRoutesOnMap();}});chip.addEventListener("click",(event)=>{if(event.target.classList.contains("ct-selected-route-remove"))return;const routeSummary=routes.find((r)=>r.route_id===routeId)||route||{route_id:routeId};selectRoute(routeSummary,{clearExisting:false,updateCard:true});});chip.addEventListener("keydown",(event)=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();const routeSummary=routes.find((r)=>r.route_id===routeId)||route||{route_id:routeId};selectRoute(routeSummary,{clearExisting:false,updateCard:true});}});chip.appendChild(removeBtn);selectedRoutesContainer.appendChild(chip);});}function clearAllRoutesFromMap(){if(routePolyline){routePolyline.setMap(null);routePolyline=null;}if(routeMarkers&&routeMarkers.length)routeMarkers.forEach((marker)=>marker.setMap(null));routeMarkers=[];}function redrawSelectedRoutesOnMap(){if(!map)return;clearAllRoutesFromMap();selectedRouteIds.forEach((routeId)=>{const cached=routeDetailsCache[routeId];if(cached)displayRouteOnMap(cached,{clearExisting:false});});}function getRouteDisplayName(route){if(!route)return i18n("unknownRoute",null,"Unknown Route");return route.route_short_name?`${route.route_short_name} ${route.route_long_name||""}`.trim():route.route_long_name||i18n("unknownRoute",null,"Unknown Route");}function updateSelectedRoutesUI(){if(!selectedRoutesContainer)selectedRoutesContainer=document.getElementById("ct-selected-routes")||null;if(!selectedRoutesContainer)return;selectedRoutesContainer.innerHTML="";if(!selectedRouteIds||selectedRouteIds.size===0)return;selectedRouteIds.forEach((routeId)=>{const route=routes.find((r)=>r.route_id===routeId)||routeDetailsCache[routeId]||null;const routeName=getRouteDisplayName(route);const chip=document.createElement("div");chip.className="ct-selected-route-chip";chip.setAttribute("data-route-id",routeId);chip.style.display="inline-flex";chip.style.alignItems="center";chip.style.padding="4px 8px";chip.style.marginRight="4px";chip.style.marginTop="4px";chip.style.borderRadius="999px";chip.style.backgroundColor="#e6f2ff";chip.style.color="#001123";chip.style.fontSize="0.875rem";const labelSpan=document.createElement("span");labelSpan.textContent=routeName;chip.appendChild(labelSpan);const removeBtn=document.createElement("button");removeBtn.type="button";removeBtn.className="ct-selected-route-remove";removeBtn.setAttribute("aria-label",i18n("ariaRemoveRouteFromMap",{route:routeName},`Remove ${routeName} from map`));removeBtn.style.marginLeft="6px";removeBtn.style.border="none";removeBtn.style.background="transparent";removeBtn.style.cursor="pointer";removeBtn.style.fontSize="0.875rem";removeBtn.textContent="Ã";removeBtn.addEventListener("click",()=>{if(selectedRouteIds.has(routeId)){selectedRouteIds.delete(routeId);updateSelectedRoutesUI();redrawSelectedRoutesOnMap();}});chip.appendChild(removeBtn);selectedRoutesContainer.appendChild(chip);});}function clearAllRoutesFromMap(){if(routePolyline){routePolyline.setMap(null);routePolyline=null;}
52if(routeMarkers&&routeMarkers.length)routeMarkers.forEach((marker)=>marker.setMap(null));routeMarkers=[];}function redrawSelectedRoutesOnMap(){if(!map)return;clearAllRoutesFromMap();selectedRouteIds.forEach((routeId)=>{const cached=routeDetailsCache[routeId];if(cached)displayRouteOnMap(cached,{clearExisting:false});});}function initMap(){const hartford={lat:41.7658,lng:-72.6734};map=new google.maps.Map(mapElement,{zoom:12,center:hartford,mapTypeId:"roadmap",styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]}]});loadRoutes();}async function loadRoutes(){try{routes=await getSharedRoutes();initAutocomplete();}catch(error){console.error("Error loading routes:",error);}}function initAutocomplete(){const input=document.getElementById("ct-route-search-input");if(!input)return;const suggestions=[];routes.forEach((route)=>{const routeName=route.route_short_name?`${route.route_short_name} ${route.route_long_name||""}`.trim():route.route_long_name||i18n("unknownRoute",null,"Unknown Route");suggestions.push({label:routeName,value:route.route_id,route});});let filteredSuggestions=[];let selectedIndex=-1;let dropdown=null;function syncRouteSearchAriaExpanded(){const expanded=Boolean(dropdown&&dropdown.isConnected&&dropdown.style.display!=="none");input.setAttribute("aria-expanded",expanded?"true":"false");}function createDropdown(){if(dropdown)dropdown.remove();dropdown=document.createElement("div");dropdown.className="ct-route-autocomplete";dropdown.style.cssText="position: absolute; background: white; border: 1px solid #ccc; border-radius: 8px; max-height: 200px; overflow-y: auto; z-index: 1000; width: 100%; margin-top: 4px; left: 0; top: 57px";input.parentElement.style.position="relative";input.parentElement.appendChild(dropdown);syncRouteSearchAriaExpanded();}function showSuggestions(){if(filteredSuggestions.length===0){if(dropdown)dropdown.style.display="none";syncRouteSearchAriaExpanded();return;}if(!dropdown)createDropdown();dropdown.style.display="block";dropdown.innerHTML="";filteredSuggestions.forEach((item,index)=>{const option=document.createElement("div");option.className="ct-autocomplete-option";option.style.cssText="padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #eee; color: #001123;";if(index===selectedIndex)option.style.backgroundColor="#f0f0f0";option.textContent=item.label;option.addEventListener("click",()=>{handleRouteSelection(item.route);input.value="";dropdown.style.display="none";syncRouteSearchAriaExpanded();});option.addEventListener("mouseenter",()=>{selectedIndex=index;updateHighlight();});dropdown.appendChild(option);});syncRouteSearchAriaExpanded();}function updateHighlight(){const options=dropdown.querySelectorAll(".ct-autocomplete-option");options.forEach((opt,idx)=>{opt.style.backgroundColor=idx===selectedIndex?"#f0f0f0":"white";});}function filterSuggestions(query){if(!query){filteredSuggestions=[];showSuggestions();return;}const lowerQuery=query.toLowerCase();filteredSuggestions=suggestions.filter((item)=>item.label.toLowerCase().includes(lowerQuery)).slice(0,10);selectedIndex=-1;showSuggestions();}input.addEventListener("input",(e)=>{filterSuggestions(e.target.value);});input.addEventListener("keydown",(e)=>{if(!dropdown||dropdown.style.display==="none")return;if(e.key==="ArrowDown"){e.preventDefault();selectedIndex=Math.min(selectedIndex+1,filteredSuggestions.length-1);updateHighlight();}else if(e.key==="ArrowUp"){e.preventDefault();selectedIndex=Math.max(selectedIndex-1,-1);updateHighlight();}else if(e.key==="Enter"&&selectedIndex>=0){e.preventDefault();const selectedItem=filteredSuggestions[selectedIndex];handleRouteSelection(selectedItem.route);input.value="";dropdown.style.display="none";syncRouteSearchAriaExpanded();}else{if(e.key==="Escape"){dropdown.style.display="none";syncRouteSearchAriaExpanded();}}});document.addEventListener("click",(e)=>{if(dropdown&&!input.parentElement.contains(e.target)){dropdown.style.display="none";syncRouteSearchAriaExpanded();}});}function handleRouteSelection(routeSummary){if(!routeSummary||!routeSummary.route_id)return;const routeId=routeSummary.route_id;if(!selectedRouteIds.has(routeId)){selectedRouteIds.add(routeId);updateSelectedRoutesUI();}selectRoute(routeSummary,{clearExisting:false});}async function decompressGzip(buffer){if(typeof DecompressionStream==="undefined"||typeof ReadableStream==="undefined"||typeof Blob==="undefined"){console.warn("DecompressionStream API unavailable. Falling back to direct decode.");return new TextDecoder().decode(buffer);}const decompressionStream=new DecompressionStream("gzip");
52const decompressedStream=new Response(new Blob([buffer]).stream().pipeThrough(decompressionStream));return await decompressedStream.text();}async function selectRoute(route,options={}){const routeLookupKey=getRouteLookupKey(route);if(!routeLookupKey)return;const clearExisting=typeof options.clearExisting==="boolean"?options.clearExisting:true;const updateCard=typeof options.updateCard==="boolean"?options.updateCard:true;try{if(routeDetailsCache[routeLookupKey]){const cachedData=routeDetailsCache[routeLookupKey];currentRoute=cachedData;if(cachedData){displayRouteOnMap(cachedData,{clearExisting});if(updateCard)showRouteCard(cachedData);}return;}const apiUrl=getApiUrl(`/gtfs/routes/${encodeURIComponent(routeLookupKey)}`);const response=await fetch(apiUrl,{method:"GET",headers:API_HEADERS});if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);const data=await response.json();let routeData;if(typeof data==="string")routeData=JSON.parse(data);else routeData=data;console.log("Route ID:",routeData.route_id);console.log("Shapes keys:",routeData.shapes?Object.keys(routeData.shapes).slice(0,5):"No shapes");console.log("Stops count:",routeData.stops?routeData.stops.length:0);currentRoute=routeData;routeDetailsCache[routeLookupKey]=routeData;if(routeData){displayRouteOnMap(routeData,{clearExisting});if(updateCard)showRouteCard(routeData);}}catch(error){console.error("Error loading route details:",error);}}function getPrimaryShapePoints(rawShapes){if(!rawShapes)return [];if(typeof rawShapes==="object"&&!Array.isArray(rawShapes)){const shapeEntries=Object.entries(rawShapes).filter(([,points])=>Array.isArray(points));if(shapeEntries.length===0)return [];shapeEntries.sort((a,b)=>b[1].length-a[1].length);const [selectedShapeId,selectedPoints]=shapeEntries[0];console.log("Selected primary shape ID:",selectedShapeId,"with",selectedPoints.length,"points");return selectedPoints;}return Array.isArray(rawShapes)?rawShapes:[];}function normalizeShapes(shapePoints){const normalized=[];if(!shapePoints||shapePoints.length===0)return normalized;shapePoints.forEach((point,index)=>{if(!point)return;if(Array.isArray(point)&&point.length>=2)normalized.push({shape_pt_lon:point[0],shape_pt_lat:point[1],shape_pt_sequence:typeof point[2]==="number"?point[2]:index});else{if(typeof point==="object"){const lat=point.lat||point.shape_pt_lat||point[1];const lon=point.lon||point.shape_pt_lon||point[0];if(typeof lat==="number"&&typeof lon==="number")normalized.push({shape_pt_lat:lat,shape_pt_lon:lon,shape_pt_sequence:point.shape_pt_sequence||point.sequence||index});}}});return normalized;}function getSortedStops(stops){if(!stops||stops.length===0)return [];const getStopSequence=(stop,direction)=>
52{if(!stop.times||stop.times.length===0)return null;const relevantTimes=direction!==undefined?stop.times.filter((t)=>t.direction===direction):stop.times;if(relevantTimes.length===0)return null;return Math.min(...relevantTimes.map((t)=>t.sequence||Infinity));};const hasDirections=stops.some((stop)=>stop.times&&stop.times.some((t)=>t.direction!==undefined));let sortedStops=[];if(hasDirections){const directionCounts={};stops.forEach((stop)=>{if(stop.times)stop.times.forEach((t)=>{if(t.direction!==undefined)directionCounts[t.direction]=(directionCounts[t.direction]||0)+1;});});const primaryDirection=Object.keys(directionCounts).length>0?Object.keys(directionCounts).reduce((a,b)=>directionCounts[a]>directionCounts[b]?a:b):0;sortedStops=stops.filter((stop)=>getStopSequence(stop,primaryDirection)!==null).sort((a,b)=>{const aSeq=getStopSequence(a,primaryDirection);const bSeq=getStopSequence(b,primaryDirection);if(aSeq!==null&&bSeq!==null&&aSeq!==Infinity&&bSeq!==Infinity)return aSeq-bSeq;return 0;});const remainingStops=stops.filter((stop)=>getStopSequence(stop,primaryDirection)===null);sortedStops=[...sortedStops,...remainingStops];}else sortedStops=[...stops].sort((a,b)=>{const aSeq=getStopSequence(a);const bSeq=getStopSequence(b);if(aSeq!==null&&bSeq!==null&&aSeq!==Infinity&&bSeq!==Infinity)return aSeq-bSeq;return 0;});return sortedStops;}function displayRouteOnMap(routeData,options={}){const clearExisting=typeof options.clearExisting==="boolean"?options.clearExisting:true;if(!map){console.error("Map not initialized");return;}console.log("Displaying route on map:",routeData);if(clearExisting){if(routePolyline){routePolyline.setMap(null);routePolyline=null;}routeMarkers.forEach((marker)=>marker.setMap(null));routeMarkers=[];}const rawShapes=routeData.shapes||routeData.shape||routeData.shape_points||[];console.log("Raw shapes type:",typeof rawShapes,Array.isArray(rawShapes)?"array":"object");if(rawShapes&&typeof rawShapes==="object"&&!Array.isArray(rawShapes)){console.log("Raw shapes keys:",Object.keys(rawShapes).slice(0,5));const firstKey=Object.keys(rawShapes)[0];if(firstKey&&rawShapes[firstKey])console.log("First shape sample:",rawShapes[firstKey].slice(0,2));}const primaryShapePoints=getPrimaryShapePoints(rawShapes);console.log("Primary shape points selected:",primaryShapePoints.length);const shapes=normalizeShapes(primaryShapePoints);const stops=routeData.stops||routeData.stop||routeData.stop_points||[];console.log("Normalized shapes:",shapes.length,"Stops found:",stops.length);if(shapes.length>0)console.log("First normalized shape:",shapes[0]);let path=[];let bounds=new google.maps.LatLngBounds();if(shapes.length>0){const sortedShapes=[...shapes].sort((a,b)=>{const aSeq=parseFloat(a.shape_pt_sequence||a.sequence||a[2]||0);const bSeq=parseFloat(b.shape_pt_sequence||b.sequence||b[2]||0);return aSeq-bSeq;});path=sortedShapes.map((shape)=>{const lat=parseFloat(shape.shape_pt_lat||shape.lat||shape[1]);const lng=parseFloat(shape.shape_pt_lon||shape.lng||shape[0]);if(isNaN(lat)||isNaN(lng))return null;return {lat,lng};}).filter((point)=>point!==null);console.log(`Route polyline drawn from ${path.length} shapes (sorted by sequence)`);}else{if(stops.length>0){const sortedStops=getSortedStops(stops);path=sortedStops.map((stop)=>{const lat=parseFloat(stop.stop_lat||stop.lat||stop[1]);const lng=parseFloat(stop.stop_lon||stop.lng||stop[0]);if(isNaN(lat)||isNaN(lng))return null;return {lat,lng};}).filter((point)=>point!==null);console.log(`Route polyline drawn from ${path.length} stops (sorted by sequence)`);}}if(path.length>0){let routeColor="#FF0000";if(routeData.route_color)routeColor=routeData.route_color.startsWith("#")?routeData.route_color:`#${routeData.route_color}`;routePolyline=new google.maps.Polyline({path,geodesic:true,strokeColor:routeColor,strokeOpacity:0.8,strokeWeight:4});routePolyline.setMap(map);path.forEach((point)=>{if(point&&typeof point.lat==="number"&&typeof point.lng==="number")bounds.extend(point);});if(!bounds.isEmpty()){map.fitBounds(bounds,{padding:50});console.log("Map bounds fitted to route with",path.length,"points");}else console.warn("Bounds are empty, cannot fit map");console.log("Route polyline successfully drawn with",path.length,"points");}else{console.warn("No valid path points found - cannot draw route");console.warn("Shapes:",shapes.length,"Stops:",stops.length);}if(stops.length>0){stops.forEach((stop)=>{const lat=parseFloat(stop.stop_lat||stop.lat||stop[1]);const lng=parseFloat(stop.stop_lon||stop.lng||stop[0]);const name=stop.stop_name||stop.name||"";if(!isNaN(lat)&&!isNaN(lng)){const marker=new google.maps.Marker({position:{lat,lng},map,title:name,icon:{path:google.maps.SymbolPath.CIRCLE,scale:6,fillColor:"#66c4ff",fillOpacity:1,strokeColor:"#fff",strokeWeight:2}});routeMarkers.push(marker);}});console.log("Added",routeMarkers.length,"stop markers");}}function showRouteCard(routeData){const card=document.getElementById("ct-route-card");const titleEl=document.getElementById("ct-route-title");const descEl=document.getElementById("ct-route-description");const linkEl=document.getElementById("ct-route-link");if(!card)return;const routeName=routeData.route_short_name?`${routeData.route_short_name} ${routeData.route_long_name||""}`.trim():routeData.route_long_name||i18n("unknownRoute",null,"Unknown Route");
52if(titleEl)titleEl.textContent=routeName;if(descEl){const stops=routeData.stops||routeData.stop||routeData.stop_points||[];if(stops.length>0){const sortedStops=getSortedStops(stops);if(sortedStops.length>0){const uniqueStops=[];const seenKeys=new Set();sortedStops.forEach((stop)=>{const stopId=stop.stop_id||stop.id||"";const stopName=(stop.stop_name||stop.name||"").trim();const key=stopId||stopName;if(key&&!seenKeys.has(key)){seenKeys.add(key);uniqueStops.push(stop);}});if(uniqueStops.length>0){const firstStop=uniqueStops[0];const lastStop=uniqueStops[uniqueStops.length-1];const middleStops=uniqueStops.length>2?uniqueStops.slice(1,-1):[];const firstStopName=firstStop.stop_name||firstStop.name||i18n("stopFallbackStart",null,"Starting point");const lastStopName=lastStop.stop_name||lastStop.name||i18n("stopFallbackEnd",null,"Ending point");let description=`${i18n("routeLabel",null,"Route")} ${routeData.route_short_name||""} ${i18n("operatesBetween",null,"operates between")} ${firstStopName} ${i18n("and",null,"and")} ${lastStopName}`;if(middleStops.length>0){const stopNames=middleStops.map((stop)=>(stop.stop_name||stop.name||"").trim()).filter((name)=>name&&name!==""&&name!==firstStopName&&name!==lastStopName);const uniqueStopNames=[...new Set(stopNames)];if(uniqueStopNames.length>0){const maxStops=4;const displayStops=uniqueStopNames.slice(0,maxStops);const stopList=displayStops.join(", ");description+=` ${i18n("withStopsOn",null,"with stops on")} ${stopList}`;if(uniqueStopNames.length>maxStops)description+=i18n("andMore",null,", and more");}}description+=".";descEl.textContent=description;}else{let description=routeData.route_long_name||"";if(routeData.route_desc)description+=(description?". ":"")+routeData.route_desc;descEl.textContent=description||i18n("routeInfoFallback",null,"Route information available.");}}else{let description=routeData.route_long_name||"";if(routeData.route_desc)description+=(description?". ":"")+routeData.route_desc;descEl.textContent=description||i18n("routeInfoFallback",null,"Route information available.");}}else{let description=routeData.route_long_name||"";if(routeData.route_desc)description+=(description?". ":"")+routeData.route_desc;descEl.textContent=description||i18n("routeInfoFallback",null,"Route information available.");}}if(linkEl){const routeLookupKey=getRouteLookupKey(routeData);linkEl.href=routeLookupKey?`/schedules/${encodeURIComponent(routeLookupKey)}`:"/schedules";}card.style.display="block";}const viewRouteBtn=document.getElementById("ct-view-route-btn");if(viewRouteBtn)viewRouteBtn.addEventListener("click",()=>{const input=document.getElementById("ct-route-search-input");const query=input?input.value.trim():"";if(!query)return;const matchingRoute=routes.find((route)=>{const routeName=route.route_short_name?`${route.route_short_name} ${route.route_long_name||""}`.trim():route.route_long_name||"";return routeName.toLowerCase().includes(query.toLowerCase());});if(matchingRoute){handleRouteSelection(matchingRoute);if(input)input.value="";}});function waitForGoogleMaps(callback,maxAttempts=50){if(typeof google!=="undefined"&&typeof google.maps!=="undefined"){callback();return;}if(maxAttempts<=0){console.error("Google Maps API failed to load");return;}setTimeout(()=>{waitForGoogleMaps(callback,maxAttempts-1);},100);}waitForGoogleMaps(initMap);}Drupal.behaviors.serviceMap={attach:function(context){initServiceMapBehavior(context);}};})(Drupal);; 53"use strict";function initScrollToTop(context){var doc=context||document;var scrollTopBtn=doc.getElementById("scrollTopBtn");if(!scrollTopBtn)return;if(scrollTopBtn.hasAttribute("data-scroll-to-top-attached"))return;scrollTopBtn.setAttribute("data-scroll-to-top-attached","true");function onScroll(){var scrollTop=document.body.scrollTop||document.documentElement.scrollTop;scrollTopBtn.style.display=scrollTop>100?"block":"none";}window.addEventListener("scroll",onScroll,{passive:true});onScroll();scrollTopBtn.addEventListener("click",function(e){e.preventDefault();window.scrollTo({top:0,left:0,behavior:"smooth"});function forceScrollTop(){document.documentElement.scrollTop=0;document.body.scrollTop=0;}setTimeout(forceScrollTop,400);var skipLink=document.querySelector('a[href="#main-content"]');if(skipLink)skipLink.focus();});}if(typeof Drupal!=="undefined")(function(Drupal){Drupal.behaviors.scrollToTop={attach:function(context,settings){initScrollToTop(context);}};})(Drupal);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){initScrollToTop(document);});else initScrollToTop(document);; 54(function($,Drupal){"use strict";function setArrowDisabledState($button,isDisabled){if(!$button||!$button.length)return;$button.attr("aria-disabled",isDisabled?"true":"false");$button.prop("disabled",isDisabled);}function fixSlideFocusability($slider){$slider.find(".slick-slide").each(function(){this.removeAttribute("tabindex");});}function getSlidesToShowForViewport(){var width=window.innerWidth;if(width<768)return 1;if(width<992)return 2;return 3;}function shouldDisableArrows($slider){var itemCount=$slider.find(".slider-item").length;return itemCount<=getSlidesToShowForViewport();}function initServiceCardsSlider(context){var $scope=context?$(context):$(document);var $sliders=$scope.find(".cards-slider").addBack().filter(".cards-slider");if(typeof $.fn.slick==="undefined"||!$sliders.length)return;$sliders.each(function(){var $el=$(this);if($el.hasClass("slick-initialized"))return;var $section=$el.closest(".ct-card-slider-section");var prevBtn=$section.find(".slider-btn.prev-btn").first();var nextBtn=$section.find(".slider-btn.next-btn").first();var slickOpts={slidesToShow:3,slidesToScroll:1,autoplay:false,autoplaySpeed:3000,dots:false,arrows:true,infinite:false,adaptiveHeight:false,responsive:[{breakpoint:992,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:768,settings:{slidesToShow:1,slidesToScroll:1,dots:false,arrows:true}}],accessibility:true,focusOnSelect:false,focusOnChange:false,pauseOnFocus:true,pauseOnHover:true};if(prevBtn.length)slickOpts.prevArrow=prevBtn;if(nextBtn.length)slickOpts.nextArrow=nextBtn;function updateArrowDisabledState(){var disableArrows=shouldDisableArrows($el);setArrowDisabledState(prevBtn,disableArrows);setArrowDisabledState(nextBtn,disableArrows);}
54function syncSliderA11y(){updateArrowDisabledState();fixSlideFocusability($el);}$el.on("init reInit afterChange setPosition",syncSliderA11y);updateArrowDisabledState();$el.slick(slickOpts);fixSlideFocusability($el);});}$(document).ready(function(){var retryCount=0;var maxRetries=50;function tryInitSlider(){if(typeof $.fn.slick!=="undefined"&&$(".cards-slider").length)initServiceCardsSlider();else if(typeof $.fn.slick==="undefined"&&retryCount<maxRetries){retryCount++;setTimeout(tryInitSlider,100);}else{if(retryCount>=maxRetries)console.error("Slick slider failed to load after multiple attempts. Please check that slick-carousel is included.");}}tryInitSlider();});if(typeof Drupal!=="undefined")Drupal.behaviors.serviceCardsSlider={attach:function(context,settings){initServiceCardsSlider(context);}};})(jQuery,window.Drupal);; 55(function(Drupal,drupalSettings){"use strict";function i18n(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.t==="function")return window.CTI18n.t("schedule-detail",key,vars,fallback);return typeof fallback==="string"?fallback:key;}function i18nHtml(key,fallback){if(window.CTI18n&&typeof window.CTI18n.html==="function")return window.CTI18n.html("schedule-detail",key,fallback);return typeof fallback==="string"?fallback:"";}function i18nHtmlWithVars(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.htmlWithVars==="function")return window.CTI18n.htmlWithVars("schedule-detail",key,vars,fallback);return typeof fallback==="string"?fallback:"";}const API_BASE_URL="https://cttransit.alerts.api.exemplifi.io/api/v1";const API_HEADERS={Accept:"application/json","X-API-KEY":"sk_live_SOdoS2lNrADb82dOIDtRcz_t33L3Zx0t"};function getApiUrl(endpoint){return `${API_BASE_URL}${endpoint}`;}function fetchRoutesIndexRaw(){if(typeof window!=="undefined"&&window.ctGtfsRoutesIndexPromise instanceof Promise)return window.ctGtfsRoutesIndexPromise;const routesIndexPromise=fetch(getApiUrl("/routes"),{method:"GET",headers:API_HEADERS}).then((response)=>{if(!response.ok)throw new Error(`HTTP error loading routes: ${response.status}`);return response.json();});if(typeof window!=="undefined")window.ctGtfsRoutesIndexPromise=routesIndexPromise;return routesIndexPromise;}function dedupeRoutesByShortName(routes){if(!Array.isArray(routes))return [];const seen=new Map();routes.forEach((route)=>{const key=String((route&&route.route_short_name)||(route&&route.shortName)||"").trim().toLowerCase();if(!key||seen.has(key))return;seen.set(key,route);});return Array.from(seen.values());}const ROUTE_STAR_MERGES={567:"567*"};function readScheduleDownloadUrls(container){const routeMapPdf=(container.getAttribute("data-ct-gtfs-route-map")||"").trim();const routeMapHtml=(container.getAttribute("data-ct-gtfs-route-map-html")||"").trim();return {routeMap:routeMapPdf||routeMapHtml,weekdayPdf:(container.getAttribute("data-ct-gtfs-weekday-pdf")||"").trim(),weekendPdf:(container.getAttribute("data-ct-gtfs-weekend-pdf")||"").trim(),saturdayPdf:(container.getAttribute("data-ct-gtfs-saturday-pdf")||"").trim(),sundayPdf:(container.getAttribute("data-ct-gtfs-sunday-pdf")||"").trim()};}function timeToMinutes(value){const timeValue=getTimeValue(value);if(!timeValue)return null;const parts=String(timeValue).split(":");if(parts.length<2)return null;const hours=parseInt(parts[0],10);const minutes=parseInt(parts[1],10);if(Number.isNaN(hours)||Number.isNaN(minutes))return null;return hours*60+minutes;}function getTimeValue(entry){if(entry==null)return null;if(typeof entry==="object")return entry.time||entry.departure_time||entry.arrival_time||null;return entry;}function hasAsteriskFlag(entry){return !!(entry&&typeof entry==="object"&&entry.asterisk);}function formatTimeDisplay(value,asterisk){const timeValue=getTimeValue(value);const showAsterisk=typeof asterisk==="boolean"?asterisk:hasAsteriskFlag(value);if(!timeValue)return i18n("emptyTimePlaceholder",null,"â");const minutes=timeToMinutes(timeValue);if(minutes===null)return showAsterisk?String(timeValue)+"*":String(timeValue);const hours24=Math.floor(minutes/60)%24;const mins=minutes%60;const period=hours24>=12?i18n("periodPm",null,"PM"):i18n("periodAm",null,"AM");let hours12=hours24%12;if(hours12===0)hours12=12;const display=`${hours12}:${mins<10?"0"+mins:mins} ${period}`;return showAsterisk?display+"*":display;}async function fetchJson(endpoint){const response=await fetch(getApiUrl(endpoint),{method:"GET",headers:API_HEADERS});if(!response.ok)throw new Error(`HTTP error ${endpoint}: ${response.status}`);let data=await response.json();if(typeof data==="string")data=JSON.parse(data);return data;}async function fetchRouteDetailPayload(routeKey){return fetchJson(`/gtfs/routes/${encodeURIComponent(routeKey)}`);}function getLookupRoutes(data){if(Array.isArray(data?.routes))return data.routes;if(Array.isArray(data))return data;if(data&&data.route_id)return [data];return [];}function mergeShapeMaps(target,source){const out=target&&typeof target==="object"?{...target}:{};if(!source||typeof source!=="object")return out;Object.keys(source).forEach((shapeId)=>{const points=source[shapeId];if(!Array.isArray(points)||!points.length)return;if(!Array.isArray(out[shapeId])||!out[shapeId].length)out[shapeId]=points;});return out;}function coerceToTripsPayload(raw){if(!raw||Array.isArray(raw.trips))return raw;const tripsById={};
55(raw.stops||[]).forEach((stop)=>{(stop.times||[]).forEach((time,timeIndex)=>{if(!time)return;const tripId=time.trip_id||`legacy_${(time.headsign||"unknown").replace(/[^a-zA-Z0-9]/g,"_")}_${time.direction||"0"}_${timeIndex}`;if(!tripsById[tripId])tripsById[tripId]={trip_id:time.trip_id||tripId,direction:time.direction??0,headsign:time.headsign||"",day_type:time.day_type||"",service_id:time.service_id||"",shape_id:time.shape_id||"",asterisk:!!time.asterisk,stop_times:[]};tripsById[tripId].stop_times.push({stop_id:stop.stop_id,departure_time:time.departure_time||time.arrival_time||null,arrival_time:time.arrival_time||null,sequence:time.sequence||0,timepoint:time.timepoint,asterisk:!!time.asterisk});if(time.asterisk)tripsById[tripId].asterisk=true;});});return {...raw,trips:Object.values(tripsById)};}function attachScheduleWindowToTrips(raw,lookupMeta){const coerced=coerceToTripsPayload(raw)||{};const start=parseGtfsDate(coerced.schedule_start_date)||parseGtfsDate(lookupMeta?.schedule_start_date);const end=parseGtfsDate(coerced.schedule_end_date)||parseGtfsDate(lookupMeta?.schedule_end_date);const trips=(coerced.trips||[]).map((trip)=>({...trip,schedule_start_date:parseGtfsDate(trip.schedule_start_date)||start||null,schedule_end_date:parseGtfsDate(trip.schedule_end_date)||end||null}));return {...coerced,trips,schedule_start_date:start||coerced.schedule_start_date||null,schedule_end_date:end||coerced.schedule_end_date||null,route_short_name:coerced.route_short_name||lookupMeta?.route_short_name||"",route_long_name:coerced.route_long_name||lookupMeta?.route_long_name||"",route_color:coerced.route_color||lookupMeta?.route_color,route_text_color:coerced.route_text_color||lookupMeta?.route_text_color,route_desc:coerced.route_desc!=null?coerced.route_desc:lookupMeta?.route_desc||"",agency:coerced.agency||lookupMeta?.agency,categories:coerced.categories||lookupMeta?.categories||[]};}function mergeRouteDetailPayloads(payloads,shortName,lookupRoutes){const list=(payloads||[]).filter(Boolean);if(!list.length)return null;const stopsById=new Map();const trips=[];let shapes={};let minDate=null;let maxDate=null;list.forEach((payload)=>{(payload.stops||[]).forEach((stop)=>{if(!stop||stop.stop_id==null)return;const stopId=String(stop.stop_id);if(!stopsById.has(stopId))stopsById.set(stopId,stop);});(payload.trips||[]).forEach((trip)=>{trips.push(trip);const start=parseGtfsDate(trip.schedule_start_date);const end=parseGtfsDate(trip.schedule_end_date);if(start&&(!minDate||start<minDate))minDate=start;if(end&&(!maxDate||end>maxDate))maxDate=end;});const payloadStart=parseGtfsDate(payload.schedule_start_date);const payloadEnd=parseGtfsDate(payload.schedule_end_date);if(payloadStart&&(!minDate||payloadStart<minDate))minDate=payloadStart;if(payloadEnd&&(!maxDate||payloadEnd>maxDate))maxDate=payloadEnd;shapes=mergeShapeMaps(shapes,payload.shapes);});const today=toYmd(new Date());const coveringLookup=(lookupRoutes||[]).find((route)=>{const start=parseGtfsDate(route.schedule_start_date);const end=parseGtfsDate(route.schedule_end_date);return (!start||start<=today)&&(!end||end>=today);});const metaSource=coveringLookup||lookupRoutes?.[0]||list[0]||{};const coveringPayload=list.find((payload)=>String(payload.route_id||"")===String(metaSource.route_id||""))||list[0];return {...coveringPayload,id:metaSource.route_id||coveringPayload.route_id||shortName,route_id:metaSource.route_id||coveringPayload.route_id||shortName,route_short_name:metaSource.route_short_name||coveringPayload.route_short_name||shortName,route_long_name:metaSource.route_long_name||coveringPayload.route_long_name||"",route_color:metaSource.route_color||coveringPayload.route_color,route_text_color:metaSource.route_text_color||coveringPayload.route_text_color,route_desc:metaSource.route_desc!=null?metaSource.route_desc:coveringPayload.route_desc||"",agency:metaSource.agency||coveringPayload.agency,categories:metaSource.categories||coveringPayload.categories||[],stops:Array.from(stopsById.values()),trips,shapes,schedule_start_date:minDate,schedule_end_date:maxDate};}async function fetchMergedRouteDetailByShortName(shortName){const lookup=await fetchJson(`/gtfs/routes/short-name/${encodeURIComponent(shortName)}`);const lookupRoutes=getLookupRoutes(lookup);const lookupById=new Map(lookupRoutes.filter((route)=>route&&route.route_id!=null).map((route)=>[String(route.route_id),route]));const routeIds=unique(lookupRoutes.map((route)=>
55String(route.route_id||"").trim()).filter(Boolean));if(!routeIds.length)throw new Error(`No route ids found for short name ${shortName}`);const results=await Promise.allSettled(routeIds.map((routeId)=>fetchRouteDetailPayload(routeId)));const payloads=[];results.forEach((result,index)=>{const routeId=routeIds[index];if(result.status!=="fulfilled"||!result.value){console.warn(`Unable to load route detail for ${routeId}:`,result.reason);return;}payloads.push(attachScheduleWindowToTrips(result.value,lookupById.get(routeId)||{}));});if(!payloads.length)throw new Error(`Unable to load route details for ${shortName}`);return mergeRouteDetailPayloads(payloads,shortName,lookupRoutes);}function mergeStarRouteIntoPrimary(primaryData,starData){if(!primaryData||!starData)return primaryData;const markedStar=attachScheduleWindowToTrips(starData,{});markedStar.trips=(markedStar.trips||[]).map((trip)=>({...trip,asterisk:true,stop_times:(trip.stop_times||[]).map((stopTime)=>({...stopTime,asterisk:true}))}));return mergeRouteDetailPayloads([primaryData,markedStar],primaryData.route_short_name,[]);}function unique(array){return Array.from(new Set(array));}function parseRouteVariantCodeFromHeadsign(headsign,routeShortName){const h=String(headsign||"").trim();const base=String(routeShortName||"").trim();if(!h)return base?base.toUpperCase():"";const m=h.match(/^(\d+[A-Za-z0-9]*)\s*-/);if(m&&m[1])return m[1].toUpperCase();if(base){const escaped=base.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const m2=h.match(new RegExp("^\\s*"+escaped+"\\s*([A-Za-z0-9]+)","i"));if(m2&&m2[1])return (base+m2[1]).toUpperCase();}return base?base.toUpperCase():"";}function getShapePointSortKey(point,index){const seq=point.seq??point.sequence??point.shape_pt_sequence??point.shape_pt_order;if(seq!=null&&seq!==""){const n=parseFloat(seq,10);return Number.isNaN(n)?index:n;}return index;}function shapePointsToLatLngPath(points){if(!Array.isArray(points)||!points.length)return [];const mapped=points.map((pt,idx)=>{const lat=parseFloat(pt.lat??pt.shape_pt_lat??pt.latitude??(Array.isArray(pt)?pt[1]:NaN),10);const lng=parseFloat(pt.lon??pt.lng??pt.shape_pt_lon??pt.longitude??(Array.isArray(pt)?pt[0]:NaN),10);return {lat,lng,sortKey:getShapePointSortKey(pt,idx)};}).filter((p)=>!Number.isNaN(p.lat)&&!Number.isNaN(p.lng));mapped.sort((a,b)=>a.sortKey-b.sortKey);return mapped.map(({lat,lng})=>({lat,lng}));}function haversineMeters(a,b){const R=6371000;const dLat=((b.lat-a.lat)*Math.PI)/180;const dLng=((b.lng-a.lng)*Math.PI)/180;const lat1=(a.lat*Math.PI)/180;const lat2=(b.lat*Math.PI)/180;const x=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.sin(dLng/2)*Math.sin(dLng/2)*Math.cos(lat1)*Math.cos(lat2);return 2*R*Math.asin(Math.min(1,Math.sqrt(x)));}function maybeOrientPathToDirection(path,startStop,endStop){if(!path.length||!startStop||!endStop)return path;const first={lat:startStop.stop_lat,lng:startStop.stop_lon};const last={lat:endStop.stop_lat,lng:endStop.stop_lon};const p0=path[0];const pN=path[path.length-1];const fwd=haversineMeters(p0,first)+haversineMeters(pN,last);const rev=haversineMeters(pN,first)+haversineMeters(p0,last);if(rev+400<fwd)return path.slice().reverse();return path;}function buildShapePaths(shapesObj,directionStopsFull){const firstStop=directionStopsFull[0];const lastStop=directionStopsFull[directionStopsFull.length-1]||firstStop;return Object.entries(shapesObj||{}).map(([shapeId,pts])=>{let path=shapePointsToLatLngPath(pts);path=maybeOrientPathToDirection(path,firstStop,lastStop);return {shapeId,path};}).filter((entry)=>entry.path.length>=2);}function cleanStopName(stopName){if(!stopName)return "";return stopName.replace(/@/g,"/").trim();}function computeFrequencyHint(times){if(!times||times.length<2)return null;const deltas=[];for(let i=1;i<times.length;i+=1){const t1=timeToMinutes(times[i-1]);const t2=timeToMinutes(times[i]);if(t1!==null&&t2!==null&&t2>t1)deltas.push(t2-t1);}if(!deltas.length)return null;deltas.sort((a,b)=>a-b);const median=deltas[Math.floor(deltas.length/2)];if(!median)return null;if(median%60===0){const hours=median/60;if(hours>1)return i18n("runsEveryHoursPlural",{hours},`Runs every ${hours} hours`);return i18n("runsEveryHours",{hours},`Runs every ${hours} hour`);}return i18n("runsEveryMinutes",{minutes:median},`Runs every ${median} min`);}function parseGtfsDate(value){if(value==null||value==="")return null;const raw=String(value).trim();if(/^\d{8}$/.test(raw))return `${raw.slice(0,4)}-${raw.slice(4,6)}-${raw.slice(6,8)}`;if(/^\d{4}-\d{2}-\d{2}$/.test(raw))return raw;return null;}function toYmd(date){if(!(date instanceof Date)||Number.isNaN(date.getTime()))return null;const year=date.getFullYear();const month=String(date.getMonth()+1).padStart(2,"0");const day=String(date.getDate()).padStart(2,"0");return `${year}-${month}-${day}`;}function parseYmdLocal(ymd){const normalized=parseGtfsDate(ymd);if(!normalized)return null;const parts=normalized.split("-").map((part)=>parseInt(part,10));if(parts.length!==3||parts.some((part)=>Number.isNaN(part)))return null;const date=new Date(parts[0],parts[1]-1,parts[2]);if(Number.isNaN(date.getTime()))return null;return date;}function formatScheduleDateLabel(ymd){const date=parseYmdLocal(ymd);if(!date)return String(ymd||"");return date.toLocaleDateString(undefined,{weekday:"short",month:"short",day:"numeric",year:"numeric"});}function getDayBucketForDate(ymd){const date=parseYmdLocal(ymd);if(!date)return "weekdays";const weekday=date.getDay();if(weekday===0)return "sunday";if(weekday===6)return "saturday";return "weekdays";}function weekdaysFromDayType(dayTypeRaw,serviceIdRaw){const serviceId=(serviceIdRaw||"").toString().toLowerCase();const raw=(dayTypeRaw||"").toString().trim().toLowerCase();const days=new Set();const addRange=(values)=>
55{values.forEach((day)=>days.add(day));};const addToken=(token)=>{if(!token)return;const t=token.toString().trim().toLowerCase();if(!t||t==="unknown")return;if(t==="mon-fri"||t==="monday-friday"||t==="weekday"||t==="weekdays"||t==="weekday-only"){addRange([1,2,3,4,5]);return;}if(t==="sat-sun"||t==="weekend"||t==="weekends"){addRange([0,6]);return;}if(t==="daily"||t==="all"||t==="everyday"){addRange([0,1,2,3,4,5,6]);return;}if(t==="exceptions"||t==="exception")return;if(["sunday","sun"].includes(t)){days.add(0);return;}if(["monday","mon"].includes(t)){days.add(1);return;}if(["tuesday","tue","tues"].includes(t)){days.add(2);return;}if(["wednesday","wed"].includes(t)){days.add(3);return;}if(["thursday","thu","thur","thurs"].includes(t)){days.add(4);return;}if(["friday","fri"].includes(t)){days.add(5);return;}if(["saturday","sat"].includes(t))days.add(6);};if(!raw){if(serviceId.includes("saturday")||serviceId.includes("sat"))days.add(6);if(serviceId.includes("sunday")||serviceId.includes("sun"))days.add(0);if(!days.size)addRange([1,2,3,4,5]);return Array.from(days);}raw.split(/[,\s]+/).forEach(addToken);if(!days.size){if(isExceptionDayType(raw))return [];if(serviceId.includes("saturday")||serviceId.includes("sat"))days.add(6);else if(serviceId.includes("sunday")||serviceId.includes("sun"))days.add(0);else addRange([0,1,2,3,4,5,6]);}return Array.from(days);}function isExceptionDayType(dayTypeRaw){const t=String(dayTypeRaw||"").trim().toLowerCase();return t==="exceptions"||t==="exception";}function getDateList(trip,keys){if(!trip)return [];for(let i=0;i<keys.length;i+=1){const value=trip[keys[i]];if(Array.isArray(value)&&value.length)return value.map((item)=>parseGtfsDate(item)).filter(Boolean);}return [];}function getAddedServiceDates(trip){return getDateList(trip,["service_dates","dates"]);}function getExceptDates(trip){return getDateList(trip,["except_dates","exceptDates"]);}function tripOperatesOnDate(trip,ymd){if(!trip||!ymd)return false;const day=parseGtfsDate(ymd)||ymd;const start=parseGtfsDate(trip.schedule_start_date);const end=parseGtfsDate(trip.schedule_end_date);if(start&&day<start)return false;if(end&&day>end)return false;const addedDates=getAddedServiceDates(trip);if(addedDates.includes(day))return true;if(isExceptionDayType(trip.day_type))return false;if(getExceptDates(trip).includes(day))return false;const date=parseYmdLocal(day);if(!date)return false;const weekdays=weekdaysFromDayType(trip.day_type,trip.service_id);return weekdays.includes(date.getDay());}const OUTBOUND_DIRECTION_ID="0";function sortDirectionOrder(directionOrder){return directionOrder.slice().sort((a,b)=>{if(a===OUTBOUND_DIRECTION_ID)return -1;if(b===OUTBOUND_DIRECTION_ID)return 1;const aNum=parseInt(a,10);const bNum=parseInt(b,10);if(!Number.isNaN(aNum)&&!Number.isNaN(bNum)&&aNum!==bNum)return aNum-bNum;return String(a).localeCompare(String(b));});}function getOperatingTrips(normalized,ymd,direction){const trips=normalized?.trips||[];return trips.filter((trip)=>{if(!tripOperatesOnDate(trip,ymd))return false;if(direction==null||direction==="")return true;return String(trip.direction??"0")===String(direction);});}function getAvailableDirectionsForDate(normalized,ymd){const dirs=unique(getOperatingTrips(normalized,ymd).map((trip)=>String(trip.direction??"0")));return sortDirectionOrder(dirs);}function getDefaultOutboundDirection(normalized,ymd){const availableForDate=getAvailableDirectionsForDate(normalized,ymd);if(availableForDate.includes(OUTBOUND_DIRECTION_ID))return OUTBOUND_DIRECTION_ID;const order=normalized?.directionOrder||[];if(order.includes(OUTBOUND_DIRECTION_ID))return OUTBOUND_DIRECTION_ID;return order[0]||availableForDate[0]||OUTBOUND_DIRECTION_ID;}function buildDirectionStopsFromTrips(trips,stopsById){const stopEntries=[];const stopIndex=new Map();(trips||[]).forEach((trip)=>{(trip.stop_times||[]).forEach((stopTime)=>{if(!stopTime||stopTime.stop_id==null)return;const stopId=String(stopTime.stop_id);let stop=stopsById.get(stopId);if(!stop){stop={stop_id:stopId,stop_name:stopId,stop_lat:0,stop_lon:0};stopsById.set(stopId,stop);}let stopEntry=stopIndex.get(stopId);if(!stopEntry){stopEntry={stop_id:stopId,stop_name:cleanStopName(stop.stop_name),stop_lat:stop.stop_lat,stop_lon:stop.stop_lon,sequence:stopTime.sequence||0,times:[]};stopIndex.set(stopId,stopEntry);stopEntries.push(stopEntry);}else{if(stopTime.sequence!=null&&Number(stopTime.sequence)<Number(stopEntry.sequence))stopEntry.sequence=stopTime.sequence;}stopEntry.times.push({arrival_time:stopTime.arrival_time,departure_time:stopTime.departure_time,headsign:trip.headsign||"",trip_id:trip.trip_id||"",sequence:stopTime.sequence||stopEntry.sequence||0,timepoint:typeof stopTime.timepoint==="number"?stopTime.timepoint:parseInt(stopTime.timepoint||"0",10)||0,asterisk:!!(stopTime.asterisk||trip.asterisk)});});});stopEntries.sort((a,b)=>a.sequence-b.sequence);
55stopEntries.forEach((stop)=>{stop.times.sort((a,b)=>{return (timeToMinutes(a.departure_time||a.arrival_time)-timeToMinutes(b.departure_time||b.arrival_time));});});return stopEntries;}function buildDirectionStopsForDate(normalized,ymd,direction){return buildDirectionStopsFromTrips(getOperatingTrips(normalized,ymd,direction),normalized.stopsById);}function normalizeRouteDetail(raw){const stopsById=new Map();(raw.stops||[]).forEach((stop)=>{if(stop&&stop.stop_id!=null)stopsById.set(String(stop.stop_id),stop);});const trips=(raw.trips||[]).map((trip)=>({...trip,direction:trip.direction??0,schedule_start_date:parseGtfsDate(trip.schedule_start_date),schedule_end_date:parseGtfsDate(trip.schedule_end_date)}));const directionOrder=[];const directionHeadsigns={};const stopsByDirection={};trips.forEach((trip)=>{const dir=String(trip.direction??"0");if(!directionOrder.includes(dir))directionOrder.push(dir);if(!directionHeadsigns[dir]&&trip.headsign)directionHeadsigns[dir]=trip.headsign;});sortDirectionOrder(directionOrder).forEach((dir)=>{stopsByDirection[dir]=buildDirectionStopsFromTrips(trips.filter((trip)=>String(trip.direction??"0")===dir),stopsById);});const sortedDirectionOrder=sortDirectionOrder(directionOrder);const headsignPairs=sortedDirectionOrder.map((dir)=>({direction:dir,headsign:directionHeadsigns[dir]||`Direction ${dir}`}));const shapeIdBranchHints=new Map();trips.forEach((trip)=>{const sid=trip.shape_id!=null&&String(trip.shape_id).trim()!==""?String(trip.shape_id):"";if(!sid)return;const branch=parseRouteVariantCodeFromHeadsign(trip.headsign||"",raw.route_short_name||"");if(!branch)return;if(!shapeIdBranchHints.has(sid))shapeIdBranchHints.set(sid,new Set());shapeIdBranchHints.get(sid).add(branch);});const shapeBranchLabelById={};shapeIdBranchHints.forEach((set,sid)=>{const arr=Array.from(set).sort();if(arr.length===1)shapeBranchLabelById[sid]=arr[0];else{if(arr.length>1)shapeBranchLabelById[sid]=arr.join(" / ");}});return {meta:{id:raw.id||raw.route_id,shortName:raw.route_short_name,longName:raw.route_long_name,agency:raw.agency,color:raw.route_color||"#003E7E",textColor:raw.route_text_color||"#FFFFFF",categories:raw.categories||[],headsigns:headsignPairs,description:raw.route_desc||""},trips,stopsById,stopsByDirection,directionOrder:sortedDirectionOrder,shapes:raw.shapes||{},shapeBranchLabelById,scheduleMinDate:parseGtfsDate(raw.schedule_start_date),scheduleMaxDate:parseGtfsDate(raw.schedule_end_date)};}function extractBranchName(tripId,routeShortName){if(!tripId||!routeShortName)return "";const routeNum=routeShortName.replace(/\D/g,"");const routeAlpha=routeShortName.replace(/\d/g,"");const patterns=[new RegExp(`^${routeNum}([A-Z])`,"i"),new RegExp(`^${routeNum}[-_]([A-Z])`,"i"),new RegExp(`${routeNum}[-_]?([A-Z])`,"i"),routeAlpha?new RegExp(`^${routeShortName.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([A-Z])`,"i"):null].filter(Boolean);for(const pattern of patterns){const match=tripId.match(pattern);if(match&&match[1])return match[1].toUpperCase();}const numericPattern=new RegExp(`${routeNum}[-_](\\d+)`,"i");const numericMatch=tripId.match(numericPattern);if(numericMatch&&numericMatch[1]){const variantNum=parseInt(numericMatch[1],10);if(variantNum>0&&variantNum<=26)return String.fromCharCode(64+variantNum);}const lastChar=tripId.slice(-1);if(lastChar&&/^[A-Z]$/i.test(lastChar))if(!tripId.slice(0,-1).endsWith(routeNum))return lastChar.toUpperCase();return "";}function extractBranchLabel(trip,routeShortName){if(!trip)return "";const tripId=(trip.trip_id||"").toString();const headsign=(trip.headsign||"").toString();const letter=extractBranchName(tripId,routeShortName);if(letter)return letter;if(!routeShortName&&!headsign)return "";const routeNum=routeShortName?routeShortName.replace(/\D/g,""):"";if(routeNum){const re=new RegExp(`^\\s*${routeNum}\\s*-\\s*(.+)$`,"i");const m=headsign.match(re);if(m&&m[1])return m[1].trim();}const dashIdx=headsign.indexOf(" - ");if(dashIdx!==-1)return headsign.slice(dashIdx+3).trim();return "";}function extractTripsForDirection(directionStops,filters){if(!directionStops||!directionStops.length)return {stops:[],trips:[]};const timingStops=directionStops.filter((stop)=>(stop.times||[]).some((t)=>String(t.timepoint??"0")==="1"));if(!timingStops.length)timingStops.push(...directionStops);let visibleStops=timingStops.slice();if(filters.entryStop||filters.exitStop){let startIdx=0;let endIdx=visibleStops.length-1;visibleStops.forEach((stop,idx)=>{if(stop.stop_id===filters.entryStop)startIdx=idx;if(stop.stop_id===filters.exitStop)endIdx=idx;});if(startIdx>endIdx)[startIdx,endIdx]=[endIdx,startIdx];visibleStops=visibleStops.slice(startIdx,endIdx+1);}const tripsByTripId={};visibleStops.forEach((stop)=>
55{(stop.times||[]).forEach((time,timeIndex)=>{const tripId=time.trip_id||"";const timeValue=time.departure_time||time.arrival_time;if(!timeValue)return;const effectiveTripId=tripId||`trip_${(time.headsign||"unknown").replace(/[^a-zA-Z0-9]/g,"_")}_${timeIndex}`;if(!tripsByTripId[effectiveTripId])tripsByTripId[effectiveTripId]={trip_id:tripId,stops:{},headsign:time.headsign||"",asterisk:!!time.asterisk};tripsByTripId[effectiveTripId].stops[stop.stop_id]={time:timeValue,sequence:time.sequence||stop.sequence||0,asterisk:!!time.asterisk};if(time.asterisk)tripsByTripId[effectiveTripId].asterisk=true;});});const compiledTrips=[];Object.values(tripsByTripId).forEach((trip)=>{const rowTimes=visibleStops.map((stop)=>{const stopTime=trip.stops[stop.stop_id];if(!stopTime)return null;return {time:stopTime.time,asterisk:!!stopTime.asterisk};});let firstTime=null;let lastTime=null;let firstAsterisk=false;for(let i=0;i<rowTimes.length;i++)if(rowTimes[i]!==null){if(firstTime===null){firstTime=rowTimes[i].time;firstAsterisk=!!rowTimes[i].asterisk;}lastTime=rowTimes[i].time;}if(firstTime===null)return;const startMinutes=timeToMinutes(firstTime);if(filters.startMinutes!==null&&startMinutes!==null&&startMinutes<filters.startMinutes)return;if(filters.endMinutes!==null&&startMinutes!==null&&startMinutes>filters.endMinutes)return;const compiled={start:firstTime,end:lastTime,stops:rowTimes,headsign:trip.headsign,trip_id:trip.trip_id||"",asterisk:!!trip.asterisk||firstAsterisk};compiledTrips.push(compiled);});compiledTrips.sort((a,b)=>{const aMin=timeToMinutes(a.start);const bMin=timeToMinutes(b.start);if(aMin===null&&bMin===null)return 0;if(aMin===null)return 1;if(bMin===null)return -1;return aMin-bMin;});return {stops:visibleStops,trips:compiledTrips};}function buildScheduleTable(stops,trips,routeShortName,emptyMessage){const wrapper=document.createElement("div");wrapper.className="ct-gtfs-table-wrapper";wrapper.setAttribute("role","region");wrapper.setAttribute("aria-label",i18n("ariaScheduleTableForRoute",{route:routeShortName||""},`Schedule table for Route ${routeShortName||""}`));const table=document.createElement("table");table.className="ct-gtfs-table";table.setAttribute("aria-label",i18n("ariaScheduleTableSummary",{route:routeShortName||"",stops:stops.length,trips:trips.length},`Schedule for Route ${routeShortName||""} showing ${stops.length} stops and ${trips.length} trips`));const caption=document.createElement("caption");caption.className="sr-only";caption.textContent=i18n("scheduleTableCaption",{route:routeShortName||""},`Schedule table for Route ${routeShortName||""}. Columns represent bus stops, rows represent trips with departure times.`);table.appendChild(caption);const thead=document.createElement("thead");const headRow=document.createElement("tr");const thRoute=document.createElement("th");thRoute.textContent=i18n("tableHeaderRoute",null,"Route");thRoute.className="ct-gtfs-table-header-sticky";thRoute.id="ct-gtfs-col-route";thRoute.setAttribute("scope","col");thRoute.setAttribute("aria-label",i18n("ariaRouteNumber",null,"Route number"));headRow.appendChild(thRoute);stops.forEach((stop,index)=>{const th=document.createElement("th");th.textContent=stop.stop_name;th.id=`ct-gtfs-col-stop-${index+1}`;th.setAttribute("scope","col");th.setAttribute("aria-label",i18n("ariaStopColumn",{index:index+1,name:stop.stop_name},`Stop ${index+1}: ${stop.stop_name}`));headRow.appendChild(th);});thead.appendChild(headRow);const tbody=document.createElement("tbody");if(!trips.length){const emptyRow=document.createElement("tr");const emptyCell=document.createElement("td");emptyCell.colSpan=stops.length+1;emptyCell.className="ct-gtfs-empty-state";emptyCell.setAttribute("role","alert");emptyCell.setAttribute("aria-live","polite");emptyCell.textContent=emptyMessage||i18n("emptyDeparturesExpandSearch",null,"No departures match your filters. Try expanding your search.");emptyRow.appendChild(emptyCell);tbody.appendChild(emptyRow);}else trips.forEach((trip,tripIndex)=>{const row=document.createElement("tr");const branchName=extractBranchLabel(trip,routeShortName);const headsign=String(trip.headsign||"").trim();
55const routeCodeMatch=headsign.match(/^([A-Za-z0-9]+)\s*-\s*/);const routeDisplay=routeCodeMatch?routeCodeMatch[1]:routeShortName+(branchName?" "+branchName:"");const departureTime=formatTimeDisplay(trip.start,!!trip.asterisk);row.setAttribute("aria-label",i18n("ariaTripRow",{index:tripIndex+1,route:routeDisplay,time:departureTime},`Trip ${tripIndex+1}, Route ${routeDisplay}, departs at ${departureTime}`));const labelCell=document.createElement("th");labelCell.textContent=routeDisplay;labelCell.className="ct-gtfs-table-cell-sticky";labelCell.id=`ct-gtfs-row-trip-${tripIndex+1}`;labelCell.setAttribute("scope","row");labelCell.setAttribute("aria-label",i18n("ariaRouteCell",{route:routeDisplay},`Route ${routeDisplay}`));row.appendChild(labelCell);trip.stops.forEach((timeEntry,stopIndex)=>{const cell=document.createElement("td");cell.setAttribute("headers",`ct-gtfs-row-trip-${tripIndex+1} ct-gtfs-col-stop-${stopIndex+1}`);if(timeEntry===null){cell.textContent=i18n("skippedStopPlaceholder",null,"--");cell.className="ct-gtfs-table-skipped";cell.setAttribute("aria-label",i18n("ariaStopNotServed",{name:stops[stopIndex].stop_name},`${stops[stopIndex].stop_name}: Stop not served on this trip`));}else{const formattedTime=formatTimeDisplay(timeEntry);cell.textContent=formattedTime;cell.setAttribute("aria-label",i18n("ariaDepartureTimeAtStop",{name:stops[stopIndex].stop_name,time:formattedTime},`Departure time at ${stops[stopIndex].stop_name}: ${formattedTime}`));}row.appendChild(cell);});tbody.appendChild(row);});table.appendChild(thead);table.appendChild(tbody);wrapper.appendChild(table);setupTableScrollIndicators(wrapper);return wrapper;}function setupTableScrollIndicators(wrapper){if(!wrapper)return;const update=()=>{const maxScrollLeft=Math.max(0,wrapper.scrollWidth-wrapper.clientWidth);const scrollLeft=wrapper.scrollLeft;const hasLeft=scrollLeft>2;const hasRight=scrollLeft<maxScrollLeft-2;wrapper.setAttribute("data-scroll-left",hasLeft?"true":"false");wrapper.setAttribute("data-scroll-right",hasRight?"true":"false");};wrapper.addEventListener("scroll",update,{passive:true});if(typeof window!=="undefined")window.addEventListener("resize",update,{passive:true});window.requestAnimationFrame(update);}function buildAccessibilityList(trips,stops,routeMeta,emptyMessage){const container=document.createElement("div");container.className="ct-gtfs-accessible-list";container.setAttribute("role","region");container.setAttribute("aria-label",i18n("ariaScheduleListForRoute",{route:routeMeta?.shortName||"",trips:trips.length},`Schedule list view for Route ${routeMeta?.shortName||""} with ${trips.length} trips`));container.setAttribute("aria-live","polite");if(!trips.length){const emptyMsg=document.createElement("p");emptyMsg.className="ct-gtfs-empty-state";emptyMsg.setAttribute("role","alert");emptyMsg.setAttribute("aria-live","polite");emptyMsg.textContent=emptyMessage||i18n("emptyDepartures",null,"No departures match your filters.");container.appendChild(emptyMsg);return container;}trips.forEach((trip,index)=>{if(!trip||!trip.start||!trip.stops||!Array.isArray(trip.stops))return;const card=document.createElement("article");card.className="ct-gtfs-accessible-trip";const tripContentId=`trip-content-${index}`;const tripHeaderId=`trip-header-${index}`;const header=document.createElement("header");header.className="ct-gtfs-accessible-trip-header";header.id=tripHeaderId;const routeShortName=routeMeta?.shortName||"";const branchName=extractBranchLabel(trip,routeShortName);const headsign=String(trip.headsign||"").trim();const routeCodeMatch=headsign.match(/^([A-Za-z0-9]+)\s*-\s*/);const routeDisplay=routeCodeMatch?routeCodeMatch[1]:routeShortName+(branchName?branchName:"");const departureTime=formatTimeDisplay(trip.start,!!trip.asterisk);let originStop=stops[0]?.stop_name||"";let destinationStop=stops[stops.length-1]?.stop_name||"";if(stops.length>0&&trip.stops.length>0){for(let i=0;i<trip.stops.length&&i<stops.length;i++)if(trip.stops[i]!==null&&trip.stops[i]!==undefined){originStop=stops[i]?.stop_name||originStop;break;}for(let i=Math.min(trip.stops.length-1,stops.length-1);i>=0;i--)if(trip.stops[i]!==null&&trip.stops[i]!==undefined){destinationStop=stops[i]?.stop_name||destinationStop;break;}}header.innerHTML=` 56 <div class="ct-gtfs-accessible-trip-info"> 57 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-accessible-trip-icon" aria-hidden="true"> 58 <circle cx="12" cy="12" r="10" stroke="#001123" stroke-width="2"/> 59 <path d="M12 6v6l4 2" stroke="#001123" stroke-width="2" stroke-linecap="round"/> 60 </svg> 61 <h6 class="ct-gtfs-accessible-trip-time" role="heading" aria-level="3">${i18n("departsAt",{time:departureTime},`Departs ${departureTime}`)}</h6>
62 <span class="ct-gtfs-accessible-trip-badge">${i18n("routeBadge",{route:routeDisplay},`Route ${routeDisplay}`)}</span> 63 </div> 64 <p class="ct-gtfs-accessible-trip-route">${i18n("fromOriginToDestination",{origin:originStop,destination:destinationStop},`From ${originStop} to ${destinationStop}`)}</p> 65 <button type="button" class="ct-gtfs-accessible-trip-toggle" aria-expanded="false" aria-controls="${tripContentId}" aria-label="${i18n("ariaExpandTripDetails",{index:index+1,route:routeDisplay,time:departureTime,origin:originStop,destination:destinationStop},`Expand details for Trip ${index+1}, Route ${routeDisplay}, departs ${departureTime} from ${originStop} to ${destinationStop}`)}"> 66 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 67 <path d="M12 5v14M5 12h14" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"/> 68 </svg> 69 </button> 70 `;const content=document.createElement("div");content.className="ct-gtfs-accessible-trip-content";content.id=tripContentId;content.hidden=true;content.setAttribute("aria-labelledby",tripHeaderId);const stopsGrid=document.createElement("div");stopsGrid.className="ct-gtfs-accessible-stops-grid";stopsGrid.setAttribute("role","list");stopsGrid.setAttribute("aria-label",i18n("ariaStopsForTrip",{index:index+1},`Stops for Trip ${index+1}`));trip.stops.forEach((timeEntry,stopIndex)=>{if(stopIndex>=stops.length)return;if(timeEntry===null||timeEntry===undefined)return;const stopCard=document.createElement("div");stopCard.className="ct-gtfs-accessible-stop-card";stopCard.setAttribute("role","listitem");const stopName=stops[stopIndex]?.stop_name||i18n("stopFallbackLabel",{index:stopIndex+1},`Stop ${stopIndex+1}`);const arrivalTime=formatTimeDisplay(timeEntry);stopCard.setAttribute("aria-label",i18n("ariaStopArrival",{index:stopIndex+1,name:stopName,time:arrivalTime},`Stop ${stopIndex+1}: ${stopName}, arrives at ${arrivalTime}`));stopCard.innerHTML=` 71 <div class="ct-gtfs-accessible-stop-number" aria-hidden="true">${stopIndex+1}</div> 72 <div class="ct-gtfs-accessible-stop-details"> 73 <div class="ct-gtfs-accessible-stop-name"> 74 <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 75 <path d="M7.5 7.5a2 2 0 100-4 2 2 0 000 4z" stroke="#33414F" stroke-width="1.5"/> 76 <path d="M7.5 13.5s5-4 5-7.5a5 5 0 10-10 0c0 3.5 5 7.5 5 7.5z" stroke="#33414F" stroke-width="1.5"/> 77 </svg> 78 <span>${stopName}</span> 79 </div> 80 <div class="ct-gtfs-accessible-stop-time"> 81 <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 82 <circle cx="7.5" cy="7.5" r="6" stroke="#33414F" stroke-width="1.5"/> 83 <path d="M7.5 4v3.5l2 1.5" stroke="#33414F" stroke-width="1.5" stroke-linecap="round"/> 84 </svg> 85 <span>${i18n("arrivesAt",{time:arrivalTime},`Arrives at ${arrivalTime}`)}</span> 86 </div> 87 </div> 88 `;stopsGrid.appendChild(stopCard);});content.appendChild(stopsGrid);card.appendChild(header);card.appendChild(content);container.appendChild(card);const toggleBtn=header.querySelector(".ct-gtfs-accessible-trip-toggle");toggleBtn.addEventListener("click",()=>{const isExpanded=content.hidden===false;content.hidden=!content.hidden;toggleBtn.setAttribute("aria-expanded",(!content.hidden).toString());const action=content.hidden?i18n("expand",null,"Expand"):i18n("collapse",null,"Collapse");toggleBtn.setAttribute("aria-label",i18n("ariaToggleTripDetails",{action,index:index+1,route:routeDisplay,time:departureTime,origin:originStop,destination:destinationStop},`${action} details for Trip ${index+1}, Route ${routeDisplay}, departs ${departureTime} from ${originStop} to ${destinationStop}`));const svg=toggleBtn.querySelector("svg path");if(content.hidden)svg.setAttribute("d","M12 5v14M5 12h14");else svg.setAttribute("d","M5 12h14");});});return container;}function renderMap(container,detail,detailWrapper){console.log("renderMap called",{container,detail});if(!container){console.error("Map container is null or undefined");return;}container.setAttribute("data-map-initialized","true");const routeShortName=detail.meta?.shortName||"";const routeLongName=detail.meta?.longName||"";container.setAttribute("role","application");container.setAttribute("aria-label",i18n("ariaInteractiveMap",{short:routeShortName,long:routeLongName},`Interactive map showing Route ${routeShortName} ${routeLongName} with bus stops`));function loadGoogleMaps(){console.log("loadGoogleMaps: Checking for Google Maps API...");if(window.CTGoogleMaps&&typeof window.CTGoogleMaps.load==="function")return window.CTGoogleMaps.load();if(window.google&&window.google.maps){console.log("Google Maps API already loaded");return Promise.resolve(window.google.maps);}console.log("Waiting for Google Maps API to load...");return new Promise(function(resolve,reject){let attempts=0;const maxAttempts=50;const checkInterval=setInterval(function(){attempts++;console.log(`Attempt ${attempts}/${maxAttempts} - Checking for Google Maps...`);if(window.google&&window.google.maps){console.log("Google Maps API loaded successfully!");clearInterval(checkInterval);resolve(window.google.maps);}else{if(attempts>=maxAttempts){console.error("Google Maps API failed to load after 50 attempts");clearInterval(checkInterval);reject(new Error("Google Maps API failed to load"));}}},100);});}loadGoogleMaps().then(function(maps){console.log("Maps API ready, starting map initialization...");let routeColorHex=detail.meta.color||"#003E7E";if(routeColorHex&&!String(routeColorHex).startsWith("#"))routeColorHex="#"+String(routeColorHex).replace(/^#/,"");
88const routeColor=routeColorHex;console.log("Route color:",routeColor);console.log("Creating styled map type...");const styledMapType=new maps.StyledMapType([{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9e7f7"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],{name:"Styled Map"});console.log("Creating map instance...",container);const map=new maps.Map(container,{center:{lat:41.7658,lng:-72.6734},zoom:11,mapId:"ct-transit-route-map",mapTypeControl:false,streetViewControl:false,fullscreenControl:true,mapTypeControlOptions:{mapTypeIds:["styled_map"]}});map.mapTypes.set("styled_map",styledMapType);map.setMapTypeId("styled_map");console.log("Map instance created successfully");const bounds=new maps.LatLngBounds();let routePathForOverlay=null;const mapState=detailWrapper.__ctGtfsDetailState||{};const filters=mapState.filters||{};const currentDirection=filters.direction||getDefaultOutboundDirection(detail,filters.date);const directionStopsFull=buildDirectionStopsForDate(detail,filters.date,currentDirection)||detail.stopsByDirection?.[currentDirection]||[];const shapePaths=buildShapePaths(detail.shapes||{},directionStopsFull);let primaryHex=String(routeColor||"#003E7E").replace(/^#/,"");if(!/^[0-9a-fA-F]{6}$/.test(primaryHex))primaryHex="003E7E";const routeLineColor="#"+primaryHex;if(shapePaths.length){shapePaths.forEach(function(item,idx){item.path.forEach(function(pt){bounds.extend(pt);});new maps.Polyline({path:item.path,map,strokeColor:routeLineColor,strokeWeight:5,strokeOpacity:0.92,zIndex:idx});});routePathForOverlay=shapePaths.reduce(function(acc,cur){return cur.path.length>acc.path.length?cur:acc;}).path;}console.log("Starting to add markers...");console.log("Maps.marker:",maps.marker);console.log("Maps.marker.AdvancedMarkerElement:",maps.marker?.AdvancedMarkerElement);if(!maps.marker||!maps.marker.AdvancedMarkerElement)console.error("AdvancedMarkerElement not available. Falling back to old Marker API");const state=detailWrapper.__ctGtfsDetailState||{};let allStops=[];if(Array.isArray(state.visibleStops)&&state.visibleStops.length)allStops=state.visibleStops;else{const currentDirection=state.filters?.direction||getDefaultOutboundDirection(detail,state.filters?.date);const dateStops=buildDirectionStopsForDate(detail,state.filters?.date,currentDirection);if(dateStops.length)allStops=dateStops;else{if(detail.stopsByDirection?.[currentDirection])allStops=detail.stopsByDirection[currentDirection].slice();}}console.log("Total stops to add:",allStops.length);const infoWindow=new maps.InfoWindow();allStops.forEach(function(stop,index){console.log(`Adding marker ${index+1}/${allStops.length} for stop:`,stop.stop_name);const position={lat:stop.stop_lat,lng:stop.stop_lon};bounds.extend(position);const isFirst=index===0;const isLast=index===allStops.length-1;const size=isFirst||isLast?16:12;const canvas=document.createElement("canvas");canvas.width=size*2;canvas.height=size*2;const ctx=canvas.getContext("2d");ctx.beginPath();ctx.arc(size,size,size-3,0,2*Math.PI);ctx.fillStyle="#FFFFFF";ctx.fill();ctx.strokeStyle=routeColor;ctx.lineWidth=4;ctx.stroke();const markerImg=document.createElement("img");markerImg.src=canvas.toDataURL();markerImg.style.width=size*2+"px";markerImg.style.height=size*2+"px";markerImg.style.cursor="pointer";markerImg.setAttribute("alt",i18n("altBusStopMarker",{name:stop.stop_name},`${stop.stop_name} bus stop marker`));markerImg.setAttribute("role","button");markerImg.setAttribute("tabindex","0");markerImg.setAttribute("aria-label",i18n("ariaClickStopDetails",{name:stop.stop_name},`Click to view details for ${stop.stop_name} bus stop`));let marker;if(maps.marker&&maps.marker.AdvancedMarkerElement)marker=new maps.marker.AdvancedMarkerElement({map,position,content:markerImg,title:stop.stop_name});else{console.warn("Using fallback Marker API for stop:",stop.stop_name);marker=new maps.Marker({map,position,title:stop.stop_name,icon:{url:canvas.toDataURL(),scaledSize:new maps.Size(size*2,size*2),anchor:new maps.Point(size,size)}});}const showInfoWindow=function(){const stopType=isFirst?i18n("stopTypeOrigin",null,"Origin"):isLast?i18n("stopTypeDestination",null,"Destination"):i18n("stopTypeStop",null,"Stop");const stopNumber=index+1;const times=stop.times||[];const timesText=times.length>0?times.slice(0,3).map((t)=>formatTimeDisplay(t)).join(", "):i18n("noTimesAvailable",null,"No times available");const content=i18nHtmlWithVars("stopInfoWindow",{name:stop.stop_name,number:stopNumber,stopType,routeColor,times:timesText,stopId:stop.stop_id});infoWindow.setContent(content);infoWindow.open({map,anchor:marker});};
88markerImg.addEventListener("click",showInfoWindow);markerImg.addEventListener("keydown",function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();showInfoWindow();}});});if(routePathForOverlay&&allStops.length>=2){const geom=maps.geometry&&maps.geometry.spherical?maps.geometry.spherical:null;let pathDistance=0;for(let i=1;i<routePathForOverlay.length;i++)if(geom)pathDistance+=geom.computeDistanceBetween(new maps.LatLng(routePathForOverlay[i-1]),new maps.LatLng(routePathForOverlay[i]));else pathDistance+=haversineMeters(routePathForOverlay[i-1],routePathForOverlay[i]);const distanceKm=(pathDistance/1000).toFixed(1);const travelTimeMinutes=Math.round((pathDistance/1000/20)*60);const infoPanelDiv=document.createElement("div");infoPanelDiv.className="ct-gtfs-route-info-panel";infoPanelDiv.setAttribute("role","region");infoPanelDiv.setAttribute("aria-label",i18n("ariaRouteTravelInfo",{minutes:travelTimeMinutes,distance:distanceKm},`Route information: estimated travel time ${travelTimeMinutes} minutes, distance ${distanceKm} kilometers`));infoPanelDiv.innerHTML=` 89 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-select-icon" aria-hidden="true"> 90 <path d="M4 6L2 7" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 91 <path d="M10 6H14" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 92 <path d="M22 7L20 6" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 93 <path d="M18 3H6C4.89543 3 4 3.89543 4 5V17C4 18.1046 4.89543 19 6 19H18C19.1046 19 20 18.1046 20 17V5C20 3.89543 19.1046 3 18 3Z" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 94 <path d="M4 11H20" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 95 <path d="M8 15H8.01" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 96 <path d="M16 15H16.01" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 97 <path d="M6 19V21" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 98 <path d="M18 21V19" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 99 </svg> 100 <div class="ct-gtfs-route-info-content"> 101 <div class="ct-gtfs-route-info-time" aria-label="${i18n("ariaEstimatedTravelTime",{minutes:travelTimeMinutes},`Estimated travel time: ${travelTimeMinutes} minutes`)}">${i18n("travelTimeMinutes",{minutes:travelTimeMinutes},`${travelTimeMinutes} min`)}</div> 102 <div class="ct-gtfs-route-info-distance" aria-label="${i18n("ariaRouteDistance",{distance:distanceKm},`Route distance: ${distanceKm} kilometers`)}">${i18n("routeDistanceKm",{distance:distanceKm},`${distanceKm} km`)}</div> 103 </div> 104 `;const midIndex=Math.floor(routePathForOverlay.length/2);const midPoint=routePathForOverlay[midIndex];const overlay=new maps.OverlayView();overlay.onAdd=function(){const panes=this.getPanes();panes.overlayLayer.appendChild(infoPanelDiv);};overlay.draw=function(){const projection=this.getProjection();const position=projection.fromLatLngToDivPixel(new maps.LatLng(midPoint));if(position){infoPanelDiv.style.left=position.x+"px";infoPanelDiv.style.top=position.y+"px";}};overlay.onRemove=function(){if(infoPanelDiv.parentNode)infoPanelDiv.parentNode.removeChild(infoPanelDiv);};overlay.setMap(map);}if(!bounds.isEmpty())map.fitBounds(bounds);}).catch(function(){container.innerHTML=i18nHtml("mapErrorState",'<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>Unable to load the interactive map at this time.</div>');});}function getSchedulesSearchUrl(){const pathname=String((typeof window!=="undefined"&&window.location&&window.location.pathname)||"");const fromPath=pathname.match(/^(.*?\/schedules)(?:\/|$)/);if(fromPath&&fromPath[1])return fromPath[1];const prefix=(typeof drupalSettings!=="undefined"&&drupalSettings.path&&drupalSettings.path.pathPrefix)||"";return `/${prefix}schedules`.replace(/\/{2,}/g,"/");}
104function buildDetailView(routeMeta,normalizedDetail,downloadUrls){const wrapper=document.createElement("div");wrapper.className="ct-gtfs-detail-wrapper-main";const meta=normalizedDetail.meta;const categories=meta.categories&&meta.categories.length?meta.categories.join(" ⢠"):i18n("localService",null,"Local Service");function getRouteDescription(){if(meta.description)return meta.description;const summaryDirection=getDefaultOutboundDirection(normalizedDetail,toYmd(new Date()));const stops=normalizedDetail.stopsByDirection?.[summaryDirection]||Object.values(normalizedDetail.stopsByDirection||[])[0]||[];if(!stops.length)return i18n("routeDescServiceArea",{short:meta.shortName,long:meta.longName},`Route ${meta.shortName} ${meta.longName} operates throughout the service area.`);if(stops.length<2)return i18n("routeDescServiceArea",{short:meta.shortName,long:meta.longName},`Route ${meta.shortName} ${meta.longName} operates throughout the service area.`);const firstStop=stops[0].stop_name;const lastStop=stops[stops.length-1].stop_name;const middleStops=[];if(stops.length>=5){const step=Math.floor((stops.length-1)/4);for(let i=1;i<4;i++){const idx=step*i;if(idx<stops.length-1)middleStops.push(stops[idx].stop_name);}}if(middleStops.length)return i18n("routeDescWithMiddleStops",{short:meta.shortName,first:firstStop,last:lastStop,middles:middleStops.join(", ")},`Route ${meta.shortName} operates between ${firstStop} and ${lastStop} with stops on ${middleStops.join(", ")}.`);else return i18n("routeDescBetweenStops",{short:meta.shortName,first:firstStop,last:lastStop},`Route ${meta.shortName} operates between ${firstStop} and ${lastStop}.`);}const header=document.createElement("div");header.className="ct-gtfs-detail-header";header.innerHTML=` 105 <p class="label">${i18n("routeSummaryHeading",null,"ROUTE SUMMARY")}</p> 106 <h2>${i18n("routeTitle",{short:meta.shortName,long:meta.longName},`ROUTE: ${meta.shortName} ${meta.longName}`)}</h2> 107 <p class="ct-gtfs-route-description body-1">${getRouteDescription()}</p> 108 `;wrapper.appendChild(header);const dayDownloadRow=document.createElement("div");dayDownloadRow.className="ct-gtfs-day-download-row";const defaultDate=toYmd(new Date());const dateInputId="ct-gtfs-schedule-date";const dateHelpId="ct-gtfs-schedule-date-help";const dateStatusId="ct-gtfs-schedule-date-status";const schedulePanelId="schedule-panel";const dateSelectorOuter=document.createElement("div");dateSelectorOuter.className="ct-gtfs-date-selector-outer";const dateSelectorContainer=document.createElement("div");dateSelectorContainer.className="ct-gtfs-date-selector-container";const dateSelectorPill=document.createElement("div");dateSelectorPill.className="ct-gtfs-date-selector-pill";const dateLabel=document.createElement("label");dateLabel.className="label";dateLabel.setAttribute("for",dateInputId);dateLabel.textContent=i18n("viewScheduleFor",null,"VIEW SCHEDULE FOR");const dateInputWrapper=document.createElement("div");dateInputWrapper.className="ct-gtfs-select-wrapper ct-gtfs-date-input-wrapper";dateInputWrapper.innerHTML=` 109 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-select-icon" aria-hidden="true"> 110 <rect x="3" y="5" width="18" height="16" rx="2" stroke="#003E7E" stroke-width="2"/> 111 <path d="M3 10h18" stroke="#003E7E" stroke-width="2"/> 112 <path d="M8 3v4M16 3v4" stroke="#003E7E" stroke-width="2" stroke-linecap="round"/> 113 </svg> 114 <input 115 type="date" 116 id="${dateInputId}" 117 class="ct-gtfs-select ct-gtfs-date-input" 118 data-select="date" 119 name="schedule_date" 120 value="${defaultDate}" 121 autocomplete="off" 122 aria-describedby="${dateHelpId} ${dateStatusId}" 123 /> 124 `;dateSelectorPill.appendChild(dateLabel);dateSelectorPill.appendChild(dateInputWrapper);dateSelectorContainer.appendChild(dateSelectorPill);dateSelectorOuter.appendChild(dateSelectorContainer);const dateHelp=document.createElement("p");dateHelp.id=dateHelpId;dateHelp.className="visually-hidden";dateHelp.textContent=i18n("scheduleDateHelp",null,"Choose any date to view trips. If there is no schedule for that date, a message will be shown.");dateSelectorOuter.appendChild(dateHelp);const dateStatus=document.createElement("div");dateStatus.id=dateStatusId;
124dateStatus.className="ct-gtfs-date-status";dateStatus.setAttribute("role","status");dateStatus.setAttribute("aria-live","polite");dateStatus.setAttribute("aria-atomic","true");dateSelectorOuter.appendChild(dateStatus);const downloadButtons=document.createElement("div");downloadButtons.className="ct-gtfs-download-buttons";const routeName=`${meta.shortName} ${meta.longName}`;const weekdayPdf=(downloadUrls&&downloadUrls.weekdayPdf)||"";const weekendPdf=(downloadUrls&&downloadUrls.weekendPdf)||"";const saturdayPdf=(downloadUrls&&downloadUrls.saturdayPdf)||"";const sundayPdf=(downloadUrls&&downloadUrls.sundayPdf)||"";const hasDownloadUrl=weekdayPdf||weekendPdf||saturdayPdf||sundayPdf;downloadButtons.innerHTML=` 125 <a href="${weekdayPdf||"#"}" class="ct-btn ct-btn--secondary" data-action="download-schedule" data-url-weekday="${weekdayPdf}" data-url-weekend="${weekendPdf}" data-url-saturday="${saturdayPdf}" data-url-sunday="${sundayPdf}" aria-label="${i18n("ariaDownloadSchedule",{route:routeName},`Download Schedule for Route ${routeName} (opens in new tab)`)}"${!hasDownloadUrl?' style="pointer-events:none;opacity:0.6"':""}${hasDownloadUrl?' target="_blank" rel="noopener noreferrer"':""}> 126 ${i18n("downloadSchedule",null,"Download Schedule")} 127 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 128 <path d="M12 3v13m0 0l-4-4m4 4l4-4M5 21h14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 129 </svg> 130 </a> 131 `;const backToSearch=document.createElement("a");backToSearch.className="ct-btn ct-btn--secondary ct-gtfs-back-to-search";backToSearch.href=getSchedulesSearchUrl();backToSearch.setAttribute("data-action","back-to-schedule-search");const backToSearchLabel=i18n("backToScheduleSearch",null,"Back to schedule search");backToSearch.setAttribute("aria-label",backToSearchLabel);backToSearch.innerHTML=` 132 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 133 <path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 134 </svg> 135 ${backToSearchLabel} 136 `;const backToSearchWrapper=document.createElement("div");backToSearchWrapper.className="ct-gtfs-back-to-search-wrapper";backToSearchWrapper.appendChild(backToSearch);dayDownloadRow.appendChild(backToSearchWrapper);dayDownloadRow.appendChild(dateSelectorOuter);dayDownloadRow.appendChild(downloadButtons);wrapper.appendChild(dayDownloadRow);const filterRegion=document.createElement("section");filterRegion.className="ct-gtfs-schedule-filter-region";filterRegion.setAttribute("aria-labelledby","ct-gtfs-schedule-filter-instructions");
136const filterInstructions=document.createElement("p");filterInstructions.id="ct-gtfs-schedule-filter-instructions";filterInstructions.className="ct-gtfs-schedule-filter-instructions";filterInstructions.setAttribute("aria-hidden","true");filterInstructions.textContent=i18n("filterInstructions",null,"Selecting one or more of the following filter options will automatically update the results below.");filterRegion.appendChild(filterInstructions);const toolbar=document.createElement("div");toolbar.className="ct-gtfs-detail-toolbar";const filtersLeft=document.createElement("div");filtersLeft.className="ct-gtfs-filters-left";const entrySelectWrapper=document.createElement("div");entrySelectWrapper.className="ct-gtfs-select-wrapper";entrySelectWrapper.innerHTML=` 137 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-select-icon" aria-hidden="true"> 138 <path d="M4 6L2 7" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 139 <path d="M10 6H14" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 140 <path d="M22 7L20 6" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 141 <path d="M18 3H6C4.89543 3 4 3.89543 4 5V17C4 18.1046 4.89543 19 6 19H18C19.1046 19 20 18.1046 20 17V5C20 3.89543 19.1046 3 18 3Z" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 142 <path d="M4 11H20" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 143 <path d="M8 15H8.01" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 144 <path d="M16 15H16.01" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 145 <path d="M6 19V21" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 146 <path d="M18 21V19" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 147 </svg> 148 <select class="ct-gtfs-select" data-select="entry" aria-label="${i18n("ariaOriginStop",{route:routeName},`origin bus stop for Route ${routeName}`)}"> 149 <option value="">${i18n("selectOriginBusStop",null,"Select origin bus stop")}</option> 150 </select> 151 `;const entrySelect=entrySelectWrapper.querySelector("select");const swapBtn=document.createElement("button");swapBtn.type="button";swapBtn.className="ct-gtfs-swap-button";swapBtn.setAttribute("aria-label",i18n("ariaSwapDirections",null,"Select the bus stop and times from the dropdowns. Use the swap icon to switch directions"));swapBtn.innerHTML=` 152 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 153 <path d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" stroke="#001123" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 154 </svg> 155 `;const exitSelectWrapper=document.createElement("div");exitSelectWrapper.className="ct-gtfs-select-wrapper";exitSelectWrapper.innerHTML=` 156 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-select-icon" aria-hidden="true"> 157 <path d="M4 6L2 7" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 158 <path d="M10 6H14" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 159 <path d="M22 7L20 6" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 160 <path d="M18 3H6C4.89543 3 4 3.89543 4 5V17C4 18.1046 4.89543 19 6 19H18C19.1046 19 20 18.1046 20 17V5C20 3.89543 19.1046 3 18 3Z" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 161 <path d="M4 11H20" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 162 <path d="M8 15H8.01" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 163 <path d="M16 15H16.01" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 164 <path d="M6 19V21" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 165 <path d="M18 21V19" stroke="#003E7E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 166 </svg> 167 <select class="ct-gtfs-select" data-select="exit" aria-label="${i18n("ariaExitStop",{route:routeName},`Select exit bus stop for Route ${routeName}`)}"> 168 <option value="">${i18n("selectExitBusStop",null,"Select exit bus stop")}</option> 169 </select> 170 `;const exitSelect=exitSelectWrapper.querySelector("select");const startSelectWrapper=document.createElement("div");
170startSelectWrapper.className="ct-gtfs-select-wrapper";startSelectWrapper.innerHTML=` 171 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-select-icon" aria-hidden="true"> 172 <circle cx="12" cy="12" r="10" stroke="#33414F" stroke-width="2"/> 173 <path d="M12 6v6l4 2" stroke="#33414F" stroke-width="2" stroke-linecap="round"/> 174 </svg> 175 <select class="ct-gtfs-select" data-select="start" aria-label="${i18n("ariaFilterStartTime",null,"Filter trips starting from this time")}"> 176 <option value="">${i18n("startTime",null,"Start time")}</option> 177 </select> 178 `;const startSelect=startSelectWrapper.querySelector("select");const endSelectWrapper=document.createElement("div");endSelectWrapper.className="ct-gtfs-select-wrapper";endSelectWrapper.innerHTML=` 179 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="ct-gtfs-select-icon" aria-hidden="true"> 180 <circle cx="12" cy="12" r="10" stroke="#33414F" stroke-width="2"/> 181 <path d="M12 6v6l4 2" stroke="#33414F" stroke-width="2" stroke-linecap="round"/> 182 </svg> 183 <select class="ct-gtfs-select" data-select="end" aria-label="${i18n("ariaFilterEndTime",null,"Filter trips ending before this time")}"> 184 <option value="">${i18n("endTime",null,"End time")}</option> 185 </select> 186 `;const endSelect=endSelectWrapper.querySelector("select");filtersLeft.appendChild(entrySelectWrapper);filtersLeft.appendChild(swapBtn);filtersLeft.appendChild(exitSelectWrapper);filtersLeft.appendChild(startSelectWrapper);filtersLeft.appendChild(endSelectWrapper);const controlsRight=document.createElement("div");controlsRight.className="ct-gtfs-controls-right";const viewToggle=document.createElement("div");viewToggle.className="ct-gtfs-view-toggle";viewToggle.innerHTML=` 187 <span class="ct-gtfs-view-label" id="table-view-label">${i18n("tableView",null,"Table view")}</span> 188 <button type="button" class="ct-gtfs-view-switch" data-view-mode="table" aria-label="${i18n("ariaToggleTableListView",null,"Toggle between table and list view")}" aria-pressed="true" aria-describedby="table-view-label list-view-label"> 189 <span class="ct-gtfs-view-switch-slider"></span> 190 </button> 191 <span class="ct-gtfs-view-label" id="list-view-label">${i18n("listView",null,"List view")}</span> 192 `;controlsRight.appendChild(viewToggle);toolbar.appendChild(filtersLeft);toolbar.appendChild(controlsRight);filterRegion.appendChild(toolbar);wrapper.appendChild(filterRegion);const tableArea=document.createElement("div");tableArea.className="ct-gtfs-table-container";tableArea.setAttribute("data-table-container","true");tableArea.id=schedulePanelId;tableArea.setAttribute("role","region");tableArea.setAttribute("aria-label",i18n("ariaScheduleTableForRoute",{route:routeName},`Schedule table for Route ${routeName}`));tableArea.setAttribute("aria-labelledby","table-view-label");const listArea=document.createElement("div");listArea.className="ct-gtfs-list-container";listArea.setAttribute("data-list-container","true");listArea.hidden=true;listArea.setAttribute("role","region");listArea.setAttribute("aria-labelledby","list-view-label");const freqHint=document.createElement("p");freqHint.className="ct-gtfs-frequency-hint";freqHint.setAttribute("data-frequency-hint","");freqHint.setAttribute("aria-live","polite");freqHint.setAttribute("aria-atomic","true");const scheduleWrapper=document.createElement("div");scheduleWrapper.className="ct-gtfs-detail-wrapper";scheduleWrapper.appendChild(header);scheduleWrapper.appendChild(dayDownloadRow);scheduleWrapper.appendChild(filterRegion);scheduleWrapper.appendChild(tableArea);scheduleWrapper.appendChild(listArea);scheduleWrapper.appendChild(freqHint);const scheduleContainer=document.createElement("div");scheduleContainer.className="container";const scheduleRow=document.createElement("div");scheduleRow.className="row";const scheduleCol=document.createElement("div");scheduleCol.className="col-12";scheduleCol.appendChild(scheduleWrapper);scheduleRow.appendChild(scheduleCol);scheduleContainer.appendChild(scheduleRow);wrapper.appendChild(scheduleContainer);const mapSection=document.createElement("section");
192mapSection.className="ct-gtfs-map-section";const mapContainer=document.createElement("div");mapContainer.className="container";const mapRow=document.createElement("div");mapRow.className="row";const mapCol=document.createElement("div");mapCol.className="col-12";const routeMapUrl=(downloadUrls&&downloadUrls.routeMap)||"";mapCol.innerHTML=` 193 <div class="ct-gtfs-map-inner"> 194 <div class="ct-gtfs-map-header"> 195 <h2>${i18n("routeMapHeading",null,"ROUTE MAP")}</h2> 196 <div class="ct-gtfs-map-download-buttons"> 197 <a href="${routeMapUrl||"#"}" class="ct-btn ct-btn--secondary is-on-dark route-map-download-button" data-action="download-map" aria-label="${i18n("ariaDownloadRouteMap",{route:routeName},`Download Map for Route ${routeName} (opens in new tab)`)}"${!routeMapUrl?' style="pointer-events:none;opacity:0.6"':""}${routeMapUrl?' target="_blank" rel="noopener noreferrer"':""}> 198 ${i18n("downloadMap",null,"Download Map")} 199 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 200 <path d="M12 3v13m0 0l-4-4m4 4l4-4M5 21h14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 201 </svg> 202 </a> 203 </div> 204 </div> 205 <div class="ct-gtfs-map" data-map="true"></div> 206 <p class="ct-gtfs-map-note body-2">${i18n("mapNoteTimepoints",null,"Note: Circles represent timepoints. Not all trips serve all parts of the route.")}</p> 207 </div> 208 `;mapRow.appendChild(mapCol);mapContainer.appendChild(mapRow);mapSection.appendChild(mapContainer);wrapper.appendChild(mapSection);scheduleWrapper.__ctGtfsDetailState={normalized:normalizedDetail,filters:{date:defaultDate,direction:getDefaultOutboundDirection(normalizedDetail,defaultDate),entryStop:"",exitStop:"",startMinutes:null,endMinutes:null},viewMode:"table",downloadUrls:downloadUrls||{}};wrapper.__ctGtfsDetailState=scheduleWrapper.__ctGtfsDetailState;return wrapper;}function refreshDetailView(detailWrapper){const state=detailWrapper.__ctGtfsDetailState;if(!state)return;const normalized=state.normalized;const filters=state.filters;const selectedDate=parseGtfsDate(filters.date)||toYmd(new Date());filters.date=selectedDate;const directionStops=buildDirectionStopsForDate(normalized,selectedDate,filters.direction);const hasServiceForDate=getOperatingTrips(normalized,selectedDate,filters.direction).length>0;const result=extractTripsForDirection(directionStops,filters);const noTripsMessage=i18n("noTripsForSelectedDate",null,"No trips for selected date.");const emptyMessage=hasServiceForDate?i18n("emptyDeparturesExpandSearch",null,"No departures match your filters. Try expanding your search."):noTripsMessage;const tableContainer=detailWrapper.querySelector("[data-table-container]");const listContainer=detailWrapper.querySelector("[data-list-container]");const freqHint=detailWrapper.querySelector("[data-frequency-hint]");if(tableContainer){tableContainer.innerHTML="";tableContainer.appendChild(buildScheduleTable(result.stops,result.trips,normalized.meta.shortName,emptyMessage));}if(listContainer){listContainer.innerHTML="";listContainer.appendChild(buildAccessibilityList(result.trips,result.stops,normalized.meta,hasServiceForDate?i18n("emptyDepartures",null,"No departures match your filters."):noTripsMessage));}state.visibleStops=result.stops;const dateStatus=detailWrapper.querySelector(".ct-gtfs-date-status");if(dateStatus){const dateLabel=formatScheduleDateLabel(selectedDate);if(!hasServiceForDate)dateStatus.textContent=i18n("ariaNoTripsForDate",{date:dateLabel},`No trips for ${dateLabel}.`);else dateStatus.textContent="";}if(freqHint)if(hasServiceForDate&&result.trips.length){const allTimes=result.trips.map((t)=>t.start);const hint=computeFrequencyHint(allTimes);if(hint){const dayLabel=formatScheduleDateLabel(selectedDate);freqHint.textContent=i18n("frequencyHintWithDay",{day:dayLabel,hint},`${dayLabel}: ${hint}`);}else freqHint.textContent="";}else freqHint.textContent="";updateStopSelects(detailWrapper,result.stops);updateTimeSelects(detailWrapper,result.stops);const mapContainer=detailWrapper.querySelector("[data-map]");if(mapContainer&&mapContainer.hasAttribute("data-map-initialized")){mapContainer.innerHTML="";mapContainer.removeAttribute("data-map-initialized");renderMap(mapContainer,normalized,detailWrapper);}}function updateStopSelects(detailWrapper,stops){const entrySelect=detailWrapper.querySelector('[data-select="entry"]');const exitSelect=detailWrapper.querySelector('[data-select="exit"]');if(!entrySelect||!exitSelect)return;const state=detailWrapper.__ctGtfsDetailState;const savedEntry=state?.filters?.entryStop||"";const savedExit=state?.filters?.exitStop||"";entrySelect.innerHTML=`<option value="">${i18n("selectOriginBusStop",null,"Select origin bus stop")}</option>`;exitSelect.innerHTML=`<option value="">${i18n("selectExitBusStop",null,"Select exit bus stop")}</option>`;stops.forEach((stop)=>{const optEntry=document.createElement("option");optEntry.value=stop.stop_id;optEntry.textContent=stop.stop_name;entrySelect.appendChild(optEntry);const optExit=document.createElement("option");optExit.value=stop.stop_id;optExit.textContent=stop.stop_name;exitSelect.appendChild(optExit);});if(savedEntry&&stops.some((s)=>s.stop_id===savedEntry))entrySelect.value=savedEntry;if(savedExit&&stops.some((s)=>s.stop_id===savedExit))exitSelect.value=savedExit;}function updateTimeSelects(detailWrapper,stops){const startSelect=detailWrapper.querySelector('[data-select="start"]');const endSelect=detailWrapper.querySelector('[data-select="end"]');if(!startSelect||!endSelect)return;const savedStart=startSelect.value;const savedEnd=endSelect.value;if(!stops.length){startSelect.innerHTML=`<option value="">${i18n("startTime",null,"Start time")}</option>`;endSelect.innerHTML=`<option value="">${i18n("endTime",null,"End time")}</option>`;return;}const allTimes=unique((stops[0].times||[]).map((t)=>
208t.departure_time||t.arrival_time)).filter(Boolean).sort((a,b)=>timeToMinutes(a)-timeToMinutes(b));startSelect.innerHTML=`<option value="">${i18n("startTime",null,"Start time")}</option>`;endSelect.innerHTML=`<option value="">${i18n("endTime",null,"End time")}</option>`;allTimes.forEach((time)=>{const optStart=document.createElement("option");optStart.value=time;optStart.textContent=formatTimeDisplay(time);startSelect.appendChild(optStart);const optEnd=document.createElement("option");optEnd.value=time;optEnd.textContent=formatTimeDisplay(time);endSelect.appendChild(optEnd);});if(savedStart&&allTimes.includes(savedStart))startSelect.value=savedStart;if(savedEnd&&allTimes.includes(savedEnd))endSelect.value=savedEnd;}function setViewMode(detailWrapper,mode){const state=detailWrapper.__ctGtfsDetailState;if(!state)return;state.viewMode=mode;const tableContainer=detailWrapper.querySelector("[data-table-container]");const listContainer=detailWrapper.querySelector("[data-list-container]");const switchBtn=detailWrapper.querySelector(".ct-gtfs-view-switch");if(!tableContainer||!listContainer||!switchBtn)return;if(mode==="list"){tableContainer.hidden=true;listContainer.hidden=false;switchBtn.setAttribute("data-view-mode","list");switchBtn.setAttribute("aria-pressed","false");switchBtn.setAttribute("aria-label",i18n("ariaSwitchToTableView",null,"Switch to table view. Currently showing list view"));}else{tableContainer.hidden=false;listContainer.hidden=true;switchBtn.setAttribute("data-view-mode","table");switchBtn.setAttribute("aria-pressed","true");switchBtn.setAttribute("aria-label",i18n("ariaSwitchToListView",null,"Switch to list view. Currently showing table view"));}}function isMobileScheduleViewport(){if(typeof window==="undefined")return false;return window.matchMedia("(max-width: 991px)").matches;}function enforceMobileListView(detailWrapper){const state=detailWrapper?.__ctGtfsDetailState;if(!state)return;if(isMobileScheduleViewport())setViewMode(detailWrapper,"list");}function getScheduleDownloadUrlForDay(el,day){if(day==="weekdays")return el.getAttribute("data-url-weekday")||"";if(day==="saturday")return (el.getAttribute("data-url-saturday")||el.getAttribute("data-url-weekend")||"");if(day==="sunday")return (el.getAttribute("data-url-sunday")||el.getAttribute("data-url-weekend")||"");return "";}function applyScheduleDownloadLink(el,url){el.href=url||"#";el.style.pointerEvents=url?"":"none";el.style.opacity=url?"":"0.6";if(url){el.setAttribute("target","_blank");el.setAttribute("rel","noopener noreferrer");}else{el.removeAttribute("target");el.removeAttribute("rel");}}function updateScheduleDownloadLinks(detailWrapper,day){detailWrapper.querySelectorAll("[data-action='download-schedule'], [data-action='download-html']").forEach((el)=>{applyScheduleDownloadLink(el,getScheduleDownloadUrlForDay(el,day));});}function bindDetailInteractions(detailWrapper){const state=detailWrapper.__ctGtfsDetailState;if(!state)return;const dateInput=detailWrapper.querySelector('[data-select="date"]');if(dateInput){const applySelectedDate=(rawValue)=>{const nextDate=parseGtfsDate(rawValue)||toYmd(new Date());dateInput.value=nextDate;if(state.filters.date===nextDate)return;state.filters.date=nextDate;state.filters.direction=getDefaultOutboundDirection(state.normalized,nextDate);state.filters.entryStop="";state.filters.exitStop="";updateScheduleDownloadLinks(detailWrapper,getDayBucketForDate(nextDate));refreshDetailView(detailWrapper);};dateInput.addEventListener("change",()=>{applySelectedDate(dateInput.value);});}updateScheduleDownloadLinks(detailWrapper,getDayBucketForDate(state.filters.date));const swapBtn=detailWrapper.querySelector(".ct-gtfs-swap-button");if(swapBtn)swapBtn.addEventListener("click",()=>{const entrySelect=detailWrapper.querySelector('[data-select="entry"]');const exitSelect=detailWrapper.querySelector('[data-select="exit"]');const currentEntry=state.filters.entryStop||"";const currentExit=state.filters.exitStop||"";const currentIdx=state.normalized.directionOrder.indexOf(state.filters.direction);const nextIdx=(currentIdx+1)%state.normalized.directionOrder.length;state.filters.direction=state.normalized.directionOrder[nextIdx];state.filters.entryStop=currentExit;state.filters.exitStop=currentEntry;
208refreshDetailView(detailWrapper);});detailWrapper.querySelectorAll("select.ct-gtfs-select").forEach((select)=>{select.addEventListener("change",()=>{const type=select.getAttribute("data-select");if(type==="entry")state.filters.entryStop=select.value;else if(type==="exit")state.filters.exitStop=select.value;else if(type==="start")state.filters.startMinutes=select.value?timeToMinutes(select.value):null;else{if(type==="end")state.filters.endMinutes=select.value?timeToMinutes(select.value):null;}refreshDetailView(detailWrapper);});});const viewSwitch=detailWrapper.querySelector(".ct-gtfs-view-switch");if(viewSwitch)viewSwitch.addEventListener("click",()=>{const currentMode=state.viewMode;const newMode=currentMode==="table"?"list":"table";setViewMode(detailWrapper,newMode);});let resizeRafId=null;const handleResize=()=>{if(resizeRafId)window.cancelAnimationFrame(resizeRafId);resizeRafId=window.requestAnimationFrame(()=>{enforceMobileListView(detailWrapper);});};window.addEventListener("resize",handleResize,{passive:true});enforceMobileListView(detailWrapper);}async function initScheduleDetail(context){const root=context&&context!==document?context:document;const container=root.querySelector("[data-ct-gtfs-route-id]");if(!container)return;const routeKey=container.getAttribute("data-ct-gtfs-route-id");if(!routeKey){console.warn("No data-ct-gtfs-route-id found for schedule detail page");return;}if(container.dataset.ctGtfsDetailInitialized==="true")return;container.dataset.ctGtfsDetailInitialized="true";const downloadUrls=readScheduleDownloadUrls(container);if(window.CTI18n&&typeof window.CTI18n.prepare==="function")await window.CTI18n.prepare("schedule-detail");container.innerHTML=i18nHtml("loadingState",'<div class="ct-gtfs-loading"><span aria-hidden="true">â³</span>Loading schedule detailsâ¦</div>');try{let data=await fetchMergedRouteDetailByShortName(routeKey);const starRouteKey=ROUTE_STAR_MERGES[String(routeKey).trim()];if(starRouteKey)try{const starData=await fetchMergedRouteDetailByShortName(starRouteKey);data=mergeStarRouteIntoPrimary(data,starData);}catch(starError){console.warn(`Unable to merge starred route ${starRouteKey} into ${routeKey}:`,starError);}const normalized=normalizeRouteDetail(data);const detailView=buildDetailView({id:data.id,route_short_name:data.route_short_name,route_long_name:data.route_long_name,categories:data.categories||[]},normalized,downloadUrls);container.innerHTML="";container.appendChild(detailView);(function initReverseTooltip(){const btn=detailView.querySelector(".ct-gtfs-swap-button");if(!btn)return;const tooltipText=i18n("tooltipSwitchDirection",null,"Click to switch direction");btn.setAttribute("title",tooltipText);if(window.bootstrap&&window.bootstrap.Tooltip&&typeof window.bootstrap.Tooltip==="function"){if(btn.dataset.ctTooltipInitialized==="true")return;btn.dataset.ctTooltipInitialized="true";new window.bootstrap.Tooltip(btn,{title:tooltipText,placement:"top",trigger:"hover focus",customClass:"ct-gtfs-theme-tooltip"});}})();refreshDetailView(detailView);bindDetailInteractions(detailView);const mapContainer=detailView.querySelector("[data-map]");if(mapContainer)renderMap(mapContainer,normalized,detailView);if(isMobileScheduleViewport())setViewMode(detailView,"list");else setViewMode(detailView,"table");}catch(error){console.error("Error loading route detail:",error);container.dataset.ctGtfsDetailInitialized="false";container.innerHTML=i18nHtml("errorState",'<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>We were unable to load this route. Please try again shortly.</div>');}}async function initHeroRouteSearch(context){const root=context&&context!==document?context:document;const wrapper=root.querySelector("[data-ct-hero-route-search]");if(!wrapper)return;if(wrapper.dataset.ctHeroRouteSearchInitialized==="true")return;wrapper.dataset.ctHeroRouteSearchInitialized="true";const input=wrapper.querySelector("#ct-hero-route-search-input");const dropdown=wrapper.querySelector("#ct-hero-route-search-dropdown");const popularContainer=wrapper.querySelector("#ct-hero-popular-routes");const status=wrapper.querySelector("#ct-hero-route-search-status");if(!input||!dropdown)return;const closeDropdown=()=>{dropdown.hidden=true;
208input.setAttribute("aria-expanded","false");input.removeAttribute("aria-activedescendant");dropdown.querySelectorAll(".ct-gtfs-search-dropdown-item").forEach((el)=>el.setAttribute("aria-selected","false"));};function getRouteNumberParts(route){const shortName=String((route&&route.route_short_name)||(route&&route.route_id)||"");const match=shortName.trim().match(/^(\d+)(.*)$/);if(!match)return {num:Number.MAX_SAFE_INTEGER,suffix:shortName.toLowerCase()};return {num:parseInt(match[1],10),suffix:String(match[2]||"").toLowerCase()};}function compareRoutesByNumber(a,b){const pa=getRouteNumberParts(a);const pb=getRouteNumberParts(b);if(pa.num!==pb.num)return pa.num-pb.num;const suffixCmp=pa.suffix.localeCompare(pb.suffix);if(suffixCmp!==0)return suffixCmp;return String(a.route_short_name||a.route_id||"").localeCompare(String(b.route_short_name||b.route_id||""));}function getRouteDisplayName(route){if(!route)return i18n("unknownRoute",null,"Unknown Route");const short=String(route.route_short_name||"").trim();const long=String(route.route_long_name||"").trim();if(short&&long)return `${short} ${long}`.trim();return short||long||i18n("unknownRoute",null,"Unknown Route");}function getRouteUrl(route){const no=String(route?.route_short_name||route?.route_id||"").trim();if(!no)return "/schedules";return `/schedules/${encodeURIComponent(no)}`;}function pickRandomRoutes(routes,count){const arr=routes.slice();for(let i=arr.length-1;i>0;i-=1){const j=Math.floor(Math.random()*(i+1));const tmp=arr[i];arr[i]=arr[j];arr[j]=tmp;}return arr.slice(0,count);}function renderPopularRoutes(routes){if(!popularContainer)return;popularContainer.innerHTML="";if(!Array.isArray(routes)||!routes.length)return;const picks=pickRandomRoutes(routes,5);picks.forEach((route)=>{const short=String(route.route_short_name||route.route_id||"").trim();const longName=String(route.route_long_name||"").trim();const href=getRouteUrl(route);if(!short&&!longName)return;const link=document.createElement("a");link.href=href;link.className="ct-gtfs-pill";link.textContent=longName||short;link.title=getRouteDisplayName(route);link.setAttribute("aria-label",i18n("ariaViewScheduleForRoute",{name:longName||short},`View schedule for ${longName||short}`));popularContainer.appendChild(link);});}function escapeRegExp(value){return String(value).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");}function escapeHtml(value){return String(value).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");}function highlightMatch(value,query){const safeValue=String(value||"");const q=String(query||"").trim();if(!q)return escapeHtml(safeValue);const pattern=new RegExp(`(${escapeRegExp(q)})`,"ig");return escapeHtml(safeValue).replace(pattern,'<span class="ct-gtfs-search-highlight">$1</span>');}function renderDropdownItems(items,filteredRoutesState,query){dropdown.innerHTML="";if(!items.length){const empty=document.createElement("li");empty.className="ct-gtfs-search-dropdown-item ct-gtfs-search-dropdown-item--empty";empty.setAttribute("role","option");empty.setAttribute("aria-disabled","true");empty.textContent=i18n("routeNotFound",null,"Route not found.");dropdown.appendChild(empty);dropdown.hidden=false;input.setAttribute("aria-expanded","true");input.removeAttribute("aria-activedescendant");filteredRoutesState.activeIndex=-1;if(status)status.textContent=i18n("routeNotFound",null,"Route not found.");return;}items.forEach((route,index)=>{const li=document.createElement("li");li.className="ct-gtfs-search-dropdown-item";li.id=`ct-hero-route-suggestion-${index}`;li.setAttribute("role","option");li.setAttribute("aria-selected","false");const routeLabel=String(route.route_short_name||route.route_id||"").trim();const routeName=String(route.route_long_name||"").trim();li.innerHTML='<span class="ct-gtfs-search-dropdown-route">'+highlightMatch(routeLabel,query)+"</span>"+'<span class="ct-gtfs-search-dropdown-name">'+highlightMatch(routeName,query)+"</span>";li.addEventListener("click",(e)=>{e.preventDefault();selectRoute(route);input.value="";closeDropdown();});dropdown.appendChild(li);});filteredRoutesState.activeIndex=0;const first=dropdown.querySelector(`#ct-hero-route-suggestion-${filteredRoutesState.activeIndex}`);dropdown.querySelectorAll(".ct-gtfs-search-dropdown-item").forEach((el,idx)=>{const isActive=idx===0;el.classList.toggle("is-active",isActive);el.setAttribute("aria-selected",isActive?"true":"false");});if(first)input.setAttribute("aria-activedescendant",first.id);dropdown.hidden=false;input.setAttribute("aria-expanded","true");if(status){const count=items.length;status.textContent=count===1?i18n("oneRouteSuggestion",null,"1 route suggestion available."):i18n("routeSuggestionsCount",{count},`${count} route suggestions available.`);}}function highlightActiveItem(filteredRoutesState){const items=dropdown.querySelectorAll(".ct-gtfs-search-dropdown-item");
208items.forEach((el,idx)=>{const isActive=idx===filteredRoutesState.activeIndex;el.classList.toggle("is-active",isActive);el.setAttribute("aria-selected",isActive?"true":"false");});if(filteredRoutesState.activeIndex>=0&&items[filteredRoutesState.activeIndex])input.setAttribute("aria-activedescendant",items[filteredRoutesState.activeIndex].id);else input.removeAttribute("aria-activedescendant");}function selectRoute(route){const href=getRouteUrl(route);if(!href)return;window.location.href=href;}function getHaystack(route){return (String(route.route_short_name||"").toLowerCase()+" "+String(route.route_long_name||"").toLowerCase());}let state={routes:[],filtered:[],activeIndex:-1,loading:true};async function loadRoutesIndex(){if(typeof window!=="undefined"&&window.ctGtfsHeroRoutesPromise instanceof Promise)return window.ctGtfsHeroRoutesPromise;const routesPromise=(async()=>{const data=await fetchRoutesIndexRaw();let routesData=data;if(typeof data==="string")routesData=JSON.parse(data);const landingRoutes=routesData?.landing?Array.isArray(routesData.landing)?routesData.landing:routesData.landing.routes||routesData.landing.data||routesData.landing.items||[]:[];const routesList=Array.isArray(routesData)?routesData:routesData?.routes||routesData?.data||routesData?.items||landingRoutes||[];const normalizeRouteIndexItem=(item)=>{if(item&&(item.shortName!==undefined||item.longName!==undefined))return {...item,route_id:item.routeId!==undefined&&item.routeId!==null?String(item.routeId):item.code!==undefined&&item.code!==null?String(item.code):String(item.id||""),route_short_name:item.shortName!==undefined&&item.shortName!==null?String(item.shortName):String(item.routeId||""),route_long_name:item.longName!==undefined&&item.longName!==null?String(item.longName):""};return item;};const normalized=Array.isArray(routesList)?routesList.map(normalizeRouteIndexItem):[];return dedupeRoutesByShortName(normalized);})();if(typeof window!=="undefined")window.ctGtfsHeroRoutesPromise=routesPromise;return routesPromise;}try{input.disabled=true;input.placeholder=i18n("loadingRoutes",null,"Loading routes...");state.loading=true;state.routes=await loadRoutesIndex();state.routes.sort(compareRoutesByNumber);renderPopularRoutes(state.routes);closeDropdown();}catch(e){console.error("Hero route search failed to load routes:",e);}finally{state.loading=false;input.disabled=false;input.placeholder=i18n("enterRouteNumberOrName",null,"Enter Route number or name");}function filterAndRender(term){const q=String(term||"").trim().toLowerCase();if(!q){state.filtered=[];closeDropdown();return;}state.filtered=state.routes.filter((route)=>getHaystack(route).includes(q)).slice(0,10);state.filtered.sort(compareRoutesByNumber);renderDropdownItems(state.filtered,state,q);}input.addEventListener("input",(e)=>{if(state.loading)return;filterAndRender(e.target.value);});input.addEventListener("focus",()=>{if(state.loading)return;const currentValue=String(input.value||"");if(currentValue.trim())filterAndRender(currentValue);});input.addEventListener("keydown",(e)=>{if(e.key==="ArrowDown"&&dropdown.hidden){e.preventDefault();if(!state.filtered.length)filterAndRender(input.value);else renderDropdownItems(state.filtered,state,input.value);}if(dropdown.hidden)return;const itemsCount=state.filtered.length;if(!itemsCount)return;if(e.key==="ArrowDown"){e.preventDefault();state.activeIndex=Math.min(state.activeIndex+1,itemsCount-1);highlightActiveItem(state);return;}if(e.key==="ArrowUp"){e.preventDefault();state.activeIndex=Math.max(state.activeIndex-1,-1);highlightActiveItem(state);return;}if(e.key==="Home"){e.preventDefault();state.activeIndex=0;highlightActiveItem(state);return;}if(e.key==="End"){e.preventDefault();state.activeIndex=itemsCount-1;highlightActiveItem(state);return;}if(e.key==="Enter"){if(state.activeIndex>=0&&state.filtered[state.activeIndex]){e.preventDefault();selectRoute(state.filtered[state.activeIndex]);input.value="";closeDropdown();}return;}if(e.key==="Escape"){e.preventDefault();closeDropdown();}});document.addEventListener("click",(e)=>{const target=e.target;if(!target)return;if(!wrapper.contains(target))closeDropdown();});input.addEventListener("blur",()=>{window.setTimeout(()=>{const active=document.activeElement;if(!active||!wrapper.contains(active))closeDropdown();},120);});}if(typeof Drupal!=="undefined"&&Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.ctScheduleDetail={attach:function(context){initScheduleDetail(context);initHeroRouteSearch(context);}};else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){initScheduleDetail(document);initHeroRouteSearch(document);});else{initScheduleDetail(document);initHeroRouteSearch(document);}})(typeof Drupal!=="undefined"&&Drupal?Drupal:{},typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{});; 209(function(Drupal,$,window){"use strict";function i18n(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.t==="function")return window.CTI18n.t("schedules-gtfs",key,vars,fallback);return typeof fallback==="string"?fallback:key;}var CATEGORY_I18N_KEYS={Local:"categoryLocal",Express:"categoryExpress",CTfastrak:"categoryCtfastrak",Shuttle:"categoryShuttle",Airport:"categoryAirport"};function translateCategoryLabel(category){var key=CATEGORY_I18N_KEYS[category];if(!key)return category;return i18n(key,null,category);}function needsApiTranslate(text,englishFallback){return (String(text||"").replace(/\s+/g," ").trim().toLowerCase()===String(englishFallback||"").replace(/\s+/g," ").trim().toLowerCase());}function attachApiTranslate(context){if(!context||!Drupal.behaviors||!Drupal.behaviors.ctApiGtranslate||typeof Drupal.behaviors.ctApiGtranslate.attach!=="function")return;Drupal.behaviors.ctApiGtranslate.attach(context);}var API_BASE_URL="https://cttransit.alerts.api.exemplifi.io/api/v1";var API_HEADERS={Accept:"application/json","X-API-KEY":"sk_live_SOdoS2lNrADb82dOIDtRcz_t33L3Zx0t"};function getApiUrl(endpoint){return API_BASE_URL+endpoint;}function fetchRoutesIndexRaw(){if(typeof window!=="undefined"&&window.ctGtfsRoutesIndexPromise instanceof Promise)return window.ctGtfsRoutesIndexPromise;window.ctGtfsRoutesIndexPromise=fetch(getApiUrl("/routes"),{headers:API_HEADERS}).then(function(response){if(!response.ok)throw new Error("Failed to load routes from alerts API.");return response.json();});return window.ctGtfsRoutesIndexPromise;}function hasCompoundRouteLabel(value){return String(value||"").indexOf("/")!==-1;}function getCompoundRoutePartKeys(value){return String(value||"").split("/").map(function(part){return part.trim().toLowerCase();}
209).filter(Boolean);}function filterDirectoryRoutes(routes){if(!Array.isArray(routes)||!routes.length)return routes;var singleRouteKeys=new Set();routes.forEach(function(route){var shortName=String(route.route_short_name||"").trim();var routeId=String(route.route_id||"").trim();if(hasCompoundRouteLabel(shortName)||hasCompoundRouteLabel(routeId))return;if(shortName)singleRouteKeys.add(shortName.toLowerCase());if(routeId)singleRouteKeys.add(routeId.toLowerCase());});var withoutCompounds=routes.filter(function(route){var shortName=String(route.route_short_name||"").trim();var routeId=String(route.route_id||"").trim();if(!hasCompoundRouteLabel(shortName)&&!hasCompoundRouteLabel(routeId))return true;var parts=getCompoundRoutePartKeys(shortName);if(!parts.length)parts=getCompoundRoutePartKeys(routeId);if(!parts.length)return false;return !parts.every(function(part){return singleRouteKeys.has(part);});});var seenShortNames=Object.create(null);return withoutCompounds.filter(function(route){var key=String(route.route_short_name||"").trim().toLowerCase();if(!key||seenShortNames[key])return false;seenShortNames[key]=true;return true;});}function loadGoogleMaps(){if(window.CTGoogleMaps&&typeof window.CTGoogleMaps.load==="function")return window.CTGoogleMaps.load();if(window.google&&window.google.maps)return Promise.resolve(window.google.maps);return new Promise(function(resolve,reject){var attempts=0;var maxAttempts=50;var checkInterval=setInterval(function(){attempts++;if(window.google&&window.google.maps){clearInterval(checkInterval);resolve(window.google.maps);}else{if(attempts>=maxAttempts){clearInterval(checkInterval);reject(new Error("Google Maps API failed to load"));}}},100);});}function timeToMinutes(value){if(!value)return null;var parts=value.split(":");if(parts.length<2)return null;var hours=parseInt(parts[0],10);var minutes=parseInt(parts[1],10);if(isNaN(hours)||isNaN(minutes))return null;return hours*60+minutes;}function formatTimeDisplay(value){if(!value)return "â";var minutes=timeToMinutes(value);if(minutes===null)return value;var hours24=Math.floor(minutes/60)%24;var mins=minutes%60;var period=hours24>=12?"PM":"AM";var hours12=hours24%12;if(hours12===0)hours12=12;return (hours12.toString()+":"+(mins<10?"0"+mins:mins)+" "+period);}function unique(array){return Array.from(new Set(array));}function safeJsonParse(value){try{return JSON.parse(value);}catch(e){return null;}}function buildDetailUrl(template,routeId){return template.replace("__ROUTE_ID__",encodeURIComponent(routeId));}function minutesBetween(start,end){var startMinutes=timeToMinutes(start);var endMinutes=timeToMinutes(end);if(startMinutes===null||endMinutes===null)return null;return Math.max(endMinutes-startMinutes,0);}function computeFrequencyLabel(times){if(!times||times.length<2)return null;var deltas=[];for(var i=1;i<times.length;i+=1){var diff=minutesBetween(times[i-1],times[i]);if(diff!==null&&diff>0)deltas.push(diff);}if(!deltas.length)return null;deltas.sort(function(a,b){return a-b;});var median=deltas[Math.floor(deltas.length/2)];if(!median)return null;if(median%60===0){var hours=median/60;if(hours>1)return i18n("runsEveryHoursPlural",{hours},"Runs every "+hours+" hours");return i18n("runsEveryHours",{hours},"Runs every "+hours+" hour");}if(median>60&&median%30===0){var multiples=median/30;return i18n("runsEveryMinutes",{minutes:multiples*30},"Runs every "+multiples*30+" min");}return i18n("runsEveryMinutes",{minutes:median},"Runs every "+median+" min");}function normalizeRouteDetail(raw){var directions={};var directionOrder=[];var directionHeadsigns={};(raw.stops||[]).forEach(function(stop){var timesByDirection={};(stop.times||[]).forEach(function(time){var dir=(time.direction||"0").toString();if(!timesByDirection[dir])timesByDirection[dir]=[];timesByDirection[dir].push({arrival_time:time.arrival_time,departure_time:time.departure_time,headsign:time.headsign||"",sequence:time.sequence||0});if(!directionHeadsigns[dir]&&time.headsign)directionHeadsigns[dir]=time.headsign;});Object.keys(timesByDirection).forEach(function(dir){if(!directions[dir]){directions[dir]=[];directionOrder.push(dir);}var directionTimes=timesByDirection[dir];directionTimes.sort(function(a,b){return ((a.sequence||0)-(b.sequence||0)||timeToMinutes(a.departure_time)-timeToMinutes(b.departure_time));});directions[dir].push({stop_id:stop.stop_id,stop_name:stop.stop_name,stop_lat:stop.stop_lat,stop_lon:stop.stop_lon,sequence:directionTimes.length?directionTimes[0].sequence:0,times:directionTimes.map(function(time){return {arrival_time:time.arrival_time,departure_time:time.departure_time,headsign:time.headsign};})});});});directionOrder.forEach(function(dir){directions[dir].sort(function(a,b){if(a.sequence===b.sequence)return a.stop_name.localeCompare(b.stop_name);return a.sequence-b.sequence;});});var headsignPairs=[];directionOrder.forEach(function(dir){if(directionHeadsigns[dir])headsignPairs.push({direction:dir,headsign:directionHeadsigns[dir]});});return {meta:{id:raw.route_id,shortName:raw.route_short_name,longName:raw.route_long_name,agency:raw.agency,color:raw.route_color,categories:raw.categories||[],headsigns:headsignPairs},directions,directionOrder,shapes:raw.shapes||{}};}function createRouteCard(route){var href="/schedules/"+encodeURIComponent(route.route_short_name||route.route_id);var card=document.createElement("a");
209card.className="ct-gtfs-route-card";card.setAttribute("data-route-id",route.route_id);card.setAttribute("data-route-slug",route.slug);card.setAttribute("href",href);var actionLabel=i18n("viewSchedule",null,"View Schedule");var actionClass="ct-gtfs-card-action-label";var actionAttrs="";if(needsApiTranslate(actionLabel,"View Schedule")){actionClass+=" ct-gtranslate-api";actionAttrs=' lang="en" translate="yes"';}card.innerHTML='<div class="ct-gtfs-route-card-content">'+'<div class="ct-gtfs-route-card-top">'+'<div class="ct-gtfs-route-card-title">'+"<h4>"+Drupal.checkPlain(route.route_short_name+" "+route.route_long_name)+'</h4><div class="ct-gtfs-tag-wrapper">'+(route.categories||[]).map(function(category){var label=translateCategoryLabel(category);var tagClass="ct-gtfs-tag body-2";var tagLang="";if(needsApiTranslate(label,category)){tagClass+=" ct-gtranslate-api";tagLang=' lang="en" translate="yes"';}return ('<span class="'+tagClass+'"'+tagLang+">"+Drupal.checkPlain(label)+"</span>");}).join("")+"</div></div>"+'<span class="ct-btn ct-btn--tertiary ct-gtfs-card-action">'+'<span class="'+actionClass+'"'+actionAttrs+">"+Drupal.checkPlain(actionLabel)+"</span>"+'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" alt="" aria-hidden="true"><path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="#001123" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>'+"</span>"+"</div>"+"</div>";return card;}function buildSelect(options,attrs){var select=document.createElement("select");select.className="ct-gtfs-select";Object.keys(attrs||{}).forEach(function(key){select.setAttribute(key,attrs[key]);});options.forEach(function(opt){var option=document.createElement("option");option.value=opt.value;option.textContent=opt.label;if(opt.selected)option.selected=true;select.appendChild(option);});return select;}function buildAccessibilityList(trips,stops){var container=document.createElement("div");container.className="ct-gtfs-accessible-list";container.setAttribute("hidden","hidden");if(!trips.length){container.innerHTML='<p class="ct-gtfs-empty-state">'+i18n("emptyDepartures",null,"No departures match your filters.")+"</p>";return container;}var list=document.createElement("div");list.className="ct-gtfs-accessible-list-content";trips.forEach(function(trip){var item=document.createElement("article");item.className="ct-gtfs-accessible-trip";var header=document.createElement("header");header.innerHTML="<strong>"+i18n("tripStartingAt",{time:formatTimeDisplay(trip.start)},"Trip starting "+formatTimeDisplay(trip.start))+"</strong>";item.appendChild(header);var ul=document.createElement("ul");ul.className="ct-gtfs-accessible-stops";trip.stops.forEach(function(stopEntry,index){var li=document.createElement("li");li.innerHTML="<span>"+Drupal.checkPlain(stops[index].stop_name)+"</span><span>"+formatTimeDisplay(stopEntry)+"</span>";ul.appendChild(li);});item.appendChild(ul);list.appendChild(item);});container.appendChild(list);return container;}function buildScheduleTable(stops,trips){var wrapper=document.createElement("div");wrapper.className="ct-gtfs-table-wrapper";var table=document.createElement("table");table.className="ct-gtfs-table";var thead=document.createElement("thead");var headRow=document.createElement("tr");headRow.appendChild(document.createElement("th"));stops.forEach(function(stop){var th=document.createElement("th");th.textContent=stop.stop_name;headRow.appendChild(th);});thead.appendChild(headRow);var tbody=document.createElement("tbody");if(!trips.length){var emptyRow=document.createElement("tr");var emptyCell=document.createElement("td");emptyCell.colSpan=stops.length+1;emptyCell.innerHTML="<div class='ct-gtfs-empty-state'>"+"<span aria-hidden='true'>ð</span>"+i18n("emptyDeparturesExpandSearch",null,"No departures match your filters. Try expanding your search.")+"</div>";emptyRow.appendChild(emptyCell);tbody.appendChild(emptyRow);}else trips.forEach(function(trip,index){var row=document.createElement("tr");var labelCell=document.createElement("td");labelCell.textContent=i18n("tripIndex",{index:index+1}
209,"Trip "+(index+1))+" ⢠"+formatTimeDisplay(trip.start);row.appendChild(labelCell);stops.forEach(function(stop,stopIndex){var cell=document.createElement("td");cell.textContent=formatTimeDisplay(trip.stops[stopIndex]);row.appendChild(cell);});tbody.appendChild(row);});table.appendChild(thead);table.appendChild(tbody);wrapper.appendChild(table);return wrapper;}function extractTripsForDirection(directionStops,filters){if(!directionStops||!directionStops.length)return {stops:[],trips:[]};var orderedStops=directionStops.slice();var visibleStops=orderedStops;if(filters.entryStop||filters.exitStop){var startIdx=0;var endIdx=orderedStops.length-1;orderedStops.forEach(function(stop,idx){if(stop.stop_id===filters.entryStop)startIdx=idx;if(stop.stop_id===filters.exitStop)endIdx=idx;});if(startIdx>endIdx){var temp=startIdx;startIdx=endIdx;endIdx=temp;}visibleStops=orderedStops.slice(startIdx,endIdx+1);}var tripCount=0;visibleStops.forEach(function(stop){if(stop.times.length>tripCount)tripCount=stop.times.length;});var compiledTrips=[];for(var tripIndex=0;tripIndex<tripCount;tripIndex+=1){var rowTimes=visibleStops.map(function(stop){return stop.times[tripIndex]?stop.times[tripIndex].departure_time||stop.times[tripIndex].arrival_time:null;});var valid=rowTimes.some(Boolean);if(!valid)continue;var startTime=rowTimes[0];var endTime=rowTimes[rowTimes.length-1];var startMinutes=timeToMinutes(startTime);if(filters.startMinutes!==null&&startMinutes!==null&&startMinutes<filters.startMinutes)continue;if(filters.endMinutes!==null&&startMinutes!==null&&startMinutes>filters.endMinutes)continue;compiledTrips.push({start:startTime,end:endTime,stops:rowTimes});}return {stops:visibleStops,trips:compiledTrips};}function renderMap(container,detail){if(!container)return;loadGoogleMaps().then(function(maps){var map=new maps.Map(container,{center:{lat:41.7658,lng:-72.6734},zoom:11,mapTypeControl:false,streetViewControl:false,fullscreenControl:true});var bounds=new maps.LatLngBounds();var shapeKeys=Object.keys(detail.shapes||{});if(shapeKeys.length){var firstShape=detail.shapes[shapeKeys[0]];if(firstShape&&firstShape.length){var path=firstShape.map(function(point){var latLng={lat:point.lat,lng:point.lon};bounds.extend(latLng);return latLng;});new maps.Polyline({path,map,strokeColor:"#d9534f",strokeWeight:4,strokeOpacity:0.8});}}var added={};detail.directionOrder.forEach(function(direction){(detail.directions[direction]||[]).forEach(function(stop){if(added[stop.stop_id])return;added[stop.stop_id]=true;var position={lat:stop.stop_lat,lng:stop.stop_lon};bounds.extend(position);new maps.Marker({map,position,title:stop.stop_name});});});if(!bounds.isEmpty())map.fitBounds(bounds);}).catch(function(){container.innerHTML='<div class="ct-gtfs-error">'+"<span aria-hidden='true'>â ï¸</span>"+i18n("mapLoadError",null,"Unable to load the interactive map at this time.")+"</div>";});}function buildDetailView(routeSummary,normalizedDetail){var collapse=document.createElement("div");collapse.className="ct-gtfs-route-details";collapse.setAttribute("data-route-detail",routeSummary.route_id);var meta=normalizedDetail.meta;var summaryText=i18n("operatedBy",{agency:meta.agency||"CTtransit"},"Operated by "+(meta.agency||"CTtransit"));var frequencyHints=[];var defaultDirection=normalizedDetail.directionOrder[0]||"0";var firstDirection=normalizedDetail.directions[defaultDirection]||[];if(firstDirection.length&&firstDirection[0].times.length>1){var firstTimes=firstDirection[0].times.map(function(entry){return entry.departure_time||entry.arrival_time;});var hint=computeFrequencyLabel(firstTimes.slice(0,12));if(hint)frequencyHints.push(hint);}var categories=meta.categories&&meta.categories.length?meta.categories.join(" ⢠"):i18n("localService",null,"Local");collapse.innerHTML='<header class="ct-gtfs-detail-header">'+'<span class="ct-gtfs-chip">'+i18n("routeHeading",{route:meta.shortName},"Route "+meta.shortName)+"</span>"+'<h4 class="ct-gtfs-detail-title">'+Drupal.checkPlain(i18n("routePrefix",null,"Route:")+" "+meta.longName)+"</h4>"+'<p class="ct-gtfs-detail-summary">'+Drupal.checkPlain(summaryText)+"</p>"+(frequencyHints.length?'<p class="ct-gtfs-detail-summary"><em>'+frequencyHints.join(" · ")+"</em></p>":"")+'<p class="ct-gtfs-detail-summary">'+Drupal.checkPlain(categories)+"</p>"+"</header>";var toolbar=document.createElement("div");
209toolbar.className="ct-gtfs-detail-toolbar";var directionOptions=normalizedDetail.directionOrder.map(function(dir){var headsign="";var metaHead=normalizedDetail.meta.headsigns.find(function(pair){return pair.direction===dir;});if(metaHead)headsign=metaHead.headsign;return {value:dir,label:headsign?headsign:i18n("directionLabel",{dir},"Direction "+dir),selected:dir===defaultDirection};});var directionSelect=buildSelect(directionOptions,{"data-select":"direction","aria-label":i18n("selectDirection",null,"Select direction")});var allStopsForDirection=normalizedDetail.directions[defaultDirection]||[];var stopOptions=allStopsForDirection.map(function(stop,index){return {value:stop.stop_id,label:stop.stop_name,sequence:index};});var entrySelect=buildSelect([{value:"",label:i18n("selectOriginBusStop",null,"Select origin bus stop"),selected:true}].concat(stopOptions.map(function(stop){return {value:stop.value,label:stop.label};})),{"data-select":"entry","aria-label":i18n("selectOriginBusStop",null,"Select origin bus stop")});var exitSelect=buildSelect([{value:"",label:i18n("selectExitBusStop",null,"Select exit bus stop"),selected:true}].concat(stopOptions.map(function(stop){return {value:stop.value,label:stop.label};})),{"data-select":"exit","aria-label":i18n("selectExitBusStop",null,"Select exit bus stop")});var availableTimes=unique((allStopsForDirection[0]?allStopsForDirection[0].times:[]).map(function(time){return time.departure_time||time.arrival_time;})).filter(Boolean).sort(function(a,b){return timeToMinutes(a)-timeToMinutes(b);});var startSelect=buildSelect([{value:"",label:i18n("startTime",null,"Start Time"),selected:true}].concat(availableTimes.map(function(time){return {value:time,label:formatTimeDisplay(time)};})),{"data-select":"start","aria-label":i18n("startTimeFilter",null,"Start time filter")});var endSelect=buildSelect([{value:"",label:i18n("endTime",null,"End Time"),selected:true}].concat(availableTimes.map(function(time){return {value:time,label:formatTimeDisplay(time)};})),{"data-select":"end","aria-label":i18n("endTimeFilter",null,"End time filter")});var accessibleButton=document.createElement("button");accessibleButton.className="ct-gtfs-button ct-gtfs-button--ghost";accessibleButton.type="button";accessibleButton.setAttribute("data-action","toggle-accessible");accessibleButton.textContent=i18n("switchToAccessibleListView",null,"Switch to Accessible List View");toolbar.appendChild(directionSelect);toolbar.appendChild(entrySelect);toolbar.appendChild(exitSelect);toolbar.appendChild(startSelect);toolbar.appendChild(endSelect);toolbar.appendChild(accessibleButton);collapse.appendChild(toolbar);var tableArea=document.createElement("div");tableArea.setAttribute("data-table-container","true");collapse.appendChild(tableArea);var accessibleArea=buildAccessibilityList([],allStopsForDirection);accessibleArea.setAttribute("data-accessible-container","true");collapse.appendChild(accessibleArea);var map=document.createElement("div");map.className="ct-gtfs-map";map.setAttribute("data-map","true");collapse.appendChild(map);collapse.__ctGtfsDetailState={normalized:normalizedDetail,filters:{direction:defaultDirection,entryStop:"",exitStop:"",startMinutes:null,endMinutes:null}};return collapse;}function refreshDetailView(detailWrapper){var state=detailWrapper.__ctGtfsDetailState;if(!state)return;var normalized=state.normalized;var filters=state.filters;var directionStops=normalized.directions[filters.direction]||[];var result=extractTripsForDirection(directionStops,filters);var tableContainer=detailWrapper.querySelector("[data-table-container]");var accessibleContainer=detailWrapper.querySelector("[data-accessible-container]");if(tableContainer){tableContainer.innerHTML="";tableContainer.appendChild(buildScheduleTable(result.stops,result.trips));}if(accessibleContainer){accessibleContainer.innerHTML="";accessibleContainer.appendChild(buildAccessibilityList(result.trips,result.stops.length?result.stops:directionStops));}}function setAccessibleMode(detailWrapper,enable){var tableWrapper=detailWrapper.querySelector("[data-table-container]");var accessibleWrapper=detailWrapper.querySelector("[data-accessible-container]");if(enable){if(tableWrapper)tableWrapper.style.display="none";if(accessibleWrapper){accessibleWrapper.hidden=false;accessibleWrapper.style.display="block";}}else{if(tableWrapper)tableWrapper.style.display="";if(accessibleWrapper){accessibleWrapper.hidden=true;accessibleWrapper.style.display="none";}}}function bindDetailInteractions(detailWrapper){var toolbar=detailWrapper.querySelector(".ct-gtfs-detail-toolbar");
209if(!toolbar)return;toolbar.addEventListener("change",function(event){var target=event.target;var state=detailWrapper.__ctGtfsDetailState;if(!state)return;if(target.dataset.select==="direction"){state.filters.direction=target.value;var directionStops=state.normalized.directions[state.filters.direction]||[];var entrySelect=toolbar.querySelector('[data-select="entry"]');var exitSelect=toolbar.querySelector('[data-select="exit"]');var timeSelects=toolbar.querySelectorAll('[data-select="start"], [data-select="end"]');var stopOptions=directionStops.map(function(stop){return {value:stop.stop_id,label:stop.stop_name};});[entrySelect,exitSelect].forEach(function(select){if(!select)return;var value=select.value;select.innerHTML="";var placeholder=document.createElement("option");placeholder.value="";placeholder.textContent=select.dataset.select==="entry"?i18n("selectOriginBusStop",null,"Select origin bus stop"):i18n("selectExitBusStop",null,"Select exit bus stop");select.appendChild(placeholder);stopOptions.forEach(function(stop){var option=document.createElement("option");option.value=stop.value;option.textContent=stop.label;select.appendChild(option);});if(value&&stopOptions.some(function(stop){return stop.value===value;}))select.value=value;else{select.value="";if(select.dataset.select==="entry")state.filters.entryStop="";else state.filters.exitStop="";}});var firstStop=directionStops[0];var availableTimes=unique((firstStop?firstStop.times:[]).map(function(time){return time.departure_time||time.arrival_time;})).filter(Boolean).sort(function(a,b){return timeToMinutes(a)-timeToMinutes(b);});timeSelects.forEach(function(select){var saved=select.value;select.innerHTML="";var baseLabel=select.dataset.select==="start"?i18n("startTime",null,"Start Time"):i18n("endTime",null,"End Time");var baseOption=document.createElement("option");baseOption.value="";baseOption.textContent=baseLabel;select.appendChild(baseOption);availableTimes.forEach(function(time){var option=document.createElement("option");option.value=time;option.textContent=formatTimeDisplay(time);select.appendChild(option);});select.value=availableTimes.includes(saved)?saved:"";});}else if(target.dataset.select==="entry")state.filters.entryStop=target.value;else if(target.dataset.select==="exit")state.filters.exitStop=target.value;else if(target.dataset.select==="start")state.filters.startMinutes=target.value?timeToMinutes(target.value):null;else{if(target.dataset.select==="end")state.filters.endMinutes=target.value?timeToMinutes(target.value):null;}refreshDetailView(detailWrapper);});toolbar.addEventListener("click",function(event){var target=event.target;if(target.matches('[data-action="toggle-accessible"]')||target.closest('[data-action="toggle-accessible"]')){var control=target.closest('[data-action="toggle-accessible"]');var isActive=control.getAttribute("data-active")==="true";control.setAttribute("data-active",!isActive);control.textContent=!isActive?i18n("switchToTableView",null,"Switch to Table View"):i18n("switchToAccessibleListView",null,"Switch to Accessible List View");setAccessibleMode(detailWrapper,!isActive);}});}function applySearchAndFilter(routes,searchTerm,category,routeIdsFilter,serviceAreaRouteIdsFilter){var term=(searchTerm||"").toLowerCase();var idsFilterSet=null;var serviceAreaIdsFilterSet=null;if(Array.isArray(routeIdsFilter)&&routeIdsFilter.length)idsFilterSet=new Set(routeIdsFilter.filter(function(id){return typeof id==="string"&&id.length;}).map(function(id){return id.toLowerCase();}));if(Array.isArray(serviceAreaRouteIdsFilter)&&serviceAreaRouteIdsFilter.length)serviceAreaIdsFilterSet=new Set(serviceAreaRouteIdsFilter.filter(function(id){return typeof id==="string"&&id.length;}).map(function(id){return id.toLowerCase();}));function getRouteNumberParts(route){var shortName=String(route.route_short_name||route.route_id||"");var match=shortName.trim().match(/^(\d+)(.*)$/);if(!match)return {num:Number.MAX_SAFE_INTEGER,suffix:shortName.toLowerCase()};return {num:parseInt(match[1],10),suffix:String(match[2]||"").toLowerCase()};}function compareRoutesByNumber(a,b){var pa=getRouteNumberParts(a);var pb=getRouteNumberParts(b);if(pa.num!==pb.num)return pa.num-pb.num;var suffixCmp=pa.suffix.localeCompare(pb.suffix);if(suffixCmp!==0)return suffixCmp;return String(a.route_short_name||a.route_id||"").localeCompare(String(b.route_short_name||b.route_id||""));}var filtered=routes.filter(function(route){var shortName=String(route.route_short_name||"");var routeId=String(route.route_id||"");if(idsFilterSet){if(!idsFilterSet.has(shortName.toLowerCase())&&!idsFilterSet.has(routeId.toLowerCase()))return false;}else{var categories=Array.isArray(route.categories)?route.categories:[];var matchesCategory=category==="all"||categories.indexOf(category)!==-1;if(!matchesCategory)return false;}if(serviceAreaIdsFilterSet)if(!serviceAreaIdsFilterSet.has(shortName.toLowerCase())&&!serviceAreaIdsFilterSet.has(routeId.toLowerCase()))return false;if(!term)return true;var haystack=shortName.toLowerCase()+" "+String(route.route_long_name||"").toLowerCase();return haystack.indexOf(term)!==-1;});filtered.sort(compareRoutesByNumber);return filtered;}function updateRouteHash(route){if(!route||!route.slug)return;window.history.replaceState(null,"",window.location.pathname+"#"+route.slug);}function findRouteBySlug(routes,slug){if(!slug)return null;slug=slug.replace(/^#/,"");for(var i=0;i<routes.length;i+=1)if(routes[i].slug===slug)return routes[i];return null;}function initApp(root){var settingsAttr=root.getAttribute("data-ct-gtfs-settings");var settings=safeJsonParse(settingsAttr)||{};if(!settings.endpoints){console.error("CT GTFS settings missing endpoints.");return;}if(root.__ctGtfsInitialized)return;root.__ctGtfsInitialized=true;var state={routes:[],filteredRoutes:[],activeCategory:"all",activeServiceArea:"all",activeSearch:"",routeDetails:{},loading:false};var directory=root.querySelector("[data-ct-gtfs-directory]");var searchInput=root.querySelector("#ct-gtfs-search-input");var searchDropdown=root.querySelector("#ct-gtfs-search-dropdown");var searchButton=root.querySelector('[data-ct-gtfs-action="search"]');var categoryButtons=root.querySelectorAll(".ct-gtfs-pill");var serviceAreaSelect=root.querySelector("[data-ct-service-area-filter]");var dropdownActiveIndex=-1;var ctRouteTypes=typeof window!=="undefined"&&window.ctRouteTypes?window.ctRouteTypes:{};var serviceAreaRouteIdsByLabel={};var expressIds=new Set();var ctfastrakIds=new Set();var localIds=new Set();var shuttleIds=new Set();var airportIds=new Set();var serviceAreaLabels=["Bristol","Hartford","Meriden","New Britain","New Haven","Stamford","Wallingford","Waterbury"];
209serviceAreaLabels.forEach(function(areaLabel){var area=ctRouteTypes[areaLabel];if(!area||!Array.isArray(area.routes))return;serviceAreaRouteIdsByLabel[areaLabel]=area.routes.map(function(route){return route&&typeof route.id==="string"?route.id.trim():"";}).filter(Boolean);});function addCtRouteTypeIds(groupKey,targetSet){if(!ctRouteTypes||!ctRouteTypes[groupKey]||!Array.isArray(ctRouteTypes[groupKey].routes))return;ctRouteTypes[groupKey].routes.forEach(function(route){if(route&&typeof route.id==="string"&&route.id.length)targetSet.add(String(route.id).toLowerCase());});}addCtRouteTypeIds("Express",expressIds);addCtRouteTypeIds("CTfastrak",ctfastrakIds);addCtRouteTypeIds("Local",localIds);addCtRouteTypeIds("Shuttle",shuttleIds);addCtRouteTypeIds("Airport",airportIds);function getDetailUrl(route){return ("/schedules/"+encodeURIComponent(route.route_short_name||route.route_id));}function renderSearchDropdown(){if(!searchDropdown||!searchInput)return;var routes=state.filteredRoutes;var term=(state.activeSearch||"").trim();var showDropdown=searchInput===document.activeElement&&routes.length>0&&routes.length<=20;searchDropdown.innerHTML="";searchDropdown.setAttribute("hidden","hidden");searchInput.setAttribute("aria-expanded","false");searchInput.removeAttribute("aria-activedescendant");dropdownActiveIndex=-1;if(!showDropdown)return;routes.forEach(function(route,index){var li=document.createElement("li");li.className="ct-gtfs-search-dropdown-item";li.id="ct-gtfs-search-dropdown-item-"+index;li.setAttribute("role","option");li.setAttribute("data-route-index",String(index));li.innerHTML='<span class="ct-gtfs-search-dropdown-route">'+Drupal.checkPlain(route.route_short_name||route.route_id)+"</span> "+'<span class="ct-gtfs-search-dropdown-name">'+Drupal.checkPlain(route.route_long_name||"")+"</span>";li.addEventListener("click",function(e){e.preventDefault();selectDropdownRoute(routes[index]);});searchDropdown.appendChild(li);});searchDropdown.removeAttribute("hidden");searchInput.setAttribute("aria-expanded","true");}function selectDropdownRoute(route){if(!route)return;window.location.href=getDetailUrl(route);}function highlightDropdownItem(index){var items=searchDropdown?searchDropdown.querySelectorAll(".ct-gtfs-search-dropdown-item"):[];items.forEach(function(item,i){item.classList.toggle("is-active",i===index);});dropdownActiveIndex=index;if(index>=0&&items[index]){searchInput.setAttribute("aria-activedescendant",items[index].id);items[index].scrollIntoView({block:"nearest"});}else searchInput.removeAttribute("aria-activedescendant");}function handleDropdownKeydown(e){if(!searchDropdown||!searchInput)return;var items=searchDropdown.querySelectorAll(".ct-gtfs-search-dropdown-item");if(!items.length)return;if(e.key==="ArrowDown"){e.preventDefault();var next=Math.min(dropdownActiveIndex+1,items.length-1);highlightDropdownItem(next);return;}if(e.key==="ArrowUp"){e.preventDefault();var prev=dropdownActiveIndex<=0?-1:dropdownActiveIndex-1;highlightDropdownItem(prev);return;}if(e.key==="Enter"&&dropdownActiveIndex>=0&&items[dropdownActiveIndex]){e.preventDefault();var route=state.filteredRoutes[dropdownActiveIndex];if(route)selectDropdownRoute(route);return;}if(e.key==="Escape"){e.preventDefault();searchInput.blur();searchDropdown.setAttribute("hidden","hidden");searchInput.setAttribute("aria-expanded","false");searchInput.removeAttribute("aria-activedescendant");dropdownActiveIndex=-1;}}function renderDirectory(){if(!directory)return;directory.innerHTML="";if(!state.filteredRoutes.length){directory.innerHTML='<div class="ct-gtfs-empty-state">'+"<span aria-hidden='true'>ð</span>"+i18n("emptyRoutes",null,"No routes match your filters.")+"</div>";return;}state.filteredRoutes.forEach(function(route){directory.appendChild(createRouteCard(route));});attachApiTranslate(directory);}var i18nCatalog=document.getElementById("ct-i18n-schedules-gtfs");if(i18nCatalog&&window.MutationObserver&&!root.__ctGtfsI18nObserver){var i18nRefreshTimer=null;root.__ctGtfsI18nObserver=new MutationObserver(function(){window.clearTimeout(i18nRefreshTimer);i18nRefreshTimer=window.setTimeout(function(){if(state.loading)return;renderDirectory();},150);});root.__ctGtfsI18nObserver.observe(i18nCatalog,{subtree:true,childList:true,characterData:true});}function handleFilterChange(){var activeButton=null;var routeIdsFilter=null;var serviceAreaRouteIdsFilter=null;if(categoryButtons&&categoryButtons.length)categoryButtons.forEach(function(btn
209){if(btn.getAttribute("data-active")==="true")activeButton=btn;});if(activeButton&&activeButton.hasAttribute("data-routes"))routeIdsFilter=activeButton.getAttribute("data-routes").split(",").map(function(id){return id.trim();}).filter(Boolean);if(state.activeServiceArea&&state.activeServiceArea!=="all"&&Array.isArray(serviceAreaRouteIdsByLabel[state.activeServiceArea]))serviceAreaRouteIdsFilter=serviceAreaRouteIdsByLabel[state.activeServiceArea];state.filteredRoutes=applySearchAndFilter(state.routes,state.activeSearch,state.activeCategory,routeIdsFilter,serviceAreaRouteIdsFilter);renderDirectory();renderSearchDropdown();}function attachCardEvents(){}if(searchInput){searchInput.addEventListener("input",Drupal.debounce(function(){state.activeSearch=searchInput.value||"";handleFilterChange();},250));searchInput.addEventListener("focus",function(){handleFilterChange();});searchInput.addEventListener("blur",function(){setTimeout(function(){if(searchDropdown&&!searchDropdown.contains(document.activeElement)&&document.activeElement!==searchInput){searchDropdown.setAttribute("hidden","hidden");searchInput.setAttribute("aria-expanded","false");searchInput.removeAttribute("aria-activedescendant");dropdownActiveIndex=-1;}},150);});searchInput.addEventListener("keydown",handleDropdownKeydown);}if(searchDropdown)searchDropdown.addEventListener("mousedown",function(e){e.preventDefault();});root.addEventListener("click",function(e){var wrapper=root.querySelector(".ct-gtfs-search-dropdown-wrapper");if(searchDropdown&&searchInput&&wrapper&&!wrapper.contains(e.target)){searchDropdown.setAttribute("hidden","hidden");searchInput.setAttribute("aria-expanded","false");searchInput.removeAttribute("aria-activedescendant");dropdownActiveIndex=-1;}});if(searchButton)searchButton.addEventListener("click",function(){state.activeSearch=searchInput?searchInput.value||"":"";handleFilterChange();});if(categoryButtons.length)categoryButtons.forEach(function(button){button.addEventListener("click",function(){categoryButtons.forEach(function(btn){btn.setAttribute("data-active","false");});button.setAttribute("data-active","true");state.activeCategory=button.getAttribute("data-category");handleFilterChange();});});if(serviceAreaSelect)serviceAreaSelect.addEventListener("change",function(){state.activeServiceArea=serviceAreaSelect.value||"all";handleFilterChange();});attachCardEvents();state.loading=true;directory.innerHTML='<div class="ct-gtfs-loading"><span aria-hidden="true">â³</span>'+i18n("loadingSchedules",null,"Loading the latest CTtransit schedulesâ¦")+"</div>";fetchRoutesIndexRaw().then(function(json){var routesArray=Array.isArray(json)?json:json.routes||json.data||json.items||json.landing||[];var normalizedRoutes=filterDirectoryRoutes((Array.isArray(routesArray)?routesArray:[]).map(function(item){return {route_id:item&&item.routeId!=null?String(item.routeId):item&&item.code!=null?String(item.code):String(item&&item.id!=null?item.id:""),route_short_name:item&&item.shortName!=null?String(item.shortName):"",route_long_name:item&&item.longName!=null?String(item.longName):"",route_color:item&&item.routeColor!=null?item.routeColor:item.route_color!=null?item.route_color:"",text_color:item&&item.textColor!=null?item.textColor:item.text_color!=null?item.text_color:"",categories:[]};}));state.routes=normalizedRoutes.map(function(route){var categories=[];var routeShortLower=String(route.route_short_name||"").trim().toLowerCase();var routeInternalIdLower=String(route.route_id||"").trim().toLowerCase();var routeIdLower=String(route.route_short_name||route.route_id||"").toLowerCase();function routeMatchesIdSet(idSet){return (idSet.has(routeShortLower)||idSet.has(routeInternalIdLower)||idSet.has(routeIdLower));}if(routeMatchesIdSet(localIds))categories.push("Local");if(routeMatchesIdSet(expressIds))categories.push("Express");if(routeMatchesIdSet(ctfastrakIds))categories.push("CTfastrak");if(routeMatchesIdSet(shuttleIds))categories.push("Shuttle");if(routeMatchesIdSet(airportIds))categories.push("Airport");if(!categories.length)categories.push("Local");route.categories=categories;return route;});state.filteredRoutes=state.routes.slice();state.filteredRoutes.sort(function(a,b){var aShort=String(a.route_short_name||a.route_id||"").trim();var bShort=String(b.route_short_name||b.route_id||"").trim();var aMatch=aShort.match(/^(\d+)(.*)$/);var bMatch=bShort.match(/^(\d+)(.*)$/);var aNum=aMatch?parseInt(aMatch[1],10):Number.MAX_SAFE_INTEGER;var bNum=bMatch?parseInt(bMatch[1],10):Number.MAX_SAFE_INTEGER;if(aNum!==bNum)return aNum-bNum;
209var aSuffix=(aMatch?aMatch[2]:"").toLowerCase();var bSuffix=(bMatch?bMatch[2]:"").toLowerCase();var suffixCmp=aSuffix.localeCompare(bSuffix);if(suffixCmp!==0)return suffixCmp;return aShort.localeCompare(bShort);});renderDirectory();renderSearchDropdown();}).catch(function(){directory.innerHTML='<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>'+i18n("errorLoadSchedules",null,"We were unable to load CTtransit schedules. Please try again shortly.")+"</div>";}).finally(function(){state.loading=false;});}Drupal.behaviors.ctGtfsSchedules={attach:function(context){var containers=once("ct-gtfs-app",".ct-gtfs-app",context);containers.forEach(function(element){initApp(element);});}};})(Drupal,jQuery,window);; 210(function(Drupal){"use strict";function generateAbsoluteButtonText(context){const primaryButtons=context.querySelectorAll(".ct-btn");primaryButtons.forEach(function(button){const textWrap=button.querySelector(".ct-button-text-wrap");if(!textWrap)return;const originalText=textWrap.querySelector(".ct-button-text:not(.absolute)");if(!originalText)return;const existingAbsolute=textWrap.querySelector(".ct-button-text.absolute");if(existingAbsolute)return;const textContent=originalText.textContent.trim();const absoluteText=document.createElement("div");absoluteText.className="ct-button-text absolute";absoluteText.textContent=textContent;textWrap.appendChild(absoluteText);});}if(typeof Drupal!=="undefined"&&Drupal.behaviors)Drupal.behaviors.cttransitButtonText={attach:function(context,settings){generateAbsoluteButtonText(context);}};else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){generateAbsoluteButtonText(document);});else generateAbsoluteButtonText(document);function setHeroPaddingTop(){const heroSections=document.querySelectorAll(".ct-hero-v2, .ct-hero-v3");if(!heroSections.length)return;if(window.innerWidth<992){const headerElement=document.querySelector("header");if(!headerElement)return;const headerHeight=headerElement.offsetHeight;var correcterHeaderHeight=64;heroSections.forEach(function(heroSection){if(heroSection)heroSection.style.paddingTop=`${correcterHeaderHeight}px`;});}else heroSections.forEach(function(heroSection){if(heroSection)heroSection.style.paddingTop="80px";});}window.addEventListener("resize",setHeroPaddingTop);setHeroPaddingTop();function styleTransitInLineInner(context){const root=context||document;root.querySelectorAll(".line-inner").forEach(function(el){if(el.dataset.cttransitItalicDone==="true")return;el.dataset.cttransitItalicDone="true";el.innerHTML=el.innerHTML.replace(/\bCTtransit\b/g,'CT<em class="italic-word">transit</em>');});}if(typeof Drupal!=="undefined"&&Drupal.behaviors)Drupal.behaviors.cttransitItalicTransit={attach:function(context,settings){setTimeout(function(){styleTransitInLineInner(context);},0);setTimeout(function(){styleTransitInLineInner(context);},200);}};else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){setTimeout(styleTransitInLineInner,0);});else setTimeout(function(){styleTransitInLineInner(document);},0);})(typeof window.Drupal!=="undefined"?window.Drupal:{});; 211(function(Drupal){'use strict';let lastScrollY=window.scrollY||window.pageYOffset||0;let isScrollingUp=false;let scrollDirectionListenerAdded=false;let revealScrollListenerAdded=false;let revealResizeListenerAdded=false;function updateScrollDirection(){const currentScrollY=window.scrollY||window.pageYOffset||0;if(currentScrollY!==lastScrollY){isScrollingUp=currentScrollY<lastScrollY;lastScrollY=currentScrollY;}}function splitTextIntoLines(element){if(element.querySelector('a, button, input, select, textarea, label')){const lineSpan=document.createElement('span');lineSpan.className='line';const lineInner=document.createElement('span');lineInner.className='line-inner';const delayValue=parseFloat(element.getAttribute('data-delay'))||0;lineInner.style.transitionDelay=delayValue+'s';while(element.firstChild)lineInner.appendChild(element.firstChild);lineSpan.appendChild(lineInner);element.appendChild(lineSpan);return true;}const text=element.textContent.trim();const words=text.split(/\s+/);element.innerHTML='';const wordSpans=[];words.forEach((word,index)=>{const wordSpan=document.createElement('span');wordSpan.style.display='inline';wordSpan.textContent=word+(index<words.length-1?' ':'');
211element.appendChild(wordSpan);wordSpans.push(wordSpan);});element.offsetHeight;const lines=[];let currentLine=[];let lastTop=null;wordSpans.forEach((span,index)=>{const rect=span.getBoundingClientRect();const top=Math.round(rect.top);if(lastTop===null||Math.abs(top-lastTop)<5)currentLine.push({span,word:words[index]});else{if(currentLine.length>0)lines.push(currentLine);currentLine=[{span,word:words[index]}];}lastTop=top;});if(currentLine.length>0)lines.push(currentLine);element.innerHTML='';lines.forEach((line,lineIndex)=>{const lineSpan=document.createElement('span');lineSpan.className='line';const lineInner=document.createElement('span');lineInner.className='line-inner';const delayValue=parseFloat(element.getAttribute('data-delay'))||0;lineInner.style.transitionDelay=(lineIndex*0.1+delayValue)+'s';const lineText=line.map((item)=>item.word).join(' ');lineInner.textContent=lineText+(lineIndex<lines.length-1?' ':'');lineSpan.appendChild(lineInner);element.appendChild(lineSpan);});return true;}function initLineAnimations(context){const elements=context.querySelectorAll('[js-line-animation] h1:not([data-line-animation-processed]), [js-line-animation] p:not([data-line-animation-processed]), [js-line-animation] > h2:not([data-line-animation-processed]), [js-line-animation] h3:not([data-line-animation-processed]), [js-line-animation] h1:not([data-line-animation-processed]), [js-line-animation] h5:not([data-line-animation-processed])');if(elements.length===0)return;if(!scrollDirectionListenerAdded){window.addEventListener('scroll',updateScrollDirection,{passive:true,capture:false});scrollDirectionListenerAdded=true;}elements.forEach((element)=>{element.dataset.lineAnimationProcessed='true';const originalHTML=element.innerHTML;splitTextIntoLines(element);function checkAndAnimateElement(){updateScrollDirection();const rect=element.getBoundingClientRect();const viewportHeight=window.innerHeight;const isInViewport=rect.top<viewportHeight&&rect.bottom>0;const isBelowViewport=rect.top>viewportHeight;if(isInViewport){if(!isScrollingUp)element.classList.add('animated');}else{if(isBelowViewport)element.classList.remove('animated');}}checkAndAnimateElement();window.addEventListener('scroll',checkAndAnimateElement,{passive:true});if('IntersectionObserver' in window){const observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){checkAndAnimateElement();});},{threshold:0.1,rootMargin:'0px 0px -25% 0px'});observer.observe(element);}let resizeTimeout;let lastWidth=element.offsetWidth;function handleResize(){clearTimeout(resizeTimeout);resizeTimeout=setTimeout(function(){if(element.offsetWidth!==lastWidth){lastWidth=element.offsetWidth;element.classList.remove('animated');element.innerHTML=originalHTML;element.removeAttribute('data-line-animation-processed');setTimeout(function(){initLineAnimations(document);},100);}},250);}window.addEventListener('resize',handleResize);});}function initTypewriterAnimation(context){const heroGoldElement=context.querySelector('h1 .ct-hero-title-gold');if(!heroGoldElement)return;heroGoldElement.style.display='block';const heroGoldElements=context.querySelectorAll('h1 .ct-hero-title-gold');const heroGoldWords=[];heroGoldElements.forEach(function(el){el.textContent.split(/\s+/).forEach(function(word){if(word.trim()!=='')heroGoldWords.push({word:word.trim()});});});const dataText=heroGoldWords.map(function(obj){return obj.word;});if(dataText.length===0)return;function typeWriter(text,i,fnCallback){const targetElement=context.querySelector('h1 .ct-hero-title-gold');if(!targetElement)return;if(i<text.length){targetElement.innerHTML=text.substring(0,i+1)+'<span aria-hidden="true"></span>';setTimeout(function(){typeWriter(text,i+1,fnCallback);},150);}else{if(typeof fnCallback==='function')setTimeout(fnCallback,700);}}function startTextAnimation(i){if(typeof dataText[i]==='undefined'){setTimeout(function(){startTextAnimation(0);},5000);return;}if(dataText[i])typeWriter(dataText[i],0,function(){startTextAnimation(i+1);});}startTextAnimation(0);}function initRevealAnimations(context){const reveals=context.querySelectorAll('.reveal:not([data-reveal-processed])');if(reveals.length===0)return;
211reveals.forEach((el)=>{el.dataset.revealProcessed='true';});function checkReveal(){const windowHeight=window.innerHeight;const allReveals=document.querySelectorAll('.reveal');const groupedByTop={};allReveals.forEach((el)=>{const rect=el.getBoundingClientRect();const top=Math.round(rect.top);if(rect.top<windowHeight&&rect.bottom>0){if(!groupedByTop[top])groupedByTop[top]=[];groupedByTop[top].push(el);}else{if(rect.top>=windowHeight)el.classList.remove("revealed");}});Object.entries(groupedByTop).sort((a,b)=>a[0]-b[0]).forEach(([_,group],index)=>{setTimeout(()=>{group.forEach((el)=>el.classList.add("revealed"));},index*100);});}if(!revealScrollListenerAdded){window.addEventListener("scroll",checkReveal,{passive:true});revealScrollListenerAdded=true;}if(!revealResizeListenerAdded){window.addEventListener("resize",checkReveal,{passive:true});revealResizeListenerAdded=true;}checkReveal();}if(typeof Drupal!=='undefined'&&Drupal.behaviors)Drupal.behaviors.cttransitTextAnimation={attach:function(context,settings){setTimeout(function(){initLineAnimations(context);},100);initRevealAnimations(context);initTypewriterAnimation(context);}};else{function initialize(){setTimeout(function(){initLineAnimations(document);initRevealAnimations(document);initTypewriterAnimation(document);},100);}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',initialize);else initialize();}})(typeof window.Drupal!=='undefined'?window.Drupal:{});; 212(function(Drupal){'use strict';function Util(){}Util.hasClass=function(el,className){if(el.classList)return el.classList.contains(className);else return !!el.className.match(new RegExp("(\\s|^)"+className+"(\\s|$)"));};Util.addClass=function(el,className){var classList=className.split(" ");if(el.classList)el.classList.add(classList[0]);else{if(!Util.hasClass(el,classList[0]))el.className+=" "+classList[0];}if(classList.length>1)Util.addClass(el,classList.slice(1).join(" "));};Util.removeClass=function(el,className){var classList=className.split(" ");if(el.classList)el.classList.remove(classList[0]);else{if(Util.hasClass(el,classList[0])){var reg=new RegExp("(\\s|^)"+classList[0]+"(\\s|$)");el.className=el.className.replace(reg," ");}}if(classList.length>1)Util.removeClass(el,classList.slice(1).join(" "));};Util.toggleClass=function(el,className,bool){if(bool)Util.addClass(el,className);else Util.removeClass(el,className);};Util.setAttributes=function(el,attrs){for(var key in attrs)el.setAttribute(key,attrs[key]);};Util.getChildrenByClassName=function(el,className){var children=el.children,childrenByClass=[];for(var i=0;i<el.children.length;i++)if(Util.hasClass(el.children[i],className))childrenByClass.push(el.children[i]);return childrenByClass;};Util.is=function(elem,selector){if(selector.nodeType)return elem===selector;var qa=typeof selector==="string"?document.querySelectorAll(selector):selector,length=qa.length,returnArr=[];while(length--)if(qa[length]===elem)return true;return false;};Util.setHeight=function(start,to,element,duration,cb){var change=to-start,currentTime=null;var animateHeight=function(timestamp){if(!currentTime)currentTime=timestamp;var progress=timestamp-currentTime;var val=parseInt((progress/duration)*change+start);element.style.height=val+"px";if(progress<duration)window.requestAnimationFrame(animateHeight);else cb();};element.style.height=start+"px";window.requestAnimationFrame(animateHeight);};Util.scrollTo=function(final,duration,cb,scrollEl){var element=scrollEl||window;var start=element.scrollTop||document.documentElement.scrollTop,currentTime=null;if(!scrollEl)start=window.scrollY||document.documentElement.scrollTop;var animateScroll=function(timestamp){if(!currentTime)currentTime=timestamp;var progress=timestamp-currentTime;if(progress>duration)progress=duration;var val=Math.easeInOutQuad(progress,start,final-start,duration);element.scrollTo(0,val);if(progress<duration)window.requestAnimationFrame(animateScroll);else cb&&cb();};window.requestAnimationFrame(animateScroll);};Util.moveFocus=function(element){if(!element)element=document.getElementsByTagName("body")[0];element.focus();if(document.activeElement!==element){element.setAttribute("tabindex","-1");element.focus();}};
212Util.getIndexInArray=function(array,el){return Array.prototype.indexOf.call(array,el);};Util.cssSupports=function(property,value){if("CSS" in window)return CSS.supports(property,value);else{var jsProperty=property.replace(/-([a-z])/g,function(g){return g[1].toUpperCase();});return jsProperty in document.body.style;}};Util.extend=function(){var extended={};var deep=false;var i=0;var length=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){deep=arguments[0];i++;}var merge=function(obj){for(var prop in obj)if(Object.prototype.hasOwnProperty.call(obj,prop))if(deep&&Object.prototype.toString.call(obj[prop])==="[object Object]")extended[prop]=extend(true,extended[prop],obj[prop]);else extended[prop]=obj[prop];};for(;i<length;i++){var obj=arguments[i];merge(obj);}return extended;};Util.osHasReducedMotion=function(){if(!window.matchMedia)return false;var matchMediaObj=window.matchMedia("(prefers-reduced-motion: reduce)");if(matchMediaObj)return matchMediaObj.matches;return false;};if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;if(!Element.prototype.closest)Element.prototype.closest=function(s){var el=this;if(!document.documentElement.contains(el))return null;do{if(el.matches(s))return el;el=el.parentElement||el.parentNode;}while(el!==null&&el.nodeType===1);return null;};if(typeof window.CustomEvent!=="function"){function CustomEvent(event,params){params=params||{bubbles:false,cancelable:false,detail:undefined};var evt=document.createEvent("CustomEvent");evt.initCustomEvent(event,params.bubbles,params.cancelable,params.detail);return evt;}CustomEvent.prototype=window.Event.prototype;window.CustomEvent=CustomEvent;}Math.easeInOutQuad=function(t,b,c,d){t/=d/2;if(t<1)return (c/2)*t*t+b;t--;return (-c/2)*(t*(t-2)-1)+b;};var StackCards=function(element){this.element=element;this.items=this.element.getElementsByClassName("js-stack-cards__item");this.scrollingFn=false;this.scrolling=false;initStackCardsEffect(this);initStackCardsResize(this);};function initStackCardsEffect(element){setStackCards(element);var observer=new IntersectionObserver(stackCardsCallback.bind(element),{threshold:[0,1]});observer.observe(element.element);}function initStackCardsResize(element){element.element.addEventListener("resize-stack-cards",function(){setStackCards(element);animateStackCards.bind(element);});}function stackCardsCallback(entries){if(entries[0].isIntersecting){if(this.scrollingFn)return;stackCardsInitEvent(this);}else{if(!this.scrollingFn)return;window.removeEventListener("scroll",this.scrollingFn);this.scrollingFn=false;}}function stackCardsInitEvent(element){element.scrollingFn=stackCardsScrolling.bind(element);window.addEventListener("scroll",element.scrollingFn);}function stackCardsScrolling(){if(this.scrolling)return;this.scrolling=true;window.requestAnimationFrame(animateStackCards.bind(this));}function setStackCards(element){element.marginY="50px";getIntegerFromProperty(element);element.elementHeight=element.element.offsetHeight;var cardStyle=getComputedStyle(element.items[0]);element.cardTop=Math.floor(parseFloat(cardStyle.getPropertyValue("top")));element.cardHeight=Math.floor(parseFloat(cardStyle.getPropertyValue("height")));element.windowHeight=window.innerHeight;if(isNaN(element.marginY))element.element.style.paddingBottom="0px";else element.element.style.paddingBottom=element.marginY*(element.items.length-1)+"px";for(var i=0;i<element.items.length;i++)if(isNaN(element.marginY))element.items[i].style.transform="none;";else element.items[i].style.transform="translateY("+element.marginY*i+"px)";}function getIntegerFromProperty(element){var node=document.createElement("div");node.setAttribute("style","opacity:0; visbility: hidden;position: absolute; height:"+element.marginY);element.element.appendChild(node);element.marginY=parseInt(getComputedStyle(node).getPropertyValue("height"));element.element.removeChild(node);}function animateStackCards(){if(isNaN(this.marginY)){this.scrolling=false;return;}var top=this.element.getBoundingClientRect().top;if(this.cardTop-top+this.element.windowHeight-this.elementHeight-this.cardHeight+this.marginY+this.marginY*this.items.length>0){this.scrolling=false;return;}for(var i=0;i<this.items.length;i++){var scrolling=this.cardTop-top-i*(this.cardHeight+this.marginY);if(scrolling>0){var scaling=i==this.items.length-1?1:(this.cardHeight-scrolling*0.05)/this.cardHeight;this.items[i].style.transform="translateY("+this.marginY*i+"px) scale("+scaling+")";}else this.items[i].style.transform="translateY("+this.marginY*i+"px)";}this.scrolling=false;};function initStackCards(context){var stackCards=context.querySelectorAll(".js-stack-cards"),intersectionObserverSupported="IntersectionObserver" in window&&"IntersectionObserverEntry" in window&&"intersectionRatio" in window.IntersectionObserverEntry.prototype,reducedMotion=Util.osHasReducedMotion();if(stackCards.length>0&&intersectionObserverSupported&&!reducedMotion){var stackCardsArray=[];for(var i=0;i<stackCards.length;i++){if(stackCards[i].hasAttribute('data-stack-cards-initialized'))continue;stackCards[i].setAttribute('data-stack-cards-initialized','true');stackCardsArray.push(new StackCards(stackCards[i]));}if(stackCardsArray.length>
2120){var resizingId=false,customEvent=new window.CustomEvent("resize-stack-cards");window.addEventListener("resize",function(){clearTimeout(resizingId);resizingId=setTimeout(doneResizing,300);});function doneResizing(){for(var i=0;i<stackCardsArray.length;i++)(function(i){stackCardsArray[i].element.dispatchEvent(customEvent);})(i);}}}}if(typeof Drupal!=='undefined'&&Drupal.behaviors)Drupal.behaviors.cttransitCardStack={attach:function(context,settings){initStackCards(context);}};else if(document.readyState==='loading')document.addEventListener("DOMContentLoaded",function(){initStackCards(document);});else initStackCards(document);})(typeof window.Drupal!=='undefined'?window.Drupal:{});; 213(function(){const DESKTOP_BREAKPOINT=768;const STICKY_CONTAINER_HEIGHT=778;const BUS_ANIMATION_DURATION=10000;const SVG_NS="http://www.w3.org/2000/svg";class HorizontalScrollSection{constructor(section){this.section=section;this.wrapper=section.querySelector(".horizontal-scroll-wrapper");this.content=section.querySelector(".horizontal-scroll-content");this.spacer=section.querySelector(".horizontal-scroll-spacer");this.track=section.querySelector(".horizontal-scroll-track");this.path=section.querySelector(".horizontal-scroll-path");this.bus=section.querySelector(".horizontal-scroll-bus");this.svg=section.querySelector(".horizontal-scroll-svg");this.container=section.querySelector(".container");if(!this.wrapper||!this.content)return;this.scrollDistance=0;this.scrollStart=0;this.scrollEnd=0;this.motionPath=null;this.busAnimation=null;this.isInteractive=false;this.isLargeScreen=false;this.autoSlideDelay=3000;this.autoSlideInterval=null;this.isHovered=false;this.isAnimating=false;this.isUserScrolling=false;this.isAutoScrolling=false;this.isAtTop=false;this.userScrollTimeout=null;this.horizontalScrollOffset=0;this.pinLastItemMagnitude=null;this.pendingLastSlidePin=false;this.init();}init(){this.updateMetrics();let ticking=false;window.addEventListener("scroll",()=>{if(!ticking){requestAnimationFrame(()=>{this.onScroll();this.checkIfAtTop();ticking=false;});ticking=true;}});window.addEventListener("scroll",()=>this.onUserScroll());window.addEventListener("resize",()=>{this.updateMetrics();this.resetTranslate();});this.section.querySelectorAll(".scroll-text-item").forEach((item)=>{item.addEventListener("mouseenter",()=>this.stopAutoSlide());item.addEventListener("mouseleave",()=>{setTimeout(()=>{if(!this.isHovered)this.checkAndStartAutoSlide();},500);});});setTimeout(()=>{this.updateMetrics();this.checkIfAtTop();this.checkAndStartAutoSlide();},500);}updateMetrics(){const vh=window.innerHeight;const wrapperWidth=this.wrapper.clientWidth;const totalWidth=this.content.scrollWidth;this.isLargeScreen=window.innerWidth>=DESKTOP_BREAKPOINT;this.scrollDistance=Math.max(totalWidth-wrapperWidth,0);this.isInteractive=this.isLargeScreen&&this.scrollDistance>0;this.section.style.height="";this.section.classList.toggle("ct-horizontal-scroll--interactive",this.isInteractive);if(this.spacer)this.spacer.style.height=this.isInteractive?`${this.scrollDistance}px`:"0px";if(!this.isInteractive){this.horizontalScrollOffset=0;this.pinLastItemMagnitude=null;this.destroyBusAnimation();this.setTranslate(0,0);return;}const sectionTop=this.section.offsetTop;const containerHeight=this.container?this.container.offsetHeight:STICKY_CONTAINER_HEIGHT;if(this.isLargeScreen)this.scrollStart=sectionTop+containerHeight/2-vh/2;else this.scrollStart=sectionTop;this.scrollEnd=this.scrollStart+this.scrollDistance;this.initBusPath();}buildMotionPathD(){if(!this.path)return null;const subpaths=this.path.getAttribute("d").split(/(?=M)/).map((part)=>part.trim()).filter(Boolean);const centers=[];subpaths.forEach((part)=>{const temp=document.createElementNS(SVG_NS,"path");temp.setAttribute("d",part);const length=temp.getTotalLength();if(length<1)return;let sumX=0;let sumY=0;const samples=4;for(let i=0;i<samples;i+=1){const point=temp.getPointAtLength((i/(samples-1))*length);sumX+=point.x;sumY+=point.y;}centers.push({x:sumX/samples,y:sumY/samples});});centers.sort((a,b)=>a.x-b.x);const filtered=centers.filter((point,index)=>{if(index===0)return true;const previous=centers[index-1];return Math.hypot(point.x-previous.x,point.y-previous.y)>2;});if(filtered.length<2)return null;let pathD=`M ${filtered[0].x.toFixed(2)} ${filtered[0].y.toFixed(2)}`;for(let i=1;i<filtered.length;i+=1)pathD+=` L ${filtered[i].x.toFixed(2)} ${filtered[i].y.toFixed(2)}`;return pathD;}destroyBusAnimation(){if(this.busAnimation){this.busAnimation.pause();this.busAnimation=null;}}initBusPath(){if(typeof anime==="undefined"||!this.path||!this.svg||!this.bus)return;const pathD=this.buildMotionPathD();if(!pathD)return;if(!this.motionPath){this.motionPath=document.createElementNS(SVG_NS,"path");this.motionPath.setAttribute("class","horizontal-scroll-motion-path");this.svg.appendChild(this.motionPath);}this.motionPath.setAttribute("d",pathD);this.destroyBusAnimation();const motionPath=anime.path(this.motionPath);this.busAnimation=anime({targets:this.bus,translateX:motionPath("x"),translateY:motionPath("y"),rotate:motionPath("angle"),easing:"linear",duration:BUS_ANIMATION_DURATION,autoplay:false});}easeOutCubic(value){const t=Math.max(0,Math.min(1,value));return 1-Math.pow(1-t,3);}easeInOutCubic(value){const t=Math.max(0,Math.min(1,value));return t<0.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;}getBusOpacity(progress){if(progress<=0||progress>=1)return 0;const fadeInEnd=0.12;const fadeOutStart=0.88;if(progress<fadeInEnd)return this.easeOutCubic(progress/fadeInEnd);if(progress>fadeOutStart)return this.easeOutCubic((1-progress)/(1-fadeOutStart));return 1;}
213updateBus(progress){if(!this.bus||!this.busAnimation||!this.isInteractive){if(this.bus)this.bus.style.opacity="0";return;}const opacity=this.getBusOpacity(progress);this.bus.style.opacity=String(opacity);if(opacity<=0)return;const clamped=Math.max(0,Math.min(1,progress));this.busAnimation.seek(clamped*BUS_ANIMATION_DURATION);}getHorizontalProgressFromTranslate(translateX){if(!this.scrollDistance)return 0;return Math.max(0,Math.min(1,Math.abs(translateX)/this.scrollDistance));}checkIfAtTop(){const wasAtTop=this.isAtTop;const scrollY=window.scrollY;this.isAtTop=scrollY>=this.scrollStart&&scrollY<=this.scrollEnd;if(wasAtTop!==this.isAtTop)if(this.isAtTop)this.checkAndStartAutoSlide();else this.stopAutoSlide();}onScroll(){if(this.isAnimating)return;const scrollY=window.scrollY;if(!this.isInteractive){this.horizontalScrollOffset=0;this.pinLastItemMagnitude=null;this.setTranslate(0,0);return;}if(scrollY<=this.scrollStart){this.horizontalScrollOffset=0;this.pinLastItemMagnitude=null;this.setTranslate(0,0);return;}if(scrollY>=this.scrollEnd){if(this.pinLastItemMagnitude!=null){const cap=this.pinLastItemMagnitude;this.setTranslate(-cap,this.getHorizontalProgressFromTranslate(-cap));this.horizontalScrollOffset=this.scrollDistance-cap;}else{this.horizontalScrollOffset=0;this.pinLastItemMagnitude=null;this.setTranslate(-this.scrollDistance,1);}return;}const rawProgress=(scrollY-this.scrollStart)/(this.scrollEnd-this.scrollStart);const progress=this.easeInOutCubic(rawProgress);const base=-this.scrollDistance*progress;const raw=base+this.horizontalScrollOffset;let total=raw;if(this.pinLastItemMagnitude!=null){const cap=this.pinLastItemMagnitude;total=Math.max(raw,-cap);if(total>-cap+3)this.pinLastItemMagnitude=null;this.horizontalScrollOffset=total-base;}this.setTranslate(total,progress);}onUserScroll(){if(this.isAutoScrolling)return;this.isUserScrolling=true;this.stopAutoSlide();this.pendingLastSlidePin=false;const current=Math.abs(this.getTranslateX());const maxAutoSlide=this.getAutoSlideMaxMagnitude();if(current>=maxAutoSlide-1)this.pinLastItemMagnitude=maxAutoSlide;requestAnimationFrame(()=>this.onScroll());clearTimeout(this.userScrollTimeout);this.userScrollTimeout=setTimeout(()=>{this.isUserScrolling=false;this.checkAndStartAutoSlide();},800);}checkAndStartAutoSlide(){if(!this.isInteractive||!this.isAtTop||this.isHovered||this.isAnimating||this.scrollDistance<=0)return;const current=Math.abs(this.getTranslateX());const maxAutoSlide=this.getAutoSlideMaxMagnitude();if(current>=maxAutoSlide-5)return;this.startAutoSlide();}startAutoSlide(){if(this.autoSlideInterval)return;this.autoSlideInterval=setInterval(()=>{if(!this.isInteractive||!this.isAtTop||this.isHovered||this.isAnimating)return;const current=Math.abs(this.getTranslateX());const maxAutoSlide=this.getAutoSlideMaxMagnitude();if(current>=maxAutoSlide-5){this.stopAutoSlide();return;}this.slideToNext();},this.autoSlideDelay);}stopAutoSlide(){clearInterval(this.autoSlideInterval);this.autoSlideInterval=null;}getItemOffsets(){const items=this.content.querySelectorAll(".scroll-text-item");if(!items.length)return [];return Array.from(items).map((item)=>{let left=0;let el=item;while(el&&el!==this.content){left+=el.offsetLeft;el=el.offsetParent;}return left;});}getLastItemOffset(){const offsets=this.getItemOffsets();return offsets.length?offsets[offsets.length-1]:null;}getAutoSlideMaxMagnitude(){const last=this.getLastItemOffset();if(last==null)return this.scrollDistance;return Math.min(last,this.scrollDistance);}setPinIfAtLastItemSnap(targetTranslateX){const last=this.getLastItemOffset();if(last==null){this.pinLastItemMagnitude=null;return;}const aligned=Math.abs(targetTranslateX+last)<12;if(aligned)this.pinLastItemMagnitude=Math.abs(targetTranslateX);else this.pinLastItemMagnitude=null;}slideToNext(){if(this.isAnimating||!this.isAtTop)return;const offsets=this.getItemOffsets();const current=Math.abs(this.getTranslateX());const snapEps=0.5;let next;if(offsets.length){next=offsets.find((off)=>off>current+snapEps);if(next===undefined){const mag=Math.abs(this.getTranslateX());if(mag>0)this.pinLastItemMagnitude=mag;this.stopAutoSlide();return;}}else{next=Math.min(current+this.wrapper.clientWidth,this.scrollDistance);if(next>=this.scrollDistance-snapEps)this.stopAutoSlide();}next=Math.min(next,this.getAutoSlideMaxMagnitude());const lastOff=offsets.length?offsets[offsets.length-1]:null;this.pendingLastSlidePin=lastOff!=null&&Math.abs(next-lastOff)<1;this.animateTo(-next);}slideToPrev(){if(this.isAnimating||!this.isAtTop)return;const offsets=this.getItemOffsets();const current=Math.abs(this.getTranslateX());const snapEps=0.5;let prev=0;if(offsets.length){for(let i=offsets.length-1;i>=0;i--)if(offsets[i]<current-snapEps){prev=offsets[i];break;}}else prev=Math.max(current-this.wrapper.clientWidth,0);this.animateTo(-prev);}animateTo(target){if(this.isAnimating)return;this.isAnimating=true;this.isAutoScrolling=true;const start=this.getTranslateX();const duration=600;const startTime=performance.now();const animate=(time)=>{const progress=Math.min((time-startTime)/duration,1);const ease=1-Math.pow(1-progress,3);const value=start+(target-start)*ease;const animProgress=this.getHorizontalProgressFromTranslate(value);this.setTranslate(value,animProgress);if(progress<1)requestAnimationFrame(animate);else{const animProgress=this.getHorizontalProgressFromTranslate(target);this.setTranslate(target,animProgress);this.finishAutoSlideAnimation(target);}};requestAnimationFrame(animate);}finishAutoSlideAnimation(targetTranslateX){const scrollY=window.scrollY;let base=0;if(scrollY>this.scrollStart&&scrollY<this.scrollEnd){const progress=(scrollY-this.scrollStart)/(this.scrollEnd-this.scrollStart);base=-this.scrollDistance*progress;}else{if(scrollY>=this.scrollEnd)base=-this.scrollDistance;}this.horizontalScrollOffset=targetTranslateX-base;const fromLastSlide=this.pendingLastSlidePin;this.pendingLastSlidePin=false;if(fromLastSlide)this.pinLastItemMagnitude=Math.abs(targetTranslateX);else this.setPinIfAtLastItemSnap(targetTranslateX);this.isAnimating=false;setTimeout(()=>{this.isAutoScrolling=false;},80);requestAnimationFrame(()=>this.onScroll());}setTranslate(x,busProgress){this.content.style.transform=`translate3d(${x}px, 0, 0)`;if(this.isInteractive){const progress=typeof busProgress==="number"?busProgress:this.getHorizontalProgressFromTranslate(x);
213this.updateBus(progress);}}getTranslateX(){const style=getComputedStyle(this.content).transform;if(!style||style==="none")return 0;if(style.startsWith("matrix3d")){const values=style.match(/matrix3d\((.+)\)/)[1].split(", ");return parseFloat(values[12]);}const values=style.match(/matrix\((.+)\)/)[1].split(", ");return values.length===6?parseFloat(values[4]):parseFloat(values[12]);}resetTranslate(){this.horizontalScrollOffset=0;this.pinLastItemMagnitude=null;this.setTranslate(0,0);this.checkAndStartAutoSlide();}}document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".ct-horizontal-scroll").forEach((section)=>new HorizontalScrollSection(section));});})();; 214(function(Drupal){"use strict";function initExpandableSearch(context){context=context||document;const searchBlockForms=context.querySelectorAll(".search-block-form");if(!searchBlockForms.length)return;searchBlockForms.forEach(function(searchBlockForm){const form=searchBlockForm.tagName==="FORM"?searchBlockForm:searchBlockForm.querySelector("form");const submitButtons=(form||searchBlockForm).querySelectorAll(".form-submit, [data-drupal-selector='edit-submit']");const searchInput=(form||searchBlockForm).querySelector(".form-search")||(form||searchBlockForm).querySelector("[name='search_api_fulltext'], [name='keys']")||(form||searchBlockForm).querySelector("[id^='edit-keys']");if(!form||!submitButtons.length)return;if(searchBlockForm.hasAttribute("data-search-attached"))return;searchBlockForm.setAttribute("data-search-attached","true");if(searchInput){searchInput.setAttribute("tabindex","-1");const searchLabelText=typeof Drupal!=="undefined"&&Drupal.t?Drupal.t("Search"):"Search";if(!searchInput.getAttribute("aria-label"))searchInput.setAttribute("aria-label",searchLabelText);searchInput.removeAttribute("title");const wrapper=searchInput.closest(".js-form-item-keys, .form-item, .form-type-search")||searchBlockForm;let label=wrapper?wrapper.querySelector(`label[for="${searchInput.id}"]`)||wrapper.querySelector("label"):null;if(!label&&wrapper){label=document.createElement("label");label.className="control-label visually-hidden";label.textContent=searchLabelText;label.setAttribute("for",searchInput.id||"edit-keys");searchInput.insertAdjacentElement("beforebegin",label);}else{if(label&&searchInput.id)label.setAttribute("for",searchInput.id);}}let isExpanded=false;function updateAria(){submitButtons.forEach(function(button){button.setAttribute("aria-expanded",isExpanded.toString());button.setAttribute("aria-label",isExpanded?"Close search":"Open search");});}function toggleSearch(){isExpanded=!isExpanded;if(isExpanded){searchBlockForm.classList.add("is-expanded");if(searchInput)searchInput.removeAttribute("tabindex");setTimeout(function(){if(searchInput)searchInput.focus();},200);}else{searchBlockForm.classList.remove("is-expanded");if(searchInput){searchInput.value="";searchInput.setAttribute("tabindex","-1");}}updateAria();}function closeSearch(){if(isExpanded){isExpanded=false;searchBlockForm.classList.remove("is-expanded");if(searchInput){searchInput.value="";searchInput.setAttribute("tabindex","-1");}updateAria();}}submitButtons.forEach(function(button){button.addEventListener("click",function(e){var openMegaMenus=document.querySelectorAll(".ct-megamenu.is-open");if(openMegaMenus.length)openMegaMenus.forEach(function(menu){menu.classList.remove("is-open");});if(isExpanded&&searchInput&&searchInput.value.trim()!=="")return;e.preventDefault();toggleSearch();});});form.addEventListener("submit",function(e){if(!searchInput||searchInput.value.trim()===""){e.preventDefault();closeSearch();return;}});document.addEventListener("click",function(e){if(isExpanded&&!searchBlockForm.contains(e.target))closeSearch();});document.addEventListener("keydown",function(e){if(e.key==="Escape"&&isExpanded){e.preventDefault();closeSearch();submitButtons[0].focus();}});updateAria();if(searchInput)searchInput.addEventListener("focus",function(){if(!isExpanded)toggleSearch();});});}if(typeof Drupal!=="undefined"&&Drupal.behaviors)Drupal.behaviors.cttransitExpandableSearch={attach:function(context,settings){initExpandableSearch(context);}};else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){initExpandableSearch(document);});else initExpandableSearch(document);})(typeof Drupal!=="undefined"?Drupal:{});; 215(function($,Drupal,once){function isCtBrandItalicExcluded(element){return !!(element&&(element.closest(".ct-subscribe-form")||element.closest("[js-line-animation]")||element.closest("form")));}function markCtBrandItalicDone(element){if(element)element.dataset.ctBrandItalicDone="true";}Drupal.behaviors.wrapFastrakInSpan={attach:function(context,settings){once("ctBrand
215ItalicP","p",context).forEach(function(paragraph){if(isCtBrandItalicExcluded(paragraph)||paragraph.dataset.ctBrandItalicDone==="true"||paragraph.querySelector(".italic-word"))return;if(!paragraph.textContent.includes("CTtransit"))return;paragraph.innerHTML=paragraph.innerHTML.replace(/(CTtransit)/gi,"CT<span class='italic-word'>transit</span>");markCtBrandItalicDone(paragraph);});once("ctBrandItalicH1","h1",context).forEach(function(headerOne){if(isCtBrandItalicExcluded(headerOne)||headerOne.dataset.ctBrandItalicDone==="true"||headerOne.querySelector(".fastrak-span"))return;if(!headerOne.textContent.includes("CTfastrak"))return;headerOne.innerHTML=headerOne.innerHTML.replace(/(CTfastrak)/gi,"CT<span class='fastrak-span'>fastrak</span>");markCtBrandItalicDone(headerOne);});once("ctBrandItalicH2","h2",context).forEach(function(headerTwo){if(isCtBrandItalicExcluded(headerTwo)||headerTwo.dataset.ctBrandItalicDone==="true"||headerTwo.querySelector(".fastrak-span"))return;if(!headerTwo.textContent.includes("CTfastrak"))return;headerTwo.innerHTML=headerTwo.innerHTML.replace(/(CTfastrak)/gi,"CT<span class='fastrak-span'>fastrak</span>");markCtBrandItalicDone(headerTwo);});once("ctBrandItalicH3","h3",context).forEach(function(headerThree){if(isCtBrandItalicExcluded(headerThree)||headerThree.dataset.ctBrandItalicDone==="true"||headerThree.querySelector(".fastrak-span"))return;if(!headerThree.textContent.includes("CTfastrak"))return;headerThree.innerHTML=headerThree.innerHTML.replace(/(CTfastrak)/gi,"CT<span class='fastrak-span'>fastrak</span>");markCtBrandItalicDone(headerThree);});}};Drupal.behaviors.adjustH2Margin={attach:function(context,settings){var h2Elements=document.querySelectorAll(".ct-service-ways .ct-service-ways-container h2");h2Elements.forEach(function(h2Element){var nextSibling=h2Element.nextElementSibling;if(nextSibling)h2Element.style.marginBottom="16px";else h2Element.style.marginBottom="0";});}};Drupal.behaviors.wrapTransitEverywhere={attach(context){const walker=document.createTreeWalker(context,NodeFilter.SHOW_TEXT,null,false);const textNodes=[];while(walker.nextNode())textNodes.push(walker.currentNode);textNodes.forEach((textNode)=>{const parent=textNode.parentNode;if(!parent||parent.tagName==="I"||parent.closest(".ct-subscribe-form, [js-line-animation], form, .italic-word, .fastrak-s
215pan"))return;const text=textNode.nodeValue;if(text.includes("CTtransit")){const parts=text.split("CTtransit");const fragment=document.createDocumentFragment();parts.forEach((part,index)=>{fragment.appendChild(document.createTextNode(part));if(index<parts.length-1){fragment.appendChild(document.createTextNode("CT"));const italic=document.createElement("i");italic.textContent="transit";fragment.appendChild(italic);}});parent.replaceChild(fragment,textNode);}});}};Drupal.behaviors.wrapFastrakEverywhere={attach(context){const walker=document.createTreeWalker(context,NodeFilter.SHOW_TEXT,null,false);const textNodes=[];while(walker.nextNode())textNodes.push(walker.currentNode);textNodes.forEach((textNode)=>{const parent=textNode.parentNode;if(!parent||parent.tagName==="I"||parent.closest(".ct-subscribe-form, [js-line-animation], form, .italic-word, .fastrak-span"))return;const text=textNode.nodeValue;if(text.includes("CTfastrak")){const parts=text.split("CTfastrak");const fragment=document.createDocumentFragment();parts.forEach((part,index)=>{fragment.appendChild(document.createTextNode(part));if(index<parts.length-1){fragment.appendChild(document.createTextNode("CT"));const italic=document.createElement("i");italic.textContent="fastrak";fragment.appendChild(italic);}});parent.replaceChild(fragment,textNode);}});}};Drupal.behaviors.wrapPassEverywhere={attach(context){const walker=document.createTreeWalker(context,NodeFilter.SHOW_TEXT,null,false);const textNodes=[];while(walker.nextNode())textNodes.push(walker.currentNode);textNodes.forEach((textNode)=>{const parent=textNode.parentNode;if(!parent||parent.tagName==="I"||parent.closest(".ct-subscribe-form, [js-line-animation], form, .italic-word, .fastrak-s
215pan"))return;const text=textNode.nodeValue;if(text.includes("CTpass")){const parts=text.split("CTpass");const fragment=document.createDocumentFragment();parts.forEach((part,index)=>{fragment.appendChild(document.createTextNode(part));if(index<parts.length-1){fragment.appendChild(document.createTextNode("CT"));const italic=document.createElement("i");italic.textContent="pass";fragment.appendChild(italic);}});parent.replaceChild(fragment,textNode);}});}};Drupal.behaviors.ctNavbarInitCollapsed={attach(context){const togglers=context.querySelectorAll(".navbar-toggler");togglers.forEach((toggler)=>{if(!toggler.classList.contains("collapsed"))toggler.classList.add("collapsed");});}};Drupal.behaviors.ctExclusiveHeaderMobileNavs={attach(context){once("ctExclusiveHeaderMobileNavs","header.ct-header",context).forEach((header)=>{const quickToggler=header.querySelector('button.navbar-toggler[data-bs-target="#navbarNav"]');const megaToggler=header.querySelector('button.ct-menu-btn[aria-controls="ct-megamenu"]');if(!quickToggler||!megaToggler)return;if(megaToggler.getAttribute("aria-expanded")!=="true"&&!megaToggler.dataset.ctMenuBtnClosedHtml)megaToggler.dataset.ctMenuBtnClosedHtml=megaToggler.innerHTML;let syncing=false;const getMegamenu=()=>document.getElementById("ct-megamenu");const getQuickNavPanels=()=>Array.from(document.querySelectorAll("#navbarNav.navbar-collapse"));const isMegamenuOpen=()=>{const megamenu=getMegamenu();return !!(megamenu&&megamenu.classList.contains("ct-megamenu")&&megamenu.classList.contains("is-open"));};const isQuickNavOpen=()=>getQuickNavPanels().some((panel)=>panel.classList.contains("show")||panel.classList.contains("collapsing"));const closeMegamenu=()=>{const megamenu=getMegamenu();if(!megamenu||!isMegamenuOpen())return;if(megaToggler.getAttribute("aria-expanded")==="true"&&!syncing){syncing=true;try{megaToggler.click();}finally{syncing=false;}}if(isMegamenuOpen()){megamenu.classList.remove("is-open");megaToggler.setAttribute("aria-expanded","false");const openLabel=Drupal.t("Menu");megaToggler.setAttribute("aria-label",openLabel);megaToggler.setAttribute("data-ct-original-aria-label",openLabel);if(megaToggler.dataset.ctMenuBtnClosedHtml)megaToggler.innerHTML=megaToggler.dataset.ctMenuBtnClosedHtml;document.body.classList.remove("ct-megamenu-open");megamenu.querySelectorAll(".ct-megamenu-mobile-submenu.is-open").forEach((submenu)=>{submenu.classList.remove("is-open");});megamenu.querySelectorAll(".ct-megamenu-item.is-active").forEach((item)=>{item.classList.remove("is-active");});}};const closeQuickNav=()=>{if(!isQuickNavOpen()){quickToggler.classList.add("collapsed");quickToggler.setAttribute("aria-expanded","false");return;}
215let usedBootstrap=false;getQuickNavPanels().forEach((panel)=>{if(!panel.classList.contains("show")&&!panel.classList.contains("collapsing"))return;if(typeof bootstrap!=="undefined"&&bootstrap.Collapse){bootstrap.Collapse.getOrCreateInstance(panel,{toggle:false}).hide();usedBootstrap=true;}else panel.classList.remove("show","collapsing");});if(!usedBootstrap){quickToggler.classList.add("collapsed");quickToggler.setAttribute("aria-expanded","false");}};quickToggler.addEventListener("click",()=>{if(syncing)return;if(isMegamenuOpen())closeMegamenu();},true);megaToggler.addEventListener("click",()=>{if(syncing)return;if(megaToggler.getAttribute("aria-expanded")!=="true")closeQuickNav();},true);getQuickNavPanels().forEach((panel)=>{panel.addEventListener("show.bs.collapse",()=>{if(!syncing&&isMegamenuOpen())closeMegamenu();});});});}};Drupal.behaviors.removeMailtoSvgIcon={attach:function(context,settings){const mailtoLinks=context.querySelectorAll("a.mailto");mailtoLinks.forEach(function(link){const svgIcon=link.querySelector("svg");if(svgIcon)svgIcon.remove();link.innerHTML=link.innerHTML.replace(/</g,"<").replace(/>/g,">");});}};Drupal.behaviors.ctTransitPaymentTabs={attach:function(context){const tabLists=context.querySelectorAll('ul.nav.nav-tabs[role="tablist"]');tabLists.forEach(function(tabList){if(tabList.dataset.ctTransitTabsInitialized==="true")return;tabList.dataset.ctTransitTabsInitialized="true";const tabs=tabList.querySelectorAll('button.nav-link[role="tab"][data-bs-target]');if(!tabs.length)return;const paneClassNames=[];tabs.forEach(function(tab){const target=tab.getAttribute("data-bs-target");if(!target)return;const className=target.replace(/^#/,"");if(className&&paneClassNames.indexOf(className)===-1)paneClassNames.push(className);const panes=document.querySelectorAll("."+className);const controlIds=[];panes.forEach(function(pane,index){if(!pane.id)pane.id=panes.length===1?className:className+"-"+(index+1);controlIds.push(pane.id);if(!pane.getAttribute("role"))pane.setAttribute("role","tabpanel");pane.setAttribute("aria-labelledby",tab.id);});if(controlIds.length)tab.setAttribute("aria-controls",controlIds.join(" "));else tab.removeAttribute("aria-controls");});function updatePanels(activeClassName){paneClassNames.forEach(function(className){const panes=document.querySelectorAll("."+className);panes.forEach(function(pane){if(className===activeClassName)pane.classList.add("active");else pane.classList.remove("active");});});}function setActiveTab(activeTab){tabs.forEach(function(tab){const isActive=tab===activeTab;tab.classList.toggle("active",isActive);tab.setAttribute("aria-selected",isActive?"true":"false");tab.setAttribute("tabindex",isActive?"0":"-1");});const target=activeTab.getAttribute("data-bs-target");if(target){const activeClassName=target.replace(/^#/,"");updatePanels(activeClassName);}}tabs.forEach(function(tab){tab.addEventListener("click",function(event){event.preventDefault();setActiveTab(tab);});});const initialActive=tabList.querySelector('button.nav-link.active[role="tab"][data-bs-target]')||tabs[0];if(initialActive)setActiveTab(initialActive);});}};var CT_TARJETA_TELEFONO_PANE_SELECTOR="section.ct-image-text.tarjeta-o-teléfono-pestaña-panel";var CT_TARJETA_TELEFONO_ORIG_LABELLEDBY="data-ct-tarjeta-telefono-orig-labelledby";function ctVisibleText(el){if(!el)return "";return String(el.textContent||"").replace(/\s+/g," ").trim();}function ctTarjetaTelefonoPaneBaseName(panel){var heading=panel.querySelector(".text-content h1, .text-content h2, .text-content h3, h1, h2, h3, h4, h5, h6");var headingText=ctVisibleText(heading);var tabName="";var labelledby=panel.getAttribute(CT_TARJETA_TELEFONO_ORIG_LABELLEDBY)||panel.getAttribute("aria-labelledby");if(labelledby){var refId=labelledby.trim().split(/\s+/)[0];var tabEl=refId?document.getElementById(refId):null;tabName=ctVisibleText(tabEl);}if(tabName&&headingText&&tabName.toLowerCase()!==headingText.toLowerCase())return tabName+": "+headingText;if(headingText)return headingText;if(tabName)return tabName;if(panel.id)return panel.id.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return "Tarjeta o teléfono";}function ctFixTarjetaTelefonoTabPanelLandmark(panel){if(!panel||panel.nodeType!==1)return;panel.setAttribute("role","tabpanel");var labelledby=panel.getAttribute("aria-labelledby");if(labelledby&&!panel.hasAttribute(CT_TARJETA_TELEFONO_ORIG_LABELLEDBY))panel.setAttribute(CT_TARJETA_TELEFONO_ORIG_LABELLEDBY,labelledby);var all=document.querySelectorAll(CT_TARJETA_TELEFONO_PANE_SELECTOR);var index=Array.prototype.indexOf.call(all,panel);var base=ctTarjetaTelefonoPaneBaseName(panel)||"Tarjeta o teléfono";var uniqueName=base;if(all.length>1&&index>=0)uniqueName=base+" ("+(index+1)+")";panel.removeAttribute("aria-labelledby");panel.setAttribute("aria-label",uniqueName);}Drupal.behaviors.ctTarjetaTelefonoTabPanelLandmarkFix={attach(context){document.querySelectorAll(CT_TARJETA_TELEFONO_PANE_SELECTOR).forEac
215h(ctFixTarjetaTelefonoTabPanelLandmark);if(context&&context!==document&&context.nodeType===1&&context.matches&&context.matches(CT_TARJETA_TELEFONO_PANE_SELECTOR))ctFixTarjetaTelefonoTabPanelLandmark(context);once("ctTarjetaTelefonoTabPanelLandmarkFixObserver","body",context).forEach(function(body){if(!window.MutationObserver)return;var timer=null;var schedule=function(){window.clearTimeout(timer);timer=window.setTimeout(function(){document.querySelectorAll(CT_TARJETA_TELEFONO_PANE_SELECTOR).forEach(ctFixTarjetaTelefonoTabPanelLandmark);},50);};var observer=new MutationObserver(schedule);observer.observe(body,{childList:true,subtree:true,attributes:true,attributeFilter:["aria-labelledby","role","id"]});});}};Drupal.behaviors.ctGtranslateAccessibility={attach:function(context,settings){once("ctGtranslateAccessibilityInit",document.body,context).forEach(function(){var observer=null;var loadFallback=null;var disconnect=function(){if(observer){observer.disconnect();observer=null;}if(loadFallback){window.removeEventListener("load",loadFallback);loadFallback=null;}};var applyGtranslateOptionAbbreviations=function(langSelect){var langSpoken={en:Drupal.t("English"),es:Drupal.t("Spanish"),de:Drupal.t("German"),it:Drupal.t("Italian"),fr:Drupal.t("French")};var langAbbrev={en:"ENG",es:"SPA",de:"DEU",it:"ITA",fr:"FRA"};langSelect.querySelectorAll("option").forEach(function(opt){if(opt.value===""){var hint=opt.textContent.trim();if(hint){opt.setAttribute("aria-label",hint);opt.setAttribute("title",hint);}return;}var parts=opt.value.split("|");var code=parts.length>1?parts[1]:parts[0];if(!code)return;var spoken=langSpoken[code];var abbrev=langAbbrev[code];var priorLabel=opt.textContent.trim();if(spoken&&abbrev){opt.textContent=abbrev;opt.setAttribute("aria-label",spoken);opt.setAttribute("title",spoken);}else{if(priorLabel){opt.textContent=code.toUpperCase().slice(0,3);opt.setAttribute("aria-label",priorLabel);opt.setAttribute("title",priorLabel);}}});};var process=function(){var selectElements=document.querySelectorAll(".gt_selector.notranslate");if(selectElements.length===0)return false;if(selectElements.length>1)selectElements[1].remove();var divElements=document.querySelectorAll('[id="google_translate_element2"]');if(divElements.length>1){var keeper=null;var dupIndex=0;divElements.forEach(function(el){if(!keeper&&(el.querySelector(".goog-te-gadget, .goog-te-combo")||(el.innerHTML&&el.innerHTML.trim().length>0)))keeper=el;});if(!keeper)keeper=divElements[0];keeper.id="google_translate_element2";divElements.forEach(function(el){if(el===keeper)return;if(!el.innerHTML||el.innerHTML.trim().length===0){el.remove();return;}dupIndex+=1;el.id="google_translate_element2-dup-"+dupIndex;});}var langSelect=document.querySelector(".gt_selector.notranslate");if(!langSelect)return false;if(langSelect.getAttribute("data-ct-gtranslate-a11y")==="1"){disconnect();return true;}var wrapper=langSelect.closest(".ct-language-selector");if(wrapper){var labelEl=wrapper.querySelector('[id^="ct-site-lang-label-"]');if(labelEl&&labelEl.id){langSelect.setAttribute("aria-labelledby",labelEl.id);langSelect.removeAttribute("aria-label");}}else langSelect.setAttribute("aria-label",Drupal.t("Choose page translation language"));applyGtranslateOptionAbbreviations(langSelect);var placeholder=langSelect.querySelector('option[value=""]');if(placeholder&&langSelect.value!=="")placeholder.setAttribute("disabled","");langSelect.setAttribute("data-ct-gtranslate-a11y","1");disconnect();return true;};if(process())return;if(window.MutationObserver){var debounceTimer=null;observer=new MutationObserver(function(){window.clearTimeout(debounceTimer);debounceTimer=window.setTimeout(function(){process();},100);});observer.observe(document.body,{childList:true,subtree:true});window.setTimeout(function(){window.clearTimeout(debounceTimer);if(observer){observer.disconnect();observer=null;}},12000);}loadFallback=function(){process();};window.addEventListener("load",loadFallback);});}};Drupal.behaviors.removeSvgIcons={attach:function(context,settings){function removeExternalIcons(root){if(!root||typeof root.querySelectorAll!=="function")return;root.querySelectorAll("a.ext svg.ext").forEach(function(svg){svg.remove();});}removeExternalIcons(context);once("removeSvgIconsObserver","body",context).forEach(function(){if(!window.MutationObserver||!document.body)return;var observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEac
215h(function(node){if(!(node instanceof HTMLElement)&&!(node instanceof DocumentFragment))return;removeExternalIcons(node);});});});observer.observe(document.body,{childList:true,subtree:true});});}};Drupal.behaviors.ctAccordionFirstSectionActive={attach(context){const firstSection=document.querySelector(".ct-accordion-section");if(!firstSection)return;firstSection.classList.add("active","show");}};Drupal.behaviors.ctAccordionItemClickToggle={attach(context){context.querySelectorAll(".ct-accordion-section .accordion-item").forEach((item)=>{if(item.dataset.ctAccordionItemClickInit==="true")return;item.dataset.ctAccordionItemClickInit="true";item.addEventListener("click",(event)=>{const toggleButton=item.querySelector('.accordion-btn[data-bs-toggle="collapse"]');if(!toggleButton)return;if(event.target.closest(".accordion-btn"))return;if(event.target.closest(".accordion-link"))return;if(event.target.closest(".accordion-body"))return;if(event.target.closest("a, button, input, select, textarea"))return;toggleButton.click();});});}};Drupal.behaviors.ctCarouselAriaLiveByVisibility={attach:function(context){once("ctCarouselAriaLiveByVisibility",".ct-app-carousel",context).forEach(function(carousel){const setLiveState=function(isVisible){carousel.setAttribute("aria-live",isVisible?"polite":"off");};const isVisibleInViewport=function(){const rect=carousel.getBoundingClientRect();const viewportHeight=window.innerHeight||document.documentElement.clientHeight;const viewportWidth=window.innerWidth||document.documentElement.clientWidth;return (rect.bottom>0&&rect.right>0&&rect.top<viewportHeight&&rect.left<viewportWidth);};setLiveState(false);if("IntersectionObserver" in window){const observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){setLiveState(entry.isIntersecting&&entry.intersectionRatio>0);});},{threshold:[0,0.1]});observer.observe(carousel);}else{const updateLiveState=function(){setLiveState(isVisibleInViewport());};updateLiveState();window.addEventListener("scroll",updateLiveState,{passive:true});window.addEventListener("resize",updateLiveState);}carousel.addEventListener("focusin",function(){setLiveState(true);});carousel.addEventListener("focusout",function(){if(!("IntersectionObserver" in window))setLiveState(isVisibleInViewport());});});}};Drupal.behaviors.focusLogging={attach:function(context,settings){document.addEventListener("keydown",function(e){if(e.key==="Tab")setTimeout(function(){console.log("Currently focused element:",document.activeElement);},0);});}};Drupal.behaviors.cttransitHeadingOrderFixHomePage={attach:function(context,settings){const container=document.querySelector("body.cttransit-page-homepage");if(container){const h5Elements=container.querySelectorAll("h5");h5Elements.forEach(function(h5){h5.setAttribute("role","heading");h5.setAttribute("aria-level","2");});}}};Drupal.behaviors.ctButtonTextRepeatAccessibilityFix={attach:function(context){var scope=context&&context.nodeType===1?context:document;var wrappers=scope.querySelectorAll(".ct-button-text-wrap");wrappers.forEach(function(wrapper){if(wrapper.dataset.ctA11yProcessed==="true")return;wrapper.dataset.ctA11yProcessed="true";var primary=wrapper.querySelector(".ct-button-text:not(.absolute)");if(!primary)return;var primaryText=primary.textContent.trim();var duplicates=wrapper.querySelectorAll(".ct-button-text.absolute");duplicates.forEach(function(duplicate){if(duplicate.textContent.trim()===primaryText)duplicate.setAttribute("aria-hidden","true");});});}};Drupal.behaviors.ctNewsListingLastSpacing={attach:function(){const page=document.querySelector("body.cttransit-page-news");if(!page)return;const listings=page.querySelectorAll(".ct-news-listing");page.querySelectorAll(".ct-news-listing.ct-news-listing-last").forEach((listing)=>{listing.classList.remove("ct-news-listing-last");});if(listings.length>0)listings[listings.length-1].classList.add("ct-news-listing-last");}};Drupal.behaviors.ctServiceWaysKeyboardHoverParity={attach:function(context){once("ctServiceWaysKeyboardHoverParity",".ct-service-ways .service-ways-card-wrapper",context).forEach(function(wrapper){var cardButtonWrap=wrapper.querySelector(".card-btn-wrap");var serviceIcon=wrapper.querySelector(".service-ways-icon");if(!cardButtonWrap||!serviceIcon)return;var desktopMediaQuery=window.matchMedia("(min-width: 992px)");var applyFocusStyles=function(){if(!desktopMediaQuery.matches)return;cardButtonWrap.style.marginTop="-1rem";cardButtonWrap.style.display="block";cardButtonWrap.style.transform="translateY(0)";cardButtonWrap.style.top="100%";serviceIcon.style.transform="scale(1.05, 1.05)";};var clearFocusStyles=function(){cardButtonWrap.style.marginTop="";cardButtonWrap.style.display="";cardButtonWrap.style.transform="";cardButtonWrap.style.top="";serviceIcon.style.transform="";};wrapper.addEventListener("focusin",function(){applyFocusStyles();});wrapper.addEventListener("focusout",function(){window.requestAnimationFrame(function(){if(!wrapper.contains(document.activeElement))clearFocusStyles();});});});}};Drupal.behaviors.ctHowRideImageTextFirstLast={attach:function(context){const page=d
215ocument.querySelector('body.cttransit-page-how-ride, body[class*="cttransit-page-how-ride-"]');if(!page)return;const sections=page.querySelectorAll(".ct-image-text");sections.forEach((section)=>{section.classList.remove("first");section.classList.remove("last");});if(sections.length>0){console.log(sections[0]);console.log(sections[sections.length-1]);sections[0].classList.add("first");sections[sections.length-1].classList.add("last");}}};Drupal.behaviors.ctHowRideAccessibilityPrivacyPolicyFirstLast={attach:function(context){const page=document.querySelector("body.cttransit-page-how-ride-accessibility");if(!page)return;const sections=page.querySelectorAll(".ct-privacy-policy-section");sections.forEach((section)=>{section.classList.remove("first");section.classList.remove("last");});if(sections.length>0){sections[0].classList.add("first");sections[sections.length-1].classList.add("last");}}};})(jQuery,Drupal,once);(function(Drupal){"use strict";let ctVerticalTabsInstanceCounter=0;Drupal.behaviors.ctVerticalServiceTabsIdFix={attach(context){const wrappers=context.querySelectorAll(".ct-vertical-tab-wrap");wrappers.forEach((wrapper)=>{if(wrapper.dataset.ctVerticalTabsProcessed==="true")return;wrapper.dataset.ctVerticalTabsProcessed="true";ctVerticalTabsInstanceCounter+=1;const instanceSuffix=`-${ctVerticalTabsInstanceCounter}`;const idMap=new Map();wrapper.querySelectorAll("[id]").forEach((el)=>{const oldId=el.id;if(!oldId)return;const newId=`${oldId}${instanceSuffix}`;idMap.set(oldId,newId);el.id=newId;});const remapSimpleAttribute=(attrName)=>{wrapper.querySelectorAll(`[${attrName}]`).forEach((el)=>{const val=el.getAttribute(attrName);if(!val)return;const mapped=idMap.get(val);if(mapped)el.setAttribute(attrName,mapped);});};["aria-controls","aria-labelledby","aria-describedby"].forEach(remapSimpleAttribute);wrapper.querySelectorAll("[data-bs-target]").forEach((el)=>{const val=el.getAttribute("data-bs-target");if(!val||!val.startsWith("#"))return;const baseId=val.slice(1);const mapped=idMap.get(baseId);if(mapped)el.setAttribute("data-bs-target",`#${mapped}`);});wrapper.querySelectorAll('a[href^="#"]').forEach((el)=>{const val=el.getAttribute("href");if(!val||!val.startsWith("#"))return;const baseId=val.slice(1);const mapped=idMap.get(baseId);if(mapped)el.setAttribute("href",`#${mapped}`);});wrapper.querySelectorAll("[data-tab-nav-id]").forEach((el)=>{const baseId=el.getAttribute("data-tab-nav-id");if(!baseId)return;const mapped=idMap.get(baseId);if(mapped)el.setAttribute("data-tab-nav-id",mapped);});wrapper.querySelectorAll("select.ct-mobile-tab-select").forEach((select)=>{Array.from(select.options).forEach((option)=>{const baseVal=option.value;const mapped=idMap.get(baseVal);if(mapped)option.value=mapped;});const currentVal=select.value;const mappedCurrent=idMap.get(currentVal);if(mappedCurrent)select.value=mappedCurrent;});});}};Drupal.behaviors.ctTransitSearchLabelVisible={attach(){document.querySelectorAll(".navbar-bottom-items .search-block-form form label").forEach((label)=>{label.classList.remove("visually-hidden");});}};Drupal.behaviors.ctNewsDetailCarousel={attach(context){const root=context&&context.querySelectorAll?context:document;root.querySelectorAll("[data-ct-news-detail-carousel]:not([data-carousel-ready])").forEach((carouselRoot)=>{carouselRoot.setAttribute("data-carousel-ready","true");const viewport=carouselRoot.querySelector(".ct-news-detail-carousel__viewport");const track=carouselRoot.querySelector(".ct-news-detail-carousel__track");const slides=track?track.querySelectorAll("[data-carousel-slide]"):[];if(!viewport||!track||slides.length===0)return;if(slides.length===1){slides[0].classList.add("is-active");return;}const t=Drupal.t;let index=0;const dotsNav=document.createElement("div");dotsNav.className="ct-news-detail-carousel__dots";dotsNav.setAttribute("role","navigation");dotsNav.setAttribute("aria-label",t("Select image"));const dotButtons=[];slides.forEach((slide,i)=>{const b=document.createElement("button");b.type="button";b.className="ct-news-detail-carousel__dot";b.setAttribute("aria-label",t("Image @n of @t",{"@n":i+1,"@t":slides.length}));b.addEventListener("click",()=>{goTo(i,false);});b.addEventListener("keydown",(e)=>{if(e.key==="ArrowRight"){e.preventDefault();const next=Math.min(slides.length-1,i+1);
215goTo(next,false);dotButtons[next]?.focus();}else{if(e.key==="ArrowLeft"){e.preventDefault();const prev=Math.max(0,i-1);goTo(prev,false);dotButtons[prev]?.focus();}}});dotsNav.appendChild(b);dotButtons.push(b);});const live=document.createElement("div");live.className="visually-hidden";live.setAttribute("aria-live","polite");live.setAttribute("aria-atomic","true");carouselRoot.appendChild(live);carouselRoot.appendChild(dotsNav);function goTo(nextIndex,silentAnnouncement){const n=((nextIndex%slides.length)+slides.length)%slides.length;index=n;track.style.transform=`translate3d(-${n*100}%, 0, 0)`;slides.forEach((slide,i)=>{const on=i===n;slide.classList.toggle("is-active",on);slide.setAttribute("aria-hidden",on?"false":"true");});dotButtons.forEach((btn,i)=>{const on=i===n;btn.classList.toggle("is-selected",on);btn.tabIndex=on?0:-1;if(on)btn.setAttribute("aria-current","true");else btn.removeAttribute("aria-current");});if(!silentAnnouncement)live.textContent=t("Image @n of @t",{"@n":n+1,"@t":slides.length});}viewport.setAttribute("tabindex","0");viewport.addEventListener("keydown",(e)=>{if(e.key==="ArrowLeft"){e.preventDefault();goTo(index-1,false);}else if(e.key==="ArrowRight"){e.preventDefault();goTo(index+1,false);}else if(e.key==="Home"){e.preventDefault();goTo(0,false);}else{if(e.key==="End"){e.preventDefault();goTo(slides.length-1,false);}}});goTo(0,true);});}};Drupal.behaviors.uniqueSearchLabels={attach(context){const root=context===document?document:context;const wrappers=root.querySelectorAll(".js-form-item-keys");const suffixCount={};wrappers.forEach((wrapper)=>{if(wrapper.dataset.searchLabelFixed)return;wrapper.dataset.searchLabelFixed="true";const input=wrapper.querySelector('input[type="search"]');const label=wrapper.querySelector("label");if(!input||!label)return;let baseSuffix=null;const header=wrapper.closest("header");if(header)baseSuffix="header";else{const namedAncestor=wrapper.closest("[id]");if(namedAncestor)baseSuffix=namedAncestor.id;}if(!baseSuffix)baseSuffix="instance";suffixCount[baseSuffix]=(suffixCount[baseSuffix]||0)+1;const uniqueId=`edit-keys--${baseSuffix}--${suffixCount[baseSuffix]}`;input.setAttribute("id",uniqueId);label.setAttribute("for",uniqueId);});}};Drupal.behaviors.ctHowRideTipsImageTextCardH3AriaLevel={attach(context){const sectionSelector=".cttransit-page-how-ride-tips-help-us-serve-you-better .ct-image-text-card-v4-section";const isFullDocument=!context||context===document||context.nodeType===Node.DOCUMENT_NODE;let sections;if(isFullDocument)sections=document.querySelectorAll(sectionSelector);else sections=Array.from(document.querySelectorAll(sectionSelector)).filter((section)=>section===context||section.contains(context)||context.contains(section));sections.forEach((section)=>{section.querySelectorAll("h3").forEach((heading)=>{if(heading.dataset.cttransitHeadingAriaLevel2==="true")return;heading.dataset.cttransitHeadingAriaLevel2="true";heading.setAttribute("role","heading");heading.setAttribute("aria-level","2");});});}};Drupal.behaviors.ctNewsLisaRiversEventDetailsH2AriaLevel={attach(context){const headingSelector=".cttransit-page-news-transit-move-ctdot-transit-administrator-lisa-rivers .ct-events-details-page h2";const isFullDocument=!context||context===document||context.nodeType===Node.DOCUMENT_NODE;let headings;if(isFullDocument)headings=document.querySelectorAll(headingSelector);else headings=Array.from(document.querySelectorAll(headingSelector)).filter((h2)=>h2===context||h2.contains(context)||context.contains(h2));
215headings.forEach((heading)=>{if(heading.dataset.cttransitEventDetailsH2AriaLevel1==="true")return;heading.dataset.cttransitEventDetailsH2AriaLevel1="true";heading.setAttribute("role","heading");heading.setAttribute("aria-level","1");});}};Drupal.behaviors.ctNewsFeaturePartnerLogosRemoveAriaHidden={attach(context){const selector=".cttransit-page-news .ct-news-feature-partner-logos";const isFullDocument=!context||context===document||context.nodeType===Node.DOCUMENT_NODE;let elements;if(isFullDocument)elements=document.querySelectorAll(selector);else{elements=Array.from(context.querySelectorAll(selector));if(context.nodeType===Node.ELEMENT_NODE&&typeof context.matches==="function"&&context.matches(selector))elements.unshift(context);}elements.forEach((el)=>{if(el.getAttribute("aria-hidden")==="true")el.removeAttribute("aria-hidden");});}};Drupal.behaviors.ctNewsPageFeatureSlide0H3AriaLevel2={attach(context){const selector='.cttransit-page-news div[data-slide-index="0"] > .ct-news-feature-card > .ct-news-feature-body > h3';const isFullDocument=!context||context===document||context.nodeType===Node.DOCUMENT_NODE;let headings;if(isFullDocument)headings=document.querySelectorAll(selector);else{headings=Array.from(context.querySelectorAll(selector));if(context.nodeType===Node.ELEMENT_NODE&&typeof context.matches==="function"&&context.matches(selector))headings.unshift(context);}
215headings.forEach((heading)=>{if(heading.dataset.cttransitNewsFeatureSlide0H3AriaLevel2==="true")return;heading.dataset.cttransitNewsFeatureSlide0H3AriaLevel2="true";heading.setAttribute("role","heading");heading.setAttribute("aria-level","2");});}};Drupal.behaviors.ctTripPlannerServiceWaysCardHeading5Role={attach(context){once("ctTripPlannerServiceWaysCardHeading5Role",".cttransit-page-trip-planner .ct-service-ways .service-ways-card h5",context).forEach((heading)=>{heading.setAttribute("aria-level","3");heading.setAttribute("role","heading");});}};Drupal.behaviors.ctFaresIconTextCardHeading5Role={attach(context){once("ctFaresIconTextCardHeading5Role",".cttransit-page-fares .icon-text-card-v1 .ct-card-header h5",context).forEach((heading)=>{heading.setAttribute("aria-level","3");heading.setAttribute("role","heading");});}};Drupal.behaviors.ctGtfsFilterAriaCurrent={attach(context){once("ctGtfsFilterAriaCurrent",".ct-gtfs-filters",context).forEach((filterGroup)=>{const filterButtons=Array.from(filterGroup.querySelectorAll("button.ct-gtfs-pill"));if(!filterButtons.length)return;const setCurrentFilter=(activeButton)=>{filterButtons.forEach((button)=>{const isCurrent=button===activeButton;button.setAttribute("aria-current",isCurrent?"true":"false");button.dataset.active=isCurrent?"true":"false";});};const initialCurrentButton=filterButtons.find((button)=>button.getAttribute("aria-current")==="true"||button.dataset.active==="true")||filterButtons[0];setCurrentFilter(initialCurrentButton);filterGroup.addEventListener("click",(event)=>{const clickedButton=event.target.closest("button.ct-gtfs-pill");if(!clickedButton||!filterGroup.contains(clickedButton))return;setCurrentFilter(clickedButton);});});}};Drupal.behaviors.ctMegamenuMobileFocusTrap={attach(context){const megamenu=(context.querySelector&&context.querySelector("#ct-megamenu"))||(context.id==="ct-megamenu"?context:null)||(typeof document!=="undefined"?document.getElementById("ct-megamenu"):null);if(!megamenu||megamenu.dataset.ctMegamenuFocusTrapInit==="true")return;megamenu.dataset.ctMegamenuFocusTrapInit="true";let wasMenuOpen=megamenu.classList.contains("is-open");const menuToggle=()=>document.querySelector(".ct-header button.ct-menu-btn");const observer=new MutationObserver(()=>{const isOpen=megamenu.classList.contains("is-open");if(wasMenuOpen&&!isOpen){const btn=menuToggle();if(btn&&typeof btn.focus==="function")btn.focus();}wasMenuOpen=isOpen;});observer.observe(megamenu,{attributes:true,attributeFilter:["class"]});megamenu._ctMegamenuFocusTrapObserver=observer;const mobileMq=window.matchMedia("(max-width: 991.98px)");const tabbableSelector=['a[href]:not([tabindex="-1"])',"area[href]",'button:not([disabled]):not([tabindex="-1"])','input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])','select:not([disabled]):not([tabindex="-1"])','textarea:not([disabled]):not([tabindex="-1"])',"iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");const isLikelyVisible=(el)=>el.offsetWidth>0||el.offsetHeight>0||el.getClientRects().length>0;const getTabbable=()=>{const nodes=Array.from(megamenu.querySelectorAll(tabbableSelector));return nodes.filter((el)=>{if(el.closest("[hidden]")||el.hasAttribute("hidden"))return false;if(!isLikelyVisible(el))return false;return true;});};const trapActive=()=>mobileMq.matches&&megamenu.classList.contains("ct-megamenu")&&megamenu.classList.contains("is-open");const focusFirstTabbable=()=>{const list=getTabbable();if(list.length)list[0].focus();};const onFocusIn=(event)=>{if(!trapActive())return;if(megamenu.contains(event.target))return;focusFirstTabbable();};const onKeyDown=(event)=>{if(event.key!=="Tab"||!trapActive())return;const list=getTabbable();if(!list.length)return;const first=list[0];const last=list[list.length-1];const active=document.activeElement;if(event.shiftKey){if(active===first||!megamenu.contains(active)){event.preventDefault();last.focus();}}else{if(active===last||!megamenu.contains(active)){event.preventDefault();first.focus();}}};const controller=new AbortController();const opts={capture:true,signal:controller.signal};document.addEventListener("focusin",onFocusIn,opts);document.addEventListener("keydown",onKeyDown,opts);megamenu._ctMegamenuFocusTrapAbort=controller;},detach(context,settings,trigger){const megamenu=(context.querySelector&&context.querySelector("#ct-megamenu"))||(context.id==="ct-megamenu"?context:null);if(!megamenu)return;if(megamenu._ctMegamenuFocusTrapObserver){megamenu._ctMegamenuFocusTrapObserver.disconnect();delete megamenu._ctMegamenuFocusTrapObserver;}if(megamenu._ctMegamenuFocusTrapAbort){megamenu._ctMegamenuFocusTrapAbort.abort();delete megamenu._ctMegamenuFocusTrapAbort;}delete megamenu.dataset.ctMegamenuFocusTrapInit;}};Drupal.behaviors.ctSchedulesGtfsMapDownloadBtnFocusVisible={attach(context){once("ctSchedulesGtfsMapDownloadBtnFocusVisible",".ct-gtfs-detail-page .ct-gtfs-map-download-buttons",context).forEach((container)=>{container.querySelectorAll("a.ct-btn").forEach((anchor)=>{const applyFocusVisibleStyles=()=>{requestAnimationFrame(()=>{if(anchor.matches(":focus-visible")){anchor.style.setProperty("opacity","0.6","important");anchor.style.setProperty("background","rgba(0, 0, 0, 0)","important");anchor.style.setProperty("border-color","#fff","important");anchor.style.setProperty("color","#fff","important");}});};const clearFocusVisibleStyles=()=>{anchor.style.removeProperty("opacity");anchor.style.removeProperty("background");anchor.style.removeProperty("border-color");anchor.style.removeProperty("color");};anchor.addEventListener("focus",applyFocusVisibleStyles);anchor.addEventListener("blur",clearFocusVisibleStyles);});});}};Drupal.behaviors.ctGmpAdvancedMarkerNestedInteractiveFix={attach(context){const interactiveSelector='[role="button"], [role="link"], button, a[href], [tabindex]:not
215([tabindex="-1"])';const demoteInteractiveDescendant=(el)=>{if(!el||el.tagName==="GMP-ADVANCED-MARKER")return;el.removeAttribute("role");el.removeAttribute("tabindex");el.removeAttribute("aria-label");if(el.tagName==="IMG")el.setAttribute("alt","");el.setAttribute("aria-hidden","true");};const fixMarker=(marker)=>{if(!marker||marker.tagName!=="GMP-ADVANCED-MARKER")return;const nestedInteractive=marker.querySelector(interactiveSelector);const mapsResetImgRole=marker.getAttribute("role")==="img"&&marker.dataset.ctGmpMarkerA11y==="1";if(!nestedInteractive&&!mapsResetImgRole)return;const label=(nestedInteractive&&nestedInteractive.getAttribute("aria-label"))||marker.getAttribute("aria-label")||marker.getAttribute("title")||"";marker.querySelectorAll(interactiveSelector).forEach((el)=>{demoteInteractiveDescendant(el);});marker.querySelectorAll("img, svg").forEach((el)=>{if(el.getAttribute("aria-hidden")==="true")demoteInteractiveDescendant(el);});marker.setAttribute("role","button");marker.setAttribute("tabindex","0");if(label)marker.setAttribute("aria-label",label);if(!marker.dataset.ctGmpMarkerKeydown){marker.dataset.ctGmpMarkerKeydown="1";marker.addEventListener("keydown",(event)=>{if(event.key!=="Enter"&&event.key!==" ")return;event.preventDefault();const clickTarget=marker.querySelector("img")||marker.firstElementChild||marker;clickTarget.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true,view:window}));});}marker.dataset.ctGmpMarkerA11y="1";};const fixAll=(root)=>{if(!root)return;if(root.tagName==="GMP-ADVANCED-MARKER")fixMarker(root);if(root.querySelectorAll)root.querySelectorAll("gmp-advanced-marker").forEach(fixMarker);};fixAll(context&&context.nodeType?context:document);once("ctGmpAdvancedMarkerNestedInteractiveFix","body",context).forEach(()=>{if(!window.MutationObserver||!document.body)return;let scheduled=false;const scheduleFix=()=>{if(scheduled)return;scheduled=true;requestAnimationFrame(()=>{scheduled=false;fixAll(document);});};const observer=new MutationObserver((mutations)=>{for(const mutation of mutations){if(mutation.type==="attributes")if(mutation.target&&mutation.target.tagName==="GMP-ADVANCED-MARKER"){scheduleFix();return;}if(mutation.type==="childList"){for(const node of mutation.addedNodes){if(node.nodeType!==1)continue;if(node.tagName==="GMP-ADVANCED-MARKER"||(node.querySelector&&node.querySelector("gmp-advanced-marker"))){scheduleFix();return;}}}}});observer.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["role","aria-label","tabindex"]});});}};function injectCtSubscribeEntityMultiselectStyles(){if(document.getElementById("ct-subscribe-entity-multiselect-styles-v3"))return;document.getElementById("ct-subscribe-entity-multiselect-styles-v2")?.remove();const style=document.createElement("style");style.id="ct-subscribe-entity-multiselect-styles-v3";style.textContent=` 216 .ct-subscribe-form .form-item-select-division.ct-entity-multiselect-enhanced, 217 .ct-subscribe-form .form-item-select-service-areas-or-routes.ct-entity-multiselect-enhanced, 218 .ct-subscribe-form #ct-config-forms-routes-wrapper.ct-entity-multiselect-enhanced { 219 flex: 1; 220 min-width: 0; 221 position: relative; 222 margin: 0; 223 width: 100%; 224 } 225 .ct-subscribe-form .form-item-select-division, 226 .ct-subscribe-form .form-item-select-service-areas-or-routes { 227 flex: 1; 228 min-width: 0; 229 width: 100%; 230 } 231 .ct-subscribe-form #ct-config-forms-routes-wrapper { 232 display: block; 233 width: 100%; 234 } 235 .ct-subscribe-form .form-item-select-division .ct-entity-multiselect-native, 236 .ct-subscribe-form .form-item-select-service-areas-or-routes .ct-entity-multiselect-native, 237 .ct-subscribe-form #ct-config-forms-routes-wrapper .ct-entity-multiselect-native { 238 position: absolute; 239 width: 1px; 240 height: 1px; 241 padding: 0; 242 margin: -1px; 243 overflow: hidden; 244 clip: rect(0, 0, 0, 0); 245 white-space: nowrap; 246 border: 0; 247 } 248 .ct-subscribe-form .ct-entity-multiselect { 249 flex: 1; 250 min-width: 0; 251 position: relative; 252 } 253 .ct-subscribe-form .ct-entity-multiselect__trigger { 254 width: 100%; 255 text-align: left; 256 cursor: pointer; 257 background: transparent; 258 padding: 0; 259 color: var(--black, #001123); 260 } 261 .ct-subscribe-form .ct-entity-multiselect__trigger:focus-visible { 262 outline: 2px solid var(--ct-blue, #003e7e); 263 outline-offset: 2px; 264 } 265 .ct-subscribe-form .ct-entity-multiselect__value { 266 display: block; 267 overflow: hidden; 268 text-overflow: ellipsis; 269 white-space: nowrap; 270 } 271 .ct-subscribe-form .ct-entity-multiselect__value.is-placeholder { 272 opacity: 0.8; 273 } 274 .ct-subscribe-form .ct-entity-multiselect__listbox { 275 position: absolute; 276 top: calc(100% + 8px); 277 left: 0; 278 right: 0; 279 z-index: 20; 280 margin: 0; 281 padding: 8px 0; 282 list-style: none; 283 max-height: 240px; 284 overflow-y: auto; 285 overflow-x: hidden; 286 width: 100%; 287 box-sizing: border-box; 288 background: var(--white, #fff); 289 border: 1px solid #e9e9e9; 290 border-radius: 8px; 291 box-shadow: 0 8px 24px rgba(0, 17, 35, 0.12); 292 } 293 .ct-subscribe-form .ct-entity-multiselect__listbox[hidden] { 294 display: none; 295 } 296 .ct-subscribe-form .ct-entity-multiselect__option { 297 margin: 0; 298 } 299 .ct-subscribe-form .ct-entity-multiselect__option--select-all { 300 position: sticky; 301 top: 0; 302 z-index: 1; 303 background: var(--white, #fff); 304 border-bottom: 1px solid #e9e9e9; 305 } 306 .ct-subscribe-form .ct-entity-multiselect__option--select-all .ct-entity-multiselect__option-label { 307 font-weight: 700; 308 } 309 .ct-subscribe-form .ct-entity-multiselect__option-label { 310 display: flex; 311 align-items: center; 312 gap: 11px; 313 padding: 10px 16px; 314 cursor: pointer; 315 font-family: "Proxima Nova", "Helvetica Neue", Arial, sans-serif; 316 font-weight: 600; 317 font-size: 1rem; 318 line-height: 1.35; 319 letter-spacing: -0.01em; 320 color: var(--midnight-blue, #001123); 321 } 322 .ct-subscribe-form .ct-entity-multiselect__option-text { 323 flex: 1; 324 min-width: 0; 325 } 326 .ct-subscribe-form .ct-entity-multiselect__option-label:hover { 327 background: rgba(0, 62, 126, 0.06); 328 } 329 .ct-subscribe-form .ct-entity-multiselect__option-label input[type="checkbox"] { 330 width: 1rem; 331 height: 1rem; 332 margin: 0; 333 flex-shrink: 0; 334 border: 1px solid var(--ct-blue, #003e7e); 335 border-radius: 4px; 336 appearance: none; 337 position: relative; 338 cursor: pointer; 339 } 340 .ct-subscribe-form .ct-entity-multiselect__option-label input[type="checkbox"]:checked { 341 background: var(--ct-blue, #003e7e); 342 border-color: var(--ct-blue, #003e7e); 343 } 344 .ct-subscribe-form .ct-entity-multiselect__option-label input[type="checkbox"]:checked::after { 345 content: ""; 346 position: absolute; 347 top: 1px; 348 left: 4px; 349 width: 4px; 350 height: 8px; 351 border: solid #fff; 352 border-width: 0 2px 2px 0; 353 transform: rotate(45deg); 354 } 355 .ct-subscribe-form .ct-entity-multiselect__option-label input[type="checkbox"]:focus-visible { 356 outline: 2px solid var(--ct-blue, #003e7e); 357 outline-offset: 2px; 358 } 359 .ct-subscribe-form .ct-input-group:has(.ct-entity-multiselect-enhanced) > .input-chevron { 360 color: var(--midnight-blue, #001123); 361 flex-shrink: 0; 362 } 363 `;document.head.appendChild(style);}function destroyCtSubscribeEntityMultiselect(formItem){if(!formItem)return;if(formItem._ctEntityMultiselectAbort){formItem._ctEntityMultiselectAbort.abort();delete formItem._ctEntityMultiselectAbort;}formItem.querySelectorAll(".ct-entity-multiselect").forEach((widget)=>{widget.remove();});const select=formItem.querySelector("select");if(select){select.classList.remove("ct-entity-multiselect-native");select.removeAttribute("aria-hidden");select.removeAttribute("tabindex");}formItem.querySelector("label.control-label")?.classList.remove("visually-hidden");formItem.classList.remove("ct-entity-multiselect-enhanced");delete formItem.dataset.ctEntityMultiselectInit;}function cleanupSubscribeRoutesField(select){const formItem=select.closest(".form-item-select-service-areas-or-routes")||select.closest(".form-item");if(!formItem)return;formItem.querySelectorAll(":scope > .ct-entity-multiselect").forEach((widget)=>{widget.remove();});}function closeOtherCtSubscribeEntityMultiselects(currentFormItem){const subscribeForm=currentFormItem?.closest(".ct-subscribe-form");if(!subscribeForm)return;subscribeForm.querySelectorAll(".ct-entity-multiselect-enhanced").forEach((formItem)=>{if(formItem===currentFormItem)return;const listbox=formItem.querySelector(".ct-entity-multiselect__listbox");const trigger=formItem.querySelector(".ct-entity-multiselect__trigger");if(!listbox||listbox.hidden)return;listbox.hidden=true;listbox.setAttribute("hidden","");
363trigger?.setAttribute("aria-expanded","false");});}function initCtSubscribeEntityMultiselect(select,config){const formItem=select.closest(config.formItemSelector)||select.closest(".form-item")||select.closest("#ct-config-forms-routes-wrapper")||select.parentElement;if(!formItem)return;const existingWidget=formItem.querySelector(".ct-entity-multiselect");const optionCount=Array.from(select.options).filter((option)=>option.value).length;const checkboxCount=existingWidget?.querySelectorAll('.ct-entity-multiselect__option:not(.ct-entity-multiselect__option--select-all) input[type="checkbox"]').length||0;const selectIsBound=select.classList.contains("ct-entity-multiselect-native")&&existingWidget&&select.nextElementSibling===existingWidget&&optionCount===checkboxCount;if(formItem.dataset.ctEntityMultiselectInit==="true"){if(selectIsBound)return;destroyCtSubscribeEntityMultiselect(formItem);}injectCtSubscribeEntityMultiselectStyles();const inputGroup=formItem.closest(".ct-input-group");const label=formItem.querySelector("label.control-label")||formItem.closest(".form-item-select-service-areas-or-routes")?.querySelector("label.control-label")||formItem.closest(".form-item-select-division")?.querySelector("label.control-label")||formItem.closest(".form-item")?.querySelector("label.control-label")||inputGroup?.querySelector("label.control-label");const emptyOption=Array.from(select.options).find((option)=>!option.value);const emptyOptionText=emptyOption?.textContent.trim();const genericEmptyTexts=new Set(["Select an option","- Select -",""]);const placeholder=config.placeholder||select.getAttribute("data-ct-field-title")?.trim()||inputGroup?.dataset.ctFieldPlaceholder?.trim()||label?.textContent.trim()||(emptyOptionText&&!genericEmptyTexts.has(emptyOptionText)?emptyOptionText:"")||"Select an option";if(inputGroup&&placeholder!=="Select an option")inputGroup.dataset.ctFieldPlaceholder=placeholder;const selectedCountLabel=config.selectedCountLabel||"items selected";const closeOnSelect=formItem.dataset.ctEntityCloseOnSelect==="true"||select.dataset.ctEntityCloseOnSelect==="true";formItem.dataset.ctEntityMultiselectInit="true";formItem.classList.add("ct-entity-multiselect-enhanced");if(label){label.classList.add("visually-hidden");if(!label.id)label.id=`${select.id}-label`;}select.classList.add("ct-entity-multiselect-native");select.tabIndex=-1;select.setAttribute("aria-hidden","true");if(inputGroup&&!inputGroup.querySelector(".input-chevron.ct-entity-multiselect-chevron")){const chevron=document.createElementNS("http://www.w3.org/2000/svg","svg");chevron.setAttribute("width","20");chevron.setAttribute("height","20");chevron.setAttribute("viewBox","0 0 20 20");chevron.setAttribute("fill","none");chevron.setAttribute("xmlns","http://www.w3.org/2000/svg");chevron.setAttribute("class","input-chevron ct-entity-multiselect-chevron");chevron.setAttribute("aria-hidden","true");chevron.setAttribute("focusable","false");const path=document.createElementNS("http://www.w3.org/2000/svg","path");path.setAttribute("d","m5 7.5 5 5 5-5");path.setAttribute("stroke","currentColor");path.setAttribute("stroke-width","2");path.setAttribute("stroke-linecap","round");path.setAttribute("stroke-linejoin","round");chevron.appendChild(path);inputGroup.appendChild(chevron);}const widget=document.createElement("div");widget.className="ct-entity-multiselect";const listboxId=`${select.id}-listbox`;const trigger=document.createElement("button");trigger.type="button";trigger.className="ct-entity-multiselect__trigger ct-input";trigger.setAttribute("role","combobox");trigger.setAttribute("aria-expanded","false");trigger.setAttribute("aria-haspopup","listbox");trigger.setAttribute("aria-controls",listboxId);if(label)trigger.setAttribute("aria-labelledby",label.id);const triggerValue=document.createElement("span");triggerValue.className="ct-entity-multiselect__value is-placeholder";trigger.appendChild(triggerValue);const listbox=document.createElement("ul");listbox.id=listboxId;listbox.className="ct-entity-multiselect__listbox";listbox.setAttribute("role","listbox");listbox.setAttribute("aria-multiselectable","true");listbox.setAttribute("aria-label",placeholder);listbox.hidden=true;const getValuedOptions=()=>Array.from(select.options).filter((option)=>option.value);const syncTriggerLabel=()=>{const selectedOptions=getValuedOptions().filter((option)=>option.selected);if(selectedOptions.length===0){triggerValue.textContent=placeholder;triggerValue.classList.add("is-placeholder");return;}triggerValue.classList.remove("is-placeholder");if(config.enableSelectAll&&selectedOptions.length===getValuedOptions().length){triggerValue.textContent=Drupal.t("All routes selected");return;}if(selectedOptions.length===1){triggerValue.textContent=selectedOptions[0].textContent.trim();return;}triggerValue.textContent=`${selectedOptions.length} ${selectedCountLabel}`;};const syncOptionAria=(optionElement,isSelected)=>{optionElement.setAttribute("aria-selected",isSelected?"true":"false");};const dispatchNativeChange=()=>
363{const changeEvent=new Event("change",{bubbles:true});select.dispatchEvent(changeEvent);if(window.jQuery)window.jQuery(select).trigger("change");};let selectAllCheckbox=null;let selectAllItem=null;const syncSelectAllState=()=>{if(!selectAllCheckbox)return;const options=getValuedOptions();const selectedCount=options.filter((option)=>option.selected).length;const allSelected=options.length>0&&selectedCount===options.length;selectAllCheckbox.checked=allSelected;selectAllCheckbox.indeterminate=selectedCount>0&&selectedCount<options.length;if(selectAllItem)syncOptionAria(selectAllItem,allSelected);};if(config.enableSelectAll){selectAllItem=document.createElement("li");selectAllItem.className="ct-entity-multiselect__option ct-entity-multiselect__option--select-all";selectAllItem.setAttribute("role","option");const selectAllLabel=document.createElement("label");selectAllLabel.className="ct-entity-multiselect__option-label";selectAllCheckbox=document.createElement("input");selectAllCheckbox.type="checkbox";selectAllCheckbox.className="ct-entity-multiselect__select-all";selectAllCheckbox.setAttribute("aria-label",config.selectAllLabel||"Select all routes");const selectAllText=document.createElement("span");selectAllText.className="ct-entity-multiselect__option-text";selectAllText.textContent=config.selectAllLabel||"Select all";selectAllLabel.appendChild(selectAllCheckbox);selectAllLabel.appendChild(selectAllText);selectAllItem.appendChild(selectAllLabel);listbox.appendChild(selectAllItem);selectAllCheckbox.addEventListener("change",()=>{const checked=selectAllCheckbox.checked;selectAllCheckbox.indeterminate=false;getValuedOptions().forEach((option)=>{option.selected=checked;});listbox.querySelectorAll('.ct-entity-multiselect__option:not(.ct-entity-multiselect__option--select-all) input[type="checkbox"]').forEach((checkbox)=>{checkbox.checked=checked;const listItem=checkbox.closest(".ct-entity-multiselect__option");if(listItem)syncOptionAria(listItem,checked);});syncOptionAria(selectAllItem,checked);syncTriggerLabel();dispatchNativeChange();});}Array.from(select.options).forEach((option)=>{if(!option.value)return;const listItem=document.createElement("li");listItem.className="ct-entity-multiselect__option";listItem.setAttribute("role","option");const optionLabel=document.createElement("label");optionLabel.className="ct-entity-multiselect__option-label";const checkbox=document.createElement("input");checkbox.type="checkbox";checkbox.value=option.value;if(config.selectAllByDefault)option.selected=true;checkbox.checked=option.selected;const optionText=document.createElement("span");optionText.className="ct-entity-multiselect__option-text";optionText.innerHTML=option.innerHTML;optionLabel.appendChild(checkbox);optionLabel.appendChild(optionText);listItem.appendChild(optionLabel);listbox.appendChild(listItem);syncOptionAria(listItem,checkbox.checked);checkbox.addEventListener("change",()=>{option.selected=checkbox.checked;syncOptionAria(listItem,checkbox.checked);syncSelectAllState();syncTriggerLabel();if(config.clearRoutesOnChange)document.querySelectorAll(CT_SUBSCRIBE_ROUTES_SELECT_SELECTOR).forEach((routesSelect)=>{Array.from(routesSelect.options).forEach((routeOption)=>{routeOption.selected=false;});});dispatchNativeChange();if(closeOnSelect)closeListbox();});});syncSelectAllState();widget.appendChild(trigger);widget.appendChild(listbox);select.insertAdjacentElement("afterend",widget);const isOpen=()=>!listbox.hidden;const setOpen=(open)=>{if(open){listbox.hidden=false;listbox.removeAttribute("hidden");}else{listbox.hidden=true;listbox.setAttribute("hidden","");}trigger.setAttribute("aria-expanded",open?"true":"false");};const closeListbox=()=>{setOpen(false);};const openListbox=()=>{closeOtherCtSubscribeEntityMultiselects(formItem);setOpen(true);};const toggleListbox=()=>{if(isOpen())closeListbox();else openListbox();};const chevronIcon=inputGroup?.querySelector(".input-chevron.ct-entity-multiselect-chevron");if(chevronIcon){chevronIcon.setAttribute("aria-hidden","true");chevronIcon.setAttribute("focusable","false");chevronIcon.removeAttribute("role");chevronIcon.removeAttribute("tabindex");chevronIcon.removeAttribute("aria-label");chevronIcon.style.cursor="pointer";}const controller=new AbortController();const {signal}=controller;formItem._ctEntityMultiselectAbort=controller;trigger.addEventListener("click",(event)=>{event.preventDefault();event.stopPropagation();if(trigger.getAttribute("aria-expanded")==="true")closeListbox();else openListbox();},{signal});if(chevronIcon)chevronIcon.addEventListener("click",(event)=>{event.preventDefault();event.stopPropagation();toggleListbox();trigger.focus();},{signal});trigger.addEventListener("keydown",(event)=>{if(event.key==="ArrowDown"||event.key==="ArrowUp"){event.preventDefault();if(!isOpen())openListbox();const firstCheckbox=listbox.querySelector('input[type="checkbox"]');
363firstCheckbox?.focus();}else if(event.key==="Enter"||event.key===" "){event.preventDefault();toggleListbox();}else{if(event.key==="Escape")closeListbox();}},{signal});listbox.addEventListener("keydown",(event)=>{if(event.key==="Escape"){event.preventDefault();closeListbox();trigger.focus();}},{signal});document.addEventListener("click",(event)=>{if(!formItem.contains(event.target))closeListbox();},{signal});syncTriggerLabel();}function initCtSubscribeDivisionMultiselect(select){initCtSubscribeEntityMultiselect(select,{formItemSelector:".form-item-select-division",selectedCountLabel:Drupal.t("divisions selected"),clearRoutesOnChange:true});}const CT_SUBSCRIBE_ROUTES_SELECT_SELECTOR='[data-drupal-selector="edit-select-service-areas-or-routes"], select[name="select_service_areas_or_routes[]"]';function isSubscribeRoutesSelect(select){if(!select||select.tagName!=="SELECT"||!select.closest(".ct-subscribe-form"))return false;if(select.getAttribute("data-drupal-selector")==="edit-select-service-areas-or-routes")return true;if(select.name==="select_service_areas_or_routes[]")return true;const selectId=select.id||"";return (selectId==="edit-select-service-areas-or-routes"||selectId.startsWith("edit-select-service-areas-or-routes--"));}function findSubscribeRoutesSelects(context){const selects=[];const seen=new Set();const addSelect=(select)=>{if(!isSubscribeRoutesSelect(select)||seen.has(select))return;seen.add(select);selects.push(select);};if(!context)return selects;if(context.nodeType===1&&isSubscribeRoutesSelect(context))addSelect(context);if(typeof context.querySelectorAll==="function")context.querySelectorAll(CT_SUBSCRIBE_ROUTES_SELECT_SELECTOR).forEach(addSelect);return selects;}let subscribeRoutesInitTimer=null;function scheduleSubscribeRoutesInit(context){if(subscribeRoutesInitTimer)window.clearTimeout(subscribeRoutesInitTimer);subscribeRoutesInitTimer=window.setTimeout(()=>{subscribeRoutesInitTimer=null;initCtSubscribeRoutesFields(context||document);},100);}function initCtSubscribeRoutesFields(context){findSubscribeRoutesSelects(context).forEach((select)=>{cleanupSubscribeRoutesField(select);initCtSubscribeRoutesMultiselect(select);});}function bindSubscribeRoutesAjaxReinit(){if(bindSubscribeRoutesAjaxReinit.isBound||!window.jQuery)return;bindSubscribeRoutesAjaxReinit.isBound=true;window.jQuery(document).on("ajaxComplete.ctSubscribeRoutesMultiselect",function(){scheduleSubscribeRoutesInit(document);});}function initCtSubscribeRoutesMultiselect(select){initCtSubscribeEntityMultiselect(select,{formItemSelector:".form-item-select-service-areas-or-routes",selectedCountLabel:Drupal.t("routes selected"),enableSelectAll:true,selectAllLabel:"Select all",selectAllByDefault:false});}Drupal.behaviors.ctSubscribeEntityMultiselect={attach(context){bindSubscribeRoutesAjaxReinit();once("ctSubscribeDivisionMultiselect",".ct-subscribe-form #edit-select-division",context).forEach((select)=>{initCtSubscribeDivisionMultiselect(select);});scheduleSubscribeRoutesInit(context);},detach(context,settings,trigger){if(trigger!=="unload")return;if(!context||(context.nodeType!==1&&context.nodeType!==9))return;context.querySelectorAll?.(".form-item-select-division, .form-item-select-service-areas-or-routes")?.forEach((formItem)=>{destroyCtSubscribeEntityMultiselect(formItem);});}};function syncCtEntityMultiselectTriggerName(trigger){if(!trigger||trigger.tagName!=="BUTTON")return;const valueEl=trigger.querySelector(".ct-entity-multiselect__value");const valueText=(valueEl?.textContent||"").trim();let labelText="";const labelledBy=trigger.getAttribute("aria-labelledby");if(labelledBy)labelText=labelledBy.split(/\s+/).map((id)=>document.getElementById(id)?.textContent?.trim()||"").filter(Boolean).join(" ");if(!labelText){const formItem=trigger.closest(".form-item, [class*='form-item-'], #ct-config-forms-routes-wrapper");labelText=formItem?.querySelector("label.control-label, label")?.textContent?.trim()||"";}const listboxId=trigger.getAttribute("aria-controls");const listbox=listboxId?document.getElementById(listboxId):null;const listboxLabel=(listbox?.getAttribute("aria-label")||"").trim();const accessibleName=valueText||labelText||listboxLabel||"Select an option";trigger.removeAttribute("aria-labelledby");trigger.setAttribute("aria-label",accessibleName);}
363function bindCtEntityMultiselectTriggerNameObserver(trigger){if(trigger.dataset.ctMsTriggerA11y==="true")return;trigger.dataset.ctMsTriggerA11y="true";syncCtEntityMultiselectTriggerName(trigger);const valueEl=trigger.querySelector(".ct-entity-multiselect__value");if(!valueEl)return;const observer=new MutationObserver(()=>{syncCtEntityMultiselectTriggerName(trigger);});observer.observe(valueEl,{characterData:true,childList:true,subtree:true,attributes:true,attributeFilter:["class"]});}Drupal.behaviors.ctEntityMultiselectTriggerAccessibleName={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;scope.querySelectorAll?.("button.ct-entity-multiselect__trigger.ct-input")?.forEach((trigger)=>{bindCtEntityMultiselectTriggerNameObserver(trigger);});once("ctEntityMultiselectTriggerA11yObserver","body",context).forEach((body)=>{const observer=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{mutation.addedNodes.forEach((node)=>{if(!node||node.nodeType!==1)return;if(node.matches?.("button.ct-entity-multiselect__trigger.ct-input"))bindCtEntityMultiselectTriggerNameObserver(node);node.querySelectorAll?.("button.ct-entity-multiselect__trigger.ct-input")?.forEach((trigger)=>{bindCtEntityMultiselectTriggerNameObserver(trigger);});});});});observer.observe(body,{childList:true,subtree:true});});}};function ctDedupeGoogleTranslateElement2(){const nodes=Array.from(document.querySelectorAll('[id="google_translate_element2"]'));if(nodes.length<2)return;let keeper=nodes.find((el)=>el.querySelector(".goog-te-gadget, .goog-te-combo")||(el.innerHTML&&el.innerHTML.trim().length>0));if(!keeper)keeper=nodes[0];keeper.id="google_translate_element2";let dupIndex=0;nodes.forEach((el)=>{if(el===keeper)return;if(!el.innerHTML||el.innerHTML.trim().length===0){el.remove();return;}dupIndex+=1;el.id=`google_translate_element2-dup-${dupIndex}`;});}Drupal.behaviors.ctGoogleTranslateElementUniqueId={attach(context){ctDedupeGoogleTranslateElement2();once("ctGoogleTranslateElementUniqueId","body",context).forEach((body)=>{let debounceTimer=null;const scheduleDedupe=()=>{window.clearTimeout(debounceTimer);debounceTimer=window.setTimeout(()=>{ctDedupeGoogleTranslateElement2();},100);};if(window.MutationObserver){const observer=new MutationObserver(scheduleDedupe);observer.observe(body,{childList:true,subtree:true});}window.addEventListener("load",scheduleDedupe);});}};var CT_GOOG_TE_LANDMARK_ROLES={banner:true,complementary:true,contentinfo:true,form:true,main:true,navigation:true,region:true,search:true};function ctGoogleTranslateShellSelector(){return ['#google_translate_element2','[id^="google_translate_element2-dup-"]',".goog-te-gadget"].join(",");}function ctGoogleTranslateIframeSelector(){return ["iframe.goog-te-banner-frame","iframe.goog-te-menu-frame","iframe.skiptranslate",".goog-te-spinner-pos iframe",'iframe[id^=":"][class*="goog-te"]','iframe[title="Language Translate Widget"]'].join(",");}function ctStripLandmarkRole(el){if(!el||!el.getAttribute)return;var role=(el.getAttribute("role")||"").trim().split(/\s+/)[0].toLowerCase();if(role&&CT_GOOG_TE_LANDMARK_ROLES[role])el.removeAttribute("role");}function ctHideGoogleTranslateShellFromAt(el){if(!el||el.nodeType!==1)return;ctStripLandmarkRole(el);if(el.getAttribute("aria-hidden")!=="true")el.setAttribute("aria-hidden","true");el.querySelectorAll("a[href], area[href], button, input, select, textarea, iframe, object, embed, summary, [tabindex]").forEach(function(focusable){if(focusable.getAttribute("tabindex")!=="-1"){if(!focusable.hasAttribute("data-ct-gt-prev-tabindex"))focusable.setAttribute("data-ct-gt-prev-tabindex",focusable.hasAttribute("tabindex")?focusable.getAttribute("tabindex"):"");focusable.setAttribute("tabindex","-1");}});}function ctUniquifyGoogleTranslateIframes(){var iframes=document.querySelectorAll(ctGoogleTranslateIframeSelector());var usedTitles={};iframes.forEach(function(iframe,index){if(iframe.getAttribute("aria-hidden")!=="true")iframe.setAttribute("aria-hidden","true");if(iframe.getAttribute("tabindex")!=="-1")iframe.setAttribute("tabindex","-1");ctStripLandmarkRole(iframe);var base=(iframe.getAttribute("title")||"").trim()||"Language Translate Widget";var candidate=base;var key=candidate.toLowerCase();var n=2;while(usedTitles[key]){candidate=base+" ("+n+")";key=candidate.toLowerCase();n+=1;}usedTitles[key]=true;if(iframe.getAttribute("title")!==candidate)iframe.setAttribute("title",candidate);if(iframe.hasAttribute("aria-label")&&iframe.getAttribute("aria-label")!==candidate)iframe.setAttribute("aria-label",candidate);if(!iframe.id)iframe.id="ct-goog-te-frame-"+(index+1);});}var ctGoogleTranslateLandmarkFixing=false;function ctIsGoogleTranslateRelatedNode(node){if(!node||node.nodeType!==1)return false;if(typeof node.matches==="function")if(node.matches(ctGoogleTranslateShellSelector())||node.matches(ctGoogleTranslateIframeSelector())||node.id==="google_translate_element2"||(node.id&&node.id.indexOf("google_translate_element2")===0)||(node.classList&&(node.classList.contains("skiptranslate")||node.classList.contains("goog-te-gadget")||node.classList.contains("gtranslate_wrapper"))))return true;if(typeof node.querySelector==="function")return !!(node.querySelector(ctGoogleTranslateShellSelector())||node.querySelector(ctGoogleTranslateIframeSelector()));return false;}function ctFixGoogleTranslateLandmarkA11y(){if(ctGoogleTranslateLandmarkFixing)return;ctGoogleTranslateLandmarkFixing=true;try{document.querySelectorAll(ctGoogleTranslateShellSelector()).forEac
363h(ctHideGoogleTranslateShellFromAt);document.querySelectorAll(".gtranslate_wrapper").forEach(function(wrap){var hasVisibleLangUi=wrap.querySelector(".gt_selector:not(.goog-te-combo), .gt_switcher, a.glink");if(hasVisibleLangUi)return;ctHideGoogleTranslateShellFromAt(wrap);});ctUniquifyGoogleTranslateIframes();}finally{ctGoogleTranslateLandmarkFixing=false;}}Drupal.behaviors.ctGoogleTranslateLandmarkA11y={attach(context){ctFixGoogleTranslateLandmarkA11y();once("ctGoogleTranslateLandmarkA11y","body",context).forEach(function(body){var debounceTimer=null;var schedule=function(){window.clearTimeout(debounceTimer);debounceTimer=window.setTimeout(function(){ctFixGoogleTranslateLandmarkA11y();},100);};if(window.MutationObserver){var observer=new MutationObserver(function(mutations){if(ctGoogleTranslateLandmarkFixing)return;for(var i=0;i<mutations.length;i++){var mutation=mutations[i];if(mutation.type==="childList"){var nodes=[];var a;for(a=0;a<mutation.addedNodes.length;a++)nodes.push(mutation.addedNodes[a]);for(a=0;a<mutation.removedNodes.length;a++)nodes.push(mutation.removedNodes[a]);for(a=0;a<nodes.length;a++)if(ctIsGoogleTranslateRelatedNode(nodes[a])){schedule();return;}}else{if(mutation.type==="attributes"&&ctIsGoogleTranslateRelatedNode(mutation.target)){schedule();return;}}}});observer.observe(body,{childList:true,subtree:true,attributes:true,attributeFilter:["role","aria-label","aria-labelledby","aria-hidden","title","id"]});}window.addEventListener("load",schedule);});}};const CT_HERO_GRADIENT_IDS=["paint0_linear_5613_16673","paint1_linear_5613_16673","paint2_linear_5613_16673","paint3_linear_5613_16673"];let ctHeroSvgGradientCounter=0;function ctSvgHasHeroGradientId(svg){for(let i=0;i<CT_HERO_GRADIENT_IDS.length;i++)if(svg.querySelector(`[id="${CT_HERO_GRADIENT_IDS[i]}"]`))return true;return false;}function ctUniquifyHeroSvgGradients(svg){if(!svg||svg.nodeType!==1||!ctSvgHasHeroGradientId(svg))return;ctHeroSvgGradientCounter+=1;const suffix=`-${ctHeroSvgGradientCounter}`;const idMap=new Map();CT_HERO_GRADIENT_IDS.forEach((oldId)=>{const gradient=svg.querySelector(`[id="${oldId}"]`);if(!gradient)return;const newId=`${oldId}${suffix}`;idMap.set(oldId,newId);gradient.setAttribute("id",newId);});if(!idMap.size)return;const remapUrlValue=(value)=>{if(!value||value.indexOf("url(#")===-1)return value;let next=value;idMap.forEach((newId,oldId)=>{next=next.split(`url(#${oldId})`).join(`url(#${newId})`);});return next;};svg.querySelectorAll("[fill], [stroke], [style]").forEach((el)=>{["fill","stroke"].forEach((attr)=>{const val=el.getAttribute(attr);if(!val)return;const mapped=remapUrlValue(val);if(mapped!==val)el.setAttribute(attr,mapped);});const styleVal=el.getAttribute("style");if(styleVal){const mappedStyle=remapUrlValue(styleVal);if(mappedStyle!==styleVal)el.setAttribute("style",mappedStyle);}});}Drupal.behaviors.ctHeroSvgGradientUniqueIds={attach(context){once("ctHeroSvgGradientUniqueIds","svg",context).forEach((svg)=>{ctUniquifyHeroSvgGradients(svg);});}};const CT_LABEL_IN_NAME_SELECTOR='a[aria-label], button[aria-label], [role="button"][aria-label], [role="link"][aria-label]';const CT_ORIGINAL_ARIA_LABEL_ATTR="data-ct-original-aria-label";function ctNormalizeLabelText(text){return String(text||"").replace(/\s+/g," ").trim().toLowerCase();}function ctGetVisibleLabelText(element){if(!element||element.nodeType!==1)return "";const buttonText=element.querySelector(".ct-button-text:not(.absolute)");if(buttonText)return String(buttonText.textContent||"").replace(/\s+/g," ").trim();const clone=element.cloneNode(true);clone.querySelectorAll('svg, img, [aria-hidden="true"], [hidden], template, script, style, .visually-hidden, .sr-only, .u-hidden, .ct-button-text.absolute').forEach((node)=>{node.remove();});return String(clone.textContent||"").replace(/\s+/g," ").trim();}function ctGetOriginalAriaLabel(element){const stored=(element.getAttribute(CT_ORIGINAL_ARIA_LABEL_ATTR)||"").trim();if(stored)return stored;const current=(element.getAttribute("aria-label")||"").trim();if(!current)return "";element.setAttribute(CT_ORIGINAL_ARIA_LABEL_ATTR,current);return current;}function ctFixLabelInNameMismatch(element){if(!element||element.nodeType!==1)return;if(element.dataset.ctLabelInNameWriting==="1")return;let original=ctGetOriginalAriaLabel(element);if(!original)return;if(/\(link is external\)/i.test(original)){const repaired=original.replace(/\s*\(link is external\)\.?\s*/gi," ").replace(/\s+/g," ").trim();const newTabMatch=repaired.match(/(.+?)\s*\(opens in a new tab\)\s*$/i);original=newTabMatch?`${newTabMatch[1].replace(/^[\s.]+|[\s.]+$/g,"").trim()} (opens in a new tab)`:repaired;element.setAttribute(CT_ORIGINAL_ARIA_LABEL_ATTR,original);}const visible=ctGetVisibleLabelText(element);if(!visible)return;const normVisible=ctNormalizeLabelText(visible);const normOriginal=ctNormalizeLabelText(original);if(!normVisible)return;const next=normOriginal.includes(normVisible)?original:`${visible}. ${original}`;const current=(element.getAttribute("aria-label")||"").trim();if(current===next)return;element.dataset.ctLabelInNameWriting="1";element.setAttribute("aria-label",next);delete element.dataset.ctLabelInNameWriting;}function ctClosestLabeledControl(node){if(!node)return null;const el=node.nodeType===1?node:node.parentElement;return el?el.closest(CT_LABEL_IN_NAME_SELECTOR):null;}function ctFixLabelInNameInRoot(root){if(!root)return;if(root.nodeType===1&&root.matches?.(CT_LABEL_IN_NAME_SELECTOR))ctFixLabelInNameMismatch(root);
363root.querySelectorAll?.(CT_LABEL_IN_NAME_SELECTOR).forEach((el)=>{ctFixLabelInNameMismatch(el);});}Drupal.behaviors.ctLabelInNameMismatchFix={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;ctFixLabelInNameInRoot(scope);once("ctLabelInNameMismatchObserver","body",context).forEach((body)=>{if(!window.MutationObserver)return;let debounceTimer=null;const scheduleFullScan=()=>{window.clearTimeout(debounceTimer);debounceTimer=window.setTimeout(()=>{ctFixLabelInNameInRoot(document);},100);};const observer=new MutationObserver((mutations)=>{let needsFullScan=false;mutations.forEach((mutation)=>{if(mutation.type==="attributes"&&mutation.attributeName==="aria-label"){ctFixLabelInNameMismatch(mutation.target);return;}if(mutation.type==="characterData"){const control=ctClosestLabeledControl(mutation.target);if(control)ctFixLabelInNameMismatch(control);else needsFullScan=true;return;}mutation.addedNodes.forEach((node)=>{if(!node)return;if(node.nodeType===1){ctFixLabelInNameInRoot(node);return;}if(node.nodeType===3){const control=ctClosestLabeledControl(node);if(control)ctFixLabelInNameMismatch(control);else needsFullScan=true;}});mutation.removedNodes.forEach((node)=>{if(node&&node.nodeType===3){const control=ctClosestLabeledControl(mutation.target);if(control)ctFixLabelInNameMismatch(control);}});});if(needsFullScan)scheduleFullScan();});observer.observe(body,{childList:true,subtree:true,characterData:true,attributes:true,attributeFilter:["aria-label"]});window.addEventListener("load",scheduleFullScan);document.addEventListener("change",(event)=>{if(event.target&&event.target.matches?.("select.gt_selector, select.goog-te-combo, .gt_selector"))scheduleFullScan();});});}};var CT_HEADING_TAG_LEVEL={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6};function ctGetHeadingNaturalLevel(el){var tag=el.tagName;if(CT_HEADING_TAG_LEVEL.hasOwnProperty(tag))return CT_HEADING_TAG_LEVEL[tag];var role=el.getAttribute("role");if(role&&role.toLowerCase()==="heading"){var ariaLevelAttr=el.getAttribute("aria-level");var parsed=parseInt(ariaLevelAttr,10);if(!isNaN(parsed)&&parsed>=1&&parsed<=6)return parsed;}return null;}function ctCollectHeadings(root){var nodeList=root.querySelectorAll('h1, h2, h3, h4, h5, h6, [role="heading"]');var result=[];for(var i=0;i<nodeList.length;i++){var el=nodeList[i];var level=ctGetHeadingNaturalLevel(el);if(level!==null)result.push({el,naturalLevel:level});}return result;}function ctApplyCorrectedHeadingLevel(el,correctedLevel){var currentRole=el.getAttribute("role");var currentAriaLevel=el.getAttribute("aria-level");var correctedLevelStr=String(correctedLevel);if(currentRole===null||currentRole.toLowerCase()!=="heading")el.setAttribute("role","heading");if(currentAriaLevel!==correctedLevelStr)el.setAttribute("aria-level",correctedLevelStr);}function ctClearHeadingOverrideIfPresent(el,tag){if(!CT_HEADING_TAG_LEVEL.hasOwnProperty(tag))return;var role=el.getAttribute("role");if(role&&role.toLowerCase()==="heading")el.removeAttribute("role");if(el.hasAttribute("aria-level"))el.removeAttribute("aria-level");}function ctFixHeadingHierarchy(){var body=document.body;if(!body)return;var headings=ctCollectHeadings(body);if(headings.length===0)return;var previousEffectiveLevel=null;for(var i=0;i<headings.length;i++){var item=headings[i];var el=item.el;var natural=item.naturalLevel;var tag=el.tagName;var correctedLevel;if(previousEffectiveLevel===null)correctedLevel=natural;else if(natural<=previousEffectiveLevel)correctedLevel=natural;else if(natural===previousEffectiveLevel+1)correctedLevel=natural;else correctedLevel=previousEffectiveLevel+1;if(correctedLevel!==natural)ctApplyCorrectedHeadingLevel(el,correctedLevel);else ctClearHeadingOverrideIfPresent(el,tag);previousEffectiveLevel=correctedLevel;}}function ctGtfsTableWrapperIsScrollable(el){if(!el||el.nodeType!==1)return false;return (el.scrollWidth>el.clientWidth+1||el.scrollHeight>el.clientHeight+1);}function ctGtfsTableWrapperEnsureAccessibleName(wrapper){if(!wrapper.getAttribute("role"))wrapper.setAttribute("role","region");if(!wrapper.getAttribute("aria-label")&&!wrapper.getAttribute("aria-labelledby"))wrapper.setAttribute("aria-label",Drupal.t("Scrollable schedule table"));}function ctGtfsTableWrapperSyncKeyboardAccess(wrapper){if(!wrapper||!wrapper.isConnected)return;const scrollable=ctGtfsTableWrapperIsScrollable(wrapper);const managed=wrapper.dataset.ctScrollableKeyboard==="1";
363if(scrollable){ctGtfsTableWrapperEnsureAccessibleName(wrapper);const currentTabindex=wrapper.getAttribute("tabindex");if(currentTabindex===null||managed||currentTabindex==="-1"){wrapper.setAttribute("tabindex","0");wrapper.dataset.ctScrollableKeyboard="1";}return;}if(managed){wrapper.removeAttribute("tabindex");delete wrapper.dataset.ctScrollableKeyboard;}}function ctEnhanceGtfsTableWrapperKeyboard(wrapper){const sync=()=>{ctGtfsTableWrapperSyncKeyboardAccess(wrapper);};sync();requestAnimationFrame(sync);if(typeof ResizeObserver!=="undefined"){const resizeObserver=new ResizeObserver(sync);resizeObserver.observe(wrapper);if(wrapper.firstElementChild)resizeObserver.observe(wrapper.firstElementChild);wrapper._ctScrollableKeyboardRo=resizeObserver;}window.addEventListener("resize",sync);}Drupal.behaviors.ctGtfsTableWrapperKeyboardScroll={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;if(scope.nodeType===1&&typeof scope.matches==="function"&&scope.matches(".ct-gtfs-table-wrapper"))once("ctGtfsTableWrapperKeyboardScroll",[scope]).forEach(ctEnhanceGtfsTableWrapperKeyboard);once("ctGtfsTableWrapperKeyboardScroll",".ct-gtfs-table-wrapper",scope).forEach(ctEnhanceGtfsTableWrapperKeyboard);once("ctGtfsTableWrapperKeyboardScrollObserver","body",context).forEach((body)=>{if(!window.MutationObserver)return;let scheduled=false;const scheduleEnhance=()=>{if(scheduled)return;scheduled=true;requestAnimationFrame(()=>{scheduled=false;Drupal.behaviors.ctGtfsTableWrapperKeyboardScroll.attach(document);});};const observer=new MutationObserver((mutations)=>{for(const mutation of mutations){if(mutation.type!=="childList")continue;for(const node of mutation.addedNodes){if(node.nodeType!==1)continue;if((typeof node.matches==="function"&&node.matches(".ct-gtfs-table-wrapper"))||(typeof node.querySelector==="function"&&node.querySelector(".ct-gtfs-table-wrapper"))){scheduleEnhance();return;}}}});observer.observe(body,{childList:true,subtree:true});});}};const CT_SCROLLABLE_REGION_SELECTOR=".table-responsive, .scroll-text";const CT_SCROLLABLE_REGION_DATASET="ctScrollRegionKb";function ctScrollableRegionHasOverflowScroll(el){if(!el||el.nodeType!==1)return false;const style=window.getComputedStyle(el);const ox=style.overflowX;const oy=style.overflowY;const scrollableX=(ox==="auto"||ox==="scroll"||ox==="overlay")&&el.scrollWidth>el.clientWidth+1;const scrollableY=(oy==="auto"||oy==="scroll"||oy==="overlay")&&el.scrollHeight>el.clientHeight+1;return scrollableX||scrollableY;}function ctScrollableRegionDefaultLabel(el){if(el.classList.contains("table-responsive"))return Drupal.t("Scrollable table");if(el.classList.contains("scroll-text"))return Drupal.t("Scrollable content");return Drupal.t("Scrollable region");}function ctScrollableRegionEnsureAccessibleName(el){if(!el.getAttribute("role"))el.setAttribute("role","region");if(!el.getAttribute("aria-label")&&!el.getAttribute("aria-labelledby"))el.setAttribute("aria-label",ctScrollableRegionDefaultLabel(el));}function ctScrollableRegionSyncKeyboardAccess(el){if(!el||!el.isConnected)return;const scrollable=ctScrollableRegionHasOverflowScroll(el);const managed=el.dataset[CT_SCROLLABLE_REGION_DATASET]==="1";if(scrollable){ctScrollableRegionEnsureAccessibleName(el);const currentTabindex=el.getAttribute("tabindex");if(currentTabindex===null||managed||currentTabindex==="-1"){el.setAttribute("tabindex","0");el.dataset[CT_SCROLLABLE_REGION_DATASET]="1";}return;}if(managed){el.removeAttribute("tabindex");delete el.dataset[CT_SCROLLABLE_REGION_DATASET];}}function ctEnhanceScrollableRegionKeyboard(el){const sync=()=>{ctScrollableRegionSyncKeyboardAccess(el);};sync();requestAnimationFrame(sync);if(typeof ResizeObserver!=="undefined"){const resizeObserver=new ResizeObserver(sync);resizeObserver.observe(el);if(el.firstElementChild)resizeObserver.observe(el.firstElementChild);el._ctScrollRegionKbRo=resizeObserver;}window.addEventListener("resize",sync);}function ctScrollableRegionMatches(node){return (typeof node.matches==="function"&&node.matches(CT_SCROLLABLE_REGION_SELECTOR));}function ctScrollableRegionContains(node){return (typeof node.querySelector==="function"&&!!node.querySelector(CT_SCROLLABLE_REGION_SELECTOR));}Drupal.behaviors.ctScrollableRegionKeyboard={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;if(scope.nodeType===1&&ctScrollableRegionMatches(scope))once("ctScrollableRegionKeyboard",[scope]).forEac
363h(ctEnhanceScrollableRegionKeyboard);once("ctScrollableRegionKeyboard",CT_SCROLLABLE_REGION_SELECTOR,scope).forEach(ctEnhanceScrollableRegionKeyboard);once("ctScrollableRegionKeyboardObserver","body",context).forEach((body)=>{if(!window.MutationObserver)return;let scheduled=false;const scheduleEnhance=()=>{if(scheduled)return;scheduled=true;requestAnimationFrame(()=>{scheduled=false;Drupal.behaviors.ctScrollableRegionKeyboard.attach(document);});};const observer=new MutationObserver((mutations)=>{for(const mutation of mutations){if(mutation.type!=="childList")continue;for(const node of mutation.addedNodes){if(node.nodeType!==1)continue;if(ctScrollableRegionMatches(node)||ctScrollableRegionContains(node)){scheduleEnhance();return;}}}});observer.observe(body,{childList:true,subtree:true});});}};Drupal.behaviors.ctFixHeadingHierarchy={attach(context){once("ctFixHeadingHierarchy","body",context).forEach(function(){ctFixHeadingHierarchy();});if(context&&context!==document&&context.nodeType===1&&context!==document.body&&context!==document.documentElement){var hasHeading=(typeof context.matches==="function"&&context.matches('h1, h2, h3, h4, h5, h6, [role="heading"]'))||(typeof context.querySelector==="function"&&context.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]'));if(hasHeading)ctFixHeadingHierarchy();}}};window.__fixHeadingHierarchy=ctFixHeadingHierarchy;Drupal.behaviors.ctNormalizeInvalidLangAttributes={attach(context){once("ctNormalizeInvalidLangAttributes","html",context).forEach(()=>{const INVALID_LANG_VALUES=new Set(["x-none","none","null","undefined","n/a","na"]);const normalizeLanguageAttribute=(element)=>{if(!(element instanceof Element)||!element.hasAttribute("lang"))return;const value=element.getAttribute("lang").trim().toLowerCase();if(!value||INVALID_LANG_VALUES.has(value)||value.startsWith("x-"))element.removeAttribute("lang");};const processNode=(node)=>{if(!(node instanceof Element))return;normalizeLanguageAttribute(node);node.querySelectorAll("[lang]").forEach(normalizeLanguageAttribute);};const initialize=()=>{const documentElement=document.documentElement;if(!documentElement.hasAttribute("lang")||!documentElement.getAttribute("lang").trim()||documentElement.getAttribute("lang").trim().toLowerCase().startsWith("x-"))documentElement.setAttribute("lang","en");document.querySelectorAll("[lang]").forEach(normalizeLanguageAttribute);const observer=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{if(mutation.type==="attributes"){normalizeLanguageAttribute(mutation.target);return;}mutation.addedNodes.forEach(processNode);});});observer.observe(documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:["lang"]});};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initialize,{once:true});else initialize();});}};Drupal.behaviors.ctEnsureLevelOneHeading={attach(context){once("ctEnsureLevelOneHeading","html",context).forEach(()=>{const FALLBACK_ID="global-accessibility-h1";const STYLE_ID="global-accessibility-heading-styles";const getPageHeading=()=>{const selectors=["[data-page-title]",".page-title",".entry-title",".post-title",".content-title","main h2",'[role="main"] h2'];for(const selector of selectors){const element=document.querySelector(selector);const text=element?.textContent?.replace(/\s+/g," ").trim();if(text)return text;}const main=document.querySelector('main, [role="main"]');const mainLabel=main?.getAttribute("aria-label")?.trim();if(mainLabel)return mainLabel;const metaTitle=document.querySelector('meta[property="og:title"]')?.getAttribute("content")?.trim();if(metaTitle)return metaTitle;const documentTitle=document.title.replace(/\s*[|ââ-]\s*[^|ââ-]+$/,"").trim();return documentTitle||"Page content";};const addScreenReaderStyles=()=>{if(document.getElementById(STYLE_ID))return;const style=document.createElement("style");style.id=STYLE_ID;style.textContent=` 364 .global-accessibility-sr-only { 365 position: absolute !important; 366 width: 1px !important; 367 height: 1px !important; 368 padding: 0 !important; 369 margin: -1px !important; 370 overflow: hidden !important; 371 clip: rect(0, 0, 0, 0) !important; 372 white-space: nowrap !important; 373 border: 0 !important; 374 } 375 `;document.head.appendChild(style);};const ensureLevelOneHeading=()=>{const fallbackHeading=document.getElementById(FALLBACK_ID);const existingHeading=Array.from(document.querySelectorAll("h1")).find((heading)=>heading.id!==FALLBACK_ID);if(existingHeading){fallbackHeading?.remove();return;}const headingText=getPageHeading();if(fallbackHeading){fallbackHeading.textContent=headingText;return;}addScreenReaderStyles();const heading=document.createElement("h1");heading.id=FALLBACK_ID;heading.className="global-accessibility-sr-only";heading.textContent=headingText;const contentContainer=document.querySelector('main, [role="main"], #main, #content, .main-content');if(contentContainer)contentContainer.prepend(heading);else document.body.prepend(heading);};const initialize=()=>{ensureLevelOneHeading();let scheduled=false;const observer=new MutationObserver(()=>{if(scheduled)return;scheduled=true;window.requestAnimationFrame(()=>{ensureLevelOneHeading();scheduled=false;});});observer.observe(document.body,{childList:true,subtree:true});window.addEventListener("popstate",ensureLevelOneHeading);window.addEventListener("hashchange",ensureLevelOneHeading);};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",initialize,{once:true});else initialize();});}};var CT_LANDMARK_MANAGED="data-ct-landmark-unique";var CT_LANDMARK_ORIG_LABEL="data-ct-landmark-orig-aria-label";var CT_LANDMARK_ORIG_LABELLEDBY="data-ct-landmark-orig-aria-labelledby";var CT_LANDMARK_ROLES={banner:true,complementary:true,contentinfo:true,form:true,main:true,navigation:true,region:true,search:true};var CT_ALWAYS_LANDMARK={banner:true,complementary:true,contentinfo:true,main:true,navigation:true,search:true};var CT_LANDMARK_ID_LABELS={"block-ct-search-desktop":"Desktop search","block-ct-search-mobile":"Mobile search","block-ct-lang-nav":"Language","block-ct-lang":"Language","block-cttransit-language":"Language"};var CT_LANDMARK_CANDIDATE_SELECTOR=["header","nav","main","aside","footer",'[role="banner"]','[role="navigation"]','[role="main"]','[role="complementary"]','[role="contentinfo"]','[role="search"]','[role="form"]','[role="region"]',"section[aria-label]","section[aria-labelledby]","form[aria-label]","form[aria-labelledby]"].join(",");var ctLandmarkUniquifyScheduled=false;var ctLandmarkObserver=null;function ctLandmarkNormalizeName(name){return String(name||"").replace(/\s+/g," ").trim().toLowerCase();}function ctLandmarkVisibleText(el){if(!el)return "";return String(el.textContent||"").replace(/\s+/g," ").trim();}function ctLandmarkGetAccessibleName(el){var labelledby=el.getAttribute("aria-labelledby");if(labelledby){var parts=labelledby.trim().split(/\s+/);var chunks=[];for(var i=0;i<parts.length;i++){var ref=document.getElementById(parts[i]);var t=ctLandmarkVisibleText(ref);if(t)chunks.push(t);}var joined=chunks.join(" ").trim();if(joined)return joined;}var label=el.getAttribute("aria-label");if(label&&label.trim())return label.replace(/\s+/g," ").trim();return "";}function ctLandmarkIsA11yHidden(el){if(!el||el.nodeType!==1)return true;if(el.hasAttribute("hidden")||el.getAttribute("aria-hidden")==="true")return true;if(typeof el.closest==="function")if(el.closest('[aria-hidden="true"], [hidden], template, [inert]'))return true;return false;}function ctLandmarkIsScopedHeaderOrFooter(el){var tag=el.tagName.toLowerCase();if(tag!=="header"&&tag!=="footer")return false;var parent=el.parentElement;while(parent&&parent!==document.body&&parent!==document.documentElement){var pTag=parent.tagName.toLowerCase();if(pTag==="article"||pTag==="aside"||pTag==="main"||pTag==="nav"||pTag==="section")return true;parent=parent.parentElement;}return false;}function ctLandmarkGetRole(el){var explicit=(el.getAttribute("role")||"").trim().split(/\s+/)[0].toLowerCase();if(explicit){if(explicit==="none"||explicit==="presentation")return null;return CT_LANDMARK_ROLES[explicit]?explicit:null;}var tag=el.tagName.toLowerCase();if(tag==="main")return "main";if(tag==="nav")return "navigation";if(tag==="aside")return "complementary";if(tag==="header"&&!ctLandmarkIsScopedHeaderOrFooter(el))return "banner";if(tag==="footer"&&!ctLandmarkIsScopedHeaderOrFooter(el))return "contentinfo";if(tag==="section"||tag==="form")return tag==="section"?"region":"form";return null;}function ctLandmarkIsLandmark(el,role,name){if(!role||!CT_LANDMARK_ROLES[role])return false;if(CT_ALWAYS_LANDMARK[role])return true;return !!ctLandmarkNormalizeName(name);}function ctLandmarkHeadingLabel(el){var heading=el.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return ctLandmarkVisibleText(heading);}function ctLandmarkIdBasedLabel(el){var id=el.id||"";if(id&&CT_LANDMARK_ID_LABELS[id])return CT_LANDMARK_ID_LABELS[id];var lower=id.toLowerCase();if(lower.indexOf("search-desktop")!==-1||lower.indexOf("searchdesktop")!==-1)return "Desktop search";if(lower.indexOf("search-mobile")!==-1||lower.indexOf("searchmobile")!==-1)return "Mobile search";if(lower.indexOf("lang")!==-1&&(el.getAttribute("role")==="navigation"||el.classList.contains("language-switcher-language-url")))return "Language";if(el.classList.contains("language-switcher-language-url")||el.querySelector(".ct-language-selector__block"))return "Language";if(el.classList.contains("search-block-form")||el.getAttribute("role")==="search"){if(lower.indexOf("mobile")!==-1||(el.id&&el.id.indexOf("mobile")!==-1))return "Mobile search";if(lower.indexOf("desktop")!==-1||(el.id&&el.id.indexOf("desktop")!==-1))return "Desktop search";
375if(el.closest(".navbar-bottom-items, .ct-header__desktop, .desktop"))return "Desktop search";if(el.closest(".ct-header__mobile, .mobile-nav, .navbar-toggler, .offcanvas"))return "Mobile search";}return "";}function ctLandmarkRoleFallbackLabel(role){switch(role){case "search":return "Search";case "navigation":return "Navigation";case "banner":return "Header";case "contentinfo":return "Footer";case "complementary":return "Complementary";case "main":return "Main content";case "form":return "Form";case "region":return "Region";default:return "Landmark";}}function ctLandmarkSuggestBaseName(el,role,currentName){var fromId=ctLandmarkIdBasedLabel(el);if(fromId)return fromId;var fromHeading=ctLandmarkHeadingLabel(el);if(fromHeading)return fromHeading;if(currentName)return currentName;if(el.id){var crumb=el.id.replace(/^block-ct-?/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(crumb)return crumb.charAt(0).toUpperCase()+crumb.slice(1);}return ctLandmarkRoleFallbackLabel(role);}function ctLandmarkAllocateUniqueName(baseName,usedSet){var candidate=baseName.replace(/\s+/g," ").trim()||"Landmark";var key=ctLandmarkNormalizeName(candidate);var n=2;while(usedSet[key]){candidate=baseName.replace(/\s+/g," ").trim()+" ("+n+")";key=ctLandmarkNormalizeName(candidate);n+=1;}usedSet[key]=true;return candidate;}function ctLandmarkStoreOriginals(el){if(el.hasAttribute(CT_LANDMARK_MANAGED))return;el.setAttribute(CT_LANDMARK_ORIG_LABEL,el.hasAttribute("aria-label")?el.getAttribute("aria-label"):"");el.setAttribute(CT_LANDMARK_ORIG_LABELLEDBY,el.hasAttribute("aria-labelledby")?el.getAttribute("aria-labelledby"):"");el.setAttribute(CT_LANDMARK_MANAGED,"1");}function ctLandmarkRestoreOriginal(el){if(!el.hasAttribute(CT_LANDMARK_MANAGED))return;var ol=el.getAttribute(CT_LANDMARK_ORIG_LABEL);var olb=el.getAttribute(CT_LANDMARK_ORIG_LABELLEDBY);if(ol===""||ol===null)el.removeAttribute("aria-label");else el.setAttribute("aria-label",ol);if(olb===""||olb===null)el.removeAttribute("aria-labelledby");else el.setAttribute("aria-labelledby",olb);}function ctLandmarkClearManagedTracking(el){el.removeAttribute(CT_LANDMARK_MANAGED);el.removeAttribute(CT_LANDMARK_ORIG_LABEL);el.removeAttribute(CT_LANDMARK_ORIG_LABELLEDBY);}function ctLandmarkApplyUniqueLabel(el,name){ctLandmarkStoreOriginals(el);if(el.hasAttribute("aria-labelledby"))el.removeAttribute("aria-labelledby");el.setAttribute("aria-label",name);}function ctLandmarkCollect(root){var nodes=root.querySelectorAll(CT_LANDMARK_CANDIDATE_SELECTOR);var list=[];for(var i=0;i<nodes.length;i++){var el=nodes[i];if(ctLandmarkIsA11yHidden(el))continue;var role=ctLandmarkGetRole(el);if(!role)continue;var name=ctLandmarkGetAccessibleName(el);if(!ctLandmarkIsLandmark(el,role,name))continue;list.push({el,role,name,nameKey:ctLandmarkNormalizeName(name)});}return list;}function ctUniquifyLandmarks(){var root=document;var previouslyManaged=root.querySelectorAll("["+CT_LANDMARK_MANAGED+"]");for(var r=0;r<previouslyManaged.length;r++)ctLandmarkRestoreOriginal(previouslyManaged[r]);var landmarks=ctLandmarkCollect(root);var groups={};for(var i=0;i<landmarks.length;i++){var item=landmarks[i];var gKey=item.role+"\0"+item.nameKey;if(!groups[gKey])groups[gKey]=[];groups[gKey].push(item);}Object.keys(groups).forEach(function(gKey){var group=groups[gKey];if(group.length<2)return;var role=group[0].role;var emptyName=!group[0].nameKey;var used={};for(var u=0;u<landmarks.length;u++){var other=landmarks[u];if(other.role!==role)continue;var inGroup=false;for(var g=0;g<group.length;g++)if(group[g].el===other.el){inGroup=true;break;}if(inGroup)continue;if(other.nameKey)used[other.nameKey]=true;}for(var j=0;j<group.length;j++){var entry=group[j];var mustRename=emptyName||j>0;if(!mustRename){if(entry.nameKey)used[entry.nameKey]=true;continue;}var base=ctLandmarkSuggestBaseName(entry.el,role,entry.name);if(!emptyName&&j>0&&ctLandmarkNormalizeName(base)===entry.nameKey){var heading=ctLandmarkHeadingLabel(entry.el);var idLabel=ctLandmarkIdBasedLabel(entry.el);if(idLabel&&ctLandmarkNormalizeName(idLabel)!==entry.nameKey)base=idLabel;else{if(heading&&ctLandmarkNormalizeName(heading)!==entry.nameKey)base=heading;}}var unique=ctLandmarkAllocateUniqueName(base,used);ctLandmarkApplyUniqueLabel(entry.el,unique);entry.el.__ctLandmarkKeepManaged=true;}});for(var k=0;k<previouslyManaged.length;k++){var el=previouslyManaged[k];if(el.__ctLandmarkKeepManaged){delete el.__ctLandmarkKeepManaged;continue;}ctLandmarkClearManagedTracking(el);}var managedNow=root.querySelectorAll("["+CT_LANDMARK_MANAGED+"]");for(var m=0;m<managedNow.length;m++)delete managedNow[m].__ctLandmarkKeepManaged;}function ctLandmarkScheduleUniquify(){if(ctLandmarkUniquifyScheduled)return;ctLandmarkUniquifyScheduled=true;window.requestAnimationFrame(function(){ctLandmarkUniquifyScheduled=false;ctUniquifyLandmarks();});}function ctLandmarkStartObserver(){if(ctLandmarkObserver||!window.MutationObserver||!document.body)return;ctLandmarkObserver=new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++){var mutation=mutations[i];if(mutation.type==="childList"&&(mutation.addedNodes.length||mutation.removedNodes.length)){ctLandmarkScheduleUniquify();return;}if(mutation.type==="attributes"&&(mutation.attributeName==="role"||mutation.attributeName==="aria-label"||mutation.attributeName==="aria-labelledby"||mutation.attributeName==="id"||mutation.attributeName==="aria-hidden"||mutation.attributeName==="hidden")){var t=mutation.target;if(t&&t.hasAttribute&&t.hasAttribute(CT_LANDMARK_MANAGED)&&(mutation.attributeName==="aria-label"||mutation.attributeName==="aria-labelledby"))continue;ctLandmarkScheduleUniquify();return;}}});ctLandmarkObserver.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["role","aria-label","aria-labelledby","id","aria-hidden","hidden"]});}Drupal.behaviors.ctUniqueLandmarkNames={attach(context){once("ctUniqueLandmarkNames","body",context).forEach(function(){ctUniquifyLandmarks();ctLandmarkStartObserver();});if(context&&context!==document&&context.nodeType===1&&context!==document.body&&context!==document.documentElement)ctUniquifyLandmarks();}};window.ctUniquifyLandmarks=ctUniquifyLandmarks;const CT_ARIA_HIDDEN_FOCUS_ATTR="data-ct-aria-hidden-focus";const CT_ARIA_HIDDEN_PREV_TABINDEX="data-ct-aria-hidden-prev-tabindex";const CT_ARIA_HIDDEN_FOCUSABLE=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not
375([tabindex="-1"])'].join(", ");let ctAriaHiddenFocusScheduled=false;let ctAriaHiddenFocusObserver=null;function ctIsAriaHiddenTrue(el){return !!(el&&el.nodeType===1&&el.getAttribute("aria-hidden")==="true");}function ctIsUnderAriaHidden(el){if(!el||el.nodeType!==1)return false;if(ctIsAriaHiddenTrue(el))return true;return typeof el.closest==="function"?!!el.closest('[aria-hidden="true"]'):false;}function ctIsInTabOrder(el){if(!el||el.nodeType!==1)return false;const tabindex=el.getAttribute("tabindex");if(tabindex!==null){const n=Number.parseInt(tabindex,10);return !Number.isNaN(n)&&n>=0;}try{return el.matches(CT_ARIA_HIDDEN_FOCUSABLE);}catch(e){return false;}}function ctDemoteAriaHiddenFocusable(el){if(!el||el.nodeType!==1||!ctIsInTabOrder(el))return;if(el.getAttribute(CT_ARIA_HIDDEN_FOCUS_ATTR)==="1"&&el.getAttribute("tabindex")==="-1")return;if(el.getAttribute(CT_ARIA_HIDDEN_FOCUS_ATTR)!=="1"){const current=el.getAttribute("tabindex");el.setAttribute(CT_ARIA_HIDDEN_PREV_TABINDEX,current===null?"":current);el.setAttribute(CT_ARIA_HIDDEN_FOCUS_ATTR,"1");}el.setAttribute("tabindex","-1");if(document.activeElement===el&&typeof el.blur==="function")el.blur();}function ctRestoreAriaHiddenFocusable(el){if(!el||el.nodeType!==1)return;if(el.getAttribute(CT_ARIA_HIDDEN_FOCUS_ATTR)!=="1")return;if(ctIsUnderAriaHidden(el))return;const prev=el.getAttribute(CT_ARIA_HIDDEN_PREV_TABINDEX);if(prev===null||prev==="")el.removeAttribute("tabindex");else el.setAttribute("tabindex",prev);el.removeAttribute(CT_ARIA_HIDDEN_PREV_TABINDEX);el.removeAttribute(CT_ARIA_HIDDEN_FOCUS_ATTR);}function ctFixAriaHiddenFocusInRoot(root){if(!root)return;const scope=root.nodeType===9?root.documentElement||root.body:root.nodeType===1?root:null;if(!scope||!scope.querySelectorAll)return;scope.querySelectorAll("["+CT_ARIA_HIDDEN_FOCUS_ATTR+'="1"]').forEach(ctRestoreAriaHiddenFocusable);const hiddenNodes=[];if(ctIsAriaHiddenTrue(scope))hiddenNodes.push(scope);scope.querySelectorAll('[aria-hidden="true"]').forEach((el)=>{hiddenNodes.push(el);});hiddenNodes.forEach((hidden)=>{ctDemoteAriaHiddenFocusable(hidden);hidden.querySelectorAll(CT_ARIA_HIDDEN_FOCUSABLE).forEach((el)=>{ctDemoteAriaHiddenFocusable(el);});});}function ctAriaHiddenFocusScheduleFix(){if(ctAriaHiddenFocusScheduled)return;ctAriaHiddenFocusScheduled=true;window.requestAnimationFrame(()=>{ctAriaHiddenFocusScheduled=false;ctFixAriaHiddenFocusInRoot(document);});}function ctAriaHiddenFocusStartObserver(){if(ctAriaHiddenFocusObserver||!window.MutationObserver||!document.body)return;ctAriaHiddenFocusObserver=new MutationObserver((mutations)=>{for(let i=0;i<mutations.length;i++){const mutation=mutations[i];if(mutation.type==="childList")if(mutation.addedNodes.length||mutation.removedNodes.length){ctAriaHiddenFocusScheduleFix();return;}if(mutation.type==="attributes"&&(mutation.attributeName==="aria-hidden"||mutation.attributeName==="tabindex")){if(mutation.attributeName==="tabindex"&&mutation.target&&mutation.target.getAttribute&&mutation.target.getAttribute(CT_ARIA_HIDDEN_FOCUS_ATTR)==="1")continue;ctAriaHiddenFocusScheduleFix();return;}}});ctAriaHiddenFocusObserver.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:["aria-hidden","tabindex"]});}Drupal.behaviors.ctAriaHiddenFocusFix={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;ctFixAriaHiddenFocusInRoot(scope);once("ctAriaHiddenFocusFix","body",context).forEach(()=>{ctFixAriaHiddenFocusInRoot(document);ctAriaHiddenFocusStartObserver();});}};Drupal.behaviors.ctInputGroupSvgClick={attach(context){once("ctInputGroupSvgClick",".ct-trip-planner-widget .ct-input-group svg.dropdown-icon",context).forEach((svg)=>{svg.style.cursor="pointer";svg.style.pointerEvents="auto";svg.addEventListener("click",(event)=>{event.preventDefault();event.stopPropagation();const group=svg.closest(".ct-input-group");if(!group)return;const field=group.querySelector("input.ct-input, select.ct-input");if(!field)return;field.focus();field.click();if(field.tagName==="SELECT"&&typeof field.showPicker==="function")try{field.showPicker();}catch(e){}if(field._flatpickr&&typeof field._flatpickr.open==="function")field._flatpickr.open();});});}};})(Drupal);(function(Drupal,once){"use strict";const isVisuallyEmpty=(element)=>{if(!element)return false;const textContent=element.textContent.replace(/\u00A0/g," ").replace(/[\u200B\uFEFF]/g,"").trim();const hasVisualContent=element.querySelector(["img","svg","picture","video","audio","iframe","canvas","input","select","textarea","button","object","embed","hr"].join(", "));return textContent===""&&!hasVisualContent;};Drupal.behaviors.ctHideVisuallyEmptyElements={attach(context){once("ct-hide-empty-card-price",".ct-card-price",context).forEach((element)=>{const subtitle=element.querySelector(".sub-title");if(isVisuallyEmpty(subtitle))element.hidden=true;});once("ct-hide-empty-brand-italic-paragraph",'p[data-once~="ctBrand
375ItalicP"]',context).forEach((element)=>{if(isVisuallyEmpty(element))element.hidden=true;});}};const CT_UNLABELLED_SELECTS=["select.ct-entity-multiselect-native","select[data-ct-field-title]",".ct-entity-multiselect-enhanced select",".ct-subscribe-form select[multiple]","#ct-config-forms-routes-wrapper select"].join(", ");const ctCleanLabelText=(value)=>(value||"").replace(/\*/g," ").replace(/\s*\((?:required|optional)\)\s*/gi," ").replace(/\s+/g," ").trim();const ctResolveLabelledByText=(element)=>{const ids=(element.getAttribute("aria-labelledby")||"").trim();if(!ids)return "";return ctCleanLabelText(ids.split(/\s+/).map((id)=>document.getElementById(id)?.textContent||"").join(" "));};const ctLabelNativeSelect=(select)=>{if(ctCleanLabelText(select.getAttribute("aria-label")))return;if(ctResolveLabelledByText(select))return;const formItem=select.closest(".form-item, [class*='form-item-'], .ct-input-group, #ct-config-forms-routes-wrapper");const explicitLabel=select.id?document.querySelector(`label[for="${CSS.escape(select.id)}"]`):null;const emptyOption=Array.from(select.options).find((option)=>!option.value);const accessibleName=ctCleanLabelText(select.getAttribute("data-ct-field-title"))||ctCleanLabelText(explicitLabel?.textContent)||ctCleanLabelText(formItem?.querySelector("label.control-label, label")?.textContent)||ctCleanLabelText(select.getAttribute("title"))||ctCleanLabelText(emptyOption?.textContent)||ctCleanLabelText(select.getAttribute("name")?.replace(/\[\]$/,"").replace(/[_-]+/g," "));if(accessibleName)select.setAttribute("aria-label",accessibleName);};const ctLabelNativeSelects=(scope)=>{if(!scope||(scope.nodeType!==1&&scope.nodeType!==9))return;if(scope.nodeType===1&&scope.matches?.(CT_UNLABELLED_SELECTS))ctLabelNativeSelect(scope);scope.querySelectorAll?.(CT_UNLABELLED_SELECTS)?.forEach((select)=>ctLabelNativeSelect(select));};Drupal.behaviors.ctNativeMultiselectAccessibleName={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;ctLabelNativeSelects(scope);window.setTimeout(()=>ctLabelNativeSelects(document),150);once("ctNativeSelectA11yObserver","body",context).forEach((body)=>{const observer=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{mutation.addedNodes.forEach((node)=>ctLabelNativeSelects(node));});});observer.observe(body,{childList:true,subtree:true});});}};const CT_ARIA_MENU_ITEM_SELECTOR=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]'].join(", ");const ctClearImpliedMenuPopup=(menu)=>{const id=menu.id;if(!id)return;document.querySelectorAll(`[aria-controls="${CSS.escape(id)}"]`).forEach((trigger)=>{const popup=(trigger.getAttribute("aria-haspopup")||"").toLowerCase();if(popup==="true"||popup==="menu")trigger.removeAttribute("aria-haspopup");});};const ctFixBrokenAriaMenu=(menu)=>{if(!menu||menu.getAttribute("role")!=="menu")return;if(menu.querySelector(CT_ARIA_MENU_ITEM_SELECTOR))return;menu.removeAttribute("role");ctClearImpliedMenuPopup(menu);};const ctFixBrokenAriaMenus=(scope)=>{if(!scope||(scope.nodeType!==1&&scope.nodeType!==9))return;if(scope.nodeType===1&&scope.matches?.('[role="menu"]'))ctFixBrokenAriaMenu(scope);scope.querySelectorAll?.('[role="menu"]')?.forEach((menu)=>ctFixBrokenAriaMenu(menu));};Drupal.behaviors.ctBrokenAriaMenuFix={attach(context){const scope=context&&(context.nodeType===1||context.nodeType===9)?context:document;ctFixBrokenAriaMenus(scope);once("ctBrokenAriaMenuObserver","body",context).forEach((body)=>{const observer=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{mutation.addedNodes.forEach((node)=>ctFixBrokenAriaMenus(node));});});observer.observe(body,{childList:true,subtree:true});});}};})(Drupal,once);; 376(function(){'use strict';const MOBILE_BREAKPOINT=767;const SELECT_CLASS='ct-mobile-tab-select';const SELECT_WRAPPER_CLASS='ct-mobile-tab-select-wrapper';const TAB_NAV_BOUND_ATTR='data-ct-vtabs-mobile-bound';function escapeSelectorAttr(value){if(typeof CSS!=='undefined'&&typeof CSS.escape==='function')return CSS.escape(value);return String(value).replace(/\\/g,'\\\\').replace(/"/g,'\\"');}function isMobile(){return window.innerWidth<=MOBILE_BREAKPOINT;}function getBootstrapTab(){const root=typeof window!=='undefined'?window:globalThis;return root.bootstrap&&root.bootstrap.Tab?root.bootstrap.Tab:null;}function switchTabManual(tabButton){const targetSel=tabButton.getAttribute('data-bs-target');if(!targetSel)return;
376const pane=document.querySelector(targetSel);if(!pane)return;const tabNav=tabButton.closest('.nav-pills[aria-orientation="vertical"]');const tabContent=pane.closest('.tab-content');if(!tabNav||!tabContent)return;tabNav.querySelectorAll('.nav-link').forEach(function(btn){btn.classList.remove('active');btn.setAttribute('aria-selected','false');});tabButton.classList.add('active');tabButton.setAttribute('aria-selected','true');tabContent.querySelectorAll('.tab-pane').forEach(function(p){p.classList.remove('show','active');});pane.classList.add('show','active');}function createSelectFromTabs(tabNav){const tabId=tabNav.getAttribute('id');const tabButtons=tabNav.querySelectorAll('.nav-link');if(tabButtons.length===0)return null;const wrapper=document.createElement('div');wrapper.className=SELECT_WRAPPER_CLASS;wrapper.setAttribute('data-tab-nav-id',tabId);const select=document.createElement('select');select.className=SELECT_CLASS;const tabContent=tabNav.nextElementSibling;const tabContentId=tabContent&&tabContent.classList.contains('tab-content')?tabContent.getAttribute('id'):'';const tabLabel=tabNav.closest('.ct-vertical-tab-wrap')?.previousElementSibling?.querySelector('h2')?.textContent?.trim()||'Tab';select.setAttribute('aria-label',`Select ${tabLabel} option`);if(tabContentId)select.setAttribute('aria-controls',tabContentId);tabButtons.forEach((button,index)=>{const option=document.createElement('option');option.value=button.getAttribute('id');option.textContent=button.textContent.trim();if(button.classList.contains('active'))option.selected=true;select.appendChild(option);});wrapper.appendChild(select);return wrapper;}function switchTabFromSelect(select){const selectedOption=select.options[select.selectedIndex];if(!selectedOption)return;const tabButtonId=selectedOption.value;const tabButton=document.getElementById(tabButtonId);if(!tabButton)return;const TabCtor=getBootstrapTab();if(TabCtor)try{if(typeof TabCtor.getOrCreateInstance==='function')TabCtor.getOrCreateInstance(tabButton).show();else new TabCtor(tabButton).show();return;}catch(e){}switchTabManual(tabButton);}function updateSelectFromTab(tabNav,select){const activeButton=tabNav.querySelector('.nav-link.active');if(activeButton&&select){const activeButtonId=activeButton.getAttribute('id');const option=Array.from(select.options).find((opt)=>opt.value===activeButtonId);if(option)select.value=activeButtonId;}}function initMobileSelect(tabNav){const tabId=tabNav.getAttribute('id');if(!tabId)return;const selectWrapper=document.querySelector(`.${SELECT_WRAPPER_CLASS}[data-tab-nav-id="${escapeSelectorAttr(tabId)}"]`);const shouldBind=tabNav.getAttribute(TAB_NAV_BOUND_ATTR)!=='true';if(!selectWrapper){const createdWrapper=createSelectFromTabs(tabNav);if(createdWrapper){tabNav.parentNode.insertBefore(createdWrapper,tabNav);if(shouldBind){bindSelectEvents(tabNav,createdWrapper.querySelector('select'));tabNav.setAttribute(TAB_NAV_BOUND_ATTR,'true');}}}else{const select=selectWrapper.querySelector('select');if(select&&shouldBind){bindSelectEvents(tabNav,select);tabNav.setAttribute(TAB_NAV_BOUND_ATTR,'true');}}if(isMobile()){tabNav.style.display='none';tabNav.setAttribute('aria-hidden','true');}else{tabNav.style.display='';tabNav.removeAttribute('aria-hidden');}}function bindSelectEvents(tabNav,select){if(!select)return;const newSelect=select.cloneNode(true);select.parentNode.replaceChild(newSelect,select);newSelect.addEventListener('change',function(){switchTabFromSelect(this);});tabNav.querySelectorAll('.nav-link').forEach((button)=>{button.addEventListener('shown.bs.tab',function(){updateSelectFromTab(tabNav,newSelect);});});}function initInContext(context){const root=context&&context.querySelectorAll?context:document;const tabNavs=root.querySelectorAll('.nav-pills[aria-orientation="vertical"]');tabNavs.forEach(function(tabNav){if(context&&context!==document&&typeof context.contains==='function'&&!context.contains(tabNav))return;initMobileSelect(tabNav);});}let resizeTimeout;function handleResize(){clearTimeout(resizeTimeout);resizeTimeout=setTimeout(function(){initInContext(document);},150);}let globalListenersAttached=false;function setupGlobalListenersOnce(){if(globalListenersAttached)return;globalListenersAttached=true;window.addEventListener('resize',handleResize);document.addEventListener('shown.bs.tab',function(event){const tabButton=event.target;if(tabButton&&tabButton.classList.contains('nav-link')){const tabNav=tabButton.closest('.nav-pills[aria-orientation="vertical"]');if(tabNav){const tid=tabNav.getAttribute('id');if(!tid)return;const selectWrapper=document.querySelector(`.${SELECT_WRAPPER_CLASS}[data-tab-nav-id="${escapeSelectorAttr(tid)}"]`);if(selectWrapper){const sel=selectWrapper.querySelector('select');updateSelectFromTab(tabNav,sel);}}}});}
376function init(){setupGlobalListenersOnce();if(typeof Drupal!=='undefined'&&Drupal.behaviors)Drupal.behaviors.ctVerticalTabsMobileSelect={attach:function(context){initInContext(context);}};else if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',function(){initInContext(document);});else initInContext(document);}init();})();; 377(function(Drupal,drupalSettings){"use strict";function i18n(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.t==="function")return window.CTI18n.t("where-to-buy",key,vars,fallback);return typeof fallback==="string"?fallback:key;}function i18nHtml(key,fallback){if(window.CTI18n&&typeof window.CTI18n.html==="function")return window.CTI18n.html("where-to-buy",key,fallback);return typeof fallback==="string"?fallback:"";}const settings=typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{};const API_BASE_URL="https://cttransit.alerts.api.exemplifi.io/api/v1";const API_HEADERS={Accept:"application/json","X-API-KEY":"sk_live_SOdoS2lNrADb82dOIDtRcz_t33L3Zx0t"};function isLocalEnvironment(){return (window.location.protocol==="file:"||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"||window.location.hostname===""||window.location.hostname.includes("localhost"));}function getApiBaseUrl(){let baseUrl=settings?.cttransit?.apiBaseUrl||window.drupalSettings?.cttransit?.apiBaseUrl;if(!baseUrl||!String(baseUrl).includes("/api/v1"))baseUrl=API_BASE_URL;return baseUrl;}function getApiUrl(endpoint){const baseUrl=getApiBaseUrl();const fullUrl=baseUrl?`${baseUrl}${endpoint}`:endpoint;const useCorsProxy=isLocalEnvironment()&&settings?.cttransit?.useCorsProxy!==false&&window.drupalSettings?.cttransit?.useCorsProxy!==false;if(useCorsProxy&&baseUrl){const corsProxy=settings?.cttransit?.corsProxyUrl||window.drupalSettings?.cttransit?.corsProxyUrl||"https://corsproxy.io/?";return `${corsProxy}${encodeURIComponent(fullUrl)}`;}return fullUrl;}function normalizeRetailerData(input){let raw=input;if(typeof raw==="string")try{raw=JSON.parse(raw);}catch(e){raw={};}for(let i=0;i<4;i++){if(!raw||typeof raw!=="object"||Array.isArray(raw))break;if(raw.data)raw=raw.data;else if(raw.result)raw=raw.result;else if(raw.payload)raw=raw.payload;else if(raw.response)raw=raw.response;else break;}if(Array.isArray(raw))raw={merchants:raw};raw=raw&&typeof raw==="object"?raw:{};const rawMerchants=Array.isArray(raw.merchants)?raw.merchants:[];const merchants=rawMerchants.map(function(m){const name=m?.name??m?.merchantName??"";const rawLocations=Array.isArray(m?.locations)?m.locations:[];const locations=rawLocations.map(function(loc){const rawLat=loc?.lat??loc?.latitude??loc?.Latitude??loc?.y??null;const rawLng=loc?.lng??loc?.lon??loc?.long??loc?.longitude??loc?.Longitude??loc?.x??null;return {merchant:loc?.merchant??name??"",location_id:loc?.location_id??loc?.locationId??null,address:loc?.address??"",city:loc?.city??"",state:loc?.state??"",zip:loc?.zip??"",product_description:loc?.product_description??loc?.productDescription??null,lat:rawLat!==null&&rawLat!==""&&!Number.isNaN(Number(rawLat))?Number(rawLat):null,lng:rawLng!==null&&rawLng!==""&&!Number.isNaN(Number(rawLng))?Number(rawLng):null};});const locationCount=typeof m?.location_count==="number"?m.location_count:typeof m?.locationCount==="number"?m.locationCount:locations.length;return {name,location_count:locationCount,locations};});const totalMerchants=merchants.length;const totalLocations=merchants.reduce(function(sum,merchant){const locations=Array.isArray(merchant?.locations)?merchant.locations:[];return sum+locations.length;},0);return {metadata:{total_merchants:totalMerchants,total_locations:totalLocations},merchants};}function loadGoogleMaps(){if(window.google&&window.google.maps)return Promise.resolve(window.google.maps);return new Promise(function(resolve,reject){let attempts=0;const maxAttempts=50;const checkInterval=setInterval(function(){attempts++;if(window.google&&window.google.maps){clearInterval(checkInterval);resolve(window.google.maps);}else{if(attempts>=maxAttempts){clearInterval(checkInterval);reject(new Error("Google Maps API failed to load"));}}},100);});}function isValidLatLng(lat,lng){return (Number.isFinite(lat)&&Number.isFinite(lng)&&Math.abs(lat)<=90&&Math.abs(lng)<=180);}function normalizeProvidedCoords(lat,lng){if(!isValidLatLng(lat,lng))return null;const looksSwapped=Math.abs(lat)>60&&Math.abs(lng)<=90;if(looksSwapped&&isValidLatLng(lng,lat))return {lat:lng,lng:lat};return {lat,lng};}function getFallbackPosition(index){const i=Number(index||0);const angle=i*2.399963229728653;const radius=0.002+(i%25)*0.00035;return {lat:41.7658+Math.cos(angle)*radius,lng:-72.6734+Math.sin(angle)*radius};}function resolveLocationPosition(providedLat,providedLng,fallbackIndex,address,city,state,zip){const normalizedCoords=normalizeProvidedCoords(providedLat,providedLng);if(normalizedCoords)return normalizedCoords;
377const fullAddress=[address,city,state,zip].filter(Boolean).join(", ");console.warn("Missing/invalid lat-lng in where-to-buy payload:",fullAddress);return getFallbackPosition(fallbackIndex);}function makeLocationKey(merchantName,merchantIndex,locIndex){return `${merchantName||"merchant"}-${merchantIndex}-${locIndex}`;}function createMapController(retailerData){const DEFAULT_CENTER={lat:41.7658,lng:-72.6734};const DEFAULT_ZOOM=15;const records=[];const recordsByKey=Object.create(null);(retailerData&&Array.isArray(retailerData.merchants)?retailerData.merchants:[]).forEach(function(merchant,merchantIndex){const locations=Array.isArray(merchant.locations)?merchant.locations:[];locations.forEach(function(location,locIndex){const key=makeLocationKey(merchant.name,merchantIndex,locIndex);const record={key,merchantIndex,locIndex,location,merchantName:merchant.name,checkbox:null,marker:null,position:null,visible:true};records.push(record);recordsByKey[key]=record;});});const controller={map:null,mapsApi:null,infoWindow:null,fullBounds:null,highlightLocationInSidebar:null,records};function isAdvancedMarker(marker){const mapsApi=controller.mapsApi;return !!(marker&&mapsApi&&mapsApi.marker&&mapsApi.marker.AdvancedMarkerElement&&marker instanceof mapsApi.marker.AdvancedMarkerElement);}function applyMarkerVisibility(record){if(!record||!record.marker)return;const visible=!!record.visible;const marker=record.marker;const map=controller.map;if(isAdvancedMarker(marker)||(marker&&marker.content))marker.map=visible?map:null;if(typeof marker.setMap==="function")marker.setMap(visible?map:null);if(typeof marker.setVisible==="function")marker.setVisible(visible);}controller.getRecord=function(merchantIndex,locIndex){const merchants=retailerData&&retailerData.merchants;const merchant=merchants&&merchants[merchantIndex];return (recordsByKey[makeLocationKey(merchant&&merchant.name,merchantIndex,locIndex)]||null);};controller.getRecordByKey=function(locationKey){return locationKey?recordsByKey[locationKey]||null:null;};controller.bindCheckbox=function(record,checkbox){if(!record||!checkbox)return;record.checkbox=checkbox;checkbox._ctWhereToBuyRecord=record;record.visible=!!checkbox.checked;};controller.bindMarker=function(record,marker,position){if(!record)return;record.marker=marker;record.position=position;applyMarkerVisibility(record);};controller.setRecordVisible=function(record,isVisible){if(!record)return;record.visible=!!isVisible;applyMarkerVisibility(record);};controller.setVisibilityFromCheckbox=function(checkbox){const record=checkbox&&checkbox._ctWhereToBuyRecord;if(!record)return null;record.visible=!!checkbox.checked;applyMarkerVisibility(record);return record;};controller.fitToVisible=function(){const map=controller.map;const mapsApi=controller.mapsApi;if(!map||!mapsApi)return;const allBounds=new mapsApi.LatLngBounds();let visibleCount=0;records.forEach(function(record){if(record.checkbox)record.visible=!!record.checkbox.checked;applyMarkerVisibility(record);if(record.visible&&record.position){allBounds.extend(record.position);visibleCount++;}});if(visibleCount===0){const fallbackBounds=controller.fullBounds;const center=fallbackBounds&&typeof fallbackBounds.isEmpty==="function"&&!fallbackBounds.isEmpty()?fallbackBounds.getCenter():DEFAULT_CENTER;map.setCenter(center);map.setZoom(DEFAULT_ZOOM);return;}if(visibleCount===1){map.setCenter(allBounds.getCenter());map.setZoom(DEFAULT_ZOOM);return;}map.fitBounds(allBounds,48);};return controller;}function buildSidebar(retailerData,onLocationClick,mapController){const sidebar=document.createElement("div");sidebar.className="ct-where-to-buy-sidebar";sidebar.setAttribute("role","complementary");sidebar.setAttribute("aria-label",i18n("sidebarAriaLabel",null,"Retail locations by merchant"));const allMerchantCheckboxes=[];const allLocationCheckboxes=[];const sidebarHeader=document.createElement("div");sidebarHeader.className="ct-where-to-buy-sidebar-header";sidebarHeader.innerHTML=` 378 <div class="ct-where-to-buy-sidebar-header-main"> 379 <h2 class="ct-where-to-buy-sidebar-title">${i18n("retailLocationsTitle",null,"Retail Locations")}</h2> 380 <p class="ct-where-to-buy-sidebar-subtitle">${i18n("locationsAcrossSummary",{locations:retailerData.metadata.total_locations,merchants:retailerData.metadata.total_merchants},`${retailerData.metadata.total_locations} locations across ${retailerData.metadata.total_merchants} merchants`)}</p> 381 </div>
382 <div class="ct-where-to-buy-sidebar-header-controls"> 383 <label class="ct-where-to-buy-select-all-label"> 384 <input 385 type="checkbox" 386 class="ct-where-to-buy-select-all-checkbox" 387 checked 388 aria-label="${i18n("selectAllAriaLabel",null,"Select or unselect all retail location pins")}" 389 /> 390 <span>${i18n("selectAll",null,"Select all")}</span> 391 </label> 392 </div> 393 `;const sidebarContent=document.createElement("div");sidebarContent.className="ct-where-to-buy-sidebar-content";sidebarContent.setAttribute("role","region");sidebarContent.setAttribute("aria-label",i18n("merchantGroupsAriaLabel",null,"Merchant groups"));const selectAllCheckbox=sidebarHeader.querySelector(".ct-where-to-buy-select-all-checkbox");function fitMapToVisibleLocations(){if(mapController&&typeof mapController.fitToVisible==="function")mapController.fitToVisible();}retailerData.merchants.forEach(function(merchant,index){const merchantPanel=document.createElement("div");merchantPanel.className="ct-where-to-buy-merchant-panel";merchantPanel.setAttribute("data-merchant",merchant.name);const panelId=`merchant-panel-${index}`;const headerId=`merchant-header-${index}`;const panelHeaderRow=document.createElement("div");panelHeaderRow.className="ct-where-to-buy-merchant-header-row";const panelHeader=document.createElement("button");panelHeader.type="button";panelHeader.className="ct-where-to-buy-merchant-header";panelHeader.id=headerId;panelHeader.setAttribute("aria-expanded","false");panelHeader.setAttribute("aria-controls",panelId);panelHeader.setAttribute("aria-label",i18n("toggleMerchantPanel",{name:merchant.name},`Toggle ${merchant.name} locations panel`));const headerContent=document.createElement("div");headerContent.className="ct-where-to-buy-merchant-header-content";const locationWord=merchant.location_count!==1?i18n("locationPlural",null,"locations"):i18n("locationSingular",null,"location");headerContent.innerHTML=` 394 <span class="ct-where-to-buy-merchant-name">${merchant.name}</span> 395 <span class="ct-where-to-buy-merchant-count">${i18n("merchantLocationCount",{count:merchant.location_count,locationWord},`${merchant.location_count} ${locationWord}`)}</span> 396 `;const merchantCheckboxWrapper=document.createElement("div");merchantCheckboxWrapper.className="ct-where-to-buy-merchant-checkbox-wrapper";const merchantCheckboxLabel=document.createElement("label");merchantCheckboxLabel.className="ct-where-to-buy-merchant-checkbox-label";const merchantCheckbox=document.createElement("input");merchantCheckbox.type="checkbox";merchantCheckbox.className="ct-where-to-buy-merchant-checkbox";merchantCheckbox.checked=true;merchantCheckbox.setAttribute("aria-label",i18n("toggleMerchantVisibility",{name:merchant.name},`Toggle visibility for all ${merchant.name} locations on the map`));merchantCheckboxLabel.appendChild(merchantCheckbox);merchantCheckboxWrapper.appendChild(merchantCheckboxLabel);allMerchantCheckboxes.push(merchantCheckbox);const merchantLocationCheckboxes=[];const headerIcon=document.createElement("span");headerIcon.className="ct-where-to-buy-merchant-icon";headerIcon.setAttribute("aria-hidden","true");headerIcon.innerHTML=` 397 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 398 <path d="M12 5v14M5 12h14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> 399 </svg> 400 `;panelHeader.appendChild(headerContent);panelHeader.appendChild(headerIcon);panelHeaderRow.appendChild(merchantCheckboxWrapper);panelHeaderRow.appendChild(panelHeader);const panelContent=document.createElement("div");panelContent.className="ct-where-to-buy-merchant-content";panelContent.id=panelId;panelContent.setAttribute("aria-labelledby",headerId);panelContent.hidden=true;const locationsList=document.createElement("ul");locationsList.className="ct-where-to-buy-locations-list";locationsList.setAttribute("role","list");merchant.locations.forEach(function(location,locIndex){const locationItem=document.createElement("li");
400locationItem.className="ct-where-to-buy-location-item";locationItem.setAttribute("role","listitem");locationItem.setAttribute("data-location-id",makeLocationKey(merchant.name,index,locIndex));const locationCheckbox=document.createElement("input");locationCheckbox.type="checkbox";locationCheckbox.className="ct-where-to-buy-location-checkbox";locationCheckbox.checked=true;const locationButton=document.createElement("button");locationButton.type="button";locationButton.className="ct-where-to-buy-location-button";const fullAddress=`${location.address}, ${location.city}, ${location.state} ${location.zip}`;locationButton.setAttribute("aria-label",i18n("viewLocationOnMap",{merchant:location.merchant,address:fullAddress},`View ${location.merchant} at ${fullAddress} on map`));locationCheckbox.setAttribute("aria-label",i18n("toggleLocationVisibility",{merchant:location.merchant,address:fullAddress},`Toggle visibility for ${location.merchant} at ${fullAddress} on the map`));locationButton.innerHTML=` 401 <div class="ct-where-to-buy-location-address"> 402 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 403 <path d="M8 8a2 2 0 100-4 2 2 0 000 4z" stroke="#33414F" stroke-width="1.5"/> 404 <path d="M8 14s5-4 5-7.5a5 5 0 10-10 0C3 10 8 14 8 14z" stroke="#33414F" stroke-width="1.5"/> 405 </svg> 406 <span>${fullAddress}</span> 407 </div> 408 ${location.product_description?`<div class="ct-where-to-buy-location-product">${location.product_description}</div>`:""} 409 `;const locationRow=document.createElement("div");locationRow.className="ct-where-to-buy-location-row";const locationInfo=document.createElement("div");locationInfo.className="ct-where-to-buy-location-info";const locationCheckboxLabel=document.createElement("label");locationCheckboxLabel.className="ct-where-to-buy-location-checkbox-label";locationCheckboxLabel.appendChild(locationCheckbox);locationInfo.appendChild(locationCheckboxLabel);locationInfo.appendChild(locationButton);locationRow.appendChild(locationInfo);locationItem.appendChild(locationRow);locationsList.appendChild(locationItem);allLocationCheckboxes.push(locationCheckbox);merchantLocationCheckboxes.push(locationCheckbox);const locationRecord=mapController&&mapController.getRecord?mapController.getRecord(index,locIndex):null;if(mapController&&mapController.bindCheckbox&&locationRecord)mapController.bindCheckbox(locationRecord,locationCheckbox);function handleLocationToggle(){const isChecked=!!locationCheckbox.checked;if(mapController&&mapController.setVisibilityFromCheckbox)mapController.setVisibilityFromCheckbox(locationCheckbox);else{if(mapController&&mapController.setRecordVisible&&locationRecord)mapController.setRecordVisible(locationRecord,isChecked);}if(isChecked){if(mapController&&mapController.highlightLocationInSidebar)mapController.highlightLocationInSidebar(locationItem.getAttribute("data-location-id"));}else{locationItem.classList.remove("is-active");if(mapController&&mapController.infoWindow)mapController.infoWindow.close();}fitMapToVisibleLocations();const allChecked=merchantLocationCheckboxes.every((cb)=>cb.checked);const noneChecked=merchantLocationCheckboxes.every((cb)=>!cb.checked);merchantCheckbox.checked=allChecked;merchantCheckbox.indeterminate=!allChecked&&!noneChecked;if(selectAllCheckbox){const allGlobalChecked=allLocationCheckboxes.every((cb)=>cb.checked);const noneGlobalChecked=allLocationCheckboxes.every((cb)=>!cb.checked);selectAllCheckbox.checked=allGlobalChecked;selectAllCheckbox.indeterminate=!allGlobalChecked&&!noneGlobalChecked;}}locationCheckboxLabel.addEventListener("click",function(event){event.stopPropagation();});locationCheckbox.addEventListener("click",function(event){event.stopPropagation();});locationCheckbox.addEventListener("change",function(event){event.stopPropagation();handleLocationToggle();});locationButton.addEventListener("click",function(event){event.preventDefault();if(!locationCheckbox.checked)return;const locationKey=locationItem.getAttribute("data-location-id");if(mapController&&mapController.highlightLocationInSidebar)mapController.highlightLocationInSidebar(locationKey);if(typeof onLocationClick==="function")onLocationClick(location,merchant.name,index,locIndex);});});panelContent.appendChild(locationsList);merchantPanel.appendChild(panelHeaderRow);
409merchantPanel.appendChild(panelContent);sidebarContent.appendChild(merchantPanel);panelHeader.addEventListener("click",function(){panelContent.hidden=!panelContent.hidden;panelHeader.setAttribute("aria-expanded",(!panelContent.hidden).toString());const iconPath=headerIcon.querySelector("svg path");if(panelContent.hidden)iconPath.setAttribute("d","M12 5v14M5 12h14");else iconPath.setAttribute("d","M5 12h14");});merchantCheckbox.addEventListener("change",function(){const isChecked=merchantCheckbox.checked;merchantCheckbox.indeterminate=false;merchantLocationCheckboxes.forEach(function(cb){cb.checked=isChecked;if(mapController&&mapController.setVisibilityFromCheckbox)mapController.setVisibilityFromCheckbox(cb);});if(!isChecked&&mapController&&mapController.infoWindow)mapController.infoWindow.close();fitMapToVisibleLocations();if(selectAllCheckbox){const allGlobalChecked=allLocationCheckboxes.every((cb)=>cb.checked);const noneGlobalChecked=allLocationCheckboxes.every((cb)=>!cb.checked);selectAllCheckbox.checked=allGlobalChecked;selectAllCheckbox.indeterminate=!allGlobalChecked&&!noneGlobalChecked;}});});if(selectAllCheckbox)selectAllCheckbox.addEventListener("change",function(){const isChecked=selectAllCheckbox.checked;selectAllCheckbox.indeterminate=false;allMerchantCheckboxes.forEach(function(cb){cb.checked=isChecked;cb.indeterminate=false;});allLocationCheckboxes.forEach(function(cb){cb.checked=isChecked;if(mapController&&mapController.setVisibilityFromCheckbox)mapController.setVisibilityFromCheckbox(cb);});if(mapController&&mapController.infoWindow)mapController.infoWindow.close();fitMapToVisibleLocations();});sidebar.appendChild(sidebarHeader);sidebar.appendChild(sidebarContent);return sidebar;}function buildMap(container,retailerData,mapController){return loadGoogleMaps().then(function(maps){const styledMapType=new maps.StyledMapType([{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9e7f7"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],{name:"Styled Map"});const DEFAULT_CENTER={lat:41.7658,lng:-72.6734};const DEFAULT_ZOOM=15;const map=new maps.Map(container,{center:DEFAULT_CENTER,zoom:DEFAULT_ZOOM,mapId:"ct-transit-where-to-buy-map",mapTypeControl:false,streetViewControl:false,fullscreenControl:true,mapTypeControlOptions:{mapTypeIds:["styled_map"]}});map.mapTypes.set("styled_map",styledMapType);map.setMapTypeId("styled_map");if(mapController){mapController.map=map;mapController.mapsApi=maps;}container.setAttribute("role","application");container.setAttribute("aria-label",i18n("ariaInteractiveMap",{count:retailerData.metadata.total_locations},`Interactive map showing ${retailerData.metadata.total_locations} retail locations`));const bounds=new maps.LatLngBounds();const infoWindow=new maps.InfoWindow();const markers=[];const locationMarkers={};let geocodePromises=[];
409retailerData.merchants.forEach(function(merchant,merchantIndex){merchant.locations.forEach(function(location,locIndex){const locationKey=makeLocationKey(merchant.name,merchantIndex,locIndex);const geocodePromise=Promise.resolve().then(function(){const position=resolveLocationPosition(location.lat,location.lng,merchantIndex*10000+locIndex,location.address,location.city,location.state,location.zip);bounds.extend(position);const markerDiv=document.createElement("div");markerDiv.className="ct-where-to-buy-marker";markerDiv.innerHTML=` 410 <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> 411 <circle cx="16" cy="16" r="14" fill="#003E7E" stroke="#FFFFFF" stroke-width="3"/> 412 <circle cx="16" cy="16" r="6" fill="#FFFFFF"/> 413 </svg> 414 `;let marker;if(maps.marker&&maps.marker.AdvancedMarkerElement)marker=new maps.marker.AdvancedMarkerElement({map,position,content:markerDiv,title:`${location.merchant} - ${location.address}`});else{const canvas=document.createElement("canvas");canvas.width=32;canvas.height=32;const ctx=canvas.getContext("2d");ctx.beginPath();ctx.arc(16,16,14,0,2*Math.PI);ctx.fillStyle="#003E7E";ctx.fill();ctx.strokeStyle="#FFFFFF";ctx.lineWidth=3;ctx.stroke();ctx.beginPath();ctx.arc(16,16,6,0,2*Math.PI);ctx.fillStyle="#FFFFFF";ctx.fill();marker=new maps.Marker({map,position,title:`${location.merchant} - ${location.address}`,icon:{url:canvas.toDataURL(),scaledSize:new maps.Size(32,32),anchor:new maps.Point(16,16)}});}const clickHandler=function(){showInfoWindow(marker,location,merchant.name);highlightLocationInSidebar(locationKey);};if(maps.marker&&maps.marker.AdvancedMarkerElement)marker.addListener("click",clickHandler);else if(markerDiv){markerDiv.setAttribute("role","button");markerDiv.setAttribute("tabindex","0");markerDiv.setAttribute("aria-label",i18n("ariaViewLocationDetails",{merchant:location.merchant,address:location.address},`View details for ${location.merchant} at ${location.address}`));markerDiv.addEventListener("keydown",function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();clickHandler();}});}else marker.addListener("click",clickHandler);locationMarkers[locationKey]={marker,location,merchant:merchant.name,position,visible:true};if(mapController&&mapController.bindMarker)mapController.bindMarker(mapController.getRecord(merchantIndex,locIndex),marker,position);markers.push(marker);});geocodePromises.push(geocodePromise);});});if(mapController){mapController.map=map;mapController.mapsApi=maps;mapController.infoWindow=infoWindow;mapController.fullBounds=bounds;}Promise.all(geocodePromises).then(function(){if(mapController&&mapController.fitToVisible){mapController.fitToVisible();return;}if(!bounds.isEmpty())map.fitBounds(bounds,48);});function showInfoWindow(marker,location,merchantName){const fullAddress=`${location.address}, ${location.city}, ${location.state} ${location.zip}`;const content=` 415 <div class="ct-where-to-buy-info-window" role="dialog" aria-label="${i18n("ariaInfoWindow",{name:merchantName},`Retail location information for ${merchantName}`)}"> 416 <h4 class="subtitle">${merchantName}</h4> 417 <div class="ct-where-to-buy-info-details"> 418 <div class="ct-where-to-buy-info-row"> 419 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 420 <path d="M8 8a2 2 0 100-4 2 2 0 000 4z" stroke="#33414F" stroke-width="1.5"/> 421 <path d="M8 14s5-4 5-7.5a5 5 0 10-10 0C3 10 8 14 8 14z" stroke="#33414F" stroke-width="1.5"/> 422 </svg> 423 <span>${fullAddress}</span> 424 </div> 425 ${location.location_id?` 426 <div class="ct-where-to-buy-info-row"> 427 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 428 <rect x="2" y="4" width="12" height="10" rx="1" stroke="#33414F" stroke-width="1.5"/> 429 <path d="M5 2v4M11 2v4" stroke="#33414F" stroke-width="1.5" stroke-linecap="round"/> 430 </svg>
431 <span>${i18n("locationIdLabel",{id:location.location_id},`Location ID: ${location.location_id}`)}</span> 432 </div> 433 `:""} 434 <div class="ct-where-to-buy-info-row"> 435 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 436 <path d="M2 4h12M2 8h12M2 12h8" stroke="#003E7E" stroke-width="1.5" stroke-linecap="round"/> 437 </svg> 438 <span>${location.product_description||i18n("retailLocationFallback",null,"Retail Location")}</span> 439 </div> 440 </div> 441 </div> 442 `;infoWindow.setContent(content);if(maps.marker&&maps.marker.AdvancedMarkerElement)infoWindow.open({map,anchor:marker});else infoWindow.open(map,marker);}function highlightLocationInSidebar(locationKey){const sidebarElement=document.querySelector(".ct-where-to-buy-sidebar");if(!sidebarElement)return;sidebarElement.querySelectorAll(".ct-where-to-buy-location-item.is-active").forEach(function(item){item.classList.remove("is-active");});const locationItem=sidebarElement.querySelector(`[data-location-id="${window.CSS&&typeof window.CSS.escape==="function"?window.CSS.escape(locationKey):locationKey}"]`);if(locationItem){locationItem.classList.add("is-active");locationItem.scrollIntoView({behavior:"smooth",block:"nearest"});const merchantPanel=locationItem.closest(".ct-where-to-buy-merchant-panel");if(merchantPanel){const panelHeader=merchantPanel.querySelector(".ct-where-to-buy-merchant-header");const panelContent=merchantPanel.querySelector(".ct-where-to-buy-merchant-content");if(panelContent.hidden)panelHeader.click();}}}container._map=map;container._infoWindow=infoWindow;container._locationMarkers=locationMarkers;container._showInfoWindow=showInfoWindow;container._highlightLocationInSidebar=highlightLocationInSidebar;if(mapController){mapController.highlightLocationInSidebar=highlightLocationInSidebar;container._setMarkerVisibility=function(locationKey,isVisible){mapController.setRecordVisible(mapController.getRecordByKey(locationKey),isVisible);};container._fitToAllMarkers=mapController.fitToVisible;}container._onLocationClick=function(location,merchantName,merchantIndex,locIndex){const locationKey=makeLocationKey(merchantName,merchantIndex,locIndex);const record=mapController&&mapController.getRecord?mapController.getRecord(merchantIndex,locIndex):null;const markerData=locationMarkers[locationKey];const marker=(record&&record.marker)||(markerData&&markerData.marker);const position=(record&&record.position)||(markerData&&markerData.position);if(marker&&position){map.panTo(position);showInfoWindow(marker,location,merchantName);if(container._highlightLocationInSidebar)container._highlightLocationInSidebar(locationKey);}};container._highlightLocationInSidebar=highlightLocationInSidebar;}).catch(function(error){console.error("Failed to load Google Maps:",error);container.innerHTML=i18nHtml("mapErrorState",'<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>Unable to load the interactive map at this time.</div>');});}function buildWhereToBuyPage(container,retailerData){const wrapper=document.createElement("div");wrapper.className="ct-where-to-buy-wrapper";const mapSection=document.createElement("section");mapSection.className="ct-where-to-buy-map-section";mapSection.setAttribute("role","region");mapSection.setAttribute("aria-label",i18n("mapSectionAriaLabel",null,"Retail locations map"));const mapContainer=document.createElement("div");mapContainer.className="container";const mapRow=document.createElement("div");mapRow.className="row";const mapCol=document.createElement("div");mapCol.className="col-12";const mapHeader=document.createElement("div");mapHeader.className="ct-where-to-buy-map-header";mapHeader.innerHTML=i18nHtml("mapHeader",` 443 <div> 444 <p class="label">FIND A LOCATION</p> 445 <h2>RETAIL LOCATIONS MAP</h2> 446 <p class="body-1">Find CT<i>transit</i> ticket retailers near you. Click on a marker or select a location from the sidebar to view details.</p> 447 </div> 448 `);const mapElement=document.createElement("div");
448mapElement.className="ct-where-to-buy-map";mapElement.setAttribute("data-where-to-buy-map","");mapCol.appendChild(mapHeader);mapCol.appendChild(mapElement);const mapController=createMapController(retailerData);const sidebar=buildSidebar(retailerData,function(location,merchantName,merchantIndex,locIndex){if(mapElement._onLocationClick)mapElement._onLocationClick(location,merchantName,merchantIndex,locIndex);},mapController);mapCol.appendChild(sidebar);mapRow.appendChild(mapCol);mapContainer.appendChild(mapRow);mapSection.appendChild(mapContainer);wrapper.appendChild(mapSection);container.innerHTML="";container.appendChild(wrapper);buildMap(mapElement,retailerData,mapController).then(function(){});}async function initWhereToBuy(context){const root=context&&context!==document?context:document;const container=root.querySelector("[data-ct-where-to-buy]");if(!container)return;if(container.dataset.ctWhereToBuyInitialized==="true")return;container.dataset.ctWhereToBuyInitialized="true";container.innerHTML=i18nHtml("loadingState",'<div class="ct-gtfs-loading"><span aria-hidden="true">â³</span>Loading retail locationsâ¦</div>');try{let data;try{const apiUrl=getApiUrl("/gtfs/where-to-buy");const response=await fetch(apiUrl,{method:"GET",mode:"cors",credentials:"omit",headers:API_HEADERS});if(response.ok){data=await response.json();data=normalizeRetailerData(data);}else throw new Error("API not available, using local file");}catch(apiError){const localUrl="../map/where-to-buy.json.gz";const response=await fetch(localUrl);if(!response.ok)throw new Error(`Failed to load local file: ${response.status}`);const arrayBuffer=await response.arrayBuffer();async function decompressGzip(buffer){if(typeof DecompressionStream==="undefined"||typeof ReadableStream==="undefined"||typeof Blob==="undefined"){console.warn("DecompressionStream API unavailable. Trying JSON file instead.");throw new Error("Decompression not supported");}const decompressionStream=new DecompressionStream("gzip");const decompressedStream=new Response(new Blob([buffer]).stream().pipeThrough(decompressionStream));return await decompressedStream.text();}try{const jsonText=await decompressGzip(arrayBuffer);data=normalizeRetailerData(jsonText);}catch(decompressError){const jsonUrl="../map/where-to-buy.json";const jsonResponse=await fetch(jsonUrl);if(!jsonResponse.ok)throw new Error(`Failed to load JSON file: ${jsonResponse.status}`);data=normalizeRetailerData(await jsonResponse.json());}}buildWhereToBuyPage(container,normalizeRetailerData(data));}catch(error){console.error("Error loading where to buy data:",error);container.innerHTML=i18nHtml("errorState",'<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>We were unable to load retail location information. Please try again shortly.</div>');}}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){initWhereToBuy(document);});else initWhereToBuy(document);if(typeof Drupal!=="undefined"&&Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.ctWhereToBuy={attach:function(context){initWhereToBuy(context);}};})(typeof Drupal!=="undefined"&&Drupal?Drupal:{},typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{});; 449(function(Drupal,drupalSettings){"use strict";function i18n(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.t==="function")return window.CTI18n.t("park-ride",key,vars,fallback);return typeof fallback==="string"?fallback:key;}function i18nHtml(key,fallback){if(window.CTI18n&&typeof window.CTI18n.html==="function")return window.CTI18n.html("park-ride",key,fallback);return typeof fallback==="string"?fallback:"";}function i18nHtmlWithVars(key,vars,fallback){if(window.CTI18n&&typeof window.CTI18n.htmlWithVars==="function")return window.CTI18n.htmlWithVars("park-ride",key,vars,fallback);return typeof fallback==="string"?fallback:"";}const settings=typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{};const API_BASE_URL="https://cttransit.alerts.api.exemplifi.io/api/v1";const API_HEADERS={Accept:"application/json","X-API-KEY":"sk_live_SOdoS2lNrADb82dOIDtRcz_t33L3Zx0t"};function isLocalEnvironment(){return (window.location.protocol==="file:"||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"||window.location.hostname===""||window.location.hostname.includes("localhost"));}function getApiBaseUrl(){let baseUrl=settings?.cttransit?.apiBaseUrl||window.drupalSettings?.cttransit?.apiBaseUrl;if(!baseUrl||!String(baseUrl).includes("/api/v1"))baseUrl=API_BASE_URL;return baseUrl;}function getApiUrl(endpoint){const baseUrl=getApiBaseUrl();const fullUrl=baseUrl?`${baseUrl}${endpoint}`:endpoint;const useCorsProxy=isLocalEnvironment()&&settings?.cttransit?.useCorsProxy!==false&&window.drupalSettings?.cttransit?.useCorsProxy!==false;if(useCorsProxy&&baseUrl){const corsProxy=settings?.cttransit?.corsProxyUrl||window.drupalSettings?.cttransit?.corsProxyUrl||"https://corsproxy.io/?";return `${corsProxy}${encodeURIComponent(fullUrl)}`;}return fullUrl;}function normalizeParkRideData(raw){let data=raw;
449if(typeof data==="string")try{data=JSON.parse(data);}catch(e){data=null;}if(!data)return {park_and_ride_lots:[]};for(let i=0;i<4;i++){if(!data||typeof data!=="object"||Array.isArray(data))break;if(data.data)data=data.data;else if(data.result)data=data.result;else if(data.payload)data=data.payload;else break;}if(data&&typeof data==="object"&&!Array.isArray(data))if(Array.isArray(data.park_and_ride_lots))return data;const rows=Array.isArray(data)?data:[];const looksFlat=rows.length>0&&(Object.prototype.hasOwnProperty.call(rows[0],"County")||Object.prototype.hasOwnProperty.call(rows[0],"county")||Object.prototype.hasOwnProperty.call(rows[0],"Facility Name")||Object.prototype.hasOwnProperty.call(rows[0],"facilityName"));if(!looksFlat)return {park_and_ride_lots:[]};const park_and_ride_lots=rows.map(function(row,idx){const county=String(row.County??row.county??"").trim();const city=String(row.City??row.city??"").trim();const facility=String(row["Facility Name"]??row.facilityName??"").replace("&","and").trim();const desc=String(row["Location Description"]??row.locationDescription??"").trim();const busRoutesRaw=row["Bus Routes"]!=null?row["Bus Routes"]:row.busRoutes!=null?row.busRoutes:"";const busRoutes=String(busRoutesRaw).trim();let lat=row.Latitude??row.latitude;let lon=row.Longitude??row.longitude;lat=typeof lat==="number"?lat:parseFloat(String(lat),10);lon=typeof lon==="number"?lon:parseFloat(String(lon),10);if(Number.isNaN(lat))lat=null;if(Number.isNaN(lon))lon=null;const spacesRaw=row.Spaces??row.spaces;let spaces=null;if(spacesRaw!=null&&spacesRaw!==""){spaces=typeof spacesRaw==="number"?spacesRaw:parseInt(String(spacesRaw),10);if(Number.isNaN(spaces))spaces=null;}return {id:String(row.id??idx+1),county,city,name:facility,locations:[{name:facility,address:desc,lat,lon,routes:busRoutes?[busRoutes]:[],spaces}]};});return {park_and_ride_lots};}function collectCountiesFromLots(lots){const set=new Set();(lots||[]).forEach(function(lot){const c=lot&&typeof lot.county==="string"?lot.county.trim():"";if(c)set.add(c);});return Array.from(set).sort(function(a,b){return a.localeCompare(b);});}function collectCitiesFromLots(lots,countyFilter){const set=new Set();const cf=typeof countyFilter==="string"?countyFilter.trim():"";(lots||[]).forEach(function(lot){if(cf&&(lot.county||"").trim()!==cf)return;const city=lot&&typeof lot.city==="string"?lot.city.trim():"";if(city)set.add(city);});return Array.from(set).sort(function(a,b){return a.localeCompare(b);});}function formatSpacesDisplay(spaces){if(spaces==null||spaces==="")return "";const n=typeof spaces==="number"?spaces:parseInt(String(spaces),10);if(Number.isNaN(n))return "";return String(n);}function fitMapToVisibleLocations(map,mapsApi,bounds,locationCount){if(!map||!bounds||bounds.isEmpty()||!locationCount)return;const SINGLE_LOT_ZOOM=12;const MAX_FILTER_ZOOM=12;const boundsPadding=48;if(locationCount===1){map.setCenter(bounds.getCenter());map.setZoom(SINGLE_LOT_ZOOM);return;}map.fitBounds(bounds,boundsPadding);const listener=mapsApi.event.addListener(map,"idle",function(){mapsApi.event.removeListener(listener);if(map.getZoom()>MAX_FILTER_ZOOM)map.setZoom(MAX_FILTER_ZOOM);});}function lotMatchesCountyAndCity(lot,countyFilter,cityFilter){const cf=typeof countyFilter==="string"?countyFilter.trim():"";const cityF=typeof cityFilter==="string"?cityFilter.trim():"";if(cf&&(lot.county||"").trim()!==cf)return false;if(cityF&&(lot.city||"").trim()!==cityF)return false;return true;}function loadGoogleMaps(){if(window.CTGoogleMaps&&typeof window.CTGoogleMaps.load==="function")return window.CTGoogleMaps.load();if(window.google&&window.google.maps)return Promise.resolve(window.google.maps);return new Promise(function(resolve,reject){let attempts=0;const maxAttempts=50;const checkInterval=setInterval(function(){attempts++;if(window.google&&window.google.maps){clearInterval(checkInterval);resolve(window.google.maps);}else{if(attempts>=maxAttempts){clearInterval(checkInterval);reject(new Error("Google Maps API failed to load"));}}},100);});}function buildParkRideMap(container,parkRideData,onMarkersReady){loadGoogleMaps().then(function(maps){const map=new maps.Map(container,{center:{lat:41.7658,lng:-72.6734},zoom:10,mapId:"ct-transit-park-ride-map",mapTypeControl:false,streetViewControl:false,fullscreenControl:true});container.setAttribute("aria-label",i18n("ariaInteractiveMap",null,"Interactive map showing park and ride locations"));const bounds=new maps.LatLngBounds();const infoWindow=new maps.InfoWindow();
449parkRideData.park_and_ride_lots.forEach(function(lot){lot.locations.forEach(function(location){if(location.lat==null||location.lon==null||Number.isNaN(Number(location.lat))||Number.isNaN(Number(location.lon)))return;const position={lat:Number(location.lat),lng:Number(location.lon)};bounds.extend(position);const markerDiv=document.createElement("div");markerDiv.className="ct-park-ride-marker";markerDiv.setAttribute("role","button");markerDiv.setAttribute("tabindex","0");markerDiv.setAttribute("aria-label",i18n("ariaViewLotDetails",{name:location.name},`View details for ${location.name}`));markerDiv.innerHTML=` 450 <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"> 451 <circle cx="16" cy="16" r="14" fill="#FFDD00" stroke="#FFFFFF" stroke-width="3"/> 452 <circle cx="16" cy="16" r="6" fill="#FFFFFF"/> 453 <circle cx="16" cy="16" r="3" fill="#FFDD00"/> 454 </svg> 455 `;let marker;if(maps.marker&&maps.marker.AdvancedMarkerElement)marker=new maps.marker.AdvancedMarkerElement({map,position,content:markerDiv,title:location.name});else{const canvas=document.createElement("canvas");canvas.width=32;canvas.height=32;const ctx=canvas.getContext("2d");ctx.beginPath();ctx.arc(16,16,14,0,2*Math.PI);ctx.fillStyle="#FFDD00";ctx.fill();ctx.strokeStyle="#FFFFFF";ctx.lineWidth=3;ctx.stroke();ctx.beginPath();ctx.arc(16,16,6,0,2*Math.PI);ctx.fillStyle="#FFFFFF";ctx.fill();ctx.beginPath();ctx.arc(16,16,3,0,2*Math.PI);ctx.fillStyle="#FFDD00";ctx.fill();marker=new maps.Marker({map,position,title:location.name,icon:{url:canvas.toDataURL(),scaledSize:new maps.Size(32,32),anchor:new maps.Point(16,16)},optimized:false});}const clickHandler=function(){const routesList=Array.isArray(location.routes)?location.routes.join(", "):location.routes||"";const spacesText=formatSpacesDisplay(location.spaces);const spacesRow=spacesText?i18nHtmlWithVars("lotSpacesRow",{spaces:spacesText}):"";const content=i18nHtmlWithVars("lotInfoWindow",{name:location.name,address:location.address,routes:routesList,spacesRow});infoWindow.setContent(content);if(maps.marker&&maps.marker.AdvancedMarkerElement)infoWindow.open({map,anchor:marker});else infoWindow.open(map,marker);};if(markerDiv){markerDiv.addEventListener("click",clickHandler);markerDiv.addEventListener("keydown",function(e){if(e.key==="Enter"||e.key===" "){e.preventDefault();clickHandler();}});}else marker.addListener("click",clickHandler);location._marker=marker;});});if(!bounds.isEmpty())map.fitBounds(bounds);container._map=map;container._infoWindow=infoWindow;if(typeof onMarkersReady==="function")onMarkersReady();}).catch(function(error){console.error("Failed to load Google Maps:",error);container.innerHTML=i18nHtml("mapErrorState",'<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>Unable to load the interactive map at this time.</div>');});}function buildCitySelector(){const wrapper=document.createElement("div");wrapper.className="ct-park-ride-selector-wrapper";const selectWrapper=document.createElement("div");selectWrapper.className="ct-park-ride-selector-select-wrapper";const label=document.createElement("label");label.className="ct-park-ride-selector-label subtitle";label.textContent=i18n("cityTownLabel",null,"City / Town");label.setAttribute("for","park-ride-city-select");const select=document.createElement("select");select.className="ct-park-ride-selector";select.id="park-ride-city-select";const defaultOption=document.createElement("option");defaultOption.value="";defaultOption.textContent=i18n("allCitiesOption",null,"All cities");select.appendChild(defaultOption);const button=document.createElement("button");button.type="button";button.className="ct-btn ct-btn--secondary";button.innerHTML=` 456 ${i18n("viewLotsButton",null,"View Lots")} 457 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 458 <path d="M5 12h14m0 0l-7-7m7 7l-7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> 459 </svg> 460 `;wrapper.appendChild(label);selectWrapper.appendChild(select);selectWrapper.appendChild(button);wrapper.appendChild(selectWrapper);return {wrapper,select,button};}function fillCitySelect(select,lots,countyFilter){const current=select.value;while(select.firstChild)select.removeChild(select.firstChild);const defaultOption=document.createElement("option");defaultOption.value="";defaultOption.textContent=i18n("allCitiesOption",null,"All cities");select.appendChild(defaultOption);const cities=collectCitiesFromLots(lots,countyFilter);
460cities.forEach(function(city){const option=document.createElement("option");option.value=city;option.textContent=city;select.appendChild(option);});if(current&&Array.from(select.options).some((o)=>o.value===current))select.value=current;}function buildAccordionList(parkRideData,selectedCounty,onCountyChange){const wrapper=document.createElement("div");wrapper.className="ct-park-ride-county-tabs";const deriveCityGroupLabel=(lot)=>{if(lot&&typeof lot.city==="string"&&lot.city.trim()!=="")return lot.city.trim();if(lot&&typeof lot.name==="string"&&lot.name.trim()!=="")return lot.name.trim();return i18n("otherCityGroup",null,"Other");};const tabList=document.createElement("div");tabList.className="ct-park-ride-tablist";tabList.setAttribute("role","tablist");tabList.setAttribute("aria-label",i18n("countyTabsAriaLabel",null,"Park and Ride lots grouped by county"));const panelsContainer=document.createElement("div");panelsContainer.className="ct-park-ride-tabpanels";const lots=Array.isArray(parkRideData?.park_and_ride_lots)?parkRideData.park_and_ride_lots:[];const counties=collectCountiesFromLots(lots);const tabsConfig=[{value:"",label:i18n("allCountiesTab",null,"All counties")}].concat(counties.map(function(c){return {value:c,label:c};}));const selected=typeof selectedCounty==="string"?selectedCounty.trim():"";let activeIndex=tabsConfig.findIndex(function(t){return t.value===selected;});if(activeIndex<0)activeIndex=0;const tabs=[];tabsConfig.forEach(function(countyTab,index){const tabId=`ct-park-ride-county-tab-${index}`;const panelId=`ct-park-ride-county-panel-${index}`;const isActive=index===activeIndex;const tab=document.createElement("button");tab.type="button";tab.className="ct-park-ride-tab"+(isActive?" ct-park-ride-tab--active":"");tab.setAttribute("role","tab");tab.setAttribute("id",tabId);tab.setAttribute("aria-controls",panelId);tab.setAttribute("aria-selected",isActive?"true":"false");tab.setAttribute("tabindex",isActive?"0":"-1");tab.textContent=countyTab.label;tab.setAttribute("data-county-value",countyTab.value);tabList.appendChild(tab);tabs.push(tab);const panel=document.createElement("div");panel.className="ct-park-ride-tabpanel"+(isActive?" ct-park-ride-tabpanel--active":"");panel.setAttribute("role","tabpanel");panel.setAttribute("id",panelId);panel.setAttribute("aria-labelledby",tabId);if(!isActive)panel.hidden=true;const accordion=document.createElement("div");accordion.className="ct-park-ride-accordion";const countyLots=lots.filter(function(lot){if(!countyTab.value)return true;return (lot.county||"").trim()===countyTab.value;});if(!countyLots.length){const empty=document.createElement("p");empty.className="ct-park-ride-empty-state body-2";empty.textContent=i18n("emptySelectionState",null,"No park and ride lots available for this selection.");panel.appendChild(empty);panelsContainer.appendChild(panel);return;}const cityMap=new Map();countyLots.forEach(function(lot){const cityName=deriveCityGroupLabel(lot);if(!cityMap.has(cityName))cityMap.set(cityName,[]);cityMap.get(cityName).push(lot);});Array.from(cityMap.entries()).sort(function(a,b){return a[0].localeCompare(b[0]);}).forEach(function([cityName,cityLots]){const item=document.createElement("div");item.className="ct-park-ride-accordion-item";item.setAttribute("data-city",cityName);const header=document.createElement("button");header.type="button";header.className="ct-park-ride-accordion-header";header.setAttribute("aria-expanded","false");const safeCityId=cityName.toLowerCase().replace(/[^a-z0-9]+/g,"-");const safeCountyId=String(countyTab.label||"all").toLowerCase().replace(/[^a-z0-9]+/g,"-");const contentId=`park-ride-content-${safeCountyId}-${safeCityId}`;header.setAttribute("aria-controls",contentId);const headerText=document.createElement("span");headerText.className="ct-park-ride-accordion-title";headerText.setAttribute("role","heading");headerText.setAttribute("aria-level","3");headerText.textContent=i18n("cityLotCount",{city:cityName,count:cityLots.length,lotWord:cityLots.length===1?i18n("lotSingular",null,"lot"):i18n("lotPlural",null,"lots")},`${cityName} (${cityLots.length} lot${cityLots.length!==1?"s":""})`);const headerIcon=document.createElement("span");
460headerIcon.className="ct-park-ride-accordion-icon";headerIcon.innerHTML=` 461 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 462 <path d="M12 5v14M5 12h14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/> 463 </svg> 464 `;header.appendChild(headerText);header.appendChild(headerIcon);const content=document.createElement("div");content.className="ct-park-ride-accordion-content";content.id=contentId;content.setAttribute("aria-hidden","true");const cardsGrid=document.createElement("div");cardsGrid.className="ct-park-ride-cards-grid";cityLots.forEach(function(lot){lot.locations.forEach(function(location){const card=document.createElement("div");card.className="ct-park-ride-card";const routesList=Array.isArray(location.routes)?location.routes.join(", "):location.routes||"";const spacesText=formatSpacesDisplay(location.spaces);card.innerHTML=` 465 <div class="ct-park-ride-card-header"> 466 <h4 class="subtitle">${location.name}</h4> 467 </div> 468 <div class="ct-park-ride-card-body"> 469 <div class="ct-park-ride-card-address body-2"> 470<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> 471 <path d="M10 10a2.5 2.5 0 100-5 2.5 2.5 0 000 5z" stroke="#003E7E" stroke-width="1.5"/> 472 <path d="M10 18s6.25-5 6.25-9.375a6.25 6.25 0 10-12.5 0C3.75 13 10 18 10 18z" stroke="#003E7E" stroke-width="1.5"/> 473 </svg> 474 <p>${location.address}</p> 475 </div> 476 <div class="ct-park-ride-card-routes body-2"> 477 <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> 478 <path d="M10 10a2.5 2.5 0 100-5 2.5 2.5 0 000 5z" stroke="#003E7E" stroke-width="1.5"/> 479 <path d="M10 18s6.25-5 6.25-9.375a6.25 6.25 0 10-12.5 0C3.75 13 10 18 10 18z" stroke="#003E7E" stroke-width="1.5"/> 480 </svg> 481 <p><strong>${i18n("routesLabel",null,"Routes:")}</strong> ${routesList}</p> 482 </div> 483 ${spacesText?`<div class="ct-park-ride-card-spaces body-2"> 484 <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> 485 <rect x="3" y="3" width="14" height="14" rx="2" stroke="#003E7E" stroke-width="1.5"/> 486 <path d="M8 16V7.5H10.5C12.1 7.5 13.4 8.75 13.4 10.35C13.4 11.95 12.1 13.2 10.5 13.2H8" stroke="#003E7E" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 487 </svg> 488 <p><strong>${i18n("spacesLabel",null,"Spaces:")}</strong> ${spacesText}</p> 489 </div>`:""} 490 </div> 491 `;cardsGrid.appendChild(card);});});content.appendChild(cardsGrid);item.appendChild(header);item.appendChild(content);accordion.appendChild(item);header.addEventListener("click",function(){const isExpanded=header.getAttribute("aria-expanded")==="true";const willExpand=!isExpanded;header.setAttribute("aria-expanded",willExpand.toString());content.setAttribute("aria-hidden",(!willExpand).toString());header.classList.toggle("is-expanded",willExpand);content.classList.toggle("is-open",willExpand);const iconPath=headerIcon.querySelector("svg path");if(willExpand)iconPath.setAttribute("d","M5 12h14");else iconPath.setAttribute("d","M12 5v14M5 12h14");});});panel.appendChild(accordion);panelsContainer.appendChild(panel);});function activateTab(newTab){if(!newTab||newTab.getAttribute("role")!=="tab")return;const currentTab=tabList.querySelector('[role="tab"][aria-selected="true"]');if(currentTab===newTab)return;const newPanelId=newTab.getAttribute("aria-controls");const newPanel=newPanelId&&panelsContainer.querySelector(`#${newPanelId}`);if(!newPanel)return;if(currentTab){currentTab.classList.remove("ct-park-ride-tab--active");currentTab.setAttribute("aria-selected","false");currentTab.setAttribute("tabindex","-1");const currentPanelId=currentTab.getAttribute("aria-controls");if(currentPanelId){const currentPanel=panelsContainer.querySelector(`#${currentPanelId}`);if(currentPanel){currentPanel.classList.remove("ct-park-ride-tabpanel--active");currentPanel.hidden=true;}}}newTab.classList.add("ct-park-ride-tab--active");newTab.setAttribute("aria-selected","true");newTab.setAttribute("tabindex","0");newPanel.classList.add("ct-park-ride-tabpanel--active");newPanel.hidden=false;newTab.focus();}
491tabs.forEach(function(tab,index){tab.addEventListener("click",function(){activateTab(tab);if(typeof onCountyChange==="function"){const countyVal=tab.getAttribute("data-county-value");onCountyChange(countyVal!=null?countyVal:"");}});tab.addEventListener("keydown",function(event){const key=event.key;if(key!=="ArrowLeft"&&key!=="ArrowRight"&&key!=="Home"&&key!=="End")return;event.preventDefault();let newIndex=index;if(key==="ArrowRight")newIndex=(index+1)%tabs.length;else if(key==="ArrowLeft")newIndex=(index-1+tabs.length)%tabs.length;else if(key==="Home")newIndex=0;else{if(key==="End")newIndex=tabs.length-1;}const newTab=tabs[newIndex];activateTab(newTab);if(typeof onCountyChange==="function"){const countyVal=newTab.getAttribute("data-county-value");onCountyChange(countyVal!=null?countyVal:"");}});});wrapper.appendChild(tabList);wrapper.appendChild(panelsContainer);return wrapper;}function buildParkRidePage(container,parkRideData){const safeParkRideData=normalizeParkRideData(parkRideData);const lots=Array.isArray(safeParkRideData.park_and_ride_lots)?safeParkRideData.park_and_ride_lots:Array.isArray(safeParkRideData.lots)?safeParkRideData.lots:[];safeParkRideData.park_and_ride_lots=lots;const contactPhone=safeParkRideData?.metadata?.contact?.phone!==undefined?String(safeParkRideData.metadata.contact.phone):"";const wrapper=document.createElement("div");wrapper.className="ct-park-ride-wrapper";const mapSection=document.createElement("section");mapSection.className="ct-park-ride-map-section";const mapContainer=document.createElement("div");mapContainer.className="container";const mapRow=document.createElement("div");mapRow.className="row";const mapCol=document.createElement("div");mapCol.className="col-12";const mapHeader=document.createElement("div");mapHeader.className="ct-park-ride-map-header";mapHeader.innerHTML=i18nHtml("mapHeader",` 492 <div> 493 <p class="label">FIND A SPOT</p> 494 <h2>PARKING LOT LOCATOR</h2> 495 </div> 496 `);const mapControls=document.createElement("div");mapControls.className="ct-park-ride-map-controls";const citySelector=buildCitySelector();mapControls.appendChild(citySelector.wrapper);const citySelect=citySelector.select;const cityApplyBtn=citySelector.button;let selectedCounty="";let selectedCity="";const mapElement=document.createElement("div");mapElement.className="ct-park-ride-map";mapElement.setAttribute("data-park-ride-map","");mapCol.appendChild(mapHeader);mapCol.appendChild(mapControls);mapCol.appendChild(mapElement);mapRow.appendChild(mapCol);mapContainer.appendChild(mapRow);mapSection.appendChild(mapContainer);wrapper.appendChild(mapSection);const listSection=document.createElement("section");listSection.className="ct-park-ride-list-section";const listContainer=document.createElement("div");listContainer.className="container";const listRow=document.createElement("div");listRow.className="row";const listCol=document.createElement("div");listCol.className="col-12";const listHeader=document.createElement("div");listHeader.className="ct-park-ride-list-header";listHeader.innerHTML=i18nHtml("listHeader",` 497 <h2>Park and Ride Locations Served by CT<i>transit</i></h2> 498 <div class="ct-park-ride-list-info body-1"> 499 <p>These CTDOT-maintained facilities offer free parking for CT<i>transit</i> and CT<i>fastrak</i> local and express customers. Links are provided to the schedules for routes serving each Park and Ride lot. You can also use our <a href="/trip-planner">Trip Planner</a>.</p> 500 <p>For questions or to report an issue with a specific Park and Ride location, contact CTDOT:</p> 501 <ul> 502 <li><strong>Phone:</strong> <a href="tel:8605942141">860-594-2141</a></li> 503 <li><strong>Email:</strong> <a href="mailto:[email protected]">[email protected]</a></li> 504 </ul> 505 </div> 506 `);const accordionMount=document.createElement("div");accordionMount.setAttribute("data-park-ride-accordion-mount","");function renderAccordion(){accordionMount.innerHTML="";accordionMount.appendChild(buildAccordionList(safeParkRideData,selectedCounty,function(newCounty){selectedCounty=typeof newCounty==="str
506ing"?newCounty.trim():"";selectedCity="";fillCitySelect(citySelect,safeParkRideData.park_and_ride_lots,selectedCounty);citySelect.value="";applyMapFilters();}));}renderAccordion();listCol.appendChild(listHeader);listCol.appendChild(accordionMount);listRow.appendChild(listCol);listContainer.appendChild(listRow);listSection.appendChild(listContainer);wrapper.appendChild(listSection);container.innerHTML="";container.appendChild(wrapper);function applyMapFilters(){if(mapElement._infoWindow)mapElement._infoWindow.close();const map=mapElement._map;const mapsApi=window.google&&window.google.maps;if(!map||!mapsApi)return;const bounds=new mapsApi.LatLngBounds();let visibleLocationCount=0;safeParkRideData.park_and_ride_lots.forEach(function(lot){const locations=Array.isArray(lot.locations)?lot.locations:[];locations.forEach(function(location){const marker=location&&location._marker;if(!marker)return;const visible=lotMatchesCountyAndCity(lot,selectedCounty,selectedCity);if(mapsApi.marker&&marker instanceof mapsApi.marker.AdvancedMarkerElement)marker.map=visible?map:null;else{if(typeof marker.setMap==="function")marker.setMap(visible?map:null);}if(visible&&location.lat!=null&&location.lon!=null&&!Number.isNaN(Number(location.lat))&&!Number.isNaN(Number(location.lon))){bounds.extend({lat:Number(location.lat),lng:Number(location.lon)});visibleLocationCount+=1;}});});if(visibleLocationCount>0&&!bounds.isEmpty())fitMapToVisibleLocations(map,mapsApi,bounds,visibleLocationCount);}fillCitySelect(citySelect,safeParkRideData.park_and_ride_lots,"");buildParkRideMap(mapElement,safeParkRideData,applyMapFilters);citySelect.addEventListener("change",function(){selectedCity=typeof citySelect.value==="string"?citySelect.value.trim():"";applyMapFilters();});cityApplyBtn.addEventListener("click",function(){selectedCity=typeof citySelect.value==="string"?citySelect.value.trim():"";applyMapFilters();});}async function initParkRide(context){const root=context&&context!==document?context:document;const container=root.querySelector("[data-ct-park-ride]");if(!container)return;if(container.dataset.ctParkRideInitialized==="true")return;container.dataset.ctParkRideInitialized="true";container.innerHTML=i18nHtml("loadingState",'<div class="ct-gtfs-loading"><span aria-hidden="true">â³</span>Loading park and ride informationâ¦</div>');try{const apiUrl=getApiUrl("/gtfs/park-and-ride");const response=await fetch(apiUrl,{method:"GET",mode:"cors",credentials:"omit",headers:API_HEADERS});if(!response.ok)throw new Error(`HTTP error loading park and ride data: ${response.status}`);let data=await response.json();if(typeof data==="string")data=JSON.parse(data);buildParkRidePage(container,data);}catch(error){console.error("Error loading park and ride data:",error);container.innerHTML=i18nHtml("errorState",'<div class="ct-gtfs-error"><span aria-hidden="true">â ï¸</span>We were unable to load park and ride information. Please try again shortly.</div>');}}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){initParkRide(document);});else initParkRide(document);if(typeof Drupal!=="undefined"&&Drupal&&typeof Drupal.behaviors!=="undefined")Drupal.behaviors.ctParkRide={attach:function(context){initParkRide(context);}};})(typeof Drupal!=="undefined"&&Drupal?Drupal:{},typeof drupalSettings!=="undefined"?drupalSettings:window.drupalSettings||{});; 507(function(Drupal,once,window){"use strict";function getInnerContentHeight(el){var total=0;Array.prototype.forEach.call(el.children,function(child){var rect=child.getBoundingClientRect();var styles=window.getComputedStyle(child);var mt=parseFloat(styles.marginTop)||0;var mb=parseFloat(styles.marginBottom)||0;total+=rect.height+mt+mb;});return total;}function updateStickyImageColumns(root){var scope=root||document;var thresholdPx=window.innerHeight*1;var sections=scope.querySelectorAll(".ct-image-text");sections.forEach(function(section){var row=section.querySelector(".row");if(!row)return;var textContent=row.querySelector(".text-content");if(!textContent)return;var imgCol=Array.prototype.find.call(row.querySelectorAll(".col-md-6.image-wrapper"),function(col){return !!col.querySelector("img");});if(!imgCol)return;var contentHeight=getInnerContentHeight(textContent);var shouldStick=contentHeight>thresholdPx;imgCol.classList.toggle("col-sticky",shouldStick);});}var rafId=null;function scheduleUpdate(root){if(rafId)return;rafId=window.requestAnimationFrame(function(){rafId=null;updateStickyImageColumns(root||document);});}if(typeof Drupal!=="undefined"&&Drupal.behaviors)Drupal.behaviors.cttransitStickyCol={attach:function(context){scheduleUpdate(context);once("cttransitStickyColResize","body",context).forEach(function(){window.addEventListener("resize",function(){scheduleUpdate(document);},{passive:true});});}};else{if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",function(){scheduleUpdate(document);});else scheduleUpdate(document);window.addEventListener("resize",function(){scheduleUpdate(document);},{passive:true});}})(Drupal,once,window);;
508(function(Drupal,once){const ctBrandRegex=/\b(CTtransit|CTfastrak|CTtrail|CTpass)\b/gi;function shouldSkipTextNode(textNode){const parent=textNode.parentNode;if(!parent||parent.nodeType!==Node.ELEMENT_NODE)return true;const tag=parent.nodeName;if(tag==='SCRIPT'||tag==='STYLE'||tag==='TEXTAREA'||tag==='NOSCRIPT')return true;return Boolean(parent.closest('em'));}function wrapMatchesInEm(textNode){if(shouldSkipTextNode(textNode))return;const text=textNode.nodeValue;if(!text||!ctBrandRegex.test(text)){ctBrandRegex.lastIndex=0;return;}ctBrandRegex.lastIndex=0;const parent=textNode.parentNode;const frag=document.createDocumentFragment();const re=new RegExp(ctBrandRegex.source,ctBrandRegex.flags);let last=0;let m;while((m=re.exec(text))!==null){if(m.index>last)frag.appendChild(document.createTextNode(text.slice(last,m.index)));const full=m[1];frag.appendChild(document.createTextNode(full.slice(0,2)));const em=document.createElement('em');em.textContent=full.slice(2);frag.appendChild(em);last=m.index+m[0].length;if(m[0].length===0)re.lastIndex++;}if(last<text.length)frag.appendChild(document.createTextNode(text.slice(last)));parent.replaceChild(frag,textNode);}Drupal.behaviors.wrapTargetWordsBehavior={attach(context){once('cttransit-wrap-target-words','body',context).forEach((body)=>{const walker=document.createTreeWalker(body,NodeFilter.SHOW_TEXT,null);const textNodes=[];let n;while((n=walker.nextNode()))textNodes.push(n);textNodes.forEach(wrapMatchesInEm);});}};})(Drupal,once);; 509((Drupal)=>{const NEW_WINDOW_TITLE=/opens in a new (?:window|tab)/i;const OPENS_NEW_TAB=/opens in a new tab/i;const LINK_IS_EXTERNAL=/\(link is external\)/i;const ORIGINAL_ARIA_ATTR='data-ct-original-aria-label';function stripExtlinkTitles(root){const scope=root&&root.querySelectorAll?root:document;scope.querySelectorAll('a[title], area[title]').forEach((el)=>{const title=el.getAttribute('title');if(!title||!NEW_WINDOW_TITLE.test(title))return;const cleaned=title.replace(/\s*\(?\s*opens in a new (?:window|tab)\s*\)?/gi,'').replace(/^[\s,]+|[\s,]+$/g,'').trim();if(cleaned)el.setAttribute('title',cleaned);else el.removeAttribute('title');});}function getVisibleLinkText(el){const clone=el.cloneNode(true);clone.querySelectorAll('svg, img, [aria-hidden="true"], .visually-hidden, .sr-only').forEach((node)=>{node.remove();});return (clone.textContent||'').replace(/\s+/g,' ').trim();}function hideExtlinkIcon(el){el.querySelectorAll('svg.ext, svg[data-extlink-placement]').forEach((svg)=>{svg.setAttribute('aria-hidden','true');svg.removeAttribute('aria-label');svg.querySelectorAll('title').forEach((title)=>{title.remove();});});}function ensureNewTabAriaLabel(el){if(el.getAttribute('target')!=='_blank')return;const visible=getVisibleLinkText(el);if(!visible)return;const desired=`${visible} (opens in a new tab)`;const current=(el.getAttribute('aria-label')||'').trim();const stored=(el.getAttribute(ORIGINAL_ARIA_ATTR)||'').trim();const needsRepair=!current||LINK_IS_EXTERNAL.test(current)||LINK_IS_EXTERNAL.test(stored)||(OPENS_NEW_TAB.test(current)&¤t!==desired)||!OPENS_NEW_TAB.test(current);if(needsRepair&¤t!==desired)el.setAttribute('aria-label',desired);if((el.getAttribute(ORIGINAL_ARIA_ATTR)||'')!==desired)el.setAttribute(ORIGINAL_ARIA_ATTR,desired);hideExtlinkIcon(el);}function labelNewTabLinks(root){const scope=root&&root.querySelectorAll?root:document;scope.querySelectorAll('a[target="_blank"]').forEach((el)=>{ensureNewTabAriaLabel(el);});}Drupal.behaviors.cttransitStripExtlinkTitle={attach(context){window.setTimeout(()=>{const root=context===document?document:context;stripExtlinkTitles(root);labelNewTabLinks(root);},0);}};})(Drupal);; 510(function(Drupal){'use strict';const DRUPAL_LANGS=['en','es-419'];function getPageLanguage(){if(typeof drupalSettings!=='undefined'&&drupalSettings.ctLanguageSelector&&drupalSettings.ctLanguageSelector.pageLanguage)return drupalSettings.ctLanguageSelector.pageLanguage;const lang=document.documentElement.getAttribute('lang')||'en';return lang==='es-419'?'es':lang;}function clearGoogleTranslateCookie(){const expires='Thu, 01 Jan 1970 00:00:00 GMT';const hostname=window.location.hostname;const hostBare=hostname.replace(/^www\./,'');const paths=['/',window.location.pathname];const domains=[null,hostname,hostBare,'.'+hostname,'.'+hostBare];paths.forEach((path)=>{domains.forEach((domain)=>{const domainPart=domain?'; domain='+domain:'';document.cookie='googtrans=; path='+path+domainPart+'; expires='+expires;});});}function getGoogleTranslateCombo(){const selects=document.getElementsByTagName('select');for(let i=0;i<selects.length;i++)if(selects[i].className.indexOf('goog-te-combo')!==-1)return selects[i];return null;}function stripGoogleTranslateDom(){document.documentElement.classList.remove('translated-ltr','translated-rtl');document.body.classList.remove('translated-ltr','translated-rtl');}function resetGoogleTranslateWidget(){const pageLang=getPageLanguage();stripGoogleTranslateDom();document.querySelectorAll('.ct-language-selector__gt-mount a.gt-current-lang').forEach((link)=>{link.classList.remove('gt-current-lang');});const sourceLink=document.querySelector('.ct-language-selector__gt-mount a[data-gt-lang="'+pageLang+'"]');
510if(sourceLink)sourceLink.classList.add('gt-current-lang');if(typeof window.doGTranslate==='function')try{window.doGTranslate(pageLang+'|'+pageLang);}catch(e){}const combo=getGoogleTranslateCombo();if(combo){combo.value='';combo.dispatchEvent(new Event('change',{bubbles:true}));}}function clearGtSessionStorage(){try{sessionStorage.removeItem('gt_autoswitch');localStorage.removeItem('gt_autoswitch');}catch(e){}}function getApplyGtLang(){if(typeof drupalSettings!=='undefined'&&drupalSettings.ctLanguageSelector&&drupalSettings.ctLanguageSelector.applyGtLang)return drupalSettings.ctLanguageSelector.applyGtLang;return new URL(window.location.href).searchParams.get('gt_lang');}function getGtLabels(){return (typeof drupalSettings!=='undefined'&&drupalSettings.ctLanguageSelector&&drupalSettings.ctLanguageSelector.gtLabels)||{};}function shouldResetGtOnLoad(){if(getApplyGtLang())return false;if(typeof drupalSettings!=='undefined'&&drupalSettings.ctLanguageSelector&&typeof drupalSettings.ctLanguageSelector.resetGtOnLoad==='boolean')return drupalSettings.ctLanguageSelector.resetGtOnLoad;const root=document.querySelector('[data-language-selector]');const lang=root&&root.getAttribute('data-drupal-lang');return lang&&DRUPAL_LANGS.indexOf(lang)!==-1;}function hasActiveGoogleTranslate(){const match=document.cookie.match('(^|;) ?googtrans=([^;]*)(;|$)');if(!match||!match[2])return false;const parts=match[2].split('/');return parts.length>=3&&parts[2]&&parts[2]!==parts[1];}function resetGoogleTranslateOnDrupalPage(){if(!shouldResetGtOnLoad())return;clearGoogleTranslateCookie();clearGtSessionStorage();stripGoogleTranslateDom();if(hasActiveGoogleTranslate()||document.documentElement.classList.contains('translated-ltr'))resetGoogleTranslateWidget();}function navigateToDrupalLanguage(href){clearGoogleTranslateCookie();clearGtSessionStorage();resetGoogleTranslateWidget();stripGoogleTranslateDom();const target=new URL(href,window.location.origin);target.searchParams.delete('gt_lang');const current=new URL(window.location.href);current.searchParams.delete('gt_lang');const sameDestination=target.pathname===current.pathname&&target.search===current.search&&target.hash===current.hash;if(sameDestination){window.location.replace(target.pathname+target.search+target.hash);window.location.reload();return;}window.location.assign(target.toString());}function updateGtLanguageUi(lang){const labels=getGtLabels();const label=labels[lang]||lang;document.querySelectorAll('.ct-language-selector__trigger-label').forEach((el)=>{el.textContent=label;});document.querySelectorAll('.ct-language-selector__gt-mount a[data-gt-lang]').forEach((link)=>{link.classList.toggle('gt-current-lang',link.getAttribute('data-gt-lang')===lang);});document.querySelectorAll('.ct-language-selector__primary-link').forEach((link)=>{link.classList.remove('is-active');});}function updateDrupalLanguageUi(root,langId){const labels={en:'English','es-419':'Español'};const label=labels[langId]||langId;root.querySelectorAll('.ct-language-selector__trigger-label').forEach((el)=>{el.textContent=label;});root.querySelectorAll('.ct-language-selector__primary-link').forEach((link)=>{const id=link.getAttribute('data-lang-id');link.classList.toggle('is-active',id===langId);});root.querySelectorAll('.ct-language-selector__gt-mount a.gt-current-lang').forEach((link)=>{link.classList.remove('gt-current-lang');});}function syncTriggerFromGtranslate(root){const current=root.querySelector('.ct-language-selector__gt-mount a.gt-current-lang');if(!current)return;const lang=current.getAttribute('data-gt-lang');if(!lang)return;updateGtLanguageUi(lang);}function setPanelOpen(root,open){const trigger=root.querySelector('.ct-language-selector__trigger');const panel=root.querySelector('.ct-language-selector__panel');if(!trigger||!panel)return;trigger.setAttribute('aria-expanded',open?'true':'false');panel.hidden=!open;root.classList.toggle('is-open',open);}function updateDrupalTriggerLabel(root){const triggerLabel=root.querySelector('.ct-language-selector__trigger-label');const active=root.querySelector('.ct-language-selector__primary-link.is-active');if(triggerLabel&&active)triggerLabel.textContent=active.textContent.trim();}function initLanguageSelector(root){if(root.getAttribute('data-ct-lang-init')==='true')return;root.setAttribute('data-ct-lang-init','true');const trigger=root.querySelector('.ct-language-selector__trigger');const panel=root.querySelector('.ct-language-selector__panel');if(!trigger||!panel)return;const drupalLang=root.getAttribute('data-drupal-lang');const applyLang=getApplyGtLang();if(applyLang)updateGtLanguageUi(applyLang);else if(hasActiveGoogleTranslate())syncTriggerFromGtranslate(root);else updateDrupalLanguageUi(root,drupalLang);trigger.addEventListener('click',(event)=>{event.preventDefault();event.stopPropagation();setPanelOpen(root,trigger.getAttribute('aria-expanded')!=='true');});root.querySelectorAll('.ct-language-selector__primary-link').forEach((link)=>{link.addEventListener('click',(event)=>{const href=link.getAttribute('href');if(!href||href==='#'||href.indexOf('javascript:')===0)return;event.preventDefault();event.stopPropagation();
510const langId=link.getAttribute('data-lang-id');if(langId)updateDrupalLanguageUi(root,langId);setPanelOpen(root,false);navigateToDrupalLanguage(href);});});const gtMount=root.querySelector('.ct-language-selector__gt-mount');if(gtMount)gtMount.addEventListener('click',(event)=>{const link=event.target.closest('a[data-gt-lang]');if(!link)return;const lang=link.getAttribute('data-gt-lang');const pageLang=getPageLanguage();if(lang&&lang!==pageLang)updateGtLanguageUi(lang);setPanelOpen(root,false);});}if(!Drupal.ctLanguageSelectorDocumentInit){Drupal.ctLanguageSelectorDocumentInit=true;document.addEventListener('click',(event)=>{document.querySelectorAll('[data-language-selector].is-open').forEach((root)=>{if(!root.contains(event.target))setPanelOpen(root,false);});});document.addEventListener('keydown',(event)=>{if(event.key==='Escape')document.querySelectorAll('[data-language-selector].is-open').forEach((root)=>{setPanelOpen(root,false);});});}function ensureGtranslateLinks(mount,attempts){if(!mount||mount.querySelector('a[data-gt-lang]'))return;if(attempts<1)return;window.setTimeout(()=>ensureGtranslateLinks(mount,attempts-1),300);}function scheduleGtRestoreOnLoad(){if(!shouldResetGtOnLoad())return;let attempts=0;const tick=()=>{attempts+=1;if(typeof window.doGTranslate==='function'||getGoogleTranslateCombo()){resetGoogleTranslateWidget();return;}if(attempts<30)window.setTimeout(tick,200);};tick();}Drupal.behaviors.ctLanguageSelector={attach(context){if(!Drupal.ctLanguageSelectorPageInit){Drupal.ctLanguageSelectorPageInit=true;resetGoogleTranslateOnDrupalPage();scheduleGtRestoreOnLoad();const applyLang=getApplyGtLang();if(applyLang)updateGtLanguageUi(applyLang);}const scope=context.querySelectorAll?context:document;scope.querySelectorAll('[data-language-selector]').forEach(initLanguageSelector);scope.querySelectorAll('.ct-language-selector__gt-mount').forEach((mount)=>{ensureGtranslateLinks(mount,20);});}};})(Drupal);; 511((Drupal,drupalSettings)=>{Drupal.extlink=Drupal.extlink||{};Drupal.extlink.attach=(context,drupalSettings)=>{if(typeof drupalSettings.data==='undefined'||!drupalSettings.data.hasOwnProperty('extlink'))return;let extIconPlacement='append';if(drupalSettings.data.extlink.extIconPlacement&&drupalSettings.data.extlink.extIconPlacement!=='0')extIconPlacement=drupalSettings.data.extlink.extIconPlacement;const pattern=/^(([^:]+?\.)*)([^.:]+)((\.[a-z0-9]{1,253})*)(:[0-9]{1,5})?$/;const host=window.location.host.replace(pattern,'$2$3$6');const subdomain=window.location.host.replace(host,'');let subdomains;if(drupalSettings.data.extlink.extSubdomains)subdomains='([^/]*\\.)?';else if(subdomain==='www.'||subdomain==='')subdomains='(www\\.)?';else subdomains=subdomain.replace('.','\\.');let allowedDomains=false;if(drupalSettings.data.extlink.allowedDomains){allowedDomains=[];for(let i=0;i<drupalSettings.data.extlink.allowedDomains.length;i++)allowedDomains.push(new RegExp(`^https?:\\/\\/${drupalSettings.data.extlink.allowedDomains[i].replace(/(\r\n|\n|\r)/gm,'')}.*$`,'i'));}const internalLink=new RegExp(`^https?://([^@]*@)?${subdomains}${host}`,'i');let extInclude=false;if(drupalSettings.data.extlink.extInclude)extInclude=new RegExp(drupalSettings.data.extlink.extInclude.replace(/\\/,'\\'),'i');let extExclude=false;if(drupalSettings.data.extlink.extExclude)extExclude=new RegExp(drupalSettings.data.extlink.extExclude.replace(/\\/,'\\'),'i');let extExcludeNoreferrer=false;if(drupalSettings.data.extlink.extExcludeNoreferrer)extExcludeNoreferrer=new RegExp(drupalSettings.data.extlink.extExcludeNoreferrer.replace(/\\/,'\\'),'i');let extCssExclude=false;if(drupalSettings.data.extlink.extCssExclude)extCssExclude=drupalSettings.data.extlink.extCssExclude;let extCssInclude=false;if(drupalSettings.data.extlink.extCssInclude)extCssInclude=drupalSettings.data.extlink.extCssInclude;let extCssExplicit=false;if(drupalSettings.data.extlink.extCssExplicit)extCssExplicit=drupalSettings.data.extlink.extCssExplicit;const externalLinks=[];const mailtoLinks=[];const telLinks=[];const extlinks=context.querySelectorAll('a:not([data-extlink]), area:not([data-extlink])');extlinks.forEach((el)=>{try{let url='';if(typeof el.href==='string')url=el.href.toLowerCase();else{if(typeof el.href==='object')url=el.href.baseVal;}
511const isExtCssIncluded=extCssInclude&&(el.matches(extCssInclude)||el.closest(extCssInclude));if(url.indexOf('http')===0&&((!internalLink.test(url)&&!(extExclude&&extExclude.test(url)))||(extInclude&&extInclude.test(url))||isExtCssIncluded)&&!(extCssExclude&&el.matches(extCssExclude))&&!(extCssExclude&&el.closest(extCssExclude))&&!(extCssExplicit&&!el.closest(extCssExplicit))){let match=false;if(!isExtCssIncluded&&allowedDomains){for(let i=0;i<allowedDomains.length;i++)if(allowedDomains[i].test(url)){match=true;break;}}if(!match)externalLinks.push(el);}else{if(el.tagName!=='AREA'&&!(extCssExclude&&el.closest(extCssExclude))&&!(extCssExplicit&&!el.closest(extCssExplicit)))if(url.indexOf('mailto:')===0)mailtoLinks.push(el);else{if(url.indexOf('tel:')===0)telLinks.push(el);}}}catch(error){return false;}});const hasExtIcon=drupalSettings.data.extlink.extClass!=='0'&&drupalSettings.data.extlink.extClass!=='';const hasAdditionalExtClasses=drupalSettings.data.extlink.extAdditionalLinkClasses!=='';Drupal.extlink.applyClassAndSpan(externalLinks,'ext',hasExtIcon?extIconPlacement:null);if(hasAdditionalExtClasses)Drupal.extlink.applyClassAndSpan(externalLinks,drupalSettings.data.extlink.extAdditionalLinkClasses,null);const hasMailtoClass=drupalSettings.data.extlink.mailtoClass!=='0'&&drupalSettings.data.extlink.mailtoClass!=='';const hasAdditionalMailtoClasses=drupalSettings.data.extlink.extAdditionalMailtoClasses!=='';if(hasMailtoClass)Drupal.extlink.applyClassAndSpan(mailtoLinks,drupalSettings.data.extlink.mailtoClass,extIconPlacement);if(hasAdditionalMailtoClasses)Drupal.extlink.applyClassAndSpan(mailtoLinks,drupalSettings.data.extlink.extAdditionalMailtoClasses,null);const hasTelClass=drupalSettings.data.extlink.telClass!=='0'&&drupalSettings.data.extlink.telClass!=='';const hasAdditionalTelClasses=drupalSettings.data.extlink.extAdditionalTelClasses!=='0'&&drupalSettings.data.extlink.extAdditionalTelClasses!=='';if(hasTelClass)Drupal.extlink.applyClassAndSpan(telLinks,drupalSettings.data.extlink.telClass,extIconPlacement);if(hasAdditionalTelClasses)Drupal.extlink.applyClassAndSpan(mailtoLinks,drupalSettings.data.extlink.extAdditionalTelClasses,null);if(drupalSettings.data.extlink.extTarget){externalLinks.forEach((link,i)=>{if(!(drupalSettings.data.extlink.extTargetNoOverride&&link.matches('a[target]')))externalLinks[i].setAttribute('target','_blank');});externalLinks.forEach((link,i)=>{const val=link.getAttribute('rel');if(val===null||typeof val==='undefined'){externalLinks[i].setAttribute('rel','noopener');return;}if(val.indexOf('noopener')>-1)if(val.indexOf('noopener')===-1)externalLinks[i].setAttribute('rel',`${val} noopener`);else{}else externalLinks[i].setAttribute('rel',`${val} noopener`);});}if(drupalSettings.data.extlink.extNofollow)externalLinks.forEach((link,i)=>{const val=link.getAttribute('rel');if(val===null||typeof val==='undefined'){externalLinks[i].setAttribute('rel','nofollow');return;}let target='nofollow';if(drupalSettings.data.extlink.extFollowNoOverride)target='follow';if(val.indexOf(target)===-1)externalLinks[i].setAttribute('rel',`${val} nofollow`);});if(drupalSettings.data.extlink.extTitleNoOverride===false)externalLinks.forEach((link,i)=>{const oldTitle=link.getAttribute('title');let newTitle='';if(drupalSettings.data.extlink.extTargetAppendNewWindowDisplay)newTitle=drupalSettings.data.extlink.extTargetAppendNewWindowLabel;if(oldTitle!==null){if(Drupal.extlink.hasNewWindowText(oldTitle))return;newTitle=Drupal.extlink.combineLabels(oldTitle,newTitle);}if(newTitle)externalLinks[i].setAttribute('title',newTitle);});if(drupalSettings.data.extlink.extNoreferrer)externalLinks.forEach((link,i)=>{if(drupalSettings.data.extlink.extExcludeNoreferrer&&extExcludeNoreferrer.test(link.getAttribute('href')))return;const val=link.getAttribute('rel');if(val===null||typeof val==='undefined'){externalLinks[i].setAttribute('rel','noreferrer');return;}externalLinks[i].setAttribute('rel',`${val} noreferrer`);});Drupal.extlink=Drupal.extlink||{};Drupal.extlink.popupClickHandler=Drupal.extlink.popupClickHandler||(()=>{if(drupalSettings.data.extlink.extAlert)return confirm(drupalSettings.data.extlink.extAlertText);});const _that=this;Drupal.extlink.handleClick=function(event){const shouldNavigate=Drupal.extlink.popupClickHandler.call(_that,event);if(typeof shouldNavigate!=='undefined'&&!shouldNavigate)event.preventDefault();};externalLinks.forEach((val,i)=>{externalLinks[i].removeEventListener('click',Drupal.extlink.handleClick);externalLinks[i].addEventListener('click',Drupal.extlink.handleClick);});};Drupal.extlink.hasNewWindowText=function(label){return label.toLowerCase().indexOf(Drupal.t('new window'))!==-1;};Drupal.extlink.combineLabels=function(labelA,labelB){labelA=labelA||'';labelB=labelB||'';if(!labelA.trim())return labelB;if(!labelB.trim())return labelA;const labelANoParens=labelA.trim().replace('(','').replace(')','');const labelBNoParens=labelB.trim().replace('(','').replace(')','');if(labelA===labelANoParens){if(labelB===labelBNoParens)return `${labelA}, ${labelB}`;return `${labelA} ${labelB}`;}if(labelB===labelBNoParens)return `${labelB} ${labelA}`;return `(${labelANoParens}, ${labelBNoParens})`;};Drupal.extlink.applyClassAndSpan=(links,className,iconPlacement)=>{let linksToProcess;if(drupalSettings.data.extlink.extImgClass)linksToProcess=links;else linksToProcess=links.filter((link)=>{return link.querySelector('img, svg')===null;});for(let i=0;i<linksToProcess.length;i++){if(className!=='0')linksToProcess[i].classList.add(className);if(className===drupalSettings.data.extlink.mailtoClass&&drupalSettings.data.extlink.extAdditionalMailtoClasse
511s)linksToProcess[i].classList.add(drupalSettings.data.extlink.extAdditionalMailtoClasses);else if(className===drupalSettings.data.extlink.telClass&&drupalSettings.data.extlink.extAdditionalTelClasses)linksToProcess[i].classList.add(drupalSettings.data.extlink.extAdditionalTelClasses);else{if(drupalSettings.data.extlink.extAdditionalLinkClasses)linksToProcess[i].classList.add(drupalSettings.data.extlink.extAdditionalLinkClasses);}linksToProcess[i].setAttribute('data-extlink','');if(iconPlacement){let link=linksToProcess[i];if(drupalSettings.data.extlink.extPreventOrphan&&iconPlacement==='append'){let lastTextNode=link.lastChild;let trailingWhitespace=null;let parentNode=link;while(lastTextNode)if(lastTextNode.lastChild){parentNode=lastTextNode;lastTextNode=lastTextNode.lastChild;}else if(lastTextNode.nodeName==='#text'&&parentNode.lastElementChild&&lastTextNode.textContent.trim().length===0){trailingWhitespace=lastTextNode;parentNode=parentNode.lastElementChild;lastTextNode=parentNode.lastChild;}else break;if(lastTextNode&&lastTextNode.nodeName==='#text'&&lastTextNode.textContent.length>0){const lastText=lastTextNode.textContent;const lastWordRegex=new RegExp(/\S+\s*$/,'g');const lastWord=lastText.match(lastWordRegex);if(lastWord!==null){const breakPreventer=document.createElement('span');breakPreventer.classList.add('extlink-nobreak');breakPreventer.textContent=lastWord[0];if(trailingWhitespace){trailingWhitespace.textContent='';breakPreventer.append(trailingWhitespace.textContent);}lastTextNode.textContent=lastText.substring(0,lastText.length-lastWord[0].length);lastTextNode.parentNode.append(breakPreventer);link=breakPreventer;}}}let iconElement;if(drupalSettings.data.extlink.extUseFontAwesome){iconElement=document.createElement('span');iconElement.setAttribute('class',`fa-${className} extlink`);if(className===drupalSettings.data.extlink.mailtoClass){if(drupalSettings.data.extlink.mailtoLabel)link.ariaLabel=drupalSettings.data.extlink.mailtoLabel;iconElement.innerHTML=Drupal.theme('extlink_fa_mailto',drupalSettings,iconPlacement);}else if(className===drupalSettings.data.extlink.extClass){if(drupalSettings.data.extlink.extLabel)link.ariaLabel=drupalSettings.data.extlink.extLabel;iconElement.innerHTML=Drupal.theme('extlink_fa_extlink',drupalSettings,iconPlacement);}else{if(className===drupalSettings.data.extlink.telClass){if(drupalSettings.data.extlink.telLabel)link.ariaLabel=drupalSettings.data.extlink.telLabel;iconElement.innerHTML=Drupal.theme('extlink_fa_tel',drupalSettings,iconPlacement);}}}else{iconElement=document.createElementNS('http://www.w3.org/2000/svg','svg');iconElement.setAttribute('focusable','false');iconElement.setAttribute('width','1em');iconElement.setAttribute('height','1em');iconElement.classList.add(className);iconElement.setAttribute('data-extlink-placement',iconPlacement);if(className===drupalSettings.data.extlink.mailtoClass)iconElement=Drupal.theme('extlink_mailto',iconElement,drupalSettings);else if(className===drupalSettings.data.extlink.extClass)iconElement=Drupal.theme('extlink_extlink',iconElement,drupalSettings);else{if(className===drupalSettings.data.extlink.telClass)iconElement=Drupal.theme('extlink_tel',iconElement,drupalSettings);}}iconElement.setAttribute('role','img');iconElement.setAttribute('aria-hidden',drupalSettings.data.extlink.extHideIcons);link[iconPlacement](iconElement);}}};Drupal.theme.extlink_fa_mailto=function(drupalSettings,iconPlacement){return `<span class="${drupalSettings.data.extlink.extFaMailtoClasses}" data-extlink-placement="${iconPlacement}"></span>`;};Drupal.theme.extlink_fa_extlink=function(drupalSettings,iconPlacement){return `<span class="${drupalSettings.data.extlink.extFaLinkClasses}" data-extlink-placement="${iconPlacement}"></span>`;};Drupal.theme.extlink_fa_tel=function(drupalSettings,iconPlacement){return `<span class="${drupalSettings.data.extlink.extFaTelClasses}" data-extlink-placement="${iconPlacement}"></span>`;};Drupal.theme.extlink_mailto=function(iconElement,drupalSettings){iconElement.setAttribute('aria-label',drupalSettings.data.extlink.mailtoLabel);iconElement.setAttribute('viewBox','0 10 70 20');iconElement.innerHTML=`<title>${drupalSettings.data.extlink.mailtoLabel}</title><path d="M56 14H8c-1.1 0-2 0.9-2 2v32c0 1.1 0.9 2 2 2h48c1.1 0 2-0.9 2-2V16C58 14.9 57.1 14 56 14zM50.5 18L32 33.4 13.5 18H50.5zM10 46V20.3l20.7 17.3C31.1 37.8 31.5 38 32 38s0.9-0.2 1.3-0.5L54 20.3V46H10z"/>`;return iconElement;};Drupal.theme.extlink_extlink=function(iconElement,drupalSettings){iconElement.setAttribute('aria-label',drupalSettings.data.extlink.extLabel);iconElement.setAttribute('viewBox','0 0 80 40');iconElement.innerHTML=`<title>${drupalSettings.data.extlink.extLabel}</title><path d="M48 26c-1.1 0-2 0.9-2 2v26H10V18h26c1.1 0 2-0.9 2-2s-0.9-2-2-2H8c-1.1 0-2 0.9-2 2v40c0 1.1 0.9 2 2 2h40c1.1 0 2-0.9 2-2V28C50 26.9 49.1 26 48 26z"/><path d="M56 6H44c-1.1 0-2 0.9-2 2s0.9 2 2 2h7.2L30.6 30.6c-0.8 0.8-0.8 2 0 2.8C31 33.8 31.5 34 32 34s1-0.2 1.4-0.6L54 12.8V20c0 1.1 0.9 2 2 2s2-0.9 2-2V8C58 6.9 57.1 6 56 6z"/>`;return iconElement;};Drupal.theme.extlink_tel=function(iconElement,drupalSettings){iconElement.setAttribute('aria-label',drupalSettings.data.extlink.telLabel);iconElement.setAttribute('viewBox','0 0 181.352 181.352');iconElement.innerHTML=`<title>${drupalSettings.data.extlink.telLabel}</title><path xmlns="http://www.w3.org/2000/svg" d="M169.393,167.37l-14.919,9.848c-9.604,6.614-50.531,14.049-106.211-53.404C-5.415,58.873,9.934,22.86,17.134,14.555L29.523,1.678c2.921-2.491,7.328-2.198,9.839,0.811l32.583,38.543l0.02,0.02c2.384,2.824,2.306,7.22-0.83,9.868v0.029l-14.44,10.415c-5.716,5.667-0.733,14.587,5.11,23.204l27.786,32.808c12.926,12.477,20.009,18.241,26.194,14.118l12.008-13.395c2.941-2.472,7.328-2.169,9.839,0.821l32.603,38.543v0.02C172.607,160.316,172.519,164.703,169.393,167.37z"/>`;return iconElement;};Drupal.behaviors.extlink=Drupal.behaviors.extlink||{};Drupal.behaviors.extlink.attach=(context,drupalSettings)=>{if(typeof extlinkAttach==='function')extlinkAttach(context);else Drupal.extlink.attach(context,drupalSettings);};})(Drupal,drupalSettings);;
512/* @license GPL-2.0-or-later https://raw.githubusercontent.com/jquery-form/form/master/LICENSE */ 513(function(factory){if(typeof define==='function'&&define.amd)define(['jquery'],factory);else if(typeof module==='object'&&module.exports)module.exports=function(root,jQuery){if(typeof jQuery==='undefined')if(typeof window!=='undefined')jQuery=require('jquery');else jQuery=require('jquery')(root);factory(jQuery);return jQuery;};else factory(jQuery);}(function($){'use strict';var rCRLF=/\r?\n/g;var feature={};feature.fileapi=$('<input type="file">').get(0).files!==undefined;feature.formdata=(typeof window.FormData!=='undefined');var hasProp=!!$.fn.prop;$.fn.attr2=function(){if(!hasProp)return this.attr.apply(this,arguments);var val=this.prop.apply(this,arguments);if((val&&val.jquery)||typeof val==='string')return val;return this.attr.apply(this,arguments);};$.fn.ajaxSubmit=function(options,data,dataType,onSuccess){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}var method,action,url,isMsie,iframeSrc,$form=this;if(typeof options==='function')options={success:options};else if(typeof options==='string'||(options===false&&arguments.length>0)){options={'url':options,'data':data,'dataType':dataType};if(typeof onSuccess==='function')options.success=onSuccess;}else{if(typeof options==='undefined')options={};}method=options.method||options.type||this.attr2('method');action=options.url||this.attr2('action');url=(typeof action==='string')?action.trim():'';url=url||window.location.href||'';if(url)url=(url.match(/^([^#]+)/)||[])[1];isMsie=/(MSIE|Trident)/.test(navigator.userAgent||'');iframeSrc=(isMsie&&/^https/i.test(window.location.href||''))?'javascript:false':'about:blank';options=$.extend(true,{url,success:$.ajaxSettings.success,type:method||$.ajaxSettings.type,iframeSrc},options);var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}var traditional=options.traditional;if(typeof traditional==='undefined')traditional=$.ajaxSettings.traditional;var elements=[];var qx,a=this.formToArray(options.semantic,elements,options.filtering);if(options.data){var optionsData=typeof (options.data)==="function"?options.data(a):options.data;options.extraData=optionsData;qx=$.param(optionsData,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}var q=$.param(a,traditional);if(qx)q=(q?(q+'&'+qx):qx);if(options.type.toUpperCase()==='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}else options.data=q;var callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm(options.includeHidden);});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data,textStatus,jqXHR){var successArguments=arguments,fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(function(){oldSuccess.apply(this,successArguments);});});}else{if(options.success)if(Array.isArray(options.success))callbacks=callbacks.concat(options.success);else callbacks.push(options.success);}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++)callbacks[i].apply(context,[data,status,xhr||$form,$form]);};if(options.error){var oldError=options.error;options.error=function(xhr,status,error){var context=options.context||this;oldError.apply(context,[xhr,status,error,$form]);};}if(options.complete){var oldComplete=options.complete;options.complete=function(xhr,status){var context=options.context||this;oldComplete.apply(context,[xhr,status,$form]);};}var fileInputs=$('input[type=file]:enabled',this).filter(function(){return $(this).val()!=='';});var hasFileInputs=fileInputs.length>0;var mp='multipart/form-data';var multipart=($form.attr('enctype')===mp||$form.attr('encoding')===mp);var fileAPI=feature.fileapi&&feature.formdata;log('fileAPI :'+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame))if(options.closeKeepAlive)$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});else jqxhr=fileUploadIframe(a);else if((hasFileInputs||multipart)&&fileAPI)jqxhr=fileUploadXhr(a);else jqxhr=$.ajax(options);$form.removeData('jqxhr').data('jqxhr',jqxhr);for(var k=0;k<elements.length;k++)elements[k]=null;this.trigger('form-submit-notify',[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData,options.traditional).split('&');var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g,' ');part=serialized[i].split('=');result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}return result;}function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++)formdata.append(a[i].name,a[i].value);if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++)if(serializedData[i])formdata.append(serializedData[i][0],serializedData[i][1]);}options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||'POST'});if(options.uploadProgress)s.xhr=function(){var xhr=$.ajaxSettings.xhr();if(xhr.upload)xhr.upload.addEventListener('progress',function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable)percent=Math.ceil(position/total*100);options.uploadProgress(event,position,total,percent);},false);return xhr;};s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){if(options.formData)o.data=options.formData;else o.data=formdata;
513if(beforeSend)beforeSend.call(this,xhr,o);};return $.ajax(s);}function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var deferred=$.Deferred();deferred.abort=function(status){xhr.abort(status);};if(a)for(i=0;i<elements.length;i++){el=$(elements[i]);if(hasProp)el.prop('disabled',false);else el.removeAttr('disabled');}s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id='jqFormIO'+new Date().getTime();var ownerDocument=form.ownerDocument;var $body=$form.closest('body');if(s.iframeTarget){$io=$(s.iframeTarget,ownerDocument);n=$io.attr2('name');if(!n)$io.attr2('name',id);else id=n;}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />',ownerDocument);$io.css({position:'absolute',top:'-1000px',left:'-1000px'});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;try{if(io.contentWindow.document.execCommand)io.contentWindow.document.execCommand('Stop');}catch(ignore){}$io.attr('src',s.iframeSrc);xhr.error=e;if(s.error)s.error.call(s.context,xhr,e,status);if(g)$.event.trigger('ajaxError',[xhr,s,e]);if(s.complete)s.complete.call(s.context,xhr,e);}};g=s.global;if(g&&$.active++===0)$.event.trigger('ajaxStart');if(g)$.event.trigger('ajaxSend',[xhr,s]);if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global)$.active--;deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type==='image'){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=null;try{if(frame.contentWindow)doc=frame.contentWindow.document;}catch(err){log('cannot get iframe.contentWindow document: '+err);}if(doc)return doc;try{doc=frame.contentDocument?frame.contentDocument:frame.document;}catch(err){log('cannot get iframe.contentDocument: '+err);doc=frame.document;}return doc;}var csrf_token=$('meta[name=csrf-token]').attr('content');var csrf_param=$('meta[name=csrf-param]').attr('content');if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr2('target'),a=$form.attr2('action'),mp='multipart/form-data',et=$form.attr('enctype')||$form.attr('encoding')||mp;form.setAttribute('target',id);if(!method||/post/i.test(method))form.setAttribute('method','POST');if(a!==s.url)form.setAttribute('action',s.url);if(!s.skipEncodingOverride&&(!method||/post/i.test(method)))$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});if(s.timeout)timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state&&state.toLowerCase()==='uninitialized')setTimeout(checkState,50);}catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);if(timeoutHandle)clearTimeout(timeoutHandle);timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData)for(var n in s.extraData)if(s.extraData.hasOwnProperty(n))if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty('name')&&s.extraData[n].hasOwnProperty('value'))extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">',ownerDocument).val(s.extraData[n].value).appendTo(form)[0]);else extraInputs.push($('<input type="hidden" name="'+n+'">',ownerDocument).val(s.extraData[n]).appendTo(form)[0]);if(!s.iframeTarget)$io.appendTo($body);if(io.attachEvent)io.attachEvent('onload',cb);else io.addEventListener('load',cb,false);setTimeout(checkState,15);try{form.submit();}catch(err){var submitFn=document.createElement('form').submit;submitFn.apply(form);}}finally{form.setAttribute('action',a);form.setAttribute('enctype',et);if(t)form.setAttribute('target',t);else $form.removeAttr('target');$(extraInputs).remove();}}if(s.forceSync)doSubmit();else setTimeout(doSubmit,10);var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed)return;doc=getDoc(io);if(!doc){log('cannot access response document');e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');deferred.reject(xhr,'timeout');return;}if(e===SERVER_ABORT&&xhr){xhr.abort('server abort');deferred.reject(xhr,'error','server abort');return;}if(!doc||doc.location.href===s.iframeSrc)if(!timedOut)return;if(io.detachEvent)io.detachEvent('onload',cb);else io.removeEventListener('load',cb,false);var status='success',errMsg;
513try{if(timedOut)throw 'timeout';var isXml=s.dataType==='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML))if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml)s.dataType='xml';xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header.toLowerCase()];};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText;}var dt=(s.dataType||'').toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName('pre')[0];var b=doc.getElementsByTagName('body')[0];if(pre)xhr.responseText=pre.textContent?pre.textContent:pre.innerText;else{if(b)xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}else{if(dt==='xml'&&!xhr.responseXML&&xhr.responseText)xhr.responseXML=toXml(xhr.responseText);}try{data=httpData(xhr,dt,s);}catch(err){status='parsererror';xhr.error=errMsg=(err||status);}}catch(err){log('error caught: ',err);status='error';xhr.error=errMsg=(err||status);}if(xhr.aborted){log('upload aborted');status=null;}if(xhr.status)status=((xhr.status>=200&&xhr.status<300)||xhr.status===304)?'success':'error';if(status==='success'){if(s.success)s.success.call(s.context,data,'success',xhr);deferred.resolve(xhr.responseText,'success',xhr);if(g)$.event.trigger('ajaxSuccess',[xhr,s]);}else{if(status){if(typeof errMsg==='undefined')errMsg=xhr.statusText;if(s.error)s.error.call(s.context,xhr,status,errMsg);deferred.reject(xhr,'error',errMsg);if(g)$.event.trigger('ajaxError',[xhr,s,errMsg]);}}if(g)$.event.trigger('ajaxComplete',[xhr,s]);if(g&&!--$.active)$.event.trigger('ajaxStop');if(s.complete)s.complete.call(s.context,xhr,status);callbackProcessed=true;if(s.timeout)clearTimeout(timeoutHandle);setTimeout(function(){if(!s.iframeTarget)$io.remove();else $io.attr('src',s.iframeSrc);xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}else doc=(new DOMParser()).parseFromString(s,'text/xml');return (doc&&doc.documentElement&&doc.documentElement.nodeName!=='parsererror')?doc:null;};var parseJSON=$.parseJSON||function(s){return window['eval']('('+s+')');};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=((type==='xml'||!type)&&ct.indexOf('xml')>=0),data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror')if($.error)$.error('parsererror');if(s&&s.dataFilter)data=s.dataFilter(data,type);if(typeof data==='string')if((type==='json'||!type)&&ct.indexOf('json')>=0)data=parseJSON(data);else{if((type==='script'||!type)&&ct.indexOf('javascript')>=0)$.globalEval(data);}return data;};return deferred;}};$.fn.ajaxForm=function(options,data,dataType,onSuccess){if(typeof options==='string'||(options===false&&arguments.length>0)){options={'url':options,'data':data,'dataType':dataType};if(typeof onSuccess==='function')options.success=onSuccess;}options=options||{};options.delegation=options.delegation&&typeof $.fn.on==='function';if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this;}if(options.delegation){$(document).off('submit.form-plugin',this.selector,doAjaxSubmit).off('click.form-plugin',this.selector,captureSubmittingElement).on('submit.form-plugin',this.selector,options,doAjaxSubmit).on('click.form-plugin',this.selector,options,captureSubmittingElement);return this;}if(options.beforeFormUnbind)options.beforeFormUnbind(this,options);return this.ajaxFormUnbind().on('submit.form-plugin',options,doAjaxSubmit).on('click.form-plugin',options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(e.target).closest('form').ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!$el.is('[type=submit],[type=image]')){var t=$el.closest('[type=submit]');if(t.length===0)return;target=t[0];}var form=target.form;form.clk=target;if(target.type==='image')if(typeof e.offsetX!=='undefined'){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset==='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.off('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic,elements,filtering){var a=[];if(this.length===0)return a;var form=this[0];var formId=this.attr('id');var els=(semantic||typeof form.elements==='undefined')?form.getElementsByTagName('*'):form.elements;var els2;if(els)els=$.makeArray(els);if(formId&&(semantic||/(Edge|Trident)\//.test(navigator.userAgent))){els2=$(':input[form="'+formId+'"]').get();if(els2.length)els=(els||[]).concat(els2);}if(!els||!els.length)return a;
513if(typeof (filtering)==="function")els=$.map(els,filtering);var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n||el.disabled)continue;if(semantic&&form.clk&&el.type==='image'){if(form.clk===el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}continue;}v=$.fieldValue(el,true);if(v&&v.constructor===Array){if(elements)elements.push(el);for(j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]});}else if(feature.fileapi&&el.type==='file'){if(elements)elements.push(el);var files=el.files;if(files.length)for(j=0;j<files.length;j++)a.push({name:n,value:files[j],type:el.type});else a.push({name:n,value:'',type:el.type});}else{if(v!==null&&typeof v!=='undefined'){if(elements)elements.push(el);a.push({name:n,value:v,type:el.type,required:el.required});}}}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type==='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor===Array)for(var i=0,max=v.length;i<max;i++)a.push({name:n,value:v[i]});else{if(v!==null&&typeof v!=='undefined')a.push({name:this.name,value:v});}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v==='undefined'||(v.constructor===Array&&!v.length))continue;if(Array.isArray(v))val=val.concat(v);else val.push(v);}return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful==='undefined')successful=true;if(successful&&(!n||el.disabled||t==='reset'||t==='button'||(t==='checkbox'||t==='radio')&&!el.checked||(t==='submit'||t==='image')&&el.form&&el.form.clk!==el||tag==='select'&&el.selectedIndex===-1))return null;if(tag==='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t==='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected&&!op.disabled){var v=op.value;if(!v)v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;if(one)return v;a.push(v);}}return a;}return $(el).val().replace(rCRLF,'\r\n');};$.fn.clearForm=function(includeHidden){return this.each(function(){$('input,select,textarea',this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag==='textarea')this.value='';else if(t==='checkbox'||t==='radio')this.checked=false;else if(tag==='select')this.selectedIndex=-1;else if(t==='file')if(/MSIE/.test(navigator.userAgent))$(this).replaceWith($(this).clone(true));else $(this).val('');else{if(includeHidden)if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden==='string'&&$(this).is(includeHidden)))this.value='';}});};$.fn.resetForm=function(){return this.each(function(){var el=$(this);var tag=this.tagName.toLowerCase();switch(tag){case 'input':this.checked=this.defaultChecked;case 'textarea':this.value=this.defaultValue;return true;case 'option':case 'optgroup':var select=el.parents('select');if(select.length&&select[0].multiple)if(tag==='option')this.selected=this.defaultSelected;else el.find('option').resetForm();else select.resetForm();return true;case 'select':el.find('option').each(function(i){this.selected=this.defaultSelected;if(this.defaultSelected&&!el[0].multiple){el[0].selectedIndex=i;return false;}});return true;case 'label':var forEl=$(el.attr('for'));var list=el.find('input,select,textarea');if(forEl[0])list.unshift(forEl[0]);list.resetForm();return true;case 'form':if(typeof this.reset==='function'||(typeof this.reset==='object'&&!this.reset.nodeType))this.reset();return true;default:el.find('form,input,label,select,textarea').resetForm();return true;}}
513);};$.fn.enable=function(b){if(typeof b==='undefined')b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(typeof select==='undefined')select=true;return this.each(function(){var t=this.type;if(t==='checkbox'||t==='radio')this.checked=select;else{if(this.tagName.toLowerCase()==='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type==='select-one')$sel.find('option').selected(false);this.selected=select;}}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug)return;var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log)window.console.log(msg);else{if(window.opera&&window.opera.postError)window.opera.postError(msg);}}}));; 514/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 515(function($,Drupal,drupalSettings){Drupal.Views={};Drupal.Views.parseQueryString=function(query){const args={};if(query.includes('?'))query=query.substring(query.indexOf('?')+1);let pair;const pairs=query.split('&');for(let i=0;i<pairs.length;i++){pair=pairs[i].split('=');if(pair[0]!=='q')if(pair[1])args[decodeURIComponent(pair[0].replace(/\+/g,' '))]=decodeURIComponent(pair[1].replace(/\+/g,' '));else args[decodeURIComponent(pair[0].replace(/\+/g,' '))]='';}return args;};Drupal.Views.parseViewArgs=function(href,viewPath){const returnObj={};const path=Drupal.Views.getPath(href);const viewHref=Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length);if(viewHref&&path.startsWith(`${viewHref}/`)){returnObj.view_args=decodeURIComponent(path.substring(viewHref.length+1,path.length));returnObj.view_path=path;}return returnObj;};Drupal.Views.pathPortion=function(href){const protocol=window.location.protocol;if(href.startsWith(protocol))href=href.substring(href.indexOf('/',protocol.length+2));return href;};Drupal.Views.getPath=function(href){href=Drupal.Views.pathPortion(href);href=href.substring(drupalSettings.path.baseUrl.length,href.length);if(href.startsWith('?q='))href=href.substring(3,href.length);const chars=['#','?','&'];for(let i=0;i<chars.length;i++)if(href.includes(chars[i]))href=href.substring(0,href.indexOf(chars[i]));return href;};})(jQuery,Drupal,drupalSettings);; 516(function($,Drupal,drupalSettings){Drupal.behaviors.ViewsAjaxView={};Drupal.behaviors.ViewsAjaxView.attach=function(context,settings){if(settings&&settings.views&&settings.views.ajaxViews){const {views:{ajaxViews}}=settings;Object.keys(ajaxViews||{}).forEach((i)=>{Drupal.views.instances[i]=new Drupal.views.ajaxView(ajaxViews[i]);});}};Drupal.behaviors.ViewsAjaxView.detach=(context,settings,trigger)=>{if(trigger==='unload')if(settings&&settings.views&&settings.views.ajaxViews){const {views:{ajaxViews}}=settings;Object.keys(ajaxViews||{}).forEach((i)=>{const selector=`.js-view-dom-id-${ajaxViews[i].view_dom_id}`;if($(selector,context).length){delete Drupal.views.instances[i];delete settings.views.ajaxViews[i];}});}};Drupal.views={};Drupal.views.instances={};Drupal.views.ajaxView=function(settings){const selector=`.js-view-dom-id-${settings.view_dom_id}`;this.$view=$(selector);let ajaxPath=drupalSettings.views.ajax_path;if(ajaxPath.constructor.toString().includes('Array'))ajaxPath=ajaxPath[0];let queryString=window.location.search||'';if(queryString!==''){queryString=queryString.slice(1).replace(/q=[^&]+&?|page=[^&]+&?|&?render=[^&]+/,'');if(queryString!=='')queryString=(/\?/.test(ajaxPath)?'&':'?')+queryString;}this.element_settings={url:ajaxPath+queryString,submit:settings,httpMethod:'GET',setClick:true,event:'click',selector,progress:{type:'fullscreen'}};this.settings=settings;this.$exposed_form=$(`form#views-exposed-form-${settings.view_name.replace(/_/g,'-')}-${settings.view_display_id.replace(/_/g,'-')}`);once('exposed-form',this.$exposed_form).forEach(this.attachExposedFormAjax.bind(this));once('ajax-pager',this.$view.filter(this.filterNestedViews.bind(this))).forEach(this.attachPagerAjax.bind(this));const selfSettings=$.extend({},this.element_settings,{event:'RefreshView',base:this.selector,httpMethod:'GET',element:this.$view.get(0)});this.refreshViewAjax=Drupal.ajax(selfSettings);};Drupal.views.ajaxView.prototype.attachExposedFormAjax=function(){const that=this;this.exposedFormAjax=[];$('input[type=submit], button[type=submit], input[type=image]',this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function(index){const selfSettings=$.extend({},that.element_settings,{base:$(this).attr('id'),element:this});that.exposedFormAjax[index]=Drupal.ajax(selfSettings);});};Drupal.views.ajaxView.prototype.filterNestedViews=function(){return !this.$view.parents('.view').length;};Drupal.views.ajaxView.prototype.attachPagerAjax=function(){this.$view.find('.js-pager__items a, th.views-field a, .attachment .views-summary a').each(this.attachPagerLinkAjax.bind(this));};Drupal.views.ajaxView.prototype.attachPagerLinkAjax=function(id,link){const $link=$(link);const viewData={};const href=$link.attr('href');$.extend(viewData,this.settings,Drupal.Views.parseQueryString(href),Drupal.Views.parseViewArgs(href,this.settings.view_base_path));const selfSettings=$.extend({},this.element_settings,{submit:viewData,base:false,element:link,httpMethod:'GET'});this.pagerAjax=Drupal.ajax(selfSettings);};Drupal.AjaxCommands.prototype.viewsScrollTop=function(ajax,response){Drupal.AjaxCommands.prototype.scrollTop(ajax,response);};})(jQuery,Drupal,drupalSettings);; 517(function($,Drupal,debounce){"use strict";var $window=$(window);var scrollThreshold=200;var automaticPagerSelector='[data-drupal-views-infinite-scroll-pager
517="automatic"]';var pagerSelector='[data-drupal-views-infinite-scroll-pager]';var contentWrapperSelector='[data-drupal-views-infinite-scroll-content-wrapper]';var scrollEvent='scroll.views_infinite_scroll';$.fn.infiniteScrollInsertView=function($newView){var matches=/(js-view-dom-id-\w+)/.exec(this.attr('class'));if(!matches)return;var currentViewId=matches[1].replace('js-view-dom-id-','views_dom_id:');var view=Drupal.views.instances[currentViewId];once.remove('ajax-pager',view.$view);once.remove('exposed-form',view.$exposed_form);var $existingPager=view.$view.find(pagerSelector);once.remove('infinite-scroll',$existingPager);var $newRows=$newView.find(contentWrapperSelector).children();var $newPager=$newView.find(pagerSelector);view.$view.find(contentWrapperSelector).trigger('views_infinite_scroll.new_content',$newRows.clone()).append($newRows);$existingPager.replaceWith($newPager);Drupal.attachBehaviors(view.$view[0]);};Drupal.behaviors.views_infinite_scroll_automatic={attach:function(context,settings){once('infinite-scroll',automaticPagerSelector,context).forEach(function(elem){var $pager=$(elem);$pager.addClass('visually-hidden');var isLoadNeeded=function(){return window.innerHeight+window.pageYOffset>$pager.offset().top-scrollThreshold;};$window.on(scrollEvent,debounce(function(){if(isLoadNeeded()){$pager.find('[rel=next]').click();$window.off(scrollEvent);}},200));if(isLoadNeeded())$window.trigger(scrollEvent);});},detach:function(context,settings,trigger){if(trigger==='unload')if(once.remove('infinite-scroll',automaticPagerSelector,context).length)$window.off(scrollEvent);}};Drupal.views.ajaxView.prototype.filterNestedViews=function(){return this.$view.hasClass('view-eva')||!this.$view.parents('.view').length;};})(jQuery,Drupal,Drupal.debounce);;
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.