PageSourceSearch

https://account.canapii.com/chunk-P7JGPLGR.js

js canapii.com collected 2026-10-01 12:00:09 UTC 5,403 bytes, 1 lines download raw bytes

1import{a as Q}from"./chunk-7KS4HGJC.js";import{a as f,b as h}from"./chunk-6RCNNY6E.js";import{a as G}from"./chunk-DAROWBAH.js";import"./chunk-RXRKGCUL.js";import"./chunk-LW7CZM4G.js";import"./chunk-EW2NZJHY.js";import"./chunk-GAHMBGQ7.js";import"./chunk-VT7CJSCD.js";import{g as D}from"./chunk-D7LJQ2E3.js";import"./chunk-Y4544WYO.js";import"./chunk-73R64QIM.js";import"./chunk-KOEZPSOA.js";import"./chunk-ZEL44FAF.js";import"./chunk-RT33Z4W3.js";import"./chunk-CTTXKPH2.js";import"./chunk-CT5YU3F2.js";import{e as F,j as C}from"./chunk-B5NVKW3K.js";import{k as H,z as N}from"./chunk-MRC2PHN7.js";import{A as T,Ec as c,Fa as a,Fc as l,Gc as m,Hc as _,Ib as x,Jb as d,Lc as B,Mc as A,Od as O,Wb as y,Xc as w,Zc as I,bc as M,bd as P,cc as p,cd as R,dd as S,gc as b,hd as j,jd as U,ld as v,md as L,z as k}from"./chunk-77LCFR2D.js";import{i as z,l as s}from"./chunk-6G35VSEK.js";var u=z(G());function J(t,E){t&1&&(l(0,"div",5)(1,"span",6),v(2,"Loading..."),m()())}function K(t,E){if(t&1&&(B(0),l(1,"div",3),b(2,J,3,0,"div",4),m(),A()),t&2){let e=I(),i=j(3);d(2),c("ngIf",!(e.errorMessage!=null&&e.errorMessage.length))("ngIfElse",i)}}function W(t,E){if(t&1&&(l(0,"p"),v(1),m()),t&2){let e=I();d(),L(e.errorMessage)}}var g=(()=>{class t{constructor(e,i){this.analyticsService=e,this.activatedRoute=i,this.isEmbedded=!1,this.isLoaded=!1,this.subscriptions=[],this.reportConfig={type:"report",id:void 0,embedUrl:void 0,tokenType:u.models.TokenType.Embed,accessToken:void 0,settings:void 0,hostname:"https://app.powerbi.com"},this.eventHandlersMap=new Map([["loaded",()=>{this.reportObj.getReport().setComponentTitle("Canapii analytics"),this.isLoaded=!0}],["rendered",()=>{this.refreshInterval&&clearInterval(this.refreshInterval),this.refreshInterval=setInterval(()=>{this.checkTokenAndUpdate()},3e4)}],["error",n=>{n&&console.error(n.detail)}]])}ngOnInit(){this.subscriptions.push(T([this.activatedRoute.url.pipe(k(e=>e[0].path)),this.analyticsService.analyticsNewSubmenuObservable]).subscribe(n=>s(this,[n],function*([e,i]){let r=i?.find(o=>o.basePath===e);if(i?.length&&!r){this.errorMessage="Failed to fetch the report";return}if(this.tokenExpiration&&this.isTokenExpired()&&r?.embedInfo?.expiry!==this.tokenExpiration){this.tokenExpiration=r.embedInfo.expiry;let o=this.reportObj.getReport();yield o.setAccessToken(r.embedInfo.accessToken),yield o.reload();return}this.tokenExpiration=r?.embedInfo?.expiry,this.isTokenExpired()&&!this.tokenExpiration&&(this.refreshToken(),r={embedInfo:{embedUrl:[void 0],accessToken:void 0}}),this.reportConfig={type:"report",embedUrl:r.embedInfo.embedUrl[0]?.embedUrl,accessToken:r.embedInfo.accessToken,tokenType:u.models.TokenType.Embed,settings:{filterPaneEnabled:!0,layoutType:u.models.LayoutType.Custom,bookmarksPaneEnabled:!1}},this.isEmbedded=!0})))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.refreshInterval&&clearInterval(this.refreshInterval)}getEmbedLink(){return s(this,null,function*(){try{yield this.analyticsService.getAnalyticsBI()}catch(e){console.error("Failed to get embed link:",e),this.errorMessage="Failed to fetch the report"}})}isTokenExpired(e){if(!e&&!this.tokenExpiration)return!0;let i=Date.now(),r=Date.parse(e||this.tokenExpiration)-i,o=600*1e3;return r<=o}checkTokenAndUpdate(){this.isTokenExpired()&&this.refreshToken()}refreshToken(){return s(this,null,function*(){try{yield this.analyticsService.getAnalyticsBI()}catch{this.isEmbedded=!1,this.errorMessage="Failed to refresh the token. Please refresh the page."}})}visibilityChange(e){this.checkTokenAndUpdate()}static{this.\u0275fac=function(i){return new(i||t)(y(Q),y(F))}}static{this.\u0275cmp=M({type:t,selectors:[["ng-component"]],viewQuery:function(i,n){if(i&1&&P(f,5),i&2){let r;R(r=S())&&(n.reportObj=r.first)}},hostBindings:function(i,n){i&1&&w("visibilitychange",function(o){return n.visibilityChange(o)},x)},decls:4,vars:7,consts:[["errorMessageTemplate",""],[3,"embedConfig","eventHandlers","cssClassName","phasedEmbedding"],[4,"ngIf"],[1,"d-flex","justify-content-center","align-items-center","vh-100"],["class","spinner-border","role","status",4,"ngIf","ngIfElse"],["role","status",1,"spinner-border"],[1,"visually-hidden"]],template:function(i,n){i&1&&(_(0,"powerbi-report",1),b(1,K,3,2,"ng-container",2)(2,W,2,1,"ng-template",null,0,O)),i&2&&(U("d-none",!n.isEmbedded||!n.isLoaded),c("embedConfig",n.reportConfig)("eventHandlers",n.eventHandlersMap)("cssClassName","pbi-report-container")("phasedEmbedding",!1),d(),c("ngIf",!n.isEmbedded||!n.isLoaded))},dependencies:[h,f,H],styles:["[_nghost-%COMP%]{padding:0!important;margin:0!important}[_nghost-%COMP%]     .pbi-report-container{height:calc(100vh - 71px)}iframe[_ngcontent-%COMP%]{border:none}  .page-analytics-bi{padding:0!important;margin:0!important}  .page-analytics-bi .content-body{padding:0!important;margin:0!important}  .page-analytics-bi main{padding:0!important;margin:0!important}  .page-analytics-bi .my-5{display:none}"]})}}return t})();var X=[{path:":id",component:g,data:{reuse:!0,pageId:"analytics-bi"}}],V=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=p({type:t})}static{this.\u0275inj=a({imports:[C.forChild(X),C]})}}return t})();var fe=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=p({type:t})}static{this.\u0275inj=a({imports:[N,V,D,h,g]})}}return t})();export{fe as AnalyticsBIModule};

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.