PageSourceSearch

https://nsm.no/corepublish/cplib-common/corepublish.js?appver=3a33fb0791

js nsm.no collected 2026-09-24 09:23:59 UTC 28,073 bytes, 1 lines download raw bytes

1function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var corepublishInitDone=!1,x,y;function CpAddEvent(e,t,i,n){return e.addEventListener?(e.addEventListener(t,i,n),!0):e.attachEvent?e.attachEvent("on"+t,i):void(e["on"+t]=i)}function CpRemoveEvent(e,t,i,n){return e.removeEventListener?(e.removeEventListener(t,i,n),!0):e.detachEvent?e.detachEvent("on"+t,i):void(e["on"+t]=null)}function CpCreateCustomEvent(e,t,i,n){if(cpNavigatorUserAgentInfo.isIE)(r=document.createEvent("CustomEvent")).initCustomEvent(e,t,i,n);else var r=new CustomEvent(e,{bubbles:t,canceable:i,detail:n});return r}function corepublishInit(){if(document.onmousemove=catchXY,corepublishInitDone=!0,!cpNavigatorUserAgentInfo.isIE8&&!cpNavigatorUserAgentInfo.isIE7){var e=CpCreateCustomEvent("corepublishInitLoaded");window.dispatchEvent(e)}}function catchXY(e){x=cpNavigatorUserAgentInfo.isIE?event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft):e.pageX,y=cpNavigatorUserAgentInfo.isIE?event.clientY+(document.documentElement.scrollTop||document.body.scrollTop):e.pageY}function ctOidcAuthenticate(){var e=window.location.hash;if(0!==e.length&&-1!==e.indexOf("id_token")){var t=window.location.href,i=-1===t.indexOf("?")?"?":"&";-1===(t=t.replace("#",i)).indexOf("code=")&&(t+="&code"),window.location.href=t}}window.CustomEvent||function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}e.prototype=window.Event.prototype,window.CustomEvent=e}();var cpNavigatorUserAgent=navigator.userAgent.toLowerCase(),cpNavigatorUserAgentInfo={isIE:cpNavigatorUserAgent.indexOf("msie")>-1||cpNavigatorUserAgent.indexOf("trident")>-1,isIE7:cpNavigatorUserAgent.indexOf("msie 7")>-1,isIE8:cpNavigatorUserAgent.indexOf("msie 8")>-1,isGecko:cpNavigatorUserAgent.indexOf("gecko/")>-1,isSafari:cpNavigatorUserAgent.indexOf("safari")>-1,isOpera:cpNavigatorUserAgent.indexOf("opera")>-1,isMac:cpNavigatorUserAgent.indexOf("macintosh")>-1};function cpReadCookie(e){e+="=";for(var t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substr(1);if(0==n.indexOf(e))return n.substr(e.length)}return null}function ct_win(e,t,i,n){return win_name="ct_win",n&&n.length>1?win_props=n:win_props="height="+t+",width="+i+",screenX=400,screenY=100",window.open(e,win_name,win_props)}function getAbsoluteElementPosition(e){if(null==e)return{x:0,y:0};var t=e.getBoundingClientRect();return{x:window.pageXOffset+t.left,y:window.pageYOffset+t.top}}function scrollToElement(e,t){if(null!=(t=findSubElement(e=getElement(e),t))){var i=0;el=t;do{i+=el.offsetTop,el=el.offsetParent}while(el&&null==findSubElement(el,e));e.scrollTop=i-e.offsetTop}}function findSubElement(e,t){e=getElement(e),t=getElement(t);for(var i=e.childNodes,n=0;n<i.length;n++){if(i[n]==t)return t;var r=findSubElement(i[n],t);if(null!=r)return r}return null}function getElement(e){if("object"==_typeof(e))return e;var t=document.getElementById(e);return"object"==_typeof(t)?t:null}function getAvailableBrowserHeight(){return window.innerWidth&&window.innerHeight?window.innerHeight:null!=document.body&&document.body.clientWidth&&document.body.clientHeight?document.body.clientHeight:window.screen?screen.availHeight:600}function getAvailableBrowserWidth(){return window.innerWidth&&window.innerHeight?window.innerWidth:null!=document.body&&document.body.clientWidth&&document.body.clientHeight?document.body.clientWidth:window.screen?screen.availWi
1dth:800}function ct_image(e){return!!corepublishInitDone&&(a=new Image,a.src=e,a)}function ct_swap(e,t){corepublishInitDone&&(document[e].src=t.src)}function cpWriteActiveX(e){document.write(e)}function cpWriteMediaObject(e,t,i,n,r,o,s,a,c,l,u){var d="";void 0===u&&1!=u&&(u=!1);var p="https"==e.substr(0,5)?"https":"http",h=new Object;if(h["video/x-flv"]=!0,h["application/x-flash-video"]=!0,h["video/flv"]=!0,null!=h[r]){var m=null;void 0!==l&&void 0!==l.floatingcontrols&&"true"==l.floatingcontrols&&(m=n),(l=new Object).file=encodeURIComponent(e),l.width=i,l.height=n,null!=m&&(l.displayheight=n),l.overstrech="true",l.frontcolor="0xFFFFFF",l.backcolor="0x000000",l.lightcolor="0xFFFFFF",l.autostart=s?"true":"false",l.repeat=o?"true":"false",l.usefullscreen="true",d+='<param name="allowscriptaccess" value="always" />',d+='<param name="allowfullscreen" value="true" />',d+='<param name="flashvars" value="'+getQueryParamsFromObject(l)+'" />',r="application/x-shockwave-flash",e=CPLIBHTMLROOT+"/mediaplayer.swf"}var g=new Object;if(cpNavigatorUserAgentInfo.isIE&&(g["audio/mpeg"]="application/x-mplayer2",g["video/mpeg"]="application/x-mplayer2",g["video/x-msvideo"]="video/x-ms-wmv"),null!=g[r]&&(r=g[r]),"application/x-shockwave-flash"!=r?(d+='<param name="loop" value="'+(o?"true":"false")+'" />',d+='<param name="autostart" value="'+(s?"true":"false")+'" />',d+='<param name="controller" value="'+(a?"true":"false")+'" />'):(d+='<param name="wmode" value="opaque" />',void 0!==l&&(d+='<param name="flashVars" value="'+getQueryParamsFromObject(l)+'" />')),cpNavigatorUserAgentInfo.isIE){var f=e.indexOf("?")>-1?"&":"?",v=cpReadCookie(t);null!=v&&v.length>0&&(e=e+f+t+"="+v)}var w="",y='<object type="'+r+'" data="'+e+'" width="'+i+'" height="'+n+'">',b='<param name="movie" value="'+e+'" />';switch(r){case"application/x-shockwave-flash":cpNavigatorUserAgentInfo.isIE&&(y='<object codebase="'+p+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+i+'" height="'+n+'">');break;case"application/x-mplayer2":case"video/x-ms-wmv":case"video/x-msvideo":b='<param name="src" value="'+e+'" />';break;case"video/quicktime":if(cpNavigatorUserAgentInfo.isIE){y='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="'+p+'://www.apple.com/qtactivex/qtplugin.cab" width="'+i+'" height="'+n+'">',b='<param name="src" value="'+e+'" />';break}break;case"video/x-ms-asf":if(cpNavigatorUserAgentInfo.isIE){b='<param name="FileName" value="'+e+'" />';break}}if(w+=y,w+=b,w+=d,w+="<p>(No plugin detected for your OS/browser)</p>",w+="</object>",null==c||0==c)document.write(w);else try{cpNavigatorUserAgentInfo.isIE&&!u?CpAddEvent(window,"load",function(){document.getElementById(c).innerHTML=w}):document.getElementById(c).innerHTML=w}catch(e){document.write(w)}}function getQueryParamsFromObject(e){var t="";for(var i in e)t.length>0&&(t+="&"),t+=i+"="+encodeURIComponent(e[i]);return t}function slideshow(thearray,imgname,pos,what,theform){corepublishInitDone&&(i=eval("slidepos"+pos),count=eval("count"+pos),"next"==what&&thearray[i+1]&&(temp=ct_image(thearray[i+1]),document[imgname].src=temp.src,eval("slidepos"+pos+"++"),theform.slidetext.value=i+2+" av "+count),"previous"==what&&i>0&&thearray[i-1]&&(temp=ct_image(thearray[i-1]),document[imgname].src=temp.src,eval("slidepos"+pos+"--"),theform.slidetext.value=i+" av "+count))}window.jQuery?jQuery(document).ready(corepublishInit):"undefined"!=typeof Prototype&&document.observe?document.observe("dom:loaded",corepublishInit):CpAddEvent(window,"load",corepublishInit,!0);var cplibTileLoaderXMLHttpObjectArray=new Object;if("undefined"!=typeof htmlroot)var cplibXmlHttpUrl=htmlroot+"xmlhttprequest.php";else var cplibXmlHttpUrl="/xmlhttprequest.php";function cplibRenderAjaxTile(e,t,i,n,r,o,s){cplibTileLoaderXMLHttpObjectArray[t]=new CtXMLHttpRequest;var a=cplibTileLoaderXMLHttpObjectArray[t];a.SetOnreadystatechange(function(){4==a.getReadyState()&&(document.getElementById("cplibajaxtilecontainer-"+t+"-loading").style.display="none",document.getElementById("cplibaja
1xtilecontainer-"+t).style.display="block",document.getElementById("cplibajaxtilecontainer-"+t).innerHTML=a.getResponseText(),void 0!==o&&null!=o&&o.call(this,t,i))});var c=new Object;if(c.categorytemplatetileID=t,c.categorytemplateID=e,c.categoryID=n,c.articleID=r,c.placeholdername=i,s)for(var l in s)c[l]=s[l];if(location.search.length>0)for(var u=location.search.substring(1).split("&"),d=0;d<u.length;d++){var p=u[d].split("=");c[p[0]]=p[1]}a.openCorePublishService(cplibXmlHttpUrl,"categorytemplate.renderajaxtile","html",c)}function cpRegisterStatistics(){now=new Date,void 0===window.cpstatDomain?window.cpstatDomain="/":window.cpstatDomain="//"+window.cpstatDomain;var e=JSON.parse(window.cpstatInfo);for(var t in e.s=+screen.width+"x"+screen.height,e.c=+screen.colorDepth,e.r=now.getMilliseconds()-CPLIBSTARTTIME.getMilliseconds(),e.f=AFPGetSwfVer(),e.e=encodeURIComponent(cpStatisticsGetReferer()),e.a=encodeURIComponent(document.location.href),e.t=encodeURIComponent(document.title),e.w=cpStatisticsGetTrackingId(),str="",e)str+=t+":"+e[t]+"\n";for(var i in url=window.cpstatDomain+"/regstat.php?reg=1",e)url+="&"+i+"="+e[i];img=new Image(1,1),img.src=url}function cpRegisterStatisticsArrayToUrl(e,t){}function cpStatisticsGetReferer(){try{return top.document.referrer?top.document.referrer:document.referrer}catch(e){return document.referrer}}function cpStatisticsGetTrackingId(){return id=cpGetCookieVal("__ctsid"),(null==id||id.length<1)&&(id=cpgenTrackingId(),cpSetCookieVal("__ctsid",id,1825)),id}function cpGetCookieVal(e){var t=document.cookie.split(";");for(cookies=new Object,i=0;i<t.length;i++)if(cookieInfo=t[i].split("="),cName=cookieInfo[0].replace(" ",""),cName==e)return cookieInfo[1];return null}function cpSetCookieVal(e,t,i){var n=new Date;n.setTime(n.getTime()+24*i*60*60*1e3);var r="; expires="+n.toGMTString(),o="; domain="+cpstatDomain;document.cookie=e+"="+t+r+o+"; path=/"}function cpgenTrackingId(){var e=(new Date).getTime().toString()+".";for(x=0;x<3;x++)e+=Math.floor(100*Math.random()+1);return e}var AFPisIE=-1!=navigator.appVersion.indexOf("MSIE"),AFPisWin=-1!=navigator.appVersion.toLowerCase().indexOf("win"),AFPisOpera=-1!=navigator.userAgent.indexOf("Opera");function AFPControlVersion(){var e,t;try{e=(t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")).GetVariable("$version")}catch(e){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),e="WIN 6,0,21,0",t.AllowScriptAccess="always",e=t.GetVariable("$version")}catch(e){}if(!e)try{e=(t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3")).GetVariable("$version")}catch(e){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e="WIN 3,0,18,0"}catch(e){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),e="WIN 2,0,0,11"}catch(t){e=-1}return-1!=e&&(e=(e=e.substr(4)).replace(",",".").replace(",",".").replace(",",".").replace(",",".")),e}function AFPGetSwfVer(){var e=-1;if(null!=navigator.plugins&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var t=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",i=navigator.plugins["Shockwave Flash"+t].description.split(" "),n=i[2].split("."),r=n[0],o=n[1],s=i[3];""==s&&(s=i[4]),"d"==s[0]?s=s.substring(1):"r"==s[0]&&(s=s.substring(1)).indexOf("d")>0&&(s=s.substring(0,s.indexOf("d"))),e=r+"."+o+"."+s}}else-1!=navigator.userAgent.toLowerCase().indexOf("webtv/2.6")?e=4:-1!=navigator.userAgent.toLowerCase().indexOf("webtv/2.5")?e=3:-1!=navigator.userAgent.toLowerCase().indexOf("webtv")?e=2:AFPisIE&&AFPisWin&&!AFPisOpera&&(e=AFPControlVersion());return e}var cplangstringarray={};function setWord(e,t){void 0!==cplangstringarray&&void 0===cplangstringarray[e]&&(cplangstringarray[e]=t)}function getWord(e,t){if(void 0!==cplangstringarray&&void 0!==cplangstringarray[e]){var i=cplangstringarray[e];if("object"==_typeof(t))for(var n=0;n<Object.keys(t).length;n++)i=i.replace("{"+n+"}",t[n]);return i}}function ctShowRetinaImages(){if(0!=window.devicePixelRatio>1){var e=document.getElementsByTagName("img");for(i in e)if(image=e[i],"object"==("undefined"==typeof image?"undefined":_typeof(image))&&(null==image.getAttribute("class")||-1==image.getAttribute("class").indexOf("noretina"))){var t=image.getAttribute("data-retinasrc");if(t){var n=image.getAttribute("height"),r=image.getAttribute("width");
1if(null==n||null==r||1==isNaN(n)||1==isNaN(r)){if(!image.clientWidth||!image.clientHeight)continue;image.setAttribute("height",image.clientHeight),image.setAttribute("width",image.clientWidth)}image.setAttribute("data-originalsrc",image.src),image.src=t}image.removeAttribute("data-retinasrc")}}}function ctLoadSvgSymbols(e){if("undefined"!=typeof frontendhtmlroot)var t=frontendhtmlroot+"service.php";else t="/service.php";var i=new XMLHttpRequest;i.open("GET",t+"?service=mmarchive.getsitesvgsymbols&version="+e,!0),i.onreadystatechange=function(){if(4==i.readyState&&200==i.status){var e=document.createElement("div");e.setAttribute("id","svgsymbolcontainer"),e.setAttribute("role","complementary"),e.setAttribute("aria-label","SVG icons"),e.setAttribute("style","height:0;width:0"),e.innerHTML=i.responseText;var t=CpCreateCustomEvent("ctSvgSymbolsLoaded");window.dispatchEvent(t);var n=function(){document.body.insertBefore(e,document.body.firstChild)};void 0!==document.body&&document.body?n.call():document.addEventListener("DOMContentLoaded",function(e){n.call()})}},i.send()}function cticon(e){var t=getCtSvgSymbolUseElement(e);return t.setAttribute("class","stdicon"),t}function getCtSvgSymbolUseElement(e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("shape-rendering","auto"),t.setAttribute("aria-hidden","true"),t.setAttribute("role","presentation"),t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/xmlns/"),t.innerHTML='<use xlink:href="#'+e+'" />',t}function getGeoPositionErrorHandler(e){var t="An unknown error occured";switch(e.code){case e.PERMISSION_DENIED:t="User denied the request for Geolocation.";break;case e.POSITION_UNAVAILABLE:t="Location information is unavailable.";break;case e.TIMEOUT:t="The request to get user location timed out.";break;case e.UNKNOWN_ERROR:t="An unknown error occurred."}alert(t)}function ctOnDocumentReady(e){"loading"!=document.readyState?e():document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}function ctAppendNonceParameters(e){if(document.getElementById("cpstartupscript")){var t=document.getElementById("cpstartupscript").nonce,i=document.getElementById("cpstartupscript").dataset.ctnsh;if(e instanceof FormData)e.set("nonce",t),e.set("ctnsh",i);else if(e instanceof URL)e.searchParams.set("nonce",t),e.searchParams.set("ctnsh",i);else if("object"===_typeof(e))e.nonce=t,e.ctnsh=i;else if("string"==typeof e){var n="&";"&"===e.charAt(e.length-1)?n="":-1===e.indexOf("?")&&-1===e.indexOf("&")&&(n="?"),e+=n+"nonce="+t+"&ctnsh="+i}}return e}if(0==(cpNavigatorUserAgentInfo.isIE8||cpNavigatorUserAgentInfo.isIE7)){var evt=CpCreateCustomEvent("corepublishJsLoaded");window.dispatchEvent(evt)}function CtXMLHttpRequest(){window.XMLHttpRequest?(req=new XMLHttpRequest,this.browsertype="moz"):(req=new ActiveXObject("Microsoft.XMLHTTP"),this.browsertype="ie"),this.reqobject=req,this.onreadystatechangefunctionname="void();"}cplibJsLoaded=!0,CtXMLHttpRequest.prototype.SetOnreadystatechange=function(e){this.reqobject.onreadystatechange=e},CtXMLHttpRequest.prototype.open=function(e,t,i,n,r){if("ie"==this.browsertype){var o=Math.random(1e3);t+="&ie_nocache_random_param"+o+"="+o}this.reqobject.open(e,t,i,n,r),this.reqobject.setRequestHeader("X-Requested-With","XMLHttpRequest")},CtXMLHttpRequest.prototype.openCorePublishService=function(e,t,i,n){var r=e+"?service="+t+"&responseformat="+i;if("undefined"!=typeof ctCgiAntiCSRFTokenUrlpart&&(r+="&"+ctCgiAntiCSRFTokenUrlpart),"object"===_typeof(n)&&!1===Array.isArray(n))for(var o in n)r+="&"+o+"="+n[o];r=ctAppendNonceParameters(r),this.open("GET",r,!0),this.send()},CtXMLHttpRequest.prototype.openTileService=function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"GET",o="xmlhttprequest.php?service=tile.service&tileInstanceId="+e+"&categoryId="+t+"&action="+i;if("undefined"!=typeof ctCgiAntiCSRFTokenUrlpart&&(o+="&"+ctCgiAntiCSRFTokenUrlpart),"object"===_typeof(n)&&!1===Array.isArray(n))for(var s in n)Array.isArray(n[s])?o+=n[s].map(function(e){return"&".concat(s,"[]=").concat(e)}).join(""):o+="&".concat(s,"=").concat(n[s]);o=ctAppendNonceParameters(o),this.open(r,o,!0),this.send()},CtXMLHttpRequest.prototype.send=function(e){this.reqobject.send(e)},CtXMLHttpRequest.prototype.getReadyState=function(){return this.reqobject.readyState},CtXMLHttpRequest.prototype.isReadyToProcess=function(){return 4==this.reqobject.readyState&&0==this.hasError()},CtXMLHttpRequest.prototype.hasError=function(){return 200!=this.getStatus()&&4==this.getReadyState()},CtXMLHttpRequest.prototype.getErrorString=function(){return 0==this.hasError()?"":"404"===this.getStatus()?"the page requested could not be found. Check the url to the service":"An internal service error occurred."},CtXMLHttpRequest.prototype.getStatus=function(){try{return this.reqobject.status}catch(e){return 200}},CtXMLHttpRequest.prototype.getStatusText=function(){return this.reqobject.statusText},CtXMLHttpRequest.prototype.getResponseText=function(){return this.reqobject.responseText},CtXMLHttpRequest.prototype.getResponseXML=function(){return this.reqobject.responseXML},CtXMLHttpRequest.prototype.getJsonResponseObject=function(){return jQuery.parseJSON(this.reqobject.responseText)},CtXMLHttpRequest.prototype.abort=function(){return this.reqobject.abort},CtXMLHttpRequest.prototype.getAllResponseHeaders=function(){return this.reqobject.getAllResponseHeaders()},CtXMLHttpRequest.prototype.getResponseheader=function(e){return this.reqobject.getResponseheader(e)},CtXMLHttpRequest.prototype.setRequestHeader=function(e,t){return this.reqobject.setRequestHeader(e,t)},CtXMLHttpRequest.prototype.getServiceUrl=function(){return htmlroot+"service.php"};var SessionRefreshDialog=_createClass(function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"form",o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];_classCallCheck(this,e),this.sessionLifeTimeValue=t,this.serviceBaseUrl=i,this.isUserLoggedInValue=n,this.formQuerySelector=r,this.debugEnabled=o,this.userAnswer=null,this.userAnswerTimestamp=null,this.htmlRootElement=null,this.dialogOpen=!1,this.intervalTimer=null,this.answerTimeSeconds=300,this.notificationType="form",this.lastSessionRefreshTime=this.currentTimestamp,this.isUserLoggedIn()&&(this.notificationType="login",this.startSessionRefreshTimer()),this.initializeFormEventListeners(),this.debugLog("Constructor finished")},[{key:"debugLog",value:function(e){this.debugEnabled&&console.debug("SessionRefreshDialog:",e)}},{key:"answerTime",get:function(){return this.answerTimeSeconds}},{key:"currentTimestamp",get:function(){return Math.round(Date.now()/1e3)}},{key:"sessionLifeTime",get:function(){return this.debugEnabled?30:this.sessionLifeTimeValue}},{key:"isSessionExpired",value:function(){return this.debugLog("isSessionExpired(): Session will expire in "+(this.sessionExpireTimestamp-this.currentTimestamp)+" seconds, at "+this._timeFromTimestamp(this.sessionLifeTime+this.lastSessionRefreshTime)),this.sessionLifeTime+this.lastSessionRefreshTime<this.currentTimestamp}},{key:"sessionExpireTimestamp",get:function(){return this.sessionLifeTime+this.lastSessionRefreshTime}},{key:"startSessionRefreshTimer",value:function(){var e=this;if(this.promptForSessionRefresh=!0,null===this.intervalTimer){var t=e.periodicalInterval;this.debugLog("startSessionRefreshTimer() starting. Periodical interval is "+t+" seconds, periodicalExecuter() will trigger at "+this._timeFromTimestamp(this.currentTimestamp+t)+" - session will expire at "+this._timeFromTimestamp(this.sessionExpireTimestamp)),this.intervalTimer=setInterval(function(){e.periodicalExecuter()},1e3*t)}}},{key:"periodicalInterval",get:function(){var e=Math.max(10,this.sessionLifeTime-this.answerTime);return this.debugLog("periodicalInterval() returning ",e),e}},{key:"stopSessionRefreshTimer",value:function(){clearInterval(this.intervalTimer),this.intervalTimer=null}},{key:"periodicalExecuter",value:function(){if(this.isSessionExpired())return this.debugLog("periodicalExecuter(): Session is expired, showing expired dialog instead of the refresh dialog"),void("expired"!==this.dialogOpen&&(this.hideDialog(),this.showDialog("expired")));this.promptUser(),!0===this.userAnswer||!1===this.dialogOpen?(this.debugLog("periodicalExecuter(): User answer is yes, about to refresh session"),this.refreshSession(),this.debugLog("periodicalExecuter(): Refreshed session, will run again at "+this._timeFromTimestamp(this.currentTimestamp+this.periodicalInterval)+" - session will expire at "+this._timeFromTimestamp(this.sessionExpireTimestamp))):this.debugLog("periodicalExecuter() NOT refreshing session at this stage")}},{key:"promptUser",value:function(){this.mustPromptUser()&&!1===this.dialogOpen?(this.debugLog("promptUser() re-setting user answer and showing dialog"),this.userAnswer=null,!1===this.dialogOpen?this.showDialog():this.debugLog("promptUser() dialog was already open")):this.debugLog("promptUser() 
1NOT showing dialog as mustPromptUser() returns false or dialog is already open")}},{key:"userAnswerYes",value:function(){this.debugLog("User answered yes"),this.userAnswer=!0,this.userAnswerTimestamp=this.currentTimestamp,this.refreshSession(),this.hideDialog()}},{key:"userAnswerNo",value:function(){this.debugLog("User answered no"),this.userAnswer=!1,this.stopSessionRefreshTimer(),this.hideDialog()}},{key:"userAnswerReloadPage",value:function(){this.debugLog("User answered reload page"),history.go(0)}},{key:"userAnswerCloseDialog",value:function(){this.debugLog("User answered close dialog, simply call userAnswerNo()"),this.userAnswerNo()}},{key:"showDialog",value:function(e){var t=this,i=new XMLHttpRequest;"expired"!=e&&(e="refresh");var n=this.serviceBaseUrl+"?service=user.session.refreshdialog&type="+e+"&notificationtype="+this.notificationType;this.debugLog("showDialog(): starting and requesting the dialog html from url ["+n+"]"),i.open("GET",n,!0),t.dialogOpen=e,i.onreadystatechange=function(e){4===i.readyState&&(200===i.status?t.createDialog(i.responseText):console.error("Something went wrong when calling xhr service for session refresh"))},i.send()}},{key:"hideDialog",value:function(){null!==this.htmlRootElement&&(document.body.removeChild(this.htmlRootElement),this.htmlRootElement=null),this.dialogOpen=!1}},{key:"createDialog",value:function(e){var t=this;this.htmlRootElement=document.getElementById("session-refreshdialog-root"),null===this.htmlRootElement&&(this.htmlRootElement=document.createElement("div"),this.htmlRootElement.id="session-refreshdialog-root",this.htmlRootElement.classList.add("session-refreshdialog-root"),document.body.appendChild(this.htmlRootElement),this.htmlRootElement.addEventListener("click",function(e){if("BUTTON"===e.target.tagName)switch(e.target.getAttribute("id")){case"sessionrefresh-btn_yes":t.userAnswerYes();break;case"sessionrefresh-btn_no":t.userAnswerNo();break;case"sessionrefresh-btn_reload":t.userAnswerReloadPage();break;case"sessionrefresh-btn_close":t.userAnswerCloseDialog()}})),this.htmlRootElement.innerHTML=e,this.setDialogFocus(),this.assignEscapeKeyListener()}},{key:"setDialogFocus",value:function(){var e=this.htmlRootElement.querySelector("button.initfocus");null!==e&&setTimeout(function(){e.focus()},200)}},{key:"assignEscapeKeyListener",value:function(){var e=this;document.addEventListener("keyup",function(t){27===t.keyCode&&(e.userAnswerNo(),e.debugLog("Closing dialog after escape key press, which means user answered no."))})}},{key:"mustPromptUser",value:function(){if(null===this.userAnswer)return this.debugLog("mustPromptUser(): User will be prompted since never prompted before, return true"),!0;var e=10*Math.max(this.sessionLifeTime-this.answerTime,10);return this.userAnswerTimestamp+e<=this.currentTimestamp?(this.debugLog("mustPromptUser(): User will be prompted now as "+(this.userAnswerTimestamp+e)+" <= "+this.currentTimestamp),!0):(this.debugLog("mustPromptUser(): User will be prompted again in "+(this.userAnswerTimestamp+e-this.currentTimestamp)+" seconds, return false"),!1)}},{key:"refreshSession",value:function(){var e=new XMLHttpRequest,t=this,i=this.serviceBaseUrl+"?service=user.session.refresh";e.open("GET",i,!0),e.onreadystatechange=function(n){4===e.readyState&&(200!==e.status&&console.error("Something went wrong when calling xhr service ["+i+"] for session refresh",t),t.lastSessionRefreshTime=t.currentTimestamp,t.debugLog("refreshSession(): successfully requested ["+i+"] "))},e.send()}},{key:"isUserLoggedIn",value:function(){return this.isUserLoggedInValue}},{key:"setIsUserLoggedIn",value:function(e){this.isUserLoggedInValue=e}},{key:"initializeFormEventListeners",value:function(){var e=this,t=function(){setTimeout(function(){e.addEventListerToForms()},100)};"complete"===document.readyState?(this.debugLog("initializeFormEventListeners(): Document readystate is complete, running immediately"),t.call()):(document.addEventListener("DOMContentLoaded",t),this.debugLog("initializeFormEventListeners(): scheduling domcontentloaded event listener"))}},{key:"addEventListerToForms",value:function(){var e=this;this.debugLog("addEventListerToForms() running");for(var t="undefined"!=typeof CtEditor?Object.keys(CtEditor.ctEditors):[],i=[],n=this.findForms(),r=0;r<n.length;r++){var o=n[r];Array.from(o.querySelectorAll('input:not([type="hidden"]), textarea, select')).forEac
1h(function(n){!1===n.dataset.hasOwnProperty("sessiontimer")&&(n.addEventListener("input",e.onFormElementChange.bind(e,n),!0),n.dataset.sessiontimer=1),e.debugEnabled&&(n.placeholder=n.placeholder="sessionrefresh listener added"),t.includes(n.id)&&(e.debugLog("addEventListerToForms() add editor "+n.id),i.push(n))})}i.forEach(function(t){!1===CtEditor.ctEditors[t.id].editor.hasOwnProperty("sessiontimer")&&(CtEditor.ctEditors[t.id].editor.on("change",e.onFormElementChange.bind(e,t)),CtEditor.ctEditors[t.id].editor.sessiontimer=1)})}},{key:"findForms",value:function(){for(var e=document.querySelectorAll(this.formQuerySelector),t=[],i=0;i<e.length;i++){var n=e[i];"post"==n.method&&t.push(n)}return t}},{key:"onFormElementChange",value:function(e){this.debugLog("onFormElementChange():  input event raised for element "+e.name+", calling startSessionRefreshTimer() and setting user answer to yes so next refresh will be done automatically"),this.debugEnabled&&e.animate&&e.animate([{opacity:.8},{opacity:.4},{opacity:0}],400),this.notificationType="form",this.startSessionRefreshTimer(),this.userAnswer=!0,this.userAnswerTimestamp=this.currentTimestamp}},{key:"_timeFromTimestamp",value:function(e){var t=new Date(1e3*e),i=t.getHours(),n="0"+t.getMinutes(),r="0"+t.getSeconds();return i+":"+n.substr(-2)+":"+r.substr(-2)}}]);if("function"==typeof window.CustomEvent){var evt=new CustomEvent("sessionrefresh.loaded");window.dispatchEvent(evt)}else if("function"==typeof window.CpCreateCustomEvent){var evt=CpCreateCustomEvent("sessionrefresh.loaded");window.dispatchEvent(evt)}

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.