PageSourceSearch

https://www.carteblanche.ch/_astro/Main.astro_astro_type_script_index_0_lang.Cozr8Z3u.js

js carteblanche.ch collected 2026-10-08 17:02:56 UTC 16,619 bytes, 8 lines download raw bytes

1import{appOnboardingsHistoryKey as e,pushSettingsStorageKey as t,storageHelper as n,subscriptionLinkingHandledKey as r,subscriptionLinkingPageViewsKey as i}from"./storageHelper.ru1f2Q_8.js";import{addPageTargeting as a,updateTatmOnClient as o}from"./tatm.DvT9brgK.js";import{createAndAppendAsyncScript as s,createAndAppendMetaTag as c,findElOrThrow as l,fireCustomEvent as ee,getColorMode as te,getPageData as ne,getScriptData as re}from"./domHelpers.Due4eUf_.js";import{googleShowcaseParameters as ie}from"./getQueryParam.CVa1sMRt.js";import{identityService as ae,initializePersonalizedData as oe,personalizedData as u,readArticlesStore as se,removeGoogleShowcaseFromStore as ce,userStore as le}from"./personalizedDataStore.B0SnIJW1.js";import{authorizationHeaders as d,errorIn as f,getIdentityToken as p,getUserStatus as ue,hasSubscription as m,headersWithCredentials as de,isLoaded as h,isLoggedInUser as g,isRegisteredAndSubscribed as fe,makeRequest as _}from"./http.nEQ3k9-G.js";import{discoEnv as v}from"./envHelper.y6P0bv9v.js";import{getConfig as y}from"./mainConfig.CG44EOIi.js";import{deleteClientCookie as pe}from"./cookieHelper.BtvVZZCj.js";import{pageState as b}from"./pageStateHelper.8hn2v7AN.js";import{trackEvent as me}from"./analyticsClient.DRvZ5vOf.js";import{getAppVersion as he,sendViaNativeBridge as x}from"./nativeBridge.DAaJNEl_.js";import{getStorageData as S,handlePushLogic as ge,saveLastActivity as _e,setStorageData as C}from"./pushNotificationsHelpers.BTAtuG3C.js";import{checkConditions as ve,evaluateAppVersion as ye,getCurrentStats as be,triggerAppOverlay as w}from"./appOverlayHelper.4EYN-EBk.js";import{showToast as T}from"./toastMessageHelper.opJgQyRY.js";import{checkFrontPageUpdate as E}from"./fetchHelpers.BBj0adWA.js";import{addCMPListener as D,getConsentData as O,handleCMP as k}from"./handleCMP.Ch3KSrs1.js";import{BindGlobalAnalyticsEventTrackingListeners as A}from"./analyticsAstroHelpers.CSja-dga.js";import{initializeZoomListener as j}from"./zoomHelper.CX0x7-eK.js";import{initLoginOverlay as M,navigateToLogin as N}from"./loginNavigation.BBYGr-il.js";import{setPlaybackState as xe}from"./playbackStateStore.DmFNSWIn.js";import{initializeSubscribeToNewsletterListener as Se}from"./helpers.Cm7G2GxZ.js";import{onPianoReady as Ce,pianoCheckoutParamsKey as we,trackSwgCheckout as Te,trackSwgTransaction as Ee}from"./pianoLogin.CtVlmQFN.js";import{initializePageViewTracking as De}from"./pageViewHelper.9_ce0QR_.js";import{isArticleRead as Oe}from"./readArticlesHelpers.v5AIKFRh.js";function ke(){u.subscribe(({entitlements:e})=>{if(!h(e))return;let{hasAdFree:t,hasUnlimitedSubscription:n}=e,r=re(`tatm-config`);if(r&&!t&&(window.TATM=window.TATM||[],o({...r,activeSubscription:n})),t){let e=document.querySelector(`.TopAds`);e&&e.classList.remove(`-spacereserved`)}})}var Ae=(e,t)=>{let n=e.key,r=y(e).ecommerceServiceUrl,i=new URLSearchParams;i.set(`tenant`,n.toString());let a=i.toString();return _(`GET`,`${r}/api/subscription-linking/status${a?`?`+a:``}`,void 0,t)},je=(e,t,n)=>{let r=e.key,i=y(e).ecommerceServiceUrl,a=new URLSearchParams;a.set(`tenant`,r.toString()),t!==void 0&&a.set(`tamediaid`,t);let o=a.toString();return _(`POST`,`${i}/api/subscription-linking/syncEntitlements${o?`?`+o:``}`,void 0,n)},Me=(e,t,n)=>{e.key;let r=y(e).ecommerceServiceUrl;return _(`POST`,`${r}/api/reader-revenue/process-purchase`,t,n)},P=5e3,Ne=30,Pe=3,Fe=[`24heures`,`bazonline`,`bernerzeitung`,`derbund`,`fuw`,`tagesanzeiger`,`tdg`];function Ie(){let{tenant:e,shopUrl:t,isHybridApp:n}=b;if(!Fe.includes(e.key))return;let r=!1;u.subscribe(({user:i,entitlements:a,googleShowcase:o})=>{if(r||n||!h(i)||!h(a))return;g(i)&&m(a)&&c(`subscriptions-product-id`,`${e.key}.ch:basic`);let l=!!o;s(`https://accounts.google.com/gsi/client`),s(`https://news.google.com/swg/js/v1/swg.js`,()=>He(e,i,a,l),l?void 0:{"subscriptions-control":`manual`}),o&&(s(`https://news.google.com/swg/js/v1/swg-gaa.js`,()=>Be(e,o,t)),ce()),r=!0})}function F(){return window.location.href}function I(e){window.location.href=e}function L(e){sessionStorage.removeItem(we),I(R(e,`gaa`))}function Le(e){if(e){let e=new URL(F());ie.forEach(t=>e.searchParams.delete(t)),I(e.toString())}}function Re(e){return new Promise(()=>{window.GaaMetering.getLoginPromise().then(()=>{N(e,{onCancel:()=>window.location.reload()})})})}function ze(e){let t=[`local.${e.key}.ch`,`master.dev.${e.key}.ch`,`abo-digital-dev.${e.key}.ch`,window.location.hostname],n=[`${e.key}.ch`,`www.${e.key}.ch`,`abo-digital.${e.key}.ch`];return[...v===`production`?n:t,`id.tamedia.ch`]}function R(e,t){return`${ae(`/auth/authorize?source_client=web&response_type=token`,e)}
1&redirect_uri=${encodeURIComponent(F())}&source=${t}`}function Be(e,t,n){let{showcaseEntitlement:r,userState:i}=t,a=R(e,`showcase`),o=R(e,`gaa`);window.GaaMetering.init({authorizationUrl:o,paywallType:`SERVER_SIDE`,allowedReferrers:ze(e),userState:i,showcaseEntitlement:r,unlockArticle:()=>Le(!!r),showPaywall:()=>I(n),handleLoginPromise:Re(a),registerUserPromise:()=>{},handleSwGEntitlement:()=>{},shouldInitializeSwG:!1})}var z={21:`IMPRESSION_METER_TOAST`,23:`IMPRESSION_SHOWCASE_REGWALL`,1025:`ACTION_METER_TOAST_SUBSCRIBE_CLICK`,1036:`ACTION_SHOWCASE_REGWALL_EXISTING_ACCOUNT_CLICK`,1060:`ACTION_SHOWCASE_REGWALL_SIWG_CLICK`,1063:`ACTION_SHOWCASE_REGWALL_3P_BUTTON_CLICK`,40:`IMPRESSION_SUBSCRIPTION_LINKING_COMPLETE`,41:`IMPRESSION_SUBSCRIPTION_LINKING_ERROR`,3027:`EVENT_SUBSCRIPTION_LINKING_SUCCESS`,2005:`EVENT_SUBSCRIPTION_LINKING_FAILED`,1086:`ACTION_SUBSCRIPTION_LINKING_CLOSE`,3034:`EVENT_SHOW_OFFERS_API`,1037:`ACTION_SUBSCRIPTION_OFFERS_CLOSED`,1006:`ACTION_OFFER_SELECTED`,1005:`ACTION_PAYMENT_FLOW_STARTED`,1014:`ACTION_USER_CANCELED_PAYFLOW`,1001:`ACTION_PAYMENT_COMPLETE`,2e3:`EVENT_PAYMENT_FAILED`,3058:`EVENT_PAY_PAYMENT_COMPLETE`,3050:`EVENT_SUBSCRIPTION_PAYMENT_COMPLETE`,1003:`ACTION_ACCOUNT_ACKNOWLEDGED`};function Ve(e,t){if(e.eventType&&e.eventType in z){g(t)&&((e.eventType===41||e.eventType===2005)&&Ge(`Subscription linking failed, please try again later.`),e.eventType===3027&&(B(),Je(t)),e.eventType===1086&&B());let n=z[e.eventType];if(n){let t=[1001,3058,3050,1003].includes(Number(e.eventType));me(n,{...e,subscription_status:t?`subscribed`:`unsubscribed`})}}}function He(e,t,r,a){(window.SWG||[]).push(async o=>{a||(o.init(`${e.key}.ch`),o.configure({paySwgVersion:`2`}));let s=Ye();if(g(t)&&m(r)&&!s&&Xe()>=Pe)if(n.remove(i),await qe(e,t))B();else{let e=await We(t.tamediaId);o.linkSubscription({publisherProvidedId:e})}o.getEventManager().then(e=>{e.registerEventListener(e=>Ve(e,t))}),Ue(o,e)})}function Ue(e,t){let n=!1;Ce(r=>{r.push([`addHandler`,`customEvent`,r=>{if(![`swg_standard_button_clicked`,`swg_smart_button_clicked`,`swg_offer_button_clicked`].includes(r.eventName))return;let i=r.params?.sku,a=r.params?.productid;Te({sku:i,name:a}),i?e.subscribe(i):e.showOffers({isClosable:!0}),!n&&(n=!0,e.setOnLoginRequest(()=>L(t)),e.setOnPaymentResponse(async e=>{let n=await e,r=le.get();await Me(t,n,de(r)),Ee(n),await n.complete(),pe(`entitlementToken`,t),g(r)?window.location.reload():L(t)}))}])})}async function We(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-512`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Ge(e){let t=Ke();document.body.appendChild(t),T({content:e,variant:`error`,targetElement:t,duration:P,asChild:!0}),setTimeout(()=>{t.remove()},P)}function Ke(){let e=document.createElement(`div`);return e.style.cssText=`
2    position: fixed;
3    top: 50%;
4    left: 50%;
5    transform: translate(-50%, -50%);
6    z-index: 9999;
7    pointer-events: none;
8  `,e}async function qe(e,t){let n=await Ae(e,{headers:d(t)});return f(n)?!1:n.linked===!0||n.subscribedWithGoogle===!0}function Je(e){let{tamediaId:t}=e,{tenant:n}=b;je(n,t,{headers:d(e)}).then(()=>{console.info(`syncEntitlements completed successfully`)}).catch(e=>{console.error(`syncEntitlements failed:`,e)})}function Ye(){let e=n.get(r);return e?new Date(e.expires)<new Date?(n.remove(r),!1):!0:!1}function B(){let e=new Date;e.setDate(e.getDate()+Ne),n.set(r,{expires:e.toISOString()}),n.remove(i)}function Xe(){let e=(n.get(`subscriptionLinkingPageViews`)??0)+1;return n.set(i,e),e}var Ze={pushHistory:`/app/pushhistory`,pushSettings:`/app/notifications`};function Qe(){let e=document.getElementById(`app-state`);if(!e){console.error(`app-state element not found`);return}try{let t=JSON.parse(e.textContent||`{}`);t.isHybridApp&&$e({isHybridApp:t.isHybridApp,tenant:t.tenant,user:t.user})}catch(e){console.error(`Failed to initialize document event interceptors:`,e)}}function $e(e){let{isHybridApp:t,tenant:n,user:r}=e;if(!t)return;function i(e){return nt(e,r)}function a(e){return et(e,n)}return window.addEventListener(`message`,i,!1),window.addEventListener(`click`,a,{capture:!0}),()=>{window.removeEventListener(`message`,i,!1),window.removeEventListener(`click`,a,{capture:!0})}}function et(e,t){let{target:n}=e;for(;n instanceof Element;){if(n.tagName===`BUTTON`)return;if(n.tagName===`A`){if(n.hasAttribute(`data-is-ticker`)||n.hasAttribute(`data-should-open-flyout`)||n.hasAttribute(`data-logout-url`))return;let r=tt(t,n.getAttribute(`href`));r&&(e.preventDefault(),x(r));break}n=n.parentNode}}function tt(e,t){if(t){let n=`https://www.`+e.key+`.ch`,r=`https://`+e.key+`.ch`;t.startsWith(n)?t=t.replace(n,``):t.startsWith(r)&&(t=t.replace(r,``));let i=`external`;if(t.startsWith(`/`)&&(i=/(\/.+-[0-9]{12}|\/.+-[0-9]{8})/.test(t)?`internalArticle`:`internalCategory`),t.startsWith(`#`))return;if(t.includes(`#event-list`)){let e=t.split(`#`)[0];if(window.location.pathname===e)return}return t===Ze.pushSettings&&(i=`pushNotifications`),{url:t,type:`navigate`,subtype:i}}}function nt(e,t){if(e.origin===`https://buy.tinypass.com`)try{let n=JSON.parse(e.data);if(n.type===`iap`){let e={subtype:`purchase`,type:`iap`,termId:n.termId,identityToken:p(t)};x(e)}}catch(e){console.warn(`interceptIAPMessage JSON parse failed`,e)}}async function rt(t,n,r,i){let a=he();if(!(a!==void 0&&ye(`>`,`13.3.9`,a))||t===`timedOut`)return!1;let o=t.appOnboardingsHistory||[],s=be(r,i,t);return n.some(n=>{let r=!o.includes(n.id||`0`)&&ve(n.triggers,s);return r&&(x({type:`navigate`,subtype:`onboarding`,onboardingData:{title:n.title,screens:n.screens}}),C(e,{...t,appOnboardingsHistory:n.id?[...o,n.id]:o})),r})}function it(){return document.querySelector(`.RefreshButton`)?.classList.contains(`-visible`)??!1}async function at(){let{firstTeaserId:e}=b;if(e){let t=await E({firstTeaserId:e});!f(t)&&t.hasChanged&&document.dispatchEvent(new CustomEvent(`refresh-available`))}}function ot(e){let{appOverlays:t,onboardings:n}=e,r=!1;async function i(){if(document.visibilityState===`visible`){if(!r&&!it()&&(r=!0,setTimeout(async()=>{await at(),r=!1},500)),!n||!t)return;let{user:e,entitlements:i}=u.get();if(!h(e)||!h(i))return;let a=await S(),o=te();n?!await rt(a,n,e,i)&&t&&await w(a,t,e,i,o):t&&await w(a,t,e,i,o)}}document.addEventListener(`visibilitychange`,i)}function st(){window.nativeBridge&&(window.nativeBridge.onPlaybackState=e=>{xe(e)})}function ct(e){let{isHybridApp:t,tenant:r}=b;t&&window.nativeBridge&&st(),t&&e&&window.nativeBridge&&S().then(e=>{e!==`timedOut`&&(window.nativeBridge.onReverseMessage=t=>{lt(t,r,e)},x({type:`appStatus`,subtype:`ready`,isInitialized:!!e.pushConfig}),n.set(`hybridRegion`,e.regional?.categoryPath?.startsWith(`/`)?e.regional?.categoryPath?.slice(1):e.regional?.categoryPath))})}function lt(e,n,r){if(e.type===`appStatusResponse`){let{pushConfig:i}=r,{areNotificationsEnabled:a,deviceToken:o}=e;if(!i){let e={areNotificationsEnabled:a,token:o,isEnrolled:!1};C(t,{...r,pushConfig:e});return}let s=i.token!==o,c=i.areNotificationsEnabled!==a;if(o&&(s||c)){let e=window.nativeBridge.getOS(),t={areNotificationsEnabled:a,token:o,isEnrolled:i.isEnrolled,pushGroups:i.pushGroups};ge(n,e,t,r)}else i.isEnrolled&&o&&_e(n,o,r)}}function ut(){let e=!1;u.subscribe(t=>{let{user:n,entitlements:r}=t;if(n===`loading`||r===`loading`||e)return;e=!0;let i;i=fe(n,r)?`known_subscription`:g(n)?`known`:`anonymous`,window.PARSELY=window.PARSELY||{track_ip_adresses:!1,enableHeartbeats:!0,secondsBetweenHeartbeats:11,activeTimeout:5,autotrack:!1},window.PARSELY.onReady=()=>{window.PARSELY.updateDefaults({data:{user_status:i}}),window.PARSELY.beacon.trackPageView()};let{tenantKey:a}=ne();if(a){let e=document.createElement(`script`);
8e.src=`//cdn.parsely.com/keys/${v===`production`?`${a}.ch`:`sandbox.tamedia`}/p.js`,e.async=!0,document.head.appendChild(e)}else console.error(`Parsely: tenantKey is not set`)})}var V=!1;function dt(){if(V)return;V=!0,se.subscribe(e=>{h(e)&&H(e)});function e(){let e=u.get();h(e.readArticles)&&H(e.readArticles)}document.addEventListener(`reinitializeMetaIcons`,e)}function H(e){document.querySelectorAll(`.teaser[data-teaser-id]`).forEach(t=>{let n=t.datasetAsString(`teaserId`);ft(t,Oe(n,e))})}function ft(e,t){let n=e.querySelector(`.MetaIcons`);if(!n)return;n.classList.toggle(`-read`,t);let r=n.querySelector(`.readIcon`);r&&r.setAttribute(`aria-hidden`,t?`false`:`true`)}function pt(){document.addEventListener(`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`.LoadMoreButton`);t&&!t.hasAttribute(`disabled`)&&(e.preventDefault(),ee(`load-more-button`,{target:t}))})}var mt=300,U=5,W=100;function ht(e){return e.scrollWidth>e.clientWidth+2}function gt(e,t){let n=ht(e);return t.style.display=n?`block`:`none`,n}function _t(e,t,n){let r=t.parentElement;if(!r||!gt(e,r))return;let{scrollLeft:i,scrollWidth:a,clientWidth:o}=e;t.disabled=i<=U,n.disabled=i>=a-o-U}function G(e){return Array.from(e.querySelectorAll(`article`)).filter(e=>{let t=e.classList.contains(`-tempcrass`),n=e.getAttribute(`data-crass-received`)===`true`;return!t||n})}function vt(e,t){let n=Math.max(e.left,t.left),r=Math.min(e.right,t.right);return Math.max(0,r-n)}function yt(e){let t=G(e),n=e.getBoundingClientRect(),{scrollLeft:r,scrollWidth:i,clientWidth:a}=e;if(r>=i-a-U&&t.length>0)return t.length-1;let o=0,s=0;return t.forEach((e,t)=>{let r=vt(e.getBoundingClientRect(),n);r>s&&(s=r,o=t)}),o}function bt(e){let t=e.querySelector(`.indicator, .selectedindicator`),n=t?Array.from(t.classList).find(e=>e.startsWith(`astro-`)):null,r=document.createElement(`div`);r.className=`indicator`,n&&r.classList.add(n),r.setAttribute(`data-index`,e.children.length.toString()),e.appendChild(r)}function xt(e,t){G(e).length>t.children.length&&bt(t);let n=t.querySelectorAll(`.indicator, .selectedindicator`),r=yt(e);n.forEach((e,t)=>{e.classList.toggle(`selectedindicator`,t===r),e.classList.toggle(`indicator`,t!==r)})}function K(){document.querySelectorAll(`.scrollable-section.-is-scrollable`).forEach(e=>{let t=l(`.TeaserList`,e),n=l(`.scroll-buttons`,e),r=l(`.indicators`,e),i=l(`.leftarrow`,n),a=l(`.rightarrow`,n);function o(){_t(t,i,a),xt(t,r)}i.addEventListener(`click`,()=>t.scrollBy({left:-300,behavior:`smooth`})),a.addEventListener(`click`,()=>t.scrollBy({left:mt,behavior:`smooth`})),t.addEventListener(`scroll`,o),window.addEventListener(`resize`,()=>setTimeout(o,W)),new MutationObserver(o).observe(t,{attributes:!0,attributeFilter:[`data-crass-received`],subtree:!0}),setTimeout(o,W)})}function St(){K(),new MutationObserver(e=>{e.some(e=>Array.from(e.addedNodes).some(e=>e instanceof HTMLElement&&(e.classList.contains(`scrollable-section`)||e.querySelector(`.scrollable-section`))))&&K()}).observe(document.body,{childList:!0,subtree:!0})}var q,J=`uninitialized`;function Ct(e){q=e,D(Y),Y(O())}function Y(e){if(!e.allowsPerformance)return Et();if(J===`uninitialized`)return wt(e);J===`stopped`&&window.clarity?.(`start`),J=`running`,X(e)}function wt(e){Tt(),J=`running`,X(e),Dt(),Z(),s(`https://www.clarity.ms/tag/${q}`)}function Tt(){if(window.clarity)return;let e=[];function t(...t){e.push(t)}window.clarity=Object.assign(t,{q:e})}function Et(){J===`running`&&(X({groups:[],allowsPerformance:!1,allowsTargeting:!1}),window.clarity?.(`stop`),J=`stopped`)}function X({allowsPerformance:e,allowsTargeting:t}){window.clarity?.(`consentv2`,{analytics_Storage:e?`granted`:`denied`,ad_Storage:t?`granted`:`denied`})}function Dt(){b.isHybridApp&&window.clarity?.(`set`,`source`,`app`)}function Z(){u.subscribe(({user:e,entitlements:t})=>{!window.clarity||!h(e)||!h(t)||(window.clarity(`set`,`login_status`,g(e)?`logged_in`:`logged_out`),window.clarity(`set`,`subscription_status`,ue(e,t)))})}var{appOverlays:Ot,onboardings:kt,isHybridApp:At,clarityId:Q}=b,$=document.location.pathname===`/`;A(),De(),k(),Q&&Ct(Q),Qe(),oe(),dt(),Ie(),j(),St(),pt(),ut(),ke(),a(),ct($),Se(),M(),$&&At&&ot({appOverlays:Ot,onboardings:kt});

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.