PageSourceSearch

https://www.svenskhockey.tv/build/p-b65e6980.entry.js

js svenskhockey.tv collected 2026-10-06 19:25:00 UTC 12,012 bytes, 1 lines download raw bytes

1import{r as s,B as t,h as i}from"./p-BfiO-GnF.js";import{G as a,a as e,A as o,z as n,$ as h,U as c,s as r,Y as d,al as l,B as p,H as m,ab as u,aa as C,i as g,l as v,ae as w,O as S,y as T,c as E,P as b,S as P}from"./p-DQw3aa6Y.js";import{U as f}from"./p-DJsGqBIS.js";import{C as y}from"./p-CnIJ_mi2.js";import{a as I,m as _,p as k}from"./p-vpVk1EJj.js";import{g as N}from"./p-1JSYZCwG.js";import{P as A}from"./p-B0731Yan.js";import{s as O}from"./p-VQu1qMTi.js";import"./p-AuPLCHfl.js";import"./p-E-ZsRS8r.js";import"./p-B3rt3ERk.js";import"./p-C9XQO4Tr.js";import"./p-B_-dwzkt.js";import"./p-CEkafJrf.js";import"./p-B5yexDit.js";import"./p-CWgfNgqu.js";import"./p-Dwv6KnWp.js";const U=class{constructor(t){s(this,t),this.editMode=!1,this.userFavoriteCards=[],this.transactionPageIndex=0,this.transactionPageSize=12,this.favoritePageIndex=0,this.favoritePageSize=20,this.showFavorites=!1,this.multiAccessSite=[],this.productPackages=[],this.groupService=a,this.toasterService=e}async componentWillLoad(){this.siteConfig=o.siteConfig,this.isApp=n.isApp(),this.updateScreenBreakpoints(),this.allowTrackingIOS=localStorage.getItem("tracking-preference");const s="true"===new URLSearchParams(window.location.search).get("unsubscribeEmail");window.addEventListener("resize",(()=>{this.updateScreenBreakpoints()})),this.productPackages=await h.getProductPackagesBySiteId(this.siteConfig.siteId),t.isBrowser&&(c.getUser().then((async t=>{var i,e;t&&(this.user=t,this.firstName=t.firstName,this.lastName=t.lastName,this.emailAddress=t.emailAddress,await a.getGroupById(null===(e=null===(i=this.user)||void 0===i?void 0:i.kickbackGroup)||void 0===e?void 0:e.id,o.siteConfig.siteId).then((s=>{s&&(this.user.kickbackGroup=s,this.kickbackGroup=s,this.kickbackGroupCard=y.fromGroup(this.user.kickbackGroup))})),await this.getActiveSubscriptions(t).then((async()=>{this.getMultiAccessSiteInfo()})),this.transactions=await this.getTransactions(t),s&&await this.openCookieConsentModal())})),this.groupService.getGroups({type:r.CLUB}).then((async s=>{var t;this.clubs=null===(t=await y.fromGroups(s))||void 0===t?void 0:t.sort(((s,t)=>s.title.localeCompare(t.title,this.siteConfig.locale))),o.siteConfig.useKickbackGroup&&(this.clubs=y.shiftPrefKickbacksToTopOfList(this.clubs))})),this.showFavorites=await f.userHasAnyFavoriteFeature(),this.showFavorites&&await this.createUserFavoriteCards())}updateScreenBreakpoints(){const s=O();this.screenWidth=s.screenWidth,this.smallScreen=s.smallScreen,this.extraSmallScreen=s.extraSmallScreen,this.minimalScreen=s.minimalScreen}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}transactionRequest(){return{siteId:this.siteConfig.siteId,pageSize:this.transactionPageSize.toString(),pageIndex:this.transactionPageIndex.toString(),sortOrder:d.DESC,sortColumn:"created"}}async getTransactions(s){return new Promise((async t=>{const i=await l.getAggregatedTransactions(s.id,this.transactionRequest());i&&0!==i.length||t([]);const a=i.map((s=>s.broadcastId)).filter((s=>void 0!==s)),e=p.getBroadcasts({broadcastId:a}),o=i.map((s=>s.internalProductId)).filter((s=>void 0!==s)),n=m.getProducts({id:o}),[h,c]=await Promise.all([e,n]);i.forEach((s=>{var t;const i=c.find((t=>t.id===s.productId)),a=null==h?void 0:h.find((t=>t.id===s.broadcastId));if((null==i?void 0:i.targetType)===u.COMPETITION){const i=null===(t=null==a?void 0:a.competition)||void 0===t?void 0:t.name;s.productName=i||s.productName}(null==i?void 0:i.targetType)===u.BROADCAST&&(s.productName=a?N(a):s.productName)})),t(i||[])}))}async getActiveSubscriptions(s){const t=await c.getUserAccess({userId:s.id,siteId:o.siteConfig.siteId},!1),i=t.map((s=>s.productId)),a=await m.getProducts({siteId:o.siteConfig.siteId,id:i,includeArchived:!0,providerType:[C.REDEEMABLE,C.EXTERNAL,C.STRIPE]});return t.map((s=>s.product=a.find((t=>t.id===s.productId)))),this.userPurchases=t,this.userPurchases.length>0&&this.userPurchases.forEach((s=>{const t=this.productPackages.find((t=>t.productIds.includes(s.productId)));t&&(s.productPackageId=t.id)})),this.userPurchases}navigateToProductPackage(s){A.goTo(s?`/package/${s}`:"/subscriptions")}
1async manageExternalPurchase(s){s&&s.extManagementUrl?window.open(s.extManagementUrl,"_blank"):e.presentErrorToast({message:"External management URL is not available, check with your administrator"})}async confirmCancelSubscription(s){const t=await I.create({header:g("ACCOUNT_PAGE.END_SUBSCRIPTION_CONFIRM_TITLE"),message:g("ACCOUNT_PAGE.END_SUBSCRIPTION_CONFIRM_TEXT"),buttons:[{text:g("ACCOUNT_PAGE.END_SUBSCRIPTION_CANCEL_BUTTON"),role:"cancel"},{text:g("ACCOUNT_PAGE.END_SUBSCRIPTION_CONFIRM_BUTTON"),handler:()=>{this.cancelSubscription(s)}}]});await t.present()}async cancelSubscription(s){v.loadingPresent();const t=o.siteConfig.siteId;await w.remove(`user-access-${this.user.id}`),await l.cancelSubscription(null,s.productId,t,this.user.id,this.user.emailAddress).then((async t=>{t?((null==s?void 0:s.validTo)&&await c.updateRefreshToken(),this.toasterService.presentToast({message:g("ACCOUNT_PAGE.END_SUBSCRIPTION_SUCCESS")}),v.loadingDismiss()):(this.toasterService.presentErrorToast({message:g("ACCOUNT_PAGE.END_SUBSCRIPTION_FAILED")}),v.loadingDismiss())})),this.userPurchases=[...await this.getActiveSubscriptions(this.user)]}async regretChanges(){var s;this.firstName=this.user.firstName,this.lastName=this.user.lastName,this.kickbackGroupCard=await y.fromGroup(null===(s=this.user)||void 0===s?void 0:s.kickbackGroup),this.editMode=!1}async favoriteClubSelected(s){if(this.kickbackGroup=s.detail.data,this.kickbackGroup){v.loadingPresent(),this.user.kickbackGroup=this.kickbackGroup;try{const s=await c.updateUser(this.user);this.kickbackGroupCard=y.fromGroup(s.kickbackGroup)}catch(s){console.error("Could not set kickbackGroup")}finally{v.loadingDismiss()}}}async saveChanges(){this.firstName&&(this.user.firstName=this.firstName),this.lastName&&(this.user.lastName=this.lastName),this.kickbackGroup&&(this.user.kickbackGroup=this.kickbackGroup,this.userFavoriteCards.filter((s=>s.data.name===this.kickbackGroup.name)).length>0||S.createUserFavorite({type:T.CLUB,siteId:this.siteConfig.siteId,userId:this.user.id,image:this.kickbackGroup.logo,name:this.kickbackGroup.name,groupId:this.kickbackGroup.id,slug:this.kickbackGroup.slug}).then((()=>this.createUserFavoriteCards()))),this.user=await c.updateUser(this.user),e.presentToast({message:g("GAME_PAGE.EVENT_INFO_UPDATE_SUCCESS")}),this.editMode=!1}async deleteAccount(){try{v.loadingPresent(),await c.deleteUser(this.user.id).then((async()=>{await e.presentToast({message:g("DELETE_ACCOUNT_TOASTER_TEXT")})})),await E.logout({platform:b.PLAYSITE,routeTo:"/start",reload:!0}),v.loadingDismiss()}catch(s){console.error("Failed to deleteUser",s)}}async createUserFavoriteCards(){var s;const t=await S.getUserFavorites({siteId:o.siteConfig.siteId,userId:null===(s=o.currentUser)||void 0===s?void 0:s.id,pageIndex:this.favoritePageIndex,pageSize:this.favoritePageSize});this.userFavoriteCards=await y.fromUserFavorites(t),this.unsubscribe=o.onChange("currentUser",(async()=>{o.oldUserState||(this.userFavoriteCards=await y.fromUserFavorites(t))})),this.addDeleteBtnToUserFavoriteCards()}async getMultiAccessSiteInfo(){this.multiAccessSite=[];const s=this.userPurchases.flatMap((s=>{var t;return null===(t=s.product)||void 0===t?void 0:t.features.filter((s=>s.data&&s.data.siteId)).map((s=>s.data.siteId))}));if(s.length>0){const t=s.map((s=>P.getMultiAccessSite(s))),i=await Promise.all(t);this.multiAccessSite=i.filter((s=>null!==s)).map(((t,i)=>Object.assign(Object.assign({},t),{siteId:s[i]})))}}addDeleteBtnToUserFavoriteCards(){for(let s=0;s<this.userFavoriteCards.length;s++)this.userFavoriteCards[s].buttons=[{action:()=>{this.removeUserFavorite(this.userFavoriteCards[s])},icon:"trash-outline",iconColor:"danger"}]}async removeUserFavorite(s){S.removeUserFavorite(s.data.id).then((()=>{this.userFavoriteCards=this.userFavoriteCards.filter((t=>t.data.id!==s.data.id))}))}goToFavorite(s){s.detail.handleClick()}async navigateToCustomerPortal(){const s=null===location||void 0===location?void 0:location.href;s?(v.loadingPresent(),await l.customerPortal(this.user.id,this.siteConfig.siteId,s,"STRIPE").then((s=>{s?window.location.replace(s.url):e.presentToast({message:g("ACCOUNT_PAGE.NO_ADDED_PAYMENT_METHOD")}),v.loadingDismiss()}))):e.presentErrorToast({message:`${g("ACCOUNT_PAGE.RETURN_URL_ERROR_MESSAGE")}`})}async openChangePasswordModal(){const s=await _.create({component:"app-change-password-modal",cssClass:"modal-small",componentProps:{}});await s.present()}async openCookieConsentModal(){const s=await _.create({component:"app-cookie-sett
1ings-modal"});await s.present()}handleTransactionPageIndex(s){this.transactionPageIndex=s,this.getTransactions(this.user).then((s=>{this.transactions=s}))}handleTransactionPageSize(s){this.transactionPageSize=s,this.getTransactions(this.user).then((s=>{this.transactions=s}))}async handleFavoritePageIndex(s){this.favoritePageIndex=s,await this.createUserFavoriteCards()}async handleFavoritePageSize(s){this.favoritePageSize=s,await this.createUserFavoriteCards()}async openDeleteUserPopover(){const s=await k.create({component:"app-delete-account-popover",componentProps:{deleteCallback:()=>this.deleteAccount()},cssClass:"popover-wider"});await s.present()}render(){var s;return i("ion-content",{key:"18762c9c0c6d8006cedec7385026e7f85b9d9ef6"},i("app-page",{key:"c584f37c7077b877ad5993960e823b3474b4ea03"},i("app-header",{key:"961c3d209343d277d6cd30ec80ba2e1e18bbc0dd",mainTitle:g("SIDE_MENU.ACCOUNT")}),i("app-page-body",{key:"c19ba1e883940f79460074677dcc3ac7297b30ce"},i("ion-item-divider",{key:"e22c7c5c58f3a1680b1489e1a98e19528f3e7c82"}),i("app-user-info-section",{key:"ef49f2f9c958a5917945d830fb7313dec891c21b",firstName:this.firstName,lastName:this.lastName,emailAddress:this.emailAddress,editMode:this.editMode,kickbackGroupCard:this.kickbackGroupCard,clubs:this.clubs,useKickbackGroup:null===(s=this.siteConfig)||void 0===s?void 0:s.useKickbackGroup,smallScreen:this.smallScreen,extraSmallScreen:this.extraSmallScreen,allowTrackingIOS:this.allowTrackingIOS,isApp:this.isApp,onFirstNameChange:s=>this.firstName=s.detail,onLastNameChange:s=>this.lastName=s.detail,onEditModeToggle:s=>this.editMode=s.detail,onKickbackGroupChange:s=>this.kickbackGroup=s.detail,kickbackGroup:this.kickbackGroup,onFavoriteClubSelected:s=>this.favoriteClubSelected({detail:{data:s.detail}}),onOpenChangePassword:()=>this.openChangePasswordModal(),onOpenCookieConsent:()=>this.openCookieConsentModal(),onOpenDeleteUser:()=>this.openDeleteUserPopover(),onSaveChanges:()=>this.saveChanges(),onRegretChanges:()=>this.regretChanges()}),this.showFavorites&&i("app-favorites-section",{key:"bf747838bd41a59c25bab3a2eb55f1e969a853c4",userFavoriteCards:this.userFavoriteCards,favoritePageIndex:this.favoritePageIndex,favoritePageSize:this.favoritePageSize,onPageIndexChange:s=>this.handleFavoritePageIndex(s.detail),onPageSizeChange:s=>this.handleFavoritePageSize(s.detail)}),i("app-subscriptions-section",{key:"5e5da587ab1299a43ee42f526c8d51c994f3f773",userPurchases:this.userPurchases,multiAccessSite:this.multiAccessSite,emailAddress:this.emailAddress,smallScreen:this.smallScreen,extraSmallScreen:this.extraSmallScreen,isApp:this.isApp,onManageBilling:()=>this.navigateToCustomerPortal(),onCancelSubscription:s=>this.confirmCancelSubscription(s.detail),onManageExternal:s=>this.manageExternalPurchase(s.detail.product),onNavigateToPackage:s=>this.navigateToProductPackage(s.detail)}),i("app-transactions-section",{key:"90b2594010f5094aa47f6c085138b361e38d57a8",transactions:this.transactions,smallScreen:this.smallScreen,transactionPageIndex:this.transactionPageIndex,transactionPageSize:this.transactionPageSize,onPageIndexChange:s=>this.handleTransactionPageIndex(s.detail),onPageSizeChange:s=>this.handleTransactionPageSize(s.detail)}))))}};U.style=".account-page ion-row:nth-child(even){background:var(--ion-color-light)}.ion-link-button{cursor:pointer}";export{U as app_account_page}

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.