PageSourceSearch

https://sol.no/view-resources/baseview/public/common/build/baseview_dependencie_modules.js?v=25

js sol.no collected 2026-10-01 11:36:56 UTC 407,258 bytes, 8 lines download raw bytes

1/*!
2* Common client JS-dependencies
3* (c) Labrador CMS AS
4* Licence required for usage
5* https://labradorcms.com
6*/
7var e={
7"./build/modules/client_modules.js":(e,t,i)=>{i.r(t),i.d(t,{Entry:()=>E,behaviours:()=>r});var a={d:(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};a.r(r),a.d(r,{adnuntiusAd:()=>M,article:()=>k,googleAd:()=>$,image:()=>P,livefeed:()=>C,notice:()=>T,page_article:()=>b,page_front:()=>y});class s{static getSiteStyles(e,t=[]){const i=lab_api.v1.config.get(`site_styles.${e}`)||t;return Sys.logger.debug(`ViewSupport: Found ${Array.isArray(i)?i.length:0} stylesheet(s) for site "${e}".`),i}static getSiteStylesWithFallback(e,t=[]){const i=this.getSiteStyles(e,null);if(null===i){t.push(e);const i=lab_api.v1.config.get("lab_fallback_site",{site:e});if(i&&!t.includes(i))return this.getSiteStylesWithFallback(i,t)}return i||[]}static getSiteScripts(e,t,i){const a=this.filterScriptListByPageType(lab_api.v1.config.get(`site_scripts.${e}`)||[],t,i);return Sys.logger.debug(`ViewSupport: Found ${a.length} script-path(s) for site "${e}".`),a}static getSiteScriptsWithFallback(e,t,i,a=[]){let r=this.getSiteScripts(e,t,i);if(a.length&&(r=this.removeWithInheritFalse(r)),!r.length){a.push(e);const r=lab_api.v1.config.get("lab_fallback_site",{site:e});if(r&&!a.includes(r))return this.getSiteScriptsWithFallback(r,t,i,a).filter(e=>!1!==e.inherit)}return r}static getCommonScripts(e,t,i=!1){const a=this.filterScriptListByPageType(lab_api.v1.config.get("site_scripts_common")||[],e,t,i);return Sys.logger.debug(`ViewSupport: Found ${a.length} common ${i?"script-path(s)":"JS modules"}`),a}static filterScriptListByPageType(e,t,i,a=!1){return e.filter(e=>(!e.isModule&&!a||e.isModule&&a)&&(!e.pageType||e.pageType===t)&&(!i||i&&!e.skipEditor))}static removeWithInheritFalse(e){return Array.isArray(e)&&e.length>0?e.filter(e=>!1!==e.inherit):e}static getSiteFilesForContentboxes(e,t,i,a=[]){const r=[],s=lab_api.v1.model.query.getModelTypes();Sys.logger.debug(`ViewSupport sitefiles: Will register ${i}-file(s) for contentbox-types ${s.join(", ")}.`);for(const e of s){const t=lab_api.v1.config.get(`contentbox_settings.${e}.require.${i}`);if(Array.isArray(t))for(const s of t)r.includes(s)||a.includes(s)||(Sys.logger.debug(`ViewSupport sitefiles: Will include ${i}-file "${s}" for contentbox "${e}".`),r.push(s))}return Sys.logger.debug(`ViewSupport sitefiles: Finished registering ${i}-file(s). Found ${r.length} file(s).`),r}}class n{constructor(e){this.api=e,this.pageType=this.api.v1.model.root.getType()}get media(){return{getLogo:(e=this.api.v1.viewport.getName())=>{const t=this.api.v1.config.get("logo")||{},i=t.default||{},a=t.mobile||t.default||{},r=t.mainLogo||{},s=t.secondaryLogo||{},n=t.mobileLogo||{},o=t.mailmojoLogo||{},[l,d,c]=[{data:r,legacy:t,uploadedKey:"uploadedFileUrl",widthKey:"logoWidth",heightKey:"logoHeight",hrefKey:"logoHref",altTextKey:"logoAltText",defaultObj:i},{data:s,legacy:t,uploadedKey:"uploadedSecondaryFileUrl",widthKey:"secondaryLogoWidth",heightKey:"secondaryLogoHeight",hrefKey:"secondaryLogoHref",altTextKey:"secondaryLogoAltText",defaultObj:i},{data:n,legacy:t,uploadedKey:"uploadedMobileFileUrl",widthKey:"mobileLogoWidth",heightKey:"mobileLogoHeight",hrefKey:"mobileLogoHref",altTextKey:"mobileLogoAltText",defaultObj:a}].map(({data:i,legacy:a,uploadedKey:r,widthKey:s,heightKey:n,hrefKey:o,altTextKey:l,defaultObj:d})=>{const c=i[r]||a[r]||i.src,g=t[e]||t.default||{},p=g.size||{},u=i[s]||a[s]||i.size&&i.size.width,h=i[n]||a[n]||i.size&&i.size.height,f=u||h,m=f?{width:u,height:h}:{width:p.width,height:p.height};let b;return c?b={src:c,href:i[o]||a[o]||i.href||d.href,type:"img",size:m,title:i[l]||a[l]||i.title||d.title,altText:i[l]||a[l]||i.altText||null,isCustom:!0}:(b=g.src?g:null,b&&f&&(b={src:b.src,href:b.href,type:b.type,size:m,title:b.title,altText:b.altText||null})),b&&("img"===b.type?b.is_img=!0:"svg"===b.type&&(b.is_svg=!0)),b}),g=r.uploadedFileUrl||t.uploadedFileUrl||r.src,p=g?{src:g,href:r.logoHref||t.logoHref||i.href,size:{width:r.logoWidth||t.logoWidth,height:r.logoHeight||t.logoHeight},title:r.logoAltText||t.logoAltText||i.title,isCustom:!0}:t.standalone||t.mailmojo||null,u=o.uploadedMailmojoFileUrl||t.uploadedMailmojoFileUrl||o.src;return{current:l,sm:p,mm:u?{src:u,href:o.mailmojoLogoHref||t.mailmojoLogoHref||i.href,size:{width:o.mailmojoLogoWidth||t.mailmojoLogoWidth,height:o.mailmojoLogoHeight||t.mailmojoLogoHeight},title:o.mailmojoLogoAltText||t.mailmojoLogoAltText||i.title,isCustom:!0}:t.mailmojo||t.standalone||null,secondary:d,mobile:c||l}}}}get menus(){return{get:({section:e,defaultSection:t}={},i)=>{const a={},r=Object.values(this.api.v1.config.get("menus")||{});if(r.length<1)return null;const s=i=>
7{i.forEach(i=>{i.selected=i.section===e||i.section===t,"target"in i||(i.target="_self"),"selector"in i||(i.selector=""),"children"in i||(i.children=[]),i.children.length>0&&(i.hasChildren=!0,s(i.children))})};return r.forEach(e=>{s(e.menuItems);const t=e.type||e.menuName;a[t]={items:e.menuItems,type:e.type,selector:e.selector||"",menuName:e.menuName||"",showMenuName:e.showMenuNameOnDesktop||e.showMenuNameOnMobile||!1,showMenuNameOnDesktop:e.showMenuNameOnDesktop||"",showMenuNameOnMobile:e.showMenuNameOnMobile||""}}),i?a[i]:a}}}get misc(){return{}}get resources(){const e={required:[],getProgressReader:()=>(e.required.push({url:"/view-resources/public/common/ReadProgress.js",requireDom:!1}),{active:!0,minElementCount:lab_api.v1.config.get("displayReadProgress.minElementCount")||25}),getSiteFiles(t,i,a,r,n){const o=s.getSiteScriptsWithFallback(a,r,n),l=s.getCommonScripts(r,n);return e.required.push(...o,...l),{js:s.getSiteFilesForContentboxes(t,i,"js",e.required.map(e=>e.url)),css:s.getSiteFilesForContentboxes(t,i,"css")}},getModules:(e,t,i,a,r)=>s.getCommonScripts(a,r,!0)},t={get:e=>{const i=(lab_api.v1.config.get("analytics.kilkaya")||[]).map(e=>{const t={...e};return t.id&&"string"==typeof t.id&&t.id.trim().endsWith(".js")&&(t.url=t.id),t});let a=this.api.v1.config.get("analytics.adnuntiusConnect");a&&"object"==typeof a&&!Array.isArray(a)&&Object.keys(a).length&&(a=new Array(a));const r={google:this.api.v1.config.get("analytics.google.tracking_id"),google_gtm:this.api.v1.config.get("analytics.google.gtm"),comscore:this.api.v1.config.get("analytics.comscore.comscore_id"),adnuntiusConnect:a,adnuntiusConnectCMP:this.api.v1.config.get("analytics.adnuntiusConnectCMP"),kilkaya:i,kilkayaSettings:this.api.v1.config.get("analytics.kilkayaSettings"),io:this.api.v1.config.get("analytics.io.tracking_id")},s=t.getDataLayer(e);return s.dataLayer&&(r.dataLayer=s.dataLayer),s.usesJWTCookieData&&(r.usesJWTCookieData=s.usesJWTCookieData),r},getDataLayer:e=>{const t=this.api.v1.config.get("analytics.google.dataLayer");let i=!1;if(t&&Array.isArray(t)&&t.length){t.forEach(t=>{let a=null;switch(t.source){case"fixed":a=(t.value||"").trim();break;case"config":a=this.api.v1.properties.get(t.value);break;case"jwtcookie":t.isJWTCookie=!0,a=t.value,i=!0;break;case"article_authors":a=`${(e.bylinesStringCommaSeparated||"").replace(/"/g,"")}`;break;case this.pageType.replace("page_",""):a=this.api.v1.model.query.getRootModel().get(t.value);break;default:Sys.logger.warn(`Unsupported dataLayer source: "${t.source}"`)}t.value=null===a?"":a.toString()});const a=t.map(e=>e.value.length>0).lastIndexOf(!0);t[a]&&(t[a].last=!0)}return{dataLayer:t,usesJWTCookieData:i}}};return{scripts:e,analytics:t}}get settings(){return{get:(e={})=>{const t=this.api.v1.config.get(`page_settings.${e.pageType}.social.display`)||{},i=this.api.v1.model.query.getRootModel().get("fields.show_social_bodytext_before"),a=this.api.v1.model.query.getRootModel().get("fields.show_social_bodytext_after"),r=this.api.v1.model.query.getRootModel().get("fields.show_social_header");null!==i&&(t.bodytext_before=!!i),null!==a&&(t.bodytext_after=!!a),null!==r&&(t.header=!!r);const s=this.api.v1.config.get(`page_settings.${e.pageType}.social.items`)||{},n=this.api.v1.config.get(`page_settings.${e.pageType}.showTags`),o={"fi-social-facebook":"facebook","fi-social-twitter":"twitter","fi-social-linkedin":"linkedin","fi-social-whatsapp":"whatsapp","fi-mail":"email","fi-social-telegram":"telegram","fi-social-copyLink":"system"},l=Object.keys(s).filter(e=>!!s[e].display).map(t=>{const i=s[t].icon||"";return{name:t,icon:i,url:e.socialLinks[t]||"",shareText:this.api.v1.locale.get(`socialMedia.shareText.${t}`,{noRender:!0,fallbackValue:""}),isButton:s[t].isButton||!1,ampType:o[i]||"",telegram:"telegram"===t,twitter:"twitter"===t,whatsapp:"whatsapp"===t,email:"email"===t}});return{page_type:e.pageType,social:{display:{bodytext_before:l.length>0&&!!t.bodytext_before,bodytext_after:l.length>0&&!!t.bodytext_after,header:l.length>0&&!!t.header},items:l},showTags:!1!==n}}}}}class o{static getStyleDefinitions(e){const t=e.v1.properties.get("site.alias"),i=e.v1.config.get("style_definitions",t),a=[];
7(i.rules||[]).forEach(e=>a.push(e)),(i.fontface||[]).forEach(e=>{const t=`.font-${(Array.isArray(e.family)?e.family[0]:e.family).replace(/ /g,"")}`;a.push(o.getFamilyDefinition(t,e.family));const i={light:{keys:["light","200","100","300"],used:!1},normal:{keys:["regular","normal","400","500"],used:!1},bold:{keys:["bold","600","700"],used:!1},black:{keys:["black","800","900"],used:!1}};e.variants.forEach(e=>{for(const r of Object.keys(i)){const s=i[r];s&&!s.used&&s.keys.indexOf(e)>-1&&(a.push(o.getWeightDefinition(t,e,r)),s.used=!0)}})});const r={fontface:i.fontface||[],parsedRules:o.CSSRuleParser(a)};return r.hasRules=!!r.parsedRules.length,r}static getFamilyDefinition(e,t){return{selector:e,declarations:[{key:"font-family",value:(Array.isArray(t)?`${t.map(e=>`"${e}"`).join(", ")}`:`"${t}"`)+" !important"}]}}static getWeightDefinition(e,t,i){let a=t;return"regular"===t&&(a="normal"),{selector:`${e}.font-weight-${i}`,declarations:[{key:"font-weight",value:`${a} !important`}]}}static CSSRuleParser(e){const t=[];return e.forEach(e=>{let i,a,r=`${e.selector} { `;e.declarations.forEach(e=>{"font-size-desktop"===e.key?"default"!==e.value&&(r+=`font-size: ${e.value.slice(0,-2)/16}rem; `):"font-size-mobile"===e.key?"default"!==e.value&&(i=`calc(0.262vw * ${e.value.slice(0,-2)})`):"line-height-desktop"===e.key?"default"!==e.value&&(r+=`line-height: ${e.value}; `):"line-height-mobile"===e.key?"default"!==e.value&&(a=e.value):"font-family"===e.key?e.value.includes("!important")?r+=`${e.key}: ${e.value}; `:r+=`${e.key}: "${e.value}"; `:"color"===e.key||"text-transform"===e.key||"text-decoration"===e.key?"default"!==e.value&&(r+=`${e.key}: ${e.value}; `):r+=`${e.key}: ${e.value}; `}),r+="}",(i||a)&&(r+=`@media (max-width: 767px) { .resp_fonts ${e.selector} {`,i&&(r+=`font-size: ${i}; `),a&&(r+=`line-height: ${a}; `),r+="} }"),t.push(r)}),t}static getInlineCSS(e,t){return[{key:"custom_properties",value:e.v1.config.get("css_build.custom_properties",{site:t})||""},{key:"background_colors",value:e.v1.config.get("css_build.background_colors",{site:t})||""},{key:"background_colors_opacity",value:e.v1.config.get("css_build.background_colors_opacity",{site:t})||""},{key:"border_colors",value:e.v1.config.get("css_build.border_colors",{site:t})||""},{key:"font_colors",value:e.v1.config.get("css_build.font_colors",{site:t})||""},{key:"image_gradient",value:e.v1.config.get("css_build.image_gradient",{site:t})||""}]}static getCssVariables(e){const t=e.v1.config.get("custom_css_variables")||{},i={no_viewport:[],desktop:[],mobile:[]};for(const e of Object.keys(t))for(const a of Object.keys(t[e]))i[a].push({key:e,value:(t[e][a]||{}).value});return i}}class l{constructor(e="en",t="en"){this.fallbackLanguage=t,this.language=e||t,this.timezone=this.getTimezone(),this.ianaTimezone=lab_api.v1.config.get("iana_timezone")||null}getTimezone(){const e=lab_api.v1.config.get("timezone");return void 0===e||Number.isNaN(e)||Number.isNaN(parseFloat(e))?1:parseInt(e,10)}str(e){return lab_api.v1.locale.get(`dates.${e}`,{noRender:!0})}format(e,t){return Mustache.render(t,{YYYY:()=>e.getFullYear(),YY:()=>`${e.getFullYear()}`.slice(-2),MM:()=>(e.getMonth()<9?"0":"")+(e.getMonth()+1),M:()=>e.getMonth()+1,D:()=>e.getDate(),DD:()=>(e.getDate()<10?"0":"")+e.getDate(),H:()=>e.getHours(),HH:()=>(e.getHours()<10?"0":"")+e.getHours(),m:()=>e.getMinutes(),mm:()=>(e.getMinutes()<10?"0":"")+e.getMinutes(),s:()=>e.getSeconds(),ss:()=>(e.getSeconds()<10?"0":"")+e.getSeconds(),dddd:()=>this.weekday(e,!1),ddd:()=>this.weekday(e,!1,3),MMMM:()=>this.monthName(e,!1),MMM:()=>this.monthName(e,!1,3),W:()=>this.weekNumber(e,!0,!0),WW:()=>this.weekNumber(e,!0,!1)})}utcFormat(e,t){const i=this.correctDate(e);return Mustache.render(t,{YYYY:()=>i.getUTCFullYear(),YY:()=>`${i.getUTCFullYear()}`.slice(-2),MM:()=>(i.getUTCMonth()<9?"0":"")+(i.getUTCMonth()+1),M:()=>i.getUTCMonth()+1,D:()=>i.getUTCDate(),DD:()=>(i.getUTCDate()<10?"0":"")+i.getUTCDate(),H:()=>i.getUTCHours(),HH:()=>(i.getUTCHours()<10?"0":"")+i.getUTCHours(),h:()=>this.twelveHourClock(i),hh:()=>this.twelveHourClock(i,!0),m:()=>i.getUTCMinutes(),mm:()=>(i.getUTCMinutes()<10?"0":"")+i.getUTCMinutes(),s:()=>i.getUTCSeconds(),ss:()=>(i.getUTCSeconds()<10?"0":"")+i.getUTCSeconds(),a:()=>i.getUTCHours()<12?"a.m.":"p.m.",A:()=>i.getUTCHours()<12?"A.M.":"P.M.",dddd:()=>this.weekday(i,!0),ddd:()=>this.weekday(i,!0,3),MMMM:()=>this.monthName(i,!0),MMM:()=>this.monthName(i,!0,3),W:()=>this.weekNumber(i,!0,!0),WW:()=>this.weekNumber(i,!0,!1)})}formattedDate(e,t,i=!0,a=!0){let r=t||"";return r=r.replace("Y",e.getFullYear()),r=r.replace("m",(i&&e.getMonth()<9?"0":"")+(e.getMonth()+1)),r=r.replace("d",(i&&e.getDate()<10?"0":"")+e.getDate()),r=r.replace("H",(a&&e.getHours()<10?"0":"")+e.getHours()),r=r.replace("i",(a&&e.getMinutes()<10?"0":"")+e.getMinutes()),r=r.replace("s",e.getSeconds()),r
7=r.replace("l",this.weekday(e,!1)),r=r.replace("D",this.weekday(e,!1,3)),r=r.replace("F",this.monthName(e,!1)),r=r.replace("M",this.monthName(e,!1,3)),r}formattedUtcDate(e,t,i=!0,a=!0){const r=this.correctDate(e);let s=t||"";return s=s.replace("Y",r.getUTCFullYear()),s=s.replace("m",(i&&r.getUTCMonth()<9?"0":"")+(r.getUTCMonth()+1)),s=s.replace("d",(i&&r.getUTCDate()<10?"0":"")+r.getUTCDate()),s=s.replace("H",(a&&r.getUTCHours()<10?"0":"")+r.getUTCHours()),s=s.replace("i",(a&&r.getUTCMinutes()<10?"0":"")+r.getUTCMinutes()),s=s.replace("s",r.getUTCSeconds()),s=s.replace("l",this.weekday(r,!0)),s=s.replace("D",this.weekday(r,!0,3)),s=s.replace("F",this.monthName(r,!0)),s=s.replace("M",this.monthName(r,!0,3)),s}getUtcOffsetMinutes(e,t){const i=new Date(6e4*Math.floor(t.getTime()/6e4)),a=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1,hourCycle:"h23"}).formatToParts(i),r=Object.fromEntries(a.map(e=>[e.type,parseInt(e.value)]));24===r.hour&&(r.hour=0);const s=new Date(Date.UTC(r.year,r.month-1,r.day,r.hour,r.minute)).getTime()-i.getTime();return Math.round(s/6e4)}getEffectiveOffset(e){return this.ianaTimezone&&"undefined"!=typeof Intl?this.getUtcOffsetMinutes(this.ianaTimezone,e)/60:this.isSummerTime(e)?this.timezone+1:this.timezone}correctDate(e){return this.manipulateTime(e,this.getEffectiveOffset(e))}utcDate(e){return this.unmanipulateTime(e,this.getEffectiveOffset(e))}timestampToDate(e){return new Date(1e3*e)}toTimestamp(e){return Math.round(e.getTime()/1e3)}parseDate(e){const t=e.substr(0,4),i=e.substr(4,2)-1,a=e.substr(6,2),r=new Date(t,i,a),s=r.getFullYear()==t,n=r.getMonth()==i,o=r.getDate()==a;return s&&n&&o?r:"invalid date"}weekday(e,t=!1,i=9){return([this.str("sunday"),this.str("monday"),this.str("tuesday"),this.str("wednesday"),this.str("thursday"),this.str("friday"),this.str("saturday")][t?e.getUTCDay():e.getDay()]||"").substr(0,i)}monthName(e,t=!1,i=10){return([this.str("january"),this.str("february"),this.str("march"),this.str("april"),this.str("may"),this.str("june"),this.str("july"),this.str("august"),this.str("september"),this.str("october"),this.str("november"),this.str("december")][t?e.getUTCMonth():e.getMonth()]||"").substr(0,i)}weekNumber(e,t=!1,i=!0){const a=new Date(e.valueOf()),r=((t?e.getUTCDay():e.getDay())+6)%7;a.setDate(a.getDate()-r+3);const s=a.valueOf();a.setMonth(0,1),4!==a.getDay()&&a.setMonth(0,1+(4-a.getDay()+7)%7);const n=1+Math.ceil((s-a)/6048e5);return(!i&&n<10?"0":"")+n}timestampToNiceDate(e,t=!1){const i={ago:t?"":this.str("ago"),now:this.str("now"),minute:t?this.str("min"):this.str("minutes"),minutes:t?this.str("min"):this.str("minutes"),hour:this.str("hour"),hours:this.str("hours"),day:this.str("day"),days:this.str("days")},a=(new Date).getTime(),r=new Date(1e3*e).getTime()-0,s=parseInt((a-r)/1e3/60,10);return s<60?s<1?i.now:1==s?`1 ${i.minute} ${i.ago}`:`${s} ${i.minutes} ${i.ago}`:s<1440?1==parseInt(s/60,10)?`1 ${i.hour} ${i.ago}`:`${parseInt(s/60,10)} ${i.hours} ${i.ago}`:parseInt(s/1440,10)<30?1==parseInt(s/1440,10)?`1 ${i.day} ${i.ago}`:`${parseInt(s/1440,10)} ${i.days} ${i.ago}`:this.format(this.timestampToDate(e),this.str("monthdayyear"))}isSummerTime(e){function t(e,t){const i=new Date,a=new Date(Date.UTC(t||i.getFullYear(),e+1,0)),r=a.getDay();return new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()-r))}const i=e||new Date,a=t(2,i.getFullYear());a.setHours(1);const r=t(9,i.getFullYear());return a.setHours(1),i.getTime()>=a.getTime()&&i.getTime()<r.getTime()}manipulateTime(e,t){return new Date(e.getTime()+60*t*60*1e3)}unmanipulateTime(e,t){return new Date(e.getTime()-60*t*60*1e3)}formatRfc2822(e){if(!e&&0!==e)return"";let t;if(t="number"==typeof e||/^\d+$/.test(String(e))?new Date(1e3*parseInt(e,10)):new Date(e),Number.isNaN(t.getTime()))return"";const i=Math.round(60*this.getEffectiveOffset(t)),a=new Date(t.getTime()+60*i*1e3),r=e=>e<10?`0${e}`:`${e}`,s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][a.getUTCDay()],n=r(a.getUTCDate()),o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getUTCMonth()],l=a.getUTCFullYear(),d=r(a.getUTCHours()),c=r(a.getUTCMinutes()),g=r(a.getUTCSeconds()),p=i>=0?"+":"-",u=Math.abs(i);return`${s}, ${n} ${o} ${l} ${d}:${c}:${g} ${p}${r(Math.floor(u/60))}${r(u%60)}`}twelveHourClock(e,t=!1){const i=e.getUTCHours();let a;return 0===i||12===i?a=12:(a=i<12?i:i-12,t&&a<10&&(a=`0${a}`)),a}}class d{static getAdnuntiusSettings(e,t,i,a,r,s=!1,n=!1){Sys.logger.debug(`[AdsHelper.getAdnuntiusSettings] Called with disableSkyscraper=${s}, disableTopBanner=${n}`);const o=(e.v1.config.get("contentbox_settings.adnuntiusAd.bidding")||{}).enabled||!1;function d(e,t){let i="";return o&&e.prebidConfig&&(i=JSON.parse(e.prebidConfig),Array.isArray(i)&&([i]=i),i=JSON.stringify(i)),{...e,prebidConfig:i,metadata:t.metadata||[]}}const c=e.v1.config.get("contentbox_settings.adnuntiusAd.formats")||[],g=e.v1.config.getView(`insertDynamic.${e.v1.model.root.getType().replace("page_","")}.${i.getViewport()}`,r.alias)||[],p=e.v1.model.query.getChildrenOfType(t,"adnuntiusAd",!0,!0),u=[];for(const e of g){const[t]=c.filter(t=>e.content_data.fields.format===t.format);t&&(!1===e.placement.key.includes("skyscraper_")&&"topbanner"!==e.placement.key||e.placement.key.includes("skyscraper_")&&!s||"topbanner"===e.placement.key&&!n)&&u.push(d(t,e))}for(const e of p){const[t]=c.filter(t=>e.get("fields.format")===t.format);t&&u.push(d(t,e))}const h=(new l).utcFormat(new Date,"&tag=week_{{ W }}_{{ YYYY }}");return{enabled:c.length>0,lazyload:e.v1.config.get("contentbox_settings.adnuntiusAd.lazyload")||!1,adUnits:u,spacingTop:e.v1.config.get("contentbox_settings.adnuntiusAd.spacingTop")||120,fetchMarginPercent:a.fetchMarginPercent||150,renderMarginPercent:a.renderMarginPercent||150,mobileScaling:a.mobileScaling||2,bidding:{enabled:o},hideOnTabletWidth:a.hideOnTabletWidth||1316,refreshdelay:e.v1.config.get("contentbox_settings.adnuntiusAd.refreshdelay")||5,refreshcount:e.v
71.config.get("contentbox_settings.adnuntiusAd.refreshcount")||1,connectLoading:e.v1.config.get("contentbox_settings.adnuntiusAd.connectLoading")||!1,contkitEnabled:e.v1.config.get("contentbox_settings.adnuntiusAd.contkitEnabled")||!1,newsletter:{targeting:h}}}static getGoogleSettings(e,t,i,a,r,s=!1,n=!1){function o(e,t){const{sizes:i=[],fluid:a=!1}=e,r=i.map(e=>`[${e.width},${e.height}]`);return a&&r.push('"fluid"'),{...e,sizesString:`[${r.join(", ")}]`,metadata:t.metadata||[]}}Sys.logger.debug(`[AdsHelper.getGoogleSettings] Called with disableSkyscraper=${s}, disableTopBanner=${n}`);const l=e.v1.config.get("contentbox_settings.googleAd.formats")||[],d=e.v1.config.get("contentbox_settings.googleAd.anchor")||{enabled:!1,code:"",type:"TOP_ANCHOR"},c=e.v1.config.getView(`insertDynamic.${e.v1.model.root.getType().replace("page_","")}.${i.getViewport()}`,r.alias)||[],g=e.v1.model.query.getChildrenOfType(t,"googleAd",!0,!0),p=[];for(const e of c){const[t]=l.filter(t=>e.content_data.fields.format===t.format),i=e.placement.key,a=t&&(!1===i.includes("skyscraper_")&&"topbanner"!==i||i.includes("skyscraper_")&&!s||"topbanner"===i&&!n);Sys.logger.debug(`[AdsHelper.getGoogleSettings] Placement: ${i}, Format: ${t?t.format:"not found"}, ShouldInclude: ${a}`),a&&p.push(o(t,e))}Sys.logger.debug(`[AdsHelper.getGoogleSettings] Found ${g.length} manual Google Ad(s)`);for(const e of g){const[t]=l.filter(t=>e.get("fields.format")===t.format);t&&(Sys.logger.debug(`[AdsHelper.getGoogleSettings] Adding manual ad with format: ${t.format}`),p.push(o(t,e)))}return Sys.logger.debug(`[AdsHelper.getGoogleSettings] Final visibleUnits count: ${p.length}, formats: ${p.map(e=>e.format).join(", ")}`),{enabled:l.length>0,lazyload:a.lazyload||!1,spacingTop:e.v1.config.get("contentbox_settings.googleAd.spacingTop")||120,fetchMarginPercent:a.fetchMarginPercent||150,renderMarginPercent:a.renderMarginPercent||150,mobileScaling:a.mobileScaling||2,adUnits:p,anchor:d,dfpid:a.dfpid||!1,debugmode:a.debugmode||!1,disableInitialLoad:a.disableInitialLoad||!1,bidding:a.bidding,hideOnTabletWidth:a.hideOnTabletWidth||1316}}}class c{static buildImageUrl(e,t,i){const a=e.get("instance_of"),r=e.get("fields.imageurl");let s;if(!r||a&&!e.get("fields.forceImageUrl")){if(!a)return"";s=`${t}/?imageId=${a}`}else s=r;return i?s.includes("width=")?s.replace(/width=\d*/,`width=${i}`):`${s}${s.includes("?")?"&":"?"}width=${i}`:s}static buildAuthorSchema(e,t={}){const{imageServer:i="",shouldUseAuthorPageUrl:a,getAuthorPageUrl:r,getImageDimensions:s}=t;let n=e.get("fields.firstname");"Byline first name"===n&&(n="");let o=e.get("fields.lastname");"Byline last name"===o&&(o="");const l={"@type":"Person",name:`${n} ${o}`},d=e.get("fields.description");d&&(l.description=lab_api.v1.util.string.sanitizeString(d));const g=e.get("fields.job_title");if(g&&"Click to add job title"!==g&&(l.jobTitle=lab_api.v1.util.string.sanitizeString(g).trim()),a&&a(e))l.url=r(e);else{const t=e.get("fields.public_url");t&&(l.url=t)}const p=lab_api.v1.model.query.getChildrenOfType(e,"image",!0);if(p&&p.length>0){const e=p[0];if(l.image={"@type":"ImageObject",url:c.buildImageUrl(e,i,250)},s){const t=s(e,250);t&&(l.image.width=t.width,l.image.height=t.height)}}const u=e.get("fields.public_email");u&&(l.email=u);try{const t=[],i=e.get("fields.public_url");i&&t.push(i),t.length>0&&(l.sameAs=t)}catch(e){}return l}static buildPublisherSchema(e=""){const t=lab_api.v1.config.get("logo")||{},i=t.mainLogo||{};let a=lab_api.v1.config.get("seoSchema.publisherLogoUrl")||i.uploadedFileUrl||t.uploadedFileUrl||i.src||t.default&&t.default.src||"";!a||a.startsWith("http://")||a.startsWith("https://")||(a=`${e}${a.startsWith("/")?"":"/"}${a}`);const r=lab_api.v1.config.get("logo.logoWidth")||null,s=lab_api.v1.config.get("logo.logoHeight")||null;return{"@type":"Organization",name:lab_api.v1.properties.get("site.display_name"),url:e,logo:{"@type":"ImageObject",url:a,...r&&{width:r},...s&&{height:s}}}}static buildBroadcasterSchema(e=""){return{"@type":"BroadcastService",name:lab_api.v1.properties.get("site.display_name"),broadcaster:c.buildPublisherSchema(e)}}static buildArticleListItemList(e,t){return e&&0!==e.length?{"@type":"ItemList",itemListElement:e.map((e,i)=>{const a={"@type":"NewsArticle",headline:e.get("fields.title"),url:e.get("fields.published_url")||e.get("fields.url")},r=e.get("fields.someimage");if(r)a.image=`${t}/${r}.webp?width=1200&height=630`;else{const i=lab_api.v1.model.query.getChildrenOfType(e,"image",!0);i&&i.length>0&&(a.image=c.buildImageUrl(i[0],t,1200))}return{"@type":"ListItem",position:i+1,item:a}})}:null}static buildArticleListHasPart(e,t){return e&&0!==e.length?e.map(e=>{const i={"@type":"NewsArticle",headline:e.get("fields.title"),url:e.get("fields.published_url")||e.get("fields.url")},a=e.get("fields.someimage");if(a)i.image=`${t}/${a}.webp?width=1200&height=630`;else{const a=lab_api.v1.model.query.getChildrenOfType(e,"image",!0);a&&a.length>0&&(i.image=c.buildImageUrl(a[0],t,1200))}return i}):null}}class g{constructor({pageType:e="",canonical:t="",isTagpage:i=!1,isTagpageWithFrontpage:a=!1,tagpagePath:r="/tag/",publishedUrl:s=""}={}){this.settings={pageType:e,canonical:t,isTagpage:i,isTagpageWithFrontpage:a,tagpagePath:r,publishedUrl:s},this.cache={seoData:null},this.imageServer=lab_api.v1.properties.get("image_server"),this.domain=lab_api.v1.site.getSite().domain||lab_api.v1.properties.get("customer_front_url"),this.authorPagesConfig=lab_api.v1.config.get("authorPages")||{}}getStructuredData(e){if("front"===this.settings.pageType)return this.generateFrontData(e);if("gallery"===this.settings.pageType)return this.generateGalleryPageData(e);if("article"===this.settings.pageType||"notice"===this.settings.pageType){const t=e.get("fields.seoschematype")||"NewsArticle",i=[];if(["ImageGallery","VideoObject","BroadcastEvent","LiveBlogPosting","Recipe","PodcastEpisode","PodcastSeries"].includes(t)){let a=null;if("ImageGallery"===t?a=this.generateImageGalleryData(e):"VideoObject"===t?a=this.generateVideoObjectData(e):"BroadcastEvent"===t?a=this.generateBroadcastEventData(e):"LiveBlogPosting"===t?a=this.generateArticleData(e):"Recipe"===t?a=this.generateRecipeData(e):"PodcastEpisode"===t?a=this.generatePodcastEpisodeData(e):"PodcastSeries"===t&&(
7a=this.generatePodcastSeriesData(e)),!a)return null;if(i.includes(t)){const t=this.generateArticleData(e);return delete t.mainEntityOfPage,[t,a]}return a}return this.generateArticleData(e)}return null}generateSiteData(e){return{"@context":"http://schema.org","@type":"WebSite",name:lab_api.v1.properties.get("site.display_name"),url:lab_api.v1.properties.get("site.domain")||""}}getPublisherObject(){return c.buildPublisherSchema(this.domain)}getBroadcasterObject(){return c.buildBroadcasterSchema(this.domain)}getArticleImages(e,t=[]){const i=lab_api.v1.model.query.getChildrenOfType(e,"image",!0);if(0===t.length)return i;const a=new Set;return t.forEach(t=>{lab_api.v1.model.query.getChildrenOfType(e,t,!0).forEach(e=>{lab_api.v1.model.query.getChildrenOfType(e,"image",!0).forEach(e=>a.add(e.get("instance_of")))})}),i.filter(e=>!a.has(e.get("instance_of")))}calculateWordCount(e){return e?lab_api.v1.util.string.stripTags(e).trim().split(/\s+/).filter(e=>e.length>0).length:0}calculateTimeRequired(e){return e&&0!==e?`PT${Math.ceil(e/200)}M`:"PT1M"}getImageDimensions(e,t){let i=parseFloat(e.get("fields.whRatio"));if(!i||isNaN(i)){const t=parseInt(e.get("fields.originalWidth"),10),a=parseInt(e.get("fields.originalHeight"),10);if(!(t&&a&&t>0))return null;i=a/t}return{width:t,height:Math.round(t*i)}}buildArticleImageObjects(e){const t=this.getArticleImages(e,["byline"]).map((e,t)=>{const i=c.buildImageUrl(e,this.imageServer,1200),a=this.getImageDimensions(e,1200),r={"@type":"ImageObject",url:i};return 0===t&&(r["@id"]=`${this.settings.publishedUrl}#primaryimage`),a&&(r.width=a.width,r.height=a.height),r});if(0===t.length){const t=e.get("frontCrop"),i=t&&t.pano&&t.pano.instance_of;if(i)return[{"@type":"ImageObject","@id":`${this.settings.publishedUrl}#primaryimage`,url:`${this.imageServer}/${i}.webp?width=1200`}]}return t}shouldUseAuthorPageUrl(e){const t=e.get("fields.public_email"),i=e.get("fields.email"),a=e.get("instance_of");if(this.authorPagesConfig.enabled&&(t||i)&&a){if(this.authorPagesConfig.enableForAll)return!0;if(this.authorPagesConfig.enabledAuthorIds&&this.authorPagesConfig.enabledAuthorIds.split(",").map(e=>parseInt(e.trim(),10)).includes(a))return!0}return!1}getAuthorPageUrl(e){const t=e.get("instance_of"),i=e.get("instance_of_json")?JSON.parse(e.get("instance_of_json")):void 0,a=i&&i.fields&&i.fields.slug?i.fields.slug:void 0;return`${this.domain}/${this.authorPagesConfig.path||"author"}/${a||t||""}`}buildArticleListItemList(e){return c.buildArticleListItemList(e,this.imageServer)}buildArticleListHasPart(e){return c.buildArticleListHasPart(e,this.imageServer)}getArticleSchemaType(e){const t=e.get("fields.seoschematype")||"NewsArticle";return["NewsArticle","Article","OpinionNewsArticle","LiveBlogPosting"].includes(t)?t:"NewsArticle"}generateFrontData(e){const t=this.getSEOData(e);if(this.settings.isTagpage){const i={"@context":"https://schema.org","@type":"CollectionPage",url:this.settings.publishedUrl,name:t.title,description:t.description},a=lab_api.v1.model.query.getChildrenOfType(e,"article",!0),r=this.buildArticleListItemList(a);return r&&(i.mainEntity=r),i}const i={"@context":"https://schema.org","@type":"WebPage",url:this.settings.publishedUrl,name:t.title,description:t.description,publisher:this.getPublisherObject()},a=lab_api.v1.model.query.getChildrenOfType(e,"article",!0),r=this.buildArticleListItemList(a);return r&&(i.mainEntity=r,i.hasPart=this.buildArticleListHasPart(a)),i}generateArticleData(e){const t=this.getSEOData(e),i=this.getArticleSchemaType(e),a=this.getArticleImages(e,["byline"]),r=lab_api.v1.config.get("extendedSeoSchema.active"),s=lab_api.v1.config.get("page_settings.article.ignoredTags")||[],n=lab_api.v1.config.get("page_settings.article.ignoredTagPrefix")||[];let o=!1;("article"===this.settings.pageType&&lab_api.v1.config.get("showHiddenTagsOnArticle")||"notice"===this.settings.pageType&&lab_api.v1.config.get("showHiddenTagsInNotices"))&&(o=!0);const l=o?[]:(lab_api.v1.config.get("tagsToHide")||"").split(",").map(e=>e.trim()),d=[...new Set([...s,...l])],g=(e.get("tags")||[]).filter(e=>!d.includes(e)).filter(e=>{for(const t of n)if(e.startsWith(t))return!1;return!0}),p={"@context":"https://schema.org","@type":i,headline:t.title||e.get("fields.title"),description:t.description,url:this.settings.publishedUrl,inLanguage:[{"@type":"Language",alternateName:t.language}],image:this.buildArticleImageObjects(e),keywords:g.join(", ")},u=e.get("fields.someimage");if(u)p.thumbnailUrl=`${this.imageServer}/${u}.webp?width=400`;else if(a&&a.length>0)p.thumbnailUrl=c.buildImageUrl(a[0],this.imageServer,400);else{const t=e.get("frontCrop"),i=t&&t.pano&&t.pano.instance_of;i&&(p.thumbnailUrl=`${this.imageServer}/${i}.webp?width=400`)}const h=e.data&&e.data.contentdata;let f;if(f=e.get("fields.subsection")?h&&h.term&&h.term.section&&h.term.section[0]&&h.term.section[0].displayName||e.get("fields.subsection"):h&&h.mainterm&&h.mainterm.section&&h.mainterm.section[0]&&h.mainterm.section[0].displayName||e.get("primaryTags.section")||e.get("fields.defaultsection"),f&&(p.articleSection=f),r&&(p["@id"]="LiveBlogPosting"===i?`#${i.toLowerCase()}`:`${this.settings.publishedUrl}#${i.toLowerCase()}`),p.author=lab_api.v1.model.query.getChildrenOfType(e,"byline",!0).map(e=>c.buildAuthorSchema(e,{imageServer:this.imageServer,shouldUseAuthorPageUrl:this.shouldUseAuthorPageUrl.bind(this),getAuthorPageUrl:this.getAuthorPageUrl.bind(this),getImageDimensions:this.getImageDimensions.bind(this)})),p.publisher=this.getPublisherObject(),p.mainEntityOfPage=this.settings.publishedUrl,r&&(p.mainEntity={"@type":"WebPage","@id":this.settings.publishedUrl}),e.get("fields.published")&&(p.datePublished=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString()),e.get("fields.modified")&&(p.dateModified=new Date(1e3*parseInt(e.get("fields.modified"),10)).toISOString()),"1"===e.get("fields.paywall")?(p.isAccessibleForFree=!1,p.hasPart={"@type":"WebPageElement",isAccessibleForFree:!0,cssSelector:".teaserContent"}):p.isAccessibleForFree=!0,r)try{const t=e.get("fields.bodytext"),i="1"===e.get("fields.paywall");if(t&&!i&&(p.articleBody=lab_api.v1.util.string.stripTags(t)),t){const e=this.calculateWordCount(t);e>0&&(p.wordCount=e,p.timeRequired=this.calculateTimeRequired(e))}const a=lab_api.v1.model.query.getChildrenOfType(e,"editor",!0);a&&a.length>0&&(p.editor=a.map(e=>{let t=e.get("fields.firstname")||"",i=e.get("fields.lastname")||"";"Editor first name"===t&&(t=""),"Editor last name"===i&&(i="");const a={"@type":"Person",name:`${t} ${i}`.trim()},r=e.get("fields.description");r&&(a.description=lab_api.v1.util.string.sanitizeString(r));const s=e.get("fields.public_url");s&&(a.url=s);const n=(e.children||[]).filter(e=>"image"===e.type)[0];if(n){a.image={"@type":"ImageObject",url:c.buildImageUrl(n,this.imageServer,250)};const e=this.getImageDimensions(n,250);e&&(a.image.width=e.width,a.image.height=e.height)}return a}))}catch(e){}if("LiveBlogPosting"===i){e.get("fields.published")&&(p.coverageStartTime=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString());const t=lab_api.v1.model.query.getChildrenOfType(e,"livefeed",!0);if(t.length>0){const e=t[0].get("fields.endTime");e&&(p.coverageEndTime=new Date(1e3*parseInt(e,10)).toISOString())}const i=lab_api.v1.model.query.getChildrenOfType(e,"timeline",!0);if(!p.coverageEndTime&&i.length>0){const e=i[0].get("fields.endTime");e&&(p.coverageEndTime=new Date(1e3*parseInt(e,10)).toISOString())}if(i.length>0){const e=lab_api.v1.model.query.getChildrenOfType(i[0],"timelineItem",!0);e.length>0&&(p.liveBlogUpdate=e.map(e=>{const t=e.get("fields.isoDate")||p.datePublished,i=(e.get("fields.text")||"").replace(/<[^>]*>/g,"").trim();return{"@type":"BlogPosting","@id":`${this.settings.publishedUrl}#timelineItem-${e.get("guid")}`,headline:e.get("fields.title"),articleBody:i,datePublished:t,author:p.author}}))}const a=e.get("fields.seo_liveblog_end_date");if(!p.coverageEndTime&&a){const e=a.endsWith("Z")?a:`${a}:00Z`;p.coverageEndTime=new Date(e).toISOString()}}return p}getSEOData(e){if(this.cache.seoData)return this.cache.seoData;let t,i,a;if("article"===this.settings.pageType||"notice"===this.settings.pageType)i=lab_api.v1.util.string.sanitizeString(e.get("fields.seotitle")||e.get("fields.title")||""),a=lab_api.v1.util.string.sanitizeString(e.get("fields.seodescription")||e.get("fields.subtitle")||""),t=e.get("fields.seolanguage")||lab_api.v1.config.get("contentLanguage");else if("gallery"===this.settings.pageType)i=lab_api.v1.util.string.sanitizeString(e.get("filtered.seotitle")||""),a=lab_api.v1.util.string.sanitizeString(e.get("filtered.seodescription")||""),t=lab_api.v1.config.get("contentLanguage");else{if(this.settings.isTagpage&&!this.settings.isTagpageWithFrontpage){const t=lab_api.v1.properties.get("tags_as_terms"),a=(this.settings.canonical.split(this.settings.tagpagePath)[1]||"").split("/").filter(e=>!!e);let r=a[a.length-1]||"";if(t){let t=null;e.data&&e.data.contentdata&&(t=e.data.contentdata.mainterm),t&&t.section&&t.section.displayName&&(r=t.section.displayName)}const s={tag:r,tags:a,tagPath:this.settings.tagpagePath.replace(/\//g,"")};i=lab_api.v1.locale.get("tags.title_text",{data:s})}else i=lab_api.v1.util.string.sanitizeString(e.get("fields.seotitle")||e.get("fields.name")||"");a=lab_api.v1.util.string.sanitizeString(e.get("fields.seodescription")||"")}return this.cache.seoData={title:i.charAt(0).toUpperCase()+i.slice(1),description:a,language:t},this.cache.seoData}
7buildGalleryImageObjects(e){return(e||[]).map(e=>{const t={"@type":"ImageObject",contentUrl:c.buildImageUrl(e,this.imageServer,1200)},i=this.getImageDimensions(e,1200);i&&(t.width=i.width,t.height=i.height);const a=e.get("fields.caption");a&&(t.caption=lab_api.v1.util.string.sanitizeString(a));const r=e.get("fields.byline");return r&&(t.author={"@type":"Person",name:lab_api.v1.util.string.sanitizeString(r)}),t})}generateImageGalleryData(e){const t=lab_api.v1.model.query.getChildrenOfType(e,"slideshow",!0)[0],i=this.getSEOData(e),a=this.getArticleImages(e,["byline"])||[];if(!t&&0===a.length)return null;const r={"@context":"https://schema.org","@type":"ImageGallery","@id":`${this.settings.publishedUrl}#gallery`,url:this.settings.publishedUrl,name:i.title,description:t&&t.get("fields.description")||e.get("fields.subtitle")||i.description,mainEntityOfPage:this.settings.publishedUrl,image:this.buildGalleryImageObjects(a)};return r.author=lab_api.v1.model.query.getChildrenOfType(e,"byline",!0).map(e=>c.buildAuthorSchema(e,{imageServer:this.imageServer,shouldUseAuthorPageUrl:this.shouldUseAuthorPageUrl.bind(this),getAuthorPageUrl:this.getAuthorPageUrl.bind(this),getImageDimensions:this.getImageDimensions.bind(this)})),e.get("fields.published")&&(r.datePublished=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString()),r.publisher=this.getPublisherObject(),r}generateGalleryPageData(e){const t=lab_api.v1.model.query.getChildOfType(e,"slideshow");if(!t)return null;const i=lab_api.v1.model.query.getChildrenOfType(t,"image",!0)||[],a=this.getSEOData(e),r=a.title||e.get("filtered.title")||"",s=a.description||"",n={"@context":"https://schema.org","@type":"ImageGallery","@id":`${this.settings.publishedUrl}#gallery`,url:this.settings.publishedUrl,name:r,numberOfItems:i.length,image:this.buildGalleryImageObjects(i),mainEntityOfPage:this.settings.publishedUrl,publisher:this.getPublisherObject()};s&&(n.description=s);const o=e.get("fields.parent_node_type"),l=e.get("fields.parent_node_published_url"),d=e.get("fields.parent_node_title");if("article"===o&&l){const t=l.startsWith("http")?l:`${this.domain}${l}`;n.isPartOf={"@type":"NewsArticle","@id":`${t}#newsarticle`,headline:d||"",url:t};const i=e.get("fields.parent_node_published"),a=e.get("fields.parent_node_modified");i&&(n.datePublished=new Date(1e3*parseInt(i,10)).toISOString()),a&&(n.dateModified=new Date(1e3*parseInt(a,10)).toISOString());const r=e.get("fields.parent_node_bylines_json");if(Array.isArray(r)&&r.length>0){const e=r.map(e=>({"@type":"Person",name:`${e.firstname||""} ${e.lastname||""}`.trim()})).filter(e=>e.name);e.length>0&&(n.author=e)}const s=e.get("fields.parent_node_section");s&&(n.articleSection=s);const o=e.get("fields.parent_node_tags_json");Array.isArray(o)&&o.length>0&&(n.keywords=o.join(", "))}return n}getFirstVideoWithProperties(e){const t=lab_api.v1.model.query.getChildrenOfType(e,"youtube",!0)[0]||lab_api.v1.model.query.getChildrenOfType(e,"vimond",!0)[0]||lab_api.v1.model.query.getChildrenOfType(e,"vp",!0)[0]||lab_api.v1.model.query.getChildrenOfType(e,"jwplayer",!0)[0]||lab_api.v1.model.query.getChildrenOfType(e,"onnetwork",!0)[0];if(!t)return null;const i=t.getType(),a={};if("youtube"===i){const e=t.get("fields.vid");e&&(a.thumbnailUrl=`https://img.youtube.com/vi/${e}/maxresdefault.jpg`,a.embedUrl=`https://www.youtube-nocookie.com/embed/${e}`,a.contentUrl=`https://www.youtube.com/watch?v=${e}`)}else if("vimond"===i||"vp"===i){const e=t.get("fields.playerUrl");e&&(a.embedUrl=e)}else if("jwplayer"===i){const e=t.get("fields.mediaId");e&&(a.contentUrl=e)}else if("onnetwork"===i){const e=t.get("fields.vid");e&&(a.thumbnailUrl=`https://video.onnetwork.tv/poster.php?video=${e}`,a.contentUrl=`https://video.onnetwork.tv/itemg.php?id=${e}`);const i=t.get("fields.playerUrl");i&&(a.embedUrl=i)}return{video:t,type:i,properties:a}}generateVideoObjectData(e){const t=this.getFirstVideoWithProperties(e);if(!t)return null;const i=this.getSEOData(e),{video:a,properties:r}=t,s={"@context":"https://schema.org","@type":"VideoObject","@id":`${this.settings.publishedUrl}#video`,name:i.title||e.get("fields.title"),description:e.get("fields.subtitle")||a.get("fields.caption")||i.description,mainEntityOfPage:this.settings.publishedUrl};s.publisher=this.getPublisherObject(),s.author=lab_api.v1.model.query.getChildrenOfType(e,"byline",!0).map(e=>c.buildAuthorSchema(e,{imageServer:this.imageServer,shouldUseAuthorPageUrl:this.shouldUseAuthorPageUrl.bind(this),getAuthorPageUrl:this.getAuthorPageUrl.bind(this),getImageDimensions:this.getImageDimensions.bind(this)})),e.get("fields.published")&&(s.uploadDate=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString()),r.thumbnailUrl&&(s.thumbnailUrl=[r.thumbnailUrl]),r.embedUrl&&(s.embedUrl=r.embedUrl),r.contentUrl&&(s.url=r.contentUrl);const n=e.get("fields.seo_video_duration");n&&(s.duration=n);const o=this.buildArticleImageObjects(e);return o.length>0&&(s.image=o),s}generateBroadcastEventData(e){const t=this.getFirstVideoWithProperties(e);if(!t)return null;const i=this.getSEOData(e),{video:a,properties:r}=t,s={"@type":"VideoObject",name:a.get("fields.caption")||i.title||e.get("fields.title"),description:a.get("fields.caption")||i.description};e.get("fields.published")&&(s.uploadDate=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString()),r.thumbnailUrl&&(s.thumbnailUrl=r.thumbnailUrl),r.embedUrl&&(s.embedUrl=r.embedUrl),r.contentUrl&&(s.contentUrl=r.contentUrl);const n={"@context":"https://schema.org","@type":"BroadcastEvent","@id":`${this.settings.publishedUrl}#broadcast`,name:i.title||e.get("fields.title"),description:e.get("fields.subtitle")||i.description,mainEntityOfPage:this.settings.publishedUrl,isLiveBroadcast:!0,videoFormat:"HD"};e.get("fields.published")&&(n.startDate=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString()),n.publishedOn=this.getBroadcasterObject();const o=lab_api.v1.model.query.getChildrenOfType(e,"byline",!0);return o&&o.length>0&&(s.author=o.map(e=>c.buildAuthorSchema(e,{imageServer:this.imageServer,shouldUseAuthorPageUrl:e=>this.shouldUseAuthorPageUrl(e),getAuthorPageUrl:e=>this.getAuthorPageUrl(e),getImageDimensions:(e,t)=>this.getImageDimensions(e,t)}))),n.workPerformed=s,n}generateRecipeData(e){const t=lab_api.v1.model.query.getChildrenOfType(e,"recipe",!0)[0];if(!t)return null;const i=t.get("guid"),a=this.getSEOData(e),r={"@context":"https://schema.org","@type":"WebPage",url:this.settings.publishedUrl,name:a.title||e.get("fields.title"),description:a.description,mainEntity:{"@type":"Recipe","@id":`${this.settings.publishedUrl}#recipe-${i}`}};return r.publisher=this.getPublisherObject(),r}generatePodcastEpisodeData(e){const t=this.getSEOData(e),i={"@context":"https://schema.org","@type":"PodcastEpisode",url:this.settings.publishedUrl,name:t.title||e.get("fields.title"),description:t.description,mainEntityOfPage:this.settings.publishedUrl};e.get("fields.published")&&(i.datePublished=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString());const a=lab_api.v1.model.query.getChildrenOfType(e,"audio",!0)[0],r=a&&a.get("fields.url")||e.get("fields.seo_podcast_audio_url");r&&(i.associatedMedia={"@type":"MediaObject",contentUrl:r});const s=e.get("fields.seo_podcast_series_name"),n=e.get("fields.seo_podcast_series_url");return(s||n)&&(i.partOfSeries={"@type":"PodcastSeries",...s&&{name:s},...n&&{url:n}}),i.publisher=this.getPublisherObject(),i}generatePodcastSeriesData(e){const t=this.getSEOData(e),i={"@context":"https://schema.org","@type":"PodcastSeries",url:e.get("fields.seo_podcast_series_url")||this.settings.publishedUrl,name:e.get("fields.seo_podcast_series_name")||t.title||e.get("fields.title"),description:t.description,mainEntityOfPage:this.settings.publishedUrl},a=e.get("fields.seo_podcast_feed_url");return a&&(i.webFeed=a),i.publisher=this.getPublisherObject(),i}}class p{static prepareForTemplate(e,t,i){const a={meta:{head_top:[],head_bottom:[]},script:{head_top:[],head_bottom:[],body_top:[],body_bottom:[]},style:{head_top:[],head_bottom:[]},link:{head_top:[],head_bottom:[]},noscript:{head_top:[],head_bottom:[],body_top:[],body_bottom:[]}},r=e.filter(e=>!(e.pageType&&e.pageType!==t||e.skipEditor&&i||e.skipFront&&!i));for(const e of Object.keys(a))for(const t of Object.keys(a[e]))a.meta[t]=r.filter(e=>"meta"===e.tag).filter(e=>e.placement===t).map(e=>this.createCustomTag(e)),a.script[t]=r.filter(e=>"script"===e.tag).filter(e=>e.placement===t).map(e=>this.createCustomTag(e)),a.style[t]=r.filter(e=>"style"===e.tag).filter(e=>e.placement===t).map(e=>this.createCustomTag(e)),a.link[t]=r.filter(e=>"link"===e.tag).filter(e=>e.placement===t).map(e=>this.createCustomTag(e)),a.noscript[t]=r.filter(e=>"noscript"===e.tag).filter(e=>e.placement===t).map(e=>this.createCustomTag(e));return a}static createCustomTag(e){switch(e.tag){case"link":return this.createLinkTag(e);case"script":return this.createScriptTag(e);case"style":return this.createStyleTag(e);case"noscript":return this.createNoscriptTag(e);default:return this.createMetaTag(e)}}static fetchDynamicAttribute(e){return lab_api.v1.view.render({model:lab_api.v1.model.query.getRootModel(),template:e})||null}static parseAttributes(e){return e.filter(e=>!!e.key).map(e=>e.value?`${e.key}="${e.value.match(/\{\{.*\}\}/g)?this.fetchDynamicAttribute(e.value):e.value}"`:e.key).join(" ")}static parseVariables(e){return e.replace(/\{\{\{?.*?\}\}\}?/g,this.fetchDynamicAttribute)}static createLinkTag(e){return`<link ${this.parseAttributes(e.attributes)}>`}static createScriptTag(e){return`<script ${this.parseAttributes(e.attributes)}>${e.value?this.parseVariables(e.value):""}<\/script>`}static createMetaTag(e){return`<meta ${this.parseAttributes(e.attributes)}>`}static createStyleTag(e){return`<style ${this.parseAttributes(e.attributes)}>${e.value?this.parseVariables(e.value):""}</style>`}static createNoscriptTag(e){return`<noscript ${this.parseAttributes(e.attributes)}>${e.value?this.parseVariables(e.value):""}</noscript>`}}class u{static buildConfig(e){return{viewConfig:{config:{customer:{paywall:{label:lab_api.v1.config.get("paywall.label")||{}},image:{defaultAspectRatio:lab_api.v1.config.get("image.defaultAspectRatio")||void 0}}}}}}}class h{constructor(e,t){this.api=e,this.page=t}set(e,t){const i=this.export(e,t),a=t.get("type").replace("page_",""),r=this.api.v1.app.mode.isEditor();for(const t of Object.keys(i))e.setFiltered(t,i[t]);e.setFiltered("customTags",p.prepareForTemplate(this.api.v1.config.get("customTags")||[],a,r))}export(e,t){const i={},a=new Date,r=t.get("type").replace("page_",""),n=t.get("id"),l=this.api.v1.site.getSite().domain||this.api.v1.properties.get("customer_front_url"),c=l+t.get("fields.published_url"),p=encodeURIComponent(c),f=this.api.v1.properties.get("image_server"),m=this.api.v1.app.mode.isEditor(),b=this.getCanonicalUrl(e,r,n,l),y=this.api.v1.config.get("tagPagePath")||"/tag/",v="front"===r&&(c.endsWith(y.slice(0,-1))||c.indexOf(y)>-1),w=v&&!c.endsWith(y.slice(0,-1));i.customer_front_url=l,i.isEditMode=m,i.url=c,i.urlEncoded=p,i.specificUrl=b,i.image_server=f,i.pageType=r,i.pageId=n,i.is_article="article"===r,i.is_notice="notice"===r,i.is_front="front"===r,i.is_gallery="gallery"===r,i.is_index="index"===t.get("fields.hostpath"),i.is_infiniteArticle="infinitescroll"===t.get("fields.page_template_alias"),i.section=t.get("primaryTags.section")||t.get("fields.defaultsection"),i.device=this.api.v1.viewport.getName(),i.cmsVersion=this.api.v1.properties.get("app.version"),i.front_api_url=this.api.v1.properties.get("front_api_url"),i.xUaDevice=this.api.v1.properties.get("xUaDevice"),i.favicons=this.api.v1.config.get("favicons"),i.faviconList=this.api.v1.config.get("faviconList"),i.skipDefaultFont=this.api.v1.config.get("skipDefaultFont"),i.isDebug=this.api.v1.util.request.hasQueryParam("debug"),i.staticUrl=this.getStaticUrl(e,r,n,l),i.customMetatags=this.getCustomMetatags(),i.footerSettings=this.api.v1.config.get("page_settings.footer"),i.ampSettings=this.api.v1.config.get("page_settings.amp"),i.rssDescriptionPrefix=this.api.v1.config.get("viewports.rss.descriptionPrefix"),i.is_tagpage=v,i.contentLanguage=lab_api.v1.config.get("contentLanguage"),i.publishhidden="1"===t.get("fields.publishhidden");const _=this.page.media.getLogo(t.getViewport());i.logo=_.current,i.logo_sm=_.sm,i.logo_mm=_.mm,i.logo_secondary=_.secondary,i.logo_mobile=_.mobile,i.misc=this.api.v1.config.get("misc");const k={active:!1,lang:this.api.v1.config.get("google_translate")};k.lang&&Array.isArray(k.lang)&&k.lang.length&&(k.active=!0),i.google_translate=k;const x=new g({pageType:r,canonical:b,isTagpage:v,isTagpageWithFrontpage:w,tagpagePath:y,publishedUrl:c}),P=t.get("mainterm"),S=t.get("term");if(v||P&&P.section){const e=t.get("fields.published_url")||"",a=P&&P.section&&P.section.name?P.section.name:"";let r="",s="";if(P&&P.section&&P.section.uriRootPath)r=P.section.uriRootPath.replace(/^\//,"").split("/")[0];else{const t=e.replace(/^\//,"").split("/").filter(e=>e.length>0);r=t.length>0?t[0]:""}P&&P.section&&P.section.displayName&&(s=P.section.displayName),i.tagDisplayName=s,i.tagSubSection=a,i.tagPrimarySection=r,S&&S.section&&Array.isArray(S.section)&&S.section.length>0&&S.section[0].displayName&&(i.termSectionDisplayName=S.section[0].displayName)}const T=e.get("fields.subsection"),C=e.get("fields.hostpath"),M=(C?C.replace(/^\//,"").split("/"):[]).length>1;if(T)C&&!M||(i.subsection=T);else{let e=P&&P.section&&P.section.uriPath||C||"";if(e){const t=e.replace(/^\//,"").split("/");t.length>1&&(e=t.pop(),i.subsection=e)}}const $=x.generateSiteData(e),A=x.getStructuredData(e),I=Array.isArray(A)?A:[A];i.jsonld=JSON.stringify([$,...I]);const D=x.getSEOData(e);if(i.seotitle=D.title,i.seodescription=D.description,i.seolanguage=D.language,"article"===r||"notice"===r){const t=e.get("fields.sometitle")||e.get("fields.teaserTitle")||e.get("fields.title");t&&(i.sometitle=this.api.v1.util.string.stripTags(t));const a=e.get("fields.teaserTitle")||e.get("fields.title")||"";a&&(i.kilkayaTitle=this.api.v1.util.string.stripTags(a));const r=e.get("fields.teaserKicker")||e.get("fields.kicker")||"";r&&(i.kilkayaKicker=this.api.v1.util.string.stripTags(r));const s=e.get("fields.somedescription")||e.get("fields.teaserSubtitle")||e.get("fields.subtitle");if(s&&s.length>0)i.somedescription=this.api.v1.util.string.stripTags(s);else{let t=e.get("fields.bodytext")||"";t=this.api.v1.util.string.stripTags(t),i.somedescription=`${t.substring(0,100)} ...`}}else if("front"===r){const t=e.get("fields.someimage");null!=t&&""!==t&&(i.someimage=`${f}/${t}.webp?width=1200&height=630`),i.sometitle=e.get("fields.sometitle")||e.get("fields.name"),i.somedescription=e.get("fields.somedescription")||""}else if("gallery"===r&&(i.gallery_social_image=this.resolveGallerySocialImage(e,f),i.parent_is_article="article"===e.get("fields.parent_node_type"),i.parent_is_article)){const t=e.get("fields.parent_node_published"),a=e.get("fields.parent_node_modified");i.parent_article_dates={published:t?new Date(1e3*parseInt(t,10)).toISOString():"",modified:a?new Date(1e3*parseInt(a,10)).toISOString():""};const r=e.get("fields.parent_node_bylines_json");i.parent_article_bylines=(Array.isArray(r)?r:[]).map(e=>({name:`${e.firstname||""} ${e.lastname||""}`.trim()})).filter(e=>e.name);const s=e.get("fields.parent_node_tags_json");i.parent_article_tags=Array.isArray(s)?s:[]}if(this.isAuthorPage(e.get("fields.hostpath"))){const t=e.get("fields.author_json");if(t){const e=[t.fields.firstname||"",t.fields.lastname||""].filter(
7Boolean).join(" "),a=this.api.v1.properties.get("site.display_name")||"";e&&(i.sometitle=`${e} - ${a}`,i.seotitle=`${e} - ${a}`)}i.noImagePreview=!this.hasAuthorPageImage(e)}const F=this.api.v1.config.get("page_settings.article.social.items.messenger.app_id");if(i.social={facebook:`https://www.facebook.com/sharer.php?u=${p}`,messenger:F?`window.open('https://www.facebook.com/dialog/send?app_id=${F}&link=${p}&redirect_uri=${p}&display=popup','messenger','width=600,height=500');`:"",twitter:`https://twitter.com/intent/tweet?url=${p}`,mail:`mailto:?subject=${encodeURIComponent(this.api.v1.util.string.stripTags(t.get("fields.title")))}&body=${encodeURIComponent(this.api.v1.util.string.stripTags(t.get("fields.subtitle")))}%0D${p}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${p}`,threads:`https://threads.net/intent/post?text=${p}`,copyLink:`navigator.clipboard.writeText("${c}");`,glimta:`https://glimta.com/unlock?link=${p}`,talandeWebb:"ReachDeck.panel.toggleBar();",bluesky:`https://bsky.app/intent/compose?text=${encodeURIComponent(`${i.sometitle}\n`)}${p}`,reddit:`https://www.reddit.com/submit?url=${p}&title=${encodeURIComponent(i.sometitle)}`,whatsapp:`https://api.whatsapp.com/send?text=${encodeURIComponent(`${i.sometitle}\n${c}`)}`,telegram:`https://t.me/share/url?url=${p}&text=${encodeURIComponent(i.sometitle)}`,print:"window.print();",googlenews:this.api.v1.config.get("page_settings.article.social.items.googlenews.url")||""},"article"===r){const t=this.api.v1.config.get("page_settings.article.ignoredTags")||[],a=this.api.v1.config.get("page_settings.article.ignoredTagPrefix")||[],r=(e.get("tags")||[]).filter(e=>!t.includes(e)).filter(e=>{for(const t of a)if(e.startsWith(t))return!1;return!0});i.tagsString=r.toString();let s="";r.forEach((e,t)=>{s+=`"${e.replace('"',"'")}"`,t<r.length-1&&(s+=", ")}),i.tagsStringCommaSeparated=s;const n=this.api.v1.model.query.getChildrenOfType(e,"byline",!0);if(n){const e=n.map(e=>`"${e.get("fields.firstname")} ${e.get("fields.lastname")}"`).join(", ");i.bylinesStringCommaSeparated=e}const o=this.api.v1.config.get("showHiddenTagsOnArticle")?[]:(this.api.v1.config.get("tagsToHide")||"").split(",").map(e=>e.trim()),l=[...new Set([...t,...o])],d=(e.get("tags")||[]).filter(e=>!l.includes(e)).filter(e=>{for(const t of a)if(e.startsWith(t))return!1;return!0});i.filteredTags=d,i.filteredTagsString=d.toString();let c="";d.forEach((e,t)=>{c+=`"${e.replace('"',"'")}"`,t<d.length-1&&(c+=", ")}),i.filteredTagsStringCommaSeparated=c}if("notice"===r){const t=this.api.v1.config.get("showHiddenTagsInNotices")?[]:(this.api.v1.config.get("tagsToHide")||"").split(",").map(e=>e.trim()),a=(e.get("tags")||[]).filter(e=>!t.includes(e));i.filteredTags=a}"article"===r&&(e.get("fields.published")&&(i.published=new Date(1e3*parseInt(e.get("fields.published"),10)).toISOString(),i.publishedTimestamp=e.get("fields.published")),e.get("fields.hidefromfp_time")&&(i.hidefromfp_time=new Date(1e3*parseInt(e.get("fields.hidefromfp_time"),10)).toISOString())),i.site=this.api.v1.site.getSite(),i.siteJSON=JSON.stringify(i.site),i["site.domain_no_protocol"]=i.site.domain.split("://").pop(),i.siteAlias=i.site.alias,i.fullUrl=i.site.domain,i[`site_is_${i.siteAlias}`]=!0;const O=this.page.resources;if(!m&&i.is_article&&this.api.v1.config.get("displayReadProgress.active")&&t.get("fields.displayReadProgress")&&(i.readProgress=O.scripts.getProgressReader()),i.siteStylesheetList=s.getSiteStylesWithFallback(i.siteAlias),Sys.logger.debug(`ViewSupport: Will include ${i.siteStylesheetList.length} configured stylesheet(s): "${i.siteStylesheetList.join(", ")}".`),i.siteFiles=O.scripts.getSiteFiles(e,t,i.siteAlias,r,m),i.modules=O.scripts.getModules(e,t,i.siteAlias,r,m),!m){i.analytics=O.analytics.get(i),i.widgets={strossle:this.api.v1.config.get("widgets.strossle.strossle_id")},i.consent={cookieconsent:this.api.v1.config.get("consent.cookieconsent.show"),cookieconsent_culture:this.api.v1.config.get("consent.cookieconsent.culture")||"NB"},this.api.v1.config.get("cookieConsent.enabled")&&O.scripts.required.push({url:"/view-resources/public/common/cookieConsent.js",requireDom:!1}),"desktop"===this.api.v1.viewport.getName()&&t.get("fields.style_slidein")&&(i.style_slidein=!0,O.scripts.required.push({url:"/view-resources/public/common/SlideIn/SlideIn.js",requireDom:!1}));const a=this.api.v1.config.get("adEnvironment")||{},r="1"===t.get("fields.hideAds"),s="1"===t.get("fields.hideSkyscraperAds")||!1,n="1"===t.get("fields.hideTopBannerAd")||"1"===e.get("fields.hideTopBannerAd")||!1;if(Sys.logger.debug(`[PageData] Ad settings: hideAds=${r}, disableSkyscraper=${s}, disableTopBanner=${n}, adEnv=${a.name||"none"}
7`),!r&&a&&"adnuntius"===a.name)try{i.adnuntius=d.getAdnuntiusSettings(this.api,e,t,a,i.site,s,n)}catch(e){Sys.logger.warn(`[PageData] Failed to prepare Adnuntius ads: ${e.toString()}`)}if(!r&&a&&"google"===a.name)try{i.googleAds=d.getGoogleSettings(this.api,e,t,a,i.site,s,n)}catch(e){Sys.logger.warn(`[PageData] Failed to prepare Google ads: ${e.toString()}`)}}if(this.api.v1.util.request.hasQueryParam("fontpreview")){const e=h.validateOrigin(this.api.v1.util.request.getQueryParam("fontpreview"));e&&(i.fontpreview=e,i.analytics=null)}if(i.page_settings=this.page.settings.get({pageType:"notice"===r||"gallery"===r?"article":r,socialLinks:i.social}),"article"===r){const a=this.api.v1.config.get("comments_provider.hideCommentsIfPaywall")||!1,s=this.api.v1.properties.get("paywall")||{},o=lab_api.v1.app.mode.isFront()&&s.active&&!s.hasAccess&&a,l=!1===m&&!1===o;if(t.get("fields.showcomments")&&!o){if(this.api.v1.config.get("comments_provider.facebook")){const e=this.api.v1.config.get("comments_provider.facebook.app_id");e&&(i.facebook={display:l,displayPlaceholder:m,appId:e,pageId:n,url:i.fullUrl+("article"===r?`/a/${n}`:"")},i.displayComments=!0)}if(this.api.v1.config.get("comments_provider.disqus")){const e=this.api.v1.config.get("comments_provider.disqus.enable"),t=this.api.v1.config.get("comments_provider.disqus.script");e&&(i.disqus={display:l,displayPlaceholder:m,canonical:b,pageId:n,script:t},i.displayComments=!0)}const a=this.api.v1.config.get("comments_provider.commento");a&&a.enable&&(i.commento={display:l,displayPlaceholder:m,canonical:b,usePageId:a.usePageId,pageId:n,script:a.script,cssOverride:a.cssOverride,descriptionText:a.descriptionText},i.displayComments=!0);const s=lab_api.v1.config.get("comments_provider.hyvor");if(s&&s.websiteId){const t=e.get("fields.published")||0;i.hyvor={display:l,displayPlaceholder:m,websiteId:s.websiteId,pageId:t>1646908200&&n},s.hidePageIdBeforeDate&&t<s.hidePageIdBeforeDate&&(i.hyvor.pageId=""),i.displayComments=!0}const o=lab_api.v1.config.get("comments_provider.engagently");if(o&&o.communityId){const e=t.get("fields.discussion-id"),a=t.get("fields.discussion-data"),r=this.api.v1.properties.get("app.engagently")||{};i.engagently={display:l,displayPlaceholder:m,communityId:o.communityId,frontendUrl:o.frontendUrl,counterHost:o.counterHost,defaultLanguage:o.defaultLanguage||"en",preambleHtmlLoggedOut:o.preambleHtmlLoggedOut||"",preambleHtmlLoggedIn:o.preambleHtmlLoggedIn||"",buttonLabel:o.buttonLabel||"Comments",buttonLabelClose:o.buttonLabelClose||"Close comments",discussionId:e||r.discussionId||`p${n}`,discussionData:a||r.discussionJwt||""},i.displayComments=!0}const d=lab_api.v1.config.get("comments_provider.ifragasatt");d&&(i.ifragasatt={display:l,displayPlaceholder:m,customerId:d.customer_id,articleId:`article${n}`},i.displayComments=!0)}}i.menus=this.page.menus.get({defaultSection:t.get("fields.defaultsection"),section:t.get("primaryTags.section")}),i.style_definitions=o.getStyleDefinitions(this.api),i.css_build=o.getInlineCSS(this.api),i.css_variables=o.getCssVariables(this.api),i.contact=this.api.v1.config.get("contact");const j=!!t.get("fields.norobots"),R=t.get("fields.hidefromfp_time"),L=Math.round(a.getTime()/1e3),E="gallery"===r&&"article"===e.get("fields.parent_node_type")&&"1"===e.get("fields.parent_node_norobots");if(i.norobots=j||E||R&&R<=L||!1,"article"===r&&this.api.v1.config.get("embeddable.active")&&(i.embeddable={active:!0,display:!!t.get("fields.displayEmbedButton")&&"embed"!==i.device,aboveBodytext:!!t.get("fields.displayEmbedButtonAboveBodytext")&&"embed"!==i.device,isFullContent:this.api.v1.util.request.getQueryString().indexOf("lab_content=full")>-1,hasParallax:this.api.v1.model.query.hasChildOfType(e,"parallax",!0)}),Sys.logger.debug(`ViewSupport: Will include ${O.scripts.required.length} configured script(s): "${O.scripts.required.map(e=>e.url).join(", ")}".`),O.scripts.required.forEach(e=>{if(!e.placeholderKey&&e.requireDom&&(e.placeholderKey="requireDom"),e.placeholderKey){const{placeholderKey:t}=e;e.placeholderKey={},e.placeholderKey[t]=!0}}),i.siteScriptList=O.scripts.required,i.paywall=this.getPaywallInfo(e,m),i.is_article){const e=this.api.v1.config.get("vgwort")||{};if(e.karteinummer&&e.counter_domain&&e.prefix){const t=`vgzm.${e.karteinummer}-${e.prefix}-${n}`,a=`pw-${t}`,r=i.paywall&&i.paywall.enabled,s=this.getVgWortHasAccess(i.paywall);i.vgwort={counterDomain:e.counter_domain,publisherKey:t,paywallPublisherKey:a,paywallEnabled:r,hasAccess:s}}}if(i.simplestreamEnabled=lab_api.v1.config.get("contentbox_settings.simplestream")||!1,"mailmojo"===i.device&&this.setDefaultMailmojoData(e,t),"article"===r){const t=lab_api.v1.config.get("page_settings.article.ageWarnings");if(Array.isArray(t)){const i=e.get("fields.published");if(i){const a=this.getAgeWarningItem(i,t);a&&e.setFiltered("ageWarning",a)}}}i.featureFlags={responsive_mobile_fonts:!lab_api.v1.util.featureFlags.enabled("Disable responsive mobile fonts",r)},i.clientSideConfig=JSON.stringify(u.buildConfig(this.api));const B=e.get("fields.hostpath");return i.shouldRenderCanonical=!("labrador/http-404"===B||"labrador/http-410"===B),i}static validateOrigin(e){if("string"!=typeof e||!e)return null;try{const t=new URL(e);if(("http:"===t.protocol||"https:"===t.protocol)&&t.origin===e)return t.origin}catch(e){}return null}getAgeWarningItem(e,t){const i=Object.values(t).filter(e=>!!e.years&&!!e.label).sort((e,t)=>
7t.years-e.years),a=new Date(1e3*e),r=Date.now()-a,s=new Date(r),n=Math.abs(s.getUTCFullYear()-1970);for(const e of i)if(n>=e.years)return e;return null}setDefaultMailmojoData(e,t){const i=lab_api.v1.config.get("lang")||"no";e.setFiltered("lang",i)}getCanonicalUrl(e,t,i,a,r){const s=e.get("fields.lab_canonical");if(s)return s;if("front"===t){const t=e.get("fields.hostpath");return"index"===t?`${a}/`:this.isAuthorPage(t)?`${a}/${this.getAuthorPageCanonical(e)}`:`${a}/${t}`}return`${a+e.get("fields.published_url")}`}getStaticUrl(e,t,i,a){if("front"===t){const t=lab_api.v1.util.request.getHeader("X-Labrador-404-Referer");if(t)return`${a}${t}`;const i=e.get("fields.hostpath");return i?`${a}/${"index"===i?"":i}`:`${a+e.get("fields.published_url")}`}return"gallery"===t?`${a+e.get("fields.published_url")}`:`${lab_api.v1.properties.get("site").domain}/a/${i}`}getCustomMetatags(){const e=lab_api.v1.config.get("customMetatags")||[],t=lab_api.v1.config.get("customMetatagsKeyVal")||[],i=[];for(const t of e){const e=Object.keys(t).map(e=>({key:e,value:t[e]}));i.push(e)}for(const e of t)e.length&&i.push(e);return i}getPaywallInfo(e,t){const i=lab_api.v1.properties.get("paywall"),a=!t&&"1"===e.get("fields.paywall"),r=lab_api.v1.config.get("paywall.provider",{site:lab_api.v1.site.getSite().alias})||"internal",s=(!t&&e.get("fields.paywallSalesImage"),!t&&a&&i.hasAccess&&"1"===e.get("fields.paywallShareable"));let n;if("1"===e.get("fields.paywallShareable")){n=lab_api.v1.config.getConfig("pages.localisation.data.items.paywall.items.shareableArticle.items")||{};for(const e of Object.keys(n))n[e]=lab_api.v1.locale.get(`paywall.shareableArticle.${e}`)||""}const o={display:!0,...this.api.v1.config.get("paywall.label")},l=this.api.v1.config.get("paywall.label.text.content"),d=this.api.v1.config.get("paywall.label.icon.content"),c={text:{content:null==l?"Plus":this.api.v1.config.get("paywall.label.text.content")},icon:{content:null==d?"fi-plus":this.api.v1.config.get("paywall.label.icon.content")}};return Object.assign(o,c),o.display&&e.setFiltered("paywallLabel",o),{enabled:a,settings:i,provider:r,shareable:s,shareableArticle:n,hasAccess:!a||!i.active||i.hasAccess,serverResolvesAccess:this.serverResolvesPaywallAccess(r,i),hidePaywallOffers:this.api.v1.util.request.hasQueryValue("lab_opts","paywall_loginonly"),paywallSalesImage:e.get("fields.paywallSalesImage"),paywallSalesPitchContent:e.get("fields.paywallSalesPitchContent"),paywallSalesPitchTitle:e.get("fields.paywallSalesPitchTitle"),paywallLayoutType:e.get("fields.paywallPreview.paywallLayoutType"),requiredProducts:JSON.stringify(this.api.v1.properties.get("app.paywall.requiredProducts")||[])}}serverResolvesPaywallAccess(e,t={}){return"internal"===e&&!!t.active||"tulo"===e}getVgWortHasAccess(e){if(!e||!e.enabled)return!1;const t=e.settings||{};return!!this.serverResolvesPaywallAccess(e.provider,t)&&!!t.hasAccess}isAuthorPage(e){const t=this.api.v1.config.get("authorPages")||{},i=t.path||"author";return!!(e&&t.enabled&&e.startsWith(`${i}/`))}getAuthorPagePath(){return(this.api.v1.config.get("authorPages")||{}).path||"author"}getAuthorPageSlug(e){const t=e.get("fields.author_json");if(t)return t.fields.slug}getAuthorPageId(e){const t=e.get("fields.author_json");if(t)return t.fields.id}hasAuthorPageImage(e){const t=e.get("fields.author_json"),i=t&&t.children?t.children.image:null,a=i&&i.length?i[0]:null;return!!a&&(!!a.instance_of||/imageId=\d+/.test(a.imageurl||""))}getAuthorPageCanonical(e){const t=this.getAuthorPagePath(),i=this.getAuthorPageSlug(e),a=this.getAuthorPageId(e);return`${t}/${i||a}`}resolveGallerySocialImage(e,t){const i=this.api.v1.config.get("image.socialAspectRatio")||.525,a=1200,r=Math.round(a*i),s=this.api.v1.model.query.getChildOfType(e,"slideshow",!0),n=s?this.api.v1.model.query.getChildOfType(s,"image",!0):null;if(n){const e=n.get("instance_of"),i=n.get("fields.imageurl")||(e?`${t}/?imageId=${e}`:null);if(i)return{url:this.applyImageDimensions(i,a,r),width:a,height:r,hasLargeImage:!0}}const o=e.get("fields.parent_node_someimage");return o?{url:`${t}/${o}.webp?width=1200&height=${r}`,width:a,height:r,hasLargeImage:!0}:null}applyImageDimensions(e,t,i){let a=e;return a.includes("width=")?a=a.replace(/width=\d*/,`width=${t}`):a+=a.includes("?")?`&width=${t}`:`?width=${t}`,a.includes("height=")?a=a.replace(/height=\d*/,`height=${i}`):a+=`&height=${i}`,a}}class f{static parseCss(e,t="filtered.autodata"){const i=e.get(t);if(i&&"object"==typeof i)return[Object.values(i.cssObject||{}).join(" "),i.cssString||"",(i.cssArray||[]).join(" ")].join(" ").trim()}static parseAttributes(e){const t=e.get("filtered.autodata.attributesObject");
7if(t&&"object"==typeof t)return Object.keys(t).map(e=>({key:e,value:t[e]}))}static parseCustomData(e){const t=e.get("filtered.autodata.custom");if(!t||"object"!=typeof t)return;const i={};for(const e of Object.keys(t))i[e]=Object.keys(t[e]).map(i=>({key:i,value:t[e][i]}));return i}static parseCustomDataFromFeed(e,t){const i=lab_api.v1.config.get(`${t}.autodata.mapping`)||{};if(!i||"object"!=typeof i)return;const a={labels:[]};if(i.labels)for(const t of Object.keys(i.labels))e[i.labels[t]]&&a.labels.push({key:t,value:e[i.labels[t]]});return a}}class m{static getEffectiveSettings(e,t){const i=(t.v1.config.get("audio_settings")||{}).texttospeech||{},a=i.provider||{},r=i.enabledGlobally||!1,s=i.hidePlacementInEditor||!1,n=e.get("fields.texttospeechEnabled"),o=e.get("fields.hidePlacementInEditor"),l=null!=n?!0===n||"1"===n:r,d=e.get("fields.texttospeechEnabledFromDate")||i.enabledFromDate||null;let c=!0;if(d){const t=Number(e.get("fields.published"))||Date.now()/1e3;c=new Date(1e3*t)>=new Date(d)}return{texttospeechEnabled:l&&c,ttsOnOff:l,dateOk:c,enabledFromDate:d,hidePlacementInEditor:null!=o?!0===o||"1"===o:s,video:a.video||!1,globalConfig:i}}static insertIfNeeded(e,t,{isEditor:i=!1}={}){const a=m.getEffectiveSettings(t,e),r=i?a.ttsOnOff:a.texttospeechEnabled;if(!a.globalConfig.enable||!r)return;if(i&&a.hidePlacementInEditor)return;if(e.v1.model.query.getModelByType("texttospeech"))return;const s=a.globalConfig.path||"page_article/bodytext",n=null!=a.globalConfig.bodyTextIndex?a.globalConfig.bodyTextIndex:0,o=null!=a.globalConfig.index?a.globalConfig.index:0;e.v1.model.insert.atPath({path:s,data:{type:"texttospeech",...i?{state:{isNonPersistent:!0,editNonPersistent:!0,draggableDisabled:!0}}:{},metadata:{isBodytext:!0,bodyTextIndex:n,autoInserted:!0},contentdata:{fields:{video:a.video}}},options:{index:o,persistentTarget:!0,intermediate:{useExisting:!0},silent:!0}})}}class b{constructor(e){this.api=e,this.pageData=new h(this.api,new n(this.api))}onReady(e,t){this.pageData.set(e,t),e.setFiltered("autodata_css",f.parseCss(e)),e.setFiltered("autodata_attributes",f.parseAttributes(e)),e.setFiltered("autodata_custom",f.parseCustomData(e));const i=m.getEffectiveSettings(e,this.api);e.setFiltered("hidePlacementInEditor",i.hidePlacementInEditor);const a=this.api.v1.model.query.getModelByType("texttospeech"),r=a&&!a.get("metadata.autoInserted");e.setFiltered("ttsEnabled",this.api.v1.app.mode.isEditor()||i.texttospeechEnabled||r);const s=i.enabledFromDate&&!i.dateOk;e.setFiltered("ttsEnabledFromDate",s?i.enabledFromDate:""),this.api.v1.app.mode.isEditor()&&(this.api.v1.model.bindings.bind(e,"fields.texttospeechEnabled",this._syncTexttospeechElement.bind(this)),this.api.v1.model.bindings.bind(e,"fields.hidePlacementInEditor",this._syncHidePlacementInEditor.bind(this)),this.api.v1.model.bindings.bind(e,"fields.texttospeechEnabledFromDate",this._syncTtsDateBlocked.bind(this)))}onPrepareViewHelper(e){this.api.v1.app.mode.isEditor()&&m.insertIfNeeded(this.api,e,{isEditor:!0})}_syncHidePlacementInEditor(e){const t=m.getEffectiveSettings(e,this.api);e.setFiltered("hidePlacementInEditor",t.hidePlacementInEditor);const i=this.api.v1.model.query.getModelByType("texttospeech");t.hidePlacementInEditor?i&&i.get("metadata.autoInserted")&&this.api.v1.model.delete(i):i?this.api.v1.model.addToRedrawQueue(i,!0):m.insertIfNeeded(this.api,e,{isEditor:!0})}_syncTtsDateBlocked(e){const t=m.getEffectiveSettings(e,this.api),i=t.enabledFromDate&&!t.dateOk;e.setFiltered("ttsEnabledFromDate",i?t.enabledFromDate:"");const a=this.api.v1.model.query.getModelByType("texttospeech");a&&this.api.v1.model.addToRedrawQueue(a,!0)}_syncTexttospeechElement(e){const t=m.getEffectiveSettings(e,this.api),i=this.api.v1.model.query.getModelByType("texttospeech");t.ttsOnOff?i||m.insertIfNeeded(this.api,e,{isEditor:!0}):i&&i.get("metadata.autoInserted")&&this.api.v1.model.delete(i)}}class y{constructor(e){this.api=e,this.pageData=new h(this.api,new n(this.api)),this.dateTimeHelper=new l}onReady(e,t){this.pageData.set(e,t);const i=e.get("fields.modified");if(i){const t=new Date(1e3*parseInt(i,10));e.setFiltered("modified",this.dateTimeHelper.utcFormat(t,"{{ YYYY }}-{{ MM }}-{{ DD }} {{ HH }}:{{ mm }}:{{ ss }}"))}}}class v{static textElements(e,t){const i={top:[],floating:[],bottom:[],sub:[],positions:{kicker:"",title:"",bylines:""}};let a="",r="",s="";const n=e.get("metadata.showKicker"),o=e.get("fields.origin_data_json")||{};if(n&&(t||e.get("fields.kicker")||o.teaserKicker||o.kicker)&&(e.get("metadata.floatingKicker")?(i.floating.push("kicker"),i.positions.kicker="floating",a="floating"):e.get("metadata.kickerBelowImage")?(i.bottom.push("kicker"),i.positions.kicker="below",a="bottom"):(i.top.push("kicker"),i.positions.kicker="above",a="top")),e.get("metadata.hideTitle")||!t&&!e.get("fields.title")||(e.get("metadata.floatingTitle")?(i.floating.push("title"),i.positions.title="floating",r="floating"):e.get("metadata.titleAboveImage")?(i.top.push("title"),i.positions.title="above",r="top"):(i.bottom.push("title"),i.positions.title="below",r="bottom")),e.get("fields.displayByline")&&(e.get("metadata.floatingBylines")?(i.floating.push("bylines"),i.positions.bylines="floating",s="floating"):(i.sub.push("bylines"),i.positions.bylines="sub",s="sub"),e.get("metadata.bylinesAboveTitle")&&r)){
7if(s){const e=i[s].indexOf("bylines");-1!=e&&i[s].splice(e,1)}const e=i[r],t=e.indexOf("title");-1!==t?e.splice(t,0,"bylines"):e.push("bylines"),i.positions.bylines="aboveTitle",s=r}if(e.get("metadata.kickerBelowTitle")&&n&&r){if(a){const e=i[a].indexOf("kicker");-1!==e&&i[a].splice(e,1)}const e=i[r],t=e.indexOf("title");-1!==t?e.splice(t+1,0,"kicker"):e.push("kicker"),i.positions.kicker="belowTitle",a=r}return!e.get("metadata.hidesubtitle")&&(t||e.get("fields.subtitle")||o.teaserSubtitle)&&(e.get("metadata.floatingSubtitle")?i.floating.push("subtitle"):e.get("metadata.subtitleAboveImage")?i.top.push("subtitle"):i.bottom.push("subtitle")),i}}class w{static convertToIso639(e){let t="";return e&&(t=3===e.length?e.toLowerCase():e.includes("-")?e.split("-")[0].toLowerCase():e.toLowerCase()),t}}class _{static autoSizeText(e,t){if(!e)return"";let i={};i=t||{regex:{},formats:{default:{maxWordLength:15,minLineLength:3,ranges:[{maxCharacters:1/0,numberOfLines:1}]}}};const a={1:100,2:70,3:50,4:45,5:40,6:35,7:30,8:26,9:22,10:20,11:18,12:17,13:16,14:15,15:14,16:13,17:12,18:11,19:10,20:9,21:8,22:7,23:6,24:5,25:4},r=e.innerHTML.replace(/&nbsp;/,"");if(e.querySelector("br")||e.querySelector(".auto-font-size-line-br")){const t=this.handleBreaks(r);e.innerHTML="",t.forEach((i,a)=>{e.innerHTML+=`<span class="auto-font-size-line${a<t.length?" auto-font-size-line-br":""}">${i} </span>`})}else{const t=this.removeHTMLTags(r),a=this.splitSentence(t,i,"default");e.innerHTML="";for(const t of a)e.innerHTML+=`<span class="auto-font-size-line">${t} </span>`}const s=e.querySelectorAll(".auto-font-size-line"),n=e.clientWidth;for(const e of s){const t=a[e.innerText.length]||5;e.clientWidth<n?this.enlargeTitle(e,n,t):e.clientWidth>n&&this.shrinkTitle(e,n,t)}return e.innerHTML}static handleBreaks(e){let t=this.removeHTMLTags(e).split(/<br\s*[^>]*>/gi);return t=t.filter(e=>e.trim().length>0),t}static removeFontSize(e){const t=e.innerHTML;return e.innerHTML=this.removeHTMLTags(t),this.removeHTMLTags(t)}static removeHTMLTags(e){let t=e.replace(/<span class="auto-font-size-hyphen">-<\/span>\s?/g,"");return t=t.replace(/<span class="[^"]*\bauto-font-size-line-br\b[^"]*"[^>]*>(.*?)<\/span>/g,"$1<br>"),t=t.replace(/<span class="[^"]*\bauto-font-size-line\b[^"]*"[^>]*>(.*?)<\/span>/g,"$1"),t=t.replace(/<span[^>]*>([^<]*)<\/span>/g,"$1"),t=t.replace(/(\r\n|\n|\r)/g,""),t}static enlargeTitle(e,t,i,a=100){let r=i;for(;e.clientWidth<t&&r<=a;)r+=1,e.style.setProperty("--lab-auto-font-size",`${r}cqi`);for(;e.clientWidth>=t||r>a;)r-=.1,e.style.setProperty("--lab-auto-font-size",`${r}cqi`)}static shrinkTitle(e,t,i){let a=i;for(;e.clientWidth>t;)a-=.1,e.style.setProperty("--lab-auto-font-size",`${a}cqi`)}static splitSentence(e,t,i){const a=e||"",{length:r}=a;if(!t||!t.formats||!t.formats[i])return[a];const s=this.findRules(t,i),n=this.findNumberOfLines(s.ranges,r)||1,o=s.maxWordLength||null,l=s.minLineLength||null,d=t.regex||{};return this.splitTextEvenly(e,n,o,l,d)||[]}static findRules(e,t){return{...e.formats[t]}}static findNumberOfLines(e,t){const i={maxLineLength:20,numberOfLines:1};for(const a of e)if(t<=a.maxCharacters){i.numberOfLines=a.numberOfLines,i.maxLineLength=a.maxCharacters/a.numberOfLines;break}return i}static checkRegex(e,t,i){let a=t;const r=[];return Array.from(Object.entries(e),([,e])=>e).forEach(e=>{const t=new RegExp(e,"g"),i=a.match(t);i&&r.push(...i)}),r.forEach(e=>{const t=e.replace(/ /g,i);a=a.replace(e,t)}),a}static splitStringIntoParts(e,t,i,a,r){const s=this.checkRegex(i,e,"___").split(" "),n=[];let o="";return s.forEach(e=>{const i=e.trim().replace(new RegExp("___","g")," ");if(i.includes("-"))o.length+i.length+1>t?(n.push(o),o=i):o+=(o.length>0?" ":"")+i;else{const e=this.splitWord(i,a);e.forEach((i,a)=>{o.length+i.length+1>t?(n.push(o),o=i):o+=(o.length>0?" ":"")+i,a<e.length-1&&(o+='<span class="auto-font-size-hyphen">-</span>')})}}),o.length>0&&n.push(o),n}static splitWord(e,t){if(!Number.isFinite(t)||t<=0)return[e];const i=[];let a=e;for(;a.length>t;){if(a.length>t&&a.length<=t+2){const e=Math.floor(a.length/2);i.push(a.substring(0,e)),a=a.substring(e);break}i.push(a.substring(0,t)),a=a.substring(t)}if(a.length>0)if(1===a.length&&i.length>0){const e=i.pop();i.push(e+a)}else i.push(a);return i}static splitTextEvenly(e,t,i,a,r){const s=e.trim(),n=Math.ceil(s.length/t.numberOfLines);let o=this.splitStringIntoParts(s,n,r,i,t.numberOfLines);if(a&&(o=this.mergeShortLines(o,a)),o.length>t.numberOfLines){const e=/<span class="auto-font-size-hyphen">-<\/span>$/,t=o.pop();e.test(o[o.length-1])?o[o.length-1]=o[o.length-1].replace(e,"")+t:o[o.length-1]+=` ${t}`}return o}static mergeShortLines(e,t){const i=[];for(let a=0;a<e.length;a++){let r=e[a].trim();r.length<t&&a<e.length-1&&(r+=` ${e[a+1]}`,a++),i.push(r)}if(i.length>1){const e=i[i.length-1];e.length<t&&(i[i.length-2]+=` ${e}`,i.pop())}return i}}class k{constructor(e){this.api=e,this.imageServer=this.api.v1.properties.get("image_server"),this.rootModel=this.api.v1.model.query.getRootModel(),this.domain=this.api.v1.site.getSite().domain||this.api.v1.properties.get("customer_front_url"),this.fallbackLanguage=this.api.v1.config.get("contentLanguage")||"",this.autoFontSizeConfig=this.api.v1.config.get("autoFontSize")||[],this.autoFontSizePageSettings=Boolean(!!this.rootModel&&this.rootModel.get("fields.autoFontSize")),this.hasAutoFontSize=this.autoFontSizePageSettings&&this.autoFontSizeConfig.enabled,this.autoFontSizeDone=!1,this.dateTimeHelper=new l(this.api.v1.config.get("lang")||void 0),this.dateFormat=this.api.v1.locale.get("dates.monthdayyear",{noRender:!0}),this.paywallLabelDefaults=this.api.v1.config.get("paywall.label"),this.paywallLabelTextContent=this.api.v1.config.get("paywall.label.text.content"),this.paywallLabelIconContent=this.api.v1.config.get("paywall.label.icon.content"),this.showHiddenTagsOnFront=this.api.v1.config.get("showHiddenTagsOnFront"),this.tagsToIgnore=(this.api.v1.config.get("tagsToHide")||"").split(",").map(e=>e.trim()).filter(e=>e),this.tagsAsTermsConfig=this.api.v1.properties.get("tags_as_terms"),this.termCollectionConfig=this.api.v1.properties.get("tag_term_collection")||"keyword"}onInserted(e){if(this.api.v1.app.mode.isEditor()&&this.hasAutoFontSize){e.set("state.autoF
7ontSizeReRender",!0,{notify:!1});const t=(e,t,i)=>{e.get("fields.title")===e.get("state.title")?e.set("state.autoFontSizeReRender",!1,{notify:!1}):(e.set("state.autoFontSizeReRender",!0,{notify:!1}),e.set("metadata.autoFontSizeDone",!1,{notify:!1}))};this.api.v1.model.bindings.bind(e,"fields.title",t)}}onReady(e,t){e.setFiltered("layout",v.textElements(t,this.api.v1.app.mode.isEditor()));let i=e.get("fields.published_url")||"";!/^https?/.test(i)&&i&&(i=this.domain+i),e.setFiltered("published_url",i),e.setFiltered("published_url_rss",i.replace(/&/g,"&amp;"))}onRender(e,t){const i=e.get("fields.origin_data_json")||{},a=e.get("instance_of")||i.id,r=e.get("fields.published")||i.published,s=i.teaserTitle||t.get("fields.title")||"",n=i.teaserSubtitle||t.get("fields.subtitle")||"",o=i.published||e.get("fields.published"),l=i.teaserKicker||i.kicker||t.get("fields.kicker"),d=e.get("fields.site_id")||i.site_id,c=i.seolanguage||e.get("fields.seolanguage")||this.fallbackLanguage,g=i.teaserAudio||e.get("fields.audio"),p=i.teaserAudio_style_json||e.get("fields.audioInfo")||{},u=i.addRelNoFollow||e.get("fields.addRelNoFollow")||!1,h=i.addRelSponsored||e.get("fields.addRelSponsored")||!1,m=i.addRelUgc||e.get("fields.addRelUgc")||!1;e.setFiltered("published",r),e.setFiltered("published_rss",this.dateTimeHelper.formatRfc2822(r)),e.setFiltered("title",s),e.setFiltered("kicker",l),e.setFiltered("subtitle",n),e.setFiltered("articleId",a),e.setFiltered("section",i.section_tag||e.get("fields.section")||""),e.setFiltered("base_url",this.domain),e.setFiltered("published_sitemap",o),e.setFiltered("canonical_url",`${this.getSiteDomain(d)}/a/${a}`),e.setFiltered("tags",e.get("tags")||[]),e.setFiltered("tagsString",(e.get("tags")||[]).toString()),e.setFiltered("languageIso639",w.convertToIso639(c));const b=(new Date).getTime()-1728e5;if(e.setFiltered("articleOutOfDate_sitemap",!!o&&b>new Date(o).getTime()),e.setFiltered("addRelNoFollow",u),e.setFiltered("addRelSponsored",h),e.setFiltered("addRelUgc",m),!this.showHiddenTagsOnFront&&this.tagsToIgnore.length){const t=(e.get("tags")||[]).filter(e=>!this.tagsToIgnore.includes(e));e.setFiltered("tags",t),e.setFiltered("tagsString",t.toString())}if(this.tagsAsTermsConfig){const t=e.get("mainterm")||{},i=e.get("term")||{},a=this.termCollectionConfig,r=t.section,s=[...!r||r.hidden||this.tagsToIgnore.includes(r.name)?[]:[{name:r.name||"",displayName:r.displayName||r.name||"",uriPath:r.uriPath||r.name||"",uriName:r.uriName||r.name||"",termFullPath:(r.uriRootPath||"")+(r.uriPath||""),isMainTerm:!0}],...[...(i[a]||[]).map(e=>({...e,termFullPath:""})),...(i.section||[]).map(e=>({...e,termFullPath:(e.uriRootPath||"")+(e.uriPath||"")}))].filter((e,t,i)=>!e.hidden&&!this.tagsToIgnore.includes(e.name)&&e.name!==(r&&r.name)&&i.findIndex(t=>t.name===e.name)===t).map(e=>({name:e.name||"",displayName:e.displayName||e.name||"",uriPath:e.uriPath||e.name||"",uriName:e.uriName||e.name||"",termFullPath:e.termFullPath,isMainTerm:!1}))];s.length&&(e.setFiltered("termData",s),e.setFiltered("tagsString",s.map(e=>e.uriName).toString()))}if(d){const t=this.api.v1.site.getSiteById(d);t&&e.setFiltered("site_alias",t.alias)}if(g){const t={url:g};if(p){const e=JSON.parse(p);t.title=e.title||null,t.fileType=e.fileType||null,t.playTime=e.playTime||null}e.setFiltered("audio",t)}const y=i.showbylineonfp||t.get("fields.displayByline")||!1;if(y){const a=t.get("fields.byline")||i.byline,r=t.get("fields.bylineImage")||i.bylineImage,s=(i.full_bylines||e.get("fields.full_bylines_json")||[]).map(e=>({firstname:e.firstname,lastname:e.lastname,description:e.description,imageUrl:e.imageUrl?this.getImageUrl(`${e.imageUrl}&width=90&height=90`):""}));s.length||!a&&!r||s.push({firstname:a,lastname:"",imageUrl:r?this.getImageUrl(`${r}&width=90&height=90`):""}),e.setFiltered("bylines",s),r&&e.setFiltered("bylineImage",`${r}&width=90&height=90`)}e.setFiltered("displayByline",y);const v=t.get("fields.displayPublishedDate")||!1,_=this.dateFormat;if(e.setFiltered("displayPublishedDate",v),v)if(this.api.v1.app.mode.isEditor()&&!r)e.setFiltered("publishedDate",_);else if(this.api.v1.app.mode.isEditor()||r){const t=new Date(r),i=this.dateTimeHelper.format(t,_);e.setFiltered("publishedDate",i)}else e.setFiltered("displayPublishedDate",!1);let k=i.paywall||e.get("fields.paywall")||!1;if(k=1===k||"1"===k||!0===k||null,k){const i={display:!0,displayInNewsletter:!0,...this.paywallLabelDefaults},a=this.paywallLabelTextContent,r=this.paywallLabelIconContent,s={text:{content:null==a?"Plus":a},icon:{content:null==r?"fi-plus":r}};if(Object.assign(i,s),i.display){i.layout={noImage:!0,float:null};const a=this.api.v1.model.query.getChildOfType(e,"image")||this.api.v1.model.query.getChildOfType(e,"graphic");if(a&&a.get("instance_of")){const e=this.api.v1.view.getView(a,t.getViewport());i.layout.float=this.api.v1.config.get("paywall.label.labelPosition")||e.get("fields.float"),i.layout.noImage=!!t.get("metadata.hideimage")}e.setFiltered("paywallLabel",i)}}else e.setFiltered("paywallLabel",null);
7e.setFiltered("paywall",k);const x=e.get("metadata.tagPlacement")||"underImage";e.setFiltered("tagPlacement.underImage","underImage"===x),e.setFiltered("tagPlacement.underText","underText"===x);const P=e.get("metadata.sectionPlacement")||"floating";if(e.setFiltered("sectionPlacement.floating","floating"===P),e.setFiltered("sectionPlacement.underImage","underImage"===P),e.setFiltered("sectionPlacement.underText","underText"===P),e.setFiltered("articleWidth",t.getPixelWidth()),e.setFiltered("autodata_css",f.parseCss(e)),e.setFiltered("autodata_content_css",f.parseCss(e,"filtered.autodata_content")),e.setFiltered("autodata_attributes",f.parseAttributes(e)),e.setFiltered("autodata_custom",f.parseCustomData(e)),this.autoFontSizeConfig.enabled&&(this.autoFontSizeDone=e.get("metadata.autoFontSizeDone")),"naver-xml"===this.api.v1.viewport.getName()){const t=this.api.v1.model.query.getChildOfType(e,"image"),i=t&&t.get("instance_of");this.imageServer&&i&&e.setFiltered("naverImageUrl",`${this.imageServer}?imageId=${i}&format=jpg&width=1200`)}const S=[],T=[],C=e.get("metadata.imageHoverScale");if(C){S.push("lab-has-hover-scale");const e="scale-up-subtle"===C?"1.05":"1.1";T.push(`--hover-scale: ${e}`)}const M=e.get("metadata.imageHoverFilter");if(M){const e=M.replace("filter-","");let t;S.push(`lab-has-hover-filter-${e}`),"brighten"===e?t="1.2":("darken"===e||"grayscale"===e)&&(t="0.8"),T.push(`--hover-filter-${e}: ${t}`)}e.setFiltered("hoverEffectClasses",S.join(" ")),e.setFiltered("hoverEffectStyles",T.join("; "))}onRendered(e,t){if(this.api.v1.app.mode.isEditor()&&this.autoFontSizeConfig.enabled){const i=()=>{const e=t.getMarkup().querySelector(".headline");_.removeFontSize(e),this.api.v1.tool.off("ended",i)};if("desktop"===t.viewport&&this.hasAutoFontSize&&e.get("metadata.autoFontSizeEnabled")&&(this.api.v1.tool.on("started",t=>{"fields.title"===t.key&&t.model===e&&i()}),e.get("state.autoFontSizeReRender")&&e.get("fields.title")&&!this.autoFontSizeDone&&e.get("metadata.autoFontSizeEnabled"))){const i=t.getMarkup().querySelector(".headline"),a=_.autoSizeText(i,this.autoFontSizeConfig);e.set("state.autoFontSizeReRender",!1,{notify:!1}),e.set("state.title",a,{notify:!1}),e.set("metadata.autoFontSizeDone",!0,{notify:!1}),e.set("fields.title",a)}}}onCreated(e){this.hasAutoFontSize&&null===e.get("metadata.autoFontSizeEnabled")&&e.set("metadata.autoFontSizeEnabled",!0,{notify:!1})}getSiteDomain(e){if(!e)return"";const t=this.api.v1.site.getSiteById(e);return t?t.domain:""}getImageUrl(e){return e?e.startsWith("http")?e:this.imageServer+e:""}}class x{constructor(e){this.api=e,this.isEditor=this.api.v1.app.mode.isEditor(),this.isFragmentMode=this.api.v1.app.mode.isFragmentMode(),this.lazyloadImages=!this.isEditor&&!!this.api.v1.config.get("imageLoading.lazy")}check(e,t){if(!this.lazyloadImages||t.getProperty("image.noLazy"))return!1;const i=lab_api.v1.model.query.getParentOfType(e,"row");if(i&&!this.isFragmentMode&&i.getModelIndex()<5)return!1;const a=lab_api.v1.model.query.getParentOfType(e,"slideshow");return!(a&&lab_api.v1.model.query.getParentOfType(a,"articleHeader")&&e.getModelIndex()<1)&&("slideshow"!==e.getType()||!lab_api.v1.model.query.getParentOfType(e,"articleHeader"))}}class P{constructor(e){this.api=e,this.lazyloadHelper=new x(e),this.api.v1.app.mode.isEditor()&&(this.cropIds=[],this.rootModel=this.api.v1.model.query.getRootModel(),this.frontcropBinding=this.frontCropChanged.bind(this),this.api.v1.model.bindings.bind(this.rootModel,"frontCrop",this.frontcropBinding),this.frontcropBinding(this.rootModel,"frontCrop",this.rootModel.get("frontCrop")),this.api.v1.ns.set("imageFilter.preview",this.prepareVisualFilters)),this.isFragmentMode=this.api.v1.app.mode.isFragmentMode(),this.isEditorMode=this.api.v1.app.mode.isEditor(),this.boundModels=[]}onInserted(e,t){this.isEditorMode&&e.get("instance_of")&&(this.boundModels.includes(e)||(this.api.v1.model.bindings.bind(e,"fields.imageCaption",this.imageUpdater.bind(this)),this.api.v1.model.bindings.bind(e,"fields.byline",this.imageUpdater.bind(this)),this.boundModels.push(e)))}imageUpdater(e,t,i){if(!i)return;const a=e.get("instance_of");if(!a)return;const r=t.includes("imageCaption"),s=t.includes("byline");this.api.v1.util.httpClient.get(`/ajax/node/get-node?id=${a}`,{resetCache:!0}).then(t=>{const n=t.data,o=n&&n.fields&&n.fields.caption||"",l=n&&n.fields&&n.fields.byline||"",d=r&&!o,c=s&&!l;if(!d&&!c)return;const g=n&&n.fields&&n.fields.extra_metadata_json&&n.fields.extra_metadata_json.currentLanguage||this.api.v1.config.get("contentLanguage")||"en",p=JSON.parse(JSON.stringify(n&&n.fields&&n.fields.extra_metadata_json||{})),u={};if(p.aiMetadata||(p.aiMetadata={}),p.aiMetadata[g]||(p.aiMetadata[g]={}),d){const t=e.get("fields.extra_metadata_json.currentLanguage")||"",a=!t||t===g;!(p.aiMetadata&&p.aiMetadata[g]&&p.aiMetadata[g].caption)&&a&&(u.caption=i,p.aiMetadata[g].caption=i,u.extra_metadata_json=p)}if(c&&(u.byline=i),0===Object.keys(u).length)return;const h={type:"image",id:a,fields:u},f=new FormData;f.append("json[id]",a),f.append("json[type]","image"),f.append("json[structure]",null),f.append("json[node]",JSON.stringify([h])),this.api.v1.util.httpClient.request("/ajax/node/save-node-and-data",{body:f,method:"POST"}).then(()=>{Sys.logger.debug("[Image] Synced caption/byline to backend:",a)}).catch(e=>{Sys.logger.error("[Image] Error syncing to backend:",e)})}).catch(e=>{Sys.logger.error("[Image] Error fetching backend node:",e)})}onViewHelper(e,t){if(e.parent){this.prepareForSlideshow(e,t);const i=t.getViewport();if(this.api.v1.view.getView(e.parent,i).get("metadata.hasFullWidth")){const t="mobile"===i?600:1800;e.setFiltered(`width.${i}`,t)}else e.setFiltered(`width.${i}`,null);
7e.setFiltered("allowFullwidth","image"!==e.parent.getType())}}onRender(e,t){this.setVisualFilters(e,t),e.setFiltered("lazyloadImages",this.lazyloadHelper.check(e,t));const i=e.get("fields.sourceUrl")||null,a=e.get("fields.displaySourceUrl"),r=i&&(null==a||"1"===a);e.setFiltered("sourceUrl",r?i:null),this.setCaptionOptions(e.getParent(),e,t);const s=t.get("fields.float");e.setFiltered("hasFloat",!!s&&"floatNone"!==s)}onRendered(e,t){if(!this.api.v1.app.mode.isEditor()||!this.cropIds.length)return;const i=parseInt(e.get("instance_of"),10);this.cropIds.includes(i)&&this.markFrontCrop(t,i)}setVisualFilters(e,t){e.setFiltered("filters",this.prepareVisualFilters(e,t))}prepareVisualFilters(e,t,i=!1){const a=[],r=e.get("metadata.filter_blur_active")?e.get("metadata.filter_blur_value")||0:null,s=e.get("metadata.filter_sepia_active")?e.get("metadata.filter_sepia_value")||0:null,n=e.get("metadata.filter_saturate_active")?e.get("metadata.filter_saturate_value")||1:null,o=e.get("metadata.filter_brightness_active")?e.get("metadata.filter_brightness_value")||1:null,l=e.get("metadata.filter_contrast_active")?e.get("metadata.filter_contrast_value")||1:null;return null!==r&&a.push(`blur(${r}px)`),null!==s&&a.push(`sepia(${s})`),null!==n&&a.push(`saturate(${n})`),null!==o&&a.push(`brightness(${o})`),null!==l&&a.push(`contrast(${l})`),i?{filter:a.join(" ")}:a.length?`filter: ${a.join(" ")};`:null}markFrontCrop(e,t){const i=document.createElement("span");i.classList.add("labicon-imgFrontCrop","is-frontcrop"),i.setAttribute("title","Image used as front crop. Click to edit"),i.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),this.api.v1.apps.start("ArticleSettings")},!1),e.getMarkup().appendChild(i)}frontCropChanged(e,t,i){let a=this.getImages(this.cropIds);this.cropIds=[],this.updateImages(a),i&&(i.pano&&i.pano.instance_of&&this.cropIds.push(i.pano.instance_of),i.height&&i.height.instance_of&&!this.cropIds.includes(i.height.instance_of)&&this.cropIds.push(i.height.instance_of),a=this.getImages(this.cropIds),this.updateImages(a))}getImages(e){const t=[];for(const i of e)t.push(...this.api.v1.model.query.getModelsByKeyAndValue("instance_of",i));return t}updateImages(e){for(const t of e)this.api.v1.model.addToRedrawQueue(t)}setCaptionOptions(e,t,i){const a=e?this.api.v1.view.getView(e,i.getViewport()):null,r=(e,t,i)=>{if(e){const t=e.get(i);if(!t&&null!==t)return!1;if(t)return!0}return!!t.get(i)};let s=r(a,i,"fields.displayCaption"),n=s||null===i.get("fields.displayCaption")&&!i.get("metadata.hidecaption");!this.api.v1.app.mode.isFront()||t.get("fields.imageCaption")||t.get("fields.byline")||t.get("filtered.sourceUrl")||(s=!1,n=!1);const o=r(a,i,"fields.expandableCaption"),l=r(a,i,"fields.truncateCaption"),d={display:s,displayDefault:n,truncate:l,expandable:o||l};t.setFiltered("captionOptions",d)}prepareForSlideshow(e,t){if(!e.parent||"slideshow"!==e.parent.getType())return;const i=this.api.v1.view.getView(e.parent,t.getViewport());if(i&&"1"===i.get("fields.originalAspectRatio")){const t=e.get("fields.originalWidth"),i=e.get("fields.originalHeight");return void(t&&i&&e.setFiltered("whRatio",i/t))}if(t.get("fields.whRatio"))return void e.setFiltered("whRatio",null);const a=e.get("fields.originalWidth"),r=e.get("fields.originalHeight");if(r&&a){const t=r/a;e.setFiltered("whRatio",t)}}}class S extends l{constructor({languageCode:e}={}){super("en"),this.languageCode=e||lab_api.v1.config.get("contentLanguage")}str(e,{data:t,noRender:i}={}){return lab_api.v1.locale.get(`dates.${e}`,{data:t,noRender:i})}timestampToNiceDate(e,t=!1){const i=(new Date).getTime(),a=new Date(1e3*e).getTime()-0,r=parseInt((i-a)/1e3/60,10);if(r<60)return r<1?this.str("now"):this.str("durationSince",{data:{count:r,period:t?this.str("min"):1===r?this.str("minute"):this.str("minutes"),ago:t?"":this.str("ago")}});if(r<1440){const e=parseInt(r/60,10);return this.str("durationSince",{data:{count:e,period:1===e?this.str("hour"):this.str("hours"),ago:t?"":this.str("ago")}})}if(parseInt(r/1440,10)<30){const e=parseInt(r/1440,10);return this.str("durationSince",{data:{count:e,period:1===e?this.str("day"):this.str("days"),ago:t?"":this.str("ago")}})}return this.format(this.timestampToDate(e),this.str("monthdayyear",{noRender:!0}))}}class T{constructor(e){this.api=e,this.dateTimeHelper=new S}onRender(e,t){const i=e.get("fields.modified")||e.get("fields.published");if(null!=i){const t=new Date(1e3*i);e.setFiltered("niceDate",this.dateTimeHelper.timestampToNiceDate(i)),e.setFiltered("publishedDate",this.dateTimeHelper.utcFormat(t,`${this.api.v1.locale.get("dates.monthdayyear",{noRender:!0})} ${this.api.v1.locale.get("dates.hourminute",{noRender:!0})}`)),e.setFiltered("isoDate",t.toISOString())}}}class C{constructor(e){this.api=e,this.baseApiUrl=this.api.v1.properties.get("front_api_url"),this.siteId=this.api.v1.properties.get("site.id"),this.cache=new Map,this.defaultMaxCount=100,this.isEditor=this.api.v1.app.mode.isEditor(),this.rootModel=this.api.v1.model.query.getRootModel()}onPrepareViewHelper(e,t){const i=e.get("fields.site")||this.siteId,a=t.get("fields.maxNoticesCount")||this.defaultMaxCount;let r=(e.get("fields.tags")||"").toLowerCase().split(",").filter(e=>""!==e);0===r.length&&(r=this.getNoticePageTags(),Sys.logger.info(`LiveFeed: No tags configured for the view, using notice page tags: ${r.join(", ")}`));const s=this.prepareTags(r),n=this.prepareQuery(s,!1),o=this.prepareQuery(s,!0),l=`${this.baseApiUrl}/notice?content=full&site_id=${i}&limit=${a}`;e.setFiltered("query",n),e.setFiltered("clientQuery",o),e.setFiltered("url",l)}getNoticePageTags(){const e=(this.rootModel.get("fields.noticeTagString")||"").toLowerCase();return Sys.logger.info(`LiveFeed: Fetching notice tags from root model field 'noticeTagString': ${e}`),e?e.split(/[+/]/).map(e=>e.trim()).filter(e=>""!==e):[]}onReady(e,t){const i=t.get("external"),a=e.get("filtered.noFetch")||!1,r=e.get("metadata.blackl
7ist")||[],s=t.get("fields.maxNoticesCount")||this.defaultMaxCount;if(!a&&i){e.setFiltered("noFetch",!0);const a=e.get("fields.pinnedNotices_json")||[];let n=i.result;if(this.api.v1.app.mode.isEditor()){const t=this.api.v1.model.query.getModelsByType("notice",e.children);for(const e of t)this.api.v1.model.delete(e,!0,!0)}n=n.slice(0,s);const o=!!t.get("fields.useInternalImageFormat");n.forEach(t=>{const{attribute:i={},field:s={}}=t.notice;if(r.includes(parseInt(i.id||0,10)))return void Sys.logger.warn(`Notice with id ${i.id} is blacklisted from Livefeed and will not be displayed.`);"object"==typeof s.bodytext&&(s.bodytext="");const{title:n,bodytext:l,published:d,modified:c,published_url:g,userName:p}=s,u=[];if(t.notice.children&&t.notice.children.image){const e=Array.isArray(t.notice.children.image)?t.notice.children.image:[t.notice.children.image];for(const t of e){let e={};if(s.structure_json&&t.attribute.id)try{const i=JSON.parse(s.structure_json);for(const a of i)if("bodytext"===a.type){const i=this.getStructure(a.children||[],t.attribute.id);e=i?i.metadata:{};break}}catch(e){Sys.logger.warn(`Failed to parse structure data: ${e.toString()}`)}e.hasFullWidth={desktop:!1,mobile:!1},u.push(this.getImageData(t,e||{},o))}}this.api.v1.model.insert.atPath({path:e.getPositionedPath(),data:{type:"notice",contentdata:{id:i.id,fields:{title:n,bodytext:l,published:d,modified:c,published_url:g,userName:p,pinned:a.includes(i.id)},tags:t.notice.tag?t.notice.tag.tag:""},state:{isNonPersistent:!0,editNonPersistent:!0},children:u},options:{silent:!0,index:a.includes(i.id)?0:void 0}})}),e.children.sort((e,t)=>a.includes(e.getId())?-1:a.includes(t.getId())?1:t.getId()-e.getId()),this.api.v1.app.mode.isEditor()&&(this.api.v1.model.addToRedrawQueue(e,!0),this.api.v1.app.save())}const n=this.api.v1.config.get("contentbox_settings.livefeed.updateFrequency")||[{range:[0,600],interval:10},{range:[600,1200],interval:30},{range:[1200],interval:60}];e.setFiltered("updateFrequency",JSON.stringify(n))}onRender(e,t){const i=t.get("fields.placeholder");e.setFiltered("placeholder",i||this.api.v1.locale.get("emptyState.noContentText",{noRender:!0})),e.setFiltered("initialRenderTime",(new Date).getTime()),e.setFiltered("dateStrings",JSON.stringify({now:this.api.v1.locale.get("dates.now",{noRender:!0}),monthdayyear:this.api.v1.locale.get("dates.monthdayyear",{noRender:!0}),hourminute:this.api.v1.locale.get("dates.hourminute",{noRender:!0}),durationSince:this.api.v1.locale.get("dates.durationSince",{noRender:!0}),minute:this.api.v1.locale.get("dates.minute",{noRender:!0}),minutes:this.api.v1.locale.get("dates.minutes",{noRender:!0}),hour:this.api.v1.locale.get("dates.hour",{noRender:!0}),hours:this.api.v1.locale.get("dates.hours",{noRender:!0}),day:this.api.v1.locale.get("dates.day",{noRender:!0}),days:this.api.v1.locale.get("dates.days",{noRender:!0}),ago:this.api.v1.locale.get("dates.ago",{noRender:!0})}))}onCreated(e){const t=!!this.api.v1.config.get("livefeedSettings.useInternalImageFormat");e.set("fields.useInternalImageFormat",t?1:0,{notify:!1})}onChildAdded(e,t){if(this.isEditor&&"notice"!==t.getType()){if(e.children.indexOf(t)>0)return;const i=this.api.v1.model.query.getModelsByType("notice",e.children).filter(e=>e.get("fields.pinned"));if(!i.length)return;let a=0;for(const t of i)e.children.indexOf(t)>a&&(a=e.children.indexOf(t));a>0&&this.api.v1.model.addChild(e,t,a,!1)}}prepareQuery(e,t=!1){const i=t?["(visibility_status:P OR visibility_status:H)"]:["visibility_status:P"];return e.length>0&&i.push(`(${e.join(" OR ")})`),`&query=${encodeURIComponent(i.join(" AND "))}`}prepareTags(e){return e.map(e=>{let t=e.trim();return t.indexOf(" ")>-1&&(t=`"${t}"`),`tag:${t}`})}getImageData(e,t,i=!1){return this.api.v1.model.serialize.apiToView({type:"image",data:e,meta:t,useInternalFormat:i})}onSettingsPanel(e,t,i){const a={layout:null,container:null};return{onDisplay:({model:e,view:t,config:i,markup:r,modal:s})=>{a.layout=r.querySelector("#layout"),a.container=r.querySelector(".horizontalOptions"),a.layout&&a.container&&a.layout.addEventListener("change",e=>{"1"===a.layout.value?a.container.classList.remove("lab-hidden"):a.container.classList.add("lab-hidden")}),function(e,t="endTimeUnix",i="endTime"){const a=e.querySelector(`#${t}`),r=e.querySelector(`#${i}`);if(a&&r){if(a.value){const e=/^\d+$/.test(a.value)?1e3*parseInt(a.value,10):a.value,t=new Date(e),i=e=>String(e).padStart(2,"0");r.value=`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}T${i(t.getHours())}:${i(t.getMinutes())}`}r.addEventListener("change",function(){a.value=this.value?Math.floor(new Date(this.value).getTime()/1e3):""})}}(r)},onHide:({model:e,view:t,config:i,markup:r,modal:s})=>{a.layout=null,a.container=null,e.setFiltered("noFetch",!1),this.api.v1.model.addToRedrawQueue(e,!0),this.api.v1.app.save()}}}getStructure(e,t){for(const i of e){if("image"===i.type&&i.node_id==t)return i;if(i.children){const e=this.getStructure(i.children,t);
7if(e)return e.metadata&&!e.metadata.bodyTextIndex&&i.metadata&&i.metadata.bodyTextIndex&&(e.metadata.bodyTextIndex=i.metadata.bodyTextIndex),e}}return null}}class M{constructor(e){this.api=e}onRender(e,t){const i=this.api.v1.config.get("contentbox_settings.adnuntiusAd.formats")||[],a=e.get("fields.format"),r=i.filter(e=>e.format===a)[0]||{};if(e.setFiltered("adData",r),e.setFiltered("isDebug",this.api.v1.util.request.hasQueryParam("debug")||e.get("metadata.isDebug")),!this.api.v1.app.mode.isEditor()){const t=e.parent&&!0===e.parent.get("metadata.hideOnTablet")&&"tablet"===this.api.v1.config.get("xUaDevice");e.setFiltered("hideOnTablet",t)}if(this.api.v1.app.mode.isEditor()){const t=this.api.v1.model.root.getType().replace("page_",""),r=[];i.forEach(e=>{if(e.selectable&&e.selectable.indexOf(t)>-1||e.selectableOn&&!0===e.selectableOn[t])if(e.format===a){const t={...e};t.selected=!0,r.push(t)}else r.push(e)}),e.setFiltered("formatConfigKeys",r)}const s=this.api.v1.config.get("contentbox_settings.adnuntiusAd.label")||"Annonse",n=e.get("fields.label")||s;if(e.setFiltered("label",n),e.setFiltered("displayLabel",n&&(e.get("metadata.css")||"").includes("display-label")),(e.get("metadata.css")||"").includes("sticky")){const t=`top: ${this.api.v1.config.get("contentbox_settings.adnuntiusAd.spacingTop")||120}px;`;e.setFiltered("spacingTop",t)}}}class ${constructor(e){this.api=e}onRender(e,t){const i=this.api.v1.model.query.getRootModel(),a=this.api.v1.config.get("contentbox_settings.googleAd.formats")||[],r=e.get("fields.format"),s=this.api.v1.config.get("adEnvironment")||{},n={bidding:s.bidding,hideOnTabletWidth:s.hideOnTabletWidth||1316,fetchMarginPercent:s.fetchMarginPercent||150,renderMarginPercent:s.renderMarginPercent||150,mobileScaling:s.mobileScaling||2};e.setFiltered("googleAds",n);const o=n.bidding&&n.bidding.provider&&"optidigital"===n.bidding.provider.name;e.setFiltered("isOptiDigital",o);const l=((e,t)=>{for(let i=0;i<t.length;i++)if(t[i].format===e)return{...t[i]};return{}})(r,a);if(l.key=e.get("metadata.key")||"row",n.bidding&&n.bidding&&n.bidding.provider&&n.bidding.provider.name&&"livewrapped"===n.bidding.provider.name){const e=()=>{const e=()=>(65536*(1+Math.random())||0).toString(16).substring(1);return`${e()+e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`};l.code&&l.code.endsWith("-1")&&(l.code+=`_${e()}`)}"mpu_top"===l.code&&(l.isMpuTop=!0),e.setFiltered("adData",l),e.setFiltered("isDebug",this.api.v1.util.request.hasQueryParam("debug")||e.get("metadata.isDebug"));const d=this.api.v1.config.get("contentbox_settings.googleAd.label")||"Annonse",c=e.get("fields.label")||d;if(e.setFiltered("label",c),!this.api.v1.app.mode.isEditor()){const t=e.parent&&!0===e.parent.get("metadata.hideOnTablet")&&"tablet"===this.api.v1.properties.get("xUaDevice");e.setFiltered("hideOnTablet",t)}if(this.api.v1.app.mode.isEditor()){const t=i.get("type").replace("page_",""),r=[];a.forEach(e=>{(e.selectable&&e.selectable.indexOf(t)>-1||e.selectableOn&&!0===e.selectableOn[t])&&r.push(e)}),e.setFiltered("formatConfigKeys",r)}if((e.get("metadata.css")||"").includes("sticky")){const t=`top: ${this.api.v1.config.get("contentbox_settings.googleAd.spacingTop")||120}px;`;e.setFiltered("spacingTop",t)}}}class A{constructor({path:e=null,selector:t=null,data:i={},options:a={}}={}){this.path=e,this.selector=t,this.data=i,this.options={persistentTarget:!0,intermediate:{useExisting:!0},...a}}}class I{constructor({key:e=null,path:t=null,selector:i=null,placeholder:a=null,metadata:r={},options:{shouldInsert:s=!0,wrap:n=null,skipIfOutOfBounds:o=!1,useIndex:l=!1,useBodyTextIndex:d=!1,useBodyTextHeadingIndex:c=!1,lastBodyTextHeading:g=!1,prepend:p=!1}={}}={}){this.key=e,this.path=t,this.selector=i,this.placeholder=a,this.metadata=r,this.options={shouldInsert:s,wrap:n,skipIfOutOfBounds:o,useIndex:l,useBodyTextIndex:d,useBodyTextHeadingIndex:c,lastBodyTextHeading:g,prepend:p}}}class D{constructor({type:e=null,contentdata:t=null,content_data:i=null,cssSettings:a={},children:r=[],metadata:s={}}={}){this.type=e,this.contentdata=t||i,this.children=r,this.metadata={...s},this.state={};const n=[];this.metadata.css&&n.push(this.metadata.css);for(const e of Object.keys(a))a[e]&&n.push(e);this.metadata.css=n.join(" ")}}class F{constructor(e){this.api=e,this.page=this.api.v1.model.query.getRootModel(),this.pageType=this.api.v1.model.root.getType().replace("page_",""),this.viewports=this.api.v1.viewport.getActive(),this.isEditor=this.api.v1.app.mode.isEditor(),this.cache=new Map,this.pageElements={},this.hideAds="1"===this.page.get("fields.hideAds")||!0===this.page.get("fields.hideAds"),this.hideTopBannerAd="1"===this.page.get("fields.hideTopBannerAd")||!0===this.page.get("fields.hideTopBannerAd"),this.hideSkyscraperAd="1"===this.page.get("fields.hideSkyscraperAd")||!0===this.page.get("fields.hideSkyscraperAd"),this.api.v1.util.request.hasQueryValue("lab_opts","infinitescroll")&&(this.pageType=`${this.pageType}_infinitescroll`)}hasRequiredElement(e){return void 0===this.pageElements[e]&&(this.pageElements[e]=!!this.api.v1.model.query.getModelByType(e)),this.pageElements[e]}insert(e,t=null){const i={clientSidePlacements:[]},a={},r=`insertDynamic.${this.pageType}.${e}`,s=`placements.${this.pageType}.${e}`;let n=!1;const o=(this.api.v1.config.get(s)||[]).filter(e=>!e.client||(e.requireElement&&!this.hasRequiredElement(e.requireElement)||(a[e.key]=e),!1));if(!this.cache.has(r)){const e=`insertDynamicAdditions.${this.pageType}`,t=this.api.v1.config.get(r)||[];Sys.logger.debug(`[DynamicDataHelper]: Found ${t.length} items from ${r}.`);const s=this.validateConditions(this.api.v1.config.get(e)||[]).reverse();n=s.length>0,Sys.logger.debug(`[DynamicDataHelper]: Found ${s.length} additions from ${e}.`);const o=[...t,...s];Sys.logger.debug(`[DynamicDataHelper]: Merged content has ${o.length} items.`);const l=(this.isEditor?o.filter(e=>!e.dynamicDataSettings||!e.dynamicDataSettings.hideInEditMode):o).filter(e=>{if(e.placement&&e.placement.key&&a[e.placement.key]){const t={...e,placementData:a[e.placement.key]};return i.clientSidePlacements.push(t),!1}return!0});Sys.logger.debug(`[DynamicDataHelper]: Filtered content has ${l.length} items. ${i.clientSidePlacements.length} items are client-side placements.`),this.cache.set(r,l)}if(!this.cache.has(s)){if(n){const e=`placementsAdditions.${this.pageType}`,t=this.api.v1.config.get(e)||[];o.push(...t)}this.cache.set(s,o.map(e=>new I(e)))}const l=this.parse(this.cache.get(r),this.cache.get(s),e,t);for(const e of l)e.selector?this.api.v1.model.insert.bySelector({selector:e.selector,data:e.data,options:e.options}):e.path&&this.api.v1.model.insert.atPath({path:e.path,data:e.data,options:e.options});return i}validateConditions(e){return e.filter(e=>{if(e.excludeDuplicates&&this.api.v1.model.query.getModelByType(e.type))return Sys.logger.debug(`[DynamicDataHelper]: Element of type "${e.type}" already exist on page. Skipping.`),!1;if(e&&e.conditions){const{conditions:t}=e;for(const i of t){const{field:t,operator:a,value:r=""}=i,s=this.page.get(t||"",void 0,!0);if(void 0!==s)switch(a){case"equals":if(s!==r)return Sys.logger.debug(`[DynamicDataHelper]: Condition for inserting element type "${e.type}" failed. Field: "${t}", operator "${a}", value: "${r}", page value: "${s}".`),!1;break;case"notEquals":if(s===r)return Sys.logger.debug(`[DynamicDataHelper]: Condition for inserting element type "${e.type}" failed. Field: "${t}", operator "${a}", value: "${r}", page value: "${s}".`),!1;break;case"contains":if(!s.includes(r))return Sys.logger.debug(`[DynamicDataHelper]: Condition for inserting element type "${e.type}" failed. Field: "${t}", operator "${a}", value: "${r}", page value: "${s}".`),!1;break;case"notContains":if(s.includes(r))return Sys.logger.debug(`[DynamicDataHelper]: Condition for inserting element type "${e.type}" failed. Field: "${t}", operator "${a}", value: "${r}", page value: "${s}".`),!1;break;default:return Sys.logger.warning(`[DynamicDataHelper]: Operator "${a}
7" is not valid. The condition fails and the item is not inserted onto the page.`),!1}else Sys.logger.debug(`[DynamicDataHelper]: Condition for inserting element type "${e.type}" ignored. Value of field: "${t}" is undefined.`)}return Sys.logger.debug(`[DynamicDataHelper]: All conditions (${t.length}) for inserting element type "${e.type}" accepted. Will insert.`),!0}return Sys.logger.debug(`[DynamicDataHelper]: No validation specified for inserting element type "${e.type}". Will insert.`),!0})}parse(e=[],t=[],i="desktop",a=null){const r=[];for(const s of e){const[n]=t.filter(({key:e})=>e===s.placement.key);if(n)if(this.acceptPath(n.path,a)){const t=this.create(s,n,e,i);if(null!==t&&(t.data.metadata.viewportBlacklist=this.viewports.filter(e=>e!==i),r.push(t),Number.isInteger(t.options.interval)&&Number.isInteger(t.options.index))){const{interval:a}=s.placement,{index:o}=s.placement;let l=o;const d=this.api.v1.model.query.getModelByPath(t.path);if(d){const t=d.getPersistentChildren().length;for(;l<t;){const t=JSON.parse(JSON.stringify(s));t.options.index=l,t.placement.index=l,t.type="placeholder_ad";const o=JSON.parse(JSON.stringify(n));o.selector="";const d=this.create(t,o,e,i);null!==d&&(d.data.metadata.viewportBlacklist=this.viewports.filter(e=>e!==i),r.push(d)),l+=a}}}}else Sys.logger.debug(`[DynamicDataHelper]: Path "${n.path}" not allowed. Filter: "${a}", key: "${s.placement.key}"`);else Sys.logger.debug(`[DynamicDataHelper]: No placement found with key "${s.placement.key}"`)}return r}create(e,t,i,a="desktop"){if(this.filter(e)){const i=this.assemble(e,t);t.path&&t.selector&&(this.api.v1.model.query.getModelBySelector(t.selector)||this.api.v1.model.insert.atPath({path:t.path,data:{type:"placeholder",selector:t.selector,metadata:{...t.metadata||{},key:t.key},state:{isNonPersistent:!0}},options:{index:0,useExisting:!0,prepend:!0,silent:!0}}));const r={...e.options,prepend:t.options.prepend||!1,silent:!0};let{path:s}=t,n=e.placement.index||0,o=null;if(t.selector)o=this.api.v1.model.query.getModelBySelector(t.selector);else if(t.path){const e=this.getModelsByPath(t.path,a);e.length&&(o=t.options.useBodyTextIndex||t.options.useBodyTextHeadingIndex||t.options.lastBodyTextHeading?e.find(e=>"bodytext"===e.getType()):t.options.shouldInsert?e[0].children[n]:e[n])}if(o||!t.options.skipIfOutOfBounds){if(o){n=this.api.v1.model.query.getIndex(o);let e=o.getParent();if("mobile"===a){if(n>0&&n<e.children.length){let t=e.children[n];for(;t;){const i=o.get("width",a,!0);if(void 0===i||100===i)break;t=e.children[++n]}}e.get("metadata.hasRowTitle")&&(0===n||n>=e.children.length)&&(o=e,e=o.getParent(),n=this.api.v1.model.query.getIndex(o),s=e.getPositionedPath())}t.options.useIndex&&n<e.children.length&&(r.index=n),t.options.shouldInsert||(s=e.getPositionedPath(!0))}else r.prepend=!1;return new A({data:i,options:r,selector:t.selector,path:s})}}return null}assemble(e,t){let i=new D(e);return t.selector||(i.metadata={...i.metadata,...t.metadata,css:t.metadata.css?`${i.metadata.css} ${t.metadata.css}`:i.metadata.css||""}),t.options.wrap&&(i=new D({type:t.options.wrap.type,metadata:t.options.wrap.metadata,children:[i]})),t.options.skipIfOutOfBounds&&(i.metadata.skipIfOutOfBounds=!0),t.options.useBodyTextIndex?i.metadata.bodyTextIndex=e.placement.index||0:t.options.useBodyTextHeadingIndex&&(i.metadata.bodyTextHeadingIndex=e.placement.index||0),t.options.lastBodyTextHeading&&(i.metadata.lastBodyTextHeading=!0),i.metadata.options=e.options||{},i.state.isNonPersistent=!0,i}acceptPath(e,t){return!e||!t||e===t}filter(e){return"googleAd"!==e.type&&"adnuntiusAd"!==e.type||(Sys.logger.debug(`[DynamicDataHelper]: Ad insertion requested. ad unit=${e.placement.key} hideAds=${this.hideAds}, hideTopBannerAd=${this.hideTopBannerAd}, hideSkyscraperAd=${this.hideSkyscraperAd}`),"topbanner"===e.placement.key&&this.hideTopBannerAd?(Sys.logger.debug("[DynamicDataHelper]: Top banner ad is hidden. Skipping insertion."),!1):e.placement.key.includes("skyscraper_")&&this.hideSkyscraperAd?(Sys.logger.debug("[DynamicDataHelper]: Skyscraper ad is hidden. Skipping insertion."),!1):!this.hideAds)}getModelsByPath(e,t){const i=`getByPath-${e}`;return this.cache.has(i)||this.cache.set(i,this.api.v1.model.query.getModelsByPath(e,!0,!0)),this.cache.get(i)}}class O{constructor(e){this.api=e,this.request=this.api.v1.util.request}listen(){const e={selector:this.request.getQueryParam("lab_selector")||"contentFromPath",path:this.request.getQueryParam("lab_path"),guid:this.request.getQueryParam("lab_guid")};(e.guid||e.path)&&this.api.v1.model.on("insert",t=>{const i=e.guid?this.getModelByGuid(e.guid,t):this.getModelByPath(e.path,t);if(i)return Sys.logger.debug(`[FragmentHelper] Element found. Path: ${i.getPositionedPath()}, GUID: ${i.getGuid()}.`),i.setSelector(e.selector),"embed"===lab_api.v1.viewport.getName()?this.appendToRoot(t,i):[i]})}getModelByGuid(e){return Sys.logger.debug(`[FragmentHelper] Will filter elements by guid: "${e}".`),this.api.v1.model.query.getModelByGuid(e)}getModelByPath(e,t){Sys.logger.debug(`[FragmentHelper] Will filter elements by path: "${e}".`);const i=this.api.v1.util.string.parsePath(e);if(!i[0])return null;const a=this.api.v1.model.query.getModelsByType(i[0].base,t);return this.api.v1.model.query.getModelByPath(e,!0,!1,a)}appendToRoot(e,t){const i=e[0];return i.children=[t],[i]}}class j{constructor(e){this.api=e,this.paths={main:["parent","guid","type","tags"],fields:["feedId","byline","bylineImage","paywall","published","published_url","site_alias","
7site_id","subtitle","subtitleHTML","teaserSubtitle","somedescription","title","teaserTitle","titleHTML","seolanguage","seotitle","sometitle","kicker","teaserKicker","showcomments"],fieldsAuto:["section_tag","tags"],fieldsNative:["section"],fieldMap:{subtitle:"description",subtitleHTML:"descriptionHTML",somedescription:"someDescription",teaserSubtitle:"teaserDescription",seolanguage:"seolanguage",seotitle:"seoTitle",sometitle:"someTitle",published_url:"url",section_tag:"section"},fallback:{url:"url"}},this.frontUrl=this.api.v1.site.getSite().domain||this.api.v1.properties.get("customer_front_url"),this.imageServer=this.api.v1.properties.get("image_server")}jsonData(e){Sys.logger.debug("[PageExport] Will export page as JSON-data");const t=this.api.v1.model.serialize.model(e);delete t.guid;const i=e.getType();if("page_article"===i&&!this.api.v1.config.get("showHiddenTagsOnArticle")||"page_notice"===i&&!this.api.v1.config.get("showHiddenTagsInNotices")){t.tags=this.filterHiddenTags(t.tags);const e=this.api.v1.properties.get("tags_as_terms");e&&(t.term.keyword=this.filterHiddenTags(t.term.keyword,e))}return{page:t,result:"page_article"===i?this.exportArticle():this.exportFront()}}oembed(e){if("page_article"!==e.getType())return Sys.logger.warn("[PageExport] Will not export current page type as oEmbed."),{};const t=(this.api.v1.util.request.getQueryParam("lab_opts")||"").split(",");let i="full";t.includes("embed_type_teaser")&&(t.splice(t.indexOf("embed_type_teaser"),1),i="teaser");const a=t.filter(e=>e.startsWith("embed_no_")),r=["embed_padding"],s=[];for(const e of a)s.push(`dac-${e.replace("embed_","").replace(/_/g,"-")}`);for(const e of r)t.includes(e)&&s.push(`dac-${e.replace("embed_","").replace(/_/g,"-")}`);return Sys.logger.debug("[PageExport] Will export page as oEmbed"),{version:"1.0",type:"rich",width:"",height:"",title:this.api.v1.util.string.sanitizeString(e.get("fields.title")||""),url:e.get("filtered.url")||"",author_name:this.api.v1.site.getSite().display_name||this.api.v1.site.getSite().alias,author_url:this.frontUrl,provider_name:"Labrador",provider_url:"http://www.labradorcms.com/",html:`<div class="labrador-cms-embed" data-lab-style="${s.join(" ")} dac-embed-${i}" data-lab-content="${i}" data-lab-id="${e.get("id")}" data-lab-site="${e.get("filtered.site.domain_no_protocol")}"><script async defer src="${this.frontUrl}/embed.js?v=335"><\/script></div>`}}exportArticle(){}exportFront(){const e=this.api.v1.model.query.getModelByType("dropZone");return this.api.v1.model.query.getModelsByType("article",[e]).map(e=>this.serialize(e)).filter(e=>!!e)}serialize(e){const t=this.api.v1.model.serialize.model(e);if(!t||!t.fields)return null;const i=!!t.fields.origin_data_json,a={images:[],width:e.getWidth("desktop"),metadata:t.metadata,isAutomatic:i,siteDomain:this.frontUrl},r=i?t.fields.origin_data_json:t.fields,s=[...this.paths.fields,...i?this.paths.fieldsAuto:this.paths.fieldsNative];for(const e of this.paths.main)a[e]=t[e]||"";for(const e of s)a[this.paths.fieldMap[e]||e]=r[e]||"";a.teaserSubtitle=r.teaserSubtitle||"";const n=this.api.v1.config.get("showHiddenTagsOnFront");if(i){if(!a.byline){const e=(r.full_bylines||[]).shift();a.byline=e?`${e.firstname} ${e.lastname}`:"",a.bylineImage=a.bylineImage||(e||{}).imageUrl}if("string"==typeof a.tags){const e=a.tags.split(",").map(e=>(e||"").trim());a.tags=n?e:this.filterHiddenTags(e)}a.site_alias=(this.api.v1.site.getSiteById(r.site_id)||{}).alias,a.id=parseInt(r.id,10)}else a.titleHTML=a.title,a.title=this.cleanText(a.title),a.descriptionHTML=a.description,a.description=this.cleanText(a.description),a.kickerHTML=a.kicker,a.kicker=this.cleanText(a.kicker),a.id=t.id,a.tags=n?a.tags:this.filterHiddenTags(a.tags);a.section_tag=a.section,a.url&&!a.url.startsWith("http")&&(a.url=this.frontUrl+a.url);for(const e of Object.keys(this.paths.fallback))a[e]||(a[e]=r[this.paths.fallback[e]]||"");a.full_bylines=(i?r.full_bylines:r.full_bylines_json)||[],a.full_bylines=a.full_bylines.map(e=>({firstname:e.firstname,lastname:e.lastname,description:e.description,imageUrl:this.getImageUrl(e.imageUrl)})),i&&a.byline&&a.full_bylines.unshift({firstname:a.byline,lastname:"",imageUrl:this.getImageUrl(a.bylineImage)}),!a.byline&&a.full_bylines.length&&(a.byline=`${a.full_bylines[0].firstname} ${a.full_bylines[0].lastname}`,a.bylineImage=a.full_bylines[0].imageUrl.replace(this.imageServer,""));const o=lab_api.v1.config.get("customAdapterFields.article")||[];if(o)for(const e of o)if(e){let i=t.fields[e]||"";!i&&t.fields.origin_data_json&&(i=t.fields.origin_data_json[e]||""),i&&(a[e]=i)}a.paywall="0"!==a.paywall&&!!a.paywall;const l=this.api.v1.model.query.getChildOfType(e,"image");if(l){const e=l.get("filtered.image");if(e){const t=l.get("fields.altText")||"",i=l.get("fields.imageByline")||r.imageByline||"",s=l.get("fields.imageCaption")||"";a.images.push({url:e,jpg:`${e}&format=jpg`,webp:`${e}&format=webp`,url_size:e,default:"1",id:l.get("instance_of"),altText:t,byline:i,caption:s})}}return a}cleanText(e){return this.api.v1.util.string.sanitizeString(e).replace(/&amp;/g,"&")}getImageUrl(e){return e?e.startsWith("http")?e:this.imageServer+e:""}filterHiddenTags(e,t=!1){const i=(this.api.v1.config.get("tagsToHide")||"").split(",").map(e=>(e||"").trim());return t?(e||[]).filter(e=>!i.includes(e.name)):(e||[]).filter(e=>!i.includes(e))}}class R{constructor(e){this.api=e}register(e,t){if(this.api.v1.app.mode.isFragmentMode())return void Sys.logger.debug("[EsiHelper] Labrador is is fragment-mode. Will not register ESI. Skipping.");if(!e)return void Sys.logger.debug("[EsiHelper] Missing model, cannot process. Skipping.");const i=this.api.v1.config.get("footer.include");if(i&&i.pageId){const t=this.getEsiUrl(i);t?"client"===i.render?e.setFiltered("renderFooter.url",t):this.insertEsi(e,t,"esi_footer"):Sys.logger.warning("[EsiHelper] Cannot prepare url for footer-fragment. Missing url.")}const a=this.api.v1.config.get("header.include"),r=this.api.v1.config.get("header.includes")||[],s=[];if(a&&a.pageId){const t=this.insertHeader(a,e);t&&s.push(t)}for(const t of r)if(t&&t.pageId){const i=this.insertHeader(t,e);i&&s.push(i)}e.setFiltered("renderHeader.urls",s.map(e=>`'${e}'`).join(", "))}getEsiUrl(e){if(!e.pageId)return null;const t=["pageId","path","structureType","start","count"],i=[];if(t.forEach(t=>{void 0!==e[t]&&""!==e[t]&&null!==e[t]&&i.push(`${t}=${e[t]}`)}
7),i.length===t.length){let e=this.api.v1.properties.get("front_api_url");return this.api.v1.app.mode.isEditor()&&"https:"===document.location.protocol&&(e=e.replace("http:","https:")),`${e}/fragment/structure/?${i.join("&")}`}return null}insertEsi(e,t,i){Sys.logger.debug(`[EsiHelper] Will insert fragment for selector: "${i}", url: "${t}".`),this.api.v1.model.insert.atPath({path:e.getPath(),data:{type:"esi",selector:i,contentdata:{fields:{url:t,identifier:i}},state:{isNonPersistent:!0}},options:{frontpage:!0,articlepage:!0}}),this.api.v1.app.mode.isEditor()&&this.fetchEditorEsi(t,`${i}`)}insertHeader(e,t){const i=this.getEsiUrl(e);if(i){if("client"===e.render)return Sys.logger.debug(`[EsiHelper] Found url for header-fragment to render in client: "${i}".`),i;this.insertEsi(t,i,"esi_header")}else Sys.logger.warning("[EsiHelper] Cannot prepare url for header-fragment. Missing url.");return null}fetchEditorEsi(e,t){this.api.v1.view.on("domRendered",(i,a)=>{const r=this.api.v1.model.query.getModelBySelector(t);r&&(Sys.logger.debug(`EsiHelper.fetchEditorEsi: Will fetch esi-substitute for editor. Selector: ${t}, url: ${e}`),this.api.v1.util.httpClient.get(e,{credentials:"omit",type:"text"}).then(e=>{const i=lab_api.v1.view.getView(r,a),s=document.createElement("template");if(s.innerHTML=e,Sys.logger.debug(`EsiHelper.fetchEditorEsi: Esi-substitute fetched. Selector: ${t}, element-count: ${s.content.children.length}`),i.markup){for(const e of[...s.content.children])i.markup.parentElement.insertBefore(e,i.markup);i.markup.remove()}else Sys.logger.warn(`EsiHelper.fetchEditorEsi: Element markup not found. Cannot insert dom-element(s). Selector: ${t}`)}).catch(e=>{Sys.logger.warning(`EsiHelper.fetchEditorEsi: Esi-substitute could not be fetched. Selector: ${t}, error: ${e}`)}))})}}class L{static mediaQueries={desktop:"(min-width:1024px)",mobile:"(max-width: 1023px)"};static createStyle({model:e,view:t,viewports:i,styleCollection:a="content_inline_spacing",mediaQueries:r=this.mediaQueries,returnArray:s=!1}){const n=[],o=`[data-element-guid="${e.getGuid()}"] .content`;for(const s of i)if(r[s]){const i=lab_api.v1.style.getStyles(e,t,a,s);i&&n.push(`@media ${r[s]} { ${o} { ${i} } }`)}return s?n:`<style>${n.join("\n")}</style>`}}const E=class{constructor(){this.name="Baseview",this.api=null,this.pageAPI=null,this.useSpacing=!1}onReady(e){if(this.api=e,Sys.logger.debug(`[Front] Running Baseview version ${this.api.v1.config.get("view_version")}, build ${this.api.v1.config.get("view_build.baseview.version")}`),"json"===this.api.v1.viewport.getName()&&"PageExport.jsonData"===this.api.v1.config.get("viewports.json.renderer")){const e=new j(this.api);this.api.v1.view.on("rendered",(t,i)=>[JSON.stringify(e.jsonData(this.api.v1.model.query.getRootModel()),null,4)])}if("oembed"===this.api.v1.viewport.getName()&&"PageExport.oembed"===this.api.v1.config.get("viewports.oembed.renderer")){const e=new j(this.api);this.api.v1.view.on("rendered",(t,i)=>[JSON.stringify(e.oembed(this.api.v1.model.query.getRootModel()),null,4)])}new O(this.api,this.api.v1.util.request).listen()}onAcceptContent(){const e=this.api.v1.model.query.getRootModel();if(this.useSpacing=!(!e||!e.get("fields.style_spacing")),"editor"===this.api.v1.app.mode.getSimulatedMode())return void Sys.logger.debug("[Front] Labrador is running in simulated editor-mode. Skipping DynamicDataHelper and EsiHelper.");const t=new F(this.api),{clientSidePlacements:i=[]}=t.insert(this.api.v1.viewport.getName());i.length>0&&!e.get("fields.hideAds")&&(e.setFiltered("clientSidePlacements",JSON.stringify(i)),e.setFiltered("clientSideResources",JSON.stringify({configObject:{viewConfig:{config:{customer:{contentbox_settings:{adnuntiusAd:this.api.v1.config.get("contentbox_settings.adnuntiusAd")||{},googleAd:this.api.v1.config.get("contentbox_settings.googleAd")||{}},adEnvironment:this.api.v1.config.get("adEnvironment")||{}}}}},site:this.api.v1.site.getSite(),device:this.api.v1.properties.get("device"),debug:this.api.v1.util.request.hasQueryParam("debug")||!1}))),e&&"page_article"===e.getType()&&m.insertIfNeeded(this.api,e),new R(this.api).register(e,this.api.v1.site.getSite().alias),this.api.v1.util.request.hasQueryValue("lab_opts","hideHeader")&&(Sys.logger.debug("[Front] Hiding header and logo based on url param lab_opts=hideHeader ..."),e.setFiltered("pageHeaderDisplay","hideHeaderAndLogo")),this.api.v1.util.request.hasQueryValue("lab_opts","hideFooter")&&(Sys.logger.debug("[Front] Hiding footer based on url param lab_opts=hideFooter ..."),e.setFiltered("pageFooterDisplay","hideFooter")),this.api.v1.util.request.hasQueryValue("lab_opts","hideComments")&&(Sys.logger.debug("[Front] Hiding Hyvor comments based on url param lab_opts=hideComments ..."),e.setFiltered("pageCommentsDisplay","hideComments"))}onRender(e,t){this.useSpacing&&e.setFiltered("styleSheets",L.createStyle({model:e,view:t,viewports:["desktop","mobile"],returnArray:!1}))}onRendered(e,t){const i=e.get("metadata.elementClass");if(!i)return;const a=t.getMarkup();
7if(a)i.trim().split(/\s+/).filter(Boolean).forEach(e=>a.classList.add(e));else{const e=t.getMarkupString();if(!e)return;const a=i.trim().split(/\s+/).filter(e=>e&&/^[a-zA-Z0-9_-]+$/.test(e)).join(" ");if(!a)return;t.setMarkupString(e.replace('class="',`class="${a} `))}}onMapData(e){if("text_title"===e.type||"text_subtitle"===e.type){if(!e.contentdata||!e.contentdata.fields)return;const t={...e};return t.type="text_singleline",t.contentdata.fields.text=t.contentdata.fields.title||t.contentdata.fields.subtitle,"text_subtitle"===e.type?(t.contentdata.fields.elementType={value:"h3"},delete t.contentdata.fields.subtitle):(t.contentdata.fields.elementType={value:"h2"},lab_api.v1.util.object.set("attributes.text_size.vp.desktop",lab_api.v1.util.object.get("attributes.text_size.vp.desktop",t.contentdata.fields.text)||44,t.contentdata.fields.text),delete t.contentdata.fields.title),t.lab_internal_format=!0,t}}}},
7"./build/modules/client_package.js":(e,t,i)=>{i.r(t),i.d(t,{config:()=>a,properties:()=>r,templates:()=>s});const a={view_version:"1.4.19",view_name:"Baseview",view_build:{baseview:{releasenotes:"1419:19",userReleasenotes:"1419:37",version:605}},viewports:{mobile:{deviceWidth:480},desktop:{deviceWidth:1058}},imageUrlOptions:{extension:".webp",nameField:"instance_of"},viewHelper:{image:{viewports:["desktop","mobile"],pixelDensityFactor:2}},grid:{total_grid_spans:12,grid_prefix:{mobile:"small-",desktop:"large-"},abs_grid_prefix:{mobile:"small-abs-",desktop:"large-abs-"}},style:{definitions:{css_style:{requirePath:!1,path:"metadata.css_style",items:[{prefix:"style-",postfix:""}]},style_preset:{path:"metadata.style_preset",items:[{viewport:"no_viewport"}]},text_size:{requirePath:!0,path:"text_size",items:[{viewport:"desktop",fallback:"no_viewport",prefix:"t"},{viewport:"mobile",prefix:"tm"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},font_weight:{requirePath:!0,path:"font_weight",items:[{viewport:"desktop",fallback:["no_viewport","mobile"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"m-"}]},bold:{requirePath:!0,path:"bold",items:[{viewport:"no_viewport"}]},text_background_color:{requirePath:!0,path:"text_background_color",items:[{viewport:"desktop",fallback:["no_viewport","mobile"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_",nullValue:"no_bg_color"}]},text_background_color_op:{requirePath:!0,path:"text_background_color_op",items:[{viewport:"desktop",fallback:["no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_",nullValue:"no_bg_color"}]},custom_text_background_color:{requirePath:!0,path:"custom_text_background_color",items:[{prefix:"background-color:",postfix:" !important;"}]},custom_text_color:{requirePath:!0,path:"custom_text_color",items:[{prefix:"color:",postfix:" !important;"}]},custom_text_shadow:{requirePath:!0,path:"custom_text_shadow",items:[{prefix:"text-shadow:"}]},text_color:{requirePath:!0,path:"text_color",items:[{viewport:"desktop",fallback:["no_viewport","mobile"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_"}]},text_align:{requirePath:!0,path:"text_align",items:[{viewport:"desktop",fallback:["no_viewport","mobile"],prefix:"align-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_text_align_align-"}]},fontface:{requirePath:!0,path:"fontface",items:[{prefix:"font-"}]},italic:{requirePath:!0,path:"italic",items:[{viewport:"desktop",fallback:["no_viewport","mobile"],nullValue:"no_italic"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"m-",nullValue:"no_italic"}]},underline:{requirePath:!0,path:"underline",items:[{viewport:"no_viewport"}]},texttransform:{requirePath:!0,path:"texttransform",items:[{viewport:"no_viewport"}]},strikethrough:{requirePath:!0,path:"strikethrough",items:[{viewport:"no_viewport"}]},text_shadow:{requirePath:!0,path:"text_shadow",items:[{viewport:"no_viewport"}]},animate:{requirePath:!0,path:"animate",items:[{viewport:"no_viewport"}]},background_color:{requirePath:!1,path:"metadata.background_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"",postfix:""},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_",postfix:"",nullValue:"no_bg_color"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},background_opacity:{requirePath:!1,path:"metadata.background_color_op",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"",postfix:""},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_",postfix:""}]},background_gradient:{requirePath:!1,path:"metadata.gradient",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_"}]},border_color:{requirePath:!1,path:"metadata.border_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_",nullValue:"no_border_color"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},border_side:{requirePath:!1,path:"metadata.border_side",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_",nullValue:"no_border_side"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},border_width:{requirePath:!1,path:"metadata.border_width",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"border_width_",nullValue:""},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"border_width_mobile_",nullValue:""}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},border_style:{requirePath:!1,path:"metadata.border_style",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"border-style-",nullValue:"no_border_style"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"border-style-mobile_",nullValue:"no_border_style"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},border_radius:{requirePath:!1,path:"metadata.border_radius",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"border-radius-",
7nullValue:"no_border_radius"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"border-radius-mobile_",nullValue:"no_border_radius"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},rounded_image_edge:{requirePath:!1,path:"metadata.rounded_image_edge",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"rounded-image-edge-",nullValue:"no_rounded-image-edge"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"rounded-image-edge-mobile_",nullValue:"no_rounded-image-edge-mobile"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},rounded_image:{requirePath:!1,path:"metadata.rounded_image",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"]}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},layout:{requirePath:!1,path:"metadata.layout",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"layout_mobile_"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},fitContent:{requirePath:!1,path:"metadata.fitContent",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"fitContent_mobile_"}],template:"{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"},shadow:{requirePath:!1,path:"metadata.shadow",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"shadow_mobile_"}]},metadata_text_color:{requirePath:!1,path:"metadata.text_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_text_color-_"}]},hover_text_color:{requirePath:!1,path:"metadata.hover_text_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_hover_text_color-_"}]},hover_bg_color:{requirePath:!1,path:"metadata.hover_bg_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_hover_bg_color-_"}]},hover_border_color:{requirePath:!1,path:"metadata.hover_border_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_hover_border_color-_"}]},image_overlay:{requirePath:!1,path:"metadata.image_overlay",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_"}]},image_overlay_opacity:{requirePath:!1,path:"metadata.image_overlay_opacity",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_"}]},image_gradient:{requirePath:!1,path:"metadata.image_gradient",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_"}]},image_gradient_opacity:{requirePath:!1,path:"metadata.image_gradient_opacity",items:[{viewport:"desktop",fallback:["mobile","no_viewport"]},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"color_mobile_"}]},float:{requirePath:!1,path:"metadata.float",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"desktop-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-"}]},spacing:{requirePath:!1,path:"fields.spacing",items:[{prefix:"spacing-",nullValue:"default"}]},spacing_outer_top:{requirePath:!1,path:"metadata.spacing_outer_top",items:[{viewport:"current_viewport",prefix:"margin-top:",postfix:"% !important;"}]},spacing_outer_right:{requirePath:!1,path:"metadata.spacing_outer_right",items:[{viewport:"current_viewport",prefix:"margin-right:",postfix:"% !important;"}]},spacing_outer_bottom:{requirePath:!1,path:"metadata.spacing_outer_bottom",items:[{viewport:"current_viewport",prefix:"margin-bottom:",postfix:"% !important;"}]},spacing_outer_left:{requirePath:!1,path:"metadata.spacing_outer_left",items:[{viewport:"current_viewport",prefix:"margin-left:",postfix:"% !important;"}]},spacing_inner_top:{requirePath:!1,path:"metadata.spacing_inner_top",
7items:[{viewport:"current_viewport",prefix:"padding-top:",postfix:"% !important;"}]},spacing_inner_right:{requirePath:!1,path:"metadata.spacing_inner_right",items:[{viewport:"current_viewport",prefix:"padding-right:",postfix:"% !important;"}]},spacing_inner_bottom:{requirePath:!1,path:"metadata.spacing_inner_bottom",items:[{viewport:"current_viewport",prefix:"padding-bottom:",postfix:"% !important;"}]},spacing_inner_left:{requirePath:!1,path:"metadata.spacing_inner_left",items:[{viewport:"current_viewport",prefix:"padding-left:",postfix:"% !important;"}]},pull_up:{requirePath:!1,path:"metadata.pull_up",items:[{viewport:"desktop",prefix:"large-pull-"},{viewport:"mobile",prefix:"small-pull-"}]},content_text_align:{requirePath:!1,path:"metadata.text_align",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"align-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_text_align_align-"}]},content_vertical_text_align:{requirePath:!1,path:"metadata.vertical_text_align",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"vertical-text-align-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-vertical-text-align-"}]},text_align_row:{requirePath:!1,path:"metadata.text_align_row",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"align-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile_text_align_align-"}]},vertical_align:{requirePath:!1,path:"metadata.vertical_align",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"grid-vas-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-grid-vas-"}]},vertical_align_content:{requirePath:!1,path:"metadata.vertical_align_content",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"grid-align-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-grid-align-"}]},custom_background_color:{requirePath:!1,path:"metadata.custom_background_color",items:[{prefix:"background-color:",postfix:";"}]},custom_background_color_L3:{requirePath:!1,path:"metadata.box_custom_background",items:[{prefix:"background-color:",postfix:";"}]},custom_border_color:{requirePath:!1,path:"metadata.custom_border_color",items:[{prefix:"border-color:",postfix:" !important;"}]},movableContainer:{requirePath:!0,items:[{viewport:"desktop",value:"desktop-movable-container",nullValue:""},{viewport:"mobile",value:"mobile-movable-container",nullValue:""}]},movableElement:{requirePath:!0,items:[{viewport:"desktop",value:"desktop-movable-element",nullValue:""},{viewport:"mobile",value:"mobile-movable-element",nullValue:""}]},collapsedContent:{requirePath:!0,items:[{viewport:"desktop",value:"desktop-collapsed-element",nullValue:""},{viewport:"mobile",value:"mobile-collapsed-element",nullValue:""}]},imageAlign:{requirePath:!0,items:[{viewport:"desktop",fallback:["no_viewport"],prefix:"desktop-"},{viewport:"mobile",fallback:["no_viewport"],prefix:"mobile-"}]},imageBorder:{requirePath:!0,items:[{value:"bordered"}]},vertical_space_outside_top:{requirePath:!1,path:"metadata.spaceOutsideTop",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"desktop-space-outsideTop-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-space-outsideTop-"}]},vertical_space_outside_bottom:{requirePath:!1,path:"metadata.spaceOutsideBottom",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"desktop-space-outsideBottom-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-space-outsideBottom-"}]},vertical_space_inside_top:{requirePath:!1,path:"metadata.spaceInsideTop",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"desktop-space-insideTop-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-space-insideTop-"}]},vertical_space_inside_bottom:{requirePath:!1,path:"metadata.spaceInsideBottom",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"desktop-space-insideBottom-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-space-insideBottom-"}]},fullWidth:{requirePath:!1,path:"metadata.hasFullWidth",items:[{viewport:"desktop",fallback:["no_viewport"],prefix:"desktop-",value:"fullWidth",nullValue:""},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-",value:"fullWidth",nullValue:""}]},fullWidthLimit:{path:"metadata.hasFullWidthWithLimit",items:[{viewport:"desktop",fallback:["no_viewport"],prefix:"desktop-",value:"fullWithLimit",nullValue:""},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-",value:"fullWithLimit",nullValue:""}]},expandedState:{path:"metadata.expandedState",items:[{viewport:"desktop",postfix:"-desktop",value:"state-expanded",nullValue:""},{viewport:"mobile",postfix:"-mobile",value:"state-expanded",nullValue:""}]},dacBtn:{requirePath:!0,path:"dacBtn",items:[{viewport:"no_viewport",value:"dacBtn bg-btn-color"}]},responsive_size:{requirePath:!0,items:[{viewport:"mobile",prefix:"small-vw-"}]},compactDisplay:{path:"metadata.compactDisplay",items:[{value:"compactDisplay"}]},horizontalSubArticles:{path:"metadata.horizontalSubArticles",items:[{value:"horizontalSubArticles"}]},subArticlesNextToFloatingImage:{path:"metadata.subArticlesNextToFloatingImage",items:[{value:"subArticlesNextToFloatingImage"}]},subArticlesShowBulletIcons:{path:"metadata.subArticlesShowBulletIcons",items:[{value:"subArticlesShowBulletIcons"}]},subimagePlacement:{requirePath:!1,path:"metadata.subimagePlacement",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"placement-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-placement-"}]},subimageSize:{requirePath:!1,path:"metadata.subimageSize",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],prefix:"size-"},{viewport:"mobile",fallback:["desktop","no_viewport"],prefix:"mobile-size-"}]},hasTextPadding:{requirePath:!0,path:"text_background_color",items:[{viewport:"desktop",fallback:["no_viewport","mobile"],value:"hasTextPadding"},{viewport:"mobile",fallback:["desktop","no_viewport"],value:"mobile-hasTextPadding"}]},hasTextPaddingCustom:{requirePath:!0,path:"custom_text_background_color",items:[{value:"hasTextPadding"},{value:"mobile-hasTextPadding"}]},hasContentPadding:{path:"metadata.background_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],value:"hasContentPadding"},{viewport:"mobile",fallback:["desktop","no_viewport"],value:"mobile-hasContentPadding"}]},hasContentPaddingCustom:{path:"metadata.custom_background_color",items:[{value:"hasContentPadding"},{value:"mobile-hasContentPadding"}]},hasBorder:{path:"metadata.border_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],value:"hasBorder"},{viewport:"mobile",fallback:["desktop","no_viewport"],value:"mobile-hasBorder"}]},hasBorderCustom:{path:"metadata.custom_border_color",items:[{value:"hasBorder"},{value:"mobile-hasBorder"}]},hideQuotationMark:{path:"metadata.hideQuotationMark",items:[{value:"hideQuotationMark"}]},hideBlockLine:{path:"metadata.hideBlockLine",items:[{value:"hideBlockLine"}]},quotationMarkColor:{path:"metadata.quotationMarkColor",items:[{value:"quotationMarkColor"}]},customQuotationMarkColor:{path:"metadata.customQuotationMarkColor",items:[{value:"customQuotationMarkColor"}]},blockLineColor:{path:"metadata.blockLineColor",items:[{value:"blockLineColor"}]},customblockLineColor:{path:"metadata.customblockLineColor",items:[{value:"customblockLineColor"}]},blockLineWidth:{path:"metadata.blockLineWidth",items:[{value:"blockLineWidth"}]},hasTextColor:{requirePath:!0,path:"text_color",items:[{viewport:"desktop",fallback:["mobile","no_viewport"],value:"hasTextColor"},{viewport:"mobile",fallback:["desktop","no_viewport"],value:"hasTextColorMobile"}]},hasCustomTextColor:{requirePath:!0,path:"custom_text_color",items:[{value:"hasTextColor"},{value:"hasTextColorMobile"}]}
7,activeTabBackgroundColor:{path:"metadata.activeTabBackgroundColor",items:[{value:"activeTabBackgroundColor"}]},customActiveTabBackgroundColor:{path:"metadata.customActiveTabBackgroundColor",items:[{value:"customActiveTabBackgroundColor"}]},activeTabTextColor:{path:"metadata.activeTabTextColor",items:[{value:"activeTabTextColor"}]},inactiveTabHoverBackgroundColor:{path:"metadata.inactiveTabHoverBackgroundColor",items:[{value:"inactiveTabHoverBackgroundColor"}]},customInactiveTabHoverBackgroundColor:{path:"metadata.customInactiveTabHoverBackgroundColor",items:[{value:"customInactiveTabHoverBackgroundColor"}]},inactiveTabHoverTextColor:{path:"metadata.inactiveTabHoverTextColor",items:[{value:"inactiveTabHoverTextColor"}]},listBorderColor:{path:"metadata.listBorderColor",items:[{value:"listBorderColor"}]},customListBorderColor:{path:"metadata.customListBorderColor",items:[{value:"customListBorderColor"}]},siteNameBackgroundColor:{path:"metadata.siteNameBackgroundColor",items:[{value:"siteNameBackgroundColor"}]},customSiteNameBackgroundColor:{path:"metadata.customSiteNameBackgroundColor",items:[{value:"customSiteNameBackgroundColor"}]},tagBackgroundColor:{path:"metadata.tagBackgroundColor",items:[{value:"tagBackgroundColor"}]}
7,customTagBackgroundColor:{path:"metadata.customTagBackgroundColor",items:[{value:"customTagBackgroundColor"}]}},collections:{text_decoration:{name:"text_decoration",definitions:["text_size","font_weight","bold","text_background_color","text_background_color_op","text_color","text_align","fontface","italic","underline","texttransform","strikethrough","text_shadow","animate","dacBtn","hasTextPadding","hasTextPaddingCustom","hasTextColor","hasCustomTextColor"]},text_decoration_inline_style:{name:"text_decoration_inline_style",definitions:["custom_text_background_color","custom_text_color","custom_text_shadow"]},section_decoration:{name:"section_decoration",definitions:["style_preset","vertical_space_outside_top","vertical_space_outside_bottom"]},box_decoration:{name:"box_decoration",definitions:["float","pull_up","vertical_align","vertical_align_content","css_style","style_preset","vertical_space_outside_top","vertical_space_outside_bottom","vertical_space_inside_top","vertical_space_inside_bottom","expandedState","compactDisplay","horizontalSubArticles","subArticlesNextToFloatingImage","subArticlesShowBulletIcons"]},box_fullWidth:{name:"box_fullWidth",definitions:["fullWidth","fullWidthLimit"]},content_decoration:{name:"content_decoration",definitions:["background_color","background_opacity","background_gradient","border_color","border_side","border_width","border_style","border_radius","rounded_image_edge","rounded_image","image_gradient","image_gradient_opacity","content_text_align","content_vertical_text_align","hasContentPadding","hasContentPaddingCustom","hasBorder","hasBorderCustom"]},text_content_decoration:{name:"text_content_decoration",definitions:["background_opacity","background_gradient","border_color","border_side","border_width","border_style","border_radius","rounded_image_edge","rounded_image","image_gradient","image_gradient_opacity","content_text_align","content_vertical_text_align","hasContentPadding","hasContentPaddingCustom","hasBorder","hasBorderCustom"]},content_inline_style:{name:"content_inline_style",definitions:["custom_background_color","custom_background_color_L3","custom_border_color"]},content_inline_spacing:{name:"content_inline_spacing",definitions:["spacing_inner_top","spacing_inner_right","spacing_inner_bottom","spacing_inner_left","spacing_outer_top","spacing_outer_right","spacing_outer_bottom","spacing_outer_left"]},subimage:{name:"subimage",definitions:["subimagePlacement","subimageSize"]}},copyDefinitions:[{definition:"text_size",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"font_weight",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"text_background_color",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"text_background_color_op",data:[{path:"fields.title"}]},{definition:"text_color",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"text_align",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"fontface",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"italic",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"underline",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"texttransform",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"strikethrough",data:[{path:"fields.text"},{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"animate",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"custom_text_shadow",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"text_shadow",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"custom_text_color",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"custom_text_background_color",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.description"},{path:"fields.author"},{path:"fields.name"},{path:"fields.quote"},{path:"fields.firstname"},{path:"fields.lastname"},{path:"fields.imageCaption"},{path:"fields.byline"}]},{definition:"css_style"},{definition:"style_preset"},{definition:"background_color"},{definition:"custom_background_color"},{definition:"background_opacity"},{definition:"background_gradient"},{definition:"image_gradient"},{definition:"border_color"},{definition:"border_style"},{definition:"border_side"},{definition:"border_width"},{definition:"border_radius"},{definition:"rounded_image_edge"},{definition:"rounded_image"},{definition:"layout"},{definition:"shadow"},{definition:"fitContent"},{definition:"metadata_text_color"},{definition:"hover_bg_color"},{definition:"hover_text_color"},{definition:"hover_border_color"},{definition:"image_overlay"},{definition:"image_overlay_opacity"},{definition:"image_gradient_opacity"},{definition:"float"},{definition:"pull_up"},{definition:"content_text_align"},{definition:"content_vertical_text_align"},{definition:"vertical_align"},{definition:"vertical_space_outside_top"},{definition:"vertical_space_outside_bottom"},{definition:"vertical_space_inside_top"},{definition:"vertical_space_inside_bottom"},{definition:"spacing_outer_top",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_outer_right",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_outer_bottom",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_outer_left",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_inner_top",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_inner_right",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_inner_bottom",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{definition:"spacing_inner_left",data:[{values:{no_viewport:null,desktop:null,mobile:null}}]},{targets:["article","articleHeader"],data:[{path:"metadata.image_gradient_direction",values:{no_viewport:null,desktop:null,mobile:null}}]},{targets:["image"],data:[{path:"fields.bbRatio",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.whRatio",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.float",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.shapes",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.displayCaption"},{path:"fields.expandableCaption"},{path:"fields.truncateCaption"}]},{targets:["article"],data:[{path:"fields.displayByline",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.displayVideoArticleOverlay",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.hideVideoArticleLabel",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.videoOverlayPosition"},{path:"fields.paywall",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.paywallLabelPosition"},{path:"metadata.showSection",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.sectionPlacement"},{path:"metadata.showTags",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.tagPlacement"},{path:"metadata.subarticles",values:{no_viewport:null,desktop:null,mobile:null}},{path:"fields.displayPublishedDate"}]},{targets:["article","articleHeader"],data:[{path:"metadata.showKicker",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.kickerBelowImage",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.kickerBelowTitle",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.floatingKicker",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.hideTitle",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.titleAboveImage",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.floatingTitle",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.hidesubtitle",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.subtitleAboveImage",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.floatingSubtitle",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.hideimage",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.hasFullWidth",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.hasFullWidthWithLimit",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.compactDisplay"},{path:"metadata.horizontalSubArticles",values:{no_viewport:null}},{path:"metadata.subArticlesNextToFloatingImage",values:{no_viewport:null}},{path:"metadata.subArticlesShowBulletIcons",values:{no_viewport:null}},{path:"metadata.sub_hideImage",values:{no_viewport:null}},{path:"metadata.sub_hideTitle"},{path:"metadata.sub_hideSubtitle"},{path:"metadata.imageHoverScale"},{path:"metadata.imageHoverFilter"}]},{targets:["row"],data:[{path:"metadata.hasRowTitle"},{path:"metadata.vertical_align_content"},{path:"metadata.fullWidthContent"},{path:"metadata.fullWidthRow"},{path:"metadata.isSection",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.text_background_color",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.text_color",values:{no_viewport:null,desktop:null,mobile:null}}]},{targets:["userFeedback","timeline"],data:[{path:"metadata.ui_color"},{path:"metadata.ui_text_color"}]},{targetPath:"bodytext/",data:[{path:"width",values:{no_viewport:null,desktop:null,mobile:null}}]},{targets:["grid"],data:[{path:"fields.columnCount"},{path:"fields.rowCount"},{path:"fields.noSpace"}]},{definition:"hasTextPadding",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.text"}]},{definition:"hasContentPadding"},{definition:"hasBorder"},{definition:"hideQuotationMark"},{definition:"hideBlockLine"},{definition:"quotationMarkColor"},{definition:"customQuotationMarkColor"},{definition:"blockLineColor"},{definition:"customBlockLineColor"},{definition:"blockLineWidth"},{definition:"hasTextColor",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.text"}]},{definition:"hasCustomTextColor",data:[{path:"fields.title"},{path:"fields.subtitle"},{path:"fields.kicker"},{path:"fields.text"}]},{targets:["recipe"],data:[{path:"metadata.imagePosition",values:{no_viewport:null,desktop:null,mobile:null}},{path:"metadata.hideName"},{path:"metadata.hideDescription"},{path:"metadata.hideAuthor"},{path:"metadata.hideImage"},{path:"metadata.hidePrepTime"},{path:"metadata.hideCookTime"},{path:"metadata.hideTotalTime"},{path:"metadata.hideRecipeYield"},{path:"metadata.showDatePublished"},{path:"metadata.showKeywords"}]}
7,{definition:"activeTabBackgroundColor"},{definition:"customActiveTabBackgroundColor"},{definition:"activeTabTextColor"},{definition:"inactiveTabHoverBackgroundColor"},{definition:"customInactiveTabHoverBackgroundColor"},{definition:"inactiveTabHoverTextColor"},{definition:"listBorderColor"},{definition:"customListBorderColor"},{definition:"siteNameBackgroundColor"},{definition:"customSiteNameBackgroundColor"},{definition:"tagBackgroundColor"},{definition:"customTagBackgroundColor"},{data:[{path:"metadata.elementClass"}]},{definition:"expandedState"}],presets:{}},data:{blacklist:["sub_content"],blacklistOptions:{sub_content:{includeChildren:!0}},elements:{text_singleline:{fallbackData:{contentdata:{fields:{elementType:"h2"}}}},articleHeader:{source:{node:"page",keys:["fields.title","fields.subtitle","fields.kicker","fields.published","fields.modified","fields.created"]},fallbackData:{contentdata:{fields:{displayCaption:!0}},metadata:{showKicker:!0}}},page_notice:{fallbackData:{contentdata:{fields:{uiColor:"bg-primary"}}}},noticeHeader:{source:{node:"page"}},bodytext:{source:{node:"page"}},articleMeta:{source:{node:"page"}},articleFooter:{source:{node:"page"}},labradorSearch:{fallbackData:{contentdata:{fields:{hideSiteName:!1,hidePublishedDate:!1,hideSection:!1,displayAdvanced:!1,displaySites:!0,articleCount:20,orderBy:"published"}},metadata:{ui_color:"bg-secondary"}}},timeline:{fallbackData:{metadata:{ui_color:"bg-primary",ui_text_color:"primary"}}},livefeed:{fallbackData:{metadata:{ui_color:"bg-primary"},contentdata:{fields:{maxNoticesCount:20,viewports_json:{desktop:{fields:{visibleCount:3}},mobile:{fields:{visibleCount:2}}}}}}},image:{fallbackData:{metadata:{bodyTextIndex:0,subimagePlacement:{desktop:"topright"}}}},graphic:{fallbackData:{metadata:{subimagePlacement:{desktop:"topright"}}}},articlesByTag:{fallbackData:{contentdata:{fields:{title:"",title_style_json:{text_background_color:"bg-black"}}}}},front_rows:{fallbackData:{contentdata:{fields:{fragment_json:{start:0,count:1}}}}},buttonlink:{fallbackData:{metadata:{background_color:"bg-primary",text_color:"white",border_color:"bg-primary"}}},topcomments:{fallbackData:{contentdata:{fields:{iconLatest:"fi-clock",iconMostRead:"fi-book",articleCount:"5",days:"7"}}}},factbox:{fallbackData:{metadata:{expandedState:{desktop:!0}}}},toplist:{fallbackData:{contentdata:{fields:{days:"7",layout:"vertical",title_style_json:{text_background_color:"bg-black"}}}}},authorBox:{fallbackData:{contentdata:{fields:{layoutAuthor:"center"}}}},articleList:{fallbackData:{contentdata:{fields:{imageLayout:"left",layout:"default"}}}},article:{fallbackData:{metadata:{sub_hideSubtitle:!0}}}},presets:{},presetBlacklist:{article:["article/"]}},"int_en-GB":{comments:{one:"comment",many:"comments"},dates:{sunday:"sunday",monday:"monday",tuesday:"tuesday",wednesday:"wednesday",thursday:"thursday",friday:"friday",saturday:"saturday",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",ago:"ago",now:"now",minute:"minute",min:"min",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",durationSince:"{{count}} {{period}} {{ago}}",monthdayyear:"{{D}} {{MMMM}} {{YYYY}}",hourminute:"{{HH}}:{{mm}}",dateTime:"{{D}} {{MMMM}} {{YYYY}} - {{HH}}:{{mm}}",articleScrollerPublishedDatePrefix:"",articleScrollerPublishedFormat:"{{DD}}.{{MM}} - {{HH}}:{{mm}}"},newsletter:{generic:{signup:"Sign up for the newsletter",hiddenValue:"Signup from website",yourEmail:"Type your e-mail",subscribeButton:"Subscribe"},mailmojo:{title:"Newsletter",notice:"You are receiving this e-mail because you are subscribed to our e-mail list.",preferences:"Your settings",unsubscribe:"Unsubscribe",view:"Open in browser",date:"d. MMMM Y"}},embed:{embed_label:"Embed this",heading:"Embed article",description:"Copy and paste the HTML code below into the page where you want to embed this article.",label_teaser:"Preview",label_full:"Full article",label_copy:"Copy code",title_customize:"Customize embedded content",label_content_title:"Display title",label_content_subtitle:"Display subtitle",label_content_image:"Display main image",label_content_padding:"Padding",label_content_sitelink:"Display link to site",label_content_sitelinkLogo:"Display logo in link to site",label_content_poweredby:"Display 'Powered By' link",text_code_copied:"Copied!",close:"Close",page_sitelink_prefix:"Read more",page_sitelink_postfix:""},ai:{factbox_disclaimer:"This factbox was generated by Labrador AI and proof-read by a journalist."},tags:{title_text:"{{tagPath}}: {{ tag }}"},search:{placeholder:"Search...",label:"Search",openText:"Search",closeText:"Close",expandedLabel:"Close search",collapsedLabel:"Open search",labradorSearch:{submitLabel:"Search",navLabel:"Display more",nohitsLabel:"No hits. Try modifying your search.",searchPlaceholder:"Type your search here ...",advancedOpenText:"Open filter",advancedCloseText:"Close filter",fromDateLabel:"From date",toDateLabel:"To date",tagLabel:"Tag",authorLabel:"Author",allSitesLabel:"All sites"}},hamburger:{expandedLabel:"Close menu",collapsedLabel:"Open menu",buttonText:"Menu"},header:{logo_link_text:"Go to frontpage",menuScrollerLeftButton:"Scroll left",menuScrollerRightButton:"Scroll right"},slack_notifier:{publish:{article:"*Article published*\n*Title*: {{{title}}}\n*Page ID*: {{id}}\n{{#modified}}*Date*: {{modified}}\n{{/modified}}{{#published_ahead}}*Note: Published ahead*\n{{/published_ahead}}{{#hidden}}*Published hidden*\n{{/hidden}}*User*: {{user}}\n*<{{{url_front}}}|View page>* - *<{{{url_editor}}}|Edit page>*",front:"*Front page published*\n*Title*: {{{title}}}\n*Page ID*: {{id}}\n*Date*: {{modified}}\n{{#published_ahead}}*Note: Published ahead*\n{{/published_ahead}}{{#hidden}}*Published hidden*\n{{/hidden}}*User*: {{user}}\n*<{{{url_front}}}|View page>* - *<{{{url_editor}}}|Edit page>*",notice:"*Notice published*\n*Title*: {{{title}}}\n*Page ID*: {{id}}\n*Date*: {{modified}}{{#hidden}}*Published hidden*\n{{/hidden}}*User*: {{user}}\n*<{{{url_front}}}|View page>* - *<{{{url_editor}}}|Edit page>*"},error:{all:"*{{ #isCmsError }}CMS error{{ /isCmsError }}{{ ^isCmsError }}View error{{ /isCmsError }}*: {{{message}}}\n*Stack trace*: ```{{{stackTrace}}}```\n*User*: {{user}}\n*<{{{url_editor}}}|Edit page>* - *<{{{url_monitor}}}|Developer Monitor>*"}},contentboxes:{articleScrollerLeftButton:"Go left",articleScrollerRightButton:"Go right"},metadata:{publishedLabel:"Published",modifiedLabel:"Modified",unpublishedLabel:"Unpublished",readTimeLabel:"Read time"},notice:{relatedContent:{header:"Related content"},pinnedLabel:"Pinned"},changelog:{changelogLabel:"Changelog"},paywall:{shareableArticle:{shareArticleButton:"Share article",trySubscriptionButton:"Try subscription",trySubscriptionLink:"-",messageTitle:"Thank y
7ou for sharing this article",messageBeforeSharing:"Your friend will be able to read the whole article",messageAfterSharing:"Your friend will now be able to read the whole article",bannerGuestReader:"You have access to the article because a friend shared it with you",shareByMail:"Mail",shareByMailSubject:"I want to share this article with you",shareByMailBody:"You can read this paywalled article by clicking this link",shareByFacebook:"Facebook",shareByCopy:"Copy link",sharedByCopy:"Link copied"},piano:{login:"Log in",logout:"Log out",myAccount:"My account"}},emptyState:{noContentText:"No content"},image:{caption:{showCaptionLabel:"Show caption",hideCaptionLabel:"Hide caption",showMoreLabel:"Show more",showLessLabel:"Show less"},videoOverlayLabel:"Video article"},mostRead:{labelLatest:"Latest",titleLatest:"Recent articles",labelMostRead:"Most read",titleMostRead:"Most read articles"},authorLatestArticles:{noBylines:"No bylines found in article"},infiniteScroll:{readMore:"Continue reading"},socialMedia:{shareText:{facebook:"Share on Facebook",twitter:"Share on X (Twitter)",linkedin:"Share on LinkedIn",mail:"Share by email",threads:"Share on Threads",copyLink:"Copy link",glimta:"Unlock with Glimta",talandeWebb:"Open Talande Webb option panel",bluesky:"Share on Bluesky",reddit:"Share on Reddit",whatsapp:"Share on WhatsApp",messenger:"Share on Messenger",print:"Print page",googlenews:"Open Google News Page"}},weather:{failedToFetch:"Could not fetch weather data",updated:"Updated",fetchingData:"Loading weather data",types:{clearsky:"Clear sky",fair:"Fair",partlycloudy:"Partly cloudy",cloudy:"Cloudy",rainshowers:"Rain showers",rain:"Rain",snow:"Snow",sleet:"Sleet",thunder:"Thunder",fog:"Fog",wind:"Wind",unknown:"Unknown"}},gallery:{label:"Gallery",seeAllImages:"See all images",navigateToOriginal:"Navigate to original page",imageCountText:"images",autoDescription:'{{ n }} images from "{{ title }}"'},naver:{audio_news:"Audio News",new_window:"New window"},recipe:{prepTimeLabel:"Preparation time:",cookTimeLabel:"Cooking time:",totalTimeLabel:"Total time:",recipeYieldLabel:"Servings:",keywordsLabel:"Keywords:",caloriesLabel:"Calories:",dishLabel:"Dish:",cuisineLabel:"Cuisine:",printButton:"Print",publishedDate:"Published date:",ingredientsTitle:"Ingredients",instructionsTitle:"Instructions"}}},r={"content_settings/front/vp_data.json":{viewportMap:{presets:{vp_data:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"},attributes:"presets.vp_content_attributes.attributes"},vp_content_attributes:{attributes:{font_weight:{viewport:{default:!0},fallback:{default:"desktop"}},text_size:{viewport:{default:!0}},text_color:{viewport:{default:!0},fallback:{default:"desktop"}},text_background_color:{viewport:{default:!0},fallback:{default:"desktop"}},text_align:{viewport:{default:!0},fallback:{default:"desktop"}},italic:{viewport:{default:!0},fallback:{default:"desktop"}}}},vp_metadata_attributes:{attributes:{bodyTextIndex:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},showKicker:{viewport:{default:!0},fallback:{default:"desktop"}},hideTitle:{viewport:{default:!0},fallback:{default:"desktop"}},titleAboveImage:{viewport:{default:!0},fallback:{default:"desktop"}},floatingTitle:{viewport:{default:!0},fallback:{default:"desktop"}},floatingSubtitle:{viewport:{default:!0},fallback:{default:"desktop"}},subtitleAboveImage:{viewport:{default:!0},fallback:{default:"desktop"}},hidesubtitle:{viewport:{default:!0},fallback:{default:"desktop"}},kickerBelowImage:{viewport:{default:!0},fallback:{default:"desktop"}},kickerBelowTitle:{viewport:{default:!0},fallback:{default:"desktop"}},floatingKicker:{viewport:{default:!0},fallback:{default:"desktop"}},hasFullWidth:{viewport:{default:!0},fallback:{default:"desktop"}},hasFullWidthWithLimit:{viewport:{default:!0},fallback:{default:"desktop"}},background_color:{viewport:{default:!0},fallback:{default:"desktop"}},gradient:{viewport:{default:!0},fallback:{default:"desktop"}},image_overlay:{viewport:{default:!0},fallback:{default:"desktop"}},image_overlay_opacity:{viewport:{default:!0},fallback:{default:"desktop"}},image_gradient:{viewport:{default:!0},fallback:{default:"desktop"}},image_gradient_opacity:{viewport:{default:!0},fallback:{default:"desktop"}},image_gradient_direction:{viewport:{default:!0},fallback:{default:"desktop"}},background_color_op:{viewport:{default:!0},fallback:{default:"desktop"}},hideimage:{viewport:{default:!0},fallback:{default:"desktop"}}
7,rounded_image_edge:{viewport:{default:!0},fallback:{default:"desktop"}},rounded_image:{viewport:{default:!1},fallback:{default:"desktop"}},spacing_outer_top:{viewport:{default:!0}},spacing_outer_right:{viewport:{default:!0}},spacing_outer_bottom:{viewport:{default:!0}},spacing_outer_left:{viewport:{default:!0}},spacing_inner_top:{viewport:{default:!0}},spacing_inner_right:{viewport:{default:!0}},spacing_inner_bottom:{viewport:{default:!0}},spacing_inner_left:{viewport:{default:!0}},pull_up:{viewport:{default:!0}},float:{viewport:{default:!0}},border_color:{viewport:{default:!0},fallback:{default:"desktop"}},border_side:{viewport:{default:!0},fallback:{default:"desktop"}},border_width:{viewport:{default:!0},fallback:{default:"desktop"}},border_style:{viewport:{default:!0},fallback:{default:"desktop"}},border_radius:{viewport:{default:!0},fallback:{default:"desktop"}},subarticles:{viewport:{default:!0},fallback:{default:"desktop"}},showSection:{viewport:{default:!0},fallback:{default:"desktop"}},showTags:{viewport:{default:!0},fallback:{default:"desktop"}},text_align:{viewport:{default:!0},fallback:{default:"desktop"}},vertical_align:{viewport:{default:!0}},hideViewport:{viewport:{default:!0},fallback:{no_viewport:!1}},expandedState:{viewport:{default:!0}},displayNavigation:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},displayPreview:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}}}}},width:{viewport:{default:!0},fallback:{mailmojo:"desktop"}},metadata:"presets.vp_metadata_attributes"}},"content/row/front/default.json":{viewportMap:{metadata:{attributes:{bodyTextIndex:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},hasFullWidth:{viewport:{default:!0},fallback:{default:"desktop"}},hasFullWidthWithLimit:{viewport:{default:!0},fallback:{default:"desktop"}},background_color:{viewport:{default:!0},fallback:{default:"desktop"}},background_color_op:{viewport:{default:!0},fallback:{default:"desktop"}},border_color:{viewport:{default:!0},fallback:{default:"desktop"}},border_side:{viewport:{default:!0},fallback:{default:"desktop"}},border_width:{viewport:{default:!0},fallback:{default:"desktop"}},border_style:{viewport:{default:!0},fallback:{default:"desktop"}},vertical_align:{viewport:{default:!0}},isSection:{viewport:{default:!0},fallback:{default:"desktop"}},hideViewport:{viewport:{default:!0},fallback:{no_viewport:!1}},spaceOutsideTop:{viewport:{default:!0},fallback:{default:"desktop"}},spaceOutsideBottom:{viewport:{default:!0},fallback:{default:"desktop"}},spaceInsideTop:{viewport:{default:!0},fallback:{default:"desktop"}},spaceInsideBottom:{viewport:{default:!0},fallback:{default:"desktop"}},float:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},text_size:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},text_color:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},text_background_color:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},movableContent:{viewport:{default:!0},fallback:{no_viewport:!1}},collapsedContent:{viewport:{default:!0},fallback:{no_viewport:!1}},contentPosition:{viewport:{default:!0},fallback:{no_viewport:!1}}}}}},"content/columns/front/default.json":{},"content_settings/front/grid/default.json":{gridRules:{oddRule:{condition:"odd",values:{mobile:{default:12}}},evenRule:{condition:"even",values:{mobile:{default:12}}}}},"content/article/front/default.json":{viewportMap:{fields:{title:"presets.vp_content_attributes",subtitle:"presets.vp_content_attributes",kicker:"presets.vp_content_attributes",displayByline:"presets.vp_data",displayCaption:"presets.vp_data"}}},"content/image/front/default.json":{boxTitle:"Media placeholder",boxDescription:"Add placeholder for media (images, videos, etc.)",viewHelper:"image",viewportMap:{fields:{x:{viewport:{default:!0},fallback:{default:"desktop"}},y:{viewport:{default:!0},fallback:{default:"desktop"}},cropw:{viewport:{default:!0},fallback:{default:"desktop"}},croph:{viewport:{default:!0},fallback:{default:"desktop"}},float:{viewport:{default:!0}},shapes:{viewport:{default:!0},fallback:{default:"desktop"}},bbRatio:{viewport:{default:!0}},vpWidth:{viewport:{default:!0}},whRatio:{viewport:{default:!0},fallback:{default:"desktop"}},height:{viewport:{default:!0},fallback:{default:"desktop"}},width:{viewport:{default:!0}}},metadata:{attributes:{float:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},bodyTextIndex:{viewport:{default:!0},fallback:{default:"desktop",desktop:"mobile"}},hideViewport:{viewport:{default:!0},fallback:{no_viewport:!1}},hasFullWidth:{viewport:{default:!0},fallback:{default:"desktop"}},zoomable:{viewport:{default:!0},fallback:{default:"no_viewport",desktop:"no_viewport"}},subimage:{viewport:{default:!0},fallback:{default:"desktop"}},subimagePlacement:{viewport:{default:!0},fallback:{default:"desktop"}},subimageSize:{viewport:{default:!0},fallback:{default:"desktop"}},border_color:{viewport:{default:!0},fallback:{default:"desktop"}},border_width:{viewport:{default:!0},fallback:{default:"desktop"}}}}}},"content/image/front/subImage.json":{overrideImageSize:{width:320}},"content/image/front/subImageMobile.json":{overrideImageSize:{width:103}},"content/notice/front/default.json":{boxTitle:"Notice",viewHelper:"bodytext",bodytextElements:["p","h2","h3","h4","h5","h6","ul","ol","li"],viewportMap:{fields:{title:"presets.vp_content_attributes"}}},"content/articleList/front/default.json":{boxTitle:"Article list",boxDescription:"Display a list of articles",boxKeywords:"Labrador API feeds"},"content/scrollbox/front/default.json":{boxTitle:"Scrollbox",boxDescription:"Display a list of manually added article-teasers",boxKeywords:"slide swipe related articles",viewportMap:{fields:{title:"presets.vp_content_attributes"}}},"content/row/_resources.json":{presentation:{stage:{"lab-default":{template:{default:"content/row/template/default"},properties:{default:["content_settings/front/vp_data.json","content/row/front/default.json"]}}}}},"content/columns/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content/columns/front/default.json","content_settings/front/grid/default.json"]},template:{default:"content/columns/template/default"}}}}},"content/article/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content/article/front/default.json","content_settings/front/grid/default.json","content_settings/front/vp_data.json"]},template:{default:"content/article/template/default",rss:"content/article/template/rss",mailmojo:"content/article/template/mailmojo",newssitemap:"content/article/template/newssitemap",partials:["content/article/template/partials/kicker","content/article/template/partials/subtitle","content/article/template/partials/title","content/article/template/partials/bylines","content/article/template/partials/audio","partial/elements/paywallLabel"]}},"article//":{template:{default:"content/article/template/subarticle"}},labradorSearch:{template:{default:"content/article/template/labradorSearch"}},articleList:{template:{default:"content/article/template/articleList"}},scrollbox:{template:{default:"content/article/template/scrollbox"}}}}},"content/image/_resources.json":{presentation:{stage:{"lab-default":{template:{default:"content/image/template/default",partials:["content/image/template/article","content/image/template/partials/caption_links","content/image/template/partials/caption","content/image/template/partials/img","content/image/template/partials/child","content/image/template/partials/shapes"]},properties:{default:["content/image/front/default.json"]}},article:{template:{default:"content/image/template/article"}},image:{properties:{default:"content/image/front/subImage.json",mobile:"content/image/front/subImageMobile.json"}},notice:{template:{default:"content/image/template/grid"}}}}},"content/notice/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content_settings/front/grid/default.json","content_settings/front/vp_data.json","content/notice/front/default.json"]},template:{default:"content/notice/template/default"}}}}},"content/adnuntiusAd/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content_settings/front/grid/default.json"]},template:{default:"content/adnuntiusAd/template/default"}}}}},"content/googleAd/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content_settings/front/grid/default.json"]},template:{default:"content/googleAd/template/default"}}}}},"content/articleList/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content_settings/front/grid/default.json","content_settings/front/vp_data.json","content/articleList/front/default.json"]},template:{default:"content/articleList/template/default"}}}}},"content/scrollbox/_resources.json":{presentation:{stage:{"lab-default":{properties:{default:["content_settings/front/grid/default.json","content_settings/front/vp_data.json","content/scrollbox/front/default.json"]},template:{default:"content/scrollbox/template/default"}}}}}},s={"content/row/template/default":'{{ #get.current.metadata.isSection }}\n<div data-element-guid="{{ get.current.guid }}
7" class="{{ #helper.trim }}\nrow-section \n{{ #style.collection }}section_decoration{{ /style.collection }}\n{{ #style.collection }}content_decoration{{ /style.collection }}\n{{ #style.definition }}movableContainer metadata.movableContent{{ /style.definition }}\n{{ #style.definition }}movableElement metadata.movableContent{{ /style.definition }}\n{{ #style.definition }}collapsedContent metadata.collapsedContent{{ /style.definition }}\n{{ /helper.trim }}" style="{{ #style.collection }}content_inline_style{{ /style.collection }}">\n{{ /get.current.metadata.isSection }}\n<div {{ ^get.current.metadata.isSection }}data-element-guid="{{ get.current.guid }}" {{ /get.current.metadata.isSection }}class="{{ #helper.trim }}\n    row\n    {{ size.grid.css }}\n    {{ #get.current.metadata.fullWidthContent }}fullWidthContent{{ /get.current.metadata.fullWidthContent }}\n    {{ #style.collection }}box_decoration{{ /style.collection }}\n    {{ #style.collection }}content_decoration{{ /style.collection }}\n    {{ #style.definition }}movableContainer metadata.movableContent{{ /style.definition }}\n    {{ #style.definition }}movableElement metadata.movableContent{{ /style.definition }}\n    {{ #style.definition }}collapsedContent metadata.collapsedContent{{ /style.definition }}\n    {{ #get.current.metadata.hasRowTitle }}has-row-header{{ /get.current.metadata.hasRowTitle }}\n    {{ #get.children.mediaContainer }}has-media-container{{ /get.children.mediaContainer }}\n    {{ /helper.trim }}" style="{{ #style.collection }}content_inline_style{{ /style.collection }}"{{ #get.current.metadata.sectionId }} id="{{ get.current.metadata.sectionId }}"{{ /get.current.metadata.sectionId }}>\n\t{{ #get.current.metadata.hasRowTitle }}\n\t\t{{ #get.current.metadata.rowTitleTag }}\n\t\t\t<{{ get.current.metadata.rowTitleTag }} class="row_header_text large-12 small-12 {{ #style.collection }}text_decoration metadata{{ /style.collection }} {{ #style.definition }}text_align_row{{ /style.definition }}"><span class="lab-row-header-title">{{{ get.current.metadata.rowTitle }}}</span></{{ get.current.metadata.rowTitleTag }}>\n\t\t{{ /get.current.metadata.rowTitleTag }}\n\t\t{{ ^get.current.metadata.rowTitleTag }}\n\t\t\t<h5 class="row_header_text large-12 small-12 {{ #style.collection }}text_decoration metadata{{ /style.collection }} {{ #style.definition }}text_align_row{{ /style.definition }}"><span class="lab-row-header-title">{{{ get.current.metadata.rowTitle }}}</span></h5>\n\t\t{{ /get.current.metadata.rowTitleTag }}\n    {{ /get.current.metadata.hasRowTitle }}\n\t{{ #get.current.metadata.movableContent }}{{{ get.current.filtered.movableStyle }}}{{ /get.current.metadata.movableContent }}{{{ children.all }}}</div>\n{{ #get.current.metadata.isSection }}\n</div>\n{{ /get.current.metadata.isSection }}\n',"content/columns/template/default":'<div data-element-guid="{{ get.current.guid }}" class="columns {{ size.grid.css }} {{ size.grid.absCss }}">{{{ children.all }}}</div>',"content/article/template/default":'<article {{ #helper.trim }}\n    data-element-guid="{{ get.current.guid }}"\n    class="column\n        {{ #style.collection }}box_decoration{{ /style.collection }}\n        {{ #get.current.filtered.paywall }}paywall{{ /get.current.filtered.paywall }}\n        {{ size.grid.css }}\n        {{ size.grid.absCss }}\n        {{ get.current.filtered.autodata_css }}"\n    {{ #get.current.filtered.autodata_attributes }} {{ key }}="{{ value }}"{{ /get.current.filtered.autodata_attributes }} \n    data-site-alias="{{ get.current.filtered.site_alias }}" \n    data-section="{{ get.current.filtered.section }}" \n    {{ #get.current.filtered.tagsString }}data-tag="{{{ get.current.filtered.tagsString }}}"{{ /get.current.filtered.tagsString }}\n    data-instance="{{ get.current.instance_of }}{{ ^get.current.instance_of }}{{ get.current.id }}{{ /get.current.instance_of }}" \n    {{ #get.child.image.fields.float }}data-image-float="{{ get.child.image.fields.float }}"{{ /get.child.image.fields.float }}\n    itemscope\n    {{ /helper.trim }}>\n    {{{ get.current.filtered.styleSheets }}}\n    <div class="{{ #helper.trim }}\n        content\n        {{ #style.collection }}content_decoration{{ /style.collection }}\n        {{ #get.current.metadata.image_gradient_direction }}image-gradient-{{ get.current.metadata.image_gradient_direction }}{{ /get.current.metadata.image_gradient_direction }}\n        {{ get.current.filtered.hoverEffectClasses }}\n        {{ #style.collection }}box_fullWidth{{ /style.collection }}\n        {{ /helper.trim }}" style="{{ #style.collection }}content_inline_style{{ /style.collection }}{{ #get.current.filtered.hoverEffectStyles }} {{ get.current.filtered.hoverEffectStyles }}{{ /get.current.filtered.hoverEffectStyles }}">\n        \n        {{ #get.current.fields.published_url }}\n            <a itemprop="url"{{ #get.current.fields.open_in_new_window }} target="_blank"{{ /get.current.fields.open_in_new_window }} class="" href="{{{ get.current.fields.published_url }}}" data-k5a-url="{{{ get.current.filtered.canonical_url }}}" rel="{{ #get.current.filtered.addRelUgc }}ugc {{ /get.current.filtered.addRelUgc }}{{ #get.current.filtered.addRelSponsored }}sponsored {{ /get.current.filtered.addRelSponsored }}{{ #get.current.filtered.addRelNoFollow }}nofollow{{ /get.current.filtered.addRelNoFollow }}">\n        {{ /get.current.fields.published_url }}\n\n        {{ #get.current.filtered.layout.top }}\n            {{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n        {{ /get.current.filtered.layout.top }}\n\n        <div class="media{{ #get.current.metadata.floatingTextSubset }} floatingTextSubset{{ /get.current.metadata.floatingTextSubset }}
7 {{ #style.definition }}imageAlign child.image.fields.float{{ /style.definition }}{{ #get.current.fields.displayVideoArticleOverlay }} video-overlay{{ #get.current.fields.videoOverlayPosition }} video-overlay-pos-{{ get.current.fields.videoOverlayPosition }}{{ /get.current.fields.videoOverlayPosition }}{{ /get.current.fields.displayVideoArticleOverlay }}">\n            {{ ^get.current.metadata.hideimage }}\n                {{{ placeholder.no_media }}}\n                {{{ child.image }}}\n                {{{ child.graphic }}}\n                {{{ child.slideshow }}}\n                {{{ child.youtube }}}\n                {{{ child.simplestream }}}\n                {{{ child.markup }}}\n                {{{ child.parallax }}}\n                {{{ child.grid }}}\n                {{{ child.onnetwork }}}\n            {{ /get.current.metadata.hideimage }}\n\n            <div class="floatingText">\n                {{ #get.current.filtered.layout.floating }}\n                    {{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n                {{ /get.current.filtered.layout.floating }}\n\n                <div class="labels">\n                    {{ #get.current.filtered.autodata_custom.labels }}\n                    <div class="label" data-label-key="{{ key }}" data-label-value="{{ value }}"><span class="label-value">{{ value }}</span></div>\n                    {{ /get.current.filtered.autodata_custom.labels }}\n                    {{ #get.current.filtered.sectionPlacement.floating }}\n                        {{ #get.current.metadata.showSection }}\n                            {{ #get.current.filtered.section }}<p itemprop="section" class="section" data-tag="{{ get.current.filtered.section }}">{{ get.current.filtered.section }}</p>{{ /get.current.filtered.section }}\n                        {{ /get.current.metadata.showSection }}\n                    {{ /get.current.filtered.sectionPlacement.floating }}\n                </div>\n            </div>\n            {{ #get.current.metadata.enableAudio }}{{ #render.template }}content/article/template/partials/audio{{ /render.template }}{{ /get.current.metadata.enableAudio }}\n            {{ #get.current.filtered.paywallLabel }}{{> partial/elements/paywallLabel }}{{ /get.current.filtered.paywallLabel }}\n\n            {{ #get.current.fields.displayVideoArticleOverlay }}\n                {{ ^get.current.fields.hideVideoArticleLabel }}<p class="video-overlay-label">{{ #lang }}image.videoOverlayLabel{{ /lang }}</p>{{ /get.current.fields.hideVideoArticleLabel }}\n            {{ /get.current.fields.displayVideoArticleOverlay }}\n        </div>\n        {{ #get.current.fields.displayCaption }}\n            <div class="caption {{ #helper.trim }}\n                {{ #app.isEditor }}expanded{{ /app.isEditor }}\n                {{ #get.current.fields.truncateCaption }}truncate{{ /get.current.fields.truncateCaption }}\n                {{ ^get.current.fields.truncateCaption }}\n                    {{ #get.child.image.fields.truncateCaption }}truncate{{ /get.child.image.fields.truncateCaption }}\n                {{ /get.current.fields.truncateCaption }}\n                {{ /helper.trim }}" data-showmore="{{ #lang }}image.caption.showMoreLabel{{ /lang }}"{{ #get.child.image.filtered.captionOptions.expandable }} data-expandable="true" data-showcaption="{{ #lang }}image.caption.showCaptionLabel{{ /lang }}" data-hidecaption="{{ #lang }}image.caption.hideCaptionLabel{{ /lang }}"{{ /get.child.image.filtered.captionOptions.expandable }}>\n                <figcaption itemprop="caption" class="{{ #style.collection }}text_decoration child.image.fields.imageCaption{{ /style.collection }}">{{ #helper.stripLinks }}{{ #get.child.image.fields.globalCaption }}{{{ get.child.image.fields.globalCaption }}}{{ /get.child.image.fields.globalCaption }}{{ ^get.child.image.fields.globalCaption }}{{{ get.child.image.fields.imageCaption }}}{{ /get.child.image.fields.globalCaption }}{{ /helper.stripLinks }}</figcaption>\n                <figcaption itemprop="author" class="{{ #style.collection }}text_decoration child.image.fields.byline{{ /style.collection }}" data-byline-prefix="{{{ getConfig.image.imageBylinePrefix }}}">{{ #helper.stripLinks }}{{{ get.child.image.fields.byline }}}{{ /helper.stripLinks }}</figcaption>\n                {{ #get.child.image.filtered.sourceUrl }}
7\n                <figcaption class="{{ #style.collection }}text_decoration child.image.fields.sourceUrl{{ /style.collection }}"><a href="{{{ get.child.image.filtered.sourceUrl }}}" target="_blank" rel="noopener noreferrer nofollow">{{{ get.child.image.filtered.sourceUrl }}}</a></figcaption>\n                {{ /get.child.image.filtered.sourceUrl }}\n            </div>\n        {{ /get.current.fields.displayCaption }}\n\n        {{ #get.current.metadata.vertical_text_align }}\n            <div class="vertically-aligned-text">\n        {{ /get.current.metadata.vertical_text_align }}\n            {{ #get.current.filtered.paywallLabel }}{{> partial/elements/paywallLabel }}{{ /get.current.filtered.paywallLabel }}\n\n            {{ #get.current.filtered.sectionPlacement.underImage }}\n                {{ #get.current.metadata.showSection }}\n                    {{ #get.current.filtered.section }}<p itemprop="section" class="section" data-tag="{{ get.current.filtered.section }}">{{ get.current.filtered.section }}</p>{{ /get.current.filtered.section }}\n                {{ /get.current.metadata.showSection }}\n            {{ /get.current.filtered.sectionPlacement.underImage }}\n        \n            {{ #get.current.filtered.tagPlacement.underImage }}\n                {{ #get.current.metadata.showTags }}\n                    <div itemprop="tags" class="tags">\n                        {{ #get.current.filtered.termData }}\n                            <span itemprop="tag" class="tag" data-tag="{{ name }}">{{ displayName }}</span> \n                        {{ /get.current.filtered.termData }}\n                        {{ ^get.current.filtered.termData }}\n                            {{ #get.current.filtered.tags }}\n                                <span itemprop="tag" class="tag" data-tag="{{ . }}">{{.}}</span> \n                            {{ /get.current.filtered.tags }}\n                        {{ /get.current.filtered.termData }}\n                    </div>\n                {{ /get.current.metadata.showTags }}\n            {{ /get.current.filtered.tagPlacement.underImage }}\n            {{ #get.current.filtered.layout.bottom }}\n                {{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n            {{ /get.current.filtered.layout.bottom }}\n\n            {{ #get.current.filtered.sectionPlacement.underText }}\n                {{ #get.current.metadata.showSection }}\n                    {{ #get.current.filtered.section }}<p itemprop="section" class="section" data-tag="{{ get.current.filtered.section }}">{{ get.current.filtered.section }}</p>{{ /get.current.filtered.section }}\n                {{ /get.current.metadata.showSection }}\n            {{ /get.current.filtered.sectionPlacement.underText }}\n        \n            {{ #get.current.filtered.tagPlacement.underText }}\n                {{ #get.current.metadata.showTags }}\n                    <div itemprop="tags" class="tags under-text">\n                        {{ #get.current.filtered.termData }}\n                            <span itemprop="tag" class="tag" data-tag="{{ name }}">{{ displayName }}</span> \n                        {{ /get.current.filtered.termData }}\n                        {{ ^get.current.filtered.termData }}\n                            {{ #get.current.filtered.tags }}\n                                <span itemprop="tag" class="tag" data-tag="{{ . }}">{{.}}</span> \n                            {{ /get.current.filtered.tags }}\n                        {{ /get.current.filtered.termData }}\n                    </div>\n                {{ /get.current.metadata.showTags }}\n            {{ /get.current.filtered.tagPlacement.underText }}\n\n        {{ #get.current.filtered.displayByline }}\n            {{ #get.current.filtered.layout.sub }}\n                {{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n            {{ /get.current.filtered.layout.sub }}\n        {{ /get.current.filtered.displayByline }}\n\n        {{ ^get.current.filtered.displayByline }}\n            {{ #get.current.filtered.displayPublishedDate }}\n                <div class="article-published-wrapper">\n                    <p class="article-published-date">{{{ get.current.filtered.publishedDate }}}</p>\n                </div>\n            {{ /get.current.filtered.displayPublishedDate }}\n        {{ /get.current.filtered.displayByline }}\n\n        {{ #get.current.metadata.vertical_text_align }}\n            </div>\n        {{ /get.current.metadata.vertical_text_align }}\n\n        {{ #get.current.fields.published_url }}</a>{{ /get.current.fields.published_url }}\n\n        {{ #get.current.metadata.subarticles }}\n            <p class="subarticlesTitle bold {{ #style.collection }}text_decoration fields.subarticlesTitle{{ /style.collection }}" style="margin: 0.6em 0 0;">{{{ get.current.fields.subarticlesTitle }}}</p>\n            <ul class="relatedArticles">{{ #children.article[]+ }}\n            {{{ . }}}\n            {{ /children.article[]+ }}</ul>\n        {{ /get.current.metadata.subarticles }}\n        <time itemprop="datePublished" datetime="{{ get.current.filtered.published }}"></time>\n    </div>\n</article>\n',"content/article/template/rss":"<item>\n    <title><![CDATA[{{ #helper.sanitizeString }}{{{ get.current.filtered.title }}}{{ /helper.sanitizeString }}]]></title>\n    <link>{{{ get.current.filtered.published_url_rss }}}</link>\n    <guid>{{{ get.current.filtered.base_url }}}/a/{{ get.current.filtered.articleId }}</guid>\n    {{ #get.current.filtered.published_rss }}\n        <pubDate>{{ get.current.filtered.published_rss }}</pubDate>\n    {{ /get.current.filtered.published_rss }}\n    <description><![CDATA[{{ #helper.sanitizeString }}{{{ get.current.filtered.subtitle }}}{{ /helper.sanitizeString }}]]></description>\n    {{ #get.current.fields.kicker }}\n    <lab:kicker><![CDATA[{{{ get.current.fields.kicker }}}]]></lab:kicker>\n    {{ /get.current.fields.kicker }}\n    {{{ child.image }}}\n</item>\n","content/article/template/mailmojo":'<td class="cell" width="{{ size.grid.percentage }}%" valign="top">\n    <table width="100%" cellspacing="0" cellpadding="0" style="border: 0; padding-left: 10px; padding-right: 10px;">\n        <tr>\n            <td align="center" valign="top"{{ #get.current.metadata.mailmojo_bg_color }} style="background-color:{{{ get.current.metadata.mailmojo_bg_color }}}; padding: 12px;"{{ /get.current.metadata.mailmojo_bg_color }}>\n                {{#get.current.metadata.showKicker}}{{^get.current.metadata.kickerBelowImage}}{{ #get.current.fields.kicker }}\n                <table width="100%" cellspacing="0" cellpadding="0" style="border: 0;">\n                    <tr>\n                        <td class="font-14 text-silver" align="left" valign="top" style="font-size: 14px; color: #555;">\n                            {{{ get.current.fields.kicker }}}\n                        </td>\n                    </tr>\n                </table>\n                {{ /get.current.fields.kicker }}{{/get.current.metadata.kickerBelowImage}}{{/get.current.metadata.showKicker}}\n\n                {{^get.current.metadata.hideimage}}\n                {{{ child.image }}}\n                {{{ child.graphic }}}\n                {{/get.current.metadata.hideimage}}\n\n                {{#get.current.metadata.showKicker}}{{#get.current.metadata.kickerBelowImage}}{{ #get.current.fields.kicker }}\n                <table width="100%" cellspacing="0" cellpadding="0" style="border: 0;">\n                    <tr>\n                        <td class="font-14 text-silver" align="left" valign="top" style="font-size: 14px; color: #555;">\n                            {{#get.current.fields.published_url}}<a href="{{{get.current.fields.published_url}}}" data-k5a-url="{{{ get.current.filtered.canonical_url }}}" style="color: #000; text-decoration: none;">{{/get.current.fields.published_url}}\n                            {{{ get.current.fields.kicker }}}\n                            {{#get.current.fields.published_url}}</a>{{/get.current.fields.published_url}}\n                        </td>\n                    </tr>\n                </table>\n                {{ /get.current.fields.kicker }}{{/get.current.metadata.kickerBelowImage}}{{/get.current.metadata.showKicker}}\n\n                {{ ^get.current.metadata.hideTitle }}{{ #get.current.fields.title }}\n                <table width="100%" cellspacing="0" cellpadding="0" style="border: 0;">\n                    <tr>\n                        <td align="left" valign="top">\n                            <h1 editable="true" style="color: #000; line-height: 1.2; font-size: 24px;">\n                                {{#get.current.filtered.published_url}}<a href="{{{get.current.filtered.published_url}}}" data-k5a-url="{{{ get.current.filtered.canonical_url }}}" style="color: #000; text-decoration: none;">{{/get.current.filtered.published_url}}\n                                {{{ get.current.fields.title }}}\n                                {{ #get.current.filtered.paywall }}\n                                {{ #get.current.filtered.paywallLabel.displayInNewsletter }}\n                                {{ #get.current.filtered.paywallLabel.text.content }}\n                                ({{ get.current.filtered.paywallLabel.text.content }})\n                                {{ /get.current.filtered.paywallLabel.text.content }}\n                                {{ ^get.current.filtered.paywallLabel.text.content }}\n                                (+)\n                                {{ /get.current.filtered.paywallLabel.text.content }}\n                                {{ /get.current.filtered.paywallLabel.displayInNewsletter }}\n                                {{ /get.current.filtered.paywall }}\n                                {{#get.current.filtered.published_url}}</a>{{/get.current.filtered.published_url}}\n                            </h1>\n                        </td>\n                    </tr>\n                </table>\n                {{ /get.current.fields.title }}{{ /get.current.metadata.hideTitle }}\n\n                {{ ^get.current.metadata.hidesubtitle }}{{ #get.current.fields.subtitle }}\n                <table width="100%" cellspacing="0" cellpadding="0" style="border: 0;">\n                    <tr>\n                        <td align="left" valign="top">\n                            <p editable="true" style="color: #000; font-size: 16px; line-height: 1.5;">\n                                {{{ get.current.fields.subtitle }}}\n                            </p>\n                        </td>\n                    </tr>\n                </table>\n                {{ /get.current.fields.subtitle }}{{ /get.current.metadata.hidesubtitle }}\n            </td>\n        </tr>\n    </table>\n</td>',"content/article/template/newssitemap":"{{ #get.current.filtered.published_url }}\n<url>\n    <loc>{{ get.current.filtered.published_url }}</loc>\n    {{ ^get.current.filtered.articleOutOfDate_sitemap }}\n        <news:news>\n            <news:publication>\n                <news:name>{{ getCmsConfig.site.display_name }}</news:name>\n                <news:language>{{ get.current.filtered.languageIso639 }}</news:language>\n            </news:publication>\n            <news:publication_date>{{ get.current.filtered.published_sitemap }}</news:publication_date>\n            <news:title>{{ get.current.filtered.title }}</news:title>\n        </news:news>\n    {{ /get.current.filtered.articleOutOfDate_sitemap }}\n    {{{ child.image }}}\n</url>\n{{ /get.current.filtered.published_url }}\n","content/article/template/partials/kicker":'<div {{ #get.current.fields.kicker[animate] }}data-content="{{ #helper.sanitizeString }}{{{ get.current.filtered.kicker }}}{{ /helper.sanitizeString }}"{{ /get.current.fields.kicker[animate] }}\nstyle="{{ #style.collection }}text_decoration_inline_style fields.kicker{{ /style.collection }}"\nclass="kicker {{ get.current.filtered.layout.positions.kicker }}
7 {{ #style.collection }}text_decoration fields.kicker{{ /style.collection }}">\n{{{ get.current.filtered.kicker }}}\n</div>',"content/article/template/partials/subtitle":'<p itemprop="description" \n    class="subtitle {{ #style.collection }}text_decoration fields.subtitle{{ /style.collection }}{{ #get.current.metadata.subtitleAboveImage }} subtitleAboveImage{{ /get.current.metadata.subtitleAboveImage }}"\n    style="{{ #style.collection }}text_decoration_inline_style fields.subtitle{{ /style.collection }}"\n    {{ #get.current.fields.subtitle[animate] }}data-content="{{ #helper.sanitizeString }}{{{ get.current.filtered.subtitle }}}{{ /helper.sanitizeString }}"{{ /get.current.fields.subtitle[animate] }}>\n    {{{ get.current.filtered.subtitle }}}\n</p>\n',"content/article/template/partials/title":'<h2 itemprop="headline" \n    class="headline {{ #style.collection }}text_decoration fields.title{{ /style.collection }}"\n    style="{{ #style.collection }}text_decoration_inline_style fields.title{{ /style.collection }}"\n    {{ #get.current.fields.title[animate] }}data-content="{{ #helper.sanitizeString }}{{{ get.current.filtered.title }}}{{ /helper.sanitizeString }}"{{ /get.current.fields.title[animate] }}>{{{ get.current.filtered.title }}}\n</h2>',"content/article/template/partials/bylines":'<div class="bylines{{ #get.current.metadata.floatingBylines }} floating{{ /get.current.metadata.floatingBylines }}{{ #get.current.metadata.bylinesAboveTitle }} aboveTitle{{ /get.current.metadata.bylinesAboveTitle }}">\n    {{ #get.current.filtered.bylines }}\n        <div class="byline column" itemscope="" itemtype="http://schema.org/Person">\n            <div class="content">\n                {{ ^get.current.metadata.hideBylineImages }}\n                    {{ #imageUrl }}\n                        <figure>\n                            <img itemprop="image" src="{{{ imageUrl}}}">\n                        </figure>\n                    {{ /imageUrl}}\n                {{ /get.current.metadata.hideBylineImages }}\n                <address class="name">{{{ firstname }}} {{{ lastname }}}{{ #getConfig.contentbox_settings.article.show_byline_description }}{{ #description}}, <span class="author-description">{{{ description }}}</span>{{ /description}}{{ /getConfig.contentbox_settings.article.show_byline_description }}</address>\n            </div>\n        </div>\n    {{ /get.current.filtered.bylines }}\n    {{ #get.current.filtered.displayPublishedDate }}\n        <div class="article-published-wrapper">\n            <p class="article-published-date">{{{ get.current.filtered.publishedDate }}}</p>\n        </div>\n    {{ /get.current.filtered.displayPublishedDate }}\n</div>\n',"content/article/template/partials/audio":"{{ #get.current.filtered.audio.url }}\n    <div class=\"teaser-audio\">\n        <audio>\n            <source src=\"{{{ get.current.filtered.audio.url }}}\" type=\"{{ #get.current.filtered.audio.fileType }}{{ get.current.filtered.audio.fileType }}{{ /get.current.filtered.audio.fileType }}{{ ^get.current.filtered.audio.fileType }}audio/mpeg{{ /get.current.filtered.audio.fileType }}\">\n            Your browser does not support the audio element.\n        </audio>\n        <button class=\"fi-play\" aria-label=\"Play audio\"></button>\n    </div>\n    <script>\n        document.addEventListener('DOMContentLoaded', function() {\n            if (!window.audioScriptLoaded) {\n                window.audioScriptLoaded = true;\n\n                const teaserAudioElements = document.querySelectorAll('.teaser-audio');\n\n                teaserAudioElements.forEach(teaserAudio => {\n                    const audio = teaserAudio.querySelector('audio');\n                    const button = teaserAudio.querySelector('button');\n\n                    button.addEventListener('click', function(event) {\n                        event.preventDefault();\n                        if (audio.paused) {\n                            playAudio(audio, button);\n                        } else {\n                            pauseAudio(audio, button);\n                        }\n                    });\n\n                    audio.addEventListener('ended', function() {\
7n                        pauseAudio(audio, button);\n                    });\n\n                    audio.addEventListener('pause', function() {\n                        pauseAudio(audio, button);\n                    });\n\n                    audio.addEventListener('play', function() {\n                        playAudio(audio, button);\n                    });\n                });\n\n                function playAudio(audio, button) {\n                    audio.play();\n                    button.setAttribute('aria-label', 'Pause audio');\n                    button.setAttribute('aria-pressed', 'true');\n                    button.classList.add('fi-pause');\n                    button.classList.remove('fi-play');\n                }\n\n                function pauseAudio(audio, button) {\n                    audio.pause();\n                    button.setAttribute('aria-label', 'Play audio');\n                    button.setAttribute('aria-pressed', 'false');\n                    button.classList.add('fi-play');\n                    button.classList.remove('fi-pause');\n                }\n            }\n        });\n    <\/script>\n{{ /get.current.filtered.audio.url }}","partial/elements/paywallLabel":'<div class="paywallLabel{{ #layout.noImage }} no-image{{ /layout.noImage }} {{ get.current.metadata.paywallLabelPosition }}{{ ^get.current.metadata.paywallLabelPosition }} {{ layout.float }}{{ /get.current.metadata.paywallLabelPosition }}">{{ ^get.current.filtered.paywallLabel.hideLabelIcon }}{{ #icon.content }}<span class="{{ icon.content }}"></span> {{/icon.content }}{{ /get.current.filtered.paywallLabel.hideLabelIcon }}{{ ^get.current.filtered.paywallLabel.hideLabelText }}{{ text.content }}{{ /get.current.filtered.paywallLabel.hideLabelText }}</div>\n',"content/article/template/subarticle":'<li id="article-{{ get.current.id }}" class="column">\n    <a itemprop="url" href="{{ get.current.fields.published_url }}" data-k5a-url="{{{ get.current.filtered.canonical_url }}}">\n        {{ ^get.parent.metadata.sub_hideImage }}\n            {{{ children.image[0] }}}\n        {{ /get.parent.metadata.sub_hideImage }}\n        <div class="text">\n            {{ ^get.parent.metadata.sub_hideTitle }}\n                <h5 itemprop="name headline" class="subarticle {{ #style.collection }}text_decoration fields.title{{ /style.collection }}">{{{ get.current.fields.title }}}</h5>\n            {{ /get.parent.metadata.sub_hideTitle }}\n            {{ ^get.parent.metadata.sub_hideSubtitle }}\n                <p class="subarticle {{ #style.collection }}text_decoration fields.subtitle{{ /style.collection }}">{{{ get.current.fields.subtitle }}}</p>\n            {{ /get.parent.metadata.sub_hideSubtitle }}\n        </div>\n    </a>\n</li>\n',"content/article/template/labradorSearch":'<article {{ #helper.trim }}\n    data-element-guid="{{ get.current.guid }}"\n    class="column{{ #get.current.filtered.paywall }} paywall{{ /get.current.filtered.paywall }} {{ size.grid.css }} {{ size.grid.absCss }}"\n    data-instance="{{ get.current.instance_of }}{{ ^get.current.instance_of }}{{ get.current.id }}{{ /get.current.instance_of }}" \n    {{ #get.child.image.fields.float }}data-image-float="{{ get.child.image.fields.float }}"{{ /get.child.image.fields.float }}\n    itemscope\n    {{ /helper.trim }}>\n    {{{ get.current.filtered.styleSheets }}}\n    <div class="content">    \n        {{ #get.current.fields.published_url }}\n            <a itemprop="url" href="{{{ get.current.fields.published_url }}}">\n        {{ /get.current.fields.published_url }}\n            <div class="media {{ #style.definition }}imageAlign child.image.fields.float{{ /style.definition }}">\n                {{{ child.image }}}\n                {{ #get.current.filtered.paywallLabel }}{{> partial/elements/paywallLabel }}{{ /get.current.filtered.paywallLabel }}\n            </div>\n            <h3 itemprop="headline" class="headline">\n                {{{ get.current.filtered.title }}}\n            </h3>\n            <p itemprop="description" class="subtitle">\n                {{{ get.current.filtered.subtitle }}}\n            </p>\n        {{ #get.current.fields.published_url }}\n            </a>\n        {{ /get.current.fields.published_url }}\n        <time itemprop="datePublished" datetime="{{ get.current.filtered.published }}"></time>\n    </div>\n</article>\n',"content/article/template/articleList":'<li class="{{ #style.definition }}background_color{{ /style.definition }}">\n    <a itemprop="url" href="{{ get.current.fields.published_url }}" data-k5a-url="{{{ get.current.filtered.canonical_url }}}">\n        {{ ^get.parent.fields.hideImage }}{{{ children.image }}}{{ /get.parent.fields.hideImage }}\n        {{ #get.parent.fields.displayKicker }}\n            <p itemprop="kicker" class="al-kicker {{ #style.collection }}text_decoration fields.subtitle{{ /style.collection }}">{{{ get.current.fields.kicker }}}</p>\n        {{ /get.parent.fields.displayKicker }}\n        {{ ^get.parent.fields.hideTitle }}\n            <h3 itemprop="name headline" class="al-title {{ #style.collection }}text_decoration fields.title{{ /style.collection }}">{{{ get.current.fields.title }}}</h3>\n        {{ /get.parent.fields.hideTitle }}\n        {{ #get.parent.fields.displaySubtitle }}\n            <p itemprop="description" class="subtitle {{ #style.collection }}text_decoration fields.subtitle{{ /style.collection }}">{{{ get.current.fields.subtitle }}}</p>\n        {{ /get.parent.fields.displaySubtitle }}\n    </a>\n</li>\n',"content/article/template/scrollbox":'<article {{ #helper.trim }}\n    data-element-guid="{{ get.current.guid }}
7"\n    class="column\n        {{ #style.collection }}box_decoration{{ /style.collection }}\n        {{ #get.current.filtered.paywall }}paywall{{ /get.current.filtered.paywall }}\n        {{ size.grid.css }}\n        {{ size.grid.absCss }}\n        {{ get.current.filtered.autodata_css }}"\n    {{ #get.current.filtered.autodata_attributes }} {{ key }}="{{ value }}"{{ /get.current.filtered.autodata_attributes }} \n    data-site-alias="{{ get.current.filtered.site_alias }}" \n    data-section="{{ get.current.filtered.section }}" \n    data-instance="{{ get.current.instance_of }}{{ ^get.current.instance_of }}{{ get.current.id }}{{ /get.current.instance_of }}" \n    {{ #get.child.image.fields.float }}data-image-float="{{ get.child.image.fields.float }}"{{ /get.child.image.fields.float }}\n    itemscope\n    {{ /helper.trim }}>\n    {{{ get.current.filtered.styleSheets }}}\n    <div class="{{ #helper.trim }}\n        content\n        {{ #style.collection }}content_decoration{{ /style.collection }}\n        {{ #get.current.metadata.image_gradient_direction }}image-gradient-{{ get.current.metadata.image_gradient_direction }}{{ /get.current.metadata.image_gradient_direction }}\n        {{ get.current.filtered.hoverEffectClasses }}\n        {{ #style.collection }}box_fullWidth{{ /style.collection }}\n        {{ /helper.trim }}" style="{{ #style.collection }}content_inline_style{{ /style.collection }}{{ #get.current.filtered.hoverEffectStyles }} {{ get.current.filtered.hoverEffectStyles }}{{ /get.current.filtered.hoverEffectStyles }}">\n        \n        {{#get.current.fields.published_url}}\n\t\t\t<a itemprop="url"{{ #get.current.fields.open_in_new_window }} target="_blank"{{ /get.current.fields.open_in_new_window }} class="" href="{{{ get.current.fields.published_url }}}" data-k5a-url="{{{ get.current.filtered.canonical_url }}}" rel="{{ #get.current.filtered.addRelUgc }}ugc {{ /get.current.filtered.addRelUgc }}{{ #get.current.filtered.addRelSponsored }}sponsored {{ /get.current.filtered.addRelSponsored }}{{ #get.current.filtered.addRelNoFollow }}nofollow{{ /get.current.filtered.addRelNoFollow }}">\n\t\t{{/get.current.fields.published_url}}\n\n        {{ #get.current.filtered.layout.top }}\n            {{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n        {{ /get.current.filtered.layout.top }}\n\n        <div class="media{{ #get.current.metadata.floatingTextSubset }} floatingTextSubset{{ /get.current.metadata.floatingTextSubset }} {{ #style.definition }}imageAlign child.image.fields.float{{ /style.definition }}{{ #get.current.fields.displayVideoArticleOverlay }} video-overlay{{ #get.current.fields.videoOverlayPosition }} video-overlay-pos-{{ get.current.fields.videoOverlayPosition }}{{ /get.current.fields.videoOverlayPosition }}{{ /get.current.fields.displayVideoArticleOverlay }}">\n            {{^get.current.metadata.hideimage}}\n                {{{ placeholder.no_media }}}\n\n                {{{ child.image }}}\n                {{{ child.graphic }}}\n                {{{ child.slideshow }}}\n                {{{ child.youtube }}}\n                {{{ child.simplestream }}}\n                {{{ child.markup }}}\n                {{{ child.parallax }}}\n                {{{ child.grid }}}\n            \n            {{/get.current.metadata.hideimage}}\n\n            <div class="floatingText">\n                {{ #get.current.filtered.layout.floating }}\n\t\t\t\t\t{{ #get.parent.fields.useParagraphs }}\n\t\t\t\t\t\t<p itemprop="headline" \n\t\t\t\t\t\t\tclass="headline {{ #style.collection }}text_decoration fields.title{{ /style.collection }}"\n\t\t\t\t\t\t\tstyle="{{ #style.collection }}text_decoration_inline_style fields.title{{ /style.collection }}"\n\t\t\t\t\t\t\t{{ #get.current.fields.title[animate] }}data-content="{{ #helper.sanitizeString }}{{{ get.current.filtered.title }}}{{ /helper.sanitizeString }}"{{ /get.current.fields.title[animate] }}>{{{ get.current.filtered.title }}}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{{ /get.parent.fields.useParagraphs }}\n\n\t\t\t\t\t{{ ^get.parent.fields.useParagraphs }}\n                \t\t{{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n\t\t\t\t\t{{ /get.parent.fields.useParagraphs }}\n                {{ /get.current.filtered.layout.floating }}\n            </div>\n\n            {{ #get.current.metadata.enableAudio }}\n\t\t\t\t{{ #render.template }}content/article/template/partials/audio{{ /render.template }}\n\t\t\t{{ /get.current.metadata.enableAudio }}\n\n            {{ #get.current.filtered.paywallLabel }}\n\t\t\t\t{{> partial/elements/paywallLabel }}\n\t\t\t{{ /get.current.filtered.paywallLabel }}\n\n        </div>\n\n\t\t{{ #get.current.filtered.layout.bottom }}\n\t\t\t{{ #render.template }}content/article/template/partials/{{ . }}{{ /render.template }}\n\t\t{{ /get.current.filtered.layout.bottom }}\n\n\n\t\t{{ #get.current.filtered.paywallLabel }}\n\t\t\t{{> partial/elements/paywallLabel }}\n\t\t{{ /get.current.filtered.paywallLabel }}\n\n        {{#get.current.fields.published_url}}\n\t\t\t</a>\n\t\t{{/get.current.fields.published_url}}\n    </div>\n</article>\n',"content/image/template/default":'<figure data-element-guid="{{ get.current.guid }}
7" class="{{#helper.trim}}\n    {{ #style.collection }}box_decoration{{ /style.collection }}\n    {{ #get.current.filtered.hasFloat }}{{ #style.definition }}responsive_size fields.vpWidth{{ /style.definition }}{{ /get.current.filtered.hasFloat }}\n    {{ #style.definition }}imageBorder fields.border{{ /style.definition }}\n    {{ #style.definition }}imageAlign fields.float{{ /style.definition }}\n    {{ get.current.filtered.imageLoadingClass }}\n    {{/helper.trim}}" {{ #get.current.filtered.hasFloat }}{{ ^get.current.fields.vpWidth }}style="width:{{ get.current.filtered.imageWidth }}px;"{{ /get.current.fields.vpWidth }}{{ /get.current.filtered.hasFloat }}>\n    <div class="img{{ #get.current.filtered.allowFullwidth }} fullwidthTarget{{ /get.current.filtered.allowFullwidth }} {{ #style.collection }}content_decoration{{ /style.collection }}">\n        {{ > content/image/template/partials/img }}\n        {{ > content/image/template/partials/shapes }}\n    </div>\n    {{ ^get.parent.filtered.layout.floating }} {{ #get.current.filtered.captionOptions.display }}\n    {{ > content/image/template/partials/caption }}\n    {{ /get.current.filtered.captionOptions.display }} {{ /get.parent.filtered.layout.floating }}\n</figure>\n',"content/image/template/article":'<figure data-element-guid="{{ get.current.guid }}" class="{{#helper.trim}}\n    {{ #style.collection }}box_decoration{{ /style.collection }}\n    {{ #get.current.filtered.hasFloat }}{{ #style.definition }}responsive_size fields.vpWidth{{ /style.definition }}{{ /get.current.filtered.hasFloat }}\n    {{ #style.definition }}imageBorder fields.border{{ /style.definition }}\n    {{ #style.definition }}imageAlign fields.float{{ /style.definition }}\n    {{ get.current.filtered.imageLoadingClass }}\n    {{/helper.trim}}" {{ #get.current.filtered.hasFloat }}{{ ^get.current.fields.vpWidth }}style="width:{{ get.current.filtered.imageWidth }}px;"{{ /get.current.fields.vpWidth }}{{ /get.current.filtered.hasFloat }}>\n    <div class="img fullwidthTarget">\n        {{ > content/image/template/partials/img }}\n        {{ > content/image/template/partials/shapes }}\n    </div>\n    {{ #get.parent.metadata.image_overlay }}<div class="imageOverlay {{ get.parent.metadata.image_overlay }} {{ get.parent.metadata.image_overlay_opacity }}"></div>{{ /get.parent.metadata.image_overlay }}\n    {{ > content/image/template/partials/child }}\n</figure>\n',"content/image/template/partials/caption_links":'<div class="caption {{ #helper.trim }}\n    {{ #app.isEditor }}expanded{{ /app.isEditor }}\n    {{ #get.parent.fields.truncateCaption }}truncate{{ /get.parent.fields.truncateCaption }}\n    {{ ^get.parent.fields.truncateCaption }}\n        {{ #get.current.fields.truncateCaption }}truncate{{ /get.current.fields.truncateCaption }}\n    {{ /get.parent.fields.truncateCaption }}\n    {{ /helper.trim }}" data-showmore="{{ #lang }}image.caption.showMoreLabel{{ /lang }}"{{ #get.current.filtered.captionOptions.expandable }} data-expandable="true" data-showcaption="{{ #lang }}image.caption.showCaptionLabel{{ /lang }}" data-hidecaption="{{ #lang }}image.caption.hideCaptionLabel{{ /lang }}"{{ /get.current.filtered.captionOptions.expandable }}>\n    <figcaption itemprop="caption" class="{{ #style.collection }}text_decoration fields.imageCaption{{ /style.collection }}">{{{ get.current.fields.imageCaption }}}</figcaption>\n    <figcaption itemprop="author" class="{{ #style.collection }}text_decoration fields.byline{{ /style.collection }}" data-byline-prefix="{{{ getConfig.image.imageBylinePrefix }}}">{{{ get.current.fields.byline }}}</figcaption>\n    {{ #get.current.filtered.sourceUrl }}\n    <figcaption class="{{ #style.collection }}text_decoration fields.sourceUrl{{ /style.collection }}"><a href="{{{ get.current.filtered.sourceUrl }}}" target="_blank" rel="noopener noreferrer nofollow">{{{ get.current.filtered.sourceUrl }}}</a></figcaption>\n    {{ /get.current.filtered.sourceUrl }}\n</div>',"content/image/template/partials/caption":'<div class="caption {{ #helper.trim }}\n    {{ #app.isEditor }}expanded{{ /app.isEditor }}\n    {{ #get.parent.fields.truncateCaption }}truncate{{ /get.parent.fields.truncateCaption }}\n    {{ ^get.parent.fields.truncateCaption }}\n        {{ #get.current.fields.truncateCaption }}truncate{{ /get.current.fields.truncateCaption }}\n    {{ /get.parent.fields.truncateCaption }}\n    {{ /helper.trim }}" data-showmore="{{ #lang }}image.caption.showMoreLabel{{ /lang }}"{{ #get.current.filtered.captionOptions.expandable }} data-expandable="true" data-showcaption="{{ #lang }}image.caption.showCaptionLabel{{ /lang }}" data-hidecaption="{{ #lang }}image.caption.hideCaptionLabel{{ /lang }}"{{ /get.current.filtered.captionOptions.expandable }}>\n    <figcaption itemprop="caption" class="{{ #style.collection }}text_decoration fields.imageCaption{{ /style.collection }}">{{ #get.parent.fields.globalCaption }}{{{ get.parent.fields.globalCaption }}}{{ /get.parent.fields.globalCaption }}{{ ^get.parent.fields.globalCaption }}{{{ get.current.fields.imageCaption }}}{{ /get.parent.fields.globalCaption }}</figcaption>\n    <figcaption itemprop="author" class="{{ #style.collection }}text_decoration fields.byline{{ /style.collection }}" data-byline-prefix="{{{ getConfig.image.imageBylinePrefix }}}">{{{ get.current.fields.byline }}}</figcaption>\n    {{ #get.current.filtered.sourceUrl }}\n    <figcaption class="{{ #style.collection }}text_decoration fields.sourceUrl{{ /style.collection }}"><a href="{{{ get.current.filtered.sourceUrl }}}" target="_blank" rel="noopener noreferrer nofollow">{{{ get.current.filtered.sourceUrl }}}</a></figcaption>\n    {{ /get.current.filtered.sourceUrl }}\n</div>',"content/image/template/partials/img":'<picture>\n    {{ #get.current.filtered.viewport_list.desktop.formats }}\n    <source srcset="{{{ get.current.filtered.viewport_list.desktop.url }}}&format={{ format }}" \n        width="{{{ get.current.filtered.viewport_list.desktop.width }}}"\n        height="{{{ get.current.filtered.viewport_list.desktop.height }}}"\n        media="(min-width: 768px)"\n        type="{{{ type }}}">    \n    {{ /get.current.filtered.viewport_list.desktop.formats }}\n    {{ #get.current.filtered.viewport_list.mobile.formats }}\n    <source srcset="{{{ get.current.filtered.viewport_list.mobile.url }}}&format={{ format }}" \n        width="{{{ get.current.filtered.viewport_list.mobile.width }}}"\n        height="{{{ get.current.filtered.viewport_list.mobile.height }}}"\n        media="(max-width: 767px)"\n        type="{{{ type }}}">    \n    {{ /get.current.filtered.viewport_list.mobile.formats }}\n    <img src="{{{ get.current.filtered.viewport_list.mobile.url }}}&format=jpg"\n        width="{{{ get.current.filtered.viewport_list.mobile.width }}}"\n        height="{{{ get.current.filtered.viewport_list.mobile.height }}}"\n        alt="{{ #helper.sanitizeString }}{{ #get.current.fields.altText }}{{{ get.current.fields.altText }}}{{ /get.current.fields.altText }}{{ /helper.sanitizeString }}" \n        {{ #get.current.filtered.lazyloadImages }}loading="lazy"{{ /get.current.filtered.lazyloadImages }}{{ ^get.current.filtered.lazyloadImages }}fetchpriority="high"{{ /get.current.filtered.lazyloadImages }}\n        {{ #app.isEditor }}\n        class="{{ #helper.getEditorLoadingClass }}{{ /helper.getEditorLoadingClass }}"\n        style="{{ #helper.getEditorLoadingStyle }}{{ /helper.getEditorLoadingStyle }} {{{ get.current.filtered.filters }}}"    \n        {{ /app.isEditor }}\n        {{ ^app.isEditor }}\n        style="{{{ get.current.filtered.filters }}}"    \n        {{ /app.isEditor }}>\n</picture>',"content/image/template/partials/child":'{{ #get.current.metadata.subimage }}\n    {{ #app.isEditor }}\n    <div class="imageChildren {{ #style.collection }}subimage{{ /style.collection }}">{{{ children.all }}}</div>\n    {{ /app.isEditor }}\n    {{ #app.isFront }}{{ #children.all[0] }}\n    <div class="imageChildren {{ #style.collection }}subimage{{ /style.collection }}">{{{ children.all }}}</div>\n    {{ /children.all[0] }}{{ /app.isFront }}\n{{ /get.current.metadata.subimage }}\n',"content/image/template/partials/shapes":'{{ #get.current.filtered.viewport_list.desktop.shapes }}<div class="dac-hidden-mobile">{{{ get.current.filtered.viewport_list.desktop.shapes }}}</div>{{ /get.current.filtered.viewport_list.desktop.shapes }}\n{{ #get.current.filtered.viewport_list.mobile.shapes }}<div class="dac-hidden-desktop-up">{{{ get.current.filtered.viewport_list.mobile.shapes }}}</div>{{ /get.current.filtered.viewport_list.mobile.shapes }}',"content/image/template/grid":'<figure data-element-guid="{{ get.current.guid }}
7"{{ #get.current.metadata.zoomable }} data-zoomable="1"{{ /get.current.metadata.zoomable }} class="{{#helper.trim}}\n    column\n    {{ #style.collection }}box_decoration{{ /style.collection }}\n    {{ #style.collection }}box_fullWidth{{ /style.collection }}\n    {{ size.grid.css }}\n    {{ size.grid.absCss }}\n    {{ get.current.filtered.borderClass }}\n    {{ get.current.filtered.imageLoadingClass }}\n    {{/helper.trim}}">\n    {{{ get.current.filtered.styleSheets }}}\n    <div class="content {{ #style.collection }}content_decoration{{ /style.collection }}" style="{{ #style.collection }}content_inline_style{{ /style.collection }}">\n        {{^get.current.instance_of}}\n                {{ > content/image/template/placeholder }}\n        {{/get.current.instance_of}}\n        {{#get.current.instance_of}}\n\n        <div class="img fullwidthTarget">\n            {{ > content/image/template/partials/img }}\n            {{ > content/image/template/partials/shapes }}\n        </div>\n        {{ #get.current.filtered.captionOptions.displayDefault }}\n        {{ > content/image/template/partials/caption_links }}\n        {{ /get.current.filtered.captionOptions.displayDefault }}\n        {{/get.current.instance_of}}\n    </div>\n</figure>\n',"content/notice/template/default":'<div class="notice column\n{{ #style.collection }}box_decoration{{ /style.collection }}" id="notice-{{ get.current.id }}" data-tags="{{{ get.current.filtered.filteredTags }}}">\n    <div class="content {{ #style.collection }}content_decoration{{ /style.collection }}" title="{{{ get.current.fields.title }}}">\n        <h2>\n            <a href="/notice/{{ get.current.id }}">{{{ get.current.fields.title }}}</a>\n        </h2>\n        <div class="meta">\n            <time class="fi-clock" datetime="{{ get.current.filtered.isoDate }}" title="{{ get.current.filtered.publishedDate }}">{{ get.current.filtered.niceDate }}</time>\n            {{ #get.current.fields.userName }}<span class="author fi-torsos">{{{ get.current.fields.userName }}}</span>{{ /get.current.fields.userName }}\n            {{ #get.current.fields.pinned }}{{ ^get.parent.metadata.hidePinIcon }} <span class="pinned fi-marker"> {{ #lang }}notice.pinnedLabel{{ /lang }}</span>{{ /get.parent.metadata.hidePinIcon }}{{ /get.current.fields.pinned }}\n        </div>\n        <div class="text bodytext">{{{ get.current.filtered.bodytext }}}</div>\n    </div>\n</div>\n{{ #getConfig.noticeStructuredData.active }}<script type="application/ld+json">\n{\n    "@context": "https://schema.org",\n    "@type": "BlogPosting",\n    "@id": "#notice{{ get.current.id }}",\n    "headline": "{{{ get.current.fields.title }}}",\n    "articleBody": "{{{ get.current.fields.bodytext }}}",\n    "datePublished": "{{ get.current.filtered.isoDate }}"{{ #get.current.fields.modified }},\n    "dateModified": "{{ get.current.filtered.isoModifiedDate }}"{{ /get.current.fields.modified }},\n    {{ #get.current.fields.userName }}"author": {\n        "@type": "Person",\n        "name": "{{{ get.current.fields.userName }}}"\n    },\n    {{ /get.current.fields.userName }}"isPartOf": {\n        "@type": "LiveBlogPosting",\n        "@id": "#liveblogposting"\n    }\n}\n<\/script>{{ /getConfig.noticeStructuredData.active }}',"content/adnuntiusAd/template/default":'{{ ^get.current.filtered.hideOnTablet }}\n\n<div class="{{ #helper.trim }}\n    column\n    adnuntius-ad\n    {{ get.current.fields.css }}\n    {{ ^get.current.metadata.isBodytext }}\n    {{ size.grid.css }}\n    {{ /get.current.metadata.isBodytext }}\n    {{ get.current.metadata.css }}\n    {{ #get.current.filtered.isDebug }}adnuntius-ad-debug{{ /get.current.filtered.isDebug }}\n    {{ /helper.trim }}" {{ #get.current.filtered.isDebug }}data-ad-format="{{{ get.current.fields.format }}}" data-ad-size="{{ get.current.filtered.adData.width }}x{{ get.current.filtered.adData.height }}"{{ /get.current.filtered.isDebug }}style="{{get.current.filtered.spacingTop}}{{ #get.current.metadata.style }} {{{ get.current.metadata.style }}}{{ /get.current.metadata.style }}" data-element-guid="{{ get.current.guid }}
7">\n    {{ #app.isEditor }}\n    <div class="ad-editor-preview adnuntius-ad-content" style="width:{{ get.current.filtered.adData.width }}px; height:{{ get.current.filtered.adData.height }}px;" title="{{ get.current.fields.format }}">\n        <h4>Adnuntius-ad</h4>\n        Format: <strong>{{ get.current.fields.format }}</strong><br>\n        size: <strong>{{ get.current.filtered.adData.width }}x{{ get.current.filtered.adData.height }}</strong>\n    </div>\n    {{ /app.isEditor }}\n    {{ ^app.isEditor }}\n    <div id="adn-{{{ get.current.filtered.adData.auId }}}" {{ #get.current.metadata.defaultHeight }}style="display:block;height:{{get.current.metadata.defaultHeight}}px;"{{ /get.current.metadata.defaultHeight }}{{ ^get.current.metadata.defaultHeight }}style="display:none;"{{ /get.current.metadata.defaultHeight }} class="adnuntius-ad-content">\n        <span class="ad-label">{{ get.current.filtered.label }}</span>\n    </div>\n    {{ /app.isEditor }}\n</div>\n\n{{ /get.current.filtered.hideOnTablet }}\n',"content/googleAd/template/default":'{{ ^get.current.filtered.hideOnTablet }}\n<div data-element-guid="{{ get.current.guid }}" class="{{ #helper.trim }}\n    column\n    google-ad\n    {{ #style.collection }}box_decoration{{ /style.collection }}\n    {{ ^get.current.metadata.isBodytext }}\n    {{ size.grid.css }}\n    {{ size.grid.absCss }}\n    {{ /get.current.metadata.isBodytext }}\n    {{ get.current.fields.css }}\n    {{ get.current.metadata.css }}\n    {{ #get.current.filtered.isDebug }}adnuntius-ad-debug{{ /get.current.filtered.isDebug }}\n    {{ #get.root.filtered.googleAds.disableInitialLoad }}disable-initial-load{{ /get.root.filtered.googleAds.disableInitialLoad }}\n    {{ /helper.trim }}" {{ #get.current.filtered.isDebug }}data-ad-format="{{{ get.current.fields.format }}}"{{ /get.current.filtered.isDebug }} style="{{get.current.filtered.spacingTop}}{{ #get.current.metadata.style }} {{{ get.current.metadata.style }}}{{ /get.current.metadata.style }}">\n\n    {{ #app.isEditor }}\n    <div class="ad-editor-preview" title="{{ get.current.fields.format }}">\n        <h4>Google-ad</h4>\n        Format: <strong>{{ get.current.fields.format }}</strong>\n    </div>\n    {{ /app.isEditor }}\n    {{ ^app.isEditor }}\n    {{ #get.current.filtered.googleAds.bidding }}\n        {{ #get.current.filtered.googleAds.bidding.provider.name }}\n            <span class="ad-label">{{ get.current.filtered.label }}</span>\n            {{ #render.template }}content/googleAd/template/{{ get.current.filtered.googleAds.bidding.provider.name}}/placement{{ /render.template }}\n        {{ /get.current.filtered.googleAds.bidding.provider.name }}\n    {{ /get.current.filtered.googleAds.bidding }}\n    {{ ^get.current.filtered.googleAds.bidding }}\n        <span class="ad-label">{{ get.current.filtered.label }}</span>\n        <div class="adunit" id="{{{ get.current.filtered.adData.code }}}" {{ #get.current.metadata.defaultHeight }}style="min-height:{{ get.current.metadata.defaultHeight }}px;"{{ /get.current.metadata.defaultHeight }}></div>\n        <script>\n            googletag.cmd.push(function() {\n                googletag.display(\'{{{ get.current.filtered.adData.code }}}\');\n            });\n        <\/script>\n        {{ #get.current.metadata.options.refresh }}\n        <script type="module">\n            const data = labClientAPI.get(\'adData\') || [];\n            data.push({\n                format: \'{{ get.current.fields.format }}\',\n                code: \'{{ get.current.filtered.adData.code }}\',\n                interval: {{ get.current.metadata.options.interval }},\n                index: {{ get.current.metadata.options.index }},\n                preloadIndex: {{ get.current.metadata.options.preloadIndex }}\n            });\n            labClientAPI.set(\'adData\', data);\n        <\/script>\n        {{ /get.current.metadata.options.refresh }}\n    {{ /get.current.filtered.googleAds.bidding }}\n    {{ /app.isEditor }}\n</div>\n{{ /get.current.filtered.hideOnTablet }}',"content/articleList/template/default":'<div data-element-guid="{{ get.current.guid }}
7" class="lab4 column articleList layout_{{ get.current.fields.layout }} imageLayout_{{ get.current.fields.imageLayout }} {{ size.grid.css }} {{ size.grid.absCss }} abs_grid_{{ size.grid.absWidth }} {{ #style.collection }}box_decoration{{ /style.collection }}" style="--articleList-columnsDesktop: repeat({{ get.current.filtered.columns.desktop }}, 1fr); --articleList-columnsMobile: repeat({{ get.current.filtered.columns.mobile }}, 1fr); {{ #style.collection }}content_inline_style{{ /style.collection }}">\n    {{{ get.current.filtered.styleSheets }}}\n    <div class="content {{ #style.collection }}content_decoration{{ /style.collection }}">\n        <h2 class="article-list-title {{ #style.collection }}text_decoration fields.title{{ /style.collection }}" style="{{ #style.collection }}text_decoration_inline_style fields.title{{ /style.collection }}">{{{ get.current.fields.title }}}</h2>\n        <ul{{ ^children.article[0] }} class="labicon-article"{{ /children.article[0] }}>{{{ children.article }}}</ul>\n    </div>\n</div>\n',"content/scrollbox/template/default":"<div data-element-guid=\"{{ get.current.guid }}\" class=\"{{ #helper.trim }}\n    column scrollbox \n    {{ #style.collection }}box_decoration{{ /style.collection }}\n    {{ #style.collection }}box_fullWidth{{ /style.collection }}\n    {{ size.grid.css }}\n    {{ size.grid.absCss }}\n    {{ /helper.trim }}\" id=\"article_list_{{ get.current.id }}\">\n    {{{ get.current.filtered.styleSheets }}}\n    <div class=\"{{ #helper.trim }}\n        content\n        {{ #style.collection }}content_decoration{{ /style.collection }}\n        {{ /helper.trim }}\" style=\"{{ #style.collection }}content_inline_style{{ /style.collection }}\">\n\n        {{ #app.isFront }}{{ ^get.current.fields.hide_title}}{{ #get.current.fields.title }}{{> content/scrollbox/template/title }}{{ /get.current.fields.title }}{{ /get.current.fields.hide_title}}{{ /app.isFront }}\n        {{ #app.isEditor }}\n            {{ ^get.current.fields.hide_title}}{{> content/scrollbox/template/title }}{{ /get.current.fields.hide_title}}\n            {{{ placeholder.nocontent }}}\n        {{ /app.isEditor }}\n        <ul class=\"scroll-container swipehelper snap-container-x snap-element-start\">\n            {{ #children.article[] }}\n                <li class=\"scroll-item snap-element\">\n                    {{{ . }}}\n                </li>\n            {{ /children.article[] }}\n        </ul>\n        {{ ^get.current.fields.hide_navigation}}\n        <nav>\n            <span class=\"arrow left\">\n                <span></span>\n            </span>\n            <span class=\"arrow right\">\n                <span></span>\n            </span>\n        </nav>\n        {{ /get.current.fields.hide_navigation}}\n    </div>\n\n    {{ #get.current.id }}\n    <script>\n    (function () {\n        window.dachserData.push('swipehelper', {\n            selector: '#article_list_{{ get.current.id }}',\n            itemsContainerSelector: '.scroll-container',\n            itemsSelector: '.scroll-item',\n            isHorizontal: true,\n            navItems: {\n                forwardSelector: 'nav .arrow.right',\n                backwardSelector: 'nav .arrow.left',\n            },\n            debug: {{ #get.current.filtered.isDebug }}true{{ /get.current.filtered.isDebug }}{{ ^get.current.filtered.isDebug }}false{{ /get.current.filtered.isDebug }}\n        });\n        {{ #app.isEditor }}\n        window.dachserData.reflow('swipehelper', 'selector', '#article_list_{{ get.current.id }}');\n        {{ /app.isEditor }}\n    }());\n    <\/script>\n    {{ /get.current.id }}\n\n</div>"}},
7"./public/common/AudioInline.js":(e,t,i)=>{i.r(t),i.d(t,{AudioInline:()=>a});class a{constructor(e){this.url=e.dataset.src,this.url?(this.container=e,this.state={playing:!1},this.setup()):console.error('AudioInline: "data-src" attribute missing. Cannot play audio.')}setup(){this.container.addEventListener("click",e=>{e.preventDefault(),this.loadAudio()}),this.container.classList.add("fi-play")}loadAudio(){this.player||(this.player=this.createPlayer(this.url)),this.togglePlayer()}togglePlayer(){this.state.playing?this.player.pause():this.player.play(),this.container.classList.toggle("fi-play"),this.container.classList.toggle("fi-pause"),this.state.playing=!this.state.playing}updateProgress(){const e=this.player.currentTime/this.player.duration;this.container.setAttribute("style",`--progress-value: ${100*e.toFixed(4)}%`)}updateClass(){this.state.playing?(this.container.classList.remove("fi-play"),this.container.classList.add("fi-pause")):(this.container.classList.remove("fi-pause"),this.container.classList.add("fi-play"))}createPlayer(e){this.container.classList.add("audio-inline-loading");const t=document.createElement("audio");return t.addEventListener("timeupdate",e=>{this.updateProgress()}),t.addEventListener("loadeddata",e=>{this.container.classList.remove("audio-inline-loading")}),t.addEventListener("play",()=>{this.state.playing=!0,this.updateClass()}),t.addEventListener("pause",()=>{this.state.playing=!1,this.updateClass()}),t.addEventListener("ended",()=>{this.state.playing=!1,this.updateClass()}),t.classList.add("audio-inline-src"),t.src=e,document.body.appendChild(t),t}}},
7"./public/common/labrador/ClientData.js":(e,t,i)=>{i.r(t),i.d(t,{ClientData:()=>a});class a{constructor(){this.totalCount=0,this.count=0,this.data=[],this.markups=[]}setMarkups(e){this.markups=e}setData(e){this.data=e,this.count=this.data.length}setTotalCount(e){this.totalCount=e}getData(){return this.data}}},
7"./public/common/labrador/Core.js":(e,t,i)=>{i.r(t),i.d(t,{Core:()=>G});var a={d:(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};a.r(r),a.d(r,{defaults:()=>o,functionHelper:()=>T,grid:()=>x,interpolation:()=>l,objectHelper:()=>n,stringHelper:()=>y,uuid:()=>A});const s={state:"",version:"4.2.21",build:{styleguide:4,releasenotes:"40220:3",userReleasenotes:"40220:32",browsers:{chrome:94},version:608}},n={get:(e,t,i)=>e.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:i?void 0:null,t),set:(e,t,i)=>(e.split(".").reduce((e,i,a,r)=>{if(a!==r.length-1)return n.isObject(e[i])?e[i]:e[i]={};e[i]=t},i),i),delete:(e,t)=>{e.split(".").reduce((e,t,i,a)=>{if(i!==a.length-1)return n.isObject(e[t])?e[t]:e[t]={};delete e[t]},t)},isObject:e=>e&&"object"==typeof e&&!Array.isArray(e),hasContent:e=>!!n.isObject(e)&&!!Object.keys(e).length,merge:(e,t)=>{if(Array.isArray(e)&&Array.isArray(t))return t;const i=Object.assign(Array.isArray(e)?[]:{},e);if(n.isObject(e)&&n.isObject(t))for(const a of Object.keys(t))n.isObject(t[a])?a in e&&n.isObject(e[a])?i[a]=n.merge(e[a],t[a]):Object.assign(i,{[a]:t[a]}):Object.assign(i,{[a]:t[a]});return i},mergeArray:(e,t,i=!0)=>{const a=[...e||[],...t||[]];
7return i?[...new Set(a)]:a},clone:(e,t)=>{if(!e)return e;let i;if(!t&&e instanceof Array)i=e.slice(0);else{i=e instanceof Array?[]:{};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t&&"object"==typeof e[a]&&null!==e[a]?i[a]=n.clone(e[a],t):i[a]=e[a])}return i},serialize(e,t="=",i="&"){const a=[];for(const i of Object.keys(e))a.push(i+t+e[i]);return a.length?a.join(i):null}},o={true:e=>void 0===e||!!e,false:e=>!!e,string:(e,t="")=>"string"==typeof e?e:t,stringRestricted:(e,t="",i=[])=>"string"!=typeof e?t:i.includes(e)?e:t,pixelString:(e,t="")=>{if("number"==typeof e)return`${e}px`;if("string"!=typeof e)return t;const i=e.trim().split("px");return 2!==i.length||isNaN(i[0])?t:`${i[0]}px`},stringOrNull:e=>"string"==typeof e?e:null,stringOrUndefined:e=>"string"==typeof e?e:void 0,numberOrDefault:(e,t=0)=>"number"==typeof e?e:t,array:(e,t=[])=>Array.isArray(e)?e:t,arrayOrNull:e=>Array.isArray(e)?e:null,object:(e,t={},i=t)=>!e||"object"!=typeof e||Array.isArray(e)?t:{...i,...e},objectOrArray:(e,t={})=>Array.isArray(e)?e:o.object(e,t),notNullOrUndefined:(e,t)=>null==e?t:e,notUndefined:(e,t)=>void 0===e?t:e},l={resolve:(e,t,i)=>"object"==typeof e?l.resolveObject(e,t,i):"string"==typeof e?l.resolveString(e,t,i):e,resolveObject:(e,t,i)=>{for(const a in e)"object"==typeof e[a]?e[a]=l.resolveObject(e[a],t,i):"string"==typeof e[a]&&(e[a]=l.resolveString(e[a],t,i));return e},resolveString:(e,t,i)=>-1===e.indexOf("${")?e:e.replace(/\${([^{}]*)}/g,(e,a)=>{const r=i.getCms(a.trim());return"string"==typeof r||"number"==typeof r?r:("undefined"!=typeof Sys&&Sys.logger.warn(`Cannot interpolate config value "${e}". Description: ${t}.`),e)})};class d{constructor(e,t){this.logger=t,this.log("Setup"),this.config=e,this.siteAlias=this.config.site&&this.config.site.alias||null,this.siteUuid=this.config.site&&this.config.site.uuid||null,this.fallbackSites=this.resolveSiteAliases(this.siteAlias),this.log(`Site-alias: ${this.siteAlias}`),this.log(`Will use site(s): ${this.fallbackSites}`),this.resources=[{name:"config",source:"config",path:"customer",sitesPrefix:"customer.site_config_",storeSitesPrefix:null,siteOverride:{},paths:[],content:[],resolved:!1},{name:"cmsConfig",source:"config",path:"",sitesPrefix:null,storeSitesPrefix:null,paths:[],content:[],resolved:!1},{name:"viewConfig",source:"configObject",path:"ConfigObject.viewConfig.config.customer",sitesPrefix:"ConfigObject.viewConfig.config.customer.site_config.",storeSitesPrefix:"config.customer.site_config.",siteOverride:{},paths:[],content:[],resolved:!1},{name:"featureFlags",source:"configObject",path:"ConfigObject.featureFlags",sitesPrefix:"ConfigObject.featureFlags.site.",storeSitesPrefix:"site.",siteOverride:{},paths:[],content:[],resolved:!1},{name:"content",source:"configObject",path:"ConfigObject.content",sitesPrefix:null,storeSitesPrefix:null,paths:[],content:[],resolved:!1},{name:"localisation",source:"configObject",path:"ConfigObject.localisation",sitesPrefix:null,storeSitesPrefix:null,paths:[],content:[],resolved:!1}],this.resourceObject={},this.cache={get:{},debug:{getter:{},reload:{},update:{},resetCache:{}}},this.setupResources()}static resolveFullConfig(e={},t={}){const i={ConfigObject:{},app:{mode:"presentation",version:"[unversioned cms]"},mainViewport:o.string(e.deviceMain,e.device||"desktop"),isTouchDevice:o.false(e.isTouchDevice),sites:o.array(e.sites),...e};return i.app.version=t.version||i.app.version,i.buildInfo=t.build||e.build,i.customer=d.resolveConfig(e.customer),i}static resolveConfig(e={}){const t={grid:{},...e};t.resourceAllocation=o.object(t.resourceAllocation,{resourceMaps:["_resources"],mergeMaps:!0});const i=t.viewHelper||{};return t.viewHelper={image:o.object(i.image,{viewports:["desktop"],pixelDensityFactor:1}
7)},t.appMapper=o.objectOrArray(t.appMapper),t.view_name=o.string(t.view_name,"[unnamed view]"),t.view_version=o.string(t.view_version,"[unversioned view]"),t.grid.total_grid_spans=o.numberOrDefault(t.grid.total_grid_spans,12),t.grid.grid_prefix=o.object(t.grid.grid_prefix),t.grid.abs_grid_prefix=o.object(t.grid.abs_grid_prefix,null),t.preload=o.array(t.preload),t.preloadObject=o.object(t.preloadObject),t.viewports=o.object(t.viewports),t.viewport=o.string(t.viewport),t.touchEditingViewport=o.string(t.touchEditingViewport),t.style=o.object(t.style,{definitions:{},collections:[],presets:[],copyDefinitions:[]}),t.image=o.object(t.image,{defaultAspectRatio:.45,defaultBoundingBoxWidthRatio:1}),t.imageUrlOptions=o.object(t.imageUrlOptions),t.tags=o.object(t.tags,{},{section:[]}),t.elementList=o.object(t.elementList,{all:[],favourites:[]}),t.elementListAdditions=o.object(t.elementListAdditions,{all:[],favourites:[]}),t.elementListRemovals=o.object(t.elementListRemovals,{all:[],favourites:[]}),t.autoscroll=o.object(t.autoscroll,{scrollDistance:100,scrollBuffer:50,accelerator:{max:3,step:.2}}),t.markLockedPaths=o.true(t.markLockedPaths),t.minimap=o.object(t.minimap,{structure:null,pageType:[]}),t.exitWarning=o.stringOrNull(t.exitWarning),t.publish=o.object(t.publish,{retry:{count:4,delay:2e3},options:{article:{hidden:!0,defaultHidden:!1}}}),t.autolock=o.object(t.autolock,{timeout:18e5}),t.networkWarning=o.object(t.networkWarning,null,{offline:{alert:!0,lockPage:!0},online:{alert:!0}}),t.image_preview=o.object(t.image_preview,{width:1600,compression:50}),t.textTools=o.object(t.textTools,{characterBlacklists:{utf:[]},text_size:{min:{default:14},max:{default:150,mobile:80}}}),t.structure_map=o.object(t.structure_map),t.shapes=o.object(t.shapes),t.requiredElements=o.array(t.requiredElements),t.requiredElementsAdditions=o.array(t.requiredElementsAdditions),t.data=o.object(t.data,{elements:{},presets:{},presetBlacklist:{},blacklist:[],blacklistOptions:{}}),t.pageElements=o.object(t.pageElements),t.drawer=o.array(t.drawer),t.drawerAdditions=o.array(t.drawerAdditions),t.drawerRemovals=o.array(t.drawerRemovals),t.maxChildCount=o.numberOrDefault(t.maxChildCount,150),t}log(e,t=null){this.logger&&(t?this.logger.debug(`[ConfigReader] ${e}`,[t]):this.logger.debug(`[ConfigReader] ${e}`))}setupResources(){for(const e of this.resources)this.resourceObject[e.name]=e}setupResource(e,t=null){const i=!!t&&t!==this.siteAlias,a=this.resourceObject[e];this.log(`Settings up resource "${e}". Site: "${t||this.siteAlias}". Site-override: ${a.sitesPrefix?i:"n/a"}`),t&&!a.siteOverride[t]&&(a.siteOverride[t]={content:[],paths:[],resolved:!1});const r=t?a.siteOverride[t]:a,s=i?this.resolveSiteAliases(t):this.fallbackSites;for(const e of this.calculateResourcePaths(a,s)){r.paths.push(e);const t=this.getPath(e,this.config);r.content.push({path:e,value:t||{}})}return r.resolved=!0,r}reloadResourceBySite(e,t,i){if(e&&this.resourceObject[e]&&i){this.cache.debug.reload[`${e}|${t||"no-site"}`]=this.cache.debug.reload[`${e}|${t||"no-site"}`]?this.cache.debug.reload[`${e}|${t||"no-site"}`]+1:1;const a=l.resolve(i,"reload_resouce",{getCms:e=>n.get(e,this.config,!0)}),r=t?this.resourceObject[e].sitesPrefix+t:this.resourceObject[e].path;n.set(r,a,this.config),this.resourceObject[e].siteOverride[t]?delete this.resourceObject[e].siteOverride[t]:t||(this.setupResource(e),this.resourceObject[e].siteOverride={})}}updateConfigByPath(e,t){this.cache.debug.update[e]=this.cache.debug.update[e]?this.cache.debug.update[e]+1:1,n.set(e,t,this.config),this.resetCache(e)}getCacheKey(e="",t={}){const i=[e,t.mergeStrategy,t.orderStrategy];for(const e of t.resourceList)i.push(e.name,e.useSites?1:0,e.site||"-");return i.join("|")}getCache(e){return this.cache.debug.getter[e]=this.cache.debug.getter[e]?this.cache.debug.getter[e]+1:1,{isSet:e in this.cache.get,value:this.cache.get[e]}}setCache(e,t){this.cache.get[e]=t}resetCache(e){for(const t of Object.keys(this.cache.get))t.startsWith(`${e}|`)&&(this.cache.debug.resetCache[t]=this.cache.debug.resetCache[t]?this.cache.debug.resetCache[t]+1:1,this.log(`Deleting cache for key "${e}" ("${t}")`),delete this.cache.get[t])}calculateResourcePaths(e,t=this.fallbackSites){const i=e.sitesPrefix?t.map(t=>e.sitesPrefix+t):[];return i.push(e.path),i}resolveSiteAliases(e,t=[]){if(!e)return t;
7t.push(e);const i=this.getFallbackSite(e);return i&&this.resolveSiteAliases(i,t),t}getFallbackSite(e){return this.getPath(`customer.site_config_${e}.lab_fallback_site`,this.config)}getResource(e){let t=e.site?this.resourceObject[e.name].siteOverride[e.site]:this.resourceObject[e.name];return t&&t.resolved||(t=this.setupResource(e.name,e.site)),t}getPath(e,t,i=!1){return e?i?l.resolve(n.get(e,t,!0),e,{getCms:e=>n.get(e,this.config,!0)}):n.get(e,t,!0):t}getPaths(e,t,i=!1){const a=[],r=this.getResource(t),s=t.useSites?r.content:[r.content[r.content.length-1]];for(const r of s){const n=this.getPath(e,r.value,i);void 0!==n&&a.push({source:t.name,path:r.path,value:n,sourceIndex:s.indexOf(r)})}return a}getValueType(e){for(const t of e)if(null!==t.value)return Array.isArray(t.value)?"array":n.isObject(t.value)?"object":"other";return"other"}mergeResources(e,t,i){let a=t;const r=this.orderResources(e,i);if(!r.length)return{payload:null,paths:[],resetPaths:[]};const s=this.getValueType(r);if("default"===a&&(a="object"===s?"merge":"replace"),"replace"===a)return{payload:r[0].value,paths:[r[0].path],resetPaths:[]};r.reverse();const o=Array.isArray(r[0].value)?[]:{};let l=o;const d=[],c=[];for(const e of r){null===e.value&&(l=o,c.push(e.path));let i=n.merge;"merge"===t&&"array"===s&&(i=n.mergeArray),l=i(l,e.value),d.push(e.path)}return{payload:l,paths:d,resetPaths:c}}orderResources(e,t){if(1===e.length)return e[0].payload;let i=[];for(const t of e)i=i.concat(...t.payload);return"site"===t&&i.sort((e,t)=>e.sourceIndex-t.sourceIndex),i}prepareReturnValue(e){return e&&"object"==typeof e?n.clone(e,!0):e}getter(e,t=[],{mergeStrategy:i=null,orderStrategy:a=null,raw:r=!1,noCache:s=!1,interpolate:n=!0}){const l={mergeStrategy:o.stringRestricted(i,"default",["default","merge","replace"]),orderStrategy:o.stringRestricted(a,"site",["site","type"]),raw:o.false(r),noCache:o.false(s),resourceList:[]};for(const e of t)l.resourceList.push({name:e.name,useSites:!!e.useSites,site:o.stringOrNull(e.site)});const d=this.getCacheKey(e,l),c=this.getCache(d);if(!l.noCache&&c.isSet)return l.raw?{cached:!0,options:l,data:{raw:c.value.raw,merged:c.value.merged}}:this.prepareReturnValue(c.value.merged.payload);const g=l.resourceList.map(t=>({name:t.name,payload:this.getPaths(e,t,n)})),p=this.mergeResources(g,l.mergeStrategy,l.orderStrategy);return this.setCache(d,{raw:g,merged:p}),l.raw?{cached:!1,options:l,data:{raw:g,merged:p}}:this.prepareReturnValue(p.payload)}get(e,{useSites:t=!0,site:i=null,raw:a=!1,noCache:r=!1,mergeStrategy:s=null,orderStrategy:n=null}={}){return this.getter(e,[{name:"viewConfig",useSites:t,site:i},{name:"config",useSites:t,site:i}],{mergeStrategy:s,orderStrategy:n,raw:a,noCache:r})}getConfig(e,{useSites:t=!0,site:i=null,raw:a=!1,noCache:r=!1,mergeStrategy:s=null}={}){return this.getter(e,[{name:"config",useSites:t,site:i}],{mergeStrategy:s,raw:a,noCache:r})}getCms(e,{raw:t=!1,noCache:i=!1}={}){return this.getter(e,[{name:"cmsConfig"}],{raw:t,noCache:i})}getView(e,{useSites:t=!0,site:i=null,raw:a=!1,noCache:r=!1,mergeStrategy:s=null}={}){return this.getter(e,[{name:"viewConfig",useSites:t,site:i}],{mergeStrategy:s,raw:a,noCache:r})}getFeatureFlags(e,{useSites:t=!0,site:i=null,raw:a=!1,noCache:r=!1,mergeStrategy:s=null}={}){return this.getter(e,[{name:"featureFlags",useSites:t,site:i}],{mergeStrategy:s,raw:a,noCache:r,interpolate:!1})}getContent(e,{raw:t=!1}={}){return this.getter(e,[{name:"content"}],{raw:t})}getLocal(e,{useSites:t=!0,site:i=null,raw:a=!1,noCache:r=!1,mergeStrategy:s=null}={}){return this.getter(e,[{name:"localisation",useSites:t,site:i}],{mergeStrategy:s,raw:a,noCache:r,interpolate:!1})}getPathForSite(e,t,i=""){return e&&t&&this.resourceObject[e]&&this.resourceObject[e].sitesPrefix?this.resourceObject[e].sitesPrefix+t+(i?`.${i}`:""):null}getStorePathForSite(e,t,i=""){return e&&t&&this.resourceObject[e]&&this.resourceObject[e].sitesPrefix?this.resourceObject[e].storeSitesPrefix+t+(i?`.${i}`:""):null}debug(){return this.cache.debug}}class c{constructor(e,t,i=!1,a="",r=""){this.configReader=e,this.viewport=t,this.fragmentMode=i,this.pageType=a,this.simulatedMode=r,this.cache=new Map,this.isEditor="edit"===this.getAppMode(),this.pixelDensityFactor=this.isEditor?1:this.configReader.get("viewHelper.image.pixelDensityFactor"),this.pixelDensityFactors={}}resetCache(){this.cache.clear()}getViewport(){return this.viewport}getViewports(){const e="getViewports";return this.cache.has(e)||this.cache.set(e,Object.keys(this.configReader.get("viewports")||{})),this.cache.get(e)}getMainViewport(){const e="getMainViewport";return this.cache.has(e)||this.cache.set(e,this.configReader.getCms("mainViewport")),this.cache.get(e)}getPageType(){return this.pageType}getSimulatedMode(){return this.simulatedMode}isFragmentMode(){return!!this.fragmentMode}isMainViewport(){return this.viewport===this.getMainViewport()}isTouchDevice(e=this.viewport){return this.configReader.getCms("isTouchDevice")}
7getSubViewports(){const e="getSubViewports";if(!this.cache.has(e)){const t=this.getMainViewport();this.cache.set(e,this.getViewports().filter(e=>e!==t))}return this.cache.get(e)}isSubViewport(e=this.viewport){return e!==this.getMainViewport()}getEditableViewports(e=!1){const t=`getEditableViewports_${e}`;if(!this.cache.has(t)){const i=this.configReader.get("viewports"),a=e?{}:[];for(const t of Object.keys(i))i[t].noEdit||(e?a[t]=i[t]:a.push(t));this.cache.set(t,a)}return this.cache.get(t)}getViewportWidth(e=this.viewport){const t=this.configReader.get(`viewports.${e}.deviceWidth`);return t?parseInt(t,10):null}getEditViewportWidth(e=this.viewport){const t=this.configReader.get(`viewports.${e}.editSlotWidth`)||this.configReader.get(`viewports.${e}.deviceWidth`);return t?parseInt(t,10):null}getSite(e=null){const t={},i=`getSite_${e}`;if(!this.cache.has(i)){if(e){for(const t of this.configReader.getCms("sites"))if(t.alias===e)return this.cache.set(i,t),t;return this.cache.set(i,t),t}this.cache.set(i,this.configReader.getCms("site")||t)}return this.cache.get(i)}getSiteById(e){if(!e)return null;const t=`getSiteById_${e}`;if(!this.cache.has(t)){const i=parseInt(e,10);for(const e of this.configReader.getCms("sites"))if(e.id===i)return this.cache.set(t,e),e;return this.cache.set(t,null),null}return this.cache.get(t)}getSites(){const e="getSites";return this.cache.has(e)||this.cache.set(e,this.configReader.getCms("sites")||[]),this.cache.get(e)}getAppMode(){const e="getAppMode";return this.cache.has(e)||this.cache.set(e,this.configReader.getCms("app.mode")||"presentation"),this.cache.get(e)}isPresentationMode(){return!this.isEditor}isEditMode(){return this.isEditor}getPixelDensityFactor(e){return e?(this.pixelDensityFactors[e]||(this.pixelDensityFactors[e]=this.isEditor?1:this.configReader.get(`viewHelper.image.pixelDensity.${e}`)||this.configReader.get("viewHelper.image.pixelDensityFactor")),this.pixelDensityFactors[e]):this.pixelDensityFactor}getPreferredImageFormat(){return(this.configReader.get("imageUrlOptions.extension")||"").replace(".","")||null}}class g{constructor(e){this.debug=e&&"object"==typeof performance,this.logs={}}getLogs(){return this.logs}resetLogs(){this.logs={}}log(e,t){const i=e.pop();let a=this.logs;for(const t of e)a[t]||(a[t]={}),a=a[t];a[i]||(a[i]={count:0,time:0}),a=a[i],a.count++,a.time+=t}start(e){if(this.debug)return{paths:e,time:this.getTimestamp()}}end(e){this.debug&&this.log(e.paths,this.getTimestamp()-e.time)}getTimestamp(){return performance.now()}}class p{constructor({entries:e=[],behaviours:t={},debug:i=!1}={}){this.entries=e,this.behaviours=t,this.debug=i,this.events={},this.logs={},this.performanceLogger=new g(this.debug)}getLogs(){return this.performanceLogger.getLogs()}resetLogs(){this.performanceLogger.resetLogs()}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),!0}off(e,t){return!(!this.events[e]||!this.events[e].includes(t)||(this.events[e]=this.events[e].filter(e=>e!==t),0))}emitEntry(e,...t){const i=this.performanceLogger.start(["entry",e]),a=this.callTargets(e,"entry",this.entries,...t);return this.performanceLogger.end(i),a}emitBehaviour(e,t,...i){const a=this.behaviours[t.getType()];if(!a||!a.length)return[];const r=this.performanceLogger.start(["behaviour",e,t.getType()]),s=this.callTargets(e,"behaviour",a,t,...i);return this.performanceLogger.end(r),s}emitCollectionBehaviour(e,t,...i){const a=this.behaviours[t.getType()];return a&&a.length?this.callTargets(e,"collection",a,t,...i):[]}emitEvent(e,...t){this.events[e]&&this.callEvents(e,this.events[e],...t)}requestEvent(e,...t){return this.events[e]?this.requestEvents(e,this.events[e],...t):[]}callEvents(e,t,...i){for(const a of t)try{a(...i)}catch(t){Sys.logger.error(`[Emitter] Failed to run method on listener for message "${e}"`),Sys.logger.debug(t.toString()),lab_api.v1.app.logError(t)}}requestEvents(e,t,...i){const a=[];for(const r of t)try{const e=r(...i);void 0!==e&&a.push(e)}catch(t){Sys.logger.error(`[Emitter] Failed to run method on listener for message "${e}"`),Sys.logger.debug(t.toString()),lab_api.v1.app.logError(t)}return a}callTargets(e,t,i,...a){const r=[];
7for(const s of i)try{if(s.isEnabled){const t=s.call(e,...a);null!=t&&r.push(t)}}catch(i){Sys.logger.error(`[Emitter] Call to method ${e} on '${s.name}' failed:`),console.error(i),lab_api.v1.app.logViewError(i,t)}return r}registerEntry(e){return!this.entries.includes(e)&&(this.entries.push(e),!0)}registerBehaviour(e,t){return this.behaviours[e]||(this.behaviours[e]=[]),!this.behaviours[e].includes(t)&&(this.behaviours[e].push(t),!0)}}class u{static build(e,t,i){let a;const r=[],s=i||"&",n=(e,t,i)=>{let a,r=t;const s=[];if(!0===r?r="1":!1===r&&(r="0"),null!=r){if("object"==typeof r){for(a in r)null!=r[a]&&s.push(n(`${e}[${a}]`,r[a],i));return s.join(i)}if("function"!=typeof r)return`${this.urlencode(e)}=${this.urlencode(r)}`;throw new Error("There was an error processing for http_build_query().")}return""};for(const i of Object.keys(e)){a=e[i];let o=i;t&&!Number.isNaN(o)&&(o=String(t)+o);const l=n(o,a,s);""!==l&&r.push(l)}return r.join(s)}static urlencode(e){return encodeURIComponent(`${e}`).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}}class h extends p{constructor(e,t,i,a,r,s,n=!1){super({behaviours:r,debug:n}),this.properties=e,this.templates=t,this.configReader=i,this.propertyValidator=a,this.pathHelper=s,this.resolved={properties:new Map,templates:new Map,resourceMaps:new Map},this.appMode=i.getCms("app.mode"),this.pageTemplateName="default",this.resourceSettings=this.resolveResourceSettings(),this.viewportList=new Map,this.rootId=null,this.feedBaseUrl=`${this.configReader.getCms("front_api_url")}/feed/item`,this.isFragmentMode=!1,this.feedCounter={}}getPathInfo(e,t,i="stage"){const a=e.split("/"),r=a.pop();let s;return s=r.startsWith("page_")?`${r.replace("page_","page/")}/${this.pageTemplateName}`:`content/${r}`,{type:r,resourceType:s,area:i,modeList:this.getPrioritizedModes(),viewportList:this.getPrioritizedViewports(t),contextList:this.getPrioritizedContexts(`${a.join("/")}/`)}}resolveResourceSettings(){const e=o.object(this.configReader.get("resourceAllocation",{useSites:!1}),{resourceMaps:["_resources"]});"string"==typeof e.resourceMaps&&(e.resourceMaps=[e.resourceMaps]);const t=this.configReader.getCms("site.alias"),i=o.object(this.configReader.get("resourceAllocation",{site:t}));let a=[];if(Array.isArray(i.resourceMaps)&&a.push(...i.resourceMaps),!a.length||o.true(i.mergeMaps)){const t=[];for(const i of e.resourceMaps)a.includes(i)||t.includes(i)||t.push(i);t.length&&(a=[...t,...a])}return{names:a}}getResourceMap(e,t){if(this.resolved.resourceMaps.has(e.type))return this.resolved.resourceMaps.get(e.type);let i={labPaths:this.getEmptyPathObject()};for(const t of this.resourceSettings.names){const a=`${e.resourceType}/${t}.json`,r=this.getPropertyFile(a);if(r&&(i.labPaths.maps.push(a),i=this.mergeObject(i,r)),!i.labPaths.maps.length){const t=this.resourceSettings.names.map(t=>`${e.resourceType}/${t}.json`).join('", "');Sys.logger.warn(`[ResourceManager] No resource-map found for element "${e.type}". Expecting "${t}". Will not be able to allocate resources for this element.`)}}if(t){const a=this.emitBehaviour("onResourceMap",t,{...i},{type:e.type,resourceType:e.resourceType});a.length&&(Sys.logger.warn(`[ResourceManager] Resource-map is overridden by a bahaviour for model "${t.getPositionedPath()}".`),i=a.pop())}return this.resolved.resourceMaps.set(e.type,i),i}getPaths(e,t,i){let a=[];for(const r of i.modeList){const s=this.getContextsForModeAndArea(e,r,i);if(s)for(const e of i.contextList){const n=this.getContexts(s,t,e);if(n.length)for(const e of n){const t=this.getPathForViewports(e.match,i);if(t)for(const i of Array.isArray(t.resources)?t.resources:[t.resources])a=a.filter(e=>e.path!==i),a.push(this.getPathDescription({path:i,context:e.context,viewport:t.viewport,mode:r}))}}}return a.length||Sys.logger.debug(`ResourceManager: Cannot get ${t} for ${i.type}. Context-list: ${i.contextList.join(", ")}, area: ${i.area}`),a}getPathForViewports(e,t){for(const i of t.viewportList)if(e[i])return{resources:e[i],viewport:i};return null}getPathLength(e=""){return this.trimPath(e).replace(/\/\//g,"/||/").split("/").map(e=>e?"||"===e?.2:"*"===e?.6:1:0).reduce((e,t)=>
7e+t)}sortContexts(e){const t=e.sort((e,t)=>this.getPathLength(e)-this.getPathLength(t)||e.localeCompare(t)),i=t.indexOf("lab-default");return i>0&&(t.splice(i,1),t.unshift("lab-default")),t}trimPath(e){let t=e;return t.startsWith("/")&&!t.startsWith("//")&&(t=t.substring(1)),t.endsWith("/")&&!t.endsWith("//")&&(t=t.substr(0,t.length-1)),t}getContexts(e,t,i){const a=this.sortContexts(Object.keys(e)),r=[];for(const s of a)if(e[s][t]){const a=this.pathHelper.pathMatch(s,i);a&&r.push({match:e[a][t],context:s})}return r}getContextsForModeAndArea(e,t,i){return n.get(`${t}.${i.area}`,e)||null}getPropertyFile(e){return this.properties[e]?{...this.properties[e]}:null}getEmptyPathObject(){return{maps:[],properties:[],map:[]}}getPathDescription(e={}){return{path:e.path||null,context:e.context||null,viewport:e.viewport||null,mode:e.mode||null,requiredBy:e.requiredBy||null}}resolveInheritance(e,t){if(!e.includeFiles)return e;let i=e;for(const a of e.includeFiles)if(!i.labPaths.properties.includes(a)){const e=this.getPathDescription(t);e.requiredBy=e.path,e.path=a;const r=this.resolvePropertyFileWithDescription(e);r&&(i=this.mergeObject(r,i))}return i}getTemplateFile(e){return this.templates[e]||null}getPrioritizedViewports(e){if(!this.viewportList.get(e)){const t=e?[e]:[];this.configReader.get(`viewports.${e||"default "}.noFallback`)||t.push("default"),this.viewportList.set(e,t)}return this.viewportList.get(e)}getPrioritizedModes(){const e=[this.appMode];return"edit"===this.appMode&&e.unshift("presentation"),e}getPrioritizedContexts(e){return["lab-default",e]}mergeObject(e,t){const i=n.merge(e,t);return e.labPaths&&t.labPaths&&(i.labPaths.properties=e.labPaths.properties.concat(t.labPaths.properties),i.labPaths.map=e.labPaths.map.concat(t.labPaths.map)),i}getCacheKey(e,t,i){return`${e||"no-path"}-${t}-${i}`}rootModelReady(e){this.isFragmentMode=lab_api.v1.app.mode.isFragmentMode(),e&&(this.rootId=e.get("id"),e&&e.getType().startsWith("page_")&&this.setPageTemplateName(e.get("fields.page_template_alias")||"default"))}setPageTemplateName(e="default"){Sys.logger.debug(`[ResourceManager] Will use page-template "${e}".`),"undefined"===e?(Sys.logger.warn("[ResourceManager] Invalid page_template_alias detected. Will override template to 'default'."),this.pageTemplateName="default"):this.pageTemplateName=e}getAreaFromPath(e,t){return e&&e.includes("pasteboard/")?"pasteboard":"stage"}getPropertiesForPath(e,t,i,a=this.getAreaFromPath(e)){e||Sys.logger.warn('ResourceManager.getPropertiesForPath: Missing required param "path". Will return default properties.');const r=this.getCacheKey(e,i,a);if(this.resolved.properties.has(r))return this.resolved.properties.get(r);let s={labPaths:this.getEmptyPathObject()};const n=this.getPathInfo(e,i,a),o=this.getResourceMap(n,t),l=this.getPaths(o,"properties",n);for(const e of l){const t=this.resolvePropertyFileWithDescription(e);t&&(s=this.mergeObject(s,t))}return s.labPaths.maps=o.labPaths.maps,this.resolved.properties.set(r,this.propertyValidator(s)),this.resolved.properties.get(r)}resolvePropertyFile(e){return this.resolvePropertyFileWithDescription(this.getPathDescription({path:e}))}resolvePropertyFileWithDescription(e){const t=this.getPropertyFile(e.path);return t?(t.labPaths=this.getEmptyPathObject(),t.labPaths.properties.push(e.path),t.labPaths.map.push(e),this.resolveInheritance(l.resolve(t,e.path,this.configReader),e)):(Sys.logger.warn(`ResourceManager: Cannot find property-file for path: ${e.path}.`),null)}getTemplateForPath(e,t,i,a=this.getAreaFromPath(e)){const r=this.getCacheKey(e,i,a);if(this.resolved.templates.has(r))return this.resolved.templates.get(r);const s={paths:null,resource:null},n=this.getPathInfo(e,i,a),o=this.getResourceMap(n,t);return s.paths=this.getPaths(o,"template",n),s.paths.length&&(s.resource=this.getTemplateFile([...s.paths].pop().path)),s.resource||(Sys.logger.debug(`ResourceManager: Cannot find template for path: ${e}, viewport: ${i}, area: ${n.area}. Will assign default template.`),s.resource=this.getDefaultTemplate(e)),this.resolved.templates.set(r,s),s}getDefaultTemplate(e){return"edit"===this.appMode?"<div>{{{ children.all }}}</div>":"{{{ children.all }}}"}getPropertiesForModel(e,t,i){return this.getPropertiesForPath(e.getPath(),e,t.viewport,i)}getTemplateForModel(e,t,i){if("presentation"===this.appMode&&!this.isFragmentMode&&"1"===e.get("fields.isAutomatic"))return`<div data-lab-placeholder="include" src="${this.getFeedUrl(e,t)}" ></div>`;const a=this.getTemplateForPath(e.getPath(),e,t.viewport,i);return a.paths.length&&t.setTemplatePath([...a.paths].pop().path),a.resource}getFeedUrl(e,t){const i=e.get("fields.feedId"),a=e.get("fields.feedParams")||{};let r="";Object.keys(a).length&&(r=`?${u.build(a)}`),void 0===this.feedCounter[i]&&(this.feedCounter[i]=0);const s=this.feedCounter[i]++;return`${this.feedBaseUrl}/${i}/${this.rootId}/${s}${r}`}}class f{constructor(e,t,i){this.viewport=e,this.model=t,this.eventPipe=i,this.markup=null,this.markupString=null,this.template=null,this.templatePath=null,this.properties=null,this.data=null,this.size=this.getEmptySizeObject(),this.proxies={current:null,child:null,children:null,childMarkup:null,childrenMarkup:null,store:{get:null,set:null}},this.cache=new Map}
7static resolveConfig(e={}){return lab_api.v1.app.dbg.logger.add("LabView","resolveConfig"),{labPaths:e.labPaths||{maps:[],properties:[],map:[]},boxTitle:e.boxTitle||"",boxDescription:e.boxDescription||"",boxKeywords:e.boxKeywords||"",childLimit:e.childLimit||null,includeFiles:o.array(e.includeFiles,null),gridRules:e.gridRules||[],viewHelper:e.viewHelper||null,viewportMap:o.object(e.viewportMap),bodytextElements:o.array(e.bodytextElements),bodytextHeadingElements:o.array(e.bodytextHeadingElements),overrideImageSize:o.object(e.overrideImageSize),image:o.object(e.image,null,{defaultAspectRatio:null}),external:o.object(e.external,null,{url:null,type:"html",headers:null})}}getEmptySizeObject(){return{grid:null,pixelWidths:null,gridWidth:null,absGridWidths:null,absGridCss:null}}isPrepared(){return!1}setPreparedState(e){}setMarkupString(e){this.markupString=e}getMarkup(){return null}getMarkupString(){return this.markupString||""}setGrid(e){this.size.grid=e}getGrid(){return this.size.grid}setPixelWidths(e){this.size.pixelWidths=e}getPixelWidth(){if(this.size.pixelWidths)return this.size.pixelWidths[this.viewport]}getPixelWidths(){return this.size.pixelWidths}setGridWidth(e){this.size.gridWidth=e}getGridWidth(){return this.size.gridWidth}getAbsoluteGridWidth(){return this.size.absGridWidths?this.size.absGridWidths[this.viewport]:null}setAbsoluteGridWidths(e){this.size.absGridWidths=e}getAbsoluteGridWidths(){return this.size.absGridWidths}getAbsGridCss(){return this.size.absGridCss}setAbsGridCss(e){this.size.absGridCss=e}getWidth(){return this.get("width")}setWidth(e,t=!1){this.set("width",e,t)}setData(e){this.data=e}getData(){return this.data}getProxy(){return this.proxies.current}setProxy(e){this.proxies.current=e}getChildrenProxy(){return this.proxies.children}setChildrenProxy(e){this.proxies.children=e}getChildProxy(){return this.proxies.child}setChildProxy(e){this.proxies.child=e}getChildMarkupProxy(){return this.proxies.childMarkup}setChildMarkupProxy(e){this.proxies.childMarkup=e}getChildrenMarkupProxy(){return this.proxies.childrenMarkup}setChildrenMarkupProxy(e){this.proxies.childrenMarkup=e}getStoreProxy(e){return this.proxies.store.set&&this.proxies.store.get?e?this.proxies.store.set:this.proxies.store.get:null}setStoreProxy({get:e,set:t}){this.proxies.store.get=e,this.proxies.store.set=t}setTemplate(e){this.template=e}getTemplate(){return this.template}setTemplatePath(e){this.templatePath=e}getTemplatePath(){return this.templatePath}setProperties(e,t=!1){this.properties=t?e:this.constructor.resolveConfig(e)}getProperties(){return this.properties}getProperty(e,t){return n.get(e,this.properties,t)}getViewport(){return this.viewport}getviewportOrder(e,t=null,i=this.viewport){return this.eventPipe.getViewportOrder(this,this.model.getPath(),e,t,i)}getCacheKey(e,t,i=!1){return`${e}|${i?1:0}|${this.model.getPath()}|${t}`}get(e,t=!1,i=this.viewport){lab_api.v1.app.dbg.logger.add(this.constructor.name,"get",this.viewport);const a=this.getCacheKey(e,i,t);if(this.cache.has(a))return this.getCache(a);const r=this.model.buildQuery(e),s=this.getviewportOrder(r.path,r.attribute,i);if(!s.length){const e=this.model.get(r.key,null,t);return this.setCache(a,e)}for(const e of s){const t=this.model.get(r.key,e,!0);if(void 0!==t)return this.setCache(a,t)}return this.setCache(a,t?void 0:null)}set(e,t,i=!1){if(lab_api.v1.app.dbg.logger.add(this.constructor.name,"set",this.viewport),!e)return!1;const a=this.model.buildQuery(e),r=this.getviewportOrder(a.path,a.attribute);return this.model.set(a.key,t,{save:!i,viewport:r[0]})}setAll(e,t=!0){if(e&&"object"==typeof e&&!Array.isArray(e)){for(const t of Object.keys(e))this.set(t,e[t],!0);t&&lab_api.v1.app.save()}else Sys.logger.warn("[LabView] Method setAll expect an object containing key/value pars of data to store. Non-object given.")}
7setTransparent(e,t){const i=this.model.buildQuery(e),a=this.getviewportOrder(i.path,i.attribute),r=this.model.buildQuery(e,a[0]);let{path:s}=r;return r.attribute&&(s="fields"===r.type?`${r.path}.attributes.${r.attribute}`:`${r.path}.${r.attribute}`),n.get(s,n.set(r.fullPath,t,{}))}setCache(e,t){return this.cache.set(e,t),this.getCache(e)}getCache(e){return this.cache.get(e)}resetCache(e,t=this.getViewport()){const i=this.getCacheKey(e,t);this.cache.delete(i),this.cache.forEach((i,a,r)=>{(a.startsWith(`${e}.`)||a.startsWith(`${e}|`))&&a.endsWith(`|${t}`)&&this.cache.delete(a)})}}class m{static generateShapes(e,t){if(!e)return"";const i=JSON.parse(e);let a="";for(const e of i)a+=this.createShape(e,t);return a}static createShape(e,t){return`<div class="imageShape" style="${this.getStyle(e,t)}"></div>`}static getStyle(e,t){const i=this.getPosition(e,t),a=this.getSize(e,t);return`position: absolute;\n        width: ${a.w}%;\n        height: ${a.h}%;\n        top: ${i.y}%;\n        left: ${i.x}%;\n        border-width: ${e.borderwidth}px;\n        border-color: ${e.bordercolor};\n        border-style: ${e.borderstyle};\n        border-radius: ${"circle"===e.shape?"50%":"0"};\n        background: ${e.background||"transparent"};`}static getPosition(e,t){return{x:(e.x-t.x)*(100/t.cropw),y:(e.y-t.y)*(100/t.croph)}}static getSize(e,t){return{w:e.width*(100/t.cropw),h:e.height*(100/t.croph)}}}class b{constructor(e,t){this.api=e,this.isEditor=this.api.v1.app.mode.isEditor(),this.viewport=t.viewport,this.viewports=this.api.v1.config.get("viewHelper.image.viewports"),this.viewports.includes(this.viewport)||this.viewports.push(this.viewport),this.logger=t.logger,this.imageServer=this.api.v1.properties.get("image_server"),this.cropParamsFloat=["x","y","cropw","croph","panox","panoy","panow","panoh","heightx","heighty","heightw","heighth"],this.cropParamsString=["float","shapes"],this.privateCropParams=["bbRatio","whRatio","viewports_json","metadata_key"],this.allFields=[...this.cropParamsFloat,...this.cropParamsString,...this.privateCropParams],this.imageUrlOptions=this.api.v1.config.get("imageUrlOptions")||{},this.preferWebp=".webp"===this.api.v1.config.get("imageUrlOptions.extension"),this.maxDimension=3e3,this.pixelDensityFactors=this.readPixelDensity(),this.logger.debug(`Image-helper created. Will prepare image-data for viewports: ${this.viewports.join(", ")}.`)}static getImageProperties(e={}){const t=e.crop||{},i=t.pano||{},a=t.height||{};return{cropw:i.cropw||0,croph:i.croph||0,x:i.x||0,y:i.y||0,heightw:a.cropw||0,heighth:a.croph||0,heightx:a.x||0,heighty:a.y||0,imageCaption:e.imageCaption||"",altText:e.altText||"",imageByline:e.imageByline||e.byline||""}}run(e,t){if(!e.hasNodeData())return this.logger.debug(`Image has no node-data, skipping. Path: "${e.getPositionedPath()}"`),void this.api.v1.model.noRender(e);const i=t.getProperty("image.defaultAspectRatio")||this.api.v1.config.get("image.defaultAspectRatio")||.5,a=t.getProperty("image.defaultBoundingBoxWidthRatio")||this.api.v1.config.get("image.defaultBoundingBoxWidthRatio")||1,r=t.getPixelWidths(),s=e.getData("instance_of"),n=e.get("fields.imageurl"),o=e.get("fields.forceImageUrl"),l={},d=[],c=this.imageUrlOptions.nameField?e.get(this.imageUrlOptions.nameField):null,g="_articlefeed"===e.get("fields.source"),p="1"===e.get("fields.isLabradorImageUrl"),u=this.preferWebp&&g?"webp":null,h=[];if((this.preferWebp||"webp"===u)&&h.push({format:"webp",type:"image/webp"}),h.push({format:"jpg",type:"image/jpeg"}),!n&&!s)return this.isEditor?e.setFiltered("image","/images/lab-head_1000.png"):e.setFiltered("image",`${this.api.v1.config.get("image.fallbackUrl")||"/404-image.png"}?noImageFound`),void(e.get("state.isUploading")?e.setFiltered("imageLoadingClass","lab-uploading-image labicon-cloud_up"):e.setFiltered("imageLoadingClass","lab-missing-image"));for(const e of this.viewports){const f={width:t.get("fields.width",!1,e)||t.getProperty("overrideImageSize.width"),height:t.get("fields.height",!1,e)||t.getProperty("overrideImageSize.height")},b=r[e],y={};for(const i of this.allFields){const a=t.get(`fields.${i}`,null,e);(a||"0"===a||0===a)&&(y[i]=a)}const v={imageId:g?void 0:s,format:u,bbRatio:t.get("filtered.bbRatio",null,e)||y.bbRatio||a,whRatio:t.get("filtered.whRatio",null,e)||y.whRatio||i},w={float:null,border:null,shapes:null};for(const e of this.cropParamsFloat)if(void 0!==y[e]){const t=parseFloat(y[e]||0);v[e]=t.toFixed(2)}for(const e of this.cropParamsString){const t=y[e]||null;t&&"null"!==t&&(w[e]=t)}v.width=t.get(`filtered.width.${e}`,null,e)||f.width||Math.ceil(b*v.bbRatio),v.height=t.get(`filtered.height.${e}`,null,e)||f.height||Math.ceil(v.width*v.whRatio);const _={width:v.width,height:v.height};if(v.width=Math.round(v.width*this.pixelDensityFactors[e]),v.height=Math.round(v.height*this.pixelDensityFactors[e]),v.width/v.height>1){if(v.width>this.maxDimension){const e=this.maxDimension/v.width;v.width=Math.floor(v.width*e),v.height=Math.floor(v.height*e)}}else if(v.height>this.maxDimension){const e=this.maxDimension/v.height;v.height=Math.floor(v.height*e),v.width=Math.floor(v.width*e)}const k=this.generateUrl(v,{imageurl:n,forceImageUrl:o,instanceOf:s,isLabradorImageUrl:p,imageUrlOptionsNameValue:c}),x=w.shapes?m.generateShapes(w.shapes,y):"";l[e]={viewport:e,url:k,formats:h,width:_.width,height:_.height,shapes:x,borderClass:"on"===w.border?"borderOn":""},d.push(l[e])}const f=l[this.viewport];e.setFiltered("viewport_list",l),e.setFiltered("viewport_array",d),e.setFiltered("image",f.url),e.setFiltered("imageWidth",f.width),e.setFiltered("imageHeight",f.height),e.setFiltered("imageCleanUrl",f.url.replace(/&(width|height)=\d+/g,"")),e.setFiltered("borderClass",f.borderClass),e.setFiltered("shapes",f.shapes),e.setFiltered("imageLoadingClass",s?"":n?"lab-content-busy":"lab-is-dummy-image")}generateUrl(e,t={}){const i=[],a={width:e.width||t.width||150,height:e.height||t.height||100},r={imageId:e.imageId||t.imageId,x:e.x,y:e.y,cropw:e.cropw,croph:e.croph,panox:e.panox,panoy:e.panoy,panow:e.panow,panoh:e.panoh,heightx:e.heightx,heighty:e.he
7ighty,heightw:e.heightw,heighth:e.heighth,width:a.width,height:a.height,format:e.format||void 0};for(const e of Object.keys(r))void 0!==r[e]&&i.push(`${e}=${r[e]}`);let s=this.imageServer,n="?";return!t.imageurl||!t.forceImageUrl&&t.instanceOf?t.instanceOf?this.imageUrlOptions&&t.imageUrlOptionsNameValue&&(s+=`/${t.imageUrlOptionsNameValue}${t.format?`.${t.format}`:this.imageUrlOptions.extension}`):s="":(-1!==t.imageurl.indexOf(this.imageServer)||t.isLabradorImageUrl?s=t.imageurl:s+=`?imageUrl=${t.imageurl}`,n="&"),s&&(s+=n+i.join("&")),s}readPixelDensity(){const e={};for(const t of this.viewports)e[t]=this.api.v1.view.getPixelDensityFactor(t);return e}}const y={unique:(e=8)=>{const t=`0x${Math.pow(10,e-1)}`;return Math.floor((1+Math.random())*t).toString(16)},async digestString(e){const t=(new TextEncoder).encode(e),i=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")},trim(e,t){let i=(e||"").trim(),a=[];void 0===t?a.push(" "):"string"==typeof t?a.push(t):a=t;for(let e=0;e<a.length;e++)0===i.indexOf(a[e])&&(i=i.slice(a[e].length)),i.lastIndexOf(a[e])>-1&&i.lastIndexOf(a[e])===i.length-a[e].length&&(i=i.slice(0,i.length-a[e].length));return i.trim()},stripTags:(e="",t="")=>(e||"").replace(/<(?:.|\n)*?>/gm,t).trim(),stripLinks:(e="")=>(e||"").replace(/<a[^>]*>(.*?)<\/a>/gm,"$1"),sanitizeString:(e="")=>y.stripTags(y.unescapeEntities(e)).replace(/"/g,"'"),escapeForJavaScript:(e="")=>e?e.replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):"",unescapeEntities:(e="")=>(e||"").replace(/&nbsp;/gi," ").replace(/&amp;/gi,"&"),toFileName:(e="")=>e.replace(/\s+/gi,"-").replace(/[^a-zA-Z0-9\-._]/gi,""),ucFirst(e=""){const t=e||"";return t.charAt(0).toUpperCase()+t.slice(1)},parsePath(e=""){const t=this.trim(e,"/").split("/"),i=/\[([0-9]+)\]/;return t.map(e=>{const t={base:e,index:null,path:e},a=i.exec(e);return a&&(t.index=parseInt(a[1],10),t.base=e.replace(`[${t.index}]`,"")),t})},insertAtPosition:(e,t,i)=>[e.slice(0,t),i,e.slice(t)].join(""),labCtrlKey:()=>navigator.platform.toLowerCase().indexOf("mac")>=0?"⌘":"⊞",shiftKey:()=>"⇧",altKey:()=>navigator.platform.toLowerCase().indexOf("mac")>=0?"⌥":"alt",arrowUp:()=>"↑",arrowDown:()=>"↓",arrowLeft:()=>"←",arrowRight:()=>"→",keyMapper(e){if(!e)return"";switch(e){case" ":return"space";case"labCtrlKey":case"metaKey":return y.labCtrlKey();case"shiftKey":return y.shiftKey();case"altKey":return y.altKey();case"ArrowUp":return y.arrowUp();case"ArrowDown":return y.arrowDown();case"ArrowLeft":return y.arrowLeft();case"ArrowRight":return y.arrowRight();default:return y.ucFirst(e.replace("Key",""))}},hotkeyString:(e={})=>[...(e.controlkeys||[]).map(e=>y.keyMapper(e)),y.keyMapper(e.key)].map(e=>`<span class="lab-label-hotkey">${e}</span>`).join("+"),niceNumber(e,t=" "){let i=`${e}`;const a=i.split(".");i=a.shift();let r="";for(;i.length>3;)r=`${t}${i.slice(-3)}${r}`,i=i.slice(0,-3);return(i+r).trim()+(a.length?".":"")+a.join(".")},fallbackString:(e="")=>{const t=e.split("|||");for(const e of t){const t=e.trim();if(t.length>0)return t}return""}};class v{static getLineData(e,t,i=!1){const a={};a.bodytext=this.getBodytext(e,t,i),a.tags=t.getProperty("bodytextElements")||["p"],a.headingTags=t.getProperty("bodytextHeadingElements")||["h1","h2","h3"],a.indexRegister=[];let r=0,s=0;v.analyze(a.bodytext).forEach(e=>{if(a.tags.indexOf(e.tag)>-1){const t={charIndex:e.index,bodytextIndex:r++};a.headingTags.indexOf(e.tag)>-1&&(t.bodytextHeadingIndex=s++),a.indexRegister.push(t)}}),a.indexRegister.reverse();for(const e of a.indexRegister)if("number"==typeof e.bodytextHeadingIndex){e.lastHeading=!0;break}return a}static getBodytext(e,t,i=!1){const a=e.get("fields.bodytext")||"";return!i||a?a:t.data.placeholder.bodytext||""}static analyze(e=""){const t=[],i=new RegExp("<([\\/a-zA-Z0-9\\-]*?)(?: .*?)?>","g"),a={tag:null,index:0,level:0};return e.replace(i,(e,i,r)=>{const s=i.indexOf("/"),n=s>-1?i.replace("/",""):i;a.tag?n===a.tag&&(s<0?a.level++:a.level>0?a.level--:(t.push({tag:a.tag,index:a.index,length:r+e.length-a.index}),a.tag=null)):(a.tag=n,a.index=r)}),t}}class w{constructor(e,t){this.api=e,this.viewport=t.viewport,this.allViewports=this.api.v1.viewport.getAll(),this.mainViewport=this.api.v1.viewport.getMain(),this.logger=t.logger,this.viewManager=t.viewManager,this.lineClassSelector="lab-bodytext-line",this.logger.debug(`Bodytext-helper created. Will prepare data for viewports: ${this.allViewports.join(", ")}.`)}run(e,t){this.insertContent(e,t)}insertContent(e,t){const i={bodyText:[],bodyTextHeading:[],lastBodyTextHeading:[]};let a=0;const r=v.getLineData(e,t,this.api.v1.app.mode.isEditor());for(const t of e.children){const e=this.viewManager.getView(t),a=e.get("metadata.bodyTextIndex"),s="number"==typeof a?a:null,n=e.get("metadata.bodyTextHeadingIndex");if(e.get("metadata.lastBodyTextHeading"))i.lastBodyTextHeading.push(t);else if("number"==typeof n)i.bodyTextHeading[n]=i.bodyTextHeading[n]||[],i.bodyTextHeading[n].push(t);else if("number"==typeof s)i.bodyText[s]=i.bodyText[s]||[],i.bodyText[s].push(t);else{const e=r.indexRegister[0]?r.indexRegister[0].bodytextIndex+1:0;i.bodyText[e]=i.bodyText[e]||[],i.bodyText[e].push(t)}}let{bodytext:s}=r;for(const e of r.indexRegister){if(void 0!==i.bodyText[e.bodytextIndex]){const t=this.createMarkup(i.bodyText[e.bodytextIndex],e.charIndex,s);s=t.bodytext,a+=t.count}if(void 0!==e.bodytextHeadingIndex&&void 0!==i.bodyTextHeading[e.bodytextHeadingIndex]){const t=this.createMarkup(i.bodyTextHeading[e.bodytextHeadingIndex],e.charIndex,s);s=t.bodytext,a+=t.count}if(e.lastHeading&&i.lastBodyTextHeading.length){const t=this.createMarkup(i.lastBodyTextHeading,e.charIndex,s);s=t.bodytext,a+=t.count}}for(const e of Object.keys(i.bodyText)){const t=i.bodyText[e];if(t&&t.length)for(const e of t){const t=this.viewManager.getView(e);!0!==t.get("metadata.skipIfOutOfBounds")&&(s+=t.getMarkupString(),a++)}}for(const e of i.lastBodyTextHeading){const t=this.viewManager.getView(e);!0!==t.get("metadata.skipIfOutOfBounds")&&(s+=t.getMarkupString(),a++)}Sys.logger.debug(`Bodytext: Parsed bodytext. Inserted ${a} of ${e.children.length} structures. Tags: [${r.tags.join(", ")}]. Line-count: ${r.indexRegister.length}.`),e.setFiltered("lineData",r),e.setFiltered("bodytext",s)}createMarkup(e,t,i){let a=0,r="";for(;e.length;){const t=e.shift();r+=this.viewManager.getView(t).getMarkupString(),a++}return{count:a,bodytext:y.insertAtPosition(i,t,r)}}getIndexes(e,t){const{indexRegister:i}=v.getLineData(e,t,this.api.v1.app.mode.isEditor());return i.map(e=>e.bodytextIndex)}isBodytextLine(e,t){return e===t||!!this.api.v1.util.dom.getParentByClass(e,t,this.lineClassSelector)||e.classList.contains(this.lineClassSelector)}getLineClassSelector(){return this.lineClassSelector}}class _{constructor(e,t){this.api=e,this.viewport=t.viewport,this.logger=t.logger,this.viewManager=t.viewManager,this.settings=t.settings,this.isEditor=t.isEditor,this.apiUrl=this.api.v1.properties.get("front_api_url")}prepare(e,t){if(this.isEditor&&e.isPseudo())return;const i=t.getProperty("external");i&&i.fetchInPrepare&&i.url?this.fetchExternalData(e,t,i):i&&i.url||this.logger.warning(`[External] Missing required config "external" or "external.url" for model ${e.getPositionedPath()}
7. No external content will be fetched.`)}run(e,t){if(this.isEditor&&e.isPseudo())return;const i=t.getProperty("external");i&&!i.fetchInPrepare&&i.url?this.fetchExternalData(e,t,i):i&&i.url||this.logger.warning(`[External] Missing required config "external" or "external.url" for model ${e.getPositionedPath()}. No external content will be fetched.`)}fetchExternalData(e,t,i){if(this.settings.fragmentMode){let a;const r=e.isNonPersistent();if(r){const t=this.api.v1.model.query.getRootModel(),i=e.getPositionedPath();t.get("fields.labExternalPath")===i&&(a=t.get("fields.labExternalData"),a&&(e.set("fields.isFragment","1",{notify:!1,registerModified:!1,save:!1,undoable:!1}),e.set("metadata.isFragment","1",{notify:!1,registerModified:!1,save:!1,undoable:!1})))}else a=e.get("fields.labExternalData");if(a){this.logger.debug(`[External] Data is available for ${r?"non-persistent":"persistent"} element ${e.getPositionedPath()}.`);let s=a;if(a&&this.isExternalData(i))try{s=JSON.parse(a)}catch(t){this.logger.warn(`[External] Cannot parse fetched external data for model ${e.getPositionedPath()}.`),s={}}return void e.set("external",s,{save:!1,undoable:!1})}}const a=this.getUrl(e,t,i,this.isEditor);if(a){if(this.isEditor){const r=e.get("state.requireExternal")||{},s=!0===r[t.getViewport()];return this.viewManager.getExternalContent(e,t,a,i,s),void(s&&(r[t.getViewport()]=!1,e.set("state.requireExternal",r,{save:!1,undoable:!1,notify:!1})))}t.setTemplate(`<div data-lab-placeholder="include" src="${a}" ></div>`)}}isExternalData(e){return"json"===e.type}getUrl(e,t,i,a){const r=this.viewManager.getDataForView(e,t),s=Mustache.render(i.url,r);if(!s)return this.logger.debug(`[External] Resolved empty url for model ${e.getPositionedPath()}`),null;lab_api.v1.app.dbg.extensiveLogging&&this.logger.debug(`[External] Resolved url for model ${e.getPositionedPath()}: "${s}"`);const n=encodeURIComponent(s),o=[`lab_viewport=${this.viewport}`];if(i.headers){const e={};for(const t of Object.keys(i.headers))e[t]=Mustache.render(i.headers[t],r);o.push(`headers=${encodeURIComponent(JSON.stringify(e))}`)}return this.buildUrl(e,n,a,o)}buildUrl(e,t,i,a){const r=a.length?a.join("&"):null;return i?`${this.api.v1.properties.get("proxy")}?query=${t}${r?`&${r}`:""}`:e.isNonPersistent()?`${this.apiUrl}/external/dynamic-data/${this.settings.contentId}/?path=${encodeURIComponent(e.getPositionedPath())}&url=${t}${r?`&${r}`:""}`:`${this.apiUrl}/external/node/${e.getId()}/${this.settings.contentId}/${t}${r?`?${r}`:""}`}}class k{constructor(e){this.description=e,this.startTime=this.getTime(),this.steps=[]}getTime(){return(new Date).getTime()}start(e="[default]"){return{time:this.getTime(),description:e,duration:0}}stop(e){return e.duration=this.getTime()-e.time,this.steps.push(e),e.duration}step(e="[default]"){const t={time:this.getTime(),description:e};return t.duration=this.steps.length>0?t.time-this.steps[this.steps.length-1].time:t.time-this.startTime,this.steps.push(t),t.duration}getMin(){let e=null,t=null;for(const i of this.steps)(null===e||i.duration<e)&&(e=i.duration,t=i);return{time:e,step:t}}getMax(){let e=0,t=null;for(const i of this.steps)(null===t||i.duration>e)&&(e=i.duration,t=i);return{time:e,step:t}}getSteps(){let e=0,t=0,i=null,a=null,r=null;for(const s of this.steps)e+=s.duration,(null===a||s.duration>t)&&(t=s.duration,a=s),(null===i||s.duration<i)&&(i=s.duration,r=s);return{description:this.description,totalTime:e,minTime:i,maxTime:t,meanTime:Math.round(e/this.steps.length),minTimeStep:r,maxTimeStep:a,steps:this.steps}}}const x={percentToGrid:(e,t=12)=>Math.round(e/100*t),gridToPercent:(e,t=12)=>x.floatPrecision(e/t*100),floatPrecision:e=>parseFloat(parseFloat(e).toFixed(2)),distributePercent:(e,t,i=12)=>x.distributeGrid(x.percentToGrid(e,i),t).map(e=>x.gridToPercent(e,i)),distributeGrid:(e,t)=>{let i=t;i>e&&(i=e,Sys.logger.warn(`grid.distributeGrid: Requested count ${t} is larger than gridSize ${e}. Will use count ${i}.`));const a=e/i;if(Number.isInteger(a))return Array(i).fill(a);let r=0,s=!0,n=[];for(let e=0;e<i;e++){const e=s?Math.ceil(a):Math.floor(a);n.push(e),r+=e,s=!s}let o=r-e;if(r!==e){const e=[];for(;o>0&&n.length;){let t=n.shift();t>1&&(t--,o-=1),e.push(t)}n=n.concat(e)}return n.length!==i&&Sys.logger.warn(`Utility-method grid.distributeGrid will return a faulty array. Excpected a count of ${i}, got ${n.length} ...`),n}},P={getData:(e,t,i,a,r,s)=>{const n=x.percentToGrid(e||100,a.span),o={};for(const e of Object.keys(t))t[e]&&(o[e]=x.percentToGrid(t[e],a.span));const l={width:n,css:"",vp:{},cssVp:{}},d=P.getMatchingRule(r,i,a.span);l.vp=P.applyRule(n,o,r.length,d.values,a,s);for(const e of Object.keys(a.prefix))l.cssVp[e]=a.prefix[e]+l.vp[e];return l.css=Object.values(l.cssVp).join(" "),l},applyRule:(e,t,i,a,r,s)=>{const n={};for(const o of Object.keys(r.prefix)){let r=null;t[o]?r=t[o]:a[o]&&(r=P.getMatchingRuleValue(a[o],s,i,e)),n[o]=r?parseInt(r,10):e}return n},getMatchingRuleValue:(e,t,i,a)=>{for(const r of Object.keys(e)){if("first-child"===r&&0===t)return e[r];if("last-child"===r&&t===i-1)return e[r];if("inherit"===r&&e[r])return a;
7if(P.getNthChild(r)===t+1)return e[r]}return e.default?e.default:null},getNthChild:e=>"nth-child("===e.substring(0,10)?parseInt(e.substring(0,e.length-1).substring(10),10):null,getMatchingRule:(e,t,i)=>{const a=e.length;for(let r=t.length-1;r>=0;r--){if("odd"===t[r].condition&&!P.isEven(a))return t[r];if("even"===t[r].condition&&P.isEven(a))return t[r];if("number"==typeof t[r].condition&&t[r].condition===a)return t[r];if(Array.isArray(t[r].condition)&&t[r].condition.length===a){const s=[];for(let t=0;t<a;t++)s.push(x.percentToGrid(e[t],i));if(P.hasArrayMatch(t[r].condition,s))return t[r]}}return{values:{}}},isEven:e=>!(e%2),hasArrayMatch:(e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if("*"!==e[i]&&e[i]!==t[i])return!1;return!0}};class S{constructor(e={}){this.viewportInfo=e,this.cache=new Map,this.buildtin={width:{viewport:{default:!0},fallback:{default:this.viewportInfo.main}},external:{viewport:{default:!0},fallback:{default:this.viewportInfo.main},attributes:{"*":{viewport:{default:!0},fallback:{default:this.viewportInfo.main}}}}}}resetCache(){this.cache.clear()}get(e,t,i,a=null,r){const s=this.getCacheKey(t,i,a,r);if(!this.cache.has(s)){let t=e.getProperty(`viewportMap.${i}`);!t&&this.buildtin[i]&&(t=this.buildtin[i]),"string"==typeof t&&(t=e.getProperty(`viewportMap.${t}`)),t&&a&&"string"==typeof t.attributes&&(t.attributes=e.getProperty(`viewportMap.${t.attributes}`)),this.cache.set(s,this.defineOrder(r,a,t))}return this.cache.get(s)}defineOrder(e,t,i){if(!i)return[];if(t&&(!i.attributes||!i.attributes[t]&&!i.attributes["*"]))return[];const a={viewport:{},fallback:{},...t?i.attributes[t]||i.attributes["*"]:i},r=this.parseMap(e,a);return r.length&&!1!==a.fallback.no_viewport&&r.push(null),r}parseMap(e,t,i=[]){if(!t)return i;if(!1===t.viewport[e])return i;if((!0===t.viewport[e]||t.viewport.default)&&(i.includes(e)||i.push(e)),t.fallback){if(t.fallback[e]&&t.fallback[e]!==e){const a=t.fallback[e];return t.fallback={...t.fallback},delete t.fallback[e],this.parseMap(a,t,i)}if(t.fallback.default&&t.fallback.default!==e){const e=t.fallback.default;return t.fallback={...t.fallback},delete t.fallback.default,this.parseMap(e,t,i)}}return i}getCacheKey(e,t,i,a){return[e,t,i,a].join("|")}}const T={functionMap:{},isValidFunction:e=>{if(void 0!==T.functionMap[e])return T.hasFunction(e);let t;try{t=eval.call(null,e)}catch(e){t=null}return T.functionMap[e]=t,T.hasFunction(e)},hasFunction:e=>typeof T.functionMap[e]==typeof Function,getFunction:e=>!!e&&(T.isValidFunction(e)?T.functionMap[e]:lab_api.v1.ns.get(e)||!1)};class C{constructor(){this.resolved={pathMatch:new Map}}sortPathsByDetail(e){return Array.isArray(e)?e.sort((e,t)=>{const i=(e.match(/\/\//g)||[]).length,a=(e.match(/\*/g)||[]).length,r=e.replace(/\/\//g,"/").replace(/\*/g,"/").split("/").filter(e=>!!e).length+.7*a+.5*i,s=(t.match(/\/\//g)||[]).length,n=(t.match(/\*/g)||[]).length;return t.replace(/\/\//g,"/").replace(/\*/g,"/").split("/").filter(e=>!!e).length+.7*n+.5*s-r}):e}static getPropertyTypeAndIndex(e,t=!1){const i=/(.+)\[(.*)\]/.exec(e);if(!i||i.length<3)return[t?e.split("|"):e,null,!1];let a=i[1];t&&(a=a.split("|"));const r=i[2]?parseInt(i[2].trim(),10):null;return[a,Number.isInteger(r)?r:null,""===i[2].trim()]}pathMatch(e,t){const i=`${e}||${t}`;if(this.resolved.pathMatch.has(i))return this.resolved.pathMatch.get(i);let a=null;return(this.exactMatch(t,e)||this.wildcardMatch(t,e))&&(a=e),this.resolved.pathMatch.set(i,a),a}exactMatch(e,t){return t.endsWith("//")?e.endsWith(t.slice(0,-1)):t.endsWith("/")?e.endsWith(t):e.endsWith(`${t}/`)}wildcardMatch(e,t){const i=y.trim(t,[" ","/"]).split("/").reverse(),a=y.trim(e,[" ","/"]).split("/").reverse();return this.arrayMatch(a,i)}arrayMatch(e,t,i){const a=e.shift(),r=t.shift();return a===r||"*"===r?!t.length||this.arrayMatch(e,t,e.includes(a)):""===r?(e.unshift(a),this.arrayMatch(e,t,!0)):!(!i||!e.length)&&(t.unshift(r),this.arrayMatch(e,t,!0))}static getViewForMenuItem(e){return C.getTarget(e.getModel(),e.getView(),{pathHelper:e.getConfig("pathHelper")}).view}static getTarget(e,t,i={}){const a={model:e,view:t};if(i.pathHelper&&i.pathHelper.type){const e=Array.isArray(i.pathHelper.type)?i.pathHelper.type:[i.pathHelper.type];for(const i of e){const e=this.getTargetForPath(a.model,i);if(e)return a.model=e,a.view=lab_api.v1.view.getView(a.model,t.getViewport()),a}return Sys.logger.warn(`[PathHelper] Cannot get target for source. Check config. Tried "${i.pathHelper.type}". Will return original result.`),a}if(i.source&&"model"!==i.source){const e=T.getFunction(i.source);if(!e)return Sys.logger.warn(`[PathHelper] Cannot get function for source. Check config. Tried "${i.source}". Will return original result.`),a;if(a.model=e(),!a.model)return Sys.logger.warn(`[PathHelper] Cannot get bound source from supplied function. Check config. Tried "${i.source}". Will return original result.`),a;a.view=a.model}return a}static getTargetForPath(e,t){const i=t.split(".");if(!["parent","child","root"].includes(i[0]))return Sys.logger.warn(`[PathHelper] Supplied path not val
7id. Check config. Tried "${t}". Will return original result.`),null;let a;if("parent"===i[0])a=i[1]?lab_api.v1.model.query.getParentOfType(e,i[1],!0):e.getParent();else if("root"===i[0])a=lab_api.v1.model.query.getRootModel();else{const t=i[1],[r,s]=C.getPropertyTypeAndIndex(t);a=null===s?lab_api.v1.model.query.getChildOfType(e,r):lab_api.v1.model.query.getModelsByType(r,e.children)[s]||null}return a}}class M{constructor(e){this.getView=e.getView,this.getMarkupForModels=e.getMarkupForModels,this.getMarkupString=e.getMarkupString,this.configReader=e.configReader,this.localisation=e.localisation,this.proxies={config:null,cmsConfig:null,root:null,selector:null,preload:null,localisation:null,viewports:null},this.parsedProps=new Map,this.isEditor=this.configReader.getCms("app.isEditMode"),this.viewports=Object.keys(this.configReader.get("viewports")||{})}parseProp(e){return this.parsedProps.has(e)||this.parsedProps.set(e,this.doParseProp(e)),this.parsedProps.get(e)}doParseProp(e){const t={prop:e,attr:void 0};if(!e.endsWith("]"))return t;const i=/(.+)\[(.*)\]/.exec(e);return!i||i.length<3?t:{prop:i[1],attr:i[2]}}getProxy(e,t=this.getView(e)){return t.getProxy()||t.setProxy(this.createProxy(e,t)),t.getProxy()}createProxy(e,t){const i=(e,i)=>{const a=this.parseProp(i);return a.attr?t.get(`${e}.${a.prop}.${a.attr}`):t.get(`${e}.${a.prop}`)},a=new Proxy({},{get:(e,t)=>i("fields",t),has:(e,t)=>!!i("fields",t)}),r=new Proxy({},{get:(e,i)=>t.get(`metadata.${i}`),has:(e,i)=>!!t.get(`metadata.${i}`)}),s=new Proxy({},{get:(e,i)=>t.get(`filtered.${i}`),has:(e,i)=>!!t.get(`filtered.${i}`)});return new Proxy({},{get:(e,i)=>"fields"===i?a:"metadata"===i?r:"filtered"===i?s:t.get(i),has:(e,i)=>!!t.get(i)})}getRootProxy(){return this.proxies.root||(lab_api.v1.model.query.getRootModel()?this.proxies.root=this.getProxy(lab_api.v1.model.query.getRootModel()):this.proxies.root={}),this.proxies.root}getParentProxy(e,t){return e.parent?this.isEditor?e.parent.isMarkedForDeletion()?null:(t.getParentProxy()||t.setParentProxy(new Proxy(this.getProxy(e.parent),{get:(t,i)=>(e.parent.addToRedrawDependencies(e),t[i]),has:(e,t)=>t in e})),t.getParentProxy()):this.getProxy(e.parent):null}getChildrenProxy(e,t){return t.getChildrenProxy()||t.setChildrenProxy(new Proxy({},{get:(t,i)=>{let a=i,r=!1;a.endsWith("+")&&(r=!0,a=a.substring(0,a.length-1));const s="all"===a?e.children:lab_api.v1.model.query.getModelsByType(a,e.children,r);return this.getProxiesForModels(s,!0)},has:(e,t)=>!0})),t.getChildrenProxy()}getChildProxy(e,t){return t.getChildProxy()||t.setChildProxy(new Proxy({},{get:(t,i)=>{let a=i,r=!1;a.endsWith("+")&&(r=!0,a=a.substring(0,a.length-1));const[s,n]=C.getPropertyTypeAndIndex(a,!0);if(null===n){const t=lab_api.v1.model.query.getChildOfType(e,s,r);return t?this.getProxiesForModels([t],!1):null}const o=lab_api.v1.model.query.getModelsByType(s,e.children,r);return o[n]?this.getProxiesForModels([o[n]],!1):null},has:(e,t)=>!0})),t.getChildProxy()}getStoreProxy(e,t,i=!1){if(!t.getStoreProxy(i)){const e={};t.setStoreProxy({get:new Proxy(e,{has:()=>!0,get:(e,t)=>t in e?e[t]:""}),set:new Proxy(e,{has:()=>!0,get:(e,t)=>()=>(i,a)=>(e[t]=a(i),"")})})}return t.getStoreProxy(i)}getPreloadProxy(e){return this.proxies.preload||(this.proxies.preload=this.createPreloadProxy(e)),this.proxies.preload}createPreloadProxy(e){return new Proxy({},{get:(t,i)=>e.getObject(i),has:(e,t)=>!0})}getChildrenMarkupProxy(e,t){return t.getChildrenMarkupProxy()||t.setChildrenMarkupProxy(new Proxy({},{get:(t,i)=>{let a=i,r=!1;a.endsWith("+")&&(r=!0,a=a.substring(0,a.length-1));const[s,n,o]=C.getPropertyTypeAndIndex(a,!0),l="all"===s[0]?e.children:lab_api.v1.model.query.getModelsByType(s,e.children,r);return null===n?this.getMarkupForModels(l,o):this.getMarkupForModels(l[n]?[l[n]]:[],!1)},has:(e,t)=>!0})),t.getChildrenMarkupProxy()}getChildMarkupProxy(e,t){return t.getChildMarkupProxy()||t.setChildMarkupProxy(new Proxy({},{get:(t,i)=>{let a=i,r=!1;a.endsWith("+")&&(r=!0,a=a.substring(0,a.length-1));const[s,n]=C.getPropertyTypeAndIndex(a,!0),o=lab_api.v1.model.query.getModelsByType(s,e.children,r);return o.length?null===n||0===n?this.getMarkupForModels([o[0]],!1):this.getMarkupForModels(o[n]?[o[n]]:[],
7!1):""},has:(e,t)=>!0})),t.getChildMarkupProxy()}getSelectorProxy(){if(!this.proxies.selector){const e={get:(e,t)=>{const i=lab_api.v1.model.query.getModelBySelector(t);return i?this.getMarkupString(i,this.getView(i)):""},has:(e,t)=>!0};this.proxies.selector=new Proxy({},e)}return this.proxies.selector}getConfigProxy(){if(!this.proxies.config){const e={get:(e,t)=>this.configReader.get(t),has:(e,t)=>!0};this.proxies.config=new Proxy({},e)}return this.proxies.config}getCmsConfigProxy(){if(!this.proxies.cmsConfig){const e={get:(e,t)=>this.configReader.getCms(t),has:(e,t)=>!0};this.proxies.cmsConfig=new Proxy({},e)}return this.proxies.cmsConfig}getLocalisationProxy(){return this.proxies.localisation||(this.proxies.localisation=()=>(e,t)=>this.localisation.get(e,{fallbackValue:""})),this.proxies.localisation}getViewportProxy(e){return this.proxies.viewports||(this.proxies.viewports={},this.viewports.forEach(t=>{this.proxies.viewports[`is${t.charAt(0).toUpperCase()+t.slice(1)}`]=t===e})),this.proxies.viewports}getProxiesForModels(e,t=!0){const i=e.map(e=>this.getProxy(e));return t?i:i[0]}}class $ extends p{constructor(e){super({behaviours:e.behaviours,entries:e.entries,debug:e.settings.debug}),this.logger=e.logger,this.state={isEditor:!1},this.settings=e.settings,this.logger.debug(`Creating instance of ViewManager for viewport ${e.viewport}.`),this.resourceManager=e.resourceManager,this.configReader=e.configReader,this.configProcessor=e.configProcessor,this.viewMap=new Map,this.gridSettings=this.getGridSettings(),this.viewport={name:e.viewport,main:this.configProcessor.getMainViewport(),isMain:this.configProcessor.isMainViewport(),width:this.configProcessor.getViewportWidth()},this.styleManager=e.styleManager,this.preloadHandler=e.preloadHandler,this.localisation=e.localisation,this.viewportsSettings=this.configReader.get("viewports")||{},this.ViewHelpers={};const t=new S(this.viewport);this.viewEventPipe={getViewportOrder:t.get.bind(t)},this.rootModel=null,this.proxyManager=new M({configReader:this.configReader,localisation:this.localisation,getView:this.getView.bind(this),getMarkupForModels:this.getMarkupForModels.bind(this),getMarkupString:this.getMarkupString.bind(this)}),this.renderers={renderViewTemplate:this.renderViewTemplate.bind(this),renderViewPartial:this.renderViewPartial.bind(this),renderPartial:this.renderPartial.bind(this),renderPageElement:this.renderPageElement.bind(this)},this.renderHelpers={trim:()=>(e,t)=>t(e).replace(/\t|\r\n|\n|\r/gm," ").replace(/ +/gm," ").trim(),sanitizeString:()=>(e,t)=>y.sanitizeString(t(e)),stripTags:()=>(e,t)=>y.stripTags(t(e)),stripLinks:()=>(e,t)=>y.stripLinks(t(e)),encodeURIComponent:()=>(e,t)=>encodeURIComponent(t(e)),escapeForJavaScript:()=>(e,t)=>y.escapeForJavaScript(t(e)),cachebuster:()=>e=>{const t=e.split(","),i="cms"===t[0]?"cms":"view",a=this.configReader.getCms(`deployTimestamps.${i}`);return a?`${(t[1]||"?")+(t[2]||"v")}=${a}-L4`:""},toFixed:()=>(e,t)=>{const[i,a]=t(e).trim().split(" ");return parseFloat(i).toFixed(a)},fallbackString:()=>(e,t)=>y.fallbackString(t(e))}}apiReady(e){this.ViewHelpers={image:new b(e,this.getViewHelperParams()),bodytext:new w(e,this.getViewHelperParams()),external:this.getExternalViewHelper(e)}}getGridSettings(){const e=this.configProcessor.getViewport(),t={prefix:this.configReader.get("grid.grid_prefix"),absPrefix:this.configReader.get("grid.abs_grid_prefix"),span:this.configReader.get("grid.total_grid_spans")};return t.prefix[e]||(t.prefix[e]=""),t}getViewHelperParams(){return{viewport:this.viewport.name,logger:this.logger,viewManager:this,isEditor:this.state.isEditor,settings:this.settings}}getViewHelper(e){return e in this.ViewHelpers?this.ViewHelpers[e]:null}getExternalViewHelper(e){return new _(e,this.getViewHelperParams())}allowViewport(e){const t=e.get("metadata.viewportBlacklist");return!t||!Array.isArray(t)||!t.includes(this.viewport.name)}draw(e=[],t=null){this.emitEvent("render",this.viewport.name),this.logger.debug(`[ViewManager] Start rendering for viewport ${this.viewport.name}.`);const i=new k("ViewManager.draw");for(const t of e)this.drawModel(t);
7this.logger.debug(`[ViewManager] Rendering finished for viewport ${this.viewport.name}. Element-count: ${lab_api.v1.model.query.getModelsFromCache().length}. Duration ${i.step()} ms.`);let a=[];for(const t of e){const e=this.getView(t);a.push(e.getMarkupString())}const r=this.notifyFrontRendered(a);return r.length&&(this.logger.warn('[ViewManager] Listener for event "app-rendered" has modified markup returned from rendering engine.'),a=r.pop()),"function"==typeof t&&t(a),a}notifyFrontRendered(e){return this.requestEvent("rendered",e,this.viewport.name)}drawModel(e,t=!0){if(lab_api.v1.app.dbg.logger.add(this.constructor.name,"drawModel",this.viewport.name),!this.allowViewport(e))return void this.logger.debug(`[ViewManager] Element ${e.getPositionedPath()} is not allowed on viewport ${this.viewport.name}.`);const i=this.getView(e);if(this.prepareDrawing(e,i),t){const t=i.getProperty("childLimit");for(const i of e.children)this.allowChild(e,i,t)&&this.drawModel(i)}this.drawPrepared(e,i)}allowChild(e,t,i){return!(i&&e.children.indexOf(t)>=i)||(this.logger.warn(`[ViewManager] Child-limit (${i}) reached for "${e.getType()}". Child: "${t.getPositionedPath()}". Viewport "${this.viewport.name}".`),this.childLimitDetected(e,t,i))}childLimitDetected(e,t,i){const a=this.requestEvent("childLimitReached",e,t,this.viewport.name,i);return!!a.length&&!!a.pop()}prepareDrawing(e,t){const i=this.performanceLogger.start(["prepare",e.getType()]);this.prepareView(e,t),t.getGrid()||(this.getAndSetGridData(e,t),this.gridIsDefined(e,t)),this.proxyManager.getProxy(e,t),this.notifyOnPrepareViewHelper(e,t),this.prepareViewHelper(e,t),this.notifyOnReady(e,t),this.performanceLogger.end(i)}gridIsDefined(e,t){}drawPrepared(e,t){let i=this.performanceLogger.start(["assembleData",e.getType()]);const a=this.getDataForView(e,t);this.performanceLogger.end(i),this.runViewHelper(e,t),this.notifyBeforeElementDraw(e,t),i=this.performanceLogger.start(["template",e.getType()]),this.renderTemplate(e,t,a),this.performanceLogger.end(i),this.markupStringReady(e,t)}markupStringReady(e,t){this.notifyOnRendered(e,t)}notifyOnPrepareViewHelper(e,t){e.isPseudo()||this.emitBehaviour("onPrepareViewHelper",e,t)}notifyOnReady(e,t){e.isPseudo()||this.emitBehaviour("onReady",e,t)}notifyOnViewHelper(e,t){e.isPseudo()||this.emitBehaviour("onViewHelper",e,t)}notifyBeforeElementDraw(e,t){e.isPseudo()||(this.emitBehaviour("onRender",e,t),this.emitEntry("onRender",e,t))}notifyOnRendered(e,t){this.emitBehaviour("onRendered",e,t),this.emitEntry("onRendered",e,t)}getDataForView(e,t){return t.getData()||this.getAndSetViewData(e,t)}createView(e){const t=e.getGuid();return this.viewMap.get(t)||this.viewMap.set(t,this.newViewInstance(e)),this.viewMap.get(t)}newViewInstance(e){return new f(this.viewport.name,e,this.viewEventPipe)}getView(e){return this.viewMap.get(e.getGuid())||this.createView(e)}getViews(){return this.viewMap.values()}prepareView(e,t){t.isPrepared()||(lab_api.v1.app.dbg.logger.add(this.constructor.name,"prepareView",this.viewport.name),this.setTemplate(e,t),this.setProperties(e,t),this.viewIsResolved(e,t))}setTemplate(e,t){t.setTemplate(this.resourceManager.getTemplateForModel(e,t))}setProperties(e,t){t.setProperties(this.resourceManager.getPropertiesForModel(e,t),!0)}viewIsResolved(e,t){t.setPreparedState(!0)}prepareViewHelper(e,t){if(e.isPseudo())return;const i=t.getProperty("viewHelper");if(!i)return;const a=this.getViewHelper(i);if(a){if(a.prepare){const i=this.performanceLogger.start(["viewhelper-prepare",e.getType()]);a.prepare(e,t),this.performanceLogger.end(i)}}else this.logger.warning(`[ViewManager] Cannot find view-helper ${i} for model ${e.getPositionedPath()}.`)}runViewHelper(e,t){if(e.isPseudo())return;const i=t.getProperty("viewHelper");if(!i)return;const a=this.getViewHelper(i);if(a){this.notifyOnViewHelper(e,t);const i=this.performanceLogger.start(["viewhelper-run",e.getType()]);a.run(e,t),this.performanceLogger.end(i)}else this.logger.warning(`[ViewManager] Cannot find view-helper ${i} for model ${e.getPositionedPath()}.`)}renderTemplate(e,t,i){lab_api.v1.app.dbg.extensiveLogging&&this.logger.debug(`[ViewManager] Start renderTemplate for model ${e.getPositionedPath()}`),e.getNoRenderState()?this.logger.debug(`[ViewManager] Model-state disallows rendering model "${e.getPositionedPath()}".`):this.renderTemplateAndData(e,t,i)}getAndSetViewData(e,t){const i=this.getViewData(e,t);return t.setData(i),i}getGridData(e){const t=e.getGrid()||{};return{width:t.width,absWidth:e.getAbsoluteGridWidth(),css:t.css,absCss:e.getAbsGridCss(),vp:t.vp,absVp:e.getAbsoluteGridWidths(),cssVp:t.cssVp,percentage:x.gridToPercent(t.width)}}getViewData(e,t){const i=lab_api.v1.model.query.getRootModel()||e.getRootParent(),a=lab_api.v1.view.getView(i,t.getViewport());return{get:{current:this.proxyManager.getProxy(e,t),parent:this.proxyManager.getParentProxy(e,t),root:this.proxyManager.getRootProxy(),child:this.proxyManager.getChildProxy(e,t),children:this.proxyManager.getChildrenProxy(e,t),store:this.proxyManager.getStoreProxy(e,t)},set:{store:this.proxyManager.getStoreProxy(e,t,!0)},getPreload:this.proxyManager.getPreloadProxy(this.preloadHandler),child:this.proxyManager.getChildMarkupProxy(e,t),childByIndex:()=>(t,i)=>{const[a,r]=i(t).trim().split(" "),s=parseInt(a,10)||0,n=r?lab_api.v1.model.query.getChildrenOfType(e,r):e.getChildren();return n[s]?this.getMarkupString(n[s],this.getView(n[s])):null},children:this.proxyManager.getChildrenMarkupProxy(e,t),selector:this.proxyManager.getSelectorProxy(e,t),size:{grid:this.getGridData(t),pixelWidth:t.getPixelWidth(),pixelWidths:t.getPixelWidths()},style:{definition:()=>(i,a)=>this.styleManager.getStyleFromDefinition(e,t,a(i)),collection:()=>(i,a)=>this.styleManager.getStyle(e,t,a(i))},app:{viewport:{name:this.viewport.name,width:this.viewport.width,main:this.viewport.main,isMain:this.viewport.isMain,...this.proxyManager.getViewportProxy(this.viewport.name)}
7,isEditor:this.state.isEditor,isFront:!this.state.isEditor},render:{template:this.renderers.renderViewTemplate,partial:this.renderers.renderViewPartial,sitePartial:this.renderers.renderPartial,pageElement:this.renderers.renderPageElement},helper:{trim:this.renderHelpers.trim,sanitizeString:this.renderHelpers.sanitizeString,stripTags:this.renderHelpers.stripTags,stripLinks:this.renderHelpers.stripLinks,encodeURIComponent:this.renderHelpers.encodeURIComponent,escapeForJavaScript:this.renderHelpers.escapeForJavaScript,cachebuster:this.renderHelpers.cachebuster,toFixed:this.renderHelpers.toFixed,fallbackString:this.renderHelpers.fallbackString},calculator:{add:()=>(e,t)=>{const[i,a]=t(e).trim().split(" ");return parseFloat(i)+parseFloat(a)},subtract:()=>(e,t)=>{const[i,a]=t(e).trim().split(" ");return parseFloat(i)-parseFloat(a)},divide:()=>(e,t)=>{const[i,a]=t(e).trim().split(" ");return parseFloat(i)/parseFloat(a)},multiply:()=>(e,t)=>{const[i,a]=t(e).trim().split(" ");return parseFloat(i)*parseFloat(a)}},if:()=>(e,t)=>{const i={"=":(e,t)=>e==t,"!=":(e,t)=>e!=t,"<":(e,t)=>e<t,">":(e,t)=>e>t,"[]":(e,t)=>e.includes(t)};let a=0,r=null,s=[];for(;s.length<2&&a<Object.keys(i).length;)r=Object.keys(i)[a++],s=e.split(r);if(s.length>1){const[e,a]=s.map(e=>t(e).trim());if(i[r](e,a))return"1"}return""},getConfig:this.proxyManager.getConfigProxy(),getCmsConfig:this.proxyManager.getCmsConfigProxy(),image:{getFrontCropUrl:this.getFront
7CropUrlHelper(i,a)},lang:this.proxyManager.getLocalisationProxy()}}getFrontCropUrlHelper(e,t){return()=>(t,i)=>{const a=e.get("frontCrop");if(a&&a.pano){const e=i(t).split(","),r=parseInt(e[0],10),s=parseInt(e[1],10),n=e[2]||void 0,o=this.getViewHelper("image").generateUrl(a.pano.fields,{instanceOf:a.pano.instance_of,imageUrlOptionsNameValue:a.pano.instance_of,imageId:a.pano.instance_of,width:r,height:s,format:n});if(o)return o}const r=(lab_api.v1.config.get("faviconList")||[]).pop();return r&&r.iconPath?r.iconPath.startsWith("http")?r.iconPath:lab_api.v1.properties.get("customer_front_url")+r.iconPath:""}}renderPageElement(){return(e,t)=>{const i=e.trim().split(" "),a=t(i.shift()),r=t(i.shift())||a,s=lab_api.v1.config.get(`pageElements.${a}`);if(!s)return this.renderViewPartial()(r,t);const n=this.getTemplate("widgets/structures/root");return n?t(this.renderPageElementRecursive(n,s)):(this.logger.warn('[ViewManager] Cannot find root-widget at "widgets/structures/root". Widget not rendered.'),"")}}getTemplate(e){return this.resourceManager.templates[e]}renderPageElementRecursive(e,t,i={value:1}){const{viewport:a,pageType:r,flag:s}=t.requirements||{};if((!a||a===this.viewport.name)&&(!r||r===this.configProcessor.getPageType())&&(!s||lab_api.v1.util.featureFlags.enabled(s,this.settings.contentId))){const a=i.value,r=t.settings||{},s=[];if(t.children)for(let e=0;e<t.children.length;e++){const a=t.children[e],r=this.getTemplate(`widgets/${a.type}`);if(r){i.value++;const e=this.renderPageElementRecursive(r,a,i);e&&s.push(e)}else this.logger.warn(`[ViewManager] Cannot find widget at "widgets/${a.type}". Widget not rendered.`)}const{tags:n}=Mustache;Mustache.tags=["[[","]]"];const o=Mustache.render(e,{children:s.join(""),settings:r,id:a});return Mustache.tags=n,o}return null}renderViewTemplate(){return(e,t)=>{const i=t(e.trim());return i&&this.getTemplate(i)?t(this.getTemplate(i)):(this.logger.debug(`Render template: Path is not valid: '${i}'`),"")}}renderViewPartial(){return(e,t)=>this.renderPartialWithFallback(e.trim(),t)}renderPartial(){return(e,t)=>this.renderPartialWithOutFallback(e.trim(),t)}renderPartialWithOutFallback(e,t){return this.renderViewTemplate()(`partial/${e}`,t)}renderPartialWithFallback(e,t,i=null,a=[]){const r=i||lab_api.v1.site.getSite().alias,s=this.renderViewTemplate(),n=s(`partial/site/${r}/${e}`,t);if(!n){a.push(r);const i=lab_api.v1.config.get("lab_fallback_site",r);return i&&!a.includes(i)?this.renderPartialWithFallback(e,t,i,a):s(`partial/${e}`,t)}return n}getPixelWidths(e,t){const i=t.getPixelWidths();if(i)return i;const a=t.getAbsoluteGridWidths(),r=a[this.viewport.main],s={};for(const e in this.viewportsSettings)if(this.viewportsSettings[e]){const t=a[e]?a[e]:r;s[e]=Math.ceil(t/this.gridSettings.span*this.viewportsSettings[e].deviceWidth)}return s}calculateGridData(e,t){const i=this.viewport.main,a=t.getWidth(),r=e.getViewportWidths();let s=[a],n=t.getProperty("gridRules")||[];if(Array.isArray(n)||(n=Object.values(n)),n.length){const t=e.parent?e.parent.getPersistentChildren():null;t&&(s=t.map(e=>e.getWidth(i)||e.getWidth()))}return P.getData(a,r,n,this.gridSettings,s,e.getModelIndex(!0))}calculateAbsoluteGridWidths(e,t){const i=t.getGrid().vp;i||this.logger.error("gridWidths do not exist. It should ...");let a={};if(e.parent){const t=this.getView(e.parent);a=this.getAbsoluteGridWidths(e.parent,t)||a}const r={};for(const e of Object.keys(i))r[e]=x.floatPrecision(i[e]/this.gridSettings.span*(a[e]||this.gridSettings.span));return r}getAbsoluteGridWidths(e,t){return t.getAbsoluteGridWidths()}getAbsoluteGridCss(e,t){if(!this.gridSettings.absPrefix)return"";const i=t.getAbsoluteGridWidths();return Object.keys(i).map(e=>this.gridSettings.absPrefix[e]?this.gridSettings.absPrefix[e]+i[e]:"").join(" ")}getAndSetGridData(e,t){const i=this.calculateGridData(e,t);t.setGrid(i),t.setGridWidth(i.vp[this.viewport.name]),t.setAbsoluteGridWidths(this.calculateAbsoluteGridWidths(e,t)),t.setAbsGridCss(this.getAbsoluteGridCss(e,t)),t.setPixelWidths(this.getPixelWidths(e,t))}renderTemplateAndData(e,t,i){t.setMarkupString(Mustache.render(t.getTemplate(),i,this.resourceManager.templates))}getMarkupForModels(e,t=!0){const i=e.map(e=>this.getMarkupString(e,this.getView(e)));return t?i:i.join("")}getMarkupString(e,t){return t.getMarkupString()}getPlaceholders(){return{}}getMarkup(e){return this.getView(e).getMarkup()}}const A={create(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?i:7&i|8).toString(16)})}},I=new Map;class D{constructor(e,t={}){this.parent=null,this.children=[],this.path=e.path,this.data={type:e.type,metadata:e.metadata,contentdata:e.contentdata,width:D.validateInputWidth(e.width),guid:e.guid||A.create(),selector:e.selector},this.fallbackData=e.fallback,this.fallbackReader=e.fallbackReader||(()=>{}),this.source={model:null,targets:[],keys:[]};const i=e.state||{};this.state={isNonPersistent:!!i.isNonPersistent,isPseudo:!!i.isPseudo,noRender:!1},this.cache={serialized:null,filtered:e.filtered||{},external:e.external||null,getter:new Map,path:null,positionedPath:{persistent:null,nonPersistent:null},childCount:{value:0}},this.eventPipe={keyModified:t.keyModified,childAdded:t.childAdded}}static validateInputWidth(e){const t=D.getEmptyDataObject();t.value="number"==typeof e?e:100;const i=o.object(e,t);return i.value||0!==Object.keys(i.vp).length||(i.value=100),i}static getEmptyDataObject(){return{value:null,vp:{}}}
7getNoRenderState(){return this.state.noRender}setNoRenderState(e){this.state.noRender=!!e;for(const t of this.children)t.setNoRenderState(e)}setDataProperty(e,t){this.data[e]=t}getId(){return this.data.contentdata&&this.data.contentdata.id||null}getGuid(){return this.data.guid}isNonPersistent(){return this.state.isNonPersistent||this.state.isPseudo}isPseudo(){return this.state.isPseudo}isDerived(){return!!this.source.model}hasNodeData(e=!1){if(this.data.contentdata)return!0;if(e)for(const t of this.children)if(t.hasNodeData(e))return!0;return!1}getSourceModel(){return this.source.model}setSourceModel(e,t){this.source.model=e,this.source.keys=t}addSourceTarget(e){this.source.targets.includes(e)||this.source.targets.push(e)}getSourceTargets(){return this.source.targets}hasSourceKey(e){if(!this.source.model)return!1;if(!this.source.keys.length)return!0;const t=e.split(".");for(;t.length;){if(this.source.keys.includes(t.join(".")))return!0;t.pop()}return!1}hasKeyInTarget(e){for(const t of this.source.targets)if(t.hasSourceKey(e))return!0;return!1}isSourceKey(e){return this.source.keys.includes(e)}setParent(e){this.parent=e}getParent(){return this.parent}getRootParent(){return this.parent?this.parent.getRootParent():this}getChildren(){return this.children}getPersistentChildren(){return this.children.filter(e=>!e.isNonPersistent())}getNonpersistentChildren(){return this.children.filter(e=>e.isNonPersistent())}getPersistentSiblings(){return this.parent?this.parent.getPersistentChildren():null}addChild(e,t,i=!1){this.addChildAtIndex(e,i?0:this.children.length,t)}addChildAtIndex(e,t,i=!0,a=!1){return e.setParent(this),this.children.length<=t?this.children.push(e):this.children.splice(t,0,e),e.resetPath(),!a&&this.eventPipe.childAdded&&this.eventPipe.childAdded(this,e,t),this.children}getPath(e=!1){return null===this.cache.path&&(this.cache.path=this.parent?`${this.parent.getPath()}/`:this.path),this.cache.path+(e?"":this.getType())}getArrayPath(e=!1){return this.getPath(e).split("/").filter(e=>!!e)}getPositionedPath(e=!1){return e?this.getPersistentPositionedPath():this.getNonPersistentPositionedPath()}getPersistentPositionedPath(){if(null===this.cache.positionedPath.persistent){let e=this.getModelIndexByType(!0);-1===e&&(e=0),this.cache.positionedPath.persistent=`${(this.parent?`${this.parent.getPersistentPositionedPath()}/`:this.path)+this.getType()}[${e}]`}return this.cache.positionedPath.persistent}getNonPersistentPositionedPath(){if(null===this.cache.positionedPath.nonPersistent){let e=this.getModelIndexByType(!1);-1===e&&(e=0),this.cache.positionedPath.nonPersistent=`${(this.parent?`${this.parent.getNonPersistentPositionedPath()}/`:this.path)+this.getType()}[${e}]`}return this.cache.positionedPath.nonPersistent}resetPath(){this.cache.path=null,this.cache.positionedPath={persistent:null,nonPersistent:null};for(const e of this.children)e.resetPath()}isStage(){return this.getRootParent().getType().startsWith("page_")}getModelIndex(e=!1){return this.parent?(e?this.parent.getPersistentChildren():this.parent.children).indexOf(this):-1}getModelIndexByType(e=!1){if(!this.parent)return-1;const t=this.getType();let i=-1;for(const a of e?this.parent.getPersistentChildren():this.parent.getChildren())if(a.getType()===t&&(i++,a===this))return i;return i}getType(){return this.data.type}getWidth(e){return e?this.data.width.vp[e]||null:this.data.width.value||100}getViewportWidths(){return this.getRaw("width.vp")||{}}setSelector(e){this.data.selector=e}getSelector(){return this.data.selector}getData(e,t){return e?n.get(e,this.data.contentdata,t):this.data.contentdata}getDataObjectForKey(e,t=!1){if(!t&&this.hasSourceKey(e)){const t=this.source.model.getDataObjectForKey(e);return t.sourceModel=this.source.model,t}const i=e.split(".")[0];return"fields"===i?{base:i,data:this.data.contentdata,fallback:this.fallbackData?this.fallbackData.contentdata:void 0,fallbackPath:"contentdata",supportFallback:!0}:"filtered"===i||"external"===i||"childCount"===i?{base:i,data:this.cache,fallback:void 0,supportFallback:!1}:"metadata"===i||"width"===i||"type"===i||"guid"===i?{base:i,data:this.data,fallback:this.fallbackData?this.fallbackData:void 0,fallbackPath:"",supportFallback:!0}:"state"===i?{base:i,data:this,fallback:void 0,supportFallback:!1}:{base:"",data:this.data.contentdata,fallback:void 0,fallbackPath:"",supportFallback:!1}}getRaw(e,t){return e?n.get(e,this.data,t):this.data}setRaw(e,t,i){const a=this.buildQuery(e);if(!a.isVpObj)return void Sys.logger.warn(`LabModel: Cannot set raw value for key "${e}". Not supported.`);const r={...i};delete r.viewport;const s=this.getRaw(e);if(!s&&!t)return;const o=Object.keys(t&&t.vp||{}),l=Object.keys(s&&s.vp||{});for(const i of l)o.includes(i)&&t||this.set(e,void 0,{...r,viewport:i});for(const i of o)this.set(e,t.vp[i],{...r,viewport:i});this.set(e,t?t.value||null:void 0,{...r,predefinedQuery:a}),t||n.delete(e,this.data)}validateVpModelData(e){return!!e&&"object"==typeof e&&(void 0!==e.value||void 0!==e.vp)}buildQuery(e,t){const i=t?`${e}|${t}`:e,a=I.get(i);if(a)return a;const r=e.split("."),s={min:"width"===r[0]||"external"===r[0]||"childCount"===r[0]?1:2,max:"fields"===r[0]||"filtered"===r[0]?2:1},n="metadata"===r[0]||"fields"===r[0]||"width"===r[0]||"external"===r[0]||"childCount"===r[0],o="external"===r[0],l={path:r.slice(0,s.max).join("."),allowSource:!["childCount","filtered","metadata","guid"].includes(r[0]),attribute:r.length>s.max?r[s.max]:null,key:r.slice(0,s.max+1).join("."),fullPath:e,raw:e,type:n?r[0]:null,isVpObj:n,isValidated:!(n&&!o)||r.length<=s.max+1&&r.length>=s.min};return o&&(l.attribute=r.slice(s.min).join("."),l.key=e),l.isVpObj&&(o?l.fullPath=t?`${r.slice(0,s.max).join(".")}.vp.${t}${l.attribute?`.${l.attribute}`:""}`:`${r.slice(0,s.max).join(".")}.value${l.attribute?`.${l.attribute}`:""}`:"fields"===l.type&&l.path.endsWith("_json")?(l.fullPath=`${l.path}.value${l.attribute?".":""}${r.slice(2).join(".")}`,l.isValidated=!0):(l.fullPath=l.attribute?`${l.path}.${"fields"===l.type?"attributes.":""}${l.attribute}`:l.path,l.fullPath+=t?`.vp.${t}`:".value")),I.set(i,l),l}get(e,t,i,a){lab_api.v1.app.dbg.logger.add(this.constructor.name,"get");const r=this.getCacheKey(e,t,i),s=i?void 0:null;if(this.cache.getter.has(r))return this.getCacheValue(r);const o=a||this.buildQuery(e,t);if(!o.isValidated)return Sys.logger.warn(`LabModel: Cannot get unvalid key: "${e}".`),this.cache.getter.set(r,s),s;const l=this.getDataObjectForKey(e,!o.allowSource);let d=n.get(o.fullPath,l.data,!0);return void 0===d&&(d=this.fallbackReader(this,o,l)),void 0===d?(this.cache.getter.set(r,s),s):(this.cache.getter.set(r,d),this.getCacheValue(r))}getCacheValue(e){const t=this.cache.getter.get(e);return t&&"object"==typeof t?Array.isArray(t)?[...t]:{...t}:t}getCacheKey(e,t="lab_main",i=!1){return`${e}-${i?1:0}-${this.getPath()}-${t||"lab_main"}`}getAttributeObject(e){const t=this.buildQuery(e);if(!t.isVpObj)return null;const i=this.getDataObjectForKey(e,!0),a=n.get(t.path,i.data,!0);if(!a)return null;const r="fields"===t.type?a.attributes:a;return t.attribute&&!r[t.attribute]?null:t.attribute?{[t.attribute]:r[t.attribute]}:r}set(e,t,{viewport:i=null,notify:a=!0,checkDerived:r=!0,registerModified:s=!0,save:o=!0,predefinedQuery:l=null,undoable:d=!0,resetCache:c=!0}={}){if(lab_api.v1.app.dbg.logger.add(this.constructor.name,"set"),
7!e)return!1;let g=t;const p=l||this.buildQuery(e,i);if(!p.isValidated)return Sys.logger.warn(`LabModel: Cannot set value for key. Key not valid: ${e}.`),!1;const u=this.getDataObjectForKey(e,!p.allowSource);if(!u.data)return Sys.logger.warn(`LabModel: Trying to set data on a non-existing object. Skipping. Key: "${e}". Model-path: "${this.getPath()}".`),!1;const h=n.get(p.fullPath,u.data,!0);if(h===g)return!1;if(h&&void 0===g&&"fields"===p.type&&(g=null),p.isVpObj&&void 0===h&&void 0===n.get(p.path,u.data,!0)&&n.set(p.path,D.getEmptyDataObject(),u.data),a){if(!this.dataWillSet(p.key,g))return Sys.logger.debug(`Pre-set listener has cancelled setting data for path ${e} at model ${this.getPath()}.`),!1;d&&lab_api.v1.history&&lab_api.v1.history.getManager().add(lab_api.v1.history.getManager(),"modelSetter",[this.getGuid(),e,h,{viewport:i,notify:a,registerModified:s,save:!1,predefinedQuery:p,undoable:!1}])}return n.set(p.fullPath,g,u.data),c&&this.keyModified(p.key,i),s&&(this.registerModified(e),u.sourceModel&&u.sourceModel.registerModified(e)),a&&this.dataIsSet(p.key,g,e,o,r),!0}keyModified(e,t){this.eventPipe.keyModified&&this.eventPipe.keyModified(this,e,t)}setFiltered(e,t,i=!1){if(!i){const t=`filtered.${e}-`,i=[];for(const e of this.cache.getter.keys())e.startsWith(t)&&i.push(e);for(const e of i)this.cache.getter.delete(e)}return this.set(`filtered.${e}`,t,{notify:!1,save:!1,registerModified:!1,resetCache:i})}getSerializedCache(){return this.cache.serialized}setSerializedCache(e){this.cache.serialized=e}dataWillSet(e,t,i){return!0}dataIsSet(e,t,i){}registerModified(e){}}const F={internalToBackend(e,t=!0){const i={...e};i.type=e.type||null,i.id=e.id||null,i.tmpId=e.tmpId||null,i.instance_of=e.instance_of||null,i.parent=e.parent||null,e.status&&(i.status=e.status),i.site_id=e.site_id||null;const a={viewports_json:{}};for(const e of Object.keys(i.fields||{})){let t=i.fields[e];"object"==typeof t&&null!==t||(t={value:t}
7),this.internalFieldToBackend(e,t,a)}return i.fields=a,i},backendToInternal(e,t=[],i=!0){const a=this.backendToInternalStructure(e.structure,t);return e.contentdata&&(a.contentdata=this.backendToInternalNode(e.contentdata)),a},appendDefaultData(e,t){if(!t)return e;let i=!0,a=e;Array.isArray(e)||(i=!1,a=[e]);const r=[];for(const e of a){const i=t?n.merge(t,e):e;i.children&&(i.children=this.appendDefaultData(i.children,t)),r.push(i)}return i?r:r[0]},viewToInternal(e,t,i=lab_api.v1.viewport.getEditable()){let a=!0,r=e;Array.isArray(e)||(a=!1,r=[e]);const s=[],o=["contentdata","metadata","children","width"];for(const e of r){const a=t?n.merge(t,e):e,r={width:{value:null,vp:{}}};a.width&&("object"==typeof a.width?r.width.vp=a.width:(r.width.value=a.width,a.metadata&&"object"==typeof a.metadata.width&&(r.width.vp=a.metadata.width)));for(const e in a)o.includes(e)||(r[e]=a[e]);a.children&&(r.children=this.viewToInternal(a.children,t)),a.contentdata&&(r.contentdata=this.backendToInternalNode(a.contentdata)),a.metadata&&(r.metadata=this.backendToInternalStructureMeta(a.metadata,i)),s.push(r)}return a?s:s[0]},backendToView(e,t=!1){const i=e.fields?{fields:e.fields}:null;i&&(i.type=e.type||null,i.tags=e.tags||void 0,i.instance_of=e.instance_of||null,i.apiResult=e.apiResult,t||(i.id=e.id||void 0));const a=e.width&&"object"==typeof e.width?e.width.value:e.width||null;return{type:e.type||null,metadata:e.metadata||{},width:a,contentdata:i,children:(e.children||[]).map(e=>this.backendToView(e,t))}},apiToData(e,t,i){const a={},r={...t.field||{}},{viewports_json:s}=r;delete r["@attributes"],delete r.viewports_json;for(const e of Object.keys(r))t.field[e]&&("object"==typeof r[e]&&0===Object.keys(r[e]).length?a[e]="":a[e]=r[e]);if(s)try{a.viewports_json=JSON.parse(s)}catch(e){Sys.logger.error(`[serializer] Failed to parse viewports_json: ${e.toString()}`)}return{type:e,id:i&&i.removeId?void 0:t.attribute.id,instance_of:t.attribute?t.attribute.instanceof_id:null,fields:a}},apiToInternal(e,t,i){const a=this.backendToInternalNode(F.apiToData(e,t));return i&&i.removeId&&delete a.id,a},backendToInternalNode(e){const t={...e},i={};if(t.fields&&t.fields.viewports_json)for(const e of Object.keys(t.fields.viewports_json))for(const i of Object.keys(t.fields.viewports_json[e].fields||{}))void 0===t.fields[i]&&(t.fields[i]=null);if(t.fields)for(const e of Object.keys(t.fields||{}))if(e.endsWith("_style_json")){const i=e.replace("_style_json","");t.fields[i]||(t.fields[i]=null)}for(const e of Object.keys(t.fields||{}))if(!e.endsWith("_style_json")&&"viewports_json"!==e){i[e]={value:t.fields[e],vp:this.getViewportKey(e,t.fields),attributes:{}};for(const a in t.fields[`${e}_style_json`]||{})void 0!==t.fields[`${e}_style_json`][a]&&(i[e].attributes[a]={value:t.fields[`${e}_style_json`][a],vp:{}});for(const a in t.fields.viewports_json||{})if(t.fields.viewports_json[a].fields&&void 0!==t.fields.viewports_json[a].fields[`${e}_style_json`])for(const r in t.fields.viewports_json[a].fields[`${e}_style_json`])void 0!==t.fields.viewports_json[a].fields[`${e}_style_json`]&&(i[e].attributes[r]||(i[e].attributes[r]={value:null,vp:{}}),i[e].attributes[r].vp[a]=t.fields.viewports_json[a].fields[`${e}_style_json`][r])}return t.fields=i,t},backendToInternalStructure(e,t){const i=e.metadata?this.backendToInternalStructureMeta(e.metadata,t):{},a={guid:e.id||A.create(),selector:e.selector||null,metadata:i,type:e.type||null,width:{value:e.width?x.floatPrecision(e.width):100,vp:i.width?i.width.vp:{}},children:[]};return delete a.metadata.width,a},backendToInternalStructureMeta(e,t){const i={};for(const a of Object.keys(e))if(i[a]={value:null,vp:{}},"object"!=typeof e[a]||Array.isArray(e[a]))i[a].value=e[a];else for(const r of Object.keys(e[a]||{}))t.includes(r)?i[a].vp[r]=e[a][r]:(i[a].value||(i[a].value={}),i[a].value[r]=e[a][r]);return i},internalToBackendStructureMeta(e){const t={};for(const i of Object.keys(e)){const a=e[i];let r=!1;for(const e of Object.keys(a.vp||{}))r=!0,t[i]||(t[i]={}),t[i][e]=a.vp[e];r||void 0===a.value||(t[i]=a.value)}return t},getViewportKey(e,t){const i={};if(!t.viewports_json)return i;for(const a in t.viewports_json)t.viewports_json[a].fields&&void 0!==t.viewports_json[a].fields[e]&&(i[a]=t.viewports_json[a].fields[e]);return i}
7,internalFieldToBackend(e,t,i){if(!t)return;const a=i;a[e]=t.value;for(const i of Object.keys(t.vp||{}))a.viewports_json||(a.viewports_json={}),a.viewports_json[i]||(a.viewports_json[i]={fields:{}}),a.viewports_json[i].fields[e]=t.vp[i];if(t.attributes){const i=`${e}_style_json`;for(const e of Object.keys(t.attributes)){void 0!==t.attributes[e].value&&(a[i]||(a[i]={}),a[i][e]=t.attributes[e].value);for(const r of Object.keys(t.attributes[e].vp||{}))a.viewports_json||(a.viewports_json={}),a.viewports_json[r]||(a.viewports_json[r]={fields:{}}),a.viewports_json[r].fields[i]||(a.viewports_json[r].fields[i]={}),a.viewports_json[r].fields[i][e]=t.attributes[e].vp[r]}}},filterModifiedContent(e,t){const i={fields:{}},a=e.getModifiedPaths(),r=e.data.contentdata.fields||{};for(const e of a)if(e.startsWith("fields.")){const t=e.replace("fields.",""),a=r[t];this.internalFieldToBackend(t,a,i.fields)}else e.startsWith("state.")||n.set(e,n.get(e,t),i);return i}};class O extends p{constructor(e,t,i,a,r,s=!1){super({entries:i,behaviours:a,debug:s}),this.configReader=e,this.resourceManager=t,this.models=[],this.cache={id:new Map,guid:new Map,fallback:new Map,fallbackItems:new Map},this.eventPipe={keyModified:this.keyModified.bind(this),childAdded:this.childAdded.bind(this)},this.fallbackReaderMethod=()=>{},this.cacheHandler=null}static validateViewInput(e={},t=[],{useExisting:i=!1,intermediateUseExisting:a=!0}={}){for(const i of t)if(!e[i])return null;if(!e.data)return null;if(!e.data.type)return null;const r={...e};return r.options={...r.options||{}},r.options.front=!1!==r.options.front,r.options.editor=!1!==r.options.editor,r.options.frontpage=!0===r.options.frontpage,r.options.articlepage=!0===r.options.articlepage,r.options.template=r.options.template||null,r.options.useExisting=void 0===r.options.useExisting?i:r.options.useExisting,r.options.intermediate=r.options.intermediate||{},r.options.intermediate.useExisting=void 0===r.options.intermediate.useExisting?a:r.options.intermediate.useExisting,r.options.persistentTarget=!!r.options.persistentTarget,r.options.internalFormat=!!r.options.internalFormat,r.options.append&&(r.options.append=o.object(r.options.append,{match:"",index:0})),r.options.prepend&&(r.options.prepend=o.object(r.options.prepend,{match:"",index:0})),r}setCacheHandler(e){this.cacheHandler=e}getModelsFromCache(){return Array.from(this.cache.guid.values())}getChildModels(e){const t=[],i=e=>{for(const t of e.children)i(t);t.push(e)};return i(e),t}getModels(){return this.models}getModelById(e){return this.cache.id.get(e)||null}getModelByGuid(e){return this.cache.guid.get(e)||null}getModelBySelector(e){for(const t of this.getModelsFromCache())if(t.getSelector()===e)return t;return null}getModelTypes(e){return e?[...new Set(this.getChildModels(e).map(e=>e.getType()))]:[...new Set(this.getModelsFromCache().map(e=>e.getType()))]}recursiveGetModelByAttribute(e,t,i){}getRootModel(){return this.models[0]}getParentNodeId(e){if(e.parent)return e.parent.hasNodeData()?e.parent.getId():this.getParentNodeId(e.parent);const t=this.getRootModel();return t===e?null:t.getId()}getModelByType(e,t=this.getModelsAsArray()){for(const i of t)if(i.getType()===e)return i;return null}getChildOfType(e,t,i=!1){const a=Array.isArray(t)?t:[t];for(const t of e.children)if(a.includes(t.getType()))return t;if(!i)return null;for(const i of e.children){const e=this.getChildOfType(i,t,!0);if(e)return e}return null}getChildrenOfType(e,t,i=!1,a=!1){const r=[],s=Array.isArray(t)?t:[t];for(const t of e.children)!s.includes(t.getType())||t.isNonPersistent()&&a||r.push(t);if(!i)return r;for(const i of e.children){const e=this.getChildrenOfType(i,t,!0,a);e&&r.push(...e)}return r}getModelsByKeyAndValue(e,t,i=this.getModelsAsArray()){return i.filter(i=>i.get(e)==t)}getModelsByPath(e,t=!0,i=!1,a=null){let r=[];const s=y.trim(e,"/").split("/");let n=s.shift();const o=y.parsePath(n).shift(),l=null!==o.index;l&&(n=o.base);let d=a;a||(d="*"===n?this.models:this.getModelsByType(n,this.models));const c=[];for(let e=0;e<d.length;
7e++)"*"!==n&&d[e].getType()!==n||d[e].isNonPersistent()&&!i||d[e].getNoRenderState()&&!i||c.push(d[e]);if(l?c[o.index]?r.push(c[o.index]):!t&&c.length&&(o.index>=c.length?r.push(c[c.length-1]):r.push(c[0])):r=c,!r.length)return[];if(s.length){let e=[];for(let a=0;a<r.length;a++)r[a].children.length&&(e=e.concat(this.getModelsByPath(s.join("/"),t,i,r[a].children)));return e}return r}getModelByPath(e,t=!0,i=!1,a=null){const r=this.getModelsByPath(e,t,i,a);return r.length?r[0]:null}getModelsByQuery(e="",t=this.getModelsAsArray()){const i=e.trim().toLowerCase();return t.filter(e=>e.getType().toLowerCase().indexOf(i)>-1)}getModelsByType(e,t=this.models,i=!0){const a=[];return t.forEach(t=>{Array.isArray(e)?e.includes(t.getType())&&a.push(t):t.getType()===e&&a.push(t),i&&a.push(...this.getModelsByType(e,t.children,i))}),a}getNextContentModel(e){let t=this.getRightSibling(e);if(t){const e=this.getFirstContentModel(t);if(e)return e}return e.getParent()&&(t=this.getNextContentModel(e.getParent()),t)?t:null}getParentOfType(e,t,i=!0){const a=e.getParent();return a?a.getType()===t?a:i?this.getParentOfType(a,t,!0):null:null}getLeftSibling(e){if(!e.getParent())return null;const t=e.getModelIndex(!0);return 0===t?null:e.getParent().getPersistentChildren()[t-1]||null}getRightSibling(e){if(!e.getParent())return null;const t=e.getModelIndex(!0),i=e.getParent().getPersistentChildren();return i[t+1]?i[t+1]:null}hasChildOfType(e,t,i=!1){return!!this.getChildOfType(e,t,i)}hasChildOfTypes(e,t,i=!1){for(const a of t)if(this.getChildOfType(e,a,i))return!0;return!1}hasChild(e,t){if(!e.children.length)return!1;for(const i of e.children){if(this.is(i,t))return!0;if(this.hasChild(i,t))return!0}return!1}hasParentOfType(e,t,i=!1){return!!this.getParentOfType(e,t,i)}hasParentOfTypes(e,t,i=!1){if(!e||!Array.isArray(t))return!1;for(const a of t)if(this.getParentOfType(e,a,i))return!0;return!1}hasParent(e,t){return!!e.parent&&(!!this.is(e.parent,t)||this.hasParent(e.parent,t))}getModelsAsArray(e=null){let t=[];for(const i of e||this.models)t=t.concat(this.getChildModels(i));return t}getIndex(e,t=!1){return e?e.getModelIndex(t):null}getPath(e,t=!1){return e?e.getPath(t):null}getArrayPath(e,t=!1){return e?e.getArrayPath(t):[]}resetCache(){this.cache.id.clear(),this.cache.guid.clear()}addToCache(e,t=!0){if(e.isPseudo())return;t&&e.children.forEach(e=>this.addToCache(e)),this.cache.guid.set(e.getGuid(),e);const i=e.getId();i&&this.cache.id.set(i,e)}setData(e=[],t=!0){this.resetCache(),this.models=this.newModels(e,!1)}newModels(e=[],t=!0){const i=[];for(const t of e){const e=this.newModel(t);e&&i.push(e)}return i}newModelInstance(e){return new D(e,this.eventPipe)}modelCreated(e){this.addToCache(e)}modelsAdded(e){}newModel(e,t=!0){const i=this.modelData(e);if(!i)return Sys.logger.warn("ModelController: Data do not validate. Cannot create new instance of LabModel."),null;const a=this.newModelInstance(i);if(e.children)for(const i of e.children){const e=this.newModel(i,t);e&&a.addChild(e,t)}return this.modelCreated(a),a}modelData(e){if(!e.type)return Sys.logger.warn('ModelController: Required attribute "type" is missing. Cannot create data for new LabModel.'),null;const t=e;let i="";t.path&&(i=`${y.trim(t.path,["/"])}/`);const a=this.configReader.get(`data.elements.${t.type}.fallbackData`);return{uncreated:!1,type:t.type,path:i,width:"width"in t?t.width:null,metadata:"metadata"in t?{...t.metadata}:{},state:"state"in t?{...t.state}:{},contentdata:"contentdata"in t&&t.contentdata?{...t.contentdata}:null,filtered:"filtered"in t&&t.filtered?{...t.filtered}:null,selector:"selector"in t?t.selector:null,external:"external"in t?t.external:null,guid:"guid"in t?t.guid:null,fallback:a?F.viewToInternal(a):null,fallbackReader:this.fallbackReaderMethod}}insertAtPath(e){const t=O.validateViewInput(e,["path"],{useExisting:!1});if(!t)return Sys.logger.warn('ModelController: Cannot insert model at path. Missing required input "path", "data", or "data.type".'),null;Sys.logger.debug(`ModelController: Will insert model of type ${t.data.type} at path ${t.path}.`);const i=this.ensurePath(t.path,t.options.persistentTarget,t.options.intermediate.useExisting);if(!i)return Sys.logger.warn(`ModelController: No model inserted at path ${t.path}. Parent not found and could not be created.`),null;const a=this.insertAtParent(i,t.data,t.options);return Sys.logger.debug(`ModelController: Did insert model at path ${t.path}. Type: ${a.getType()}, path: ${a.getPositionedPath()}.`),a}insertBySelector(e){const t=O.validateViewInput(e,["selector"],{useExisting:!1});if(!t)return Sys.logger.warn('ModelController: Cannot insert model by selector. Missing required input "selector", "data", or "data.type".'),null;Sys.logger.debug(`ModelController: Will insert model of type ${t.data.type} at selector ${t.selector}.`);const i=this.getModelBySelector(t.selector);if(!i)return Sys.logger.warn(`ModelController: No model inserted at selector ${t.selector}. Model not found.`),null;const a=this.insertAtParent(i,t.data,t.options);return Sys.logger.debug(`ModelController: Did insert model at selector ${t.selector}. Type: ${a.getType()}, path: ${a.getPositionedPath()}.`),a}insertAtParent(e,t,i={}){const a={};t.state&&t.state.isNonPersistent&&(a.state={isNonPersistent:!0});const r=this.newModel(i.internalFormat?F.appendDefaultData(t,a):F.viewToInternal(t,a));if(e)if("number"==typeof i.index){let{index:t}=i;if(i.persistentTarget){const a=i.match?this.getModelsByType(i.match,e.children||[],!1):e.children||[],r=a.filter(e=>
7!e.isNonPersistent()&&!e.getNoRenderState());t=t<0?0:t>=r.length?r.length?this.getIndex(r[r.length-1])+1:this.getIndex(a[a.length-1])+1:this.getIndex(r[t])}e.addChildAtIndex(r,t)}else e.addChild(r,!0,i.prepend);else i.prepend?this.models.unshift(r):this.models.push(r);return this.modelsAdded([r],i.silent),r}addElement(e){const t={};e.data.state&&e.data.state.isNonPersistent&&(t.state={isNonPersistent:!0});const i=this.ensurePath(e.path,e.options.persistentTarget,e.options.intermediate.useExisting,t);return i&&e.options.useExisting&&(e.data.selector?this.getModelBySelector(e.data.selector):this.getChildOfType(i,e.data.type))?null:this.insertAtParent(i,e.data,e.options)}allowInsetion(e){const t={frontpage:()=>"page_front"===lab_api.v1.model.query.getRootModel().getType(),articlepage:()=>"page_article"===lab_api.v1.model.query.getRootModel().getType(),noticepage:()=>"page_notice"===lab_api.v1.model.query.getRootModel().getType(),gallerypage:()=>"page_gallery"===lab_api.v1.model.query.getRootModel().getType(),template:e=>lab_api.v1.model.query.getRootModel().get("fields.page_template_alias")===e,front:lab_api.v1.app.mode.isFront,editor:lab_api.v1.app.mode.isEditor},i=i=>{for(const a of i)if(e.options[a]&&t[a](e.options[a]))return!0;return!1};return!!i(["front","editor"])&&!(e.options.template&&!i(["template"]))&&i(["frontpage","articlepage","noticepage","gallerypage"])}ensurePath(e,t,i=!0,a=null){const r=i?this.getModelsByPath(e,!0,!t).shift():null;if(r)return r;let s="",n=null;const o=y.parsePath(e);for(;o.length;){const e=o.shift();if(!e.base)return n;const r=e.index||0;let l=0,d=!1;const c=`${s}${e.base}[${r}]`;for(;l<=r;){if(!i&&!o.length&&l===r||!this.getModelsByPath(c,!0,!t).length){const t=a?{...a}:{};t.type=e.base;const i=this.newModel(t,!1);n?null!==e.index?n.addChildAtIndex(i,e.index):n.addChild(i):this.models.push(i),this.modelsAdded([i]),l===r&&(n=i,d=!0),Sys.logger.debug(`ModelController: Inserted intermediate model type ${e.base} at path ${i.getPositionedPath()}.`)}l++}s+=`${e.path}/`,n=d?n:this.getModelsByPath(s,!0,!t).shift()}return n}keyModified(e,t,i,a=!0){if(a){if(e.hasKeyInTarget(t))for(const a of e.getSourceTargets())this.keyModified(a,t,i,!1);e.hasSourceKey(t)&&this.keyModified(e.getSourceModel(),t,i)}this.cacheHandler.resetKey(e,t,i),this.triggerRedrawByKey(e,t,i)}childAdded(){}triggerRedrawByKey(e,t,i){}noRender(e){e&&e.setNoRenderState(!0)}notifyOnAcceptContent(e=this.getRootModel(),t=!0){this.emitBehaviour("onAcceptContent",e),t&&e.children.forEach(e=>{this.notifyOnAcceptContent(e,t)})}}class j{constructor(e){this.totalGridSpans=e||12,this.backendNodes=new Map,this.nodeChildren={},this.activeNodes=[],this.offstageTypes=["pasteboard"],this.requireContentdata=["article"]}backendToInternal(e={},t={}){if(!e.data||!e.structure)return Sys.logger.debug("[DataTransformer] Unsupported input data. Require { data: {...}, structure: []"),[];const i=e.data,a=e.structure;this.registerBackendNodes(i);const r=lab_api.v1.viewport.getEditable(),s=F.backendToInternal({contentdata:this.backendNodes.get(i.id),structure:{type:`page_${i.type}`}},r,!1),n=[s];for(const e of a)if(t.skipOffstage&&this.offstageTypes.includes(e.type))Sys.logger.debug(`[DataTransformer] Skipping offstage-element "${e.type}".`);else{const i=this.createModelData(e,t.blacklist||[],t.blacklistOptions||{},r);i&&(this.offstageTypes.includes(e.type)?n.push(i):s.children.push(i))}return this.activeNodes.push(i.id),n}modelsToFragmentApi(e,{viewport:t=null,stringify:i=!1,recursive:a=!0}={}){const r=e.map(e=>this.modelToFragmentApi(e,a,t));return i?r.map(e=>JSON.stringify(e)):r}modelToFragmentApi(e,t,i){const a={nodedata:this.modelToBackend(e,t),isNonPersistent:e.isNonPersistent(),type:e.getType(),width:e.getWidth(i),id:e.getGuid(),node_id:e.getId(),guid:e.getGuid()};if(t){a.children=[];for(const t of e.children)a.children.push(this.modelToFragmentApi(t))}return a}modelToBackend(e,t=!1){let i;const a=e.getSerializedCache();if(a?(lab_api.v1.app.dbg.logger.add(e.constructor.name,"modelToBackend[cache]"),i=a):(lab_api.v1.app.dbg.logger.add(e.constructor.name,"modelToBackend"),i=e.data.contentdata?{...F.internalToBackend(e.data.contentdata)}:{},e.data.contentdata&&(i.parent=lab_api.v1.model.query.getParentNodeId(e)),i.guid=e.data.guid,i.metadata=F.internalToBackendStructureMeta(e.data.metadata),i.metadata.width=e.getViewportWidths(),i.width=e.getWidth(),e.data.selector&&(i.selector=e.data.selector),i.type=e.data.type.replace("page_",""),e.data.tmpId&&(i.tmpId=e.data.tmpId),e.setSerializedCache({...i})),t&&e.children.length){i.children=[];
7for(const t of e.children)t.isNonPersistent()||i.children.push(this.modelToBackend(t,!0))}return i}apiToInternal({type:e,data:t={},meta:i={},options:a={removeId:!1}}={}){const r=F.apiToInternal(e,t,a),{metadata:s,width:n}=F.viewToInternal({metadata:i,width:i.width});return{type:r.type,contentdata:r,width:n,metadata:s}}apiToView({type:e,data:t={},meta:i={},options:a={removeId:!1},useInternalFormat:r=!1}={}){const s=F.apiToData(e,t,a),n=r?s:F.internalToBackend(s);return{type:n.type,contentdata:n,width:i.width,metadata:i}}modelToInternal(e,t=!0,i=!1){const a=JSON.parse(JSON.stringify(e.data));if(i&&(a.contentdata&&delete a.contentdata.id,delete a.guid),a.children=[],!t)return a;for(const t of e.children)a.children.push(this.modelToInternal(t,!0,i));return a}modelToView(e,t=!0,i=!1){const a=this.modelToBackend(e,t);return F.backendToView(a,i)}modelsToView(e,t=!0){return e.map(e=>this.modelToView(e,t))}modifiedToBackend(e,t,i=!0,a=!1){const r=[];for(const e of t)e.getType().startsWith("page_")?r.push(...e.getPersistentChildren()):r.push(e);const s=this.removeFrontCrops(r);return{node:e.map(e=>this.modelNodeToBackend(e,i,a)),structure:s.map(e=>this.modelStructureToBackend(e))}}removeFrontCrops(e){return e.filter(e=>!e.get("fields.metadata_key"))}modelNodeToBackend(e,t=!1,i=!1){const a=this.modelToBackend(e,i);if(t&&!e.isDirty()){const t=F.filterModifiedContent(e,a),i=this.modelNodeBaseToBackend(e);return n.merge(i,t)}return delete a.metadata,delete a.width,a}modelNodeBaseToBackend(e){if(Array.isArray(e))return e.map(e=>this.modelNodeBaseToBackend(e));const t=this.modelToBackend(e),i={type:t.type||null,id:t.id||null,guid:t.guid||null,tmpId:t.tmpId||null,instance_of:t.instance_of||null,parent:t.parent||null,status:t.status||null,site_id:t.site_id||null};return t.primaryTags&&(i.primaryTags=t.primaryTags),t.tags&&(i.tags=t.tags),i}modelStructureToBackend(e,t=!1){const i=this.modelToBackend(e),a={type:i.type,width:i.width,metadata:i.metadata,id:i.guid,selector:i.selector,children:[]};return i.id&&(a.node_id=i.id),e.isNonPersistent()&&(a.isNonPersistent=!0),e.children.forEach(e=>{!t&&e.isNonPersistent()||a.children.push(this.modelStructureToBackend(e,t))}),a}registerBackendNodes(e){if(e.id&&this.backendNodes.set(e.id,this.prepareBackendNode(e)),e.children){this.nodeChildren[e.id]=[];for(const t of e.children)this.registerBackendNodes(t),t.id&&this.nodeChildren[e.id].push(t.id)}}prepareBackendNode(e){const t={};for(const i in e)"children"!==i&&(t[i]=e[i]);return t}createModelData(e,t,i,a,r={}){if(t.includes(e.type)){if(i[e.type]&&i[e.type].includeChildren&&e.children&&r.children){Sys.logger.warn(`[DataTransformer] Found blacklisted element "${e.type}". Skipping. Will include and move children to parent element.`);for(const s of e.children){const e=this.createModelData(s,t,i,a);e&&r.children.push(e)}}else Sys.logger.warn(`[DataTransformer] Found blacklisted element "${e.type}". Skipping.`);return null}const s=F.backendToInternal({contentdata:e.node_id?this.backendNodes.get(e.node_id):null,structure:e},a,!1);if(this.requireContentdata.includes(s.type)&&!s.contentdata)return Sys.logger.debug(`[DataTransformer] Found "${s.type}" without node-data. Skipping.`),null;s.contentdata&&this.activeNodes.push(s.contentdata.id);for(const t in s.width.vp)s.width.vp[t]?s.width.vp[t]&&s.width.vp[t]<=this.totalGridSpans&&Number.isInteger(parseFloat(s.width.vp[t],10))&&(Sys.logger.warn(`[DataTransformer] Will modify Lab3-width for element "${e.type}", viewport "${t}". Was: "${s.width.vp[t]}", New value: "${x.gridToPercent(s.width.vp[t],this.totalGridSpans)}"`),s.width.vp[t]=x.gridToPercent(s.width.vp[t],this.totalGridSpans)):delete s.width.vp[t];if(!e.children){if(!(s.contentdata&&s.contentdata.id&&this.nodeChildren[s.contentdata.id]))return s;e.children=[];for(const t of this.nodeChildren[s.contentdata.id])if(!this.activeNodes.includes(t)){const i=this.backendNodes.get(t);i&&(e.children.push({type:i.type,node_id:t}),Sys.logger.warn(`[DataTransformer] Adding structure-data for deprecated node-child. Type: ${i.type}, id: ${t}`))}}for(const r of e.children){const e=this.createModelData(r,t,i,a,s);e&&s.children.push(e)}return s}}class R{constructor(e,t,i){this.renderer=t,this.log=i,this.styles={definitions:new Map,collections:new Map},this.setupStyles(R.resolveConfig(e||{})),this.styleByKey={},this.defaultItemTemplate="{{ #items }}{{ prefix }}{{ value }}{{ postfix }} {{ /items }}"}
7static resolveConfig(e={}){const t={definitions:{},collections:[]};for(const i of Object.keys(e.definitions||{})){const a=R.resolveDefinition(e.definitions[i]);a&&(t.definitions[i]=a)}const i=Array.isArray(e.collections)?e.collections:Object.values(e.collections||{});for(const e of i){const i=R.resolveCollection(e);i&&t.collections.push(i)}return t}static resolveDefinition(e={}){if(!Array.isArray(e.items)||!e.items.length)return null;const t={requirePath:o.false(e.requirePath),path:o.string(e.path),template:o.stringOrNull(e.template),items:[]};for(const i of e.items){const e=R.resolveItem(i);e&&t.items.push(e)}return t}static resolveItem(e={}){const t=Array.isArray(e.fallback)?e.fallback:[];return"string"==typeof e.fallback&&t.push(e.fallback),{prefix:o.string(e.prefix),postfix:o.string(e.postfix),viewport:o.string(e.viewport),value:o.string(e.value),fallback:t,nullValue:o.stringOrUndefined(e.nullValue)}}static resolveCollection(e){const t=o.string(e.name),i=o.array(e.definitions),a=o.array(e.additions);if(!t||!i.length&&!a.length)return null;const r=[];for(const e of[...i,...a])if("string"==typeof e)r.includes(e)||r.push(e);else{const t=R.resolveDefinition(e);t&&r.push(t)}return{name:t,definitions:r}}setupStyles(e={}){for(const t of Object.keys(e.definitions))this.styles.definitions.set(t,e.definitions[t]);for(const t of e.collections)this.styles.collections.set(t.name,t.definitions);this.log.debug(`StyleManager: Set up and ready. Holds ${this.styles.definitions.size} definitions and ${this.styles.collections.size} collections.`)}getStyleFromDefinition(e,t,i="",a){if(!this.styles.definitions.size)return"";const{name:r,path:s,target:n,targetType:o,index:l}=this.getInputValues(i),d=this.getTargetModel(e,n,o,l);return d?this.getStyleFromDefinitionNamePath(d,r,s,null,a):""}getStyleFromDefinitionNamePath(e,t,i,a,r){const s=this.getDefinition(t);return s?this.parseDefinition(e,t,i,s,a,r):(this.log.warn(`StyleManager: Cannot find style-definition "${t}". Empty string returned.`),"")}getStyle(e,t,i="",a){if(!this.styles.collections.size)return"";const{name:r,path:s,target:n,targetType:o,index:l}=this.getInputValues(i),d=this.getTargetModel(e,n,o,l);if(!d)return this.log.warn(`StyleManager: Cannot find target-model "${n}". Empty string returned. Model: ${e.getPositionedPath()}`),"";const c=this.getCollection(r);if(!c)return this.log.warn(`StyleManager: Cannot find style-collection "${r}". Empty string returned.`),"";const g=[];for(const e of c){const t=this.parseDefinition(d,r,s,e,null,a);t&&g.push(t)}return g.join(" ").trim()}getCollection(e){return this.styles.collections.get(e)}getDefinition(e){return this.styles.definitions.get(e)}getTargetModel(e,t,i,a){return"current"===t?e:"parent"===t?e.getParent():"root"===t?lab_api.v1.model.query.getRootModel():"child"===t?null===a?lab_api.v1.model.query.getChildOfType(e,i):lab_api.v1.model.query.getModelsByType(i,e.children)[a]||null:e}getInputValues(e=""){const t=(e||"").split(" ").map(e=>e.trim()).filter(e=>!!e),i=t.shift();let a=t.shift()||"",r="current",s=null,n=null;if(a.startsWith("parent."))r="parent",a=a.replace("parent.","");else if(a.startsWith("root."))r="root",a=a.replace("root.","");else if(a.startsWith("current."))a=a.replace("current.","");else if(a.startsWith("child.")){const e=a.split(".");r=e.shift();const t=e.shift();a=e.join("."),[n,s]=C.getPropertyTypeAndIndex(t)}return{name:i,path:a||null,target:r,targetType:n,index:s}}getItemsViewports(e){const t={};for(const i of e)if(i.viewport&&(t[i.viewport]=!0),i.fallback)for(const e of i.fallback)t[e]=!0;return Object.keys(t)}parseDefinition(e,t,i,a,r,s){let n=a;if("string"==typeof a&&(n=this.getDefinition(a),!n))return this.log.warn(`StyleManager: Cannot find style-definition "${a}". Empty string returned.`),"";const o=[];if(n.requirePath&&!i)return this.log.warn(`StyleManager: Missing required path for style "${t}".`),"";const l=n.requirePath?i:"";for(const t of n.items){const i=this.getItemValueWithFallback(e,n.path,t,l,n.items,r,s);null!=i&&""!==i&&o.push({...t,value:i})}return o.length?this.renderer(n.template||this.defaultItemTemplate,{items:o}).trim().split(" ").filter((e,t,i)=>i.indexOf(e)===t).join(" "):""}getItemValueWithFallback(e,t,i,a,r,s,n){const o=a+(a&&t?".":"")+t,l=this.getItemV
7alue(e,i,o,s,n);if(void 0!==l||"current_viewport"===i.viewport)return l;const d={...i};for(d.fallback=[...d.fallback];d.fallback.length;){const t=d.fallback.shift();d.viewport=t;const i=this.getItemValue(e,d,o,s,n);if(i)return i}}getItemValue(e,t,i,a,r){let s,{viewport:n}=t;return"no_viewport"===n?n="":"current_viewport"===n&&(n=r),s=a?n?(a.vp||{})[n]:a.value:e.get(i,n,!0),null!==s&&""!==s&&!1!==s||void 0===t.nullValue?s&&t.value?t.value:s:t.nullValue}}class L{constructor(e){this.headers=e.Headers||{},this.queryString=e.queryString||"",this.params=this.parseQueryString(this.queryString)}parseQueryString(e){const t={},i=e.split("&");for(const e of i){const i=e.split("=");2===i.length&&(t[i[0]]=i[1])}return t}getHeaders(){return this.headers}getHeader(e){return this.headers[e]||null}getQueryString(){return this.queryString}getQueryParam(e){if("lab_opts"===e){const t=this.params[e];return void 0!==t?t:this.getHeader("X-Ua-Lab-Opts")||void 0}return this.params[e]}hasQueryParam(e){return void 0!==this.getQueryParam(e)}hasQueryValue(e,t){return(this.getQueryParam(e)||"").split(",").includes(t)}}class E{constructor(e,t){this.logger=t,this.siteAlias=e,this.log(`Site-alias: ${this.siteAlias}`),this.featureFlags=[],this.cache={}}prepareFlags(e){const t=[];return Array.isArray(e)&&e.forEach(e=>{if("group"===e.type){const i=e.enabled;e.flags.forEach(e=>{e.enabled=i&&e.enabled,t.push(e)})}else t.push(e)}),this.cache[this.siteAlias]=t,t}enabled(e,t=""){return this.featureFlags=this.cache[this.siteAlias]||this.prepareFlags(lab_api.v1.config.getFeatureFlags().flags||[]),this.featureFlags.filter(i=>{if(Array.isArray(t)){const a=t.map(String);return i.key===e&&(!i.nodeId||a.indexOf(i.nodeId)>-1)&&!0===i.enabled}return i.key===e&&(!i.nodeId||i.nodeId===t.toString())&&!0===i.enabled}).length>0}get(e,t=""){return this.featureFlags.filter(i=>i.key===e&&i.nodeId===t.toString())}log(e,t=null){this.logger&&(t?this.logger.debug(`FeatureFlags: ${e}`,[t]):this.logger.debug(`FeatureFlags: ${e}`))}}class B{static getWords(e){return e.replaceAll("."," ").replaceAll("!"," ").split(" ").filter(e=>""!==e)}static getSentences(e){return e.replaceAll("!",".").split(".").filter(e=>""!==e)}static getReadTime(e,t){const i=B.getWords(e).length/(t||250);return i<.5?.5:Math.round(i)}static lix(e){if(!e)return null;const t=B.getWords(e),i=B.getSentences(e),a=t.filter(e=>e.length>6);return t.length/i.length+100*a.length/t.length}}class U{constructor(){this.ns={},this.customEvents=new p}create(e={}){return{customEvents:{off:this.customEvents.off.bind(this.customEvents),on:this.customEvents.on.bind(this.customEvents),emitEvent:this.customEvents.emitEvent.bind(this.customEvents)},app:{dbg:{logger:{add:()=>{}}},logError:(e={})=>{e&&e.toString&&Sys.logger.debug(`CMS-error: ${e.toString()}`)},logViewError:(e={},t)=>{e&&e.toString&&Sys.logger.debug(`View-error: ${e.toString()}`)},mode:{get:e.configProcessor.getAppMode.bind(e.configProcessor),getSimulatedMode:e.configProcessor.getSimulatedMode.bind(e.configProcessor),isEditor:e.configProcessor.isEditMode.bind(e.configProcessor),isFragmentMode:e.configProcessor.isFragmentMode.bind(e.configProcessor),isFront:e.configProcessor.isPresentationMode.bind(e.configProcessor)},off:e.appManager.off.bind(e.appManager),on:e.appManager.on.bind(e.appManager)},config:{debug:e.configReader.debug.bind(e.configReader),get:e.configReader.get.bind(e.configReader),getConfig:e.configReader.getConfig.bind(e.configReader),getContent:e.configReader.getContent.bind(e.configReader),getFeatureFlags:e.configReader.getFeatureFlags.bind(e.configReader),getPathForSite:e.configReader.getPathForSite.bind(e.configReader),getStorePathForSite:e.configReader.getStorePathForSite.bind(e.configReader),getView:e.configReader.getView.bind(e.configReader),reloadResourceBySite:e.configReader.reloadResourceBySite.bind(e.configReader)},grid:{gridToPercent:x.gridToPercent,percentToGrid:x.percentToGrid},image:{getPreferredImageFormat:e.configProcessor.getPreferredImageFormat.bind(e.configProcessor)},locale:{get:e.localisation.get.bind(e.localisation),off:e.localisation.off.bind(e.localisation),on:e.localisation.on.bind(e.localisation)},model:{getArrayPath:e.modelController.getArrayPath,getPageType:e.configProcessor.getPageType.bind(e.configProcessor),getPath:e.modelController.getPath,insert:{atPath:e.modelController.insertAtPath.bind(e.modelController),bySelector:e.modelController.insertBySelector.bind(e.modelController)},noRender:e.modelController.noRender,off:e.modelController.off.bind(e.modelController),on:e.modelController.on.bind(e.modelController),query:{getChildOfType:e.modelController.getChildOfType.bind(e.modelController),getChildrenOfType:e.modelController.getChildrenOfType.bind(e.modelController),getIndex:e.modelController.getIndex.bind(e.modelController),getModelByGuid:e.modelController.getModelByGuid.bind(e.modelController),getModelById:e.modelController.getModelById.bind(e.modelController),getModelByPath:e.modelController.getModelByPath.bind(e.modelController),getModelBySelector:e.modelController.getModelBySelector.bind(e.modelController),getModelByType:e.modelController.getModelByType.bind(e.modelController),getModels:e.modelController.getModels.bind(e.modelController),getModelsAsArray:e.modelController.getModelsAsArray.bind(e.modelController),getModelsByKeyAndValue:e.modelController.getModelsByKeyAndValue.bind(e.modelController),getModelsByPath:e.modelController.getModelsByPath.bind(e.modelController),getModelsByQuery:e.modelController.getModelsByQuery.bind(e.modelController),getModelsByType:e.modelController.getModelsByType.bind(e.modelController),getModelsFromCache:e.modelController.getModelsFromCache.bind(e.modelController),getModelTypes:e.modelController.getModelTypes.bind(e.modelController),getNextContentModel:e.modelController.getNextContentModel.bind(e.modelController),getParentNodeId:e.modelController.getParentNodeId.bind(e.modelController),getParentOfType:e.modelController.getParentOfType.bind(e.modelController),getRootModel:e.modelController.getRootModel.bind(e.modelController),getSiblingLeft:e.modelController.getLeftSibling.bind(e.modelController),getSiblingRight:e.modelController.getRightSibling.bind(e.modelController),hasChild:e.modelController.hasChild.bind(e.modelController),hasChildOfType:e.modelController.hasChildOfType.bind(e.modelController),hasChildOfTypes:e.modelController.hasChildOfTypes.bind(e.modelController),hasParent:e.modelController.hasParent.bind(e.modelController),hasParentOfType:e.modelController.hasParentOfType.bind(e.modelController),hasParentOfTypes:e.modelController.hasParentOfTypes.bind(e.modelController)},root:{getType:()=>e.modelController.getRootModel()?e.modelController.getRootModel().get("type"):""},serialize:{apiToInternal:e.dataTransformer.apiToInternal.bind(e.dataTransformer),apiToView:e.dataTransformer.apiToView.bind(e.dataTransformer),model:e.dataTransformer.modelToBackend.bind(e.dataTransformer),modelToInternal:e.dataTransformer.modelToInternal.bind(e.dataTransformer),modelToView:e.dataTransformer.modelToView.bind(e.dataTransformer)}},ns:{get:(e="")=>n.get(e,this.ns),set:(e,t)=>n.set(e,t,this.ns)},preload:{get:e.preloadHandler.get.bind(e.preloadHandler),getHeader:e.preloadHandler.getHeader.bind(e.preloadHandler)},properties:{get:e.configReader.getCms.bind(e.configReader),update:e.configReader.updateConfigByPath.bind(e.configReader)},templates:{get:e.resourceManager.getTemplateFile.bind(e.resourceManager)},site:{getSite:e.configProcessor.getSite.bind(e.configProcessor),getSiteById:e.configProcessor.getSiteById.bind(e.configProcessor),getSites:e.configProcessor.getSites.bind(e.configProcessor)},style:{getNamedStyle:e.styleManager.getStyleFromDefinitionNamePath.bind(e.styleManager),getStyle:e.styleManager.getStyleFromDefinition.bind(e.styleManager),getStyles:e.styleManager.getStyle.bind(e.styleManager)},util:{defaults:e.utils.defaults,featureFlags:{enabled:e.featureFlags.enabled.bind(e.featureFlags),get:e.featureFlags.get.bind(e.featureFlags)},functionHelper:{getFunction:e.utils.functionHelper.getFunction,isValidFunction:e.utils.functionHelper.isValidFunction},object:n,request:{getHeader:e.requestUtil.getHeader.bind(e.requestUtil),getHeaders:e.requestUtil.getHeaders.bind(e.requestUtil),getQueryParam:e.requestUtil.getQueryParam.bind(e.requestUtil),getQueryString:e.requestUtil.getQueryString.bind(e.requestUtil),hasQueryParam:e.requestUtil.hasQueryParam.bind(e.requestUtil),hasQueryValue:e.requestUtil.hasQueryValue.bind(e.requestUtil),parseQueryString:e.requestUtil.parseQueryString.bind(e.requestUtil)},string:e.utils.stringHelper},view:{getHelper:e.viewManager?e.viewManager.getViewHelper.bind(e.viewManager):()=>{},getPixelDensityFactor:e.configProcessor.getPixelDensityFactor.bind(e.configProcessor),getView:e.viewManager?e.viewManager.getView.bind(e.viewManager):null,off:e.viewManager?e.viewManager.off.bind(e.viewManager):null,on:e.viewManager?e.viewManager.on.bind(e.viewManager):null,render:({template:t,model:i,viewManager:a=e.viewManager}={})=>{const r=a.getView(i),s=a.getDataForView(i,r);return Mustache.render(t,s,e.resourceManager.templates)}},viewHeaders:{get:t=>e.viewHeaders.get?e.viewHeaders.get(t):"",getAll:()=>e.viewHeaders.getAll?e.viewHeaders.getAll():"",set:(t,i)=>{e.viewHeaders.set&&e.viewHeaders.set(t,i)}},viewport:{getActive:()=>[e.configProcessor.getViewport()],getAll:e.configProcessor.getViewports.bind(e.configProcessor),getEditable:e.configProcessor.getEditableViewports.bind(e.configProcessor),getMain:e.configProcessor.getMainViewport.bind(e.configProcessor),getName:e.configProcessor.getViewport.bind(e.configProcessor),getSubViewports:e.configProcessor.getSubViewports.bind(e.configProcessor),getWidth:e.configProcessor.getViewportWidth.bind(e.configProcessor),isMain:e.configProcessor.isMainViewport.bind(e.configProcessor),isSubViewport:e.configProcessor.isSubViewport.bind(e.configProcessor),isTouchDevice:e.configProcessor.isTouchDevice.bind(e.configProcessor)},text:{getWords:B.getWords,getSentences:B.getSentences,getReadTime:B.getReadTime,lix:B.lix}}}}class H{constructor(e=[]){this.viewManagers=e,Sys.logger.debug(`CacheHandler: Ready to support view-manager(s) for viewport(s): ${this.viewManagers.map(e=>e.viewport.name).join(", ")}`)}setViewManagers(e){this.viewManagers=e}resetKey(e,t,i){this.resetModelCacheForKey(e,t,i),this.resetViewCacheForKey(e,t)}resetModelCacheForKey(e,t,i){e.cache.getter.delete(e.getCacheKey(t,i)),e.cache.getter.delete(e.getCacheKey(t,i,!0)),e.cache.getter.forEach((a,r)=>
7{(r.startsWith(`${t}.`)||r.startsWith(`${t}-`))&&r.endsWith(`-${i||"lab_main"}`)&&e.cache.getter.delete(r)})}resetViewCacheForKey(e,t){for(const i of this.viewManagers)i.getView(e).resetCache(t)}}class q{constructor(e,t=null){this.isEnabled=!0,this.Implementation=e,this.instance=null,this.name=t}initialize(){this.instance=new this.Implementation}disable(){this.isEnabled=!1}enable(){this.isEnabled=!0}call(e,...t){if(this.isEnabled){if(!this.instance){if(!this.Implementation)return;this.initialize(),this.instance.name&&(this.name=this.instance.name)}if(e in this.instance)return this.instance[e](...t)||null}}}class V extends q{}class N extends q{initialize(){this.instance=new this.Implementation(lab_api)}}class W{constructor(e){this.data=e}get(e=""){const t=e.split("."),i=this.getObject(t.shift());return i?t.length?n.get(t.join("."),i):i:null}getObject(e){return e?this.data[e]||null:this.data}getHeader(e){if(e){const t=this.getObject(e);return t?t.responseHeaders:null}return null}}class z extends p{constructor({configReader:e,language:t,siteAlias:i,renderFn:a,configPrefix:r}){super(),this.configReader=e,this.language=t||this.configReader.get("contentLanguage")||"en-GB",this.secondaryLanguage=this.configReader.get("contentLanguageFallback")||this.language,this.siteAlias=i||this.configReader.siteAlias,this.fallbackLanguage="en-GB",this.renderFn=a,this.objectHelper=n,this.configPrefix=r||"int_",this.cache=new Map}overrideLanguage(e){e&&(this.secondaryLanguage===this.language&&(this.secondaryLanguage=e),this.language=e)}get(e,{language:t,siteAlias:i,data:a={},fallbackValue:r,noRender:s=!1}={}){const n=(e||"").trim(),o=a||{},l=t||this.language,d=`${n}_${l}_${i}_${JSON.stringify(o||{})}_${s?"1":"0"}`;return this.cache.has(d)||this.cache.set(d,this.getKey(n,l,i,o,s,r)),this.cache.get(d)}getKey(e,t,i,a,r,s){const n=this.readConfigObject(e,i,t);if(n)return this.returnValue(e,n,a,t,i,"config",r);const o=this.readConfig(e,t,i);return o?this.returnValue(e,o,a,t,i,"configObject",r):t!==this.fallbackLanguage&&t!==this.secondaryLanguage&&this.secondaryLanguage!==this.language?this.getKey(e,this.secondaryLanguage,i,a,r,s):t!==this.fallbackLanguage?this.getKey(e,this.fallbackLanguage,i,a,r,s):void 0===s?e:s}returnValue(e,t,i,a,r,s,n){const o={value:t,data:i},l=this.requestEvent("localisation",{key:e,value:t,data:i,language:a,siteAlias:r,type:s});if(l.length){const e=l.pop();"string"==typeof e.value&&(o.value=e.value,o.data=e.data)}return o.value?n?o.value:this.renderFn(o.value,o.data).trim():e}readConfig(e,t,i){const a=this.configReader.getConfig(`${this.configPrefix}${t}.${e}`,{site:i});return"string"==typeof a?a:void 0}readConfigObject(e,t,i){const a=t||this.siteAlias,r=i||this.language,s=this.configReader.getLocal(`lang.${a}.${r}.${e}`);return"string"==typeof s?s:void 0}}class G extends p{constructor({logger:e={},settings:{siteAlias:t="default",siteUuid:i=null,pageType:a="front",contentId:r=null,device:n="desktop",runtime:o={Request:!1},transform:l,fragmentMode:g=null,debug:p=!1,simulatedMode:u=""},resources:{config:m={},templates:b={view:{},editor:{}},properties:y={},data:v=null,preload:w={},viewHeaders:_={},views:k=[]},globals:x={},callbacks:P={},entries:S=[],behaviours:T={}}={}){super({entries:S.map(e=>new V(e)),behaviours:Object.keys(T).reduce((e,t)=>({...e,[t]:T[t].map(e=>new N(e,t))}),{}),debug:p}),this.settings={debug:p,fragmentMode:g,simulatedMode:u,pageType:a,contentId:r,siteAlias:t,siteUuid:i,device:n,request:o.Request,transform:void 0===l||!!l},this.resources={properties:y,data:v,templates:b?b.view:{},viewHeaders:_},this.logger=e,this.settings.fragmentMode&&this.logger.debug(`[Core] Running fragmentMode: "${g}"`),this.configReader=new d(d.resolveFullConfig(m,s),this.logger),this.configProcessor=new c(this.configReader,this.settings.device,this.settings.fragmentMode,this.settings.pageType,this.settings.simulatedMode),this.logger.debug("---------------------------------------------------------"),this.logger.debug("[Core] Labrador rendering engine"),this.logger.debug(`Version ${this.configReader.getCms("app.version")} - build ${this.configReader.getCms("buildInfo.version")} - views: ${k.join(", ")}`),this.logger.debug("(c) Labrador CMS AS. Use require a valid licence"),this.logger.debug("---------------------------------------------------------"),this.localisation=new z({configReader:this.configReader,renderFn:Mustache.render}),this.viewManager=null,this.pathHelper=new C,this.resourceManager=new h(this.resources.properties,this.resources.templates,this.configReader,f.resolve
7Config,this.behaviours,this.pathHelper,this.settings.debug),this.dataTransformer=new j(this.configReader.get("grid.total_grid_spans")),this.modelController=new O(this.configReader,this.resourceManager,this.entries,this.behaviours),this.styleManager=new R(this.configReader.get("style"),Mustache.render,this.logger),this.preloadHandler=new W(w),this.viewManager=new $({resourceManager:this.resourceManager,configReader:this.configReader,configProcessor:this.configProcessor,logger:this.logger,viewport:this.settings.device,styleManager:this.styleManager,entries:this.entries,behaviours:this.behaviours,settings:this.settings,localisation:this.localisation,preloadHandler:this.preloadHandler}),this.api={v1:this.createApi()},x.lab_api=this.api,P.apiReady&&P.apiReady(this.api.v1),this.apiReady(this.api),this.resources.data&&this.setData(this.resources.data)}getApi(){return this.api}createApi(){this.logger.debug("Core: Creating api using CoreApi.");const e=new U,t={appManager:this,configReader:this.configReader,configProcessor:this.configProcessor,modelController:this.modelController,viewManager:this.viewManager,styleManager:this.styleManager,dataTransformer:this.dataTransformer,utils:r,requestUtil:new L(this.settings.request),featureFlags:new E(this.settings.siteAlias,this.logger),preloadHandler:this.preloadHandler,viewHeaders:this.resources.viewHeaders,localisation:this.localisation,resourceManager:this.resourceManager};return e.create(t)}getAllLogs(){return{front:this.getLogs(),view:this.viewManager.getLogs(),resource:this.resourceManager.getLogs(),model:this.modelController.getLogs()}}setSite(e){this.configReader.updateConfigByPath("site",e),this.configReader.getCms("site",{noCache:!0}),this.configProcessor.resetCache()}apiReady(e){this.logger.debug("Core: Api ready."),this.viewManager.apiReady(e),this.modelController.setCacheHandler(new H([this.viewManager])),this.onReady(e)}onReady(e){this.emitEntry("onReady",e)}setData(e){if(!e||!this.settings.transform&&!Array.isArray(e)||this.settings.transform&&!e.data)throw new Error("[Core] Cannot set data. Invalid input. "+(this.settings.transform?"Expecting property data, none given.":`Expecting an array, ${typeof e} given.`));this.viewManager.viewMap.clear();const t=this.settings.transform?this.dataTransformer.backendToInternal(e,{blacklist:this.configReader.get("data.blacklist")||[],skipOffstage:!0}):e;let i=null;const a=this.emitEntry("onDataReady",t);a.length&&(this.logger.warn("[Core] Entry-hook 'onDataReady' has modifyed input-data."),i=a.pop()),this.modelController.setData(i||t),this.resourceManager.rootModelReady(this.modelController.getRootModel()),this.localisation.overrideLanguage(this.modelController.getRootModel().get("fields.seolanguage")),this.modelController.notifyOnAcceptContent(),this.emitEntry("onAcceptContent"),this.emitEvent("acceptContent")}serializeView(e=this.modelController.models){return this.dataTransformer.modelsToView(e)}serializeForFragmentApi(e=this.modelController.models,{device:t=this.settings.device,stringify:i=!0,recursive:a=!0}={}){return this.dataTransformer.modelsToFragmentApi(e,{device:t,stringify:i,recursive:a})}render(e,{transform:t}={}){return new Promise((i,a)=>{void 0!==t&&(this.settings.transform=!!t),this.setData(e),i(this.draw())})}draw(e){return this.viewManager.draw(this.modelController.models,t=>{e&&e(t)})}getMarkup(e){if(!e)return this.logger.warn("Core: No model supplied. Will return empty string."),"";const t=this.viewManager.getView(e);return t?t.getMarkupString()||"":(this.logger.warn(`Core: Cannot get view for model ${e.getPositionedPath()}. Will return empty string.`),"")}}},
7"./public/common/labrador/Mapper.js":(e,t,i)=>{i.r(t),i.d(t,{Mapper:()=>o});var a=i("./public/common/labrador/ClientData.js"),r=i("./public/common/labrador/transformers/source/LabradorApi.js"),s=i("./public/common/labrador/transformers/source/DachserJson.js"),n=i("./public/common/labrador/transformers/source/KilkayaStreams.js");class o{constructor({source:e,image_server:t,mapperSettings:i={},settings:a={useEditorProxy:!1}}={}){this.source=e,this.useEditorProxy=a.useEditorProxy,this.image_server=t,this.mapperSettings=i}map(e){const t=new a.ClientData;switch(this.source){case"LabradorApi":return this.mapLabradorApi(e,t);case"DachserJson":return this.mapDachserJson(e,t);case"KilkayaStreams":return this.mapKilkayaStreams(e,t);default:return console.warn(`[Mapper] Unsupported source ${this.source}`),[]}}mapLabradorApi(e,t){const i=this.resolveProxy(e);if(!i||!i.result||!i.result.length)return t;const a=new r.LabradorApi(this.mapperSettings);return t.setData(a.map(i)),t.setTotalCount(i.totalCount),t}mapDachserJson(e,t){const i=this.resolveProxy(e);if(!i||!i.result||!i.result.length)return t;const a=new s.DachserJson(this.mapperSettings);return t.setData(a.map(i)),t.setTotalCount(i.totalCount),t}mapKilkayaStreams(e,t){if(!e||!e.stream||!e.stream.length)return t;const i=new n.KilkayaStreams(this.mapperSettings);return t.setData(i.map(e.stream)),t.setTotalCount(e.stream.length),t}resolveProxy(e){return this.useEditorProxy?JSON.parse(e.value):e}}},
7"./public/common/labrador/Reader.js":(e,t,i)=>{i.r(t),i.d(t,{Reader:()=>a});class a{constructor({url:e,mappers:t=[]}={}){this.url=e,this.mappers=t,this.modifiedUrl=this.url,this.cache=new Map}read(){return new Promise((e,t)=>{this.cache.has(this.modifiedUrl)?e(this.mapData(this.cache.get(this.modifiedUrl))):fetch(this.modifiedUrl).then(e=>e.json()).then(t=>{this.cache.set(this.modifiedUrl,t);const i=this.mapData(t);e(i)}).catch(e=>{console.log("[Reader] Failed to fetch/transform data. Please check input params. Error:"),console.error(e),t(e)})})}mapData(e){let t=e;for(const e of this.mappers)t=e.map(t);return t}updateUrl(e){this.modifiedUrl=e}reload(e=!1){return e&&this.cache.delete(this.modifiedUrl),this.read()}}},
7"./public/common/labrador/Renderer.js":(e,t,i)=>{i.r(t),i.d(t,{Renderer:()=>n});var a=i("./public/common/labrador/Core.js"),r=i("./build/modules/client_modules.js"),s=i("./build/modules/client_package.js");class n{constructor(e){console.group("[Labrador] Setup rendering engine");const t=n.resolveConfig(e),i={},o=[r.Entry];for(const e of Object.keys(r.behaviours))i[e]=[r.behaviours[e]];let l=!1;new URLSearchParams(window.location.search).get("debug")&&(l=!0),window.Sys={logger:console},this.renderer=new a.Core({logger:window.Sys.logger,settings:{siteAlias:t.site.alias,device:t.app.device,debug:l,transform:t.app.transform},resources:{config:{site:{alias:t.site.alias,display_name:t.site.display_name,domain:t.site.domain,id:t.site.id},image_server:t.app.image_server,app:{mode:"presentation",abc:123},customer:{...s.config,...t.config},ConfigObject:{...t.ConfigObject||{}}},templates:{view:s.templates},properties:s.properties,views:["baseview_client"]},globals:window,callbacks:{},entries:o,behaviours:i}),this.api=this.renderer.getApi(),console.groupEnd()}static resolveConfig(e){const t=e.site||{},i=e.app||{};return{config:e.config||{},ConfigObject:e.ConfigObject||{},site:{alias:t.alias,display_name:t.display_name,id:t.id,domain:t.domain},app:{debug:!!i.debug,image_server:i.image_server,device:i.device,transform:!!i.transform}}}setData(e){return this.renderer.setData("function"==typeof e.getData?e.getData():e)}render(){return new Promise((e,t)=>{console.group("[Labrador] Render data"),this.renderer.draw(t=>{e(t),console.groupEnd()})})}}},
7"./public/common/labrador/index.js":(e,t,i)=>{i.r(t),i.d(t,{ClientData:()=>a.ClientData,Core:()=>r.Core,FrontContent:()=>c.FrontContent,LabradorSearch:()=>l.LabradorSearch,Mapper:()=>s.Mapper,Reader:()=>n.Reader,Renderer:()=>o.Renderer,Tagboard:()=>d.Tagboard});var a=i("./public/common/labrador/ClientData.js"),r=i("./public/common/labrador/Core.js"),s=i("./public/common/labrador/Mapper.js"),n=i("./public/common/labrador/Reader.js"),o=i("./public/common/labrador/Renderer.js"),l=i("./public/common/modules/LabradorSearch.js"),d=i("./public/common/modules/Tagboard.js"),c=i("./public/common/modules/FrontContent.js")},
7"./public/common/labrador/source/FrontContentMapper.js":(e,t,i)=>{i.r(t),i.d(t,{FrontContentMapper:()=>a});class a{constructor(e){this.layout=e.layout||{},this.hide_items=this.layout.hide_items||[],this.alignImage=e.alignImage?`float${e.alignImage.charAt(0).toUpperCase()+e.alignImage.slice(1)}`:"",this.fallbackImage=e.fallbackImage,this.imageWidth=e.imageWidth}map(e){return e.setData(e.getData().map(e=>{const t={...e};if(t.children&&t.children[0]){const e=t.children[0];e.contentdata.fields.float={vp:{desktop:this.alignImage}},e.contentdata.fields.whRatio={vp:{desktop:this.layout.imageAspectRatio||.5}},e.width={vp:{desktop:this.imageWidth,mobile:100}}}else this.fallbackImage&&t.children.push({type:"image",contentdata:{fields:{imageurl:{value:`${this.fallbackImage}`},float:{vp:{desktop:this.alignImage}},whRatio:{vp:{desktop:this.layout.imageAspectRatio||.5}}}},width:{vp:{desktop:this.imageWidth,mobile:100}},metadata:{style_preset:{value:"fallbackImage"}}});for(const e of this.hide_items)switch(e){case"title":t.metadata.hideTitle={value:!0};break;case"subtitle":t.metadata.hidesubtitle={value:!0};break;case"image":t.metadata.hideimage={value:!0}}return this.hide_items.includes("kicker")||(t.metadata.showKicker={value:!0}),t.contentdata.fields.teaserTitle.value&&(t.contentdata.fields.title=t.contentdata.fields.teaserTitle),t.contentdata.fields.teaserSubtitle.value&&(t.contentdata.fields.subtitle=t.contentdata.fields.teaserSubtitle),t})),e}}},
7"./public/common/labrador/source/FrontContentRenderer.js":(e,t,i)=>{i.r(t),i.d(t,{FrontContentRenderer:()=>u});var a=i("./public/common/labrador/Mapper.js"),r=i("./public/common/labrador/Reader.js"),s=i("./public/common/labrador/Renderer.js"),n=i("./public/common/labrador/source/FrontContentMapper.js"),o=i("./public/common/labrador/transformers/prosessors/Filter.js"),l=i("./public/common/labrador/transformers/prosessors/Tags.js"),d=i("./public/common/labrador/transformers/prosessors/RowLines.js"),c=i("./public/common/labrador/transformers/prosessors/Setter.js"),g=i("./public/common/labrador/transformers/layout/RowsAndColumns.js"),p=i("./public/common/labrador/transformers/layout/RandomRows.js");class u{constructor({url:e,app:t={},site:i={},settings:u={}}={}){this.mappers={api:new a.Mapper({source:u.sourceType,image_server:t.image_server,settings:{useEditorProxy:u.isEditor&&("LabradorApi"!==u.sourceType||!!u.useProxy)}}),tagboard:new n.FrontContentMapper(u),filter:new o.Filter({data:u.articleFilterList}),tags:new l.Tags({tagGroups:[],articleCount:u.articleCount}),setter:new c.Setter({data:u.style}),rows:"RowsAndColumns"===u.organizer?new g.RowsAndColumns({layout:u.layout}):new p.RandomRows({layout:u.layout}),lines:new d.RowLines(u)},this.reader=new r.Reader({url:e,mappers:[this.mappers.api,this.mappers.tagboard,this.mappers.filter,this.mappers.tags,this.mappers.setter,this.mappers.rows,this.mappers.lines]}),this.renderer=new s.Renderer({app:t,site:i,ConfigObject:u.ConfigObject||{}})}read(){return new Promise((e,t)=>{this.reader.read().then(i=>{0!==!i.data.count?this.render(i).then(t=>{e(t)}).catch(e=>{t(e)}):t()}).catch(e=>{t(e)})})}render(e){return new Promise((t,i)=>{0!==!e.data.count?(this.renderer.setData(e),this.renderer.render().then(i=>{e.setMarkups(i),t(e)}).catch(e=>{i(e)})):i()})}filter(e){Array.isArray(e)&&e.length&&(this.mappers.tags.tagGroups=[...e])}updateUrl(e){this.reader.updateUrl(e)}}},
7"./public/common/labrador/source/Search.js":(e,t,i)=>{i.r(t),i.d(t,{Search:()=>o});var a=i("./public/common/labrador/Mapper.js"),r=i("./public/common/labrador/Reader.js"),s=i("./public/common/labrador/Renderer.js"),n=i("./public/common/labrador/source/SearchMapper.js");class o{constructor({ConfigObject:e,url:t,app:i={},site:o={},searchMapper:l={}}={}){this.reader=new r.Reader({url:t,mappers:[new a.Mapper({source:"LabradorApi",image_server:i.image_server}),new n.SearchMapper(l)]}),this.renderer=new s.Renderer({ConfigObject:e,app:i,site:o})}read(){return new Promise((e,t)=>{this.reader.read().then(i=>{i.count?(this.renderer.setData(i),this.renderer.render().then(t=>{i.setMarkups(t),e(i)}).catch(e=>{t(e)})):e(i)}).catch(e=>{t(e)})})}updateUrl(e){this.reader.updateUrl(e)}}},
7"./public/common/labrador/source/SearchMapper.js":(e,t,i)=>{i.r(t),i.d(t,{SearchMapper:()=>a});class a{constructor(e){this.bodytextLength=e.bodytextLength||0,this.fallbackImage=e.fallbackImage,this.sites=e.sites,this.layout=e.layout||{},this.sitesById={}}map(e){return e.setData(e.getData().map(e=>{const t={...e};let i;t.children&&t.children[0]?i=t.children[0]:this.fallbackImage&&(i={type:"image",contentdata:{fields:{imageurl:{value:`${this.fallbackImage}`}}},metadata:{style_preset:{value:"fallbackImage"}}}),i&&(i.width={vp:this.layout.image.width},i.contentdata.fields.float={vp:this.layout.image.float},i.contentdata.fields.whRatio={vp:this.layout.image.whRatio},t.children=[i]),t.contentdata.fields.subtitle.value=this.layout.article.hideSubtitle?"":this.trimBodytext(t.contentdata.fields.subtitle.value,t);const a=this.layout.article.hideSiteName?"":`<span class="sitealias label">${this.siteIdToDisplayName(t.contentdata.fields.site_id.value)}</span>`,r=this.layout.article.hidePublishedDate?"":`<span class="date fi-clock"> ${this.dateToAge(t.contentdata.fields.published.value)}</span>`,s=this.layout.article.hideSection?"":`<span class="section_tag fi-price-tag"> ${t.contentdata.primaryTags.section}</span>`,n=this.layout.article.showAuthor&&t.contentdata.fields.byline?.value?`<span class="lab-search-author fi-torso"> ${t.contentdata.fields.byline.value}</span>`:"";return(a||r||s||n)&&(t.contentdata.fields.subtitle.value+=`<span class="info">${a}${r}${s}${n}</span>`),t.width={vp:this.layout.article.width},t.path="labradorSearch",t})),e}trimBodytext(e,t){if(e)return e;const i=t.contentdata.fields.bodytext.value||"",a=this.bodytextLength;return 0===a?"":i.length>a?`${i.substring(0,a)} ...`:i}siteIdToDisplayName(e){const t=parseInt(e,10);return void 0===this.sitesById[e]&&(this.sitesById[e]=(this.sites.filter(e=>e.id===t).pop()||{}).displayName),this.sitesById[e]}dateToAge(e){if(!e)return"";const t=new Date(e);return`${t.toLocaleDateString()} - ${t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`}}},
7"./public/common/labrador/transformers/datatype.js":(e,t,i)=>{i.r(t),i.d(t,{datatype:()=>a});const a={object:{get:(e="",t={},i=!1)=>e.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:i?void 0:null,t),set:(e,t,i)=>(e.split(".").reduce((e,i,r,s)=>{if(r!==s.length-1)return a.object.isObject(e[i])?e[i]:e[i]={};e[i]=t},i),i),isObject:e=>e&&"object"==typeof e&&!Array.isArray(e),merge:(e,t)=>{if(Array.isArray(e)&&Array.isArray(t))return t;const i=Object.assign(Array.isArray(e)?[]:{},e);if(a.object.isObject(e)&&a.object.isObject(t))for(const r of Object.keys(t))a.object.isObject(t[r])?r in e&&a.object.isObject(e[r])?i[r]=a.object.merge(e[r],t[r]):Object.assign(i,{[r]:t[r]}):Object.assign(i,{[r]:t[r]});return i}},string:{unique:e=>{const t=`0x${10**(e-1)}`;return Math.floor((1+Math.random())*t).toString(16)},strip_tags:(e="")=>(e||"").replace(/<(?:.|\n)*?>/gm,"").trim()}}},
7"./public/common/labrador/transformers/layout/RandomRows.js":(e,t,i)=>{i.r(t),i.d(t,{RandomRows:()=>r});var a=i("./public/common/labrador/transformers/utils.js");class r{constructor(e){const t=e.layout||{};this.options={maxPixelWidth:t.maxPixelWidth||1e3,imageAspectRatio:t.imageAspectRatio||.6,maxRowSize:t.maxRowSize||4,minRowSize:t.minRowSize||1,selector:t.selector||"",grid_size:t.grid_size||12}}map(e){const t=e.getData(),i=[];if(!t.length)return e;const r=[];let s=[],n=this.getRandomInt(this.options.minRowSize,this.options.maxRowSize);for(const e of t){if(s.length>=n){r.push(s),s=[];const e=n;n=this.getRandomInt(this.options.minRowSize,this.options.maxRowSize),n===e&&(n=this.getRandomInt(this.options.minRowSize,this.options.maxRowSize))}s.push(e)}r.push(s);for(const e of r)a.utils.decorateRow(e,this.options),i.push({type:"row",selector:this.options.selector||"",children:e});return e.setData(i),e}getRandomInt(e,t){return Math.floor(Math.random()*(t-e+1)+e)}}},
7"./public/common/labrador/transformers/layout/RowsAndColumns.js":(e,t,i)=>{i.r(t),i.d(t,{RowsAndColumns:()=>r});var a=i("./public/common/labrador/transformers/utils.js");class r{constructor(e){const t=e.layout||{};this.options={columnCount:t.columnCount||3,rowCount:t.rowCount||4,grid_size:t.grid_size||12,maxPixelWidth:t.maxPixelWidth||1e3,imageAspectRatio:t.imageAspectRatio||.6,selector:t.selector||""}}map(e){const t=[],i=a.utils.groupRowsAndColums(e.getData(),this.options);for(const e of i)a.utils.decorateRow(e,this.options),t.push({type:"row",selector:this.options.selector||"",children:e});return e.setData(t),e}}},
7"./public/common/labrador/transformers/prosessors/Filter.js":(e,t,i)=>{i.r(t),i.d(t,{Filter:()=>r});var a=i("./public/common/labrador/transformers/datatype.js");class r{constructor(e){this.options={data:e.data||[]}}map(e){const t=e.getData();return Array.isArray(t)&&this.options.data.length?(e.setData(t.filter(e=>{for(const t of this.options.data)if(Array.isArray(t.values)&&t.values.includes(a.datatype.object.get(t.path,e)))return!1;return!0})),e):e}}},
7"./public/common/labrador/transformers/prosessors/RowLines.js":(e,t,i)=>{i.r(t),i.d(t,{RowLines:()=>r});var a=i("./public/common/labrador/transformers/datatype.js");class r{constructor(e){this.active="RowLines"===e.postprocessor,this.aspectRatio=e.layout.imageAspectRatio||.45,this.options={ratioOptionsSource:{title:1.4,subtitle:1,kicker:1,image:1},ratioOptionsTarget:{title:1.4,subtitle:1,kicker:1,image:1},text_size:{min:16,max:70,base:30},fieldSuffix:{size:"text_size"}}}map(e){if(!this.active)return e;const t=e.getData();return this.autoLayoutRows(t,this.options),e.setData(t),e}autoLayoutRows(e,t){return e.forEach(e=>this.autoLayoutRow(e,t)),e}autoLayoutRow(e,t){const i=e.children.length,r={kicker:e.children.map(e=>Math.max((e.contentdata.fields.kicker.value||"").length,10)),title:e.children.map(e=>Math.max(a.datatype.string.strip_tags(e.contentdata.fields.title.value||"").length,10)),subtitle:e.children.map(e=>Math.max((e.contentdata.fields.subtitle.value||"").length,50)),image:e.children.map(e=>e.children.length?177:0)},s=Object.keys(r),n=3,o=1.5,l=.54,d=.5,c=t.ratioOptionsSource||{},g=t.ratioOptionsTarget||{};for(const e of s)c[e]=c[e]||1,g[e]=g[e]||1;const p=[];for(let e=0;e<i;e++)p.push(parseInt(r.title[e]*n*c.title+r.kicker[e]*o*c.kicker+r.subtitle[e]*l*c.subtitle+r.image[e]*d*c.image,10));const u=this.getAvg(p),h=p.map(e=>u/e);for(const i of e.children){const s=e.children.indexOf(i),n=r.image[s]>0,o=n?(h[s]-1)/2+1:h[s];if(n){const e=o*g.image;i.children[0].contentdata.fields.whRatio={value:this.aspectRatio*e}}let l=Math.round(t.text_size.base*o*g.title);l<t.text_size.min&&(l=t.text_size.min),l>t.text_size.max&&(l=t.text_size.max),a.datatype.object.set(`attributes.${this.options.fieldSuffix.size}.value`,l,i.contentdata.fields.title)}}getAvg(e){return Math.round(e.reduce((e,t)=>e+t,0)/e.length)}}},
7"./public/common/labrador/transformers/prosessors/Setter.js":(e,t,i)=>{i.r(t),i.d(t,{Setter:()=>r});var a=i("./public/common/labrador/transformers/datatype.js");class r{constructor(e){this.options={data:e.data||[]}}map(e){if(!this.options.data.length)return e;const t=e.getData();for(const e of t)for(const t of this.options.data)t.path&&void 0!==t.value&&a.datatype.object.set(t.path,t.value,e);return e.setData(t),e}}},
7"./public/common/labrador/transformers/prosessors/Tags.js":(e,t,i)=>{i.r(t),i.d(t,{Tags:()=>a});class a{constructor({tagGroups:e=[],articleCount:t}={}){this.tagGroups=Array.isArray(e)?e:[],this.articleCount=t}map(e){const t=e.getData();if(!Array.isArray(t))return e;let i=t;return this.tagGroups.length&&(i=t.filter(e=>{for(const t of this.tagGroups)if(!this.tagGroupMatch(t,e))return!1;return!0})),this.articleCount&&(i=i.slice(0,this.articleCount)),e.setData(i),e}tagGroupMatch(e,t){if(!e.length)return!0;for(const i of e)if(t.contentdata.tags.includes(i))return!0;return!1}}},
7"./public/common/labrador/transformers/source/DachserJson.js":(e,t,i)=>{i.r(t),i.d(t,{DachserJson:()=>a});class a{constructor(e){this.options={ignore:e.ignore||[]}}map(e){return(e.result||[]).map(e=>this.transformArticle(e))}allowFragment(e){return!this.options.ignore.includes(e)}transformArticle(e){const t={type:"article",contentdata:{id:e.id,fields:{title:this.allowFragment("title")?{value:e.title}:null,subtitle:this.allowFragment("subtitle")?{value:e.description}:null,kicker:this.allowFragment("kicker")?{value:e.kicker}:null,published_url:{value:e.url}},tags:Array.isArray(e.tags)?e.tags:[]},metadata:e.metadata||{},width:e.width||100,widthVp:e.widthVp||{},children:[]};return e.images&&e.images.length&&this.allowFragment("image")&&t.children.push(this.transformImage(e.images[0])),t}transformImage(e){return{type:"image",contentdata:{fields:e.altText?{altText:{value:e.altText}}:{},instance_of:e.id,metadata:{}}}}}},
7"./public/common/labrador/transformers/source/KilkayaStreams.js":(e,t,i)=>{i.r(t),i.d(t,{KilkayaStreams:()=>a});class a{constructor(e){this.options={ignore:e.ignore||[]}}map(e){return(e||[]).map(e=>this.transformArticle(e))}allowFragment(e){return!this.options.ignore.includes(e)}transformArticle(e){const t={type:"article",contentdata:{fields:{title:{value:this.allowFragment("title")?e.title:null},subtitle:{value:this.allowFragment("subtitle")?e.desc:null},published_url:{value:this.ensureUrlProtocol(e.url)},paywall:{value:e.paid?"1":""}},primaryTags:{section:e.section}},metadata:{},children:[]};return e.image&&this.allowFragment("image")&&t.children.push(this.transformImage(this.ensureUrlProtocol(e.image))),t}ensureUrlProtocol(e="",t="https"){if(e.startsWith("//"))return e;return`${t}://${e.replace("http://","").replace("https://","")}`}transformImage(e){return{type:"image",contentdata:{fields:{imageurl:{value:e?encodeURIComponent(e):""}}},metadata:{}}}}},
7"./public/common/labrador/transformers/source/LabradorApi.js":(e,t,i)=>{i.r(t),i.d(t,{LabradorApi:()=>a});class a{constructor(e){this.options={imageServer:e.imageServer||"",ignore:e.ignore||[],extraFields:Array.isArray(e.extraFields)?e.extraFields:[]}}map(e){return(e.result||[]).map(e=>this.transformArticle(e))}transformArticle(e){const t={type:e.type,contentdata:{id:e.id,fields:{title:{value:e.titleHTML||e.title||null},teaserTitle:{value:e.teaserTitle||null},subtitle:{value:e.subtitleHTML||e.subtitle||null},teaserSubtitle:{value:e.teaserSubtitle||null},kicker:{value:e.teaserKicker||e.kicker||null},teaserKicker:{value:e.teaserKicker||null},published_url:{value:e.siteDomain+e.published_url},byline:{value:e.byline_names},bylineImage:{value:e.full_bylines&&e.full_bylines[0]?e.full_bylines[0].imageUrl:""},seotitle:{value:e.seotitle},seodescription:{value:e.seodescription},paywall:{value:e.paywall},bodytext:{value:e.bodytext},site_id:{value:e.site_id},published:{value:e.published},modified:{value:e.modified},created:{value:e.created}},primaryTags:{section:e.section_tag},tags:(e.tags||"").split(", ")},metadata:{},width:100,widthVp:{},children:[]};for(const i of this.options.extraFields)void 0!==e[i]&&void 0===t.contentdata.fields[i]&&(t.contentdata.fields[i]={value:e[i]});return e.frontCropUrl&&t.children.push(this.transformImage(e)),t}transformImage(e){const t={caption:{value:e.imageCaption}};if(e.frontCropUrl){const i=e.frontCropUrl.split("?");if(2===i.length){const e=["imageId"],a=i[1].split("&");for(const i of a){const[a,r]=i.split("=");a&&!e.includes(a)&&(t[a]={value:r})}const r={panox:"x",panoy:"y",panow:"cropw",panoh:"croph"};for(const[e,i]of Object.entries(r))void 0!==t[e]&&(t[i]=t[e],delete t[e])}}return{type:"image",contentdata:{instance_of:e.image,fields:t},metadata:{}}}}},
7"./public/common/labrador/transformers/utils.js":(e,t,i)=>{i.r(t),i.d(t,{utils:()=>a});const a={decorateRow:(e,t)=>{const i=a.distributePercent(100,e.length,t.grid_size);for(const t of e)t.width=i.shift()},groupRowsAndColums:(e,t)=>{const i=[];let a=[];for(const r of e){if(a.length>=t.columnCount){if(i.push(a),i.length>=t.rowCount)return i;a=[]}a.push(r)}return i.push(a),i},percentToGrid:(e,t=12)=>Math.round(e/100*t),gridToPercent:(e,t=12)=>a.floatPrecision(e/t*100),floatPrecision:e=>parseFloat(parseFloat(e).toFixed(2)),distributePercent:(e,t,i=12)=>a.distributeGrid(a.percentToGrid(e,i),t).map(e=>a.gridToPercent(e,i)),distributeGrid:(e,t)=>{let i=t;i>e&&(i=e,Sys.logger.warn(`grid.distributeGrid: Requested count ${t} is larger than gridSize ${e}. Will use count ${i}.`));const a=e/i;if(Number.isInteger(a))return Array(i).fill(a);let r=0,s=!0,n=[];for(let e=0;e<i;e++){const e=s?Math.ceil(a):Math.floor(a);n.push(e),r+=e,s=!s}let o=r-e;if(r!==e){const e=[];for(;o>0&&n.length;){let t=n.shift();t>1&&(t--,o-=1),e.push(t)}n=n.concat(e)}return n.length!==i&&Sys.logger.warn(`Utility-method grid.distributeGrid will return a faulty array. Excpected a count of ${i}, got ${n.length} ...`),n}}},
7"./public/common/modules/FrontContent.js":(e,t,i)=>{i.r(t),i.d(t,{FrontContent:()=>r});var a=i("./public/common/labrador/source/FrontContentRenderer.js");class r{constructor(e){this.settings=e,this.FrontContentRenderer=new a.FrontContentRenderer({url:this.getUrl(),app:{device:this.settings.viewport,image_server:this.settings.imageServer},settings:this.settings});const t=document.querySelector(`#tagboard_${this.settings.id} .taglistToggle`),i=document.querySelector(`#tagboard_${this.settings.id} .taglist`);if(t&&i){const e=t.querySelector(".dac-icon-hamburger");t.addEventListener("click",t=>{e.classList.toggle("dac-open"),i.classList.toggle("dac-hidden")},!1)}this.selectedTags=[],this.tagGroups=[],this.contentTags=[];const r=[...document.querySelectorAll(`#tagboard_${this.settings.id} form.taglist .group`)];for(const e of r){const t=r.indexOf(e),i=e.querySelectorAll("li input"),a={};for(const e of i)a[e.value]={count:0,maxCount:0,element:e,counter:e.nextElementSibling,groupIndex:t},e.addEventListener("change",e=>{this.toggleTag(e.target.value,e.target.checked,t)},!1);this.tagGroups.push(a),this.selectedTags.push([])}this.fetchData()}getUrl(){if("LabradorApi"===this.settings.sourceType){let e="";return this.settings.tagOptions&&this.settings.tagOptions.allow&&(e=this.settings.isEditor?this.settings.tagOptions.useOr?encodeURIComponent(`%20AND%20(${this.settings.tagOptions.tags.map(e=>`tag:%22${e}%22`).join("%20OR%20")})`):encodeURIComponent(`%20AND%20tag:(${this.settings.tagOptions.tags.map(e=>`%22${e}%22`).join("%20")})`):this.settings.tagOptions.useOr?` AND (${this.settings.tagOptions.tags.map(e=>`tag:"${e}"`).join(" OR ")})`:` AND tag:(${this.settings.tagOptions.tags.map(e=>`"${e}"`).join(" ")})`),`${this.settings.url}${e}&limit=${this.settings.articleCount}${this.settings.siteId?`&site_id=${this.settings.siteId}`:""}`}return this.settings.url}fetchData(){this.FrontContentRenderer.read().then(e=>{this.insertArticles(e),this.readTagCount()}).catch(e=>{console.error("[FrontContent] Failed to fetch content:",e)})}insertArticles(e){const t=document.querySelector(this.settings.selector);for(;t.firstChild;)t.firstChild.remove();const i=new DocumentFragment;for(const t of e.markups){const e=document.createElement("div");e.innerHTML=t,i.appendChild(e.firstChild)}t.appendChild(i)}readTagCount(e){if(this.contentTags.length){for(const e of this.tagGroups)for(const t of Object.keys(e))e[t].count=0,e[t].maxCount=0;this.contentTags=[]}for(const e of this.FrontContentRenderer.renderer.api.v1.model.query.getModelsAsArray().filter(e=>"article"===e.getType())){const t=e.get("tags")||[];this.contentTags.push(t);for(const e of t)this.bumpTagNumber(e,!0)}this.updateTagNumberElements()}filterTagCount(e){for(const t of this.tagGroups)if(this.tagGroups.indexOf(t)!==e){const i=this.selectedTags[e];for(const e of Object.keys(t))t[e].count=this.getTagCount(e,i)}this.updateTagNumberElements()}getTagCount(e,t){return this.contentTags.filter(i=>{if(!i.includes(e))return!1;if(!t.length)return!0;for(const e of t)if(i.includes(e))return!0;return!1}).length}bumpTagNumber(e,t=!1){for(const i of this.tagGroups)void 0!==i[e]&&(i[e].count++,t&&i[e].maxCount++)}updateTagNumberElements(){for(const e of this.tagGroups)for(const t of Object.keys(e))e[t].counter.innerHTML=e[t].count,e[t].element.disabled=0===e[t].count,0===e[t].count?e[t].element.parentElement.classList.add("disabled"):e[t].element.parentElement.classList.remove("disabled")}toggleTag(e,t,i){this.selectedTags[i]=this.selectedTags[i].filter(t=>t!==e),t&&this.selectedTags[i].push(e),this.FrontContentRenderer.filter(this.selectedTags),this.fetchData()}}},
7"./public/common/modules/LabradorSearch.js":(e,t,i)=>{i.r(t),i.d(t,{LabradorSearch:()=>r});var a=i("./public/common/labrador/source/Search.js");class r{constructor(e){this.settings=e,this.dom={container:e.container,spinner:e.spinner,nav:e.nav,filters:e.filters,nextEl:null,advanced:{button:e.advanced.button.element,container:e.advanced.container,toggleAllSites:e.advanced.sites.toggleAll}},this.sites=JSON.parse(this.settings.advanced.sites.allowed||"[]"),this.sitesById={},this.baseUrl=e.apiUrl;const t=new URLSearchParams(window.location.search);this.isDebug="1"===t.get("debug"),this.requestedSites=this.readSiteIDs(t.get("sites")||""),this.nohitsLabel=e.nohitsLabel,this.urlParams={limit:t.get("limit")||e.articleCount||20,start:parseInt(t.get("start"),10)||0,query:"",altText:1},this.queryParams={query:t.get("query")||t.get("q")||"",tag:t.get("tag")||"",author:t.get("author")||"",fromDate:t.get("fromDate")||"",toDate:t.get("toDate")||""},e.orderBy&&(this.urlParams.orderBy=e.orderBy),this.searchSettings={count:0,totalCount:0,canPage:!0},this.setup();const i=parseInt(this.settings.desktopWidth||100,10),r=i>=50;let s=100;50===i&&(s=33.33),i>50&&(s=20),this.searchHandler=new a.Search({ConfigObject:this.settings.ConfigObject,url:this.getUrl(),app:{device:this.settings.viewport,image_server:this.settings.imageServer},searchMapper:{bodytextLength:this.settings.bodytextLength,fallbackImage:this.settings.fallbackImage,sites:this.sites,layout:{article:{width:{desktop:i,mobile:100},hideSiteName:this.settings.hideSiteName,hidePublishedDate:this.settings.hidePublishedDate,hideSection:this.settings.hideSection,hideSubtitle:this.settings.hideSubtitle,showAuthor:this.settings.showAuthor},image:{width:{desktop:s,mobile:25},float:{desktop:r?"floatLeft":null,mobile:"floatLeft"},whRatio:{desktop:.65}}}}}),this.getUrlParam("query")&&(this.fetchData(),this.dom.nav.classList.remove("dac-hidden"))}setup(){const e=this.dom.container.querySelector("form");if(this.settings.isEditor&&e.addEventListener("submit",e=>{e.preventDefault()},!1),this.dom.nextEl=this.dom.container.querySelector('[data-nav="next"]'),this.updatePager(),this.dom.nextEl.addEventListener("click",e=>{e.preventDefault(),this.searchSettings.canPage&&this.nextPage()},!1),this.settings.advanced.display){let e=[];this.sites.length!==this.requestedSites.length&&this.requestedSites.length||(this.dom.advanced.toggleAllSites.checked=!0),this.sites.forEach(t=>{this.requestedSites.length>0?this.requestedSites.includes(t.id)&&e.push(t):e.push(t)}),this.settings.advanced.sites.checkboxes.forEach(t=>{const i=parseInt(t.value,10);for(const a of e)if(a.id===i){t.checked=!0;break}t.addEventListener("change",t=>{if(t.target.checked){let t=null;for(const a of this.sites)if(a.id===i){let r=!1;for(const t of e)if(t.id==i){r=!0;break}r||(t=a);break}null!==t&&e.push(t),this.sites.length===e.length&&(this.dom.advanced.toggleAllSites.checked=!0)}else{if(1===e.length)t.target.checked=!0;else{let t=-1;for(let a=0;a<e.length;a++)if(i===e[a].id){t=a;break}t>-1&&e.splice(t,1)}this.dom.advanced.toggleAllSites.checked=!1}this.settings.advanced.sites.input.value=this.writeSiteIDs(e.length>0?e:this.sites)})}),this.settings.advanced.sites.input.value=this.writeSiteIDs(e),this.setUrlParam("query",this.generateQuery(e)),this.dom.advanced.button.addEventListener("click",e=>{e.preventDefault(),this.dom.advanced.container.classList.contains("expanded")?this.toggleAdvancedSearchUI(!1):this.toggleAdvancedSearchUI(!0)}),this.dom.advanced.toggleAllSites.addEventListener("click",t=>{this.settings.advanced.sites.checkboxes.forEach(i=>{const a=t.target.checked;e=[];for(const t of this.sites)i.checked=a,a&&e.push(t);this.settings.advanced.sites.input.value=this.writeSiteIDs(e.length>0?e:this.sites)})})}else this.setUrlParam("query",this.generateQuery(this.sites))}toggleAdvancedSearchUI(e){this.settings.advanced.display&&(e?(this.dom.advanced.button.innerText=this.settings.advanced.button.closeText||"Hide Advanced",this.dom.advanced.container.classList.add("expanded")):(this.dom.advanced.button.innerText=this.settings.advanced.button.openText||"Show Advanced",this.dom.advanced.container.classList.remove("expanded")))}fetchData(){this.dom.spinner.classList.remove("dac-hidden"),this.searchHandler.read().then(e=>{this.insertArticles(e)}).catch(e=>{console.error("[LabradorSearch] Failed to fetch search results:",e),this.dom.spinner.classList.add("dac-hidden")})}insertArticles(e){const t=document.querySelector(this.settings.selector),i=new DocumentFragment;for(const t of e.markups){const e=document.createElement("div");e.innerHTML=t,i.appendChild(e.firstChild)}t.appendChild(i),this.searchSettings.count=e.count,this.searchSettings.totalCount=this.getUrlParam("start")+e.count,e.totalCount<=this.searchSettings.totalCount&&this.disablePager(),this.dom.spinner.classList.add("dac-hidden"),this.updatePager(),0===e.count&&this.displayNohits()}readSiteIDs(e=""){return e.split(",").filter(e=>""!==e).map(e=>parseInt(e,10))||[]}writeSiteIDs(e){const t=[];
7return e.forEach(e=>{t.push(e.id)}),t.join(",")}generateQuery(e){const t=[],i={query:this.cleanString(this.queryParams.query),author:this.cleanString(this.queryParams.author),tag:this.cleanString(this.queryParams.tag),fromDate:this.cleanString(this.queryParams.fromDate,!0),toDate:this.cleanString(this.queryParams.toDate,!0)};if(i.fromDate&&t.push(`published:([${i.fromDate}T00:00:00.000Z TO *])`),i.toDate&&t.push(`published:([* TO ${i.toDate}T23:59:59.000Z])`),i.tag&&t.push(`tag:("${i.tag}")`),i.author&&t.push(`child.byline:("${i.author}")`),i.query&&t.push(i.query),t.length)return e.length&&t.push(`lab_site_id:(${e.map(e=>e.id).join(" OR ")})`),t.join(" AND ")}cleanString(e,t=!1){const i=["\\\\&&","\\\\||","!","(",")",'"',"~","*","?",":","+"];t||i.push("-");const a=new RegExp(`[${i.join("")}]`,"g");return e.replace(a," ").trim()}updatePager(){if(!this.searchSettings.canPage)return;this.dom.nextEl.classList.remove("disabled");const e=this.getUrlParam("start");this.settings.isEditor?this.dom.nextEl.setAttribute("href","#"):this.dom.nextEl.setAttribute("href",this.getUrlParams({start:e+this.searchSettings.count}))}getUrlParam(e){return this.urlParams[e]}setUrlParam(e,t){this.urlParams[e]=t}getUrl(){const e=Object.keys(this.urlParams).map(e=>`${e}=${this.urlParams[e]}`).join("&");return`${this.baseUrl}?${e}`}getUrlParams(e={}){return`?${Object.keys(this.urlParams).map(t=>`${t}=${void 0!==e[t]?e[t]:this.urlParams[t]}`).join("&")}`}nextPage(){this.setUrlParam("start",this.getUrlParam("start")+this.searchSettings.count),this.searchHandler.updateUrl(this.getUrl()),this.fetchData()}disablePager(){this.searchSettings.canPage=!1,this.dom.nextEl.classList.add("disabled")}displayNohits(){this.toggleAdvancedSearchUI(!0);const e=document.createElement("div");e.innerHTML=this.nohitsLabel,e.classList.add("nohitsLabel"),this.dom.container.querySelector(".labclient-content").appendChild(e)}}},
7"./public/common/modules/Tagboard.js":(e,t,i)=>{i.r(t),i.d(t,{Tagboard:()=>r});var a=i("./public/common/labrador/source/FrontContentRenderer.js");class r{constructor(e){this.settings=e,this.baseUrl=e.apiUrl,this.FrontContentRenderer=new a.FrontContentRenderer({url:this.getUrl(),app:{device:this.settings.viewport,image_server:this.settings.imageServer},settings:this.settings});const t=document.querySelector(`#tagboard_${this.settings.id} .taglistToggle`),i=document.querySelector(`#tagboard_${this.settings.id} .taglist`);if(t&&i){const e=t.querySelector(".dac-icon-hamburger");t.addEventListener("click",t=>{e.classList.toggle("dac-open"),i.classList.toggle("dac-hidden")},!1)}this.selectedTags=[],this.tagGroups=[],this.contentTags=[];const r="tagBoardContentTags",s=e.cookieOptions.tagsArray,n=[...document.querySelectorAll(`#tagboard_${this.settings.id} form.taglist .group`)];for(const t of n){const i=n.indexOf(t),a=t.querySelectorAll("li input"),o={};this.selectedTags.push([]);for(const t of a){o[t.value]={count:0,maxCount:0,element:t,counter:t.nextElementSibling,groupIndex:i};const a=`${t.value}_${i}_${this.settings.id}`,n=s.includes(a),l=t.getAttribute("value");!0===n&&e.cookieOptions.allow&&(this.toggleTag(l,n,i),t.checked=!0),t.addEventListener("change",t=>{if(this.toggleTag(t.target.value,t.target.checked,i),e.cookieOptions.allow){const e=`${t.target.value}_${i}_${this.settings.id}`,a=JSON.parse(localStorage.getItem(r))||[];if(t.target.checked)a.includes(e)||a.push(e);else{const t=a.indexOf(e);t>-1&&a.splice(t,1)}localStorage.setItem(r,JSON.stringify(a))}},!1)}this.tagGroups.push(o),this.selectedTags.push([])}this.fetchData()}getUrl(){return`${this.addTagsToUrl(this.settings.url,this.settings.tagOptions.tags,this.settings.tagOptions.groups)}&fields=*,-bodytext,-ai_*,-bodytextHTML&limit=${this.settings.articleFetchCount}${this.settings.siteId?`&site_id=${this.settings.siteId}`:""}`}addTagsToUrl(e,t=[],i=[]){const a=e=>e.map(e=>{let t=e.trim();return t.indexOf(" ")>-1&&(t=`"${t}"`),`tag:${t}`}),r=" ";let s="";return s=i.length?encodeURIComponent(`${r}AND${r}${i.map(e=>`(${a(e).join(`${r}OR${r}`)})`).join(`${r}AND${r}`)}`):encodeURIComponent(`${r}AND${r}(${a(t).join(`${r}OR${r}`)})`),e+s}fetchData(){this.FrontContentRenderer.read().then(e=>{this.insertArticles(e),this.readTagCount()}).catch(e=>{console.error("[Tagboard] Failed to fetch content:",e)})}insertArticles(e){const t=document.querySelector(this.settings.selector);for(;t.firstChild;)t.firstChild.remove();const i=new DocumentFragment;for(const t of e.markups){const e=document.createElement("div");e.innerHTML=t,i.appendChild(e.firstChild)}t.appendChild(i)}readTagCount(e){if(this.contentTags.length){for(const e of this.tagGroups)for(const t of Object.keys(e))e[t].count=0,e[t].maxCount=0;this.contentTags=[]}for(const e of this.FrontContentRenderer.renderer.api.v1.model.query.getModelsAsArray().filter(e=>"article"===e.getType())){const t=e.get("tags")||[];this.contentTags.push(t);for(const e of t)this.bumpTagNumber(e,!0)}this.updateTagNumberElements()}filterTagCount(e){for(const t of this.tagGroups)if(this.tagGroups.indexOf(t)!==e){const i=this.selectedTags[e];for(const e of Object.keys(t))t[e].count=this.getTagCount(e,i)}this.updateTagNumberElements()}getTagCount(e,t){return this.contentTags.filter(i=>{if(!i.includes(e))return!1;if(!t.length)return!0;for(const e of t)if(i.includes(e))return!0;return!1}).length}bumpTagNumber(e,t=!1){for(const i of this.tagGroups)void 0!==i[e]&&(i[e].count++,t&&i[e].maxCount++)}updateTagNumberElements(){for(const e of this.tagGroups)for(const t of Object.keys(e))e[t].counter.innerHTML=e[t].count,e[t].element.disabled=0===e[t].count,0===e[t].count?e[t].element.parentElement.classList.add("disabled"):e[t].element.parentElement.classList.remove("disabled")}toggleTag(e,t,i){this.selectedTags[i]=this.selectedTags[i].filter(t=>t!==e),t&&this.selectedTags[i].push(e),this.FrontContentRenderer.filter(this.selectedTags),this.fetchData()}}}
7},t={};function i(a){var r=t[a];if(void 0!==r)return r.exports;var s=t[a]={exports:{}};return e[a](s,s.exports,i),s.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{i.r(a),i.d(a,{AudioInline:()=>t.AudioInline,ClientData:()=>e.ClientData,Core:()=>e.Core,FrontContent:()=>e.FrontContent,LabradorSearch:()=>e.LabradorSearch,Mapper:()=>e.Mapper,Reader:()=>e.Reader,Renderer:()=>e.Renderer,Tagboard:()=>e.Tagboard});var e=i("./public/common/labrador/index.js"),t=i("./public/common/AudioInline.js")})();const r=a.AudioInline,s=a.ClientData,n=a.Core,o=a.FrontContent,l=a.LabradorSearch,d=a.Mapper,c=a.Reader,g=a.Renderer,p=a.Tagboard;export{r as AudioInline,s as ClientData,n as Core,o as FrontContent,l as LabradorSearch,d as Mapper,c as Reader,g as Renderer,p as Tagboard};
8//# sourceMappingURL=baseview_dependencie_modules.js.map

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.