PageSourceSearch

https://salangen-nyheter.com/src/include/jsCombine.php?loc=footer&pos=early&type=minside&ver=1790285460

js salangen-nyheter.com collected 2026-09-25 06:56:48 UTC 258,442 bytes, 353 lines download raw bytes

1(function($){'use strict';var MODAL_CONFIG={zIndex:9999,animationDuration:300,overlayOpacity:0.5,maxWidth:440,minWidth:300};var MODAL_TYPES={ALERT:'alert',CONFIRM:'confirm',PROMPT:'prompt',CUSTOM:'custom'};var DEFAULT_TEXTS={ok:'OK',cancel:'Avbryt',yes:'Ja',no:'Nei',confirm:'Bekreft',close:'Lukk'};function showModal(options){return $.Deferred(function(defer){var config=$.extend({type:MODAL_TYPES.ALERT,title:'',message:'',buttons:[],width:MODAL_CONFIG.maxWidth,height:'auto',closable:!0,onClose:null,isError:!1},options);var modalHtml=createModalHTML(config);var $modal=$(modalHtml).appendTo('body');if(config.isError){$modal.find('.nf-modal-container').addClass('nf-modal-error')}
2try{positionModal($modal);showModalWithAnimation($modal,config)}catch(error){$modal.show()}
3setupModalEvents($modal,config,defer)}).promise()}
4function createModalHTML(config){var modalId='nf-modal-'+Date.now();var buttonHtml=createButtonHTML(config.buttons,config.type);var viewportW=(typeof window!=='undefined'&&window.innerWidth)?window.innerWidth:(typeof document!=='undefined'&&document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:500;var effectiveMaxWidth=Math.min(config.width,Math.max(260,viewportW-40));return'<div id="'+modalId+'" class="nf-modal-overlay">'+'<div class="nf-modal-container" style="max-width: '+effectiveMaxWidth+'px; height: '+config.height+';">'+'<div class="nf-modal-header">'+'<h3 class="nf-modal-title">'+config.title+'</h3>'+(config.closable?'<button type="button" class="nf-modal-close">&times;</button>':'')+'</div>'+'<div class="nf-modal-body">'+'<div class="nf-modal-message">'+config.message+'</div>'+(config.type===MODAL_TYPES.PROMPT?'<input type="text" class="nf-modal-input" placeholder="Skriv inn tekst..." value="'+(config.defaultValue||'').replace(/"/g,'&quot;')+'">':'')+'</div>'+'<div class="nf-modal-footer">'+buttonHtml+'</div>'+'</div></div>'}
5function createButtonHTML(buttons,type){if(buttons&&buttons.length>0){return $.map(buttons,function(btn){return'<button type="button" class="nf-modal-btn '+(btn.class||'')+'" data-action="'+(btn.action||'custom')+'">'+btn.text+'</button>'}).join('')}
6switch(type){case MODAL_TYPES.ALERT:return'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="ok">'+DEFAULT_TEXTS.ok+'</button>';case MODAL_TYPES.CONFIRM:return'<button type="button" class="nf-modal-btn nf-modal-btn-secondary" data-action="cancel">'+DEFAULT_TEXTS.cancel+'</button>'+'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="confirm">'+DEFAULT_TEXTS.confirm+'</button>';case MODAL_TYPES.PROMPT:return'<button type="button" class="nf-modal-btn nf-modal-btn-secondary" data-action="cancel">'+DEFAULT_TEXTS.cancel+'</button>'+'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="ok">'+DEFAULT_TEXTS.ok+'</button>';default:return'<button type="button" class="nf-modal-btn nf-modal-btn-primary" data-action="ok">'+DEFAULT_TEXTS.ok+'</button>'}}
7function positionModal($modal){var $container=$modal.find('.nf-modal-container');if($container.length===0){return}
8$container.css({position:'fixed',top:'50%',left:'50%',transform:'translate(-50%, -50%)',margin:'0'})}
9function showModalWithAnimation($modal,config){$modal.fadeIn(MODAL_CONFIG.animationDuration);$modal.find('.nf-modal-container').addClass('nf-modal-show');setTimeout(function(){var $input=$modal.find('.nf-modal-input');var $button=$modal.find('.nf-modal-btn').first();if($input.length){if(config.defaultValue){$input[0].select()}
10$input.focus()}else if($button.length){$button.focus()}},100)}
11function setupModalEvents($modal,config,defer){var modalId=$modal.attr('id');$modal.on('click','.nf-modal-btn',function(e){e.preventDefault();var action=$(this).data('action');var inputValue=$modal.find('.nf-modal-input').val();closeModal($modal,function(){if(config.type===MODAL_TYPES.PROMPT){defer.resolve({action:action,value:inputValue})}else{defer.resolve({action:action})}})});$modal.on('click','.nf-modal-close',function(e){e.preventDefault();closeModal($modal,function(){defer.resolve({action:'cancel'})})});if(config.closable){$modal.on('click',function(e){if(e.target===this){closeModal($modal,function(){defer.resolve({action:'cancel'})})}})}
12$(document).on('keydown.nf-modal-'+modalId,function(e){if(e.keyCode===27&&config.closable){closeModal($modal,function(){defer.resolve({action:'cancel'})})}else if(e.keyCode===13&&config.type===MODAL_TYPES.PROMPT){var inputValue=$modal.find('.nf-modal-input').val();closeModal($modal,function(){defer.resolve({action:'ok',value:inputValue})})}});if(config.type===MODAL_TYPES.PROMPT){$modal.on('keydown','.nf-modal-input',function(e){if(e.keyCode===13){e.preventDefault();$modal.find('.nf-modal-btn[data-action="ok"]').click()}})}}
13function closeModal($modal,callback){var modalId=$modal.attr('id');$modal.find('.nf-modal-container').removeClass('nf-modal-show');$modal.fadeOut(MODAL_CONFIG.animationDuration,function(){$(document).off('keydown.nf-modal-'+modalId);$modal.remove();if(callback)callback();})}
14window.NFModal={close:function(){var $overlay=$('.nf-modal-overlay');if($overlay.length){var mid=$overlay.attr('id');
14if(mid)$(document).off('keydown.nf-modal-'+mid);$overlay.remove()}},alert:function(message,title,isError){title=title||'Melding';isError=isError||!1;return showModal({type:MODAL_TYPES.ALERT,title:title,message:message,isError:isError})},confirm:function(message,title){title=title||'Bekreft';return showModal({type:MODAL_TYPES.CONFIRM,title:title,message:message})},prompt:function(message,title,defaultValue){title=title||'Inndata';defaultValue=defaultValue||'';return showModal({type:MODAL_TYPES.PROMPT,title:title,message:message,defaultValue:defaultValue})},show:function(options){return showModal($.extend({type:MODAL_TYPES.CUSTOM},options))}}})(jQuery);var CryptoJS=CryptoJS||function(s,p){var m={},l=m.lib={},n=function(){},r=l.Base={extend:function(b){n.prototype=this;var h=new n;b&&h.mixIn(b);h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)});h.init.prototype=h;h.$super=this;return h},create:function(){var b=this.extend();b.init.apply(b,arguments);return b},init:function(){},mixIn:function(b){for(var h in b)b.hasOwnProperty(h)&&(this[h]=b[h]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}},q=l.WordArray=r.extend({init:function(b,h){b=this.words=b||[];this.sigBytes=h!=p?h:4*b.length},toString:function(b){return(b||t).stringify(this)},concat:function(b){var h=this.words,a=b.words,j=this.sigBytes;b=b.sigBytes;this.clamp();if(j%4)for(var g=0;g<b;g++)h[j+g>>>2]|=(a[g>>>2]>>>24-8*(g%4)&255)<<24-8*((j+g)%4);else if(65535<a.length)for(g=0;g<b;g+=4)h[j+g>>>2]=a[g>>>2];else h.push.apply(h,a);this.sigBytes+=b;return this},clamp:function(){var b=this.words,h=this.sigBytes;b[h>>>2]&=4294967295<<32-8*(h%4);b.length=s.ceil(h/4)},clone:function(){var b=r.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var h=[],a=0;a<b;a+=4)h.push(4294967296*s.random()|0);return new q.init(h,b)}}),v=m.enc={},t=v.Hex={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++){var k=a[j>>>2]>>>24-8*(j%4)&255;g.push((k>>>4).toString(16));g.push((k&15).toString(16))}return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j+=2)g[j>>>3]|=parseInt(b.substr(j,2),16)<<24-4*(j%8);return new q.init(g,a/2)}},a=v.Latin1={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j<b;j++)g.push(String.fromCharCode(a[j>>>2]>>>24-8*(j%4)&255));return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j<a;j++)g[j>>>2]|=(b.charCodeAt(j)&255)<<24-8*(j%4);return new q.init(g,a)}},u=v.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(g){throw Error("Malformed UTF-8 data")}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}},g=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new q.init;this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=u.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,g=a.words,j=a.sigBytes,k=this.blockSize,m=j/(4*k),m=b?s.ceil(m):s.max((m|0)-this._minBufferSize,0);b=m*k;j=s.min(4*b,j);if(b){for(var l=0;l<b;l+=k)this._doProcessBlock(g,l);l=g.splice(0,b);a.sigBytes-=j}return new q.init(l,j)},clone:function(){var b=r.clone.call(this);b._data=this._data.clone();return b},_minBufferSize:0});l.Hasher=g.extend({cfg:r.extend(),init:function(b){this.cfg=this.cfg.extend(b);this.reset()},reset:function(){g.reset.call(this);this._doReset()},update:function(b){this._append(b);this._process();return this},finalize:function(b){b&&this._append(b);return this._doFinalize()},blockSize:16,_createHelper:function(b){return function(a,g){return(new b.init(g)).finalize(a)}},_createHmacHelper:function(b){return function(a,g){return(new k.HMAC.init(b,g)).finalize(a)}}});var k=m.algo={};return m}(Math);(function(s){function p(a,k,b,h,l,j,m){a=a+(k&b|~k&h)+l+m;return(a<<j|a>>>32-j)+k}function m(a,k,b,h,l,j,m){a=a+(k&h|b&~h)+l+m;return(a<<j|a>>>32-j)+k}function l(a,k,b,h,l,j,m){a=a+(k^b^h)+l+m;return(a<<j|a>>>32-j)+k}function n(a,k,b,h,l,j,m){a=a+(b^(k|~h))+l+m;return(a<<j|a>>>32-j)+k}for(var r=CryptoJS,q=r.lib,v=q.WordArray,t=q.Hasher,q=r.algo,a=[],u=0;64>u;u++)a[u]=4294967296*s.abs(s.sin(u+1))|0;
14q=q.MD5=t.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(g,k){for(var b=0;16>b;b++){var h=k+b,w=g[h];g[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var b=this._hash.words,h=g[k+0],w=g[k+1],j=g[k+2],q=g[k+3],r=g[k+4],s=g[k+5],t=g[k+6],u=g[k+7],v=g[k+8],x=g[k+9],y=g[k+10],z=g[k+11],A=g[k+12],B=g[k+13],C=g[k+14],D=g[k+15],c=b[0],d=b[1],e=b[2],f=b[3],c=p(c,d,e,f,h,7,a[0]),f=p(f,c,d,e,w,12,a[1]),e=p(e,f,c,d,j,17,a[2]),d=p(d,e,f,c,q,22,a[3]),c=p(c,d,e,f,r,7,a[4]),f=p(f,c,d,e,s,12,a[5]),e=p(e,f,c,d,t,17,a[6]),d=p(d,e,f,c,u,22,a[7]),c=p(c,d,e,f,v,7,a[8]),f=p(f,c,d,e,x,12,a[9]),e=p(e,f,c,d,y,17,a[10]),d=p(d,e,f,c,z,22,a[11]),c=p(c,d,e,f,A,7,a[12]),f=p(f,c,d,e,B,12,a[13]),e=p(e,f,c,d,C,17,a[14]),d=p(d,e,f,c,D,22,a[15]),c=m(c,d,e,f,w,5,a[16]),f=m(f,c,d,e,t,9,a[17]),e=m(e,f,c,d,z,14,a[18]),d=m(d,e,f,c,h,20,a[19]),c=m(c,d,e,f,s,5,a[20]),f=m(f,c,d,e,y,9,a[21]),e=m(e,f,c,d,D,14,a[22]),d=m(d,e,f,c,r,20,a[23]),c=m(c,d,e,f,x,5,a[24]),f=m(f,c,d,e,C,9,a[25]),e=m(e,f,c,d,q,14,a[26]),d=m(d,e,f,c,v,20,a[27]),c=m(c,d,e,f,B,5,a[28]),f=m(f,c,d,e,j,9,a[29]),e=m(e,f,c,d,u,14,a[30]),d=m(d,e,f,c,A,20,a[31]),c=l(c,d,e,f,s,4,a[32]),f=l(f,c,d,e,v,11,a[33]),e=l(e,f,c,d,z,16,a[34]),d=l(d,e,f,c,C,23,a[35]),c=l(c,d,e,f,w,4,a[36]),f=l(f,c,d,e,r,11,a[37]),e=l(e,f,c,d,u,16,a[38]),d=l(d,e,f,c,y,23,a[39]),c=l(c,d,e,f,B,4,a[40]),f=l(f,c,d,e,h,11,a[41]),e=l(e,f,c,d,q,16,a[42]),d=l(d,e,f,c,t,23,a[43]),c=l(c,d,e,f,x,4,a[44]),f=l(f,c,d,e,A,11,a[45]),e=l(e,f,c,d,D,16,a[46]),d=l(d,e,f,c,j,23,a[47]),c=n(c,d,e,f,h,6,a[48]),f=n(f,c,d,e,u,10,a[49]),e=n(e,f,c,d,C,15,a[50]),d=n(d,e,f,c,s,21,a[51]),c=n(c,d,e,f,A,6,a[52]),f=n(f,c,d,e,q,10,a[53]),e=n(e,f,c,d,y,15,a[54]),d=n(d,e,f,c,w,21,a[55]),c=n(c,d,e,f,v,6,a[56]),f=n(f,c,d,e,D,10,a[57]),e=n(e,f,c,d,t,15,a[58]),d=n(d,e,f,c,B,21,a[59]),c=n(c,d,e,f,r,6,a[60]),f=n(f,c,d,e,z,10,a[61]),e=n(e,f,c,d,j,15,a[62]),d=n(d,e,f,c,x,21,a[63]);b[0]=b[0]+c|0;b[1]=b[1]+d|0;b[2]=b[2]+e|0;b[3]=b[3]+f|0},_doFinalize:function(){var a=this._data,k=a.words,b=8*this._nDataBytes,h=8*a.sigBytes;k[h>>>5]|=128<<24-h%32;var l=s.floor(b/4294967296);k[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360;k[(h+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(k.length+1);this._process();a=this._hash;k=a.words;for(b=0;4>b;b++)h=k[b],k[b]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;return a},clone:function(){var a=t.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=t._createHelper(q);r.HmacMD5=t._createHmacHelper(q)})(Math);
15/*!
16 * JavaScript Cookie v2.2.0
17 * https://github.com/js-cookie/js-cookie
18 *
19 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
20 * Released under the MIT license
21 */
22;(function(factory){var registeredInModuleLoader;if(typeof define==='function'&&define.amd){define(factory);registeredInModuleLoader=!0}
23if(typeof exports==='object'){module.exports=factory();registeredInModuleLoader=!0}
24if(!registeredInModuleLoader){var OldCookies=window.Cookies;var api=window.Cookies=factory();api.noConflict=function(){window.Cookies=OldCookies;return api}}}(function(){function extend(){var i=0;var result={};for(;i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes){result[key]=attributes[key]}}
25return result}
26function init(converter){function api(key,value,attributes){if(typeof document==='undefined'){return}
27if(arguments.length>1){attributes=extend({path:'/'},api.defaults,attributes);if(typeof attributes.expires==='number'){attributes.expires=new Date(new Date()*1+attributes.expires*864e+5)}
28attributes.expires=attributes.expires?attributes.expires.toUTCString():'';try{var result=JSON.stringify(value);if(/^[\{\[]/.test(result)){value=result}}catch(e){}
29value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes='';
29for(var attributeName in attributes){if(!attributes[attributeName]){continue}
30stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===!0){continue}
31stringifiedAttributes+='='+attributes[attributeName].split(';')[0]}
32return(document.cookie=key+'='+value+stringifiedAttributes)}
33var jar={};var decode=function(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)};var cookies=document.cookie?document.cookie.split('; '):[];var i=0;for(;i<cookies.length;i++){var parts=cookies[i].split('=');var cookie=parts.slice(1).join('=');if(!this.json&&cookie.charAt(0)==='"'){cookie=cookie.slice(1,-1)}
34try{var name=decode(parts[0]);cookie=(converter.read||converter)(cookie,name)||decode(cookie);if(this.json){try{cookie=JSON.parse(cookie)}catch(e){}}
35jar[name]=cookie;if(key===name){break}}catch(e){}}
36return key?jar[key]:jar}
37api.set=api;api.get=function(key){return api.call(api,key)};api.getJSON=function(key){return api.call({json:!0},key)};api.remove=function(key,attributes){api(key,'',extend(attributes,{expires:-1}))};api.defaults={};api.withConverter=init;return api}
38return init(function(){})}));!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,(function(t){"use strict";const e=(t,e=1e4)=>(t=parseFloat(t+"")||0,Math.round((t+Number.EPSILON)*e)/e),i=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf("hidden"),s=-1!==i.indexOf("visible");return e&&!n&&!s},n=function(t,e=void 0){return!(!t||t===document.body||e&&t===e)&&(i(t)?t:n(t.parentElement,e))},s=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body;if(e.childElementCount>1){for(var i=document.createElement("div");e.firstChild;)i.appendChild(e.firstChild);return i}return e.firstChild},o=t=>`${t||""}`.split(" ").filter((t=>!!t)),a=(t,e,i)=>{t&&o(e).forEach((e=>{t.classList.toggle(e,i||!1)}))};class r{constructor(t){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const l={passive:!1};class c{constructor(t,{start:e=(()=>!0),move:i=(()=>{}),end:n=(()=>{})}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[t]=this[t].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,l),this.element.addEventListener("touchstart",this.onTouchStart,l),this.element.addEventListener("touchmove",this.onMove,l),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(t){if(!t.buttons||0!==t.button)return;const e=new r(t);this.currentPointers.some((t=>
38t.id===e.id))||this.triggerPointerStart(e,t)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new r(e),t);window.addEventListener("blur",this.onWindowBlur)}onMove(t){const e=this.currentPointers.slice(),i="changedTouches"in t?Array.from(t.changedTouches||[]).map((t=>new r(t))):[new r(t)],n=[];for(const t of i){const e=this.currentPointers.findIndex((e=>e.id===t.id));e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(t,this.currentPointers.slice(),e)}onPointerEnd(t){t.buttons>0&&0!==t.button||(this.triggerPointerEnd(t,new r(t)),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur))}onTouchEnd(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerEnd(t,new r(e))}triggerPointerStart(t,e){return!!this.startCallback(e,t,this.currentPointers.slice())&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}triggerPointerEnd(t,e){const i=this.currentPointers.findIndex((t=>t.id===e.id));i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,l),this.element.removeEventListener("touchstart",this.onTouchStart,l),this.element.removeEventListener("touchmove",this.onMove,l),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function h(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function d(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}const u=t=>"object"==typeof t&&null!==t&&t.constructor===Object&&"[object Object]"===Object.prototype.toString.call(t),p=(t,...e)=>{const i=e.length;for(let n=0;n<i;n++){const i=e[n]||{};Object.entries(i).forEach((([e,i])=>{const n=Array.isArray(i)?[]:{};t[e]||Object.assign(t,{[e]:n}),u(i)?Object.assign(t[e],p(n,i)):Array.isArray(i)?Object.assign(t,{[e]:[...i]}):Object.assign(t,{[e]:i})}))}return t},f=function(t,e){return t.split(".").reduce(((t,e)=>"object"==typeof t?t[e]:void 0),e)};class g{constructor(t={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith("on")&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?p({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option("on")||{}))this.on(t,e)}option(t,...e){let i=f(t,this.options);return i&&"function"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...n){let s=f(e,t);var o;"string"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))||(s=parseFloat(s)),"true"===s&&(s=!0),"false"===s&&(s=!1),s&&"function"==typeof s&&(s=s.call(this,this,t,...n));let a=f(e,this.options);return a&&"function"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){const e=this.options.classes;return e&&e[t]||""}localize(t,e=[]){t=String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g,((t,e,i)=>{let n="";return i?n=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;i<e.length;i++)t=t.split(e[i][0]).join(e[i][1]);return t=t.replace(/\{\{(.*?)\}\}/g,((t,e)=>e))}on(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEac
38h((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];"string"==typeof t?i=t.split(" "):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),"*"!==t&&this.emit("*",t,...e)}}Object.defineProperty(g,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(g,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class m extends g{constructor(t={}){super(t),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(const[i,n]of Object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach()}detachPlugins(t){t=t||Object.keys(this.plugins);for(const e of t){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit("detachPlugins"),this}}var v;!function(t){t[t.Init=0]="Init",t[t.Error=1]="Error",t[t.Ready=2]="Ready",t[t.Panning=3]="Panning",t[t.Mousemove=4]="Mousemove",t[t.Destroy=5]="Destroy"}(v||(v={}));const b=["a","b","c","d","e","f"],y={PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"},w={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:y},x='<circle cx="25" cy="25" r="20"></circle>',E='<div class="f-spinner"><svg viewBox="0 0 50 50">'+x+x+"</svg></div>",S=t=>t&&null!==t&&t instanceof Element&&"nodeType"in t,P=(t,e)=>{t&&o(e).forEach((e=>{t.classList.remove(e)}))},C=(t,e)=>{t&&o(e).forEach((e=>{t.classList.add(e)}))},T={a:1,b:0,c:0,d:1,e:0,f:0},M=1e5,O=1e4,A="mousemove",L="drag",z="content",R="auto";let k=null,I=null;class D extends m{get fits(){return this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1}get isTouchDevice(){return null===I&&(I=window.matchMedia("(hover: none)").matches),I}get isMobile(){return null===k&&(k=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),k}get panMode(){return this.options.panMode!==A||this.isTouchDevice?L:A}get panOnlyZoomed(){const t=this.options.panOnlyZoomed;return t===R?this.isTouchDevice:t}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){const{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option("minScale")||1}get fullScale(){const{contentRect:t}=this;return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){const{containerRect:t,contentRect:e}=this,i=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,i)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const t=this.content;return!!(t&&t instanceof HTMLImageElement)&&!t.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const t of b){const e="e"==t||"f"===t?1e-4:1e-5;
38if(Math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){var n;if(super(e),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:v.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},T)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},T)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error("Container Element Not Found");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},D.Plugins),i)),this.emit("attachPlugins"),this.emit("init");const o=this.content;if(o.addEventListener("load",this.onLoad),o.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){t.classList.add(this.cn("isLoading"));const e=s(E);!t.contains(o)||o.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null===(n=o.parentElement)||void 0===n?void 0:n.insertBefore(e,o))||null}this.emit("beforeLoad")}else queueMicrotask((()=>{this.enable()}))}initContent(){const{container:t}=this,e=this.cn(z);let i=this.option(z)||t.querySelector(`.${e}`);if(i||(i=t.querySelector("img,picture")||t.firstElementChild,i&&C(i,e)),i instanceof HTMLPictureElement&&(i=i.querySelector("img")),!i)throw new Error("No content found");this.content=i}onLoad(){const{spinner:t,container:e,state:i}=this;t&&(t.remove(),this.spinner=null),this.option("spinner")&&e.classList.remove(this.cn("isLoading")),this.emit
38("afterLoad"),i===v.Init?this.enable():this.updateMetrics()}onError(){this.state!==v.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=v.Error,this.emit("error"))}getNextScale(t){const{fullScale:e,targetScale:i,coverScale:n,maxScale:s,minScale:o}=this;let a=o;switch(t){case"toggleMax":a=i-o<.5*(s-o)?s:o;break;case"toggleCover":a=i-o<.5*(n-o)?n:o;break;case"toggleZoom":a=i-o<.5*(e-o)?e:o;break;case"iterateZoom":let t=[1,e,s].sort(((t,e)=>t-e)),r=t.findIndex((t=>t>i+1e-5));a=t[r]||1}return a}attachObserver(){var t;const e=()=>{const{container:t,containerRect:e}=this;return Math.abs(e.width-t.getBoundingClientRect().width)>.1||Math.abs(e.height-t.getBoundingClientRect().height)>.1};this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout((()=>{e()&&this.onResize(),this.updateTimer=null}),500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))}))),null===(t=this.resizeObserver)||void 0===t||t.observe(this.container)}detachObserver(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}attachEvents(){const{container:t}=this;t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new c(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(A,this.onMouseMove)}detachEvents(){var t;const{container:e}=this;e.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),e.removeEventListener("wheel",this.onWheel,{passive:!1}),null===(t=this.pointerTracker)||void 0===t||t.stop(),this.pointerTracker=null,document.removeEventListener(A,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){this.setTargetForce();const t=this.friction,e=this.option("maxVelocity");for(const i of b)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame((()=>this.animate())):this.stop("current")}setTargetForce(){for(const t of b)"e"===t&&this.isBouncingX||"f"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){const{current:i}=this,n=i.e+t,s=i.f+e,o=this.getBounds(),{x:a,y:r}=o,l=a.min,c=a.max,h=r.min,d=r.max;let u=0,p=0;return l!==1/0&&n<l?u=l-n:c!==1/0&&n>c&&(u=c-n),h!==1/0&&s<h?p=h-s:d!==1/0&&s>d&&(p=d-s),Math.abs(u)<1e-4&&(u=0),Math.abs(p)<1e-4&&(p=0),Object.assign(Object.assign({},o),{xDiff:u,yDiff:p,inBounds:!u&&!p})}clampTargetBounds(){const{target:t}=this,{x:e,y:i}=this.getBounds();e.min!==1/0&&(t.e=Math.max(t.e,e.min)),e.max!==1/0&&(t.e=Math.min(t.e,e.max)),i.min!==1/0&&(t.f=Math.max(t.f,i.min)),i.max!==1/0&&(t.f=Math.min(t.f,i.max))}calculateContentDim(t=this.current){const{content:e,contentRect:i}=this,{fitWidth:n,fitHeight:s,fullWidth:o,fullHeight:a}=i;let r=o,l=a;if(this.option("zoom")||0!==this.angle){const i=!(e instanceof HTMLImageElement)&&("none"===window.getComputedStyle(e).maxWidth||"none"===window.getComputedStyle(e).maxHeight),c=i?o:n,h=i?a:s,d=this.getMatrix(t),u=new DOMPoint(0,0).matrixTransform(d),p=new DOMPoint(0+c,0).matrixTransform(d),f=new DOMPoint(0+c,0+h).matrixTransform(d),g=new DOMPoint(0,0+h).matrixTransform(d),m=Math.abs(f.x-u.x),v=Math.abs(f.y-u.y),b=Math.abs(g.x-p.x),y=Math.abs(g.y-p.y);r=Math.max(m,b),l=Math.max(v,y)}return{contentWidth:r,contentHeight:l}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===A||this.targetScale<this.scale)return this.isBouncingX=!1,void(this.isBouncingY=!1);const{target:t}=this,{x:e,y:i,xDiff:n,yDiff:s}=this.checkBounds();const o=this.option("maxVelocity");let a=this.velocity.e,r=this.velocity.f;0!==n?(this.isBouncingX=!0,n*a<=0?a+=.14*n:(a=.14*n,e.min!==1/0&&(this.target.e=Math.max(t.e,e.min)),e.max!==1/0&&(this.target.e=Math.min(t.e,e.max))),o&&(a=Math.max(Math.min(a,o),-1*o))):this.isBouncingX=!1,0!==s?(this.isBouncingY=!0,s*r<=0?r+=.14*s:(r=.14*s,i.min!==1/0&&(this.target.f=Math.max(t.f,i.min)),i.max!==1/0&&(this.target.f=Math.min(t.f,i.max))),o&&(r=Math.max(Math.min(r,o),-1*o))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=a
38),this.isBouncingY&&(this.velocity.f=r)}enable(){const{content:t}=this,e=new DOMMatrixReadOnly(window.getComputedStyle(t).transform);for(const t of b)this.current[t]=this.target[t]=e[t];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=v.Ready,this.emit("ready")}onClick(t){var e;"click"===t.type&&0===t.detail&&(this.dragOffset.x=0,this.dragOffset.y=0),this.isDragging&&(null===(e=this.pointerTracker)||void 0===e||e.clear(),this.trackingPoints=[],this.startDecelAnim());const i=t.target;if(!i||t.defaultPrevented)return;if(i.hasAttribute("disabled"))return t.preventDefault(),void t.stopPropagation();if((()=>{const t=window.getSelection();return t&&"Range"===t.type})()&&!i.closest("button"))return;const n=i.closest("[data-panzoom-action]"),s=i.closest("[data-panzoom-change]"),o=n||s,a=o&&S(o)?o.dataset:null;if(a){const e=a.panzoomChange,i=a.panzoomAction;if((e||i)&&t.preventDefault(),e){let t={};try{t=JSON.parse(e)}catch(t){console&&console.warn("The given data was not valid JSON")}return void this.applyChange(t)}if(i)return void(this[i]&&this[i]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return t.preventDefault(),void t.stopPropagation();if(i.closest("[data-fancybox]"))return;const r=this.content.getBoundingClientRect(),l=this.dragStart;if(l.time&&!this.canZoomOut()&&(Math.abs(r.x-l.x)>2||Math.abs(r.y-l.y)>2))return;this.dragStart.time=0;const c=e=>{this.option("zoom",t)&&e&&"string"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&"function"==typeof this[e]&&(t.preventDefault(),this[e]({event:t}))},h=this.option("click",t),d=this.option("dblClick",t);d?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout((()=>{1===this.clicks?(this.emit("click",t),!t.defaultPrevented&&h&&c(h)):(this.emit("dblClick",t),t.defaultPrevented||c(d)),this.clicks=0,this.clickTimer=null}),350))):(this.emit("click",t),!t.defaultPrevented&&h&&c(h))}addTrackingPoint(t){const e=this.trackingPoints.filter((t=>t.time>Date.now()-100));e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){var n;if(!1===this.option("touch",t))return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const s=this.content.getBoundingClientRect();if(this.dragStart={x:s.x,y:s.y,top:s.top,left:s.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===A&&this.targetScale>1)return t.preventDefault(),t.stopPropagation(),!1;const o=t.composedPath()[0];if(!i.length){if(["TEXTAREA","OPTION","INPUT","SELECT","VIDEO","IFRAME"].includes(o.nodeName)||o.closest("[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]"))return!1;null===(n=window.getSelection())||void 0===n||n.removeAllRanges()}if("mousedown"===t.type)["A","BUTTON"].includes(o.nodeName)||t.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(e),this.emit("touchStart",t)),!0}onPointerMove(t,i,s){if(!1===this.option("touch",t))return;if(!this.isDragging)return;if(i.length<2&&this.panOnlyZoomed&&e(this.targetScale)<=e(this.minScale))return;if(this.emit("touchMove",t),t.defaultPrevented)return;this.addTrackingPoint(i[0]);const{content:o}=this,a=d(s[0],s[1]),r=d(i[0],i[1]);let l=0,c=0;if(i.length>1){const t=o.getBoundingClientRect();l=a.clientX-t.left-.5*t.width,c=a.clientY-t.top-.5*t.height}const u=h(s[0],s[1]),p=h(i[0],i[1]);let f=u?p/u:1,g=r.clientX-a.clientX,m=r.clientY-a.clientY;this.dragOffset.x+=g,this.dragOffset.y+=m,this.dragOffset.time=Date.now()-this.dragStart.time;let v=e(this.targetScale)===e(this.minScale)&&this.option("lockAxis");if(v&&!this.lockedAxis)if("xy"===v||"y"===v||"touchmove"===t.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void t.preventDefault();const e=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=e>45&&e<135?"y":"x",this.dragOffset.x=0,this.dragOffset.y=0,g=0,m=0}else this.lockedAxis=v;if(n(t.target,this.content)&&(v="x",this.dragOffset.y=0),v&&"xy"!==v&&this.lockedAxis!==v&&e(this.targetScale)===e(this.minScale))return;t.cancelable&&t.preventDefault(),this.container.classList.add(this.cn("isDragging"));const b=this.checkBounds(g,m);this.option("rubberband")?("x"!==this.isInfinite&&(b.xDiff>0&&g<0||b.xDiff<0&&g>0)&&(g*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*b.xDiff))),"y"!==this.isInfinite&&(b.yDiff>0&&m<0||b.yDiff<0&&m>0)&&(m*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*b.yDiff)))):(b.xDiff&&(g=0),b.yDiff&&(m=0));const y=this.targetScale,w=this.minScale,x=this.maxScale;y<.5*w&&(f=Math.max(f,w)),y>
381.5*x&&(f=Math.min(f,x)),"y"===this.lockedAxis&&e(y)===e(w)&&(g=0),"x"===this.lockedAxis&&e(y)===e(w)&&(m=0),this.applyChange({originX:l,originY:c,panX:g,panY:m,scale:f,friction:this.option("dragFriction"),ignoreBounds:!0})}onPointerUp(t,e,i){if(i.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn("isDragging")),this.isDragging&&(this.addTrackingPoint(e),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),n(t.target,this.content)&&"y"===this.lockedAxis&&(this.trackingPoints=[]),this.emit("touchEnd",t),this.isDragging=!1,this.lockedAxis=!1,this.state!==v.Destroy&&(t.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){var t;const i=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const t of b)this.velocity[t]=0;this.target.e=this.current.e,this.target.f=this.current.f,P(this.container,"is-scaling"),P(this.container,"is-animating"),this.isTicking=!1;const{trackingPoints:n}=this,s=n[0],o=n[n.length-1];let a=0,r=0,l=0;o&&s&&(a=o.clientX-s.clientX,r=o.clientY-s.clientY,l=o.time-s.time);const c=(null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1;1!==c&&(a*=c,r*=c);let h=0,d=0,u=0,p=0,f=this.option("decelFriction");const g=this.targetScale;if(l>0){u=Math.abs(a)>3?a/(l/30):0,p=Math.abs(r)>3?r/(l/30):0;const t=this.option("maxVelocity");t&&(u=Math.max(Math.min(u,t),-1*t),p=Math.max(Math.min(p,t),-1*t))}u&&(h=u/(1/(1-f)-1)),p&&(d=p/(1/(1-f)-1)),("y"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"y"===this.lockedAxis&&e(g)===this.minScale)&&(h=u=0),("x"===this.option("lockAxis")||"xy"===this.option("lockAxis")&&"x"===this.lockedAxis&&e(g)===this.minScale)&&(d=p=0);const m=this.dragOffset.x,v=this.dragOffset.y,y=this.option("dragMinThreshold")||0;Math.abs(m)<y&&Math.abs(v)<y&&(h=d=0,u=p=0),(this.option("zoom")&&(g<this.minScale-1e-5||g>this.maxScale+1e-5)||i&&!h&&!d)&&(f=.35),this.applyChange({panX:h,panY:d,friction:f}),this.emit("decel",u,p,m,v)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const i=Math.max(-1,Math.min(1,e));if(this.emit("wheel",t,i),this.panMode===A)return;if(t.defaultPrevented)return;const n=this.option("wheel");"pan"===n?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):"zoom"===n&&!1!==this.option("zoom")&&this.zoomWithWheel(t)}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){"Escape"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit("beforeTransform");const{current:t,target:i,content:n,contentRect:s}=this,o=Object.assign({},T);for(const n of b){const s="e"==n||"f"===n?O:M;o[n]=e(t[n],s),Math.abs(i[n]-t[n])<("e"==n||"f"===n?.51:.001)&&(t[n]=i[n])}let{a:a,b:r,c:l,d:c,e:h,f:d}=o,u=`matrix(${a}, ${r}, ${l}, ${c}, ${h}, ${d})`,p=n.parentElement instanceof HTMLPictureElement?n.parentElement:n;if(this.option("transformParent")&&(p=p.parentElement||p),p.style.transform===u)return;p.style.transform=u;const{contentWidth:f,contentHeight:g}=this.calculateContentDim();s.width=f,s.height=g,this.emit("afterTransform")}updateMetrics(t=!1){var i;if(!this||this.state===v.Destroy)return;if(this.isContentLoading)return;const n=Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1),{container:s,content:o}=this,a=o instanceof HTMLImageElement,r=s.getBoundingClientRect(),l=getComputedStyle(this.container);let c=r.width*n,h=r.height*n;const d=parseFloat(l.paddingTop)+parseFloat(l.paddingBottom),u=c-(parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),p=h-d;this.containerRect={width:c,height:h,innerWidth:u,innerHeight:p};const f=parseFloat(o.dataset.width||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalWidth:t instanceof SVGElement?t.width.baseVal.value:Math.max(t.offsetWidth,t.scrollWidth),e||0})(o),g=parseFloat(o.dataset.height||"")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalHeight:t instanceof SVGElement?t.height.baseVal.value:Math.max(t.offsetHeight,t.scrollHeight),e||0})(o);let m=this.option("width",f)||R,b=this.option("height",g)||R;const y=m===R,w=b===R;"number"!=typeof m&&(m=f),"number"!=typeof b&&(b=g),y&&(m=f*(b/g)),w&&(b=g/(f/m));let x=o.parentElement instanceof HTMLPictureElement?o.parentElement:o;this.option("transformParent")&&(x=x.parentElement||x);const E=x.getAttribute("style")||"";x.style.setProperty("transform","none","important"),a&&(x.style.width="",x.style.height=""),x.offsetHeight;const S=o.getBoundingClientRect();let P=S.width*n,C=S.height*n,T=P,M=C;P=Math.min(P,m),C=Math.min(C,b),a?({width:P,height:C}
38=((t,e,i,n)=>{const s=i/t,o=n/e,a=Math.min(s,o);return{width:t*=a,height:e*=a}})(m,b,P,C)):(P=Math.min(P,m),C=Math.min(C,b));let O=.5*(M-C),A=.5*(T-P);this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:S.top-r.top+O,bottom:r.bottom-S.bottom+O,left:S.left-r.left+A,right:r.right-S.right+A,fitWidth:P,fitHeight:C,width:P,height:C,fullWidth:m,fullHeight:b}),x.style.cssText=E,a&&(x.style.width=`${P}px`,x.style.height=`${C}px`),this.setTransform(),!0!==t&&this.emit("refresh"),this.ignoreBounds||(e(this.targetScale)<e(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===v.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}calculateBounds(){const{contentWidth:t,contentHeight:i}=this.calculateContentDim(this.target),{targetScale:n,lockedAxis:s}=this,{fitWidth:o,fitHeight:a}=this.contentRect;let r=0,l=0,c=0,h=0;const d=this.option("infinite");if(!0===d||s&&d===s)r=-1/0,c=1/0,l=-1/0,h=1/0;else{let{containerRect:s,contentRect:d}=this,u=e(o*n,O),p=e(a*n,O),{innerWidth:f,innerHeight:g}=s;if(s.width===u&&(f=s.width),s.width===p&&(g=s.height),t>f){c=.5*(t-f),r=-1*c;let e=.5*(d.right-d.left);r+=e,c+=e}if(o>f&&t<f&&(r-=.5*(o-f),c-=.5*(o-f)),i>g){h=.5*(i-g),l=-1*h;let t=.5*(d.bottom-d.top);l+=t,h+=t}a>g&&i<g&&(r-=.5*(a-g),c-=.5*(a-g))}return{x:{min:r,max:c},y:{min:l,max:h}}}getBounds(){const t=this.option("bounds");return t!==R?t:this.calculateBounds()}updateControls(){const t=this,i=t.container,{panMode:n,contentRect:s,targetScale:o,minScale:r}=t;let l=r,c=t.option("click")||!1;c&&(l=t.getNextScale(c));let h=t.canZoomIn(),d=t.canZoomOut(),u=n===L&&!!this.option("touch"),p=d&&u;if(u&&(e(o)<e(r)&&!this.panOnlyZoomed&&(p=!0),(e(s.width,1)>e(s.fitWidth,1)||e(s.height,1)>e(s.fitHeight,1))&&(p=!0)),e(s.width*o,1)<e(s.fitWidth,1)&&(p=!1),n===A&&(p=!1),a(i,this.cn("isDraggable"),p),!this.option("zoom"))return;let f=h&&e(l)>e(o),g=!f&&!p&&d&&e(l)<e(o);a(i,this.cn("canZoomIn"),f),a(i,this.cn("canZoomOut"),g);for(const t of i.querySelectorAll("[data-panzoom-action]")){let e=!1,i=!1;switch(t.dataset.panzoomAction){case"zoomIn":h?e=!0:i=!0;break;case"zoomOut":d?e=!0:i=!0;break;case"toggleZoom":case"iterateZoom":h||d?e=!0:i=!0;const n=t.querySelector("g");n&&(n.style.display=h?"":"none")}e?(t.removeAttribute("disabled"),t.removeAttribute("tabindex")):i&&(t.setAttribute("disabled",""),t.setAttribute("tabindex","-1"))}}panTo({x:t=this.target.e,y:e=this.target.f,scale:i=this.targetScale,friction:n=this.option("friction"),angle:s=0,originX:o=0,originY:a=0,flipX:r=!1,flipY:l=!1,ignoreBounds:c=!1}){this.state!==v.Destroy&&this.applyChange({panX:t-this.target.e,panY:e-this.target.f,scale:i/this.targetScale,angle:s,originX:o,originY:a,friction:n,flipX:r,flipY:l,ignoreBounds:c})}applyChange({panX:t=0,panY:i=0,scale:n=1,angle:s=0,originX:o=-this.current.e,originY:a=-this.current.f,friction:r=this.option("friction"),flipX:l=!1,flipY:c=!1,ignoreBounds:h=!1,bounce:d=this.option("bounce")}){const u=this.state;if(u===v.Destroy)return;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=r||0,this.ignoreBounds=h;const{current:p}=this,f=p.e,g=p.f,m=this.getMatrix(this.target);let y=(new DOMMatrix).translate(f,g).translate(o,a).translate(t,i);if(this.option("zoom")){if(!h){const t=this.targetScale,e=this.minScale,i=this.maxScale;t*n<e&&(n=e/t),t*n>i&&(n=i/t)}y=y.scale(n)}y=y.translate(-o,-a).translate(-f,-g).multiply(m),s&&(y=y.rotate(s)),l&&(y=y.scale(-1,1)),c&&(y=y.scale(1,-1));for(const t of b)"e"!==t&&"f"!==t&&(y[t]>this.minScale+1e-5||y[t]<this.minScale-1e-5)?this.target[t]=y[t]:this.target[t]=e(y[t],O);(this.targetScale<this.scale||Math.abs(n-1)>.1||this.panMode===A||!1===d)&&!h&&this.clampTargetBounds(),u===v.Init?this.animate():this.isResting||(this.state=v.Panning,this.requestTick())}stop(t=!1){if(this.state===v.Init||this.state===v.Destroy)return;const e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const e of b)this.velocity[e]=0,"current"===t?this.current[e]=this.target[e]:"target"===t&&(this.target[e]=this.current[e]);this.setTransform(),P(this.container,"is-scaling"),P(this.container,"is-animating"),this.isTicking=!1,this.state=v.Ready,e&&(this.emit
38("endAnimation"),this.updateControls())}requestTick(){this.isTicking||(this.emit("startAnimation"),this.updateControls(),C(this.container,"is-animating"),this.isScaling&&C(this.container,"is-scaling")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame((()=>this.animate())))}panWithMouse(t,i=this.option("mouseMoveFriction")){if(this.pmme=t,this.panMode!==A||!t)return;if(e(this.targetScale)<=e(this.minScale))return;this.emit("mouseMove",t);const{container:n,containerRect:s,contentRect:o}=this,a=s.width,r=s.height,l=n.getBoundingClientRect(),c=(t.clientX||0)-l.left,h=(t.clientY||0)-l.top;let{contentWidth:d,contentHeight:u}=this.calculateContentDim(this.target);const p=this.option("mouseMoveFactor");p>1&&(d!==a&&(d*=p),u!==r&&(u*=p));let f=.5*(d-a)-c/a*100/100*(d-a);f+=.5*(o.right-o.left);let g=.5*(u-r)-h/r*100/100*(u-r);g+=.5*(o.bottom-o.top),this.applyChange({panX:f-this.target.e,panY:g-this.target.f,friction:i})}zoomWithWheel(t){if(this.state===v.Destroy||this.state===v.Init)return;const i=Date.now();if(i-this.pwt<45)return void t.preventDefault();this.pwt=i;var n=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const s=Math.max(-1,Math.min(1,n)),{targetScale:o,maxScale:a,minScale:r}=this;let l=o*(100+45*s)/100;e(l)<e(r)&&e(o)<=e(r)?(this.cwd+=Math.abs(s),l=r):e(l)>e(a)&&e(o)>=e(a)?(this.cwd+=Math.abs(s),l=a):(this.cwd=0,l=Math.max(Math.min(l,a),r)),this.cwd>this.option("wheelLimit")||(t.preventDefault(),e(l)!==e(o)&&this.zoomTo(l,{event:t}))}canZoomIn(){return this.option("zoom")&&(e(this.contentRect.width,1)<e(this.contentRect.fitWidth,1)||e(this.targetScale)<e(this.maxScale))}canZoomOut(){return this.option("zoom")&&e(this.targetScale)>e(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo("fit",t)}zoomToCover(t){this.zoomTo("cover",t)}zoomToFull(t){this.zoomTo("full",t)}zoomToMax(t){this.zoomTo("max",t)}toggleZoom(t){this.zoomTo(this.getNextScale("toggleZoom"),t)}toggleMax(t){this.zoomTo(this.getNextScale("toggleMax"),t)}toggleCover(t){this.zoomTo(this.getNextScale("toggleCover"),t)}iterateZoom(t){this.zoomTo("next",t)}zoomTo(t=1,{friction:e=R,originX:i=R,originY:n=R,event:s}={}){if(this.isContentLoading||this.state===v.Destroy)return;const{targetScale:o,fullScale:a,maxScale:r,coverScale:l}=this;if(this.stop(),this.panMode===A&&(s=this.pmme||s),s||i===R||n===R){const t=this.content.getBoundingClientRect(),e=this.container.getBoundingClientRect(),o=s?s.clientX:e.left+.5*e.width,a=s?s.clientY:e.top+.5*e.height;i=o-t.left-.5*t.width,n=a-t.top-.5*t.height}let c=1;"number"==typeof t?c=t:"full"===t?c=a:"cover"===t?c=l:"max"===t?c=r:"fit"===t?c=1:"next"===t&&(c=this.getNextScale("iterateZoom")),c=c/o||1,e=e===R?c>1?.15:.25:e,this.applyChange({scale:c,originX:i,originY:n,friction:e}),s&&this.panMode===A&&this.panWithMouse(s,e)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.height-(e.top+.5*e.fitHeight)-i.f,scale:t.width/e.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop("target");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.innerHeight-(e.top+.5*e.fitHeight)-i.f,scale:t.height/e.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:t}=this,e=this.cn("inFullscreen"),i=this.cn("htmlHasFullscreen");t.classList.toggle(e);const n=t.classList.contains(e);n?(document.documentElement.classList.add(i),document.addEventListener("keydown",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener("keydown",this.onKeydown,!0)),this.updateMetrics(),this.emit(n?"enterFS":"exitFS")}getMatrix(t=this.current){const{a:e,b:i,c:n,d:s,e:o,f:a}=t;return new DOMMatrix([e,i,n,s,o,a])}reset(t){if(this.state!==v.Init&&this.state!==v.Destroy){this.stop("current");for(const t of b)this.target[t]=T[t];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===t?this.option("friction"):t,this.state=v.Panning,this.requestTick())}}
38destroy(){this.stop(),this.state=v.Destroy,this.detachEvents(),this.detachObserver();const{container:t,content:e}=this,i=this.option("classes")||{};for(const e of Object.values(i))t.classList.remove(e+"");e&&(e.removeEventListener("load",this.onLoad),e.removeEventListener("error",this.onError)),this.detachPlugins()}}Object.defineProperty(D,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:w}),Object.defineProperty(D,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});const F=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),setTimeout((()=>{i=!0}),e))}},j=(t,e)=>{let i=[];return t.childNodes.forEach((t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)})),i},B={viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}};var H;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Destroy=2]="Destroy"}(H||(H={}));const N=t=>{if("string"==typeof t||t instanceof HTMLElement)t={html:t};else{const e=t.thumb;void 0!==e&&("string"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb)}return Object.assign({html:"",el:null,isDom:!1,class:"",customClass:"",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},_=(t={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},t);class $ extends g{constructor(t,e){super(e),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}const W={classes:{list:"f-carousel__dots",isDynamic:"is-dynamic",hasDots:"has-dots",dot:"f-carousel__dot",isBeforePrev:"is-before-prev",isPrev:"is-prev",isCurrent:"is-current",isNext:"is-next",isAfterNext:"is-after-next"},dotTpl:'<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2};class X extends ${constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;if(!t){t=document.createElement("ul"),C(t,this.cn("list")),t.setAttribute("role","tablist");const e=this.instance.container;e.appendChild(t),C(e,this.cn("hasDots")),this.list=t}return t}refresh(){var t;const e=this.instance.pages.length,i=Math.min(2,this.option("minCount")),n=Math.max(2e3,this.option("maxCount")),s=this.option("dynamicFrom");if(e<i||e>n)return void this.cleanup();const o="number"==typeof s&&e>5&&e>=s,r=!this.list||this.isDynamic!==o||this.list.children.length!==e;r&&this.cleanup();const l=this.build();if(a(l,this.cn("isDynamic"),!!o),r)for(let t=0;t<e;t++)l.append(this.createItem(t));let c,h=0;for(const e of[...l.children]){const i=h===this.instance.page;i&&(c=e),a(e,this.cn("isCurrent"),i),null===(t=e.children[0])||void 0===t||t.setAttribute("aria-selected",i?"true":"false");for(const t of["isBeforePrev","isPrev","isNext","isAfterNext"])P(e,this.cn(t));h++}if(c=c||l.firstChild,o&&c){const t=c.previousElementSibling,e=t&&t.previousElementSibling;C(t,this.cn("isPrev")),C(e,this.cn("isBeforePrev"));const i=c.nextElementSibling,n=i&&i.nextElementSibling;C(i,this.cn("isNext")),C(n,this.cn("isAfterNext"))}this.isDynamic=o}createItem(t=0){var e;const i=document.createElement("li");i.setAttribute("role","presentation");const n=s(this.instance.localize(this.option("dotTpl"),[["%d",t+1]]).replace(/\%i/g,t+""));return i.appendChild(n),null===(e=i.children[0])||void 0===e||e.setAttribute("role","tab"),i}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,P(this.instance.container,this.cn("hasDots"))}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(X,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:W});const q="disabled",Y="next",V="prev";class Z extends ${constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isDom",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onRefresh(){const t=this.instance,e=t.pages.length,i=t.page;if(e<2)return void this.cleanup();this.build();let n=this.prev,s=this.next;n&&s&&(n.removeAttribute(q),s.removeAttribute(q),t.isInfinite||(i<=0&&n.setAttribute(q,""),i>=e-1&&s.setAttribute(q,"")))}addBtn(t){var e;const i=this.instance,n=document.createElement("button");n.setAttribute("tabindex","0"),n.setAttribute("title",i.localize(`{{${t.toUpperCase()}}}`)),C(n,this.cn("button")+" "+this.cn(t===Y?"isNext":"isPrev"));const s=i.isRTL?t===Y?V:Y:t;var o;return n.innerHTML=i.localize(this.option(`${s}Tpl`)),n.dataset[`carousel${o=t,o?o.match("^[a-z]")?o.charAt(0).toUpperCase()+o.substring(1):o:""}`]="true",null===(e=this.container)||void 0===e||e.appendChild(n),n}build(){const t=this.instance.container,e=this.cn("container");let{container:i,prev:n,next:s}=this;i||(i=t.querySelector("."+e),this.isDom=!!i),i||(i=document.createElement("div"),C(i,e),t.appendChild(i)),this.container=i,s||(s=i.querySelector("[data-carousel-next]")),s||(s=this.addBtn(Y)),this.next=s,n||(n=i.querySelector("[data-carousel-prev]")),n||(n=this.addBtn(V)),this.prev=n}cleanup(){this.isDom||(this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove()),this.prev=null,this.next=null,this.container=null,this.isDom=!1}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(Z,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>
38',prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>'}});class U extends ${constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){const{nav:t,target:e}=this;t&&e&&(t.options.initialSlide=e.options.initialPage,t.state===H.Ready?this.onNavReady(t):t.on("ready",this.onNavReady),e.state===H.Ready?this.onTargetReady(e):e.on("ready",this.onTargetReady))}onNavReady(t){t.on("createSlide",this.onNavCreateSlide),t.on("Panzoom.click",this.onNavClick),t.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on("change",this.onTargetChange),t.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n,s;if(Math.abs(e.dragOffset.x)>3||Math.abs(e.dragOffset.y)>3)return;const o=i.target,{nav:a,target:r}=this;if(!a||!r||!o)return;const l=o.closest("[data-index]");if(i.stopPropagation(),i.preventDefault(),!l)return;const c=parseInt(l.dataset.index||"",10)||0,h=r.getPageForSlide(c),d=a.getPageForSlide(c);a.slideTo(d),r.slideTo(h,{friction:(null===(s=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===s?void 0:s.Sync.option("friction"))||0}),this.markSelectedSlide(c)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){var t,e;const{target:i,nav:n}=this;if(!i||!n)return;if(n.state!==H.Ready||i.state!==H.Ready)return;const s=null===(e=null===(t=i.pages[i.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index,o=n.getPageForSlide(s);this.markSelectedSlide(s),n.slideTo(o,null===n.prevPage&&null===i.prevPage?{friction:0}:void 0)}markSelectedSlide(t){const e=this.nav;e&&e.state===H.Ready&&(this.selectedIndex=t,[...e.slides].map((e=>{e.el&&e.el.classList[e.index===t?"add":"remove"]("is-nav-selected")})))}attach(){const t=this;let e=t.options.target,i=t.options.nav;e?t.addAsNavFor(e):i&&t.addAsTargetFor(i)}detach(){const t=this,e=t.nav,i=t.target;e&&(e.off("ready",t.onNavReady),e.off("createSlide",t.onNavCreateSlide),e.off("Panzoom.click",t.onNavClick),e.off("Panzoom.touchEnd",t.onNavTouch)),t.nav=null,i&&(i.off("ready",t.onTargetReady),i.off("refresh",t.onTargetChange),i.off("change",t.onTargetChange)),t.target=null}}Object.defineProperty(U,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const G={Navigation:Z,Dots:X,Sync:U},K="animationend",J="isSelected",Q="slide";class tt extends m{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===H.Ready}get isInfinite(){let t=!1;const{contentDim:e,viewportDim:i,pages:n,slides:s}=this,o=s[0];return n.length>=2&&o&&e+o.dim>=i&&(t=this.option("infinite")),t}get isRTL(){return"rtl"===this.option("direction")}get isHorizontal(){return"x"===this.option("axis")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:H.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),"string"==typeof t&&(t=document.querySelector(t)),!t||!S(t))throw new Error("No Element found");this.container=t,this.slideNext=F(this.slideNext.bind(this),150),this.slidePrev=F(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask((()=>{this.processOptions()}))}processOptions(){var t,e;const i=p({},tt.defaults,this.userOptions);let n="";const s=i.breakpoints;if(s&&u(s))for(const[t,e]of Object.entries(s))window.matchMedia(t).matches&&u(e)&&(n+=t,p(i,e));n===this.bp&&this.state!==H.Init||(this.bp=n,this.state===H.Ready&&(i.initialSlide=(null===(e=null===(t=this.pages[this.page])||void 0===t?void 0:t.slides[0])||void 0===e?void 0:e.index)||0),this.state!==H.Init&&this.destroy(),super.setOptions(i),!1===this.option("enabled")?this.attachEvents():setTimeout((()=>{this.init()}),0))}
38init(){this.state=H.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},tt.Plugins),this.userPlugins)),this.emit("attachPlugins"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=H.Ready,this.emit("ready")}initLayout(){const{container:t}=this,e=this.option("classes");C(t,this.cn("container")),a(t,e.isLTR,!this.isRTL),a(t,e.isRTL,this.isRTL),a(t,e.isVertical,!this.isHorizontal),a(t,e.isHorizontal,this.isHorizontal);let i=this.option("viewport")||t.querySelector(`.${e.viewport}`);i||(i=document.createElement("div"),C(i,e.viewport),i.append(...j(t,`.${e.slide}`)),t.prepend(i)),i.addEventListener("scroll",this.onScroll);let n=this.option("track")||t.querySelector(`.${e.track}`);n||(n=document.createElement("div"),C(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute("aria-live","polite"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit("initLayout")}initSlides(){const{track:t}=this;if(!t)return;const e=[...this.slides],i=[];[...j(t,`.${this.cn(Q)}`)].forEach((t=>{if(S(t)){const e=N({el:t,isDom:!0,index:this.slides.length});i.push(e)}}));for(let t of[...this.option("slides",[])||[],...e])i.push(N(t));this.slides=i;for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;
38for(const t of i)this.emit("beforeInitSlide",t,t.index),this.emit("initSlide",t,t.index);this.emit("initSlides")}setInitialPage(){const t=this.option("initialSlide");this.page="number"==typeof t?this.getPageForSlide(t):parseInt(this.option("initialPage",0)+"",10)||0}setInitialPosition(){const{track:t,pages:e,isHorizontal:i}=this;if(!t||!e.length)return;let n=this.page;e[n]||(this.page=n=0);const s=(e[n].pos||0)*(this.isRTL&&i?1:-1),o=i?`${s}px`:"0",a=i?"0":`${s}px`;t.style.transform=`translate3d(${o}, ${a}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option("Panzoom")||{};this.panzoom=new D(this.viewport,p({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on("*",((t,e,...i)=>{this.emit(`Panzoom.${e}`,t,...i)})),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener("click",this.onClick,{passive:!1,capture:!1}),t.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option("slidesPerPage");n=("auto"===n||e<=i)&&!1!==this.option("fill")?1/0:parseFloat(n+"");let s=0,o=0,a=0;for(const e of this.slides)(!t.length||o+e.dim-i>.05||a>=n)&&(t.push(_()),s=t.length-1,o=0,a=0),t[s].slides.push(e),o+=e.dim+e.gap,a++;return t}processPages(){const t=this.pages,{contentDim:i,viewportDim:n,isInfinite:s}=this,o=this.option("center"),a=this.option("fill"),r=a&&o&&i>n&&!s;if(t.forEach(((t,e)=>{var s;t.index=e,t.pos=(null===(s=t.slides[0])||void 0===s?void 0:s.pos)||0,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e<t.slides.length-1&&(t.dim+=i.gap);r&&t.pos+.5*t.dim<.5*n?t.pos=0:r&&t.pos+.5*t.dim>=i-.5*n?t.pos=i-n:o&&(t.pos+=-.5*(n-t.dim))})),t.forEach((t=>{a&&!s&&i>n&&(t.pos=Math.max(t.pos,0),t.pos=Math.min(t.pos,i-n)),t.pos=e(t.pos,1e3),t.dim=e(t.dim,1e3),Math.abs(t.pos)<=.1&&(t.pos=0)})),s)return t;const l=[];let c;return t.forEach((t=>{const e=Object.assign({},t);c&&e.pos===c.pos?(c.dim+=e.dim,c.slides=[...c.slides,...e.slides]):(e.index=l.length,c=e,l.push(e))})),l}getPageFromIndex(t=0){const e=this.pages.length;let i;return t=parseInt((t||0).toString())||0,i=this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0),i}getSlideMetrics(t){var i,n;const s=this.isHorizontal?"width":"height";let o=0,a=0,r=t.el;const l=!(!r||r.parentNode);if(r?o=parseFloat(r.dataset[s]||"")||0:(r=document.createElement("div"),r.style.visibility="hidden",(this.track||document.body).prepend(r)),C(r,this.cn(Q)+" "+t.class+" "+t.customClass),o)r.style[s]=`${o}px`,r.style["width"===s?"height":"width"]="";else{l&&(this.track||document.body).prepend(r),o=r.getBoundingClientRect()[s]*Math.max(1,(null===(i=window.visualViewport)||void 0===i?void 0:i.scale)||1);let t=r[this.isHorizontal?"offsetWidth":"offsetHeight"];t-1>o&&(o=t)}const c=getComputedStyle(r);return"content-box"===c.boxSizing&&(this.isHorizontal?(o+=parseFloat(c.paddingLeft)||0,o+=parseFloat(c.paddingRight)||0):(o+=parseFloat(c.paddingTop)||0,o+=parseFloat(c.paddingBottom)||0)),a=parseFloat(c[this.isHorizontal?"marginRight":"marginBottom"])||0,l?null===(n=r.parentElement)||void 0===n||n.removeChild(r):t.el||r.remove(),{dim:e(o,1e3),gap:e(a,1e3)}}getBounds(){const{isInfinite:t,isRTL:e,isHorizontal:i,pages:n}=this;let s={min:0,max:0};if(t)s={min:-1/0,max:1/0};else if(n.length){const t=n[0].pos,o=n[n.length-1].pos;s=e&&i?{min:t,max:o}:{min:-1*o,max:-1*t}}return{x:i?s:{min:0,max:0},y:i?{min:0,max:0}:s}}repositionSlides(){let t,{isHorizontal:i,isRTL:n,isInfinite:s,viewport:o,viewportDim:a,contentDim:r,page:l,pages:c,slides:h,panzoom:d}=this,u=0,p=0,f=0,g=0;d?g=-1*d.current[this.axis]:c[l]&&(g=c[l].pos||0),t=i?n?"right":"left":"top",n&&i&&(g*=-1);for(const i of h){const n=i.el;n?("top"===t?(n.style.right="",n.style.left=""):n.style.top="",i.index!==u?n.style[t]=0===p?"":`${e(p,1e3)}px`:n.style[t]="",f+=i.dim+i.gap,u++):p+=i.dim+i.gap}if(s&&f&&o){let n=getComputedStyle(o),s="padding",l=i?"Right":"Bottom",c=parseFloat(n[s+(i?"Left":"Top")]);g-=c,a+=c,a+=parseFloat(n[s+l]);for(const i of h)i.el&&(e(i.pos)<e(a)&&e(i.pos+i.dim+i.gap)<e(g)&&e(g)>e(r-a)&&(i.el.style[t]=`${e(p+f,1e3)}px`),e(i.pos+i.gap)>=e(r-a)&&e(i.pos)>e(g+a)&&e(g)<e(a)&&(i.el.style[t]=`-${e(f,1e3)}px`))}let m,v,b=[...this.inTransition];if(b.length>1&&(m=c[b[0]],v=c[b[1]]),m&&v){let i=0;for(const n of h)n.el?this.inTransition.has(n.index)&&m.slides.indexOf(n)<0&&(n.el.style[t]=`${e(i+(m.pos-v.pos),1e3)}px`):i+=n.dim+n.gap}}createSlideEl(t){const{track:e,slides:i}=this;if(!e||!t)return;if(t.el&&t.el.parentNode)return;const n=t.el||document.createElement("div");
38C(n,this.cn(Q)),C(n,t.class),C(n,t.customClass);const s=t.html;s&&(s instanceof HTMLElement?n.appendChild(s):n.innerHTML=t.html+"");const o=[];i.forEach(((t,e)=>{t.el&&o.push(e)}));const a=t.index;let r=null;if(o.length){r=i[o.reduce(((t,e)=>Math.abs(e-a)<Math.abs(t-a)?e:t))]}const l=r&&r.el&&r.el.parentNode?r.index<t.index?r.el.nextSibling:r.el:null;e.insertBefore(n,e.contains(l)?l:null),t.el=n,this.emit("createSlide",t)}removeSlideEl(t,e=!1){const i=null==t?void 0:t.el;if(!i||!i.parentNode)return;const n=this.cn(J);if(i.classList.contains(n)&&(P(i,n),this.emit("unselectSlide",t)),t.isDom&&!e)return i.removeAttribute("aria-hidden"),i.removeAttribute("data-index"),void(i.style.left="");this.emit("removeSlide",t);const s=new CustomEvent(K);i.dispatchEvent(s),t.el&&(t.el.remove(),t.el=null)}transitionTo(t=0,e=this.option("transition")){var i,n,s,o;if(!e)return!1;const a=this.page,{pages:r,panzoom:l}=this;t=parseInt((t||0).toString())||0;const c=this.getPageFromIndex(t);if(!l||!r[c]||r.length<2||Math.abs(((null===(n=null===(i=r[a])||void 0===i?void 0:i.slides[0])||void 0===n?void 0:n.dim)||0)-this.viewportDim)>1)return!1;let h=t>a?1:-1;this.isInfinite&&(0===a&&t===r.length-1&&(h=-1),a===r.length-1&&0===t&&(h=1));const d=r[c].pos*(this.isRTL?1:-1);if(a===c&&Math.abs(d-l.target[this.axis])<1)return!1;this.clearTransitions();const u=l.isResting;C(this.container,this.cn("inTransition"));const p=(null===(s=r[a])||void 0===s?void 0:s.slides[0])||null,f=(null===(o=r[c])||void 0===o?void 0:o.slides[0])||null;this.inTransition.add(f.index),this.createSlideEl(f);let g=p.el,m=f.el;u||e===Q||(e="fadeFast",g=null);const v=this.isRTL?"next":"prev",b=this.isRTL?"prev":"next";return g&&(this.inTransition.add(p.index),p.transition=e,g.addEventListener(K,this.onAnimationEnd),g.classList.add(`f-${e}Out`,`to-${h>0?b:v}`)),m&&(f.transition=e,m.addEventListener(K,this.onAnimationEnd),m.classList.add(`f-${e}In`,`from-${h>0?v:b}`)),l.current[this.axis]=d,l.target[this.axis]=d,l.requestTick(),this.onChange(c),!0}manageSlideVisiblity(){const t=new Set,e=new Set,i=this.getVisibleSlides(parseFloat(this.option("preload",0)+"")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.inTransition)t.add(this.slides[e]);for(const e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(const i of e)t.has(i)||this.removeSlideEl(i);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t="aria-hidden";let e=this.cn(J);if(e)for(const i of this.slides){const n=i.el;n&&(n.dataset.index=`${i.index}`,n.classList.contains("f-thumbs__slide")?this.getVisibleSlides(0).has(i)?n.removeAttribute(t):n.setAttribute(t,"true"):this.pages[this.page].slides.includes(i)?(n.classList.contains(e)||(C(n,e),this.emit("selectSlide",i)),n.removeAttribute(t)):(n.classList.contains(e)&&(P(n,e),this.emit("unselectSlide",i)),n.setAttribute(t,"true")))}}flipInfiniteTrack(){const{axis:t,isHorizontal:e,isInfinite:i,isRTL:n,viewportDim:s,contentDim:o}=this,a=this.panzoom;if(!a||!i)return;let r=a.current[t],l=a.target[t]-r,c=0,h=.5*s;n&&e?(r<-h&&(c=-1,r+=o),r>o-h&&(c=1,r-=o)):(r>h&&(c=1,r-=o),r<-o+h&&(c=-1,r+=o)),c&&(a.current[t]=r,a.target[t]=r+l)}lazyLoadImg(t,e){const i=this,n="f-fadeIn",o="is-preloading";let a=!1,r=null;const l=()=>{a||(a=!0,r&&(r.remove(),r=null),P(e,o),e.complete&&(C(e,n),setTimeout((()=>{P(e,n)}),350)),this.option("adaptiveHeight")&&t.el&&this.pages[this.page].slides.indexOf(t)>-1&&(i.updateMetrics(),i.setViewportHeight()),this.emit("load",t))};C(e,o),e.src=e.dataset.lazySrcset||e.dataset.lazySrc||"",delete e.dataset.lazySrc,delete e.dataset.lazySrcset,e.addEventListener("error",(()=>{l()})),e.addEventListener("load",(()=>{l()})),setTimeout((()=>{const i=e.parentNode;i&&t.el&&(e.complete?l():a||(r=s(E),i.insertBefore(r,e)))}),300)}lazyLoadSlide(t){const e=t&&t.el;if(!e)return;const i=new Set;let n=Array.from(e.querySelectorAll("[data-lazy-src],[data-lazy-srcset]"));e.dataset.lazySrc&&n.push(e),n.map((t=>{t instanceof HTMLImageElement?i.add(t):t instanceof HTMLElement&&t.dataset.lazySrc&&(t.style.backgroundImage=`url('${t.dataset.lazySrc}')`,delete t.dataset.lazySrc)}));for(const e of i)this.lazyLoadImg(t,e)}onAnimationEnd(t){var e;const i=t.target,n=i?parseInt(i.dataset.index||"",10)||0:-1,s=this.slides[n],o=t.animationName;if(!i||!s||!o)return;const a=!!this.inTransition.has(n)&&s.transition;a&&o.substring(0,a.length+2)===`f-${a}`&&this.inTransition.delete(n),this.inTransition.size||this.clearTransitions(),n===this.page&&(null===(e=this.panzoom)||void 0===e?void 0:e.isResting)&&this.emit
38("settle")}onDecel(t,e=0,i=0,n=0,s=0){if(this.option("dragFree"))return void this.setPageFromPosition();const{isRTL:o,isHorizontal:a,axis:r,pages:l}=this,c=l.length,h=Math.abs(Math.atan2(i,e)/(Math.PI/180));let d=0;if(d=h>45&&h<135?a?0:i:a?e:0,!c)return;let u=this.page,p=o&&a?1:-1;const f=t.current[r]*p;let{pageIndex:g}=this.getPageFromPosition(f);Math.abs(d)>5?(l[u].dim<document.documentElement["client"+(this.isHorizontal?"Width":"Height")]-1&&(u=g),u=o&&a?d<0?u-1:u+1:d<0?u+1:u-1):u=0===n&&0===s?u:g,this.slideTo(u,{transition:!1,friction:t.option("decelFriction")})}onClick(t){const e=t.target,i=e&&S(e)?e.dataset:null;let n,s;i&&(void 0!==i.carouselPage?(s="slideTo",n=i.carouselPage):void 0!==i.carouselNext?s="slideNext":void 0!==i.carouselPrev&&(s="slidePrev")),s?(t.preventDefault(),t.stopPropagation(),e&&!e.hasAttribute("disabled")&&this[s](n)):this.emit("click",t)}onSlideTo(t){const e=t.detail||0;this.slideTo(this.getPageForSlide(e),{friction:0})}onChange(t,e=0){const i=this.page;this.prevPage=i,this.page=t,this.option("adaptiveHeight")&&this.setViewportHeight(),t!==i&&(this.markSelectedSlides(),this.emit("change",t,i,e))}onRefresh(){let t=this.contentDim,e=this.viewportDim;this.updateMetrics(),this.contentDim===t&&this.viewportDim===e||this.slideTo(this.page,{friction:0,transition:!1})}onScroll(){var t;null===(t=this.viewport)||void 0===t||t.scroll(0,0)}onResize(){this.option("breakpoints")&&this.processOptions()}onBeforeTransform(t){this.lp!==t.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=t.current.e}onEndAnimation(){this.inTransition.size||this.emit("settle")}reInit(t=null,e=null){this.destroy(),this.state=H.Init,this.prevPage=null,this.userOptions=t||this.userOptions,this.userPlugins=e||this.userPlugins,this.processOptions()}slideTo(t=0,{friction:e=this.option("friction"),transition:i=this.option("transition")}={}){if(this.state===H.Destroy)return;t=parseInt((t||0).toString())||0;const n=this.getPageFromIndex(t),{axis:s,isHorizontal:o,isRTL:a,pages:r,panzoom:l}=this,c=r.length,h=a&&o?1:-1;if(!l||!c)return;if(this.page!==n){const e=new Event("beforeChange",{bubbles:!0,cancelable:!0});if(this.emit("beforeChange",e,t),e.defaultPrevented)return}if(this.transitionTo(t,i))return;let d=r[n].pos;if(this.isInfinite){const e=this.contentDim,i=l.target[s]*h;if(2===c)d+=e*Math.floor(parseFloat(t+"")/2);else{d=[d,d-e,d+e].reduce((function(t,e){return Math.abs(e-i)<Math.abs(t-i)?e:t}))}}d*=h,Math.abs(l.target[s]-d)<1||(l.panTo({x:o?d:0,y:o?0:d,friction:e}),this.onChange(n))}slideToClosest(t){if(this.panzoom){const{pageIndex:e}=this.getPageFromPosition();this.slideTo(e,t)}}slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),P(this.container,this.cn("inTransition"));const t=["to-prev","to-next","from-prev","from-next"];for(const e of this.slides){const i=e.el;if(i){i.removeEventListener(K,this.onAnimationEnd),i.classList.remove(...t);const n=e.transition;n&&i.classList.remove(`f-${n}Out`,`f-${n}In`)}}this.manageSlideVisiblity()}addSlide(t,e){var i,n,s,o;const a=this.panzoom,r=(null===(i=this.pages[this.page])||void 0===i?void 0:i.pos)||0,l=(null===(n=this.pages[this.page])||void 0===n?void 0:n.dim)||0,c=this.contentDim<this.viewportDim;let h=Array.isArray(e)?e:[e];const d=[];for(const t of h)d.push(N(t));this.slides.splice(t,0,...d);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;for(const t of d)this.emit("beforeInitSlide",t,t.index);if(this.page>=t&&(this.page+=d.length),this.updateMetrics(),a){const e=(null===(s=this.pages[this.page])||void 0===s?void 0:s.pos)||0,i=(null===(o=this.pages[this.page])||void 0===o?void 0:o.dim)||0,n=this.pages.length||1,h=this.isRTL?l-i:i-l,d=this.isRTL?r-e:e-r;c&&1===n?(t<=this.page&&(a.current[this.axis]-=h,a.target[this.axis]-=h),a.panTo({[this.isHorizontal?"x":"y"]:-1*e})):d&&t<=this.page&&(a.target[this.axis]-=d,a.current[this.axis]-=d,a.requestTick())}for(const t of d)this.emit("initSlide",t,t.index)}prependSlide(t){this.addSlide(0,t)}appendSlide(t){this.addSlide(this.slides.length,t)}removeSlide(t){const e=this.slides.length;t=(t%e+e)%e;const i=this.slides[t];
38if(i){this.removeSlideEl(i,!0),this.slides.splice(t,1);for(let t=0;t<this.slides.length;t++)this.slides[t].index=t;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1}),this.emit("destroySlide",i)}}updateMetrics(){const{panzoom:t,viewport:i,track:n,slides:s,isHorizontal:o,isInfinite:a}=this;if(!n)return;const r=o?"width":"height",l=o?"offsetWidth":"offsetHeight";if(i){let t=Math.max(i[l],e(i.getBoundingClientRect()[r],1e3)),n=getComputedStyle(i),s="padding",a=o?"Right":"Bottom";t-=parseFloat(n[s+(o?"Left":"Top")])+parseFloat(n[s+a]),this.viewportDim=t}let c,h=0;for(const[t,i]of s.entries()){let n=0,o=0;!i.el&&c?(n=c.dim,o=c.gap):(({dim:n,gap:o}=this.getSlideMetrics(i)),c=i),n=e(n,1e3),o=e(o,1e3),i.dim=n,i.gap=o,i.pos=h,h+=n,(a||t<s.length-1)&&(h+=o)}h=e(h,1e3),this.contentDim=h,t&&(t.contentRect[r]=h,t.contentRect[o?"fullWidth":"fullHeight"]=h),this.pages=this.createPages(),this.pages=this.processPages(),this.state===H.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),this.manageSlideVisiblity(),this.emit("refresh")}getProgress(t,i=!1,n=!1){void 0===t&&(t=this.page);const s=this,o=s.panzoom,a=s.contentDim,r=s.pages[t]||0;if(!r||!o)return t>this.page?-1:1;let l=-1*o.current.e,c=e((l-r.pos)/(1*r.dim),1e3),h=c,d=c;this.isInfinite&&!0!==n&&(h=e((l-r.pos+a)/(1*r.dim),1e3),d=e((l-r.pos-a)/(1*r.dim),1e3));let u=[c,h,d].reduce((function(t,e){return Math.abs(e)<Math.abs(t)?e:t}));return i?u:u>1?1:u<-1?-1:u}setViewportHeight(){const{page:t,pages:e,viewport:i,isHorizontal:n}=this;if(!i||!e[t])return;let s=0;n&&this.track&&(this.track.style.height="auto",e[t].slides.forEach((t=>{t.el&&(s=Math.max(s,t.el.offsetHeight))}))),i.style.height=s?`${s}px`:""}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{panzoom:n,contentDim:s,viewportDim:o,pages:a,page:r}=this;if(o){s=s+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let l=0;l=n&&n.state!==v.Init&&n.state!==v.Destroy?-1*n.current[this.axis]:a[r]&&a[r].pos||0,this.isInfinite&&(l-=Math.floor(l/s)*s),this.isRTL&&this.isHorizontal&&(l*=-1);const c=l-o*t,h=l+o*(t+1),d=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of d){const n=t.pos+e*s,o=n+t.dim+t.gap;n<h&&o>c&&i.add(t)}}return i}getPageFromPosition(t){const{viewportDim:e,contentDim:i,slides:n,pages:s,panzoom:o}=this,a=s.length,r=n.length,l=n[0],c=n[r-1],h=this.option("center");let d=0,u=0,p=0,f=void 0===t?-1*((null==o?void 0:o.target[this.axis])||0):t;h&&(f+=.5*e),this.isInfinite?(f<l.pos-.5*c.gap&&(f-=i,p=-1),f>c.pos+c.dim+.5*c.gap&&(f-=i,p=1)):f=Math.max(l.pos||0,Math.min(f,c.pos));let g=c,m=n.find((t=>{const e=t.pos-.5*g.gap,i=t.pos+t.dim+.5*t.gap;return g=t,f>=e&&f<i}));return m||(m=c),u=this.getPageForSlide(m.index),d=u+p*a,{page:d,pageIndex:u}}setPageFromPosition(){const{pageIndex:t}=this.getPageFromPosition();this.onChange(t)}destroy(){if([H.Destroy].includes(this.state))return;this.state=H.Destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:s}=this,o=this.option("classes");t.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),t.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),s&&(s.destroy(),this.panzoom=null),n&&n.forEach((t=>{this.removeSlideEl(t)})),this.detachPlugins(),e&&(e.removeEventListener("scroll",this.onScroll),e.offsetParent&&i&&i.offsetParent&&e.replaceWith(...i.childNodes));for(const[e,i]of Object.entries(o))"container"!==e&&i&&t.classList.remove(i);this.track=null,this.viewport=null,this.page=0,this.slides=[];const a=this.events.get("ready");this.events=new Map,a&&this.events.set("ready",a)}}Object.defineProperty(tt,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:D}),Object.defineProperty(tt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:B}),Object.defineProperty(tt,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:G});const et=function(t){if(!S(t))return 0;const e=window.scrollY,i=window.innerHeight,n=e+i,s=t.getBoundingClientRect(),o=s.y+e,a=s.height,r=o+a;if(e>r||n<o)return 0;if(e<o&&n>r)return 100;if(o<e&&r>n)return 100;let l=a;o<e&&(l-=e-o),r>n&&(l-=r-n);const c=l/i*100;return Math.round(c)},it=!("undefined"==typeof window||!window.document||!window.document.createElement);let nt;const st=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not
38([tabindex^="-"]):not([disabled]):not([aria-hidden])'].join(","),ot=t=>{if(t&&it){void 0===nt&&document.createElement("div").focus({get preventScroll(){return nt=!0,!1}});try{if(nt)t.focus({preventScroll:!0});else{const e=window.scrollY||document.body.scrollTop,i=window.scrollX||document.body.scrollLeft;t.focus(),document.body.scrollTo({top:e,left:i,behavior:"auto"})}}catch(t){}}},at=()=>{const t=document;let e,i="",n="",s="";return t.fullscreenEnabled?(i="requestFullscreen",n="exitFullscreen",s="fullscreenElement"):t.webkitFullscreenEnabled&&(i="webkitRequestFullscreen",n="webkitExitFullscreen",s="webkitFullscreenElement"),i&&(e={request:function(e=t.documentElement){return"webkitRequestFullscreen"===i?e[i](Element.ALLOW_KEYBOARD_INPUT):e[i]()},exit:function(){return t[s]&&t[n]()},isFullscreen:function(){return t[s]}}),e},rt={animated:!0,autoFocus:!0,backdropClick:"close",Carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},closeButton:"auto",closeExisting:!1,commonCaption:!1,compact:()=>window.matchMedia("(max-width: 578px), (max-height: 578px)").matches,contentClick:"toggleZoom",contentDblClick:!1,defaultType:"image",defaultDisplay:"flex",dragToClose:!0,Fullscreen:{autoStart:!1},groupAll:!1,groupAttr:"data-fancybox",hideClass:"f-fadeOut",hideScrollbar:!0,idle:3500,keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"prev",ArrowDown:"next",ArrowRight:"next",ArrowLeft:"prev"},l10n:Object.assign(Object.assign({},y),{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}),parentEl:null,placeFocusBack:!0,showClass:"f-zoomInUp",startIndex:0,tpl:{closeButton:'<button data-fancybox-close class="f-button is-close-btn" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"/></svg></button>',main:'<div class="fancybox__container" role="dialog" aria-modal="true" aria-label="{{MODAL}}" tabindex="-1">\n    <div class="fancybox__backdrop"></div>\n    <div class="fancybox__carousel"></div>\n    <div class="fancybox__footer"></div>\n  </div>'},trapFocus:!0,wheel:"zoom"};var lt,ct;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Closing=2]="Closing",t[t.CustomClosing=3]="CustomClosing",t[t.Destroy=4]="Destroy"}(lt||(lt={})),function(t){t[t.Loading=0]="Loading",t[t.Opening=1]="Opening",t[t.Ready=2]="Ready",t[t.Closing=3]="Closing"}(ct||(ct={}));let ht="",dt=!1,ut=!1,pt=null;const ft=()=>{let t="",e="";const i=Ae.getInstance();if(i){const n=i.carousel,s=i.getSlide();if(n&&s){let o=s.slug||void 0,a=s.triggerEl||void 0;e=o||(i.option("slug")||""),!e&&a&&a.dataset&&(e=a.dataset.fancybox||""),e&&"true"!==e&&(t="#"+e+(!o&&n.slides.length>1?"-"+(s.index+1):""))}}return{hash:t,slug:e,index:1}},gt=()=>{const t=new URL(document.URL).hash,e=t.slice(1).split("-"),i=e[e.length-1],n=i&&/^\+?\d+$/.test(i)&&parseInt(e.pop()||"1",10)||1;return{hash:t,slug:e.join("-"),index:n}},mt=()=>{const{slug:t,index:e}=gt();if(!t)return;let i=document.querySelector(`[data-slug="${t}"]`);if(i&&i.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),Ae.getInstance())return;const n=document.querySelectorAll(`[data-fancybox="${t}"]`);n.length&&(i=n[e-1],i&&i.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))},vt=()=>{if(!1===Ae.defaults.Hash)return;const t=Ae.getInstance();if(!1===(null==t?void 0:t.options.Hash))return;const{slug:e,index:i}=gt(),{slug:n}=ft();t&&(e===n?t.jumpTo(i-1):(dt=!0,t.close())),mt()},bt=()=>{pt&&clearTimeout(pt),queueMicrotask((()=>{vt()}))},yt=()=>{window.addEventListener("hashchange",bt,!1),setTimeout((()=>{vt()}),500)};it&&(/complete|interactive|loaded/.test(document.readyState)?yt():document.addEventListener("DOMContentLoaded",yt));const wt="is-zooming-in";class xt extends ${onCreateSlide(t,e,i){const n=this.instance.optionFor(i,"src")||"";i.el&&"image"===i.type&&"string"==typeof n&&this.setImage(i,n)}onRemoveSlide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(t,e,i,n){P(this.instance.container,wt);for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onClose(){var t;const e=this.instance,i=e.container,n=e.getSlide();if(!i||!i.parentElement||!n)return;const{el:s,contentEl:o,panzoom:a,thumbElSrc:r}=n;if(!s||!r||!o||!a||a.isContentLoading||a.state===v.Init||a.state===v.Destroy)return;a.updateMetrics();let l=this.getZoomInfo(n);if(!l)return;this.instance.state=lt.CustomClosing,i.classList.remove(wt),i.classList.add("is-zooming-out"),o.style.backgroundImage=`url('${r}')`;const c=i.getBoundingClientRect();
381===((null===(t=window.visualViewport)||void 0===t?void 0:t.scale)||1)&&Object.assign(i.style,{position:"absolute",top:`${i.offsetTop+window.scrollY}px`,left:`${i.offsetLeft+window.scrollX}px`,bottom:"auto",right:"auto",width:`${c.width}px`,height:`${c.height}px`,overflow:"hidden"});const{x:h,y:d,scale:u,opacity:p}=l;if(p){const t=((t,e,i,n)=>{const s=e-t,o=n-i;return e=>i+((e-t)/s*o||0)})(a.scale,u,1,0);a.on("afterTransform",(()=>{o.style.opacity=t(a.scale)+""}))}a.on("endAnimation",(()=>{e.destroy()})),a.target.a=u,a.target.b=0,a.target.c=0,a.target.d=u,a.panTo({x:h,y:d,scale:u,friction:p?.2:.33,ignoreBounds:!0}),a.isResting&&e.destroy()}setImage(t,e){const i=this.instance;t.src=e,this.process(t,e).then((e=>{const{contentEl:n,imageEl:s,thumbElSrc:o,el:a}=t;if(i.isClosing()||!n||!s)return;n.offsetHeight;const r=!!i.isOpeningSlide(t)&&this.getZoomInfo(t);if(this.option("protected")&&a){a.addEventListener("contextmenu",(t=>{t.preventDefault()}));const t=document.createElement("div");C(t,"fancybox-protected"),n.appendChild(t)}if(o&&r){const s=e.contentRect,a=Math.max(s.fullWidth,s.fullHeight);let c=null;!r.opacity&&a>1200&&(c=document.createElement("img"),C(c,"fancybox-ghost"),c.src=o,n.appendChild(c));const h=()=>{c&&(C(c,"f-fadeFastOut"),setTimeout((()=>{c&&(c.remove(),c=null)}),200))};(l=o,new Promise(((t,e)=>{const i=new Image;i.onload=t,i.onerror=e,i.src=l}))).then((()=>{i.hideLoading(t),t.state=ct.Opening,this.instance.emit("reveal",t),this.zoomIn(t).then((()=>{h(),this.instance.done(t)}),(()=>{})),c&&setTimeout((()=>{h()}),a>2500?800:200)}),(()=>{i.hideLoading(t),i.revealContent(t)}))}else{const n=this.optionFor(t,"initialSize"),s=this.optionFor(t,"zoom"),o={event:i.prevMouseMoveEvent||i.options.event,friction:s?.12:0};let a=i.optionFor(t,"showClass")||void 0,r=!0;i.isOpeningSlide(t)&&("full"===n?e.zoomToFull(o):"cover"===n?e.zoomToCover(o):"max"===n?e.zoomToMax(o):r=!1,e.stop("current")),r&&a&&(a=e.isDragging?"f-fadeIn":""),i.hideLoading(t),i.revealContent(t,a)}var l}),(()=>{i.setError(t,"{{IMAGE_ERROR}}")}))}process(t,e){return new Promise(((i,n)=>{var o;const a=this.instance,r=t.el;a.clearContent(t),a.showLoading(t);let l=this.optionFor(t,"content");if("string"==typeof l&&(l=s(l)),!l||!S(l)){if(l=document.createElement("img"),l instanceof HTMLImageElement){let i="",n=t.caption;i="string"==typeof n&&n?n.replace(/<[^>]+>/gi,"").substring(0,1e3):`Image ${t.index+1} of ${(null===(o=a.carousel)||void 0===o?void 0:o.pages.length)||1}`,l.src=e||"",l.alt=i,l.draggable=!1,t.srcset&&l.setAttribute("srcset",t.srcset),this.instance.isOpeningSlide(t)&&(l.fetchPriority="high")}t.sizes&&l.setAttribute("sizes",t.sizes)}C(l,"fancybox-image"),t.imageEl=l,a.setContent(t,l,!1);t.panzoom=new D(r,p({transformParent:!0},this.option("Panzoom")||{},{content:l,width:(e,i)=>a.optionFor(t,"width","auto",i)||"auto",height:(e,i)=>a.optionFor(t,"height","auto",i)||"auto",wheel:()=>{const t=a.option("wheel");return("zoom"===t||"pan"==t)&&t},click:(e,i)=>{var n,s;if(a.isCompact||a.isClosing())return!1;if(t.index!==(null===(n=a.getSlide())||void 0===n?void 0:n.index))return!1;if(i){const t=i.composedPath()[0];if(["A","BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].includes(t.nodeName))return!1}let o=!i||i.target&&(null===(s=t.contentEl)||void 0===s?void 0:s.contains(i.target));return a.option(o?"contentClick":"backdropClick")||!1},dblClick:()=>a.isCompact?"toggleZoom":a.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:t=>{i(t)},error:()=>{n()},destroy:()=>{n()}}}))}))}zoomIn(t){return new Promise(((e,i)=>{const n=this.instance,s=n.container,{panzoom:o,contentEl:a,el:r}=t;o&&o.updateMetrics();const l=this.getZoomInfo(t);if(!(l&&r&&a&&o&&s))return void i();const{x:c,y:h,scale:d,opacity:u}=l,p=()=>{t.state!==ct.Closing&&(u&&(a.style.opacity=Math.max(Math.min(1,1-(1-o.scale)/(1-d)),0)+""),o.scale>=1&&o.scale>o.targetScale-.1&&e(o))},f=t=>{(t.scale<.99||t.scale>1.01)&&!t.isDragging||(P(s,wt),a.style.opacity="",t.off("endAnimation",f),t.off("touchStart",f),t.off("afterTransform",p),e(t))};o.on("endAnimation",f),o.on("touchStart",f),o.on("afterTransform",p),o.on(["error","destroy"],(()=>{i()})),o.panTo({x:c,y:h,scale:d,friction:0,ignoreBounds:!0}),o.stop("current");
38const g={event:"mousemove"===o.panMode?n.prevMouseMoveEvent||n.options.event:void 0},m=this.optionFor(t,"initialSize");C(s,wt),n.hideLoading(t),"full"===m?o.zoomToFull(g):"cover"===m?o.zoomToCover(g):"max"===m?o.zoomToMax(g):o.reset(.172)}))}getZoomInfo(t){const{el:e,imageEl:i,thumbEl:n,panzoom:s}=t,o=this.instance,a=o.container;if(!e||!i||!n||!s||et(n)<3||!this.optionFor(t,"zoom")||!a||o.state===lt.Destroy)return!1;if("0"===getComputedStyle(a).getPropertyValue("--f-images-zoom"))return!1;const r=window.visualViewport||null;if(1!==(r?r.scale:1))return!1;let{top:l,left:c,width:h,height:d}=n.getBoundingClientRect(),{top:u,left:p,fitWidth:f,fitHeight:g}=s.contentRect;if(!(h&&d&&f&&g))return!1;const m=s.container.getBoundingClientRect();p+=m.left,u+=m.top;const v=-1*(p+.5*f-(c+.5*h)),b=-1*(u+.5*g-(l+.5*d)),y=h/f;let w=this.option("zoomOpacity")||!1;return"auto"===w&&(w=Math.abs(h/d-f/g)>.1),{x:v,y:b,scale:y,opacity:w}}attach(){const t=this,e=t.instance;e.on("Carousel.change",t.onChange),e.on("Carousel.createSlide",t.onCreateSlide),e.on("Carousel.removeSlide",t.onRemoveSlide),e.on("close",t.onClose)}detach(){const t=this,e=t.instance;e.off("Carousel.change",t.onChange),e.off("Carousel.createSlide",t.onCreateSlide),e.off("Carousel.removeSlide",t.onRemoveSlide),e.off("close",t.onClose)}}Object.defineProperty(xt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:"fit",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:"auto"}}),"function"==typeof SuppressedError&&SuppressedError;const Et="html",St="image",Pt="map",Ct="youtube",Tt="vimeo",Mt="html5video",Ot=(t,e={})=>{const i=new URL(t),n=new URLSearchParams(i.search),s=new URLSearchParams;for(const[t,i]of[...n,...Object.entries(e)]){let e=i+"";if("t"===t){let t=e.match(/((\d*)m)?(\d*)s?/);t&&s.set("start",60*parseInt(t[2]||"0")+parseInt(t[3]||"0")+"")}else s.set(t,e)}let o=s+"",a=t.match(/#t=((.*)?\d+s)/);return a&&(o+=`#t=${a[1]}`),o},At={ajax:null,autoSize:!0,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:'<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">\n  <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos.</video>',videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},Lt=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class zt extends ${onBeforeInitSlide(t,e,i){this.processType(i)}onCreateSlide(t,e,i){this.setContent(i)}onClearContent(t,e){e.xhr&&(e.xhr.abort(),e.xhr=null);const i=e.iframeEl;i&&(i.onload=i.onerror=null,i.src="//about:blank",e.iframeEl=null);const n=e.contentEl,s=e.placeholderEl;if("inline"===e.type&&n&&s)n.classList.remove("fancybox__content"),"none"!==getComputedStyle(n).getPropertyValue("display")&&(n.style.display="none"),setTimeout((()=>{s&&(n&&s.parentNode&&s.parentNode.insertBefore(n,s),s.remove())}),0),e.contentEl=void 0,e.placeholderEl=void 0;else for(;e.el&&e.el.firstChild;)e.el.removeChild(e.el.firstChild)}onSelectSlide(t,e,i){i.state===ct.Ready&&this.playVideo()}onUnselectSlide(t,e,i){var n,s;if(i.type===Mt){try{null===(s=null===(n=i.el)||void 0===n?void 0:n.querySelector("video"))||void 0===s||s.pause()}catch(t){}return}let o;i.type===Tt?o={method:"pause",value:"true"}:i.type===Ct&&(o={event:"command",func:"pauseVideo"}),o&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(o),"*"),i.poller&&clearTimeout(i.poller)}onDone(t,e){t.isCurrentSlide(e)&&!t.isClosing()&&this.playVideo()}onRefresh(t,e){e.slides.forEach((t=>{t.el&&(this.resizeIframe(t),this.setAspectRatio(t))}))}onMessage(t){try{let e=JSON.parse(t.data);if("https://player.vimeo.com"===t.origin){if("ready"===e.event)for(let e of Array.from(document.getElementsByClassName("fancybox__iframe")))e instanceof HTMLIFrameElement&&e.contentWindow===t.source&&(e.dataset.ready="true")}else if(t.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&"onReady"===e.event){const t=document.getElementById(e.id);t&&(t.dataset.ready="true")}}catch(t){}}loadAjaxContent(t){const e=this.instance.optionFor(t,"src")||"";this.instance.showLoading(t);const i=this.instance,n=new XMLHttpRequest;i.showLoading(t),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===lt.Ready&&(i.hideLoading(t),200===n.status?i.setContent(t,n.responseText):i.setError(t,404===n.status?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const s=t.ajax||null;n.open(s?"POST":"GET",e+""),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(s),t.xhr=n}setInlineContent(t){let e=null;if(S(t.src))e=t.src;else if("string"==typeof t.src){const i=t.src.split("#",2).pop();e=i?document.getElementById(i):null}if(e){if("clone"===t.type||e.closest(".fancybox__slide")){e=e.cloneNode(!0);const i=e.dataset.animationName;i&&(e.classList.remove(i),delete e.dataset.animationName);let n=e.getAttribute("id");n=n?`${n}--clone`:`clone-${this.instance.id}-${t.index}`,e.setAttribute("id",n)}else if(e.parentNode){const i=document.createElement("div");i.classList.add("fancybox-placeholder"),e.parentNode.insertBefore(i,e),t.placeholderEl=i}this.instance.setContent(t,e)}else this.instance.setError(t,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(t){const{src:e,el:i}=t;if(!e||"string"!=typeof e||!i)return;i.classList.add("is-loading");const n=this.instance,s=document.createElement("iframe");s.className="fancybox__iframe",s.setAttribute("id",`fancybox__iframe_${n.id}_${t.index}`);for(const[e,i]of Object.entries(this.optionFor(t,"iframeAttr")||{}))s.setAttribute(e,i);s.onerror=()=>{n.setError(t,"{{IFRAME_ERROR}}")},t.iframeEl=s;const o=this.optionFor(t,"preload");if("iframe"!==t.type||!1===o)return s.setAttribute("src",t.src+""),n.setContent(t,s,!1),this.resizeIframe(t),void n.revealContent(t);n.showLoading(t),s.onload=()=>
38{if(!s.src.length)return;const e="true"!==s.dataset.ready;s.dataset.ready="true",this.resizeIframe(t),e?n.revealContent(t):n.hideLoading(t)},s.setAttribute("src",e),n.setContent(t,s,!1)}resizeIframe(t){const{type:e,iframeEl:i}=t;if(e===Ct||e===Tt)return;const n=null==i?void 0:i.parentElement;if(!i||!n)return;let s=t.autoSize;void 0===s&&(s=this.optionFor(t,"autoSize"));let o=t.width||0,a=t.height||0;o&&a&&(s=!1);const r=n&&n.style;if(!1!==t.preload&&!1!==s&&r)try{const t=window.getComputedStyle(n),e=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),s=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=i.contentWindow;if(l){const t=l.document,i=t.getElementsByTagName(Et)[0],n=t.body;r.width="",n.style.overflow="hidden",o=o||i.scrollWidth+e,r.width=`${o}px`,n.style.overflow="",r.flex="0 0 auto",r.height=`${n.scrollHeight}px`,a=i.scrollHeight+s}}catch(t){}if(o||a){const t={flex:"0 1 auto",width:"",height:""};o&&"auto"!==o&&(t.width=`${o}px`),a&&"auto"!==a&&(t.height=`${a}px`),Object.assign(r,t)}}playVideo(){const t=this.instance.getSlide();if(!t)return;const{el:e}=t;if(!e||!e.offsetParent)return;if(!this.optionFor(t,"videoAutoplay"))return;if(t.type===Mt)try{const t=e.querySelector("video");if(t){const e=t.play();void 0!==e&&e.then((()=>{})).catch((e=>{t.muted=!0,t.play()}))}}catch(t){}if(t.type!==Ct&&t.type!==Tt)return;const i=()=>{if(t.iframeEl&&t.iframeEl.contentWindow){let e;if("true"===t.iframeEl.dataset.ready)return e=t.type===Ct?{event:"command",func:"playVideo"}:{method:"play",value:"true"},e&&t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"),void(t.poller=void 0);t.type===Ct&&(e={event:"listening",id:t.iframeEl.getAttribute("id")},t.iframeEl.contentWindow.postMessage(JSON.stringify(e),"*"))}t.poller=setTimeout(i,250)};i()}processType(t){if(t.html)return t.type=Et,t.src=t.html,void(t.html="");const e=this.instance.optionFor(t,"src","");if(!e||"string"!=typeof e)return;let i=t.type,n=null;if(n=e.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const s=this.optionFor(t,Ct),{nocookie:o}=s,a=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}(s,["nocookie"]),r=`www.youtube${o?"-nocookie":""}.com`,l=Ot(e,a),c=encodeURIComponent(n[2]);t.videoId=c,t.src=`https://${r}/embed/${c}?${l}`,t.thumbSrc=t.thumbSrc||`https://i.ytimg.com/vi/${c}/mqdefault.jpg`,i=Ct}else if(n=e.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/)){const s=Ot(e,this.optionFor(t,Tt)),o=encodeURIComponent(n[1]),a=n[4]||"";t.videoId=o,t.src=`https://player.vimeo.com/video/${o}?${a?`h=${a}${s?"&":""}`:""}${s}`,i=Tt}if(!i&&t.triggerEl){const e=t.triggerEl.dataset.type;Lt.includes(e)&&(i=e)}i||"string"==typeof e&&("#"===e.charAt(0)?i="inline":(n=e.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(i=Mt,t.videoFormat=t.videoFormat||"video/"+("ogv"===n[1]?"ogg":n[1])):e.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?i=St:e.match(/\.(pdf)((\?|#).*)?$/i)&&(i="pdf")),(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(t.src=`https://maps.google.${n[1]}/?ll=${(n[2]?n[2]+"&z="+Math.floor(parseFloat(n[3]))+(n[4]?n[4].replace(/^\//,"&"):""):n[4]+"").replace(/\?/,"&")}&output=${n[4]&&n[4].indexOf("layer=c")>0?"svembed":"embed"}`,i=Pt):(n=e.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(t.src=`https://maps.google.${n[1]}/maps?q=${n[2].replace("query=","q=").replace("api=1","")}&output=embed`,i=Pt),i=i||this.instance.option("defaultType"),t.type=i,i===St&&(t.thumbSrc=t.thumbSrc||t.src)}setContent(t){const e=this.instance.optionFor(t,"src")||"";if(t&&t.type&&e){switch(t.type){case Et:this.instance.setContent(t,e);break;case Mt:const i=this.option("videoTpl");i&&this.instance.setContent(t,i.replace(/\{\{src\}\}/gi,e+"").replace(/\{\{format\}\}/gi,this.optionFor(t,"videoFormat")||"").replace(/\{\{poster\}\}/gi,t.poster||t.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(t);break;case"ajax":this.loadAjaxContent(t);break;case"pdf":case Pt:case Ct:case Tt:t.preload=!1;case"iframe":this.setIframeContent(t)}this.setAspectRatio(t)}}setAspectRatio(t){const e=t.contentEl;if(!(t.el&&e&&t.type&&[Ct,Tt,Mt].includes(t.type)))return;let i,n=t.width||"auto",s=t.height||"auto";if("auto"===n||"auto"===s){i=this.optionFor(t,"videoRatio");const e=(i+"").match(/(\d+)\s*\/\s?(\d+)/);i=e&&e.length>2?parseFloat(e[1])/parseFloat(e[2]):parseFloat(i+"")}else n&&s&&(i=n/s);if(!i)return;e.style.aspectRatio="",e.style.width="",e.style.height="",e.offsetHeight;const o=e.getBoundingClientRect(),a=o.width||1,r=o.height||1;e.style.aspectRatio=i+"",i<a/r?(s="auto"===s?r:Math.min(r,s),e.style.width="auto",e.style.height=`${s}px`):(n="auto"===n?a:Math.min(a,n),e.style.width=`${n}px`,e.style.height="auto")}attach(){const t=this,e=t.instance;e.on("Carousel.beforeInitSlide",t.onBeforeInitSlide),e.on("Carousel.createSlide",t.onCreateSlide),e.on("Carousel.selectSlide",t.onSelectSlide),e.on("Carousel.unselectSlide",t.onUnselectSlide),e.on("Carousel.Panzoom.refresh",t.onRefresh),e.on("done",t.onDone),e.on("clearContent",t.onClearContent),window.addEventListener("message",t.onMessage)}detach(){const t=this,e=t.instance;e.off("Carousel.beforeInitSlide",t.onBeforeInitSlide),e.off("Carousel.createSlide",t.onCreateSlide),e.off("Carousel.selectSlide",t.onSelectSlide),e.off("Carousel.unselectSlide",t.onUnselectSlide),e.off("Carousel.Panzoom.refresh",t.onRefresh),e.off("done",t.onDone),e.off("clearContent",t.onClearContent),window.removeEventListener("message",t.onMessage)}}Object.defineProperty(zt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:At});const Rt="play",kt="pause",It="ready";class Dt extends ${constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:
38It}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==It}onReady(t){this.option("autoStart")&&(t.isInfinite||t.page<t.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){"visible"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var t;this.inHover=!1,(null===(t=this.instance.panzoom)||void 0===t?void 0:t.isResting)&&this.resume()}onTimerEnd(){const t=this.instance;"play"===this.state&&(t.isInfinite||t.page!==t.pages.length-1?t.slideNext():t.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var t;if(!this.option("showProgress"))return null;this.removeProgressBar();const e=this.instance,i=(null===(t=e.pages[e.page])||void 0===t?void 0:t.slides)||[];let n=this.option("progressParentEl");if(n||(n=(1===i.length?i[0].el:null)||e.viewport),!n)return null;const s=document.createElement("div");return C(s,"f-progress"),n.prepend(s),this.progressBar=s,s.offsetHeight,s}set(){const t=this,e=t.instance;if(e.pages.length<2)return;if(t.timer)return;const i=t.option("timeout");t.state=Rt,C(e.container,"has-autoplay");let n=t.createProgressBar();n&&(n.style.transitionDuration=`${i}ms`,n.style.transform="scaleX(1)"),t.timer=setTimeout((()=>{t.timer=null,t.inHover||t.onTimerEnd()}),i),t.emit("set")}clear(){const t=this;t.timer&&(clearTimeout(t.timer),t.timer=null),t.removeProgressBar()}start(){const t=this;if(t.set(),t.state!==It){if(t.option("pauseOnHover")){const e=t.instance.container;e.addEventListener("mouseenter",t.onMouseEnter,!1),e.addEventListener("mouseleave",t.onMouseLeave,!1)}document.addEventListener("visibilitychange",t.onVisibilityChange,!1),t.emit("start")}}stop(){const t=this,e=t.state,i=t.instance.container;t.clear(),t.state=It,i.removeEventListener("mouseenter",t.onMouseEnter,!1),i.removeEventListener("mouseleave",t.onMouseLeave,!1),document.removeEventListener("visibilitychange",t.onVisibilityChange,!1),P(i,"has-autoplay"),e!==It&&t.emit("stop")}pause(){const t=this;t.state===Rt&&(t.state=kt,t.clear(),t.emit(kt))}resume(){const t=this,e=t.instance;if(e.isInfinite||e.page!==e.pages.length-1)if(t.state!==Rt){if(t.state===kt&&!t.inHover){const e=new Event("resume",{bubbles:!0,cancelable:!0});t.emit("resume",e),e.defaultPrevented||t.set()}}else t.set();else t.stop()}toggle(){this.state===Rt||this.state===kt?this.stop():this.start()}attach(){const t=this,e=t.instance;e.on("ready",t.onReady),e.on("Panzoom.startAnimation",t.onChange),e.on("Panzoom.endAnimation",t.onSettle),e.on("Panzoom.touchMove",t.onChange)}detach(){const t=this,e=t.instance;e.off("ready",t.onReady),e.off("Panzoom.startAnimation",t.onChange),e.off("Panzoom.endAnimation",t.onSettle),e.off("Panzoom.touchMove",t.onChange),t.stop()}}Object.defineProperty(Dt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class Ft extends ${constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(t){const e=t.carousel;if(!e)return;const i=t.container;i&&(e.options.Autoplay=p({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{t.emit("startSlideshow")},set:e=>{var n;i.classList.add("has-slideshow"),(null===(n=t.getSlide())||void 0===n?void 0:n.state)!==ct.Ready&&e.pause()},stop:()=>{i.classList.remove("has-slideshow"),t.isCompact||t.endIdle(),t.emit("endSlideshow")},resume:(e,i)=>{var n,s,o;!i||!i.cancelable||(null===(n=t.getSlide())||void 0===n?void 0:n.state)===ct.Ready&&(null===(o=null===(s=t.carousel)||void 0===s?void 0:s.panzoom)||void 0===o?void 0:o.isResting)||i.preventDefault()}}}),e.attachPlugins({Autoplay:Dt}),this.ref=e.plugins.Autoplay)}onReady(t){const e=t.carousel,i=this.ref;i&&e&&this.option("playOnStart")&&(e.isInfinite||e.page<e.pages.length-1)&&i.start()}onDone(t,e){const i=this.ref,n=t.carousel;if(!i||!n)return;const s=e.panzoom;s&&s.on("startAnimation",(()=>{t.isCurrentSlide(e)&&i.stop()})),t.isCurrentSlide(e)&&i.resume()}onKeydown(t,e){var i;const n=this.ref;n&&e===this.option("key")&&"BUTTON"!==(null===(i=document.activeElement)||void 0===i?void 0:i.nodeName)&&n.toggle()}attach(){const t=this,e=t.instance;e.on("Carousel.init",t.onPrepare),e.on("Carousel.ready",t.onReady),e.on("done",t.onDone),e.on("key
38down",t.onKeydown)}detach(){const t=this,e=t.instance;e.off("Carousel.init",t.onPrepare),e.off("Carousel.ready",t.onReady),e.off("done",t.onDone),e.off("keydown",t.onKeydown)}}Object.defineProperty(Ft,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:t=>{var e;return(null===(e=t.instance.container)||void 0===e?void 0:e.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||t.instance.container},timeout:3e3}});const jt={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};var Bt;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Hidden=2]="Hidden"}(Bt||(Bt={}));const Ht="isResting",Nt="thumbWidth",_t="thumbHeight",$t="thumbClipWidth";let Wt=class extends ${constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Bt.Init})}get isModern(){return"modern"===this.type}onInitSlide(t,e){const i=e.el?e.el.dataset:void 0;i&&(e.thumbSrc=i.thumbSrc||e.thumbSrc||"",e[$t]=parseFloat(i[$t]||"")||e[$t]||0,e[_t]=parseFloat(i.thumbHeight||"")||e[_t]||0),this.addSlide(e)}onInitSlides(){this.build()}onChange(){var t;if(!this.isModern)return;const e=this.container,i=this.instance,n=i.panzoom,s=this.carousel,o=s?s.panzoom:null,r=i.page;if(n&&s&&o){if(n.isDragging){P(e,this.cn(Ht));let n=(null===(t=s.pages[r])||void 0===t?void 0:t.pos)||0;n+=i.getProgress(r)*(this[$t]+this.thumbGap);let a=o.getBounds();-1*n>a.x.min&&-1*n<a.x.max&&o.panTo({x:-1*n,friction:.12})}else a(e,this.cn(Ht),n.isResting);this.shiftModern()}}onRefresh(){this.updateProps();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.shiftModern()}isDisabled(){const t=this.option("minCount")||0;if(t){const e=this.instance;let i=0;for(const t of e.slides||[])t.thumbSrc&&i++;if(i<t)return!0}const e=this.option("type");return["modern","classic"].indexOf(e)<0}getThumb(t){const e=this.option("thumbTpl")||"";return{html:this.instance.localize(e,[["%i",t.index],["%d",t.index+1],["%s",t.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(t){const e=this.carousel;e&&e.addSlide(t.index,this.getThumb(t))}getSlides(){const t=[];for(const e of this.instance.slides||[])t.push(this.getThumb(e));return t}resizeModernSlide(t){this.isModern&&(t[Nt]=t[$t]&&t[_t]?Math.round(this[_t]*(t[$t]/t[_t])):this[Nt])}updateProps(){const t=this.container;if(!t)return;const e=e=>parseFloat(getComputedStyle(t).getPropertyValue("--f-thumb-"+e))||0;this.thumbGap=e("gap"),this.thumbExtraGap=e("extra-gap"),this[Nt]=e("width")||40,this[$t]=e("clip-width")||40,this[_t]=e("height")||40}build(){const t=this;if(t.state!==Bt.Init)return;if(t.isDisabled())return void t.emit("disabled");const e=t.instance,i=e.container,n=t.getSlides(),s=t.option("type");t.type=s;const o=t.option("parentEl"),a=t.cn("container"),r=t.cn("track");let l=null==o?void 0:o.querySelector("."+a);l||(l=document.createElement("div"),C(l,a),o?o.appendChild(l):i.after(l)),C(l,`is-${s}`),C(i,t.cn("hasThumbs")),t.container=l,t.updateProps();let c=l.querySelector("."+r);c||(c=document.createElement("div"),C(c,t.cn("track")),l.appendChild(c)),t.track=c;const h=p({},{track:c,infinite:!1,center:!0,fill:"classic"===s,dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},t.option("Carousel")||{},{Sync:{target:e},slides:n}),d=new e.constructor(l,h);d.on("createSlide",((e,i)=>{t.setProps(i.index),t.emit("createSlide",i,i.el)})),d.on("ready",(()=>{t.shiftModern(),t.emit("ready")})),d.on("refresh",(()=>{t.shiftModern()})),d.on("Panzoom.click",((e,i,n)=>{t.onClick(n)})),t.carousel=d,t.state=Bt.Ready}onClick(t){t.preventDefault(),t.stopPropagation();const e=this.instance,{pages:i,page:n}=e,s=t=>{if(t){const e=t.closest("[data-carousel-index]");if(e)return[parseInt(e.dataset.carouselIndex||"",10)||0,e]}return[-1,void 0]},o=(t,e)=>{const i=document.elementFromPoint(t,e);return i?s(i):[-1,void 0]};let[a,r]=s(t.target);if(a>-1)return;const l=this[$t],c=t.clientX,h=t.clientY;let[d,u]=o(c-l,h),[p,f]=o(c+l,h);u&&f?(a=Math.abs(c-u.getBoundingClientRect().right)<Math.abs(c-f.getBoundingClientRect().left)?d:
38p,a===n&&(a=a===d?p:d)):u?a=d:f&&(a=p),a>-1&&i[a]&&e.slideTo(a)}getShift(t){var e;const i=this,{instance:n}=i,s=i.carousel;if(!n||!s)return 0;const o=i[Nt],a=i[$t],r=i.thumbGap,l=i.thumbExtraGap;if(!(null===(e=s.slides[t])||void 0===e?void 0:e.el))return 0;const c=.5*(o-a),h=n.pages.length-1;let d=n.getProgress(0),u=n.getProgress(h),p=n.getProgress(t,!1,!0),f=0,g=c+l+r;const m=d<0&&d>-1,v=u>0&&u<1;return 0===t?(f=g*Math.abs(d),v&&1===d&&(f-=g*Math.abs(u))):t===h?(f=g*Math.abs(u)*-1,m&&-1===u&&(f+=g*Math.abs(d))):m||v?(f=-1*g,f+=g*Math.abs(d),f+=g*(1-Math.abs(u))):f=g*p,f}setProps(t){var i;const n=this;if(!n.isModern)return;const{instance:s}=n,o=n.carousel;if(s&&o){const a=null===(i=o.slides[t])||void 0===i?void 0:i.el;if(a&&a.childNodes.length){let i=e(1-Math.abs(s.getProgress(t))),o=e(n.getShift(t));a.style.setProperty("--progress",i?i+"":""),a.style.setProperty("--shift",o+"")}}}shiftModern(){const t=this;if(!t.isModern)return;const{instance:e,track:i}=t,n=e.panzoom,s=t.carousel;if(!(e&&i&&n&&s))return;if(n.state===v.Init||n.state===v.Destroy)return;for(const i of e.slides)t.setProps(i.index);let o=(t[$t]+t.thumbGap)*(s.slides.length||0);i.style.setProperty("--width",o+"")}cleanup(){const t=this;t.carousel&&t.carousel.destroy(),t.carousel=null,t.container&&t.container.remove(),t.container=null,t.track&&t.track.remove(),t.track=null,t.state=Bt.Init,P(t.instance.container,t.cn("hasThumbs"))}attach(){const t=this,e=t.instance;e.on("initSlide",t.onInitSlide),e.state===H.Init?e.on("initSlides",t.onInitSlides):t.onInitSlides(),e.on(["change","Panzoom.afterTransform"],t.onChange),e.on("Panzoom.refresh",t.onRefresh)}detach(){const t=this,e=t.instance;e.off("initSlide",t.onInitSlide),e.off("initSlides",t.onInitSlides),e.off(["change","Panzoom.afterTransform"],t.onChange),e.off("Panzoom.refresh",t.onRefresh),t.cleanup()}};Object.defineProperty(Wt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:jt});const Xt=Object.assign(Object.assign({},jt),{key:"t",showOnStart:!0,parentEl:null}),qt="is-masked",Yt="aria-hidden";class Vt extends ${constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const t=this.ref;return t&&!t.isDisabled()}get isHidden(){return this.hidden}onClick(t,e){e.stopPropagation()}onCreateSlide(t,e){var i,n,s;const o=(null===(s=null===(n=null===(i=this.instance)||void 0===i?void 0:i.carousel)||void 0===n?void 0:n.slides[e.index])||void 0===s?void 0:s.type)||"",a=e.el;if(a&&o){let t=`for-${o}`;["video","youtube","vimeo","html5video"].includes(o)&&(t+=" for-video"),C(a,t)}}onInit(){var t;const e=this,i=e.instance,n=i.carousel;if(e.ref||!n)return;const s=e.option("parentEl")||i.footer||i.container;if(!s)return;const o=p({},e.options,{parentEl:s,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:i.option("Carousel.friction")||0}},on:{ready:t=>{const i=t.container;i&&this.hidden&&(e.refresh(),i.style.transition="none",e.hide(),i.offsetHeight,queueMicrotask((()=>{i.style.transition="",e.show()})))}}});o.Carousel=o.Carousel||{},o.Carousel.on=p((null===(t=e.options.Carousel)||void 0===t?void 0:t.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),n.options.Thumbs=o,n.attachPlugins({Thumbs:Wt}),e.ref=n.plugins.Thumbs,e.option("showOnStart")||(e.ref.state=Bt.Hidden,e.hidden=!0)}onResize(){var t;const e=null===(t=this.ref)||void 0===t?void 0:t.container;e&&(e.style.maxHeight="")}onKeydown(t,e){const i=this.option("key");i&&i===e&&this.toggle()}toggle(){const t=this.ref;if(t&&!t.isDisabled())return t.state===Bt.Hidden?(t.state=Bt.Init,void t.build()):void(this.hidden?this.show():this.hide())}show(){const t=this.ref;if(!t||t.isDisabled())return;const e=t.container;e&&(this.refresh(),e.offsetHeight,e.removeAttribute(Yt),e.classList.remove(qt),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetHeight,e.classList.add(qt),e.setAttribute(Yt,"true")),this.hidden=!0}refresh(){const t=this.ref;if(!t||!t.state)return;const e=t.container,i=(null==e?void 0:e.firstChild)||null;e&&i&&i.childNodes.length&&(e.style.maxHeight=`${i.getBoundingClientRect().height}px`)}
38attach(){const t=this,e=t.instance;e.state===lt.Init?e.on("Carousel.init",t.onInit):t.onInit(),e.on("resize",t.onResize),e.on("keydown",t.onKeydown)}detach(){var t;const e=this,i=e.instance;i.off("Carousel.init",e.onInit),i.off("resize",e.onResize),i.off("keydown",e.onKeydown),null===(t=i.carousel)||void 0===t||t.detachPlugins(["Thumbs"]),e.ref=null}}Object.defineProperty(Vt,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Xt});const Zt={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}};var Ut;!function(t){t[t.Init=0]="Init",t[t.Ready=1]="Ready",t[t.Disabled=2]="Disabled"}(Ut||(Ut={}));const Gt={absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null},Kt={tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Jt="has-toolbar",Qt="fancybox__toolbar";class te extends ${constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Ut.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(t){var e;if(!t.carousel)return;let i=this.option("display"),n=this.option("absolute"),s=this.option("enabled");if("auto"===s){const t=this.instance.carousel;let e=0;if(t)for(const i of t.slides)(i.panzoom||"image"===i.type)&&e++;e||(s=!1)}s||(i=void 0);let o=0;const a={left:[],middle:[],right:[]};if(i)for(const t of["left","middle","right"])for(const n of i[t]){const i=this.createEl(n);i&&(null===(e=a[t])||void 0===e||e.push(i),o++)}let r=null;if(o&&(r=this.createContainer()),r){for(const[t,e]of Object.entries(a)){const i=document.createElement("div");C(i,Qt+"__column is-"+t);for(const t of e)i.appendChild(t);"auto"!==n||"middle"!==t||e.length||(n=!0),r.appendChild(i)}!0===n&&C(r,"is-absolute"),this.state=Ut.Ready,this.onRefresh()}else this.state=Ut.Disabled}onClick(t){var e,i;const n=this.instance,s=n.getSlide(),o=null==s?void 0:s.panzoom,a=t.target,r=a&&S(a)?a.dataset:null;if(!r)return;if(void 0!==r.fancyboxToggleThumbs)return t.preventDefault(),t.stopPropagation(),void(null===(e=n.plugins.Thumbs
38)||void 0===e||e.toggle());if(void 0!==r.fancyboxToggleFullscreen)return t.preventDefault(),t.stopPropagation(),void this.instance.toggleFullscreen();if(void 0!==r.fancyboxToggleSlideshow){t.preventDefault(),t.stopPropagation();const e=null===(i=n.carousel)||void 0===i?void 0:i.plugins.Autoplay;let s=e.isActive;return o&&"mousemove"===o.panMode&&!s&&o.reset(),void(s?e.stop():e.start())}const l=r.panzoomAction,c=r.panzoomChange;if((c||l)&&(t.preventDefault(),t.stopPropagation()),c){let t={};try{t=JSON.parse(c)}catch(t){}o&&o.applyChange(t)}else l&&o&&o[l]&&o[l]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const t=this.container;if(!t)return;const e=this.instance.getSlide();if(!e||e.state!==ct.Ready)return;const i=e&&!e.error&&e.panzoom;for(const e of t.querySelectorAll("[data-panzoom-action]"))i?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));let n=i&&i.canZoomIn(),s=i&&i.canZoomOut();for(const e of t.querySelectorAll('[data-panzoom-action="zoomIn"]'))n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(const e of t.querySelectorAll('[data-panzoom-action="zoomOut"]'))s?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));for(const e of t.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){s||n?(e.removeAttribute("disabled"),e.removeAttribute("tabindex")):(e.setAttribute("disabled",""),e.setAttribute("tabindex","-1"));const t=e.querySelector("g");t&&(t.style.display=n?"":"none")}}onDone(t,e){var i;null===(i=e.panzoom)||void 0===i||i.on("afterTransform",(()=>{this.instance.isCurrentSlide(e)&&this.onRefresh()})),this.instance.isCurrentSlide(e)&&this.onRefresh()}createContainer(){const t=this.instance.container;if(!t)return null;const e=this.option("parentEl")||t;let i=e.querySelector("."+Qt);return i||(i=document.createElement("div"),C(i,Qt),e.prepend(i)),i.addEventListener("click",this.onClick,{passive:!1,capture:!0}),t&&C(t,Jt),this.container=i,i}createEl(t){const e=this.instance,i=e.carousel;if(!i)return null;if("toggleFS"===t)return null;if("fullscreen"===t&&!at())return null;let n=null;const o=i.slides.length||0;let a=0,r=0;for(const t of i.slides)(t.panzoom||"image"===t.type)&&a++,("image"===t.type||t.downloadSrc)&&r++;if(o<2&&["infobar","prev","next"].includes(t))return n;if(void 0!==Zt[t]&&!a)return null;if("download"===t&&!r)return null;if("thumbs"===t){const t=e.plugins.Thumbs;if(!t||!t.isEnabled)return null}if("slideshow"===t){if(!i.plugins.Autoplay||o<2)return null}if(void 0!==Zt[t]){const e=Zt[t];n=document.createElement("button"),n.setAttribute("title",this.instance.localize(`{{${t.toUpperCase()}}}`)),C(n,"f-button"),e.action&&(n.dataset.panzoomAction=e.action),e.change&&(n.dataset.panzoomChange=JSON.stringify(e.change)),n.appendChild(s(this.instance.localize(e.icon)))}else{const e=(this.option("items")||[])[t];e&&(n=s(this.instance.localize(e.tpl)),"function"==typeof e.click&&n.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof e.click&&e.click.call(this,this,t)})))}const l=null==n?void 0:n.querySelector("svg");if(l)for(const[t,e]of Object.entries(Kt))l.getAttribute(t)||l.setAttribute(t,String(e));return n}removeContainer(){const t=this.container;t&&t.remove(),this.container=null,this.state=Ut.Disabled;const e=this.instance.container;e&&P(e,Jt)}attach(){const t=this,e=t.instance;e.on("Carousel.initSlides",t.onReady),e.on("done",t.onDone),e.on(["reveal","Carousel.change"],t.onChange),t.onReady(t.instance)}detach(){const t=this,e=t.instance;e.off("Carousel.initSlides",t.onReady),e.off("done",t.onDone),e.off(["reveal","Carousel.change"],t.onChange),t.removeContainer()}}Object.defineProperty(te,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Gt});const ee={Hash:class extends ${onReady(){dt=!1}onChange(t){pt&&clearTimeout(pt);const{hash:e}=ft(),{hash:i}=gt(),n=t.isOpeningSlide(t.getSlide());n&&(ht=i===e?"":i),e&&e!==i&&(pt=setTimeout((()=>{try{if(t.state===lt.Ready){let t="replaceState";
38n&&!ut&&(t="pushState",ut=!0),window.history[t]({},document.title,window.location.pathname+window.location.search+e)}}catch(t){}}),300))}onClose(t){if(pt&&clearTimeout(pt),!dt&&ut)return ut=!1,dt=!1,void window.history.back();if(!dt)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(ht||""))}catch(t){}}attach(){const t=this.instance;t.on("ready",this.onReady),t.on(["Carousel.ready","Carousel.change"],this.onChange),t.on("close",this.onClose)}detach(){const t=this.instance;t.off("ready",this.onReady),t.off(["Carousel.ready","Carousel.change"],this.onChange),t.off("close",this.onClose)}static parseURL(){return gt()}static startFromUrl(){mt()}static destroy(){window.removeEventListener("hashchange",bt,!1)}},Html:zt,Images:xt,Slideshow:Ft,Thumbs:Vt,Toolbar:te},ie="with-fancybox",ne="hide-scrollbar",se="--fancybox-scrollbar-compensate",oe="--fancybox-body-margin",ae="aria-hidden",re="is-using-tab",le="is-animated",ce="is-compact",he="is-loading",de="is-opening",ue="has-caption",pe="disabled",fe="tabindex",ge="download",me="href",ve="src",be=t=>"string"==typeof t,ye=function(){var t=window.getSelection();return!!t&&"Range"===t.type};let we,xe=null,Ee=null,Se=0,Pe=0,Ce=0,Te=0;const Me=new Map;let Oe=0;class Ae extends m{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(t=[],e={},i={}){super(e),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:lt.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),we||(we=at()),this.id=e.id||++Oe,Me.set(this.id,this),this.userSlides=t,this.userPlugins=i,queueMicrotask((()=>{this.init()}))}init(){if(this.state===lt.Destroy)return;this.state=lt.Init,this.attachPlugins(Object.assign(Object.assign({},Ae.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),!0===this.option("hideScrollbar")&&(()=>{if(!it)return;const t=document,e=t.body,i=t.documentElement;if(e.classList.contains(ne))return;let n=window.innerWidth-i.getBoundingClientRect().width;const s=parseFloat(window.getComputedStyle(e).marginRight);n<0&&(n=0),i.style.setProperty(se,`${n}px`),s&&e.style.setProperty(oe,`${s}px`),e.classList.add(ne)})(),this.initLayout(),this.scale();const t=()=>{this.initCarousel(this.userSlides),this.state=lt.Ready,this.attachEvents(),this.emit("ready"),setTimeout((()=>{this.container&&this.container.setAttribute(ae,"false")}),16)};this.option("Fullscreen.autoStart")&&we&&!we.isFullscreen()?we.request().then((()=>{this.startedFs=!0,t()})).catch((()=>t())):t()}initLayout(){var t,e;const i=this.option("parentEl")||document.body,n=s(this.localize(this.option("tpl.main")||""));if(n){if(n.setAttribute("id",`fancybox-${this.id}`),n.setAttribute("aria-label",this.localize("{{MODAL}}")),n.classList.toggle(ce,this.isCompact),C(n,this.option("mainClass")||""),C(n,de),this.container=n,this.footer=n.querySelector(".fancybox__footer"),i.appendChild(n),C(document.documentElement,ie),xe&&Ee||(xe=document.createElement("span"),C(xe,"fancybox-focus-guard"),xe.setAttribute(fe,"0"),xe.setAttribute(ae,"true"),xe.setAttribute("aria-label","Focus guard"),Ee=xe.cloneNode(),null===(t=n.parentElement)||void 0===t||t.insertBefore(xe,n),null===(e=n.parentElement)||void 0===e||e.append(Ee)),n.addEventListener("mousedown",(t=>{Se=t.pageX,Pe=t.pageY,P(n,re)})),this.option("closeExisting"))for(const t of Me.values())t.id!==this.id&&t.close();else this.option("animated")&&(C(n,le),setTimeout((()=>{this.isClosing()||P(n,le)}),350));
38this.emit("initLayout")}}initCarousel(t){const e=this.container;if(!e)return;const n=e.querySelector(".fancybox__carousel");if(!n)return;const s=this.carousel=new tt(n,p({},{slides:t,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));s.on("*",((t,e,...i)=>{this.emit(`Carousel.${e}`,t,...i)})),s.on(["ready","change"],(()=>{this.manageCaption()})),this.on("Carousel.removeSlide",((t,e,i)=>{this.clearContent(i),i.state=void 0})),s.on("Panzoom.touchStart",(()=>{var t,e;this.isCompact||this.endIdle(),(null===(t=document.activeElement)||void 0===t?void 0:t.closest(".f-thumbs"))&&(null===(e=this.container)||void 0===e||e.focus())})),s.on("settle",(()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()})),this.option("dragToClose")&&(s.on("Panzoom.afterTransform",((t,e)=>{const n=this.getSlide();if(n&&i(n.el))return;const s=this.container;if(s){const t=Math.abs(e.current.f),i=t<1?"":Math.max(.5,Math.min(1,1-t/e.contentRect.fitHeight*1.5));s.style.setProperty("--fancybox-ts",i?"0s":""),s.style.setProperty("--fancybox-opacity",i+"")}})),s.on("Panzoom.touchEnd",((t,e,n)=>{var s;const o=this.getSlide();if(o&&i(o.el))return;if(e.isMobile&&document.activeElement&&-1!==["TEXTAREA","INPUT"].indexOf(null===(s=document.activeElement)||void 0===s?void 0:s.nodeName))return;const a=Math.abs(e.dragOffset.y);"y"===e.lockedAxis&&(a>=200||a>=50&&e.dragOffset.time<300)&&(n&&n.cancelable&&n.preventDefault(),this.close(n,"f-throwOut"+(e.current.f<0?"Up":"Down")))}))),s.on("change",(t=>{var e;let i=null===(e=this.getSlide())||void 0===e?void 0:e.triggerEl;if(i){const e=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}})),s.on(["refresh","change"],(t=>{const e=this.container;if(!e)return;for(const i of e.querySelectorAll("[data-fancybox-current-index]"))i.innerHTML=t.page+1;for(const i of e.querySelectorAll("[data-fancybox-count]"))i.innerHTML=t.pages.length;if(!t.isInfinite){for(const i of e.querySelectorAll("[data-fancybox-next]"))t.page<t.pages.length-1?(i.removeAttribute(pe),i.removeAttribute(fe)):(i.setAttribute(pe,""),i.setAttribute(fe,"-1"));for(const i of e.querySelectorAll("[data-fancybox-prev]"))t.page>0?(i.removeAttribute(pe),i.removeAttribute(fe)):(i.setAttribute(pe,""),i.setAttribute(fe,"-1"))}const i=this.getSlide();if(!i)return;let n=i.downloadSrc||"";n||"image"!==i.type||i.error||!be(i[ve])||(n=i[ve]);for(const t of e.querySelectorAll("[data-fancybox-download]")){const e=i.downloadFilename;n?(t.removeAttribute(pe),t.removeAttribute(fe),t.setAttribute(me,n),t.setAttribute(ge,e||n),t.setAttribute("target","_blank")):(t.setAttribute(pe,""),t.setAttribute(fe,"-1"),t.removeAttribute(me),t.removeAttribute(ge))}})),this.emit("initCarousel")}attachEvents(){const t=this,e=t.container;if(!e)return;e.addEventListener("click",t.onClick,{passive:!1,capture:!1}),e.addEventListener("wheel",t.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",t.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",t.onVisibilityChange,!1),document.addEventListener("mousemove",t.onMousemove),t.option("trapFocus")&&document.addEventListener("focus",t.onFocus,!0),window.addEventListener("resize",t.onResize);const i=window.visualViewport;i&&(i.addEventListener("scroll",t.onResize),i.addEventListener("resize",t.onResize))}detachEvents(){const t=this,e=t.container;if(!e)return;document.removeEventListener("keydown",t.onKeydown,{passive:!1,capture:!0}),e.removeEventListener("wheel",t.onWheel,{passive:!1,capture:!1}),e.removeEventListener("click",t.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",t.onMousemove),window.removeEventListener("resize",t.onResize);const i=window.visualViewport;i&&(i.removeEventListener("resize",t.onResize),i.removeEventListener("scroll",t.onResize)),document.removeEventListener("visibilitychange",t.onVisibilityChange,!1),document.removeEventListener("focus",t.onFocus,!0)}scale(){const t=this.container;if(!t)return;
38const e=window.visualViewport,i=Math.max(1,(null==e?void 0:e.scale)||1);let n="",s="",o="";if(e&&i>1){let t=`${e.offsetLeft}px`,a=`${e.offsetTop}px`;n=e.width*i+"px",s=e.height*i+"px",o=`translate3d(${t}, ${a}, 0) scale(${1/i})`}t.style.transform=o,t.style.width=n,t.style.height=s}onClick(t){var e;const{container:i,isCompact:n}=this;if(!i||this.isClosing())return;!n&&this.option("idle")&&this.resetIdle();const s=t.composedPath()[0];if(s.closest(".fancybox-spinner")||s.closest("[data-fancybox-close]"))return t.preventDefault(),void this.close(t);if(s.closest("[data-fancybox-prev]"))return t.preventDefault(),void this.prev();if(s.closest("[data-fancybox-next]"))return t.preventDefault(),void this.next();if("click"===t.type&&0===t.detail)return;if(Math.abs(t.pageX-Se)>30||Math.abs(t.pageY-Pe)>30)return;const o=document.activeElement;if(ye()&&o&&i.contains(o))return;if(n&&"image"===(null===(e=this.getSlide())||void 0===e?void 0:e.type))return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout((()=>{this.toggleIdle(),this.clickTimer=null}),350));if(this.emit("click",t),t.defaultPrevented)return;let a=!1;if(s.closest(".fancybox__content")){if(o){if(o.closest("[contenteditable]"))return;s.matches(st)||o.blur()}if(ye())return;a=this.option("contentClick")}else s.closest(".fancybox__carousel")&&!s.matches(st)&&(a=this.option("backdropClick"));"close"===a?(t.preventDefault(),this.close(t)):"next"===a?(t.preventDefault(),this.next()):"prev"===a&&(t.preventDefault(),this.prev())}onWheel(t){const e=t.target;let i=this.option("wheel",t);e.closest(".fancybox__thumbs")&&(i="slide");const s="slide"===i,o=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t})),a=Math.max(-1,Math.min(1,o)),r=Date.now();this.pwt&&r-this.pwt<300?s&&t.preventDefault():(this.pwt=r,this.emit("wheel",t,a),t.defaultPrevented||("close"===i?(t.preventDefault(),this.close(t)):"slide"===i&&(n(e)||(t.preventDefault(),this[a>0?"prev":"next"]()))))}onScroll(){window.scrollTo(Ce,Te)}onKeydown(t){if(!this.isTopmost())return;this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle();const e=t.key,i=this.option("keyboard");if(!i)return;const n=t.composedPath()[0],s=document.activeElement&&document.activeElement.classList,o=s&&s.contains("f-button")||n.dataset.carouselPage||n.dataset.carouselIndex;if("Escape"!==e&&!o&&S(n)){if(n.isContentEditable||-1!==["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(n.nodeName))return}if("Tab"===t.key?C(this.container,re):P(this.container,re),t.ctrlKey||t.altKey||t.shiftKey)return;this.emit("keydown",e,t);const a=i[e];a&&"function"==typeof this[a]&&(t.preventDefault(),this[a]())}onResize(){const t=this.container;if(!t)return;const e=this.isCompact;t.classList.toggle(ce,e),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize")}onFocus(t){this.isTopmost()&&this.checkFocus(t)}onMousemove(t){this.prevMouseMoveEvent=t,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){"visible"===document.visibilityState?this.checkFocus():this.endIdle()}manageCloseBtn(t){const e=this.optionFor(t,"closeButton")||!1;if("auto"===e){const t=this.plugins.Toolbar;if(t&&t.state===Ut.Ready)return}if(!e)return;if(!t.contentEl||t.closeBtnEl)return;const i=this.option("tpl.closeButton");if(i){const e=s(this.localize(i));t.closeBtnEl=t.contentEl.appendChild(e),t.el&&C(t.el,"has-close-btn")}}manageCaption(t=void 0){var e,i;const n="fancybox__caption",s=this.container;if(!s)return;P(s,ue);const o=this.isCompact||this.option("commonCaption"),a=!o;if(this.caption&&this.stop(this.caption),a&&this.caption&&(this.caption.remove(),this.caption=null),o&&!this.caption)for(const t of(null===(e=this.carousel)||void 0===e?void 0:e.slides)||[])t.captionEl&&(t.captionEl.remove(),t.captionEl=void 0,P(t.el,ue),null===(i=t.el)||void 0===i||i.removeAttribute("aria-labelledby"));if(t||(t=this.getSlide()),!t||o&&!this.isCurrentSlide(t))return;const r=t.el;let l=this.optionFor(t,"caption","");if(!l)return void(o&&this.caption&&this.animate(this.caption,"f-fadeOut",(()=>{this.caption&&(this.caption.innerHTML="")})));let c=null;if(a){if(c=t.captionEl||null,r&&!c){const e=n+`_${this.id}_${t.index}`;c=document.createElement("div"),C(c,n),c.setAttribute("id",e),t.captionEl=r.a
38ppendChild(c),C(r,ue),r.setAttribute("aria-labelledby",e)}}else{if(c=this.caption,c||(c=s.querySelector("."+n)),!c){c=document.createElement("div"),c.dataset.fancyboxCaption="",C(c,n);(this.footer||s).prepend(c)}C(s,ue),this.caption=c}c&&(c.innerHTML="",be(l)||"number"==typeof l?c.innerHTML=l+"":l instanceof HTMLElement&&c.appendChild(l))}checkFocus(t){this.focus(t)}focus(t){var e;if(this.ignoreFocusChange)return;const i=document.activeElement||null,n=(null==t?void 0:t.target)||null,s=this.container,o=null===(e=this.carousel)||void 0===e?void 0:e.viewport;if(!s||!o)return;if(!t&&i&&s.contains(i))return;const a=this.getSlide(),r=a&&a.state===ct.Ready?a.el:null;if(!r||r.contains(i)||s===i)return;t&&t.cancelable&&t.preventDefault(),this.ignoreFocusChange=!0;const l=Array.from(s.querySelectorAll(st));let c=[],h=null;for(let t of l){const e=!t.offsetParent||!!t.closest('[aria-hidden="true"]'),i=r&&r.contains(t),n=!o.contains(t);if(t===s||(i||n)&&!e){c.push(t);const e=t.dataset.origTabindex;void 0!==e&&e&&(t.tabIndex=parseFloat(e)),t.removeAttribute("data-orig-tabindex"),!t.hasAttribute("autoFocus")&&h||(h=t)}else{const e=void 0===t.dataset.origTabindex?t.getAttribute("tabindex")||"":t.dataset.origTabindex;e&&(t.dataset.origTabindex=e),t.tabIndex=-1}}let d=null;t?(!n||c.indexOf(n)<0)&&(d=h||s,c.length&&(i===Ee?d=c[0]:this.lastFocus!==s&&i!==xe||(d=c[c.length-1]))):d=a&&"image"===a.type?s:h||s,d&&ot(d),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const t=this.carousel;t&&t.pages.length>1&&t.slideNext()}prev(){const t=this.carousel;t&&t.pages.length>1&&t.slidePrev()}jumpTo(...t){this.carousel&&this.carousel.slideTo(...t)}isTopmost(){var t;return(null===(t=Ae.getInstance())||void 0===t?void 0:t.id)==this.id}animate(t=null,e="",i){if(!t||!e)return void(i&&i());this.stop(t);const n=s=>{s.target===t&&t.dataset.animationName&&(t.removeEventListener("animationend",n),delete t.dataset.animationName,i&&i(),P(t,e))};t.dataset.animationName=e,t.addEventListener("animationend",n),C(t,e)}stop(t){t&&t.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:t}))}setContent(t,e="",i=!0){if(this.isClosing())return;const n=t.el;if(!n)return;let o=null;if(S(e)?o=e:(o=s(e+""),S(o)||(o=document.createElement("div"),o.innerHTML=e+"")),["img","picture","iframe","video","audio"].includes(o.nodeName.toLowerCase())){const t=document.createElement("div");t.appendChild(o),o=t}S(o)&&t.filter&&!t.error&&(o=o.querySelector(t.filter)),o&&S(o)?(C(o,"fancybox__content"),t.id&&o.setAttribute("id",t.id),n.classList.add(`has-${t.error?"error":t.type||"unknown"}`),n.prepend(o),"none"===o.style.display&&(o.style.display=""),"none"===getComputedStyle(o).getPropertyValue("display")&&(o.style.display=t.display||this.option("defaultDisplay")||"flex"),t.contentEl=o,i&&this.revealContent(t),this.manageCloseBtn(t),this.manageCaption(t)):this.setError(t,"{{ELEMENT_NOT_FOUND}}")}revealContent(t,e){const i=t.el,n=t.contentEl;i&&n&&(this.emit("reveal",t),this.hideLoading(t),t.state=ct.Opening,(e=this.isOpeningSlide(t)?void 0===e?this.optionFor(t,"showClass"):e:"f-fadeIn")?this.animate(n,e,(()=>{this.done(t)})):this.done(t))}done(t){this.isClosing()||(t.state=ct.Ready,this.emit("done",t),C(t.el,"is-done"),this.isCurrentSlide(t)&&this.option("autoFocus")&&queueMicrotask((()=>{var e;null===(e=t.panzoom)||void 0===e||e.updateControls(),this.option("autoFocus")&&this.focus()})),this.isOpeningSlide(t)&&(P(this.container,de),!this.isCompact&&this.option("idle")&&this.setIdle()))}isCurrentSlide(t){const e=this.getSlide();return!(!t||!e)&&e.index===t.index}isOpeningSlide(t){var e,i;return null===(null===(e=this.carousel)||void 0===e?void 0:e.prevPage)&&t&&t.index===(null===(i=this.getSlide())||void 0===i?void 0:i.index)}showLoading(t){t.state=ct.Loading;const e=t.el;if(!e)return;C(e,he),this.emit("loading",t),t.spinnerEl||setTimeout((()=>{if(!this.isClosing()&&!t.spinnerEl&&t.state===ct.Loading){let i=s(E);C(i,"fancybox-spinner"),t.spinnerEl=i,e.prepend(i),this.animate(i,"f-fadeIn")}}),250)}hideLoading(t){const e=t.el;if(!e)return;const i=t.spinnerEl;this.isClosing()?null==i||i.remove():(P(e,he),i&&this.animate(i,"f-fadeOut",(()=>{i.remove()}
38)),t.state===ct.Loading&&(this.emit("loaded",t),t.state=ct.Ready))}setError(t,e){if(this.isClosing())return;const i=new Event("error",{bubbles:!0,cancelable:!0});if(this.emit("error",i,t),i.defaultPrevented)return;t.error=e,this.hideLoading(t),this.clearContent(t);const n=document.createElement("div");n.classList.add("fancybox-error"),n.innerHTML=this.localize(e||"<p>{{ERROR}}</p>"),this.setContent(t,n)}clearContent(t){if(void 0===t.state)return;this.emit("clearContent",t),t.contentEl&&(t.contentEl.remove(),t.contentEl=void 0);const e=t.el;e&&(P(e,"has-error"),P(e,"has-unknown"),P(e,`has-${t.type||"unknown"}`)),t.closeBtnEl&&t.closeBtnEl.remove(),t.closeBtnEl=void 0,t.captionEl&&t.captionEl.remove(),t.captionEl=void 0,t.spinnerEl&&t.spinnerEl.remove(),t.spinnerEl=void 0}getSlide(){var t;const e=this.carousel;return(null===(t=null==e?void 0:e.pages[null==e?void 0:e.page])||void 0===t?void 0:t.slides[0])||void 0}close(t,e){if(this.isClosing())return;const i=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",i,t),i.defaultPrevented)return;t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());const n=()=>{this.proceedClose(t,e)};this.startedFs&&we&&we.isFullscreen()?Promise.resolve(we.exit()).then((()=>n())):n()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(t=!1){const e=()=>{this.clearIdle(),this.idle=!0,C(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(t)e();else{const t=this.option("idle");t&&(this.idleTimer=setTimeout(e,t))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,P(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){we&&(we.isFullscreen()?we.exit():we.request().then((()=>{this.startedFs=!0})))}isClosing(){return[lt.Closing,lt.CustomClosing,lt.Destroy].includes(this.state)}proceedClose(t,e){var i,n;this.state=lt.Closing,this.clearIdle(),this.detachEvents();const s=this.container,o=this.carousel,a=this.getSlide(),r=a&&this.option("placeFocusBack")?a.triggerEl||this.option("triggerEl"):null;if(r&&(et(r)?ot(r):r.focus()),s&&(P(s,de),C(s,"is-closing"),s.setAttribute(ae,"true"),this.option("animated")&&C(s,le),s.style.pointerEvents="none"),o){o.clearTransitions(),null===(i=o.panzoom)||void 0===i||i.destroy(),null===(n=o.plugins.Navigation)||void 0===n||n.detach();for(const t of o.slides){t.state=ct.Closing,this.hideLoading(t);const e=t.contentEl;e&&this.stop(e);const i=null==t?void 0:t.panzoom;i&&(i.stop(),i.detachEvents(),i.detachObserver()),this.isCurrentSlide(t)||o.emit("removeSlide",t)}}Ce=window.scrollX,Te=window.scrollY,window.addEventListener("scroll",this.onScroll),this.emit("close",t),this.state!==lt.CustomClosing?(void 0===e&&a&&(e=this.optionFor(a,"hideClass")),e&&a?(this.animate(a.contentEl,e,(()=>{o&&o.emit("removeSlide",a)})),setTimeout((()=>{this.destroy()}),500)):this.destroy()):setTimeout((()=>{this.destroy()}),500)}destroy(){var t;if(this.state===lt.Destroy)return;window.removeEventListener("scroll",this.onScroll),this.state=lt.Destroy,null===(t=this.carousel)||void 0===t||t.destroy();const e=this.container;e&&e.remove(),Me.delete(this.id);const i=Ae.getInstance();i?i.focus():(xe&&(xe.remove(),xe=null),Ee&&(Ee.remove(),Ee=null),P(document.documentElement,ie),(()=>{if(!it)return;const t=document,e=t.body;e.classList.remove(ne),e.style.setProperty(oe,""),t.documentElement.style.setProperty(se,"")})(),this.emit("destroy"))}static bind(t,e,i){if(!it)return;let n,s="",o={};if(void 0===t?n=document.body:be(t)?(n=document.body,s=t,"object"==typeof e&&(o=e||{})):(n=t,be(e)&&(s=e),"object"==typeof i&&(o=i||{})),!n||!S(n))return;s=s||"[data-fancybox]";const a=Ae.openers.get(n)||new Map;a.set(s,o),Ae.openers.set(n,a),1===a.size&&n.addEventListener("click",Ae.fromEvent)}static unbind(t,e){let i,n="";if(be(t)?(i=document.body,n=t):(i=t,be(e)&&(n=e)),!i)return;const s=Ae.openers.get(i);s&&n&&s.delete(n),n&&s||(Ae.openers.delete(i),i.removeEventListener("click",Ae.fromEvent))}static destroy(){let t;for(;t=Ae.getInstance();)t.destroy();for(const t of Ae.openers.keys())t.removeEventListener("click",Ae.from
38Event);Ae.openers=new Map}static fromEvent(t){if(t.defaultPrevented)return;if(t.button&&0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey)return;let e=t.composedPath()[0];const i=e.closest("[data-fancybox-trigger]");if(i){const t=i.dataset.fancyboxTrigger||"",n=document.querySelectorAll(`[data-fancybox="${t}"]`),s=parseInt(i.dataset.fancyboxIndex||"",10)||0;e=n[s]||e}if(!(e&&e instanceof Element))return;let n,s,o,a;if([...Ae.openers].reverse().find((([t,i])=>!(!t.contains(e)||![...i].reverse().find((([i,r])=>{let l=e.closest(i);return!!l&&(n=t,s=i,o=l,a=r,!0)}))))),!n||!s||!o)return;a=a||{},t.preventDefault(),e=o;let r=[],l=p({},rt,a);l.event=t,l.triggerEl=e,l.delegate=i;const c=l.groupAll,h=l.groupAttr,d=h&&e?e.getAttribute(`${h}`):"";if((!e||d||c)&&(r=[].slice.call(n.querySelectorAll(s))),e&&!c&&(r=d?r.filter((t=>t.getAttribute(`${h}`)===d)):[e]),!r.length)return;const u=Ae.getInstance();return u&&u.options.triggerEl&&r.indexOf(u.options.triggerEl)>-1?void 0:(e&&(l.startIndex=r.indexOf(e)),Ae.fromNodes(r,l))}static fromSelector(t,e,i){let n=null,s="",o={};if(be(t)?(n=document.body,s=t,"object"==typeof e&&(o=e||{})):t instanceof HTMLElement&&be(e)&&(n=t,s=e,"object"==typeof i&&(o=i||{})),!n||!s)return!1;const a=Ae.openers.get(n);return!!a&&(o=p({},a.get(s)||{},o),!!o&&Ae.fromNodes(Array.from(n.querySelectorAll(s)),o))}static fromNodes(t,e){e=p({},rt,e||{});const i=[];for(const n of t){const t=n.dataset||{},s=t[ve]||n.getAttribute(me)||n.getAttribute("currentSrc")||n.getAttribute(ve)||void 0;let o;const a=e.delegate;let r;a&&i.length===e.startIndex&&(o=a instanceof HTMLImageElement?a:a.querySelector("img:not([aria-hidden])")),o||(o=n instanceof HTMLImageElement?n:n.querySelector("img:not([aria-hidden])")),o&&(r=o.currentSrc||o[ve]||void 0,!r&&o.dataset&&(r=o.dataset.lazySrc||o.dataset[ve]||void 0));const l={src:s,triggerEl:n,thumbEl:o,thumbElSrc:r,thumbSrc:r};for(const e in t){let i=t[e]+"";i="false"!==i&&("true"===i||i),l[e]=i}i.push(l)}return new Ae(i,e)}static getInstance(t){if(t)return Me.get(t);return Array.from(Me.values()).reverse().find((t=>!t.isClosing()&&t))||null}static getSlide(){var t;return(null===(t=Ae.getInstance())||void 0===t?void 0:t.getSlide())||null}static show(t=[],e={}){return new Ae(t,e)}static next(){const t=Ae.getInstance();t&&t.next()}static prev(){const t=Ae.getInstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of Me.values())t.close(...e);else{const t=Ae.getInstance();t&&t.close(...e)}}}Object.defineProperty(Ae,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(Ae,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:rt}),Object.defineProperty(Ae,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:ee}),Object.defineProperty(Ae,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),t.Carousel=tt,t.Fancybox=Ae,t.Panzoom=D}));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,(function(e){"use strict";const t=(e,...s)=>{const n=s.length;for(let i=0;i<n;i++){const n=s[i]||{};Object.entries(n).forEach((([s,n])=>{const i=Array.isArray(n)?[]:{};var o;e[s]||Object.assign(e,{[s]:i}),"object"==typeof(o=n)&&null!==o&&o.constructor===Object&&"[object Object]"===Object.prototype.toString.call(o)?Object.assign(e[s],t(i,n)):Array.isArray(n)?Object.assign(e,{[s]:[...n]}):Object.assign(e,{[s]:n})}))}return e},s=function(e,t){return e.split(".").reduce(((e,t)=>"object"==typeof e?e[t]:void 0),t)};
38class n{constructor(e={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(e);for(const e of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))e.startsWith("on")&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}setOptions(e){this.options=e?t({},this.constructor.defaults,e):{};for(const[e,t]of Object.entries(this.option("on")||{}))this.on(e,t)}option(e,...t){let n=s(e,this.options);return n&&"function"==typeof n&&(n=n.call(this,this,...t)),n}optionFor(e,t,n,...i){let o=s(t,e);var r;"string"!=typeof(r=o)||isNaN(r)||isNaN(parseFloat(r))||(o=parseFloat(o)),"true"===o&&(o=!0),"false"===o&&(o=!1),o&&"function"==typeof o&&(o=o.call(this,this,e,...i));let a=s(t,this.options);return a&&"function"==typeof a?o=a.call(this,this,e,...i,o):void 0===o&&(o=a),void 0===o?n:o}cn(e){const t=this.options.classes;return t&&t[e]||""}localize(e,t=[]){e=String(e).replace(/\{\{(\w+).?(\w+)?\}\}/g,((e,t,s)=>{let n="";return s?n=this.option(`${t[0]+t.toLowerCase().substring(1)}.l10n.${s}`):t&&(n=this.option(`l10n.${t}`)),n||(n=e),n}));for(let s=0;s<t.length;s++)e=e.split(t[s][0]).join(t[s][1]);return e=e.replace(/\{\{(.*?)\}\}/g,((e,t)=>t))}on(e,t){let s=[];"string"==typeof e?s=e.split(" "):Array.isArray(e)&&(s=e),this.events||(this.events=new Map),s.forEach((e=>{let s=this.events.get(e);s||(this.events.set(e,[]),s=[]),s.includes(t)||s.push(t),this.events.set(e,s)}))}off(e,t){let s=[];"string"==typeof e?s=e.split(" "):Array.isArray(e)&&(s=e),s.forEach((e=>{const s=this.events.get(e);if(Array.isArray(s)){const e=s.indexOf(t);e>-1&&s.splice(e,1)}}))}emit(e,...t){[...this.events.get(e)||[]].forEach((e=>e(this,...t))),"*"!==e&&this.emit("*",e,...t)}}Object.defineProperty(n,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.33"}),Object.defineProperty(n,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class i extends n{constructor(e,t){super(t),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:e})}attach(){}detach(){}}const o=e=>`${e||""}`.split(" ").filter((e=>!!e)),r=(e,t)=>{e&&o(t).forEach((t=>{e.classList.add(t)}))},a="play",l="pause",c="ready";class u extends i{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:c}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==c}onReady(e){this.option("autoStart")&&(e.isInfinite||e.page<e.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){"visible"===document.visibilityState?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var e;this.inHover=!1,(null===(e=this.instance.panzoom)||void 0===e?void 0:e.isResting)&&this.resume()}onTimerEnd(){const e=this.instance;"play"===this.state&&(e.isInfinite||e.page!==e.pages.length-1?e.slideNext():e.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var e;if(!this.option("showProgress"))return null;this.removeProgressBar();const t=this.instance,s=(null===(e=t.pages[t.page])||void 0===e?void 0:e.slides)||[];let n=this.option("progressParentEl");if(n||(n=(1===s.length?s[0].el:null)||t.viewport),!n)return null;const i=document.createElement("div");return r(i,"f-progress"),n.prepend(i),this.progressBar=i,i.offsetHeight,i}set(){const e=this,t=e.instance;if(t.pages.length<2)return;if(e.timer)return;const s=e.option("timeout");e.state=a,r(t.container,"has-autoplay");let n=e.createProgressBar();n&&(n.style.transitionDuration=`${s}ms`,n.style.transform="scaleX(1)"),e.timer=setTimeout((()=>{e.timer=null,e.inHover||e.onTimerEnd()}),s),e.emit("set")}clear(){const e=this;e.timer&&(clearTimeout(e.timer),e.timer=null),e.removeProgressBar()}start(){const e=this;if(e.set(),e.state!==c){if(e.option("pauseOnHover")){const t=e.instance.container;t.addEventListener("mouseenter",e.onMouseEnter,!1),t.addEventListener("mouseleave",e.onMouseLeave,!1)}document.addEventListener("visibilitychange",e.onVisibilityChange,!1),e.emit("start")}}stop(){const e=this,t=e.state,s=e.instance.container;var n,i;e.clear(),e.state=c,s.removeEventListener("mouseenter",e.onMouseEnter,!1),s.removeEventListener("mouseleave",e.onMouseLeave,!1),document.removeEventListener("visibilitychange",e.onVisibilityChange,!1),i="has-autoplay",(n=s)&&o(i).forEac
38h((e=>{n.classList.remove(e)})),t!==c&&e.emit("stop")}pause(){const e=this;e.state===a&&(e.state=l,e.clear(),e.emit(l))}resume(){const e=this,t=e.instance;if(t.isInfinite||t.page!==t.pages.length-1)if(e.state!==a){if(e.state===l&&!e.inHover){const t=new Event("resume",{bubbles:!0,cancelable:!0});e.emit("resume",t),t.defaultPrevented||e.set()}}else e.set();else e.stop()}toggle(){this.state===a||this.state===l?this.stop():this.start()}attach(){const e=this,t=e.instance;t.on("ready",e.onReady),t.on("Panzoom.startAnimation",e.onChange),t.on("Panzoom.endAnimation",e.onSettle),t.on("Panzoom.touchMove",e.onChange)}detach(){const e=this,t=e.instance;t.off("ready",e.onReady),t.off("Panzoom.startAnimation",e.onChange),t.off("Panzoom.endAnimation",e.onSettle),t.off("Panzoom.touchMove",e.onChange),e.stop()}}Object.defineProperty(u,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}}),e.Autoplay=u}));const DEBUG_FANCYBOX=!1;function runWhenIdle(fn,timeout){timeout=timeout||2000;if(typeof requestIdleCallback!=='undefined'){requestIdleCallback(fn,{timeout:timeout})}else{setTimeout(fn,300)}}
39if(typeof window!=='undefined'){var originalConsoleError=console.error;console.error=function(){var args=Array.prototype.slice.call(arguments);var errorMessage='';var shouldSuppress=!1;for(var i=0;i<args.length;i++){var arg=args[i];if(typeof arg==='string'){errorMessage+=arg+' '}else if(arg&&typeof arg==='object'){if(arg.message){errorMessage+=arg.message+' '}
40if(arg.toString){errorMessage+=arg.toString()+' '}}}
41if(errorMessage.indexOf('Cannot listen to an undefined element')!==-1||errorMessage.indexOf('PluginFeedFooterActionLogger')!==-1||(errorMessage.indexOf('ErrorUtils caught an error')!==-1&&errorMessage.indexOf('undefined element')!==-1)||(errorMessage.indexOf('Tried to listen to element of type click')!==-1)){shouldSuppress=!0}
42if(!shouldSuppress){for(var j=0;j<args.length;j++){if(args[j]&&typeof args[j]==='object'&&args[j].guardList){var guardListStr=JSON.stringify(args[j].guardList||[]);if(guardListStr.indexOf('PluginFeedFooterActionLogger')!==-1||guardListStr.indexOf('initializeClickLoggers')!==-1){shouldSuppress=!0;break}}}}
43if(shouldSuppress){return}
44originalConsoleError.apply(console,args)};window.addEventListener('error',function(event){if(event.message&&(event.message.indexOf('Cannot listen to an undefined element')!==-1||event.message.indexOf('PluginFeedFooterActionLogger')!==-1||(event.filename&&event.filename.indexOf('facebook.net')!==-1&&event.message.indexOf('undefined')!==-1))){event.preventDefault();return!0}},!0);if(typeof window.addEventListener!=='undefined'){window.addEventListener('unhandledrejection',function(event){if(event.reason&&typeof event.reason==='string'&&(event.reason.indexOf('Cannot listen to an undefined element')!==-1||event.reason.indexOf('PluginFeedFooterActionLogger')!==-1)){event.preventDefault()}})}}
45function debugLog(message){if(DEBUG_FANCYBOX){console.log(message)}}
46function breakingnews_scroll_setup($scrollcontainer){if($scrollcontainer.data("nfBreakingnewsScrollReady")){return}
47let $scrolltext=$scrollcontainer.find("> .nf-o-fl-post__breakingnews-text").first(),containerWidth=$scrollcontainer.width(),elementWidth=$(".nf-o-fl-post__breakingnews-text__element",$scrolltext).outerWidth(!0),html=$scrolltext.html(),ant=Math.ceil(containerWidth/elementWidth);if(!$scrolltext.length||!html||!isFinite(elementWidth)||elementWidth<=0){return}
48$scrollcontainer.data("nfBreakingnewsScrollReady",!0);for(let i=0;i<ant+1;i++){$scrolltext.append(html)}
49$scrolltext.css("width",elementWidth*(ant+1)+10+"px");breakingnews_scroll($scrollcontainer)}
50function breakingnews_scroll($scrollcontainer){let $scrolltext=$scrollcontainer.find("> .nf-o-fl-post__breakingnews-text").first(),elementWidth=$(".nf-o-fl-post__breakingnews-text__element",$scrolltext).outerWidth(!0);if(!$scrolltext.length||!isFinite(elementWidth)||elementWidth<=0){return}
51$scrolltext.css("visibility","visible");$scrolltext.stop(!0,!0);$scrolltext.animate({left:"-="+elementWidth},10000,"linear",function(){$scrolltext.children().first().appendTo($scrolltext);$scrolltext.css("left",0);if($scrollcontainer.data("nfBreakingnewsScrollReady")){breakingnews_scroll($scrollcontainer)}})}
52function safeGtag(){if(typeof gtag!=='undefined'&&typeof gtag==='function'){gtag.apply(this,arguments)}else{window.dataLayer=window.dataLayer||[];window.dataLayer.push(arguments)}}
53function grantGoogleAnalyticsConsent(){safeGtag("consent","update",{ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",});safeGtag("set","ads_data_redaction",!1)}
54var todayTime=typeof moment!=="undefined"?moment(new Date(),"DD.MM.YYYY HH:mm"):null;var today=typeof moment!=="undefined"?moment(new Date(),"DD.MM.YYYY"):null;function ensureCalentimCSS(){if(document.getElementById("nf-calentim-css"))return;var basePath=window.baseNewsflowHref||(window.jsPath||"/src/js/").replace(/\/js\/?$/,"");var link=document.createElement("link");link.id="nf-calentim-css";link.rel="stylesheet";link.href=basePath+"/js/calentim/build/css/calentim.min.css?ver="+encodeURIComponent(window.nfCssVersion||"");document.head.appendChild(link)}
55function loadCalentim(callback){window.calentimCallbacks=window.calentimCallbacks||[];if(callback)window.calentimCallbacks.push(callback);if(window.calentimLoading)return;window.calentimLoading=!0;var script=document.createElement("script");var finish=function(){window.calentimLoading=!1;window.calentimLoadFailed=!1;var callbacks=window.calentimCallbacks.splice(0);callbacks.forEach(function(queuedCallback){queuedCallback()})};script.src=(window.nfJsCombineHref||"/src/include/jsCombine.php")+"?loc=footer&pos=early&type=standard&bundle=calendar&ver="+encodeURIComponent(window.nfJsVersion||"");script.onload=finish;script.onerror=function(){window.calentimLoading=!1;window.calentimLoadFailed=!0;window.calentimCallbacks.splice(0);console.error("Failed to load the calendar bundle")};document.head.appendChild(script)}
56function prepareCalentimDates(){if(typeof moment==="undefined"){return!1}
57todayTime=moment(new Date(),"DD.MM.YYYY HH:mm");today=moment(new Date(),"DD.MM.YYYY");return!0}
58function activate_datepickers(){var datepickerSel=".nf-js-datepicker, .nf-js-datepicker-time, .nf-js-datepicker-future, .nf-js-datepicker-time-future";if(!$(datepickerSel).length)return;ensureCalentimCSS();if(typeof moment==="undefined"||typeof $.fn.calentim==="undefined"){if(window.calentimLoadFailed)return;loadCalentim(function(){activate_datepickers()});return}
59prepareCalentimDates();$(".nf-js-datepicker").each(function(){$(this).calentim(calentimOptions);calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime,"DD.MM.YYYY"));calentim.showDropdown()}})});$(".nf-js-datepicker-time").each(function(){var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.showTimePickers=!0;calentimOptionsLocal.format="DD.MM.YYYY HH:mm";$(this).calentim(calentimOptionsLocal);var calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime,"DD.MM.YYYY HH:mm"));calentim.showDropdown()}})});$(".nf-js-datepicker-future").each(function(){var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.minDate=today;$(this).calentim(calentimOptionsLocal);var calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime));calentim.showDropdown()}})});$(".nf-js-datepicker-time-future").each(function(){var calentimOptionsLocal=JSON.parse(JSON.stringify(calentimOptions));calentimOptionsLocal.minDate=today;calentimOptionsLocal.showTimePickers=!0;calentimOptionsLocal.format="DD.MM.YYYY HH:mm";$(this).calentim(calentimOptionsLocal);var calentim=$(this).data("calentim");$(this).click(function(){if($(this).val()==""){calentim.destroy();calentimOptionsLocal.startEmpty=!1;$(this).calentim(calentimOptionsLocal);calentim=$(this).data("calentim");calentim.setStart(moment(todayTime,"DD.MM.YYYY HH:mm"));calentim.showDropdown()}})})}
60function getGDPRConsent(vendorId){if(typeof vendorId==="undefined"||vendorId==null){return!0}
61if(typeof gdprVendorsNames==="undefined"||gdprVendorsNames==null){return!0}
62if(typeof inMobiCMPLoaded==="undefined"||inMobiCMPLoaded===null||!inMobiCMPLoaded){return!0}
63const i=gdprVendorsNames.indexOf(vendorId);if(i<0){return!0}
64const vendorRealId=gdprVendors[i];let gdprCookie=Cookies.get("newsflow_gdpr_accepted");if(gdprCookie!==undefined){gdprCookie=JSON.parse(gdprCookie);return gdprCookie[vendorRealId]}else{return!1}}
65function nfAbTitleHotcountHostUrl(){return window.location.protocol+"//"+window.location.host}
66function nfAbTitleHotcountSitehashString(articleId){if(typeof CryptoJS==="undefined"||!CryptoJS.MD5){return""}
67return CryptoJS.MD5(nfAbTitleHotcountHostUrl()+String(articleId||"")).toString()}
68function nfAbTitleHotcountArticleId(){var urlBase=window.location.pathname.split("?")[0];var id=typeof NyhetID!=="undefined"&&NyhetID?NyhetID:urlBase.slice(urlBase.lastIndexOf(".")+1);return String(id||"")}
69function nfAbTitleQueryParamFromUrl(){return(typeof nfAbTitleVariant!=="undefined"&&nfAbTitleVariant)?String(nfAbTitleVariant):(new URLSearchParams(window.location.search).get("abtitlevariant")||"")}
70function nfAbTitleHotcountPostBody(id,action,abTitleVariant){var sid=String(id||"");return{NyhetID:sid,Action:action,Sitehash:nfAbTitleHotcountSitehashString(sid),ABTitleVariant:abTitleVariant!=null?String(abTitleVariant):"",}}
71if(getGDPRConsent("GDPR_VENDOR_THIN")){var hotcountVisitor=function(){var id=nfAbTitleHotcountArticleId();if(!id){return}
72$.post("/src/nocache/ajax/ajax_hotcount.php",nfAbTitleHotcountPostBody(id,"update",nfAbTitleQueryParamFromUrl()))}}
73$(document).on("click","[data-nf-ab-title-variant][data-nf-ab-title-nyhetid]",function(){nfTrackAbTitleEvent($(this).attr("data-nf-ab-title-nyhetid"),$(this).attr("data-nf-ab-title-variant"),"abtitle_click")});function nfTrackAbTitleEvent(id,variant,action){if(!getGDPRConsent("GDPR_VENDOR_THIN")){return}
74id=String(id||"");variant=String(variant||"").toUpperCase();if(!id||["A","B","C","D"].indexOf(variant)===-1){return}
75const params=new URLSearchParams(nfAbTitleHotcountPostBody(id,action,variant));if(window.fetch){fetch("/src/nocache/ajax/ajax_hotcount.php",{method:"POST",body:params,keepalive:!0,credentials:"same-origin",})}else if(navigator.sendBeacon){navigator.sendBeacon("/src/nocache/ajax/ajax_hotcount.php",new Blob([params.toString()],{type:"application/x-www-form-urlencoded"}))}else{$.post("/src/nocache/ajax/ajax_hotcount.php",params.toString())}}
76function nfInitAbTitleImpressions(context){if(!getGDPRConsent("GDPR_VENDOR_THIN")||!("IntersectionObserver" in window)){return}
77const selector="[data-nf-ab-title-variant][data-nf-ab-title-nyhetid]:not([data-nf-ab-title-impression-watch])",root=context&&context.querySelectorAll?context:document,elements=Array.from(root.querySelectorAll(selector));if(root!==document&&root.matches&&root.matches(selector)){elements.push(root)}
78if(!elements.length){return}
79const observer=new IntersectionObserver(function(entries,obs){entries.forEach(function(entry){const el=entry.target;if(el.getAttribute("data-nf-ab-title-impression-sent")==="1"){obs.unobserve(el);return}
80if(entry.isIntersecting&&entry.intersectionRatio>=0.5){if(el.nfAbTitleImpressionTimer){return}
81el.nfAbTitleImpressionTimer=window.setTimeout(function(){el.setAttribute("data-nf-ab-title-impression-sent","1");nfTrackAbTitleEvent(el.getAttribute("data-nf-ab-title-nyhetid"),el.getAttribute("data-nf-ab-title-variant"),"abtitle_impression");obs.unobserve(el)},700)}else if(el.nfAbTitleImpressionTimer){window.clearTimeout(el.nfAbTitleImpressionTimer);el.nfAbTitleImpressionTimer=null}})},{threshold:[0,0.5]});elements.forEach(function(el){el.setAttribute("data-nf-ab-title-impression-watch","1");observer.observe(el)})}
82$(function(){nfInitAbTitleImpressions(document);if("MutationObserver" in window){const mutationObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(node.nodeType===1){nfInitAbTitleImpressions(node)}})})});mutationObserver.observe(document.body,{childList:!0,subtree:!0})}});var parallaxSizer;function articleQAFrame(callback){if(window.requestAnimationFrame){window.requestAnimationFrame(callback);return}
83setTimeout(callback,16)}
84function initArticleQA(){$(".nf-c-artikkel-qa__item").each(function(){var $item=$(this);var $question=$item.children(".nf-c-artikkel-qa__question").first();var $answer=$item.children(".nf-c-artikkel-qa__answer").first();if($item.data("nfQaReady")||!$question.length||!$answer.length){return}
85$item.data("nfQaReady",!0).addClass("nf-js-qa-ready");if($item.prop("open")){$answer.css("height","auto")}else{$answer.css("height","0px")}
86$question.on("click.nfArticleQA",function(event){event.preventDefault();if($item.data("nfQaAnimating")){return}
87if($item.prop("open")){closeArticleQAItem($item,$answer)}else{openArticleQAItem($item,$answer)}})})}
88function openArticleQAItem($item,$answer){var done=!1;var targetHeight;$item.data("nfQaAnimating",!0);$item.removeClass("nf-qa-is-closing").prop("open",!0);$answer.css({height:"auto",overflow:"hidden",transition:"none"});targetHeight=$answer[0].scrollHeight;$answer.css("height","0px");$answer[0].offsetHeight;$answer.css("transition","");articleQAFrame(function(){$answer.css("height",targetHeight+"px")});function finish(){if(done){return}
89done=!0;$answer.css({height:"auto",overflow:"visible"});$item.data("nfQaAnimating",!1)}
90$answer.one("transitionend.nfArticleQA",function(event){if(event.originalEvent&&event.originalEvent.propertyName!=="height"){return}
91finish()});setTimeout(finish,260)}
92function closeArticleQAItem($item,$answer){var done=!1;$item.data("nfQaAnimating",!0);$answer.css({height:$answer[0].scrollHeight+"px",overflow:"hidden"});articleQAFrame(function(){$item.addClass("nf-qa-is-closing");$answer.css("height","0px")});function finish(){if(done){return}
93done=!0;$item.removeClass("nf-qa-is-closing").prop("open",!1);$answer.css("height","0px");$item.data("nfQaAnimating",!1)}
94$answer.one("transitionend.nfArticleQA",function(event){if(event.originalEvent&&event.originalEvent.propertyName!=="height"){return}
95finish()});setTimeout(finish,260)}
96$(document).ready(function(){initArticleQA();$(".nf-o-fl-post__breakingnews").each(function(){let duration=$(this).attr("data-duration");if(duration>Math.floor(Date.now()/1000)){$(this).show();if($(this).hasClass("nf-js-breakingnews--scroll")){breakingnews_scroll_setup($(this))}}else{$(this).hide()}});if(typeof inMobiCMPLoaded!=="undefined"&&inMobiCMPLoaded!==null&&inMobiCMPLoaded){$("#openCMPwindow").click(function(){__tcfapi("displayConsentUi",2,function(){})})}else{Cookies.set("newsflow_gdpr_accepted",1,{expires:90})}
97function positionPasswordToggle($pwField,$eye){const $container=$pwField.parent();$container.css("position","relative");const fieldPosition=$pwField.position(),eyeWidth=$eye.outerWidth(),eyeHeight=$eye.outerHeight();$eye.css({left:fieldPosition.left+$pwField.outerWidth()-eyeWidth-12,right:"auto",top:fieldPosition.top+($pwField.outerHeight()-eyeHeight)/2,})}
98$("input[type=password]").each(function(){const $pwField=$(this),$eye=$('<i class="fa-solid fa-eye nf-password-toggle" title="Vis passord"></i>').insertAfter($pwField);$pwField.css("padding-right","36px");$eye.data("passwordField",$pwField).css({cursor:"pointer",position:"absolute","z-index":1});positionPasswordToggle($pwField,$eye);$eye.click(function(){if($(this).hasClass("fa-eye")){$(this).removeClass("fa-eye");$(this).addClass("fa-eye-slash");$pwField.attr("type","text")}else{$(this).removeClass("fa-eye-slash");$(this).addClass("fa-eye");$pwField.attr("type","password")}})});$(window).off("resize.nf-password-toggle").on("resize.nf-password-toggle",function(){$(".nf-password-toggle").each(function(){const $eye=$(this);positionPasswordToggle($eye.data("passwordField"),$eye)})});
98if($(".nf-js-passwordtest").length){$.getScript(jsPath+"zxcvbn/dist/zxcvbn.js").done(function(){$(".nf-js-passwordtest").after('<meter max="4" class="nf-o-passwordtest-meter"></meter><div class="nf-o-passwordtest-text"></div><input type="hidden" id="passordstyrke" name="passordstyrke" value="0">');$(".nf-js-passwordtest-login").after('<input type="hidden" id="passordstyrke" name="passordstyrke" value="0">');var $pwtest_strength={0:"Veldig svakt",1:"Svakt",2:"SÃ¥nn passe",3:"Bra",4:"Perfekt",};var $pwtest_password=$(".nf-js-passwordtest");var $pwtest_password_login=$(".nf-js-passwordtest-login");var $pwtest_meter=$(".nf-o-passwordtest-meter");var $pwtest_text=$(".nf-o-passwordtest-text");var $pwtest_styrke=$("#passordstyrke");function passwordUpdateLogin(){var val=$pwtest_password_login.val();var result=zxcvbn(val);if(val!==""){$pwtest_styrke.val(result.score)}else{$pwtest_styrke.val("0")}}
99function passwordUpdateSet(){var val=$pwtest_password.val();var result=zxcvbn(val);$pwtest_meter.val(result.score);if(val!==""){$pwtest_text.html("Passordstyrke: "+$pwtest_strength[result.score]);$pwtest_styrke.val(result.score)}else{$pwtest_text.html("");$pwtest_styrke.val("0")}}
100$(".nf-js-form-loginbutton").click(function(e){passwordUpdateLogin()});$pwtest_password.on("input",function(){passwordUpdateSet()});$pwtest_password_login.on("input",function(){passwordUpdateLogin()})})}
101if($("form.nf-o-form input[name=sludiballCtrl1]").length){$("form.nf-o-form input[name=sludiballCtrl1]").val("di-raor")}
102$("iframe[id^='nyhet_galleri']").each(function(){const $iframe=$(this);$iframe.load(function(){const $galleri=$iframe.contents().find(".nf-c-artikkel-galleri");$(".f-button",$galleri).click(function(){safeGtag("event","Galleri",{send_to:ga4id,event_action:"gallery_interaction_"+$galleri.attr("data-id"),nf_platform:window.nf_platform||'web',});$(".f-button",$galleri).off("click")})})});$(".nf-o-annonse__stillingcounterimg").each(function(){if(!getGDPRConsent("GDPR_VENDOR_GOOGLE")){}
103safeGtag("event","impression_ad",{send_to:ga4id,item_name:$(this).attr("data-label"),item_category:"Stillinger_front",nf_platform:window.nf_platform||'web',})});function recalcScaledIframes(){$("iframe.nf-js-iframe-scale").each(function(){let h=$(this).attr("height"),w=$(this).attr("width");if(h!="auto"){let realWidth=$(this).width(),ratio=w/(realWidth||1),newHeight=Math.round(h/ratio);$(this).css("width","100%").css("height",newHeight)}})}
104runWhenIdle(recalcScaledIframes);$(window).on("load",function(){runWhenIdle(recalcScaledIframes)});$(window).on("resize",function(){clearTimeout(window._nfIframeScaleTimer);window._nfIframeScaleTimer=setTimeout(recalcScaledIframes,150)});if($("#skattelisteSagat").length){$("#skattelisteSagat").attr("src","https://extras.sagat.no/seavnnjaijja.html")}
105$(".nf-js-text-folded").each(function(){var $folded=$(this);var foldedHeight=parseInt($folded.attr("data-folded-height"),10)||230;function setFoldedState(expanded){$folded.find(".nf-js-text-folded-toggle").attr("aria-expanded",expanded?"true":"false");if(expanded){var targetHeight=$folded[0].scrollHeight;$folded.addClass("nf-o-text-folded--unfolded");$folded.stop(!0).animate({height:targetHeight},200,function(){$folded.css("height","auto")})}else{if($folded.css("height")==="auto"){$folded.height($folded.outerHeight())}
106$folded.stop(!0).animate({height:foldedHeight},200,function(){$folded.removeClass("nf-o-text-folded--unfolded")})}}
107$folded.css("height",foldedHeight);$folded.on("click",function(e){if($(e.target).closest("a, button, input, select, textarea, iframe").length){return}
108setFoldedState(!$folded.hasClass("nf-o-text-folded--unfolded"))});$folded.find(".nf-js-text-folded-toggle").on("click",function(e){e.preventDefault();e.stopPropagation();setFoldedState(!$folded.hasClass("nf-o-text-folded--unfolded"))})});function nfSyncAdvertiserCarouselWidths(){document.querySelectorAll("[data-nf-advertiser-carousel]").forEach(function(carousel){carousel.style.setProperty("--nf-advertiser-viewport-width",carousel.clientWidth+"px")})}
109var nfAdvertiserCarouselMotion=window.matchMedia?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function nfApplyAdvertiserCarouselMotionPreference(){var autoplay=!nfAdvertiserCarouselMotion||!nfAdvertiserCarouselMotion.matches;document.querySelectorAll("[data-nf-advertiser-carousel]").forEach(function(carousel){carousel.classList.remove("is-paused","is-focus-paused");if(autoplay){carousel.setAttribute("data-nf-advertiser-autoplay","");carousel.setAttribute("tabindex","0");
109carousel.setAttribute("role","region");carousel.setAttribute("aria-label",carousel.dataset.nfRunningLabel)}else{carousel.removeAttribute("data-nf-advertiser-autoplay");carousel.removeAttribute("tabindex");carousel.removeAttribute("role");carousel.removeAttribute("aria-label")}})}
110function nfToggleAdvertiserCarousel(carousel){if(!carousel||!carousel.hasAttribute("data-nf-advertiser-autoplay"))return;var paused=carousel.classList.toggle("is-paused");var label=paused?carousel.dataset.nfPausedLabel:carousel.dataset.nfRunningLabel;if(label)carousel.setAttribute("aria-label",label);}
111nfSyncAdvertiserCarouselWidths();nfApplyAdvertiserCarouselMotionPreference();if(nfAdvertiserCarouselMotion){if(nfAdvertiserCarouselMotion.addEventListener){nfAdvertiserCarouselMotion.addEventListener("change",nfApplyAdvertiserCarouselMotionPreference)}else if(nfAdvertiserCarouselMotion.addListener){nfAdvertiserCarouselMotion.addListener(nfApplyAdvertiserCarouselMotionPreference)}}
112$(document).on("pointerup","[data-nf-advertiser-carousel]",function(event){if(!this.hasAttribute("data-nf-advertiser-autoplay")||event.pointerType==="mouse"||$(event.target).closest("a, button").length)return;nfToggleAdvertiserCarousel(this);this.blur()});$(document).on("keydown","[data-nf-advertiser-carousel]",function(event){if(!this.hasAttribute("data-nf-advertiser-autoplay")||(event.key!=="Enter"&&event.key!==" ")||$(event.target).closest("a, button").length)return;event.preventDefault();nfToggleAdvertiserCarousel(this)});$(document).on("focusin","[data-nf-advertiser-carousel] a",function(){$(this).closest("[data-nf-advertiser-autoplay]").addClass("is-focus-paused")});$(document).on("focusout","[data-nf-advertiser-carousel] a",function(){$(this).closest("[data-nf-advertiser-autoplay]").removeClass("is-focus-paused")});$(window).on("resize.nf-advertiser-carousel",nfSyncAdvertiserCarouselWidths);runWhenIdle(function(){$(".nf-js-scrollable").each(function(){let $parent=$(this),$wrapper=$parent.find(".nf-js-scrollable-wrapper").first(),$scrollable=$parent.find(".nf-o-module-container, .nf-o-table, .nf-o-annonse-wrapper, .nf-js-scrollable-scroller").first(),$items=$scrollable.find(".nf-js-scrollable-item"),$item=$items.first(),antVisible=$parent.attr("data-ant"),autoScroll=$parent.attr("data-autoscroll"),autoScrollSpeed=parseInt($parent.attr("data-autoscrollspeed"));$items.css("max-width",parseInt($parent.width()/antVisible));let itemWidth=parseInt($item.outerWidth(!0));if($parent.width()<300){itemWidth=$parent.width();$items.css("width",itemWidth);$items.css("max-width",itemWidth)}
113let itemHeight=parseInt($item.outerHeight(!0)),itemMargin=parseInt($item.css("margin-right")),totalWidth=itemWidth*$items.length;if(totalWidth>$parent.width()){$scrollable.css("width",totalWidth)}else{$scrollable.css("width","100%")}
114$wrapper.css("height",itemHeight);if(totalWidth>$parent.width()){let scrollerLeft=$scrollable.position().left,scrollerRight=scrollerLeft+totalWidth,wrapperLeft=$wrapper.position().left,wrapperRight=wrapperLeft+$wrapper.width(),$leftButton=$('<div class="nf-o-scrollable__nav-left"><i class="fa-solid fa-circle-arrow-left"></i></div>').prependTo($parent),$rightButton=$('<div class="nf-o-scrollable__nav-right"><i class="fa-solid fa-circle-arrow-right"></i></div>').appendTo($parent),moveTo=0,isSliding=!1,isScrolling;let fontSize=parseFloat($leftButton.css("font-size"));fontSize=fontSize/(980/parseInt($parent.width()));fontSize=fontSize<30?30:fontSize;$leftButton.css("font-size",fontSize+"px");$rightButton.css("font-size",fontSize+"px");function checkButtons(){scrollerLeft=$scrollable.position().left;scrollerRight=scrollerLeft+totalWidth;if(scrollerLeft<0){$leftButton.fadeIn()}else{$leftButton.fadeOut()}
115if(scrollerRight-itemMargin>=wrapperRight+1){$rightButton.fadeIn()}else{$rightButton.fadeOut()}}
116checkButtons();$leftButton.click(function(){moveTo=scrollerLeft+itemWidth;while(moveTo%itemWidth){moveTo-=1;if(moveTo<0){break}}
117if(moveTo>wrapperLeft){moveTo=wrapperLeft}
118$scrollable.animate({left:moveTo+"px"},500,"swing",function(){checkButtons();if($parent.hasClass('nf-c-kortvideoer-hori__wrapper')&&typeof window.nfHandleShortVideoNavigation==='function'){window.nfHandleShortVideoNavigation($parent)}})});
118$rightButton.click(function(){moveTo=scrollerLeft-itemWidth;if(moveTo+totalWidth<wrapperRight){moveTo=wrapperRight-totalWidth}
119$scrollable.animate({left:moveTo+"px"},500,"swing",function(){checkButtons();if($parent.hasClass('nf-c-kortvideoer-hori__wrapper')&&typeof window.nfHandleShortVideoNavigation==='function'){window.nfHandleShortVideoNavigation($parent)}})});if(autoScroll){setInterval(function(){let reset=!1;moveTo=scrollerLeft-itemWidth;if(moveTo+totalWidth<wrapperRight){moveTo=wrapperRight-totalWidth;reset=!0}
120$scrollable.animate({left:moveTo+"px"},500,"swing",function(){checkButtons()});if(reset){$scrollable.animate({left:0+"px"},500,"swing",function(){checkButtons()});reset=!1}},autoScrollSpeed)}
121function slideToPosition(){setTimeout(function(){if(!isSliding){isSliding=!0;let sign="+=";scrollerLeft=$scrollable.position().left;moveTo=scrollerLeft*-1;while(moveTo>itemWidth){moveTo-=itemWidth;if(moveTo<0){break}}
122if(moveTo>itemWidth/2){sign="-=";moveTo=itemWidth-moveTo}
123$scrollable.animate({left:sign+moveTo+"px"},500,"swing",function(){isSliding=!1;checkButtons()})}},100)}
124$wrapper.on("scrollend touchend",function(){oldscrollerLeft=$scrollable.position().left;clearTimeout(isScrolling);isScrolling=setInterval(()=>{scrollerLeft=$scrollable.position().left;if(scrollerLeft+totalWidth<=wrapperRight||scrollerLeft>=0){console.log("NÃ¥dde en kant");clearTimeout(isScrolling);checkButtons()}else if(oldscrollerLeft==scrollerLeft){console.log("Scrolling stoppet");clearTimeout(isScrolling);slideToPosition()}else{oldscrollerLeft=scrollerLeft}},50)})}else{$parent.removeClass("nf-o-scrollable")}})});var truncate=function(fullStr,strLen,separator){if(fullStr.length<=strLen)return fullStr;separator=separator||"...";var sepLen=separator.length,charsToShow=strLen-sepLen,frontChars=Math.ceil(charsToShow/2),backChars=Math.floor(charsToShow/2);return(fullStr.substr(0,frontChars)+separator+fullStr.substr(fullStr.length-backChars))};if($("#g-recaptcha").length){$("#g-recaptcha").each(function(){$.getScript("https://www.google.com/recaptcha/enterprise.js").done(function(){if(typeof grecaptcha!=="undefined"){grecaptcha.enterprise.ready(function(){let widgetId=grecaptcha.enterprise.render("g-recaptcha")})}})})}
125$(".nf-js-form-checkpw").click(function(e){var $pw1=$(".nf-js-pw1").val();var $pw2=$(".nf-js-pw2").val();var result=zxcvbn($pw1);var error1='<div id="passordUlike" class="nf-o-popupcontent"><p>Passordene du oppga er ikke like!</p></div>';var error2='<div id="passordSvakt" class="nf-o-popupcontent">'+"<h2>Passordet er ikke langt eller sterkt nok!</h2>"+'<p>Passord som er for enkle å gjette, f.eks ved at de inneholder kjente navn, enkle ordbok-ord og/eller enkle tall- eller bokstavsekvenser som årstall, 123456 eller "qwerty", bør unngås.<p>'+"<p><em>Lengde er viktigere enn kompleksitet!</em></p>"+'<p>Prøv derfor å kombinere flere ord, gjerne med mellomrom, for å øke lengden og kompleksisteten på passordet ditt. <a href="https://xkcd.com/936/" target="_blank">Passordet trenger ikke å være vanskelig å huske.</a></p>'+"</div>";if($pw1!=$pw2){e.preventDefault();new Fancybox([{src:error1,type:"html",},])}else if(result<pwstrength||$pw1.length<pwlength){e.preventDefault();new Fancybox([{src:error2,type:"html",},])}});if($("[data-content]").length){let currentPopup=null;let popupOpening=!1;function closeAllPopups(){$(".nf-o-popup-hover").hide();currentPopup=null;popupOpening=!1}
126$(window).on("scroll",function(){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(isCurrentlySmallScreen){closeAllPopups()}});$(document).on("click touchend",function(e){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(isCurrentlySmallScreen){if(popupOpening){return}
127setTimeout(function(){if(popupOpening){return}
128if($(e.target).closest("[data-content]").length){return}
129if($(e.target).closest(".nf-o-popup-hover").length){return}
130if(currentPopup&&currentPopup.is(":visible")){closeAllPopups()}},100)}});$("[data-content]").each(function(){const $popupLink=$(this);const content='<div style="position: relative; color: #222; font-size: .85em; word-wrap:break-word; white-space: pre-wrap; text-transform: none; font-weight: normal;"><h1>'+$popupLink.attr("title")+"</h1>"+"<p>"+$popupLink.attr("data-content")+"</p></div>",$popup=$('<div class="nf-o-popup-hover" style="display: none; border: 2px solid #222; border-radius: 5px; background: #fff; padding: 10px; position: absolute; z-index: 10000; width: auto; max-width: 50%; min-width: 300px; height: auto; max-height: 600px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);">'+content+"</div>").insertAfter($popupLink),targetXpos=$popupLink.offset().left-$popupLink.position().left,targetYpos=$popupLink.offset().top-$popupLink.position().top;$popupLink.removeAttr("title");$popupLink.on("click touchend",function(e){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(isCurrentlySmallScreen){const href=$popupLink.attr("href");if($popupLink.is("a")&&href&&href!=="#"&&href.trim()!==""){return}
131e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();popupOpening=!0;if(currentPopup===$popup&&$popup.is(":visible")){closeAllPopups();return!1}
132closeAllPopups();$popup.show().css({top:'50%',left:'50%',transform:'translate(-50%, -50%)',position:'fixed'});currentPopup=$popup;setTimeout(function(){popupOpening=!1},100);return!1}});$popupLink.mouseover(function(){const breakpointSmallMax=typeof breakpoint_small_max!=='undefined'?breakpoint_small_max:599;const isCurrentlySmallScreen=window.matchMedia("(max-width: "+breakpointSmallMax+"px)").matches;if(!isCurrentlySmallScreen){$(document).mousemove(function(e){let xpos=e.pageX-targetXpos+10,ypos=e.pageY-targetYpos+10;$popup.show().css({top:ypos,left:xpos,transform:'none',position:'absolute'})})}}).mouseleave(function(){$(document).off("mousemove");$popup.hide()})})}
133$(".nf-o-form-fieldset div").each(function(index){if($(this).hasClass("nf-o-form__item--medium")&&(index==0||!$(this).prev().hasClass("nf-o-form__item--medium")||!$(this).prev().hasClass("nf-o-form__item--first"))){$(this).addClass("nf-o-form__item--first")}});activate_datepickers();$('[data-src^="#"]').click(function(){new Fancybox([{src:$(this).attr("data-src"),type:"inline",},],{animationEffect:"zoom",})});function nfFancyboxResizeVideoOverlay($links){$links.each(function(){var w=parseInt($(this).attr("data-width"),10)||0;var h=parseInt($(this).attr("data-height"),10)||0;if(!w||!h)return;var winW=parseInt($(window).width(),10);var winH=parseInt($(window).height(),10);var ratioW=winW/w;var ratioH=winH/h;var newW,newH;if(w>h){newW=winW;newH=Math.round(h*ratioW)}else{newH=winH;newW=Math.round(w*ratioH)}
134$(this).attr("data-width",newW);$(this).attr("data-height",newH)})}
135nfFancyboxResizeVideoOverlay($(".nf-o-videopreview__link[data-fancybox='kortvideoer']"));nfFancyboxResizeVideoOverlay($(".nf-o-videopreview__link[data-type='iframe']:not([data-fancybox='kortvideoer'])"));if($("#landingpage").length){new Fancybox([{src:"#landingpage",type:"inline",},],{animationEffect:"zoom",})}
136if(typeof Fancybox!=="undefined"){function nfFancyboxNormalizeHrefs(){var sel="a[href]";$(sel).each(function(){var h=this.getAttribute("href");if(!h)return;h=h.trim();if(/^javascript:/i.test(h)){this.setAttribute("href","#");return}
137if(/^(tel:|mailto:)/i.test(h)&&(this.getAttribute("data-fancybox")!=null||this.getAttribute("data-type")==="iframe")){this.setAttribute("href","#")}})}
138nfFancyboxNormalizeHrefs();setTimeout(nfFancyboxNormalizeHrefs,0);$(document).on("esi-content-loaded",nfFancyboxNormalizeHrefs);Fancybox.bind('[data-fancybox][data-type="inline"]:not([data-fancybox="kortvideoer"])',{type:"inline",});Fancybox.bind('[data-type="iframe"]',{on:{init:(fancybox)=>{const slide=fancybox.getSlide();if(slide){const src=slide.src;const dataSrc=slide.element?.getAttribute("data-src");if((src&&src.startsWith("javascript:"))||(dataSrc&&dataSrc.startsWith("javascript:"))){return}}},},});let activeShortsFancybox=null;let shortsNextSlideMessageHandler=null;let shortsInitialActivationObserver=null;function cleanupShortsInitialActivationObserver(){if(shortsInitialActivationObserver){shortsInitialActivationObserver.disconnect();shortsInitialActivationObserver=null}}
139function activateShortsInitialSlideWhenReady(fancybox){if(!window.nfShortsVideoController||typeof window.nfShortsVideoController.onFancyboxChange!=="function"){return!1}
140const slide=fancybox&&typeof fancybox.getSlide==="function"?fancybox.getSlide():null;const selectedPlayer=slide&&slide.contentEl?slide.contentEl.querySelector(".nf-video-player"):null;if(!selectedPlayer){return!1}
141window.nfShortsVideoController.onFancyboxChange(fancybox,{delayMs:0});cleanupShortsInitialActivationObserver();return!0}
142function ensureShortsInitialActivationObserver(fancybox){cleanupShortsInitialActivationObserver();const observerTarget=(fancybox&&fancybox.container)?fancybox.container:document.body;shortsInitialActivationObserver=new MutationObserver(function(){if(activeShortsFancybox!==fancybox){cleanupShortsInitialActivationObserver();return}
143activateShortsInitialSlideWhenReady(fancybox)});shortsInitialActivationObserver.observe(observerTarget,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"],})}
144Fancybox.bind("[data-fancybox='kortvideoer']",{Thumbs:!1,Carousel:{preload:1,},Slideshow:!1,on:{init:(fancybox)=>{debugLog("Initialiserer fancybox...");activeShortsFancybox=fancybox;if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxInit==="function"){window.nfShortsVideoController.onFancyboxInit(fancybox)}},destroy:(fancybox)=>{debugLog("Fancybox closing...");activeShortsFancybox=null;cleanupShortsInitialActivationObserver();if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxDestroy==="function"){window.nfShortsVideoController.onFancyboxDestroy(fancybox)}},"Carousel.beforeChange":(fancybox)=>{if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxBeforeChange==="function"){window.nfShortsVideoController.onFancyboxBeforeChange(fancybox)}},"Carousel.change":(fancybox)=>{if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxChange==="function"){window.nfShortsVideoController.onFancyboxChange(fancybox)}},ready:(fancybox)=>{activeShortsFancybox=fancybox;if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.onFancyboxChange==="function"){const activatedNow=activateShortsInitialSlideWhenReady(fancybox);if(!activatedNow){ensureShortsInitialActivationObserver(fancybox)}}
145if(!shortsNextSlideMessageHandler){shortsNextSlideMessageHandler=function(event){if(!activeShortsFancybox){return}
146const payload=event.data;const isNextSlide=payload==="nextSlide"||(payload&&typeof payload==="object"&&payload.type==="nextSlide");if(!isNextSlide){return}
147if(window.nfShortsVideoController&&typeof window.nfShortsVideoController.shouldHandleNextSlideMessage==="function"){const shouldHandle=window.nfShortsVideoController.shouldHandleNextSlideMessage(payload&&typeof payload==="object"?payload:null);if(!shouldHandle){return}}
148debugLog("Bytter video!");activeShortsFancybox.next()};window.addEventListener("message",shortsNextSlideMessageHandler)}
149return},},});Fancybox.bind('[data-fancybox="bilder"],[data-fancybox="galleribilder"],[data-fancybox="nsbilder"],[data-fancybox="nyhetsbilder"]',{Images:{protected:!0,initialSize:"fit",},})}
150function waitForCarouselDependencies(callback,options){options=options||{};var attempts=0;var maxAttempts=typeof options.maxAttempts==="number"?options.maxAttempts:60;var retryMs=typeof options.retryMs==="number"?options.retryMs:200;var requireAutoplay=!!options.requireAutoplay;function tryInit(){var hasCarousel=typeof Carousel!=="undefined";var hasAutoplay=!requireAutoplay||typeof Autoplay!=="undefined";if(!hasCarousel||!hasAutoplay){attempts++;if(attempts<maxAttempts){setTimeout(tryInit,retryMs)}
151return}
152callback()}
153tryInit()}
154function nfCarouselFocusableSelector(){return["a[href]","area[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","iframe","object","embed","[tabindex]","[contenteditable]",].join(",")}
155function nfUpdateCarouselHiddenFocus(target){if(!target||typeof target.querySelectorAll!=="function"){return}
156var focusables=target.querySelectorAll(nfCarouselFocusableSelector());focusables.forEach(function(element){var hiddenSlide=typeof element.closest==="function"?element.closest('.f-carousel__slide[aria-hidden="true"]'):null;if(hiddenSlide){if(!Object.prototype.hasOwnProperty.call(element.dataset,"nfOrigTabindex")){element.dataset.nfOrigTabindex=element.getAttribute("tabindex")||""}
157element.setAttribute("tabindex","-1");return}
158if(Object.prototype.hasOwnProperty.call(element.dataset,"nfOrigTabindex")){if(element.dataset.nfOrigTabindex===""){element.removeAttribute("tabindex")}else{element.setAttribute("tabindex",element.dataset.nfOrigTabindex)}
159delete element.dataset.nfOrigTabindex}})}
160function nfBindCarouselHiddenFocus(target,carouselInstance){if(!target||target.dataset.nfCarouselHiddenFocusBound==="1"){return}
161target.dataset.nfCarouselHiddenFocusBound="1";var updateFocus=function(){nfUpdateCarouselHiddenFocus(target)};updateFocus();window.setTimeout(updateFocus,0);if(carouselInstance&&typeof carouselInstance.on==="function"){carouselInstance.on("ready change refresh settle",updateFocus)}
162if(typeof MutationObserver==="function"){var observer=new MutationObserver(updateFocus);observer.observe(target,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["aria-hidden","class"],});target.nfCarouselHiddenFocusObserver=observer}}
163function nfCreateCarousel(target,carouselOptions,plugins){if(!target||typeof Carousel==="undefined"){return null}
164var carouselInstance=null;try{carouselInstance=new Carousel(target,carouselOptions,plugins)}catch(error){if(typeof console!=="undefined"&&typeof console.warn==="function"){console.warn("Failed to initialize carousel",target,error)}
165return null}
166if(target.classList){target.classList.add("nf-carousel-ready")}
167nfBindCarouselHiddenFocus(target,carouselInstance);return carouselInstance}
168function nfDispatchResizeEvent(){if(typeof window==="undefined"||typeof window.dispatchEvent!=="function"){return}
169var resizeEvent=null;
169if(typeof Event==="function"){resizeEvent=new Event("resize")}else if(typeof document!=="undefined"&&typeof document.createEvent==="function"){resizeEvent=document.createEvent("Event");resizeEvent.initEvent("resize",!0,!0)}
170if(resizeEvent){window.dispatchEvent(resizeEvent)}}
171function nfScheduleCarouselLayoutUpdate(target,delay){if(!target){return}
172delay=typeof delay==="number"?delay:0;if(target.nfCarouselLayoutTimer){clearTimeout(target.nfCarouselLayoutTimer)}
173target.nfCarouselLayoutTimer=window.setTimeout(function(){var carouselInstance=target.nfCarouselInstance||null;target.nfCarouselLayoutTimer=null;if(carouselInstance){if(typeof carouselInstance.refresh==="function"){carouselInstance.refresh()}else if(typeof carouselInstance.updateMetrics==="function"){carouselInstance.updateMetrics()}else if(typeof carouselInstance.emit==="function"){carouselInstance.emit("refresh")}}
174nfDispatchResizeEvent()},delay)}
175function nfBindCarouselImageLayoutUpdates(target){if(!target||target.dataset.nfCarouselImageLayoutBound==="1"){return}
176target.dataset.nfCarouselImageLayoutBound="1";var $images=$("img",target);if(!$images.length){nfScheduleCarouselLayoutUpdate(target,0);return}
177$images.each(function(){if(this.complete){nfScheduleCarouselLayoutUpdate(target,0);return}
178$(this).one("load error",function(){nfScheduleCarouselLayoutUpdate(target,0)})})}
179function initAdCarouselElement(target){if(!target){return null}
180nfBindCarouselImageLayoutUpdates(target);if($(target).data("carousel-initialized")){nfScheduleCarouselLayoutUpdate(target,0);return target.nfCarouselInstance||null}
181let annonsescroller_options={on:{ready:()=>{target.style.display="block";nfScheduleCarouselLayoutUpdate(target,0);nfScheduleCarouselLayoutUpdate(target,150);nfScheduleCarouselLayoutUpdate(target,600)},load:()=>{},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,};if(!$(target).hasClass("nf-js-multihori-autoscroll")){annonsescroller_options.Autoplay=!1}
182const carouselInstance=nfCreateCarousel(target,annonsescroller_options,{Autoplay});if(!carouselInstance){return null}
183target.nfCarouselInstance=carouselInstance;$(target).data("carousel-initialized",!0);target.style.display="block";nfScheduleCarouselLayoutUpdate(target,0);return carouselInstance}
184function initAdCarouselsNow(){$("[id^='annonsescroll_']").each(function(){initAdCarouselElement(this)});if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}}
185window.initAdCarousels=function(options){options=options||{};waitForCarouselDependencies(function(){initAdCarouselsNow()},{requireAutoplay:!0,maxAttempts:typeof options.maxAttempts==="number"?options.maxAttempts:60,retryMs:typeof options.retryMs==="number"?options.retryMs:200})};function scheduleAdCarouselRecoveryPasses(){if(window.nfAdCarouselRecoveryScheduled){return}
186window.nfAdCarouselRecoveryScheduled=!0;[250,1000,2500].forEach(function(delay){window.setTimeout(function(){if(typeof window.initAdCarousels==="function"){window.initAdCarousels({maxAttempts:20,retryMs:100})}},delay)})}
187window.initArticleGalleries=function(){waitForCarouselDependencies(function(){$(".nf-c-artikkel-galleri .f-carousel").each(function(){const $carousel=$(this);if($carousel.data("carousel-initialized")){return}
188const $galleriContainer=$carousel.closest(".nf-c-artikkel-galleri");const hasThumbnails=$galleriContainer.attr("data-thumbnails")==="1";const plugins={};if(hasThumbnails&&typeof Thumbs!=="undefined"){plugins.Thumbs=Thumbs}
189const carouselOptions={slidesPerPage:1,transition:"crossfade",adaptiveHeight:!1};if(hasThumbnails){carouselOptions.Thumbs={type:"modern",parentEl:$galleriContainer[0]}}
190const carouselInstance=nfCreateCarousel(this,carouselOptions,plugins);if(!carouselInstance){return}
191$carousel.data("carousel-initialized",!0)})},{requireAutoplay:!1,maxAttempts:60,retryMs:200})};$(document).on("esi-content-loaded",function(){if(typeof window.initArticleGalleries==="function"){setTimeout(function(){window.initArticleGalleries()},100)}});window.initWebcamCarousels=function(){waitForCarouselDependencies(function(){$(".nf-js-webcam-carousel").each(function(){const $carousel=$(this);if($carousel.data("carousel-initialized")){return}
192const carouselOptions={slidesPerPage:1,transition:"crossfade",Dots:!1,Autoplay:{timeout:5000,showProgress:!0,},};const carouselInstance=nfCreateCarousel(this,carouselOptions,{Autoplay});if(!carouselInstance){return}
193$carousel.data("carousel-initialized",!0)})},{requireAutoplay:!0,maxAttempts:60,retryMs:200})};$(document).on("esi-content-loaded",function(){if(typeof window.initWebcamCarousels==="function"){setTimeout(function(){window.initWebcamCarousels()},100)}});$(document).on("esi-content-loaded",function(){if(typeof window.initAdCarousels==="function"){setTimeout(function(){window.initAdCarousels({maxAttempts:20,retryMs:100})},100)}});(function(){function initFrontPageCarouselsWhenReady(){if($("#newsticker").length){const newsticker=document.getElementById("newsticker");const wrapper=newsticker.closest(".nf-c-newsticker__wrapper");const isCarouselStyled=()=>{const track=newsticker.querySelector(".f-carousel__track");if(!track){return!1}
194const trackStyle=window.getComputedStyle(track);return trackStyle.display==="flex"};const revealNewsticker=()=>{if(wrapper){wrapper.classList.remove("nf-c-newsticker__wrapper--loading");wrapper.classList.add("nf-c-newsticker__wrapper--ready");wrapper.style.removeProperty("visibility");wrapper.style.removeProperty("opacity")}};const revealNewstickerWhenCarouselReady=(attempt=0)=>{if(isCarouselStyled()){window.requestAnimationFrame(revealNewsticker);return}
195if(attempt>=120){return}
196window.setTimeout(()=>revealNewstickerWhenCarouselReady(attempt+1),25)};let newsticker_options={on:{ready:()=>{revealNewstickerWhenCarouselReady()},},transition:"slide",adaptiveHeight:!0,center:!1,Dots:!1,classes:{container:"nf-c-newsticker",slide:"nf-c-newsticker__item",},};nfCreateCarousel(newsticker,newsticker_options)}
197if($("#stillingscroller").length){const stillingscroller=document.getElementById("stillingscroller");let stillingscroller_options={on:{ready:()=>{stillingscroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-stillingscroller-hori",slide:"nf-c-stillingscroller-hori__item",},};nfCreateCarousel(stillingscroller,stillingscroller_options,{Autoplay})}
198$("[id^='rssscroller_']").each(function(){const rssscroller=document.getElementById($(this).attr("id"));let rssscroller_options={on:{ready:()=>{rssscroller.style.display="block";$(rssscroller).parents(".nf-c-front-rssfeeds").css("height","auto")},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-front-rssfeeds--fullwidth",slide:"nf-c-front-rssfeeds-frontliste__item",},};if(!$(this).hasClass("nf-js-rsssscroller-hori-autoscroll")){rssscroller_options.Autoplay=!1}
199nfCreateCarousel(rssscroller,rssscroller_options,{Autoplay})});if($("#kulturscroller-hori").length){const kulturscroller=document.getElementById("kulturscroller-hori");let kulturscroller_options={on:{ready:()=>{kulturscroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-kulturscroller-hori",slide:"nf-c-kulturscroller-hori__item",},};nfCreateCarousel(kulturscroller,kulturscroller_options,{Autoplay})}
200if($("#serviceguidescroller-hori").length){const serviceguidescroller=document.getElementById("serviceguidescroller-hori");let serviceguidescroller_options={on:{ready:()=>{serviceguidescroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-serviceguidescroller-hori",slide:"nf-c-serviceguidescroller-hori__item",},};nfCreateCarousel(serviceguidescroller,serviceguidescroller_options,{Autoplay,})}
201if($("#kulturscroller").length){const kulturscroller=document.getElementById("kulturscroller");let kulturscroller_options={on:{ready:()=>{kulturscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-kulturscroller",slide:"nf-c-kulturscroller__item",},};nfCreateCarousel(kulturscroller,kulturscroller_options,{Autoplay})}
202if($("#travscroller").length){const travscroller=document.getElementById("travscroller");let travscroller_options={on:{ready:()=>{travscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-front-travscroller",slide:"nf-c-front-travscroller__item",},};nfCreateCarousel(travscroller,travscroller_options,{Autoplay})}
203if($("#hingstscroller").length){const hingstscroller=document.getElementById("hingstscroller");let hingstscroller_options={on:{ready:()=>{hingstscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-front-travscroller",slide:"nf-c-front-travscroller__item",},};nfCreateCarousel(hingstscroller,hingstscroller_options,{Autoplay})}
204if($("#follscroller").length){const follscroller=document.getElementById("follscroller");let follscroller_options={on:{ready:()=>{follscroller.style.display="block"},},Autoplay:{timeout:2000,showProgress:!1,},slidesPerPage:1,axis:"y",transition:"slide",center:!1,Navigation:!1,Dots:!1,classes:{container:"nf-c-front-travscroller",slide:"nf-c-front-travscroller__item",},};nfCreateCarousel(follscroller,follscroller_options,{Autoplay})}
205if($("#hestescroller").length){const hestescroller=document.getElementById("hestescroller");let hestescroller_options={on:{ready:()=>{hestescroller.style.display="block"},},Autoplay:{timeout:3000,showProgress:!1,},slidesPerPage:1,adaptiveHeight:!0,transition:"slide",center:!1,Dots:!1,classes:{container:"nf-c-front-hesteauksjon",slide:"nf-c-front-hesteauksjon__item",},};nfCreateCarousel(hestescroller,hestescroller_options,{Autoplay})}
206initAdCarouselsNow();if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}}
207waitForCarouselDependencies(initFrontPageCarouselsWhenReady,{requireAutoplay:!0,maxAttempts:60,retryMs:200});scheduleAdCarouselRecoveryPasses()})();$(".nf-js-spfancy-list__item").on("click touchstart",function(e){var $prodid=$(this).data("prodid");
207$(".nf-c-spfancy-list__item, .nf-c-spfancy-list__item *").removeClass("nf-c-spfancy-list__item--selected nf-u-blurry-text-white nf-u-blurry-text-black");$(this).addClass("nf-c-spfancy-list__item--selected");$(".nf-c-spfancy-content").hide();$(".nf-c-spfancy-content--prodid"+$prodid).show();if($(".nf-c-salgsplakater-fancy").width()<=breakpoint_small_max){}else{$(".nf-c-spfancy-list__item").not(".nf-c-spfancy-list__item--selected").addClass("nf-u-blurry-text-white");$(".nf-c-spfancy-list__item").not(".nf-c-spfancy-list__item--selected").find(".nf-c-spfancy-prodprice__content").addClass("nf-u-blurry-text-black");$(".nf-c-spfancy-list__item").not(".nf-c-spfancy-list__item--selected").find(".nf-c-spfancy-prodprice__content > .nf-c-spfancy__campaign").addClass("nf-u-blurry-text-white");$(".nf-c-spfancy-content--prodid"+$prodid).css("margin-top",($(this).offset().top-$(".nf-c-spfancy-list").offset().top)*-1)}});$(".nf-c-artikkel-share-buttons__link--mastodon").click(function(){let src=$(this).attr("data-src"),title=$(this).attr("data-title");if(typeof NFModal!=="undefined"&&NFModal.prompt){NFModal.prompt("Oppgi din Mastodon instans (domenenavn)","Mastodon instans","snabelen.no").then(function(result){if(result&&result.action==="ok"&&result.value){domain=result.value;if(domain==""||domain==null){return}
208let url="https://"+domain+"/share?text="+title+"&url="+src;window.open(url,"_blank")}});return}else{domain=prompt("Oppgi din Mastodon instans (domenenavn)","snabelen.no");if(domain==""||domain==null){return}}
209if(domain){let url="https://"+domain+"/share?text="+title+"&url="+src;window.open(url,"_blank")}});$(".nf-c-artikkel-share-buttons__link--utskrift").click(function(){$("#printArticleWait").fadeIn();$("html, body").animate({scrollTop:$(document).height()},1000);$("html, body").animate({scrollTop:0},1000);setTimeout(function(){$("#printArticleWait").fadeOut();setTimeout(function(){window.print()},500)},2000)});$(document).on("click",".nf-js-clickscroll",function(e){e.preventDefault();var $trigger=$(this),target=$trigger.attr("data-target");if(($trigger.hasClass("nf-comment-share-btn")||$trigger.hasClass("nf-c-artikkel__kommentarer-goto-btn"))&&typeof window.nfOpenArticleCommentsAndScroll==="function"){e.stopImmediatePropagation();window.nfOpenArticleCommentsAndScroll(target)}else{scrollToAnchor(target)}
210this.blur()});if(getGDPRConsent("GDPR_VENDOR_LESEWEB")){if($(".nf-o-leseweb-wrapper").length){(function(){let lw=document.createElement("script");lw.type="text/javascript";lw.async=!0;lw.src=("https:"==document.location.protocol?"https://":"http://")+"speech.leseweb.dk/script/"+lwfile;const s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(lw,s)})()}}
211$("#nf-c-opensearchform").click(function(){$(".nf-js-searchformpublic").slideToggle(function(){})});
211function initFrontArticleLoader(){const $control=$(".nf-js-front-load-more").first();if(!$control.length)return;const $button=$control.find("#loadMoreNewsItemsFront");let loading=!1;let observer=null;function stopAutomaticLoad(){$control.attr("data-auto-load","0");if(observer)observer.disconnect();$(window).off(".nfFrontArticleLoader")}
212function removeControl(){stopAutomaticLoad();$control.remove()}
213function loadMoreFrontArticles(automatic){if(loading||(automatic&&$control.attr("data-auto-load")!=="1"))return;loading=!0;const usedIDs=$(".nf-o-fl-post[data-nyhetid]").map(function(){return parseInt($(this).attr("data-nyhetid"),10)||null}).get().filter(function(id,index,ids){return id&&ids.indexOf(id)===index});$button.prop("disabled",!0).attr("aria-busy","true");$.ajax({url:ajaxNocachePath+"/ajax_load_more_frontarticles.php",type:"POST",dataType:"html",data:{ant:9,automatic:automatic?1:0,usedIDs:usedIDs,KatID:$control.attr("data-katid"),features:$control.attr("data-features"),},}).done(function(html,textStatus,xhr){if(html!="error"){$control.before(html);if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}
214$(document).trigger("esi-content-loaded")}
215if(xhr.getResponseHeader("X-NewsFlow-Auto-Has-More")==="0"){stopAutomaticLoad()}
216if(xhr.getResponseHeader("X-NewsFlow-Has-More")==="0"){removeControl()}}).always(function(){loading=!1;$button.prop("disabled",!1).removeAttr("aria-busy")})}
217$button.on("click",function(){stopAutomaticLoad();loadMoreFrontArticles(!1)});if($control.attr("data-auto-load")!=="1")return;if("IntersectionObserver" in window){observer=new IntersectionObserver(function(entries){if(entries[0]&&entries[0].isIntersecting)loadMoreFrontArticles(!0);},{rootMargin:"600px 0px"});observer.observe($control[0])}else{const loadWhenNearViewport=function(){if($control[0]&&$control[0].getBoundingClientRect().top<=window.innerHeight+600){loadMoreFrontArticles(!0)}};$(window).on("scroll.nfFrontArticleLoader resize.nfFrontArticleLoader",loadWhenNearViewport);loadWhenNearViewport()}}
218initFrontArticleLoader();function initAuthorProfileInfiniteList(){const $list=$(".nf-js-author-profile-list");const $more=$(".nf-js-author-profile-more");const $button=$(".nf-js-author-profile-load");const $loading=$(".nf-js-author-profile-loading");if(!$list.length||!$more.length){return}
219let loading=!1;let hasMore=$list.attr("data-has-more")==="1";function setLoading(isLoading){loading=isLoading;$button.prop("disabled",isLoading);if($loading.length){$loading.prop("hidden",!isLoading)}}
220function loadMoreAuthorArticles(){if(loading||!hasMore){return}
221setLoading(!0);$.post(ajaxNocachePath+"/ajax_load_author_articles.php",{author:$list.attr("data-author"),offset:$list.attr("data-next-offset"),},null,"json").done(function(response){if(!response||!response.ok){hasMore=!1;$more.hide();return}
222if(response.html){$list.append(response.html);if(typeof lazySizes!=="undefined"&&lazySizes.loader){lazySizes.loader.checkElems()}
223$(document).trigger("esi-content-loaded")}
224hasMore=!!response.hasMore;$list.attr("data-next-offset",response.nextOffset);$list.attr("data-has-more",hasMore?"1":"0");if(!hasMore){$more.hide()}}).fail(function(){hasMore=!1;$more.hide()}).always(function(){setLoading(!1)})}
225$button.on("click",loadMoreAuthorArticles);if("IntersectionObserver" in window){const observer=new IntersectionObserver(function(entries){if(entries[0]&&entries[0].isIntersecting){loadMoreAuthorArticles()}},{rootMargin:"400px 0px"});observer.observe($more[0])}}
226initAuthorProfileInfiniteList();function loadFrontCommentCounts(){if(typeof ajaxNocachePath==='undefined')return;if(!window.location||!document.body.classList.contains('nf-frontpage'))return;if(!window.getGDPRConsent||!getGDPRConsent('GDPR_VENDOR_THIN')){return}
227var $spans=$('.nf-o-fl-post__commentbadge-count[data-nyhet-id]');if(!$spans.length)return;var ids=[];$spans.each(function(){var $el=$(this);var id=parseInt($el.attr('data-nyhet-id'),10);if(id&&ids.indexOf(id)===-1)ids.push(id);});if(!ids.length)return;$.ajax({url:ajaxNocachePath+'/ajax_get_comment_counts.php',method:'POST',data:{ids:ids.join(',')},dataType:'json'}).done(function(json){var data;try{data=typeof json==='string'?JSON.parse(json):json}catch(e){return}
228if(!data||!data.counts)return;
228Object.keys(data.counts).forEach(function(key){var count=parseInt(data.counts[key],10)||0;var $targets=$('.nf-o-fl-post__commentbadge-count[data-nyhet-id="'+key+'"]');var $wrappers=$targets.closest('.nf-o-fl-post__commentbadge');if(count>0){$targets.text(count);$wrappers.show()}else{$wrappers.hide()}})}).fail(function(){})}
229runWhenIdle(function(){try{if($('.nf-o-fl-post__commentbadge-count[data-nyhet-id]').length){loadFrontCommentCounts()}}catch(e){}})});function fontSizeInEm($element){const fontSizePx=parseFloat($element.css("font-size"));const parentFontSizePx=parseFloat($element.parent().css("font-size"));return fontSizePx/parentFontSizePx}
230var adsInit,iFramResizeSettings;(function(){if(document.fonts&&document.fonts.check){var checkFonts=function(){if(document.fonts.check('16px "Font Awesome 6 Pro"')||document.fonts.check('16px "Font Awesome 6 Brands"')){document.documentElement.classList.add('fontawesome-loaded')}else{setTimeout(checkFonts,50)}};if(document.fonts.ready){document.fonts.ready.then(function(){checkFonts()})}else{setTimeout(checkFonts,100)}}else{setTimeout(function(){document.documentElement.classList.add('fontawesome-loaded')},200)}})();$(window).load(function(){if(typeof window.initArticleGalleries==="function"){window.initArticleGalleries()}
231if(typeof window.initWebcamCarousels==="function"){window.initWebcamCarousels()}
232if(typeof window.initAdCarousels==="function"){window.initAdCarousels({maxAttempts:20,retryMs:100})}
233iFramResizeSettings={license:"12ajjdewwwy-26rnhw2943-1s7g1u8ma0i",inPageLinks:!0,scrolling:!1,direction:"vertical",waitForLoad:!1,checkOrigin:!1,warningTimeout:0,log:!1,};runWhenIdle(function(){if($("iframe.nf-js-iframeresizer").length){if(typeof iframeResize==="function"){iframeResize(iFramResizeSettings,"iframe.nf-js-iframeresizer")}else{var basePath=(window.baseNewsflowHref||(window.jsPath||"/src/js/").replace(/\/js\/?$/,""))+"/js/";var s=document.createElement("script");s.src=basePath+"iframe-resizer/iframe-resizer.parent.js";s.onload=function(){if(typeof iframeResize==="function")iframeResize(iFramResizeSettings,"iframe.nf-js-iframeresizer");};document.head.appendChild(s)}}});runWhenIdle(function(){$(".nf-o-fl-module").each(function(){const $module=$(this),resizeElements=[{el:".nf-c-front-rssfeed",baseSize:1},{el:".nf-c-front-rssfeeds",baseSize:1},{el:".nf-c-front-nyhetslistemodul",baseSize:1.1},];if(is_mobile){return!1}
234const checkVisibility=setInterval(function(){let $layoutColumn=$module.closest(".
234nf-c-frontlayout-col, .nf-c-frontlayout-subcol"),$layoutRow=$module.closest(".nf-c-frontlayout-row, .nf-c-frontlayout-sub"),$layoutContainer=$module.closest(".nf-c-frontlayout-grid, .nf-o-frontlayout"),h=$layoutColumn.length?$layoutColumn.height():($layoutRow.length?$layoutRow.height():$layoutContainer.height()),$resizeElement=null;if(h){clearInterval(checkVisibility);resizeElements.forEach(function(element){if($module.find(element.el).length){$resizeElement=$module.find(element.el)}
235if($resizeElement){$resizeElement.animate({height:h,},1000);if(element.el!==".nf-c-front-rssfeeds"){$(".nf-o-moduleblock-module__content",$module).css("height","100%")}
236$(".nf-o-moduleblock-module__content",$module).css("overflow-y","auto");if(window.self!==window.top&&window.frameElement){}
237const w=$resizeElement.width(),fontSize=fontSizeInEm($module),newFontSize=roundToDecimal(fontSize*(element.baseSize+(w-100)/1000),2);$resizeElement.css("font-size",newFontSize+"em")}})}},100)})});if(typeof inMobiCMPLoaded!=="undefined"&&inMobiCMPLoaded!==null&&inMobiCMPLoaded){async function updateGDPRConsent(tcData,vendorId,realId){return new Promise((resolve,reject)=>{let gdprCookie=Cookies.get("newsflow_gdpr_accepted");if(gdprCookie!==undefined){gdprCookie=JSON.parse(gdprCookie)}else{gdprCookie={}}
238if(tcData.gdprApplies){__tcfapi("getNonIABVendorConsents",2,function(consent,cSuccess){if(cSuccess){if(gdprVendorsDefaults[realId]||(consent.nonIabVendorConsents&&consent.nonIabVendorConsents[vendorId])){gdprCookie[vendorId]=!0;if(gdprVendorsNames[realId]==="GDPR_VENDOR_GOOGLE"){grantGoogleAnalyticsConsent()}}else{gdprCookie[vendorId]=!1}
239Cookies.set("newsflow_gdpr_accepted",JSON.stringify(gdprCookie),{expires:30})}})}else{gdprCookie[vendorId]=!0;Cookies.set("newsflow_gdpr_accepted",JSON.stringify(gdprCookie),{expires:30,})}
240resolve()})}
241async function updateGDPRCookies(tcData,gdprVendors){for(const vendorId of gdprVendors){let realId=gdprVendors.indexOf(vendorId);await updateGDPRConsent(tcData,vendorId,realId)}}
242__tcfapi("addEventListener",2,function(tcData,success){if(success){if(tcData.gdprApplies){if(tcData.eventStatus==="tcloaded"){updateGDPRCookies(tcData,gdprVendors)}else if(tcData.eventStatus==="useractioncomplete"){updateGDPRCookies(tcData,gdprVendors)}else{}}}})}
243if(getGDPRConsent("GDPR_VENDOR_LESEWEB")){if($(".nf-o-leseweb-wrapper").length){let $playButton=$(".nf-o-leseweb-controls i.fa-circle-play"),$pauseButton=$(".nf-o-leseweb-controls i.fa-circle-pause"),$settingsButton=$(".nf-o-leseweb-controls i.fa-gear"),$helpButton=$(".nf-o-leseweb-controls i.fa-circle-question"),paused=!1;const lesewebInitMaxAttempts=40;const lesewebInitIntervalMs=250;let lesewebInitAttempts=0;function hideLeseweb(error){console.log("vfact_SetCustomParams error: "+error);$(".nf-o-leseweb-wrapper").hide()}
244function applyLesewebParams(){if(window.nfDisableLesewebCustomParams!==!1){return}
245if(typeof window.vfact_SetCustomParams!=="function"){throw new Error("vfact_SetCustomParams is not available")}
246const safeSpeed=typeof lesewebParamsSpeed==="number"?lesewebParamsSpeed:1;const safeGender=typeof lesewebParamsGender==="string"&&lesewebParamsGender?lesewebParamsGender:"f";const safeQuality=typeof lesewebParamsQuality==="number"?lesewebParamsQuality:2;const maybePromise=window.vfact_SetCustomParams(safeSpeed,safeGender,safeQuality,function(){});if(maybePromise&&typeof maybePromise.catch==="function"){maybePromise.catch(function(error){hideLeseweb(error)})}}
247function initLesewebParamsWithRetry(){if(typeof window.vfact_SetCustomParams==="function"){try{applyLesewebParams()}catch(error){hideLeseweb(error)}
248return}
249lesewebInitAttempts++;if(lesewebInitAttempts>=lesewebInitMaxAttempts){hideLeseweb("vFact init timeout");return}
250setTimeout(initLesewebParamsWithRetry,lesewebInitIntervalMs)}
251initLesewebParamsWithRetry();$playButton.click(function(){if(typeof window.vFact_playsection_or_selection!=="function"){return}
252if(paused){window.vFact_playsection_or_selection("nf-c-artikkel-content")}else{window.vFact_playsection_or_selection("nf-c-artikkel-content");if(window.vFact_HTML5Player&&typeof window.vFact_HTML5Player.setEventHandler_OnChangePlaylistStatus==="function"){window.vFact_HTML5Player.setEventHandler_OnChangePlaylistStatus(ExecEvent)}}});$pauseButton.click(function(){if(typeof window.vFact_dostop!=="function"){return}
253window.vFact_dostop();paused=!0});function ExecEvent(newPlaylistStatus){if(newPlaylistStatus==0){$pauseButton.hide();$pauseButton.next("span").hide();$playButton.show();$playButton.next("span").show()}else{$playButton.hide();$playButton.next("span").hide();$pauseButton.show();$pauseButton.next("span").show()}}
254$settingsButton.click(function(){if(typeof window.vFact_showconfigbox==="function"){window.vFact_showconfigbox()}});$helpButton.click(function(){if(typeof window.vFact_dohelp==="function"){window.vFact_dohelp()}})}}});var resizeId;$(window).resize(function(){clearTimeout(resizeId);resizeId=setTimeout(doneResizing,500)});function doneResizing(){}(function($){'use strict';var config={debug:!1,_isAdminCached:null,isAdmin:function(){if(this._isAdminCached===null){this._isAdminCached=window.location.pathname.indexOf('/webdesk/')!==-1||$('#outer
254wrap').length>0||$('.uppyThumbnail__img').length>0}
255return this._isAdminCached},placeholders:{admin:{width:150,height:100,fontSize:12,text:['Kan ikke','vise bildet']},public:{width:200,height:100,fontSize:14,text:['Kan ikke','vise bildet']}}};var svgPlaceholderCache={};var videoPosterRetryObserver=null;function debugLog(){if(config.debug&&console&&console.log){var args=Array.prototype.slice.call(arguments);args.unshift('[NewsFlow Images]');console.log.apply(console,args)}}
256function generateSVGPlaceholder(){var isAdmin=config.isAdmin();var cacheKey=isAdmin?'admin':'public';if(!svgPlaceholderCache[cacheKey]){var settings=config.placeholders[cacheKey];var svgContent='<svg width="'+settings.width+'" height="'+settings.height+'" xmlns="http://www.w3.org/2000/svg">'+'<rect width="100%" height="100%" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>'+'<text x="50%" y="40%" font-family="Arial, sans-serif" font-size="'+settings.fontSize+'" fill="#999" text-anchor="middle" dominant-baseline="central">'+settings.text[0]+'</text>'+'<text x="50%" y="60%" font-family="Arial, sans-serif" font-size="'+settings.fontSize+'" fill="#999" text-anchor="middle" dominant-baseline="central">'+settings.text[1]+'</text>'+'</svg>';svgPlaceholderCache[cacheKey]="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(svgContent)}
257return svgPlaceholderCache[cacheKey]}
258function isImageBroken(img){if(!img.complete)return!1;var $img=$(img);if($img.attr('data-error-retry'))return!1;if($img.hasClass('retrying-load')&&$img.attr('data-original-src'))return!1;if($img.hasClass("lazyload")||$img.hasClass("lazyloading"))return!1;var $picture=$img.closest('picture');if($picture.length&&$picture.find('source[data-srcset]').length&&!img.src)return!1;if($img.attr('data-src')&&(!img.src||img.src===''||img.src===window.location.href))return!1;if(img.src&&img.src.indexOf('data:image/gif;base64,R0lGOD')===0&&$img.attr('data-src'))return!1;var isGreyGif=img.src.indexOf('/pix/grey.gif')!==-1||img.src.indexOf('grey.gif')!==-1;if(isGreyGif){debugLog("Detected grey.gif placeholder:",img.src);return!0}
259var isVerySmall=img.naturalWidth<=2||img.naturalHeight<=2;if(isVerySmall){var hasValidSrc=img.src&&img.src!==''&&img.src.indexOf('data:image/svg+xml')===-1;var hasLazyAttributes=$img.attr('data-src')||$img.attr('data-srcset')||($picture.length&&$picture.find('source[data-srcset]').length);if(hasValidSrc&&$img.hasClass("lazyloaded")&&img.complete&&(img.naturalWidth===0||img.naturalHeight===0)&&isRetryableImageUrl(img.src)){debugLog("Detected failed lazyloaded nfimage:",img.src,"dimensions:",img.naturalWidth,"x",img.naturalHeight);return!0}
260if(hasValidSrc&&hasLazyAttributes)return!1;if($img.hasClass("lazyloaded")&&img.naturalWidth>0&&img.naturalHeight>0&&img.naturalWidth===1&&img.naturalHeight===1){var isImageUrl=isRetryableImageUrl(img.src);if(isImageUrl&&img.src.indexOf('grey.gif')===-1&&img.src.indexOf('data:image/svg+xml')===-1){debugLog("Detected very small image (likely broken - exactly 1x1, probably grey.gif from server):",img.src,"dimensions:",img.naturalWidth,"x",img.naturalHeight);return!0}}}
261return(isVerySmall||$img.hasClass("error-placeholder")||$img.hasClass("broken-image"))}
262function setupMutationObserver($img,img){if(!window.MutationObserver)return;var observer=new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++){var mutation=mutations[i];if(mutation.type==='attributes'&&mutation.attributeName==='class'){if($img.hasClass("lazyloaded")){$img.removeClass("lazyloaded");debugLog("Prevented lazyloaded class from being re-added to error placeholder")}}}});observer.observe(img,{attributes:!0,attributeFilter:['class']})}
263function replaceBrokenImageWithPlaceholder(img,opts){if(img.src.indexOf("data:image/svg+xml")!==-1)return;var $img=$(img);var isAdmin=config.isAdmin();var url=img.src||$img.attr('data-original-src')||'';if(isAdmin&&isRetryableImageUrl(url)&&!(opts&&opts.forceReplace)){return}
264var isAdImage=$img.hasClass('nf-o-annonse__img')&&!$img.hasClass('nf-o-annonse__adcounterimg');var $adContainer=null;if(isAdImage){$adContainer=$img.closest('.nf-o-annonse-container')}
265var originalSrc=$img.attr('data-src')||$img.attr('src');var $picture=$img.closest('picture');if($picture.length&&!originalSrc){var $firstSource=$picture.find('source[data-srcset]').first();if($firstSource.length){var srcset=$firstSource.attr('data-srcset');
265if(srcset){var match=srcset.match(/^([^\s,]+)/);if(match){originalSrc=match[1]}}}}
266if(originalSrc&&originalSrc.indexOf('data:image/svg+xml')===-1){$img.attr('data-original-src',originalSrc);$img.attr('data-error-timestamp',Date.now())}
267$img.addClass("error-placeholder").removeClass("lazyload lazyloading lazyloaded").removeAttr("data-src data-srcset srcset").attr("alt","Kan ikke vise bildet");if($picture.length){$picture.find('source').each(function(){var $source=$(this);if($source.attr('data-srcset')){$source.removeAttr("srcset")}else{var srcset=$source.attr('srcset');if(srcset){$source.attr('data-srcset',srcset).removeAttr("srcset")}}})}
268img.src=generateSVGPlaceholder();if(isAdmin){var settings=config.placeholders.admin;$img.css({width:settings.width+"px",height:settings.height+"px",minWidth:settings.width+"px",minHeight:settings.height+"px",maxWidth:settings.width+"px",maxHeight:settings.height+"px"})}
269debugLog("Replaced broken image with SVG placeholder (context: "+(isAdmin?"admin":"public")+")");if($img.hasClass("error-placeholder")){setupMutationObserver($img,img)}
270if(isAdmin){hideEditIconForBrokenImage(img);$img.off('click').css('cursor','default').removeAttr('title');var $tbody=$img.closest('tbody');if($tbody.length){$img.addClass('broken-image');$img.closest('picture').addClass('broken-image');$img.closest('.previewbilde__img').addClass('has-broken-image');$tbody.addClass('notMovable broken-image-row')}}
271if(isAdImage&&$adContainer&&$adContainer.length){$adContainer.addClass('nf-o-annonse-container--empty').attr('data-empty','1');if(typeof window.hideEmptyAd==='function'){window.hideEmptyAd($adContainer)}else{$adContainer.hide()}
272debugLog("Hidden ad container due to broken image")}}
273function findEditIconForImage(img){var $img=$(img);var $parentDiv=$img.closest('.previewbilde__img');if($parentDiv.length){var $editIcon=$parentDiv.find('.uppyThumbnail__edit');if($editIcon.length)return $editIcon}
274var $fromParent=$img.parent().find(".uppyThumbnail__edit");if($fromParent.length)return $fromParent;return $img.closest('li').find(".uppyThumbnail__edit")}
275function showEditIconForLoadedImage(img){if(!config.isAdmin())return;var $editIcon=findEditIconForImage(img);if($editIcon.length){$editIcon.css({display:'block',visibility:'visible'}).removeClass('hidden-for-lazy-loading');debugLog("Showing edit icon for successfully loaded image with PID:",$(img).data('pid')||"unknown")}}
276function hideEditIconForBrokenImage(img){if(!config.isAdmin())return;var $editIcon=findEditIconForImage(img);if($editIcon.length){$editIcon.css({display:'none',visibility:'hidden'}).addClass('hidden-for-broken-image');debugLog("Hiding edit icon for broken image with PID:",$(img).data('pid')||"unknown")}}
277function hideEditIconForImage(img,opts){var $editIcon=findEditIconForImage(img);if($editIcon.length){$editIcon.css("display","none")}
278replaceBrokenImageWithPlaceholder(img,opts)}
279function getTransparentPlaceholder(){return'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='}
280function isRetryableImageUrl(url){url=String(url||'');return url.indexOf('/bilder/')!==-1||url.indexOf('/webdesk/ajax/inactiveImagePreview.php')!==-1}
281function addRetryParam(url){return url+(url.indexOf('?')!==-1?'&':'?')+'_retry='+Date.now()}
282function getRetryDelay($img,retryCount,opts){if(opts&&typeof opts.retryDelayMs==='number'){return Math.max(0,opts.retryDelayMs)}
283var baseDelay=5000;if(config.isAdmin()){return baseDelay}
284var seed=String($img.attr('data-pid')||$img.attr('data-original-src')||$img.attr('data-src')||'');var spread=0;for(var i=0;i<seed.length;i++){spread=((spread*31)+seed.charCodeAt(i))%3500}
285return baseDelay+spread+(Math.min(retryCount,3)*1000)}
286function firstUrlFromSrcset(srcset){var match=(srcset||'').match(/^([^\s,]+)/
286);return match?match[1]:''}
287function getImageRetryCandidateUrl($img,img){var src=(img&&img.src)||'';if(isRetryableImageUrl(src)){return src}
288var attrNames=['data-src','srcset','data-srcset'];for(var i=0;i<attrNames.length;i++){var attrValue=$img.attr(attrNames[i])||'';if(!attrValue)continue;var candidate=attrNames[i].indexOf('srcset')!==-1?firstUrlFromSrcset(attrValue):attrValue;if(candidate&&isRetryableImageUrl(candidate)){return candidate}}
289var $picture=$img.closest('picture');var $source=$picture.find('source[srcset*="/bilder/"], source[data-srcset*="/bilder/"], source[srcset*="/webdesk/ajax/inactiveImagePreview.php"], source[data-srcset*="/webdesk/ajax/inactiveImagePreview.php"]').first();if($source.length){return firstUrlFromSrcset($source.attr('srcset')||$source.attr('data-srcset')||'')}
290return src}
291function storePictureSourcesForRetry($picture){if(!$picture.length)return;$picture.find('source').each(function(){var $source=$(this);var srcset=$source.attr('srcset')||$source.attr('data-srcset');if(srcset){$source.attr('data-srcset',srcset).removeAttr('srcset')}})}
292function restorePictureSourcesForRetry($picture){if(!$picture.length)return;$picture.find('source[data-srcset]').each(function(){var $source=$(this);var srcset=$source.attr('data-srcset');if(!srcset)return;var retriedSrcset=srcset.replace(/(^|,\s*)([^\s,]+)/g,function(match,prefix,url){return prefix+addRetryParam(url)});$source.attr('srcset',retriedSrcset)})}
293function updateVideoPosterRetrySource($img,retryUrl){if(!$img.hasClass('nf-video-player__poster')||!retryUrl){return}
294var $container=$img.closest('.nf-video-player');if(!$container.length){return}
295$container.attr('data-poster-url',retryUrl);if(window.nfVideoPlayers&&$container.attr('id')&&window.nfVideoPlayers[$container.attr('id')]){window.nfVideoPlayers[$container.attr('id')].posterUrl=retryUrl}}
296function retryVideoPosterWhenAvailable($img,img,retryUrl){if(!$img.hasClass('nf-video-player__poster')||!retryUrl||!window.fetch){return!1}
297$img.attr('data-poster-probe','1');window.fetch(retryUrl,{credentials:'same-origin'}).then(function(response){$img.removeAttr('data-poster-probe');if(!response||!response.ok){$img.removeClass('retrying-load').removeAttr('data-original-src');return}
298restoreAdContainerForImageRetry($img);$img.removeClass('nf-video-player__poster--pending error-placeholder broken-image retrying-load').removeAttr('data-original-src data-error-timestamp data-src data-error-retry data-error-retry-scheduled data-poster-probe');updateVideoPosterRetrySource($img,retryUrl);img.src=retryUrl}).catch(function(){$img.removeAttr('data-poster-probe').removeClass('retrying-load').removeAttr('data-original-src')});return!0}
299function restoreAdContainerForImageRetry($img){if(!$img.hasClass('nf-o-annonse__img')||$img.hasClass('nf-o-annonse__adcounterimg')){return}
300var $adContainer=$img.closest('.nf-o-annonse-container');if(!$adContainer.length){return}
301if(typeof window.restoreAdVisibility==='function'){window.restoreAdVisibility($adContainer)}else{$adContainer.removeClass('nf-o-annonse-container--empty').removeAttr('data-empty').show();$adContainer.parents('.nf-o-annonse-wrapper, .nf-o-annonse, .nf-o-mobilannonse').removeClass('nf-o-annonse-wrapper--all-empty nf-o-annonse--all-empty nf-o-mobilannonse--all-empty').show()}}
302function handleImageError(img,opts){var $img=$(img);var src=getImageRetryCandidateUrl($img,img);var isNfimageUrl=isRetryableImageUrl(src);var retryCount=parseInt($img.attr('data-error-retry')||'0',10);var retryScheduled=$img.attr('data-error-retry-scheduled')==='1';var isAdmin=config.isAdmin();var maxRetries=isAdmin?2:6;var skipRetry=!!(opts&&opts.skipRetry);if(!skipRetry&&isNfimageUrl&&retryScheduled){return}
303if(!skipRetry&&isNfimageUrl&&retryCount<maxRetries){$img.attr('data-error-retry',String(retryCount+1));$img.attr('data-error-retry-scheduled','1');var originalUrlForRetry=(src&&src.indexOf('data:image/svg+xml')===-1)?src:($img.attr('data-original-src')||'');var $picture=$img.closest('picture');if(originalUrlForRetry){$img.attr('data-original-src',originalUrlForRetry)}
304storePictureSourcesForRetry($picture);$img.removeAttr('srcset data-srcset').removeClass('lazyload lazyloading lazyloaded').addClass('retrying-load');img.src=getTransparentPlaceholder();var delay=getRetryDelay($img,retryCount,opts);setTimeout(function(){$img.removeAttr('data-error-retry-scheduled');var urlToRetry=($img.attr('data-original-src')||originalUrlForRetry||img.src||'');if(urlToRetry&&urlToRetry.indexOf('data:image/svg+xml')===-1&&isRetryableImageUrl(urlToRetry)){restoreAdContainerForImageRetry($img);$img.removeClass('error-placeholder broken-image').removeAttr('data-original-src data-error-timestamp');$img.closest('picture').removeClass('broken-image');$img.closest('.previewbilde__img').removeClass('has-broken-image');$img.closest('tbody').removeClass('notMovable broken-image-row');restorePictureSourcesForRetry($picture);var retryUrl=addRetryParam(urlToRetry);if(retryVideoPosterWhenAvailable($img,img,retryUrl)){return}
305updateVideoPosterRetrySource($img,retryUrl);img.src=retryUrl}},delay);return}
306$img.removeAttr('data-error-retry data-error-retry-scheduled');if(config.isAdmin()){hideEditIconForImage(img,{forceReplace:!0})}else{replaceBrokenImageWithPlaceholder(img)}}
307function hasLazyAttributes(img){var $img=$(img);var $picture=$img.closest('picture');return $img.attr('data-src')||$img.attr('data-srcset')||$img.hasClass('lazyload')||($picture.length&&$picture.find('source[data-srcset]').length)}
308function isInViewport(img){var rect=img.getBoundingClientRect();return(rect.top<window.innerHeight&&rect.bottom>0&&rect.left<window.innerWidth&&rect.right>0)}
309function getVideoPosterViewportTarget($img,img){var $container=$img.closest('.nf-video-player');return $container.length?$container[0]:img}
310function observeVideoPosterForRetry($img,img){if(config.isAdmin()||!window.IntersectionObserver||!$img.hasClass('nf-video-player__poster')||!$img.attr('data-src')){return!1}
311if($img.attr('data-poster-retry-observed')==='1'){return!0}
312if(!videoPosterRetryObserver){videoPosterRetryObserver=new IntersectionObserver(function(entries){for(var i=0;i<entries.length;i++){if(!entries[i].isIntersecting)continue;var poster=entries[i].target;var $poster=$(poster);videoPosterRetryObserver.unobserve(poster);$poster.removeAttr('data-poster-retry-observed');if($poster.hasClass('image-rendered')||$poster.hasClass('error-placeholder')||$poster.attr('data-error-retry-scheduled'))continue;if($poster.hasClass('retrying-load')&&$poster.attr('data-original-src'))continue;if(!isRetryableImageUrl(getImageRetryCandidateUrl($poster,poster)))continue;handleImageError(poster,{retryDelayMs:150})}},{root:null,rootMargin:'80px',threshold:0.01})}
313$img.attr('data-poster-retry-observed','1');videoPosterRetryObserver.observe(img);return!0}
314function processImages(selector,checkFn){$(selector).each(function(){var $img=$(this);var img=this;var isDeletedItemsImage=$img.closest('table.deleted-items-table').length>0;var hasLazy=hasLazyAttributes(this);var hasBeenProcessed=$img.hasClass("lazyloaded")||(!$img.hasClass("lazyload")&&!$img.hasClass("lazyloading"))||($img.attr('data-src')&&this.src&&this.src!==''&&this.src.indexOf('data:image/svg+xml')===-1);if(!hasLazy||hasBeenProcessed||$img.hasClass("lazyloaded")){if(isDeletedItemsImage){var isGreyGif=img.src&&(img.src.indexOf('/pix/grey.gif')!==-1||img.src.indexOf('grey.gif')!==-1);var hasValidSrc=img.src&&img.src.indexOf('data:image/svg+xml')===-1&&img.src.indexOf('grey.gif')===-1;
314var isCompletelyFailed=img.complete&&img.naturalWidth===0&&img.naturalHeight===0;if(isGreyGif||(isCompletelyFailed&&hasValidSrc)){debugLog("Found broken image in deleted items (processImages):",img.src||'unknown');checkFn(img)}}else{if(isImageBroken(img)){debugLog("Found broken image in processImages:",img.src||'unknown',"hasLazy:",hasLazy,"hasBeenProcessed:",hasBeenProcessed,"lazyloaded:",$img.hasClass("lazyloaded"));checkFn(img)}}}})}
315function checkImmediatelyVisibleImages(){var isAdmin=config.isAdmin();var selector=isAdmin?"img.uppyThumbnail__img":"img:not([class*='lazy'])";var checkFn=isAdmin?hideEditIconForImage:handleImageError;$(selector).each(function(){if(isAdmin&&hasLazyAttributes(this))return;var img=this;var $img=$(img);var imgSrc=img.src||'unknown';var isImageUrl=isRetryableImageUrl(imgSrc);if(isImageUrl){debugLog("checkImmediatelyVisibleImages: Checking non-lazy image:",imgSrc,"complete:",img.complete,"dimensions:",img.naturalWidth||0,"x",img.naturalHeight||0)}
316var isDeletedItemsImage=$img.closest('table.deleted-items-table').length>0;if(isDeletedItemsImage){var isGreyGif=imgSrc.indexOf('/pix/grey.gif')!==-1||imgSrc.indexOf('grey.gif')!==-1;var isCompletelyFailed=img.complete&&img.naturalWidth===0&&img.naturalHeight===0&&imgSrc.indexOf('data:image/svg+xml')===-1;if(isGreyGif||isCompletelyFailed){debugLog("Found broken image in deleted items:",imgSrc);checkFn(img)}}else{if(isImageBroken(img)){debugLog("Found broken image in checkImmediatelyVisibleImages:",imgSrc);checkFn(img)}else if(img.complete&&img.naturalWidth>0&&img.naturalHeight>0&&img.naturalWidth===1&&img.naturalHeight===1&&isImageUrl&&imgSrc.indexOf('grey.gif')===-1&&imgSrc.indexOf('data:image/svg+xml')===-1){debugLog("CRITICAL: Found non-lazy image with exactly 1x1 dimensions from retryable NewsFlow image URL:",imgSrc);checkFn(img)}}});if(!isAdmin){$("img[src*='/bilder/'], img[src*='/webdesk/ajax/inactiveImagePreview.php']").each(function(){var img=this;var $img=$(img);if($img.hasClass("error-placeholder")){return}
317if(isImageBroken(img)){handleImageError(img)}})}}
318function checkAllImagesForErrors(){var isAdmin=config.isAdmin();if(isAdmin){processImages("img.uppyThumbnail__img",hideEditIconForImage)}else{processImages("img[class*='lazy'], img.lazyloaded",handleImageError)}}
319function refreshLazyImageCandidates(){if(typeof lazySizes==='undefined'||!lazySizes.loader){return}
320if(typeof lazySizes.loader.checkElems==='function'){lazySizes.loader.checkElems()}
321if(lazySizes.autoSizer&&typeof lazySizes.autoSizer.checkElems==='function'){lazySizes.autoSizer.checkElems()}}
322function initImageErrorHandling(){$(document).on("error","img[data-pid]",function(){handleImageError(this)});if(typeof lazySizes==='undefined')return;var isAdmin=config.isAdmin();$(document).on("lazybeforeunveil",function(e){if(e.target.tagName!=="IMG")return;var $img=$(e.target);var imgTimeout=null;imgTimeout=setTimeout(function(){var img=$img[0];if($img.hasClass("lazyloaded")&&isImageBroken(img)){handleImageError(img)}},30000);$img.on("error",function(){if(imgTimeout)clearTimeout(imgTimeout);}).on("load",function(){if(imgTimeout)clearTimeout(imgTimeout);$img.removeAttr('data-error-retry-scheduled');var loadedImg=this;var $loadedImg=$(loadedImg);if($loadedImg.hasClass("retrying-load")){var width=loadedImg.naturalWidth||0;var height=loadedImg.naturalHeight||0;if(width>2&&height>2&&loadedImg.src.indexOf('grey.gif')===-1&&loadedImg.src.indexOf('data:image/svg+xml')===-1){$loadedImg.removeClass("retrying-load");return}}
323var finalizeLoadedImage=function(){if(isImageBroken(loadedImg)){handleImageError(loadedImg)}else{if(!$loadedImg.hasClass('image-rendered')&&loadedImg.naturalWidth>0&&loadedImg.naturalHeight>0){$loadedImg.addClass('image-rendered')}
324if(isAdmin&&$loadedImg.hasClass("uppyThumbnail__img")){showEditIconForLoadedImage(loadedImg)}}};if(loadedImg.naturalWidth>0&&loadedImg.naturalHeight>0){finalizeLoadedImage()}else{var runNext=window.requestAnimationFrame||function(fn){setTimeout(fn,0)};runNext(finalizeLoadedImage)}})});$(document).on("lazyloaded",function(e){if(e.target&&e.target.tagName==="IMG"){var img=e.target;var $img=$(img);
324if($img.hasClass("retrying-load")){var width=img.naturalWidth||0;var height=img.naturalHeight||0;if(width>2&&height>2&&img.src.indexOf('grey.gif')===-1&&img.src.indexOf('data:image/svg+xml')===-1){$img.removeClass("retrying-load");$img.removeAttr('data-error-retry-scheduled');return}}
325var finalizeLazyLoadedImage=function(){if(isImageBroken(img)){handleImageError(img)}else if(isAdmin&&$img.hasClass("uppyThumbnail__img")){showEditIconForLoadedImage(img)}};if(img.naturalWidth>0&&img.naturalHeight>0){finalizeLazyLoadedImage()}else{var runNext=window.requestAnimationFrame||function(fn){setTimeout(fn,0)};runNext(finalizeLazyLoadedImage)}}})}
326function initComprehensiveChecking(){$(document).ready(function(){setTimeout(checkImmediatelyVisibleImages,2000);setTimeout(refreshLazyImageCandidates,250);setTimeout(refreshLazyImageCandidates,1500);setTimeout(function(){debugLog("Comprehensive check for all images after page load");refreshLazyImageCandidates();checkAllImagesForErrors()},5000)});var isAdmin=config.isAdmin();if(isAdmin){setTimeout(function(){debugLog("Checking for broken-image class elements");$("img.broken-image").each(function(){debugLog("Found broken-image element:",this);replaceBrokenImageWithPlaceholder(this)})},1000);setTimeout(function(){debugLog("Comprehensive check for processed images");checkAllImagesForErrors()},4000);function checkStuckImages(){$('.previewbilde__img img[data-pid], td.previewbilde img[data-pid]').each(function(){var img=this;var $img=$(img);if($img.hasClass('image-rendered')||$img.hasClass('error-placeholder'))return;var url=img.src||$img.attr('data-src')||'';if(!isRetryableImageUrl(url))return;if(img.naturalWidth>0&&img.naturalHeight>0)return;handleImageError(img)})}
327setTimeout(checkStuckImages,12000);setTimeout(checkStuckImages,22000)}else{function checkStuckFrontModuleImages(){$('.nf-o-moduleblock img[data-pid][src*="/bilder/"], .nf-o-moduleblock img[data-pid][data-src*="/bilder/"], .nf-c-front-nyhetslistemodul__img[data-pid][src*="/bilder/"], .nf-c-front-nyhetslistemodul__img[data-pid][data-src*="/bilder/"], .nf-video-player__poster[data-pid][src*="/bilder/"], .nf-video-player__poster[data-pid][data-src*="/bilder/"], .nf-js-ad-container[data-ad-type="static"] img.nf-o-annonse__img[data-pid][src*="/bilder/"], .nf-js-ad-container[data-ad-type="static"] img.nf-o-annonse__img[data-pid][data-src*="/bilder/"]').each(function(){var img=this;var $img=$(img);var isVideoPoster=$img.hasClass('nf-video-player__poster');if($img.hasClass('image-rendered')||$img.hasClass('error-placeholder')||$img.attr('data-error-retry-scheduled'))return;if($img.hasClass('retrying-load')&&$img.attr('data-original-src'))return;if(!isRetryableImageUrl(getImageRetryCandidateUrl($img,img)))return;if(isVideoPoster){if(!isInViewport(getVideoPosterViewportTarget($img,img))){observeVideoPosterForRetry($img,img);return}
328if($img.attr('data-src')){handleImageError(img,{retryDelayMs:150});return}}
329var isStaticAdImage=$img.closest('.nf-js-ad-container[data-ad-type="static"]').length>0;if(isStaticAdImage&&isInViewport(img)&&!$img.hasClass('lazyloaded')){handleImageError(img);return}
330if(img.complete&&img.naturalWidth>2&&img.naturalHeight>2&&img.src.indexOf('grey.gif')===-1){$img.addClass('image-rendered');return}
331if(!img.complete&&isVideoPoster){handleImageError(img);return}
332if(img.complete&&$img.hasClass('lazyloaded')&&(img.naturalWidth===0||img.naturalHeight===0||isImageBroken(img))){handleImageError(img)}})}[750,2000].forEach(function(delay){setTimeout(function(){refreshLazyImageCandidates();checkStuckFrontModuleImages()},delay)});setTimeout(function(){refreshLazyImageCandidates();checkAllImagesForErrors();checkStuckFrontModuleImages()},4000);[10000,20000,35000].forEach(function(delay){setTimeout(function(){refreshLazyImageCandidates();checkStuckFrontModuleImages();if(typeof window.NewsFlowImages!=='undefined'&&window.NewsFlowImages.retryErrorPlaceholderImages){window.NewsFlowImages.retryErrorPlaceholderImages()}},delay)})}}
333function retryErrorPlaceholderImages(){var retriedCount=0;$('img.error-placeholder[data-original-src]').each(function(){var $img=$(this);var originalSrc=$img.attr('data-original-src');var $picture=$img.closest('picture');if(!originalSrc)return;restoreAdContainerForImageRetry($img);$img.addClass('retrying-load').removeClass('error-placeholder').removeAttr('data-original-src data-error-timestamp');if($picture.length){$picture.find('source[data-srcset]').each(function(){var $source=$(this);var dataSrcset=$source.attr('data-srcset');if(dataSrcset){$source.attr('srcset',dataSrcset)}});var $firstSource=$picture.find('source[srcset]').first();if($firstSource.length){var srcset=$firstSource.attr('srcset');
333if(srcset){var match=srcset.match(/^([^\s,]+)/);if(match){var firstUrl=match[1];$img.attr('src',firstUrl);$img.attr('data-src',firstUrl);var dataSrcset=$firstSource.attr('data-srcset');if(dataSrcset){$img.attr('data-srcset',dataSrcset)}}}}}else{$img.attr('src',originalSrc);$img.attr('data-src',originalSrc)}
334$img.addClass('lazyload').removeClass('lazyloaded lazyloading');if(typeof lazySizes!=='undefined'){lazySizes.loader.unveil($img[0])}else{var newImg=new Image();newImg.onload=function(){$img.attr('src',originalSrc);$img.addClass('lazyloaded').removeClass('retrying-load')};newImg.onerror=function(){$img.removeClass('retrying-load')};newImg.src=originalSrc}
335retriedCount++});if(retriedCount>0){debugLog("Retried loading "+retriedCount+" error-placeholder images")}
336return retriedCount}
337window.NewsFlowImages={replaceBrokenImageWithPlaceholder:replaceBrokenImageWithPlaceholder,hideEditIconForBrokenImage:hideEditIconForBrokenImage,hideEditIconForImage:hideEditIconForImage,showEditIconForLoadedImage:showEditIconForLoadedImage,findEditIconForImage:findEditIconForImage,checkAdminImagesForErrors:checkAllImagesForErrors,checkAllImagesForErrors:checkAllImagesForErrors,handleImageError:handleImageError,isImageBroken:isImageBroken,retryErrorPlaceholderImages:retryErrorPlaceholderImages,setDebug:function(enabled){config.debug=enabled},getDebug:function(){return config.debug}};$(document).ready(function(){initImageErrorHandling();initComprehensiveChecking()});$(window).on('load pageshow',function(){refreshLazyImageCandidates()});$(document).on('visibilitychange',function(){if(document.visibilityState==='visible'){refreshLazyImageCandidates()}})})(jQuery);var POOLED_CHECKER_CONFIG={MAX_BACKOFF_MULTIPLIER:8,SERVER_BACKOFF_LIMIT:4,CONNECTION_FAIL_DELAY:10000,BATCH_SIZE:3,MIN_INTERVAL:2000,MAX_INTERVAL:10000};var pooledCheckerState={timeout:0,callNumber:0,backoffMultiplier:1,pendingChecks:{},lastRequestTime:0,nextCheckId:0};function calculatePooledTimeout(baseFreq,slowFreq,backoffMultiplier){var focus=document.hasFocus()?1:0;var baseTimeout=focus?baseFreq*1000:slowFreq*1000;return Math.min(Math.max(baseTimeout*backoffMultiplier,POOLED_CHECKER_CONFIG.MIN_INTERVAL),POOLED_CHECKER_CONFIG.MAX_INTERVAL)}
338function applyPooledBackoff(currentMultiplier,factor,maxMultiplier){return Math.min(currentMultiplier*factor,maxMultiplier)}
339function safePooledJSONParse(data){if(typeof window.safeParseJSON==='function'){return window.safeParseJSON(data)}
340try{if(typeof data==='object'&&data!==null){return data}
341if(typeof data==='string'){return JSON.parse(data)}
342console.error('Unexpected data type for pooled JSON response:',typeof data,data);return null}catch(e){console.error('Failed to parse pooled JSON response:',e,'Data:',data);return null}}
343function registerPooledCheck(checkType,checkData,callback){var checkId=checkType+'_'+Date.now()+'_'+(++pooledCheckerState.nextCheckId);pooledCheckerState.pendingChecks[checkId]={type:checkType,data:checkData,callback:callback,timestamp:Date.now()};if(pooledCheckerState.timeout===0){schedulePooledRequest()}}
344function schedulePooledRequest(){var now=Date.now();var timeSinceLastRequest=now-pooledCheckerState.lastRequestTime;var minInterval=POOLED_CHECKER_CONFIG.MIN_INTERVAL;if(timeSinceLastRequest<minInterval){pooledCheckerState.timeout=setTimeout(executePooledRequest,minInterval-timeSinceLastRequest)}else{executePooledRequest()}}
345function executePooledRequest(){var pendingCheckKeys=Object.keys(pooledCheckerState.pendingChecks);if(pendingCheckKeys.length===0){pooledCheckerState.timeout=0;return}
346var checks={};var callbacks={};var batchCount=0;for(var i=0;i<pendingCheckKeys.length;i++){if(batchCount>=POOLED_CHECKER_CONFIG.BATCH_SIZE)break;var checkId=pendingCheckKeys[i];var check=pooledCheckerState.pendingChecks[checkId];checks[check.type]=check.data;callbacks[checkId]=check.callback;delete pooledCheckerState.pendingChecks[checkId];batchCount++}
347pooledCheckerState.timeout=0;pooledCheckerState.lastRequestTime=Date.now();var requestData={checks:JSON.stringify(checks),BrukerID:window.BrukerID||0,CallNumber:++pooledCheckerState.callNumber};$.post('/webdesk/ajax/ajax_pooled_checker.php',requestData).done(function(response){var responseData=response;if(!responseData||typeof responseData!=='object'){console.error('Invalid response data:',responseData);return}
348if(responseData.status==='backoff'&&responseData.backoff>0){pooledCheckerState.backoffMultiplier=applyPooledBackoff(pooledCheckerState.backoffMultiplier,1.5,POOLED_CHECKER_CONFIG.SERVER_BACKOFF_LIMIT);console.log("Pooled checker server backoff:",responseData.backoff)}else if(responseData.status==='ok'){pooledCheckerState.backoffMultiplier=1;for(var checkId in callbacks){if(callbacks.hasOwnProperty(checkId)){var callback=callbacks[checkId];var checkTypeParts=checkId.split('_');var checkType=checkTypeParts[0];var resultKey=checkType;if(checkType==='edit'){resultKey='edit_status'}else if(checkType==='newslist'){resultKey='newslist_change'}
349var result=responseData.data?responseData.data[resultKey]:null;if(result&&callback){callback(result)}}}}}).fail(function(xhr,status,error){pooledCheckerState.backoffMultiplier=applyPooledBackoff(pooledCheckerState.backoffMultiplier,2,POOLED_CHECKER_CONFIG.MAX_BACKOFF_MULTIPLIER);console.warn("Pooled checker AJAX failed:",status)});var remainingChecks=Object.keys(pooledCheckerState.pendingChecks).length;if(remainingChecks>0){var timeout=calculatePooledTimeout(window.newsCheckFreq||2,window.newsCheckFreqSlow||5,pooledCheckerState.backoffMultiplier);
349pooledCheckerState.timeout=setTimeout(schedulePooledRequest,timeout)}}
350function checkNewslistChangePooled(BrukerID,callback){registerPooledCheck('newslist_change',{},function(result){if(callback)callback(result);})}
351function checkEditStatusPooled(NyhetIDs,Type,callback){registerPooledCheck('edit_status',{NyhetIDs:NyhetIDs,Type:Type},function(result){if(callback)callback(result);})}
352function checkReorderStatusPooled(type,action,callback){registerPooledCheck('reorder_check',{type:type,action:action},function(result){if(callback)callback(result);})}
353$(document).ready(function(){})

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.