/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@boldbi/boldbi-embedded-sdk@15.2.6/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.widgetBI=exports.BoldBI=void 0;const embeddingLocalization_1=require("./types/embeddingLocalization"),enum_1=require("./types/enum"),default_1=require("./types/default"),sdk_deprecation_utils_1=require("./utils/sdk_deprecation_utils");let bbEmbed,tabInstance;class BoldBI{constructor(e){this._authorizeResponse=null,this.loadPinboard=this.Invoke((function(){if(!this.invalidDetail){if(""==this.embedOptions.pinboardName)throw new Error(embeddingLocalization_1.errorMessages.PinboardNameEmpty);if(this.embedOptions.mode!=BoldBI.Mode.View)throw new Error(embeddingLocalization_1.errorMessages.UnablePinboardRender);if(this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],!this._checkWidgetList())if(this.embedOptions.embedType==BoldBI.EmbedType.Component)this._setEmbedDefaults(),this.isPinboardRendering=!0,this._showLoader(),this._isDependencyLoaded(this);else if(this.embedOptions.embedType==BoldBI.EmbedType.IFrame){const e=document.createElement("iframe");e.frameBorder=0,e.width=this.embedOptions.width,e.height=this.embedOptions.height,e.id=this.embedOptions.embedContainerId+"_"+this.embedOptions.dashboardId,e.allowfullscreen=this.embedOptions.dashboardSettings.showFullScreen,e.setAttribute("src",this.embedOptions.serverUrl+"/dashboards/"+this.embedOptions.dashboardId+"?isembed=true"),document.getElementById(this.embedOptions.embedContainerId).appendChild(e)}}})),this.loadDatasource=this.Invoke((function(){if(!this.invalidDetail&&((this.embedOptions.dashboardId||this.embedOptions.dashboardPath)&&(this.embedOptions.dashboardId=this.embedOptions.dashboardPath=""),""!=this.embedOptions.pinboardName&&(this.embedOptions.pinboardName=""),!this._checkWidgetList())){if(this.embedOptions.mode!=BoldBI.Mode.DataSource&&this.embedOptions.mode!=BoldBI.Mode.Connection)throw new Error(embeddingLocalization_1.errorMessages.EmbedModeInvalid);if(this.embedOptions.embedType==BoldBI.EmbedType.Component)this.isWidgetMode=!1,this.widgetName="",this.isDashboardViewMode=!1,this.dashboardViewName="",this._showLoader(),this._isDependencyLoaded(this);else if(this.embedOptions.embedType==BoldBI.EmbedType.IFrame){const e=document.createElement("iframe");e.frameBorder=0,e.width=this.embedOptions.width,e.height=this.embedOptions.height,e.id=this.embedOptions.embedContainerId+"_"+this.embedOptions.datasourceId,e.allowfullscreen=this.embedOptions.dashboardSettings.showFullScreen,e.setAttribute("src",this.embedOptions.serverUrl+"/datasource-designer/"+this.embedOptions.datasourceId+"?isembed=true"),document.getElementById(this.embedOptions.embedContainerId).appendChild(e)}}})),this.viewer={refresh:()=>{this.deprecated=!1,this.refreshDashboard()},resize:()=>{this.deprecated=!1,this.resizeDashboard()},resetFilter:()=>{this.deprecated=!1,this.clearAllFilter()},updateFilters:e=>{this.deprecated=!1,this.updateFilters(e)},exportAsExcel:e=>{this.deprecated=!1,e.widgetName?this.exportWidgetAsExcel(e):this.exportDashboardAsExcel(e)},exportAsImage:e=>{this.deprecated=!1,e.widgetName?this.exportWidgetAsImage(e):this.exportDashboardAsImage(e)},exportAsPdf:e=>{this.deprecated=!1,e.widgetName?this.exportWidgetAsPdf(e):this.exportDashboardAsPdf(e)},exportAsCSV:e=>{this.deprecated=!1,e.widgetName&&this.exportWidgetAsCsv(e)},addComment:(e,i)=>{this.deprecated=!1,e.widgetId?this.addWidgetComment(e,i):this.addDashboardComment(e,i)},editComment:(e,i)=>{this.deprecated=!1,e.widgetId?this.editWidgetComment(e,i):this.editDashboardComment(e,i)},deleteComment:(e,i)=>{this.deprecated=!1,e.widgetId?this.deleteWidgetComment(e,i):this.deleteDashboardComment(e,i)},fetchComments:(e,i,t)=>{this.deprecated=!1,this.getComments(e,i,t)}},this.pinboard={addWidget:(e,i,t)=>{this.deprecated=!1,this.addWidgetToPinboard(e,i,t)}},this.dataSource={refresh:()=>{this.deprecated=!1,this.updateDatasource()}},this.designer={publish:(e,i)=>{this.deprecated=!1,this.saveDashboard(e,i)}},this.widget={fetchData:(e,i,t)=>{this.deprecated=!1,this.getWidgetData(e,i,t)},refresh:(e,i,t)=>{this.deprecated=!1,this.refreshWidgetData(e,i,t)},getInstance:e=>(this.deprecated=!1,this.getWidgetInstance(e)),updatefilters:e=>{this.deprecated=!1,this.updateWidgetFilters(e)},dispose:e=>{this.deprecated=!1,this.removeWidgetInstance(e),this.deprecated=!1}},this.view={delete:(e,i)=>{this.deprecated=!1,this.deleteFilterView(e,i)},update:(e,i)=>{this.deprecated=!1,this.updateFilterView(e,i)},save:(e,i)=>{this.deprecated=!1,this.saveFilterView(e,i)},saveAs:(e,i)=>{this.deprecated=!1,this.saveAsFilterView(e,i)},fetchById:(e,i)=>{this.deprecated=!1,this.getViewByViewId(e,i)},fetchByDashboardId:(e,i)=>{this.deprecated=!1,this.getViewsByDashboardId(e,i)}},this._initializeUrls=this.Invoke((function(){if(this.embedOptions.enableDomainMasking){if(""===this.embedOptions.authorizationServer.url&&""===this.embedOptions.token&&""===this.embedOptions.embedToken)return this.designerRootUrl=this.embedOptions.serverUrl,!0;throw new Error(embeddingLocalization_1.errorMessages.DomainMaskingError)}if(this.embedOptions.serverUrl.indexOf("/bi")<=0)throw new Error(embeddingLocalization_1.errorMessages.InvalidBoldBIURL);return this.embedOptions.environment==BoldBI.Environment.Enterprise?(this.rootUrl=this.embedOptions.serverUrl.substr(0,this.embedOptions.serverUrl.indexOf("/bi/")>=0?this.embedOptions.serverUrl.indexOf("/bi/")+3:this.embedOptions.serverUrl.indexOf("/bi")+3),this.baseUrl=this.embedOptions.serverUrl,this.siteIdentifier=this.embedOptions.serverUrl.indexOf("/site/")>=0?this.embedOptions.serverUrl.substr(this.embedOptions.serverUrl.indexOf("/site/")+1):"",this.dashboardServerApiUrl=this.rootUrl+"/api"+(this._isEmptyOrSpaces(this.siteIdentifier)?"":"/"+this.siteIdentifier),this.designerRootUrl=this.rootUrl+"/designer",this.customThemeUrl=this.rootUrl.replace(/\/bi(?!.*\/bi)/,"/ums/theme/styles")):(this.rootUrl=this.embedOptions.serverUrl.endsWith("/")?this.embedOptions.serverUrl.slice(0,-1):this.embedOptions.serverUrl,this.baseUrl=this.embedOptions.serverUrl,this.siteIdentifier="",this.dashboardServerApiUrl=this.rootUrl+"/api"),this.scheduleEndpointUrl=this.baseUrl+"/datasources/recurrence-type-page",!0})),this._addJquerydependentFiles=this.Invoke((function(){if(this._checkDepedentFileExists(this.jQueryDepedentFile,!1)||null!=window.jQuery&&"3.5.0"==window.jQuery().jquery){const e=setInterval((()=>{window.jQuery&&(clearInterval(e),bbEmbed=window.bbEmbed=window.$,void 0!==window.bb$&&(bbEmbed=window.bbEmbed=window.bb$),this._addWrapperDependentFiles(this,this.wrapperDependentScriptFiles),this._loadDepedentFiles())}),1e3)}else{const i=document.createElement("script");if(this.embedOptions.environment==BoldBI.Environment.Enterprise){var e=this.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+this.jQueryDepedentFile:this.rootUrl+"/cdn/scripts/designer/"+this.jQueryDepedentFile;i.setAttribute("src",e)}else i.setAttribute("src",this.cdnLink+"/scripts/designer/"+this.jQueryDepedentFile);this.embedOptions.nonce&&(i.nonce=this.embedOptions.nonce),document.head.appendChild(i),i.onload=()=>{try{const e=document.createElement("script");e.append(this.jqConflictFile),this.embedOptions.nonce&&(e.nonce=this.embedOptions.nonce),document.head.appendChild(e),bbEmbed=window.bbEmbed=window.bb$,this._addWrapperDependentFiles(this,this.wrapperDependentScriptFiles),this._loadDepedentFiles()}catch(e){this._throwError(embeddingLocalization_1.errorMessages.ServerNotFound),this.invalidDetail=!0}},i.onerror=e=>this._handleEnvironmentError(e)}})),this._renderDashboard=this.Invoke((function(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B,C,x,A,M,F,T,k,L,N,z,W,P,U,V,R,$,j,H,q,Q,J,G,K,X,Y,Z,ee,ie,te,se,oe,ne,de,ae,re,le,be,me,he,ce,pe,ue,ge,ve,fe,we,Ie,Oe,_e,ye,Ee,De,Se,Be,Ce,xe,Ae,Me,Fe,Te,ke,Le,Ne,ze,We,Pe,Ue,Ve,Re,$e,je,He,qe,Qe,Je,Ge,Ke,Xe,Ye,Ze,ei,ii,ti,si,oi,ni,di,ai,ri,li,bi,mi,hi,ci,pi,ui,gi,vi,fi,wi,Ii,Oi,_i,yi,Ei,Di,Si,Bi,Ci,xi,Ai,Mi,Fi,Ti,ki,Li,Ni,zi,Wi,Pi,Ui,Vi,Ri,$i,ji,Hi,qi,Qi,Ji,Gi,Ki,Xi,Yi,Zi,et,it,tt,st,ot,nt,dt,at,rt,lt,bt,mt,ht,ct,pt,ut,gt,vt,ft,wt,It,Ot,_t,yt,Et,Dt,St,Bt,Ct,xt,At,Mt,Ft,Tt,kt,Lt,Nt,zt,Wt,Pt,Ut,Vt,Rt,$t,jt,Ht,qt,Qt,Jt,Gt,Kt,Xt,Yt,Zt,es,is,ts,ss,os,ns,ds,as,rs,ls,bs,ms,hs,cs,ps,us,gs,vs,fs,ws,Is,Os,_s,ys,Es,Ds,Ss,Bs,Cs,xs,As,Ms,Fs,Ts,ks,Ls,Ns,zs,Ws,Ps,Us,Vs,Rs,$s,js,Hs,qs,Qs,Js,Gs,Ks,Xs,Ys,Zs,eo,io,to,so,oo,no,ao,ro,lo,bo,mo,ho,co,po,uo,go,vo,fo,wo,Io,Oo,_o,yo,Eo,Do,So,Bo,Co,xo,Ao,Mo,Fo,To,ko,Lo,No,zo,Wo,Po,Uo,Vo,Ro,$o,jo,Ho,qo,Qo,Jo,Go,Ko,Xo,Yo,Zo,en,tn,sn,on,nn,dn,an,rn,ln,bn,mn,hn,cn,pn,un,gn,vn,fn,wn,In,On,_n,yn,En,Dn,Sn,Bn,Cn,xn,An,Mn,Fn,Tn,kn,Ln,Nn,zn,Wn,Pn,Un,Vn,Rn,$n,jn,Hn,qn,Qn,Jn,Gn,Kn,Xn,Yn,Zn,ed,id,td,sd,od,nd,dd,ad,rd,ld,bd,md,hd,cd,pd,ud,gd,vd,fd,wd,Id,Od,_d,yd,Ed,Dd,Sd,Bd,Cd,xd,Ad;const Md=this;if(null==e)throw new Error(embeddingLocalization_1.errorMessages.NullResponse);const Fd=e.Data;if(!e.Status&&!this.embedOptions.enableDomainMasking)throw e.errorMessage==embeddingLocalization_1.errorMessages.PageUnavailable&&(e.Status=!1,e.Message=e.errorMessage),e.Message===embeddingLocalization_1.errorMessages.ObjectRefNotSet&&("view"!==this.embedOptions.mode&&"design"!==this.embedOptions.mode||(this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&this._isEmptyOrSpaces(this.embedOptions.dashboardPath)||(e.Message=embeddingLocalization_1.errorMessages.InvalidDbrdDetails),this._isEmptyOrSpaces(this.embedOptions.pinboardName)||(e.Message=embeddingLocalization_1.errorMessages.InvalidPinboardName))),null==e.Message?new Error(embeddingLocalization_1.errorMessages.InvalidResponse):new Error(e.Message);{if(Array.isArray(e.Data)&&this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&this._isEmptyOrSpaces(this.embedOptions.dashboardPath)){for(const i of e.Data)if("ErrorMessage"in i){const t=`BoldBI Embedded: ${i.ErrorMessage}`;if(this._isNullOrUndefined(this.embedOptions.events.onError)||""===this.embedOptions.events.onError)console.error(t);else{const e=new Error(t);this.onErrorClient(e)}e.Data=e.Data.filter((e=>e!==i))}if(Fd.filter((e=>"ErrorMessage"in e&&e.ErrorMessage.includes("Access denied for the item"))).length===Fd.length)throw new Error(embeddingLocalization_1.errorMessages.AccessDeniedItem);if(!e.Data.length)throw new Error(embeddingLocalization_1.errorMessages.InvalidDbrdDetails)}const kd=e.Data;if(""!=this.embedOptions.pinboardName&&0==this.pinboardIds.length){if(!kd.ColumnInfo)throw new Error(embeddingLocalization_1.errorMessages.InvalidPinboardName);this._renderPinboard(kd)}else if(!this._isNullOrUndefined(kd)&&kd.length){if(this.isWidgetMode){const e=document.getElementById(this.embedOptions.embedContainerId);throw BoldBI._hasinstance(e,"embeddedBoldBI")&&BoldBI._removeinstance(e,"embeddedBoldBI"),new Error(embeddingLocalization_1.errorMessages.MultitabDbrdWidgetRender)}if(this.embedOptions.mode!=BoldBI.Mode.View){const e=document.getElementById(this.embedOptions.embedContainerId);throw BoldBI._hasinstance(e,"embeddedBoldBI")&&BoldBI._removeinstance(e,"embeddedBoldBI"),new Error(embeddingLocalization_1.errorMessages.NotRenderMultitabDashboard)}this._renderMultiTabDashboard(kd)}else{let Fd;this.embedOptions.enableDomainMasking||(kd.ItemDetail=this.embedOptions.mode!==BoldBI.Mode.Connection?this.embedOptions.token||this.embedOptions.embedToken||"string"!=typeof e.Data.ItemDetail?e.Data.ItemDetail:JSON.parse(e.Data.ItemDetail):null),this.embedOptions.token||this.embedOptions.enableDomainMasking||this.embedOptions.isPublicDashboard||this.embedOptions.embedToken||((this.embedOptions.mode==BoldBI.Mode.View||kd.ItemDetail&&kd.ItemDetail.IsEnableDefaultView)&&(this.isDefaultView=kd.ItemDetail.IsEnableDefaultView,this.embedOptions.dashboardSettings=this.embedOptions.dashboardSettings||{},this.embedOptions.dashboardSettings.filterOverviewSettings=this.embedOptions.dashboardSettings.filterOverviewSettings||{},this.embedOptions.settings=this.embedOptions.settings||{},this.embedOptions.settings.viewer=this.embedOptions.settings.viewer||{},this.embedOptions.settings.viewer.filterOverview=this.embedOptions.settings.viewer.filterOverview||{},kd.ItemDetail.ItemViews&&(this.embedOptions.dashboardSettings.filterOverviewSettings.viewId=this.embedOptions.settings.viewer.filterOverview.viewId=kd.ItemDetail.ItemViews[0].ViewId,this.embedOptions.dashboardSettings.filterOverviewSettings.viewName=this.embedOptions.settings.viewer.filterOverview.ViewName=kd.ItemDetail.ItemViews[0].ViewName,this.embedOptions.filterParameters=kd.ItemDetail.ItemViews[0].QueryString)),this.embedOptions.mode==BoldBI.Mode.View&&(this.dashboardUrl="/dashboard/"+kd.ItemDetail.Id+"/"+kd.ItemDetail.CategoryName+"/"+kd.ItemDetail.Name+"?"),this.embedOptions.mode==BoldBI.Mode.View&&this.embedOptions.viewId&&(this.embedOptions.dashboardId=kd.ItemDetail.Id)),this.accessToken=Md.embedOptions.enableDomainMasking?null:Md.embedOptions.token?Md.embedOptions.token:this.embedOptions.embedToken?this.embedOptions.embedToken:kd.access_token;let Ld,Nd="";if(this.pinboardIds.length>0){const e=this.authToken?kd.Id:kd.WidgetId;bbEmbed.map(this.pinboardIds,(function(i){if(i.widgetId==e){const e=Md._getDashboardInstance(i.pinboardContainerId+"_embeddedbi");Md._isNullOrUndefined(e)&&(Fd=i.pinboardContainerId)}})),Ld=this.authToken?kd.ItemId:""}else if(this.isMultiTab){const e=this.embedOptions.token||this.embedOptions.embedToken?kd.DashboardId.toString().replaceAll("-",""):kd.ItemDetail.Id.toString().replaceAll("-","");Fd="multi_"+e;const s=Md._isNullOrUndefined(null===(i=Md.embedOptions.dashboardSettings)||void 0===i?void 0:i.dashboardName)||"string"==typeof Md.embedOptions.dashboardSettings.dashboardName?null===(t=Md.embedOptions.settings.viewer)||void 0===t?void 0:t.dashboardName:Md.embedOptions.dashboardSettings.dashboardName;!Md._isNullOrUndefined(s)&&Array.isArray(s)&&bbEmbed.map(s,(function(e){kd.ItemDetail.Id===e.dashboardId&&(Nd=e.displayName)})),Ld=Md.embedOptions.token||this.embedOptions.embedToken?kd.DashboardId:""}else{Fd=this.embedOptions.embedContainerId;const e=Md._isNullOrUndefined(null===(s=Md.embedOptions.dashboardSettings)||void 0===s?void 0:s.dashboardName)||"string"!=typeof Md.embedOptions.dashboardSettings.dashboardName?null===(n=null===(o=Md.embedOptions.settings)||void 0===o?void 0:o.viewer)||void 0===n?void 0:n.dashboardName:Md.embedOptions.dashboardSettings.dashboardName;Md._isNullOrUndefined(e)||"string"!=typeof e||(Nd=e)}const zd=this.pinboardIds.length>0?bbEmbed("#"+Fd).height():this.isMultiTab?this.embedOptions.height.indexOf("%")>0?this.embedOptions.height.includes("calc")?"calc(100% - 36px)":"calc("+this.embedOptions.height+" - 36px)":parseInt(this.embedOptions.height,10)-36+"px":this.embedOptions.height;if(this.embedOptions.enableDomainMasking||this.embedOptions.isPublicDashboard||this.embedOptions.embedToken||void 0===e.Data.UserDetail||(kd.UserDetail="string"==typeof e.Data.UserDetail?JSON.parse(e.Data.UserDetail):e.Data.UserDetail),this.embedOptions.mode==BoldBI.Mode.Connection&&bbEmbed('<style type="text/css"> .e-dashboarddesigner .bbi-dbrd-connection-mode-dlg .bbi-dbrd-connection-mode-header .bbi-dbrd-icon-container .bbi-dbrd-close-icon{ display: none !important} </style>').appendTo("head"),this._onBoldBIAuthorizionComplete(kd),""==this.embedOptions.widgetList){document.getElementById(Fd)&&(document.getElementById(Fd).style.height=zd,document.getElementById(Fd).style.width=""!=this.embedOptions.pinboardName?document.getElementById(Fd).style.width:this.isMultiTab?"100%":this.embedOptions.width)}const Wd=this.embedOptions.mode===BoldBI.Mode.View,Pd=(this.embedOptions.mode,BoldBI.Mode.Design,!((null===(d=this.embedOptions.authorizationServer)||void 0===d?void 0:d.url)||(null===(a=this.embedOptions.authorizationServer)||void 0===a?void 0:a.data)||this.embedOptions.token||this.embedOptions.embedToken));let Ud;Wd&&Pd&&(this._isNullOrUndefined(null===(r=this.embedOptions.dashboardSettings)||void 0===r?void 0:r.filterOverviewSettings)||(this.embedOptions.dashboardSettings.filterOverviewSettings.showSaveIcon=!1,this.embedOptions.dashboardSettings.filterOverviewSettings.showSaveAsIcon=!1),this._isNullOrUndefined(null===(b=null===(l=this.embedOptions.settings)||void 0===l?void 0:l.viewer)||void 0===b?void 0:b.filterOverview)||(this.embedOptions.settings.viewer.filterOverview.save=!1,this.embedOptions.settings.viewer.filterOverview.saveAs=!1));const Vd=this._isEmptyOrSpaces(null===(m=this.embedOptions.dashboardSettings)||void 0===m?void 0:m.fontFamily)?this._isEmptyOrSpaces(null===(p=null===(c=null===(h=this.embedOptions)||void 0===h?void 0:h.settings)||void 0===c?void 0:c.theme)||void 0===p?void 0:p.fontFamily)?"":this.embedOptions.settings.theme.fontFamily:this.embedOptions.dashboardSettings.fontFamily,Rd=this.embedOptions.environment===BoldBI.Environment.Enterprise?this.rootUrl.replace(/\/bi(?!.*\/bi)/,"/ums/user-interface/fonts")+"?family="+Vd:""+(this.rootUrl+"/user-interface/fonts?family="+Vd);if(Ud={siteUrl:this.baseUrl,serviceUrl:this.designerRootUrl,dataServiceUrl:this.designerRootUrl,serverUrl:this.dashboardServerApiUrl,hasAPIKey:!Md.embedOptions.enableDomainMasking&&!this.embedOptions.isPublicDashboard&&!this._isJwtFormat(this.accessToken),viewerSettings:{serviceUrl:this.designerRootUrl+"/v1.0/design"},nonce:this.embedOptions.nonce,localeSettings:{culture:this._isEmptyOrSpaces(null===(g=null===(u=this.embedOptions)||void 0===u?void 0:u.localeSettings)||void 0===g?void 0:g.culture)?this._isEmptyOrSpaces(null===(w=null===(f=null===(v=this.embedOptions)||void 0===v?void 0:v.settings)||void 0===f?void 0:f.locale)||void 0===w?void 0:w.culture)?"en-US":this.embedOptions.settings.locale.culture:this.embedOptions.localeSettings.culture,dateFormat:this._isEmptyOrSpaces(null===(O=null===(I=this.embedOptions)||void 0===I?void 0:I.localeSettings)||void 0===O?void 0:O.dateFormat)?this._isEmptyOrSpaces(null===(E=null===(y=null===(_=this.embedOptions)||void 0===_?void 0:_.settings)||void 0===y?void 0:y.locale)||void 0===E?void 0:E.dateFormat)?"M/d/yyyy":this.embedOptions.settings.locale.dateFormat:this.embedOptions.localeSettings.dateFormat,timeFormat:this._isEmptyOrSpaces(null===(S=null===(D=this.embedOptions)||void 0===D?void 0:D.localeSettings)||void 0===S?void 0:S.timeFormat)?this._isEmptyOrSpaces(null===(x=null===(C=null===(B=this.embedOptions)||void 0===B?void 0:B.settings)||void 0===C?void 0:C.locale)||void 0===x?void 0:x.timeFormat)?"h:mm:ss tt":this.embedOptions.settings.locale.timeFormat:this.embedOptions.localeSettings.timeFormat},mode:this.embedOptions.mode,localData:{loadFromData:this.embedOptions.localData.loadFromData,layoutData:this.embedOptions.localData.layoutData,widgetData:this.embedOptions.localData.widgetData},environment:this.embedOptions.environment,IsEmbed:!0,_isPublic:this.embedOptions.mode!=BoldBI.Mode.Connection?this.embedOptions.enableDomainMasking||!this._isNullOrUndefined(this.embedOptions.embedToken)&&!this._isEmptyOrSpaces(this.embedOptions.embedToken)||this._isNullOrUndefined(kd.ItemDetail)?"":kd.ItemDetail.IsPublic:"",itemId:this.embedOptions.mode!=BoldBI.Mode.Connection?this.embedOptions.enableDomainMasking?this.embedOptions.dashboardId:this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?kd.ItemDetail.Id:Md.embedOptions.isdesignerdraft?kd.draftItemID:Ld||this.embedOptions.dashboardId:"",dashboardPath:this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection?"":this.embedOptions.enableDomainMasking?this.embedOptions.dashboardId+"/0":this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?kd.ItemDetail.ItemLocation:Ld?Ld+"/0":this.embedOptions.dashboardId+"/"+kd.dashboardVersion,serviceAuthorizationToken:this.accessToken,dashboardName:this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection||this.embedOptions.enableDomainMasking||this._isNullOrUndefined(kd.ItemDetail)?"":this._isEmptyOrSpaces(Nd)?kd.ItemDetail.Name:Nd,dashboardDescription:this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection||this.embedOptions.enableDomainMasking||this._isNullOrUndefined(kd.ItemDetail)?"":kd.ItemDetail.Description,IsProxy:!!this.embedOptions.enableDomainMasking,theme:this._isEmptyOrSpaces(this.multiTabTheme)?this.embedOptions.theme:this.multiTabTheme,enableTheme:!1,enableFilterOverview:"boolean"==typeof this.embedOptions.dashboardSettings.enableFilterOverview?this.embedOptions.dashboardSettings.enableFilterOverview:null===(T=null===(F=null===(M=null===(A=this.embedOptions.settings)||void 0===A?void 0:A.viewer)||void 0===M?void 0:M.filterOverview)||void 0===F?void 0:F.enabled)||void 0===T||T,isPinWidget:this.pinboardIds.length>0,layoutSetting:this.embedOptions.layoutSettings,export:{Image:this.dashboardWidgetExports.export.image,Excel:this.dashboardWidgetExports.export.excel,Pdf:this.dashboardWidgetExports.export.pdf,CustomFontFamilyUrl:Vd?Rd:"",IsDefaultFont:!1},dashboardExportMenuSettings:{showCSV:this.dashboardWidgetExports.export.csv,showExcel:this.dashboardWidgetExports.export.excel,showImage:this.dashboardWidgetExports.export.image,showPDF:this.dashboardWidgetExports.export.pdf},widgetExportMenuSettings:{showCSV:this.dashboardWidgetExports.export.csv,showExcel:this.dashboardWidgetExports.export.excel,showImage:this.dashboardWidgetExports.export.image,showPDF:this.dashboardWidgetExports.export.pdf},filterParameters:(this._isEmptyOrSpaces(this.embedOptions.filterParameters)?"":"&")+(this.isMultiTab&&window.multiTabFilterParameter?window.multiTabFilterParameter:this.embedOptions.filterParameters),designCanvasSettings:{margin:this._isNullOrUndefined(null===(L=null===(k=this.embedOptions)||void 0===k?void 0:k.designCanvasSettings)||void 0===L?void 0:L.margin)?this._isNullOrUndefined(null===(W=null===(z=null===(N=this.embedOptions)||void 0===N?void 0:N.settings)||void 0===z?void 0:z.designCanvas)||void 0===W?void 0:W.margin)?null:null===(U=null===(P=this.embedOptions.settings)||void 0===P?void 0:P.designCanvas)||void 0===U?void 0:U.margin:this.embedOptions.designCanvasSettings.margin},widgetContainerSettings:{margin:this._isNullOrUndefined(null===(R=null===(V=this.embedOptions)||void 0===V?void 0:V.widgetContainerSettings)||void 0===R?void 0:R.margin)?this._isNullOrUndefined(null===(q=null===(H=null===(j=null===($=this.embedOptions)||void 0===$?void 0:$.settings)||void 0===j?void 0:j.viewer)||void 0===H?void 0:H.widgetContainer)||void 0===q?void 0:q.margin)?null:null===(J=null===(Q=this.embedOptions.settings.viewer)||void 0===Q?void 0:Q.widgetContainer)||void 0===J?void 0:J.margin:this.embedOptions.widgetContainerSettings.margin,boxShadow:this._isEmptyOrSpaces(null===(K=null===(G=this.embedOptions)||void 0===G?void 0:G.widgetContainerSettings)||void 0===K?void 0:K.boxShadow)?this._isEmptyOrSpaces(null===(ee=null===(Z=null===(Y=null===(X=this.embedOptions)||void 0===X?void 0:X.settings)||void 0===Y?void 0:Y.viewer)||void 0===Z?void 0:Z.widgetContainer)||void 0===ee?void 0:ee.boxShadow)?null:null===(te=null===(ie=this.embedOptions.settings.viewer)||void 0===ie?void 0:ie.widgetContainer)||void 0===te?void 0:te.boxShadow:this.embedOptions.widgetContainerSettings.boxShadow},viewDataSettings:{checkShowAllColumns:"boolean"==typeof(null===(oe=null===(se=this.embedOptions.dashboardSettings)||void 0===se?void 0:se.viewDataSettings)||void 0===oe?void 0:oe.showAllColumns)?this.embedOptions.dashboardSettings.viewDataSettings.showAllColumns:null!==(ae=null===(de=null===(ne=this.embedOptions.settings)||void 0===ne?void 0:ne.viewData)||void 0===de?void 0:de.allColumns)&&void 0!==ae&&ae},viewDataActions:{allowExporting:"boolean"==typeof(null===(le=null===(re=this.embedOptions.dashboardSettings)||void 0===re?void 0:re.viewDataSettings)||void 0===le?void 0:le.enableExporting)?this.embedOptions.dashboardSettings.viewDataSettings.enableExporting:null===(he=null===(me=null===(be=this.embedOptions.settings)||void 0===be?void 0:be.viewData)||void 0===me?void 0:me.exporting)||void 0===he||he,allowColumnSelection:"boolean"==typeof(null===(pe=null===(ce=this.embedOptions.dashboardSettings)||void 0===ce?void 0:ce.viewDataSettings)||void 0===pe?void 0:pe.enableColumnSelection)?this.embedOptions.dashboardSettings.viewDataSettings.enableColumnSelection:null===(ve=null===(ge=null===(ue=this.embedOptions.settings)||void 0===ue?void 0:ue.viewData)||void 0===ge?void 0:ge.columnSelection)||void 0===ve||ve},dashboardThemeSettings:{appearance:this._isEmptyOrSpaces(null===(Ie=null===(we=null===(fe=this.embedOptions)||void 0===fe?void 0:fe.dashboardSettings)||void 0===we?void 0:we.themeSettings)||void 0===Ie?void 0:Ie.appearance)?this._isEmptyOrSpaces(null===(ye=null===(_e=null===(Oe=this.embedOptions)||void 0===Oe?void 0:Oe.settings)||void 0===_e?void 0:_e.theme)||void 0===ye?void 0:ye.appearance)?"light":this.embedOptions.settings.theme.appearance:this.embedOptions.dashboardSettings.themeSettings.appearance,applicationTheme:this._isEmptyOrSpaces(null===(Se=null===(De=null===(Ee=this.embedOptions)||void 0===Ee?void 0:Ee.dashboardSettings)||void 0===De?void 0:De.themeSettings)||void 0===Se?void 0:Se.application)?this._isEmptyOrSpaces(null===(xe=null===(Ce=null===(Be=this.embedOptions)||void 0===Be?void 0:Be.settings)||void 0===Ce?void 0:Ce.theme)||void 0===xe?void 0:xe.application)?null:this.embedOptions.settings.theme.application:this.embedOptions.dashboardSettings.themeSettings.application,dashboardTheme:null!==($e=null!==(Ue=null!==(Ne=null!==(Te=null===(Fe=null===(Me=null===(Ae=this.embedOptions.dashboardSettings)||void 0===Ae?void 0:Ae.themeSettings)||void 0===Me?void 0:Me.dashboard)||void 0===Fe?void 0:Fe.trim())&&void 0!==Te?Te:(null===(Le=null===(ke=this.embedOptions.dashboardSettings)||void 0===ke?void 0:ke.themeSettings)||void 0===Le?void 0:Le.isLocalTheme)?"boldBITheme":null)&&void 0!==Ne?Ne:null===(Pe=null===(We=null===(ze=this.embedOptions.settings)||void 0===ze?void 0:ze.theme)||void 0===We?void 0:We.dashboard)||void 0===Pe?void 0:Pe.trim())&&void 0!==Ue?Ue:(null===(Re=null===(Ve=this.embedOptions.settings)||void 0===Ve?void 0:Ve.theme)||void 0===Re?void 0:Re.localTheme)?"boldBITheme":null)&&void 0!==$e?$e:null},hideMetrics:"boolean"==typeof(null===(je=this.embedOptions.dashboardSettings)||void 0===je?void 0:je.showMetrics)?!this.embedOptions.dashboardSettings.showMetrics:"boolean"==typeof(null===(qe=null===(He=this.embedOptions.settings)||void 0===He?void 0:He.viewer)||void 0===qe?void 0:qe.metrics)&&!this.embedOptions.settings.viewer.metrics,widgets:this._getWidgetFilterInfo(),showConfirmPublishPopup:!0,actionComplete:function(e){Md._onBoldBIDashboardInstaceActionComplete(e)},reportOpened:function(e){Md._onBoldBIDashboardInstaceReportOpen(e)},performNavigateToDashboard:function(e){Md._onBoldBIDashboardInstanceNavigateToDashboard(e)},beforeBannerIconRender:function(e){Md._onBoldBIDashboardBeforeBannerIconRender(e,kd)},beforeOtherOptionContextMenuRender:function(e){Md._onBoldBIDashboardBeforeOtherOptionContextMenuRender(e)},_onSaveFilter:function(e){Md._onBoldBIDashboardSaveFilter(e)},_onSaveAsFilter:function(e){Md._onBoldBIDashboardSaveAsFilter(e)},_onViewSavedFilters:function(e){Md._onBoldBIDashboardOpenViewSection(e)},onBannerIconClick:function(e){Md._onBoldBIDashboardBannerIconClick(e)},getModelDataForDashboard:function(e){Md._onGetLinkedDashboardDetails(e)},beforeWidgetIconRendered:function(e){Md._onBoldBIDashboardBeforeWidgetIconRendered(e)},onWidgetIconClick:function(e){Md._onBoldBIDashboardWidgetIconClick(e)},_onFavoriteStateChange:function(e){Md._onBoldBIDashboardUpdatefavorite(e)},beforeNavigateUrlLinking:function(e){Md._onBoldBIBeforeNavigateUrlLinking(e)},beforeViewdataIconRender:function(e){Md._onBoldBIBeforeViewdataIconRender(e)},beforeControlMenuOpen:function(e){Md._onBoldBIBeforeControlMenuOpen(e)},beforeDashboardMobileMenuOpen:function(e){Md._onBoldBIBeforeDashboardMobileMenuOpen(e)},ajaxBeforeLoad:function(e){Md._onBoldBIAjaxBeforeLoad(e)},beforeDesignerToolbarButtonsRendered:function(e){Md._onBoldBIbeforeDesignerToolbarButtonsRendered(e)},onControlMenuClick:function(e){Md._onBoldBIonControlMenuClick(e)},beforeDatasourceToolbarButtonsRendered:function(e){Md._onBoldBIbeforeDatasourceToolbarButtonsRendered(e)},beforeDatasourceToolbarIconsRendered:function(e){Md._onBoldBIbeforeDatasourceToolbarIconsRendered(e)},beforeDesignerToolbarIconsRendered:function(e){Md._onBoldBIbeforeDesignerToolbarIconsRendered(e)},toolbarClick:function(e){Md._onBoldBItoolbarClick(e)},beforeWidgetItemsListed:function(e){Md._onBoldBIbeforeWidgetItemsListed(e)},beforeWidgetLayoutRender:function(e){Md._onBoldBIbeforeWidgetLayoutRender(e)}},(Wd||this.embedOptions.mode==BoldBI.Mode.AIAssistant)&&(Ud.filterOverviewSettings={showSaveIcon:"boolean"==typeof(null===(Je=null===(Qe=this.embedOptions.dashboardSettings)||void 0===Qe?void 0:Qe.filterOverviewSettings)||void 0===Je?void 0:Je.showSaveIcon)?null===(Ke=null===(Ge=this.embedOptions.dashboardSettings)||void 0===Ge?void 0:Ge.filterOverviewSettings)||void 0===Ke?void 0:Ke.showSaveAsIcon:null!==(ei=null===(Ze=null===(Ye=null===(Xe=this.embedOptions.settings)||void 0===Xe?void 0:Xe.viewer)||void 0===Ye?void 0:Ye.filterOverview)||void 0===Ze?void 0:Ze.save)&&void 0!==ei&&ei,showSaveAsIcon:"boolean"==typeof(null===(ti=null===(ii=this.embedOptions.dashboardSettings)||void 0===ii?void 0:ii.filterOverviewSettings)||void 0===ti?void 0:ti.showSaveAsIcon)?null===(oi=null===(si=this.embedOptions.dashboardSettings)||void 0===si?void 0:si.filterOverviewSettings)||void 0===oi?void 0:oi.showSaveAsIcon:null!==(ri=null===(ai=null===(di=null===(ni=this.embedOptions.settings)||void 0===ni?void 0:ni.viewer)||void 0===di?void 0:di.filterOverview)||void 0===ai?void 0:ai.saveAs)&&void 0!==ri&&ri,showViewSavedFilterIcon:"boolean"==typeof(null===(bi=null===(li=this.embedOptions.dashboardSettings)||void 0===li?void 0:li.filterOverviewSettings)||void 0===bi?void 0:bi.showViewSavedFilterIcon)?null===(hi=null===(mi=this.embedOptions.dashboardSettings)||void 0===mi?void 0:mi.filterOverviewSettings)||void 0===hi?void 0:hi.showViewSavedFilterIcon:null!==(gi=null===(ui=null===(pi=null===(ci=this.embedOptions.settings)||void 0===ci?void 0:ci.viewer)||void 0===pi?void 0:pi.filterOverview)||void 0===ui?void 0:ui.viewSavedFilter)&&void 0!==gi&&gi,viewId:this._isNullOrUndefined(null===(vi=this.embedOptions.dashboardSettings)||void 0===vi?void 0:vi.filterOverviewSettings)||this._isEmptyOrSpaces(this.embedOptions.dashboardSettings.filterOverviewSettings.viewId)?this._isNullOrUndefined(null===(wi=null===(fi=this.embedOptions.settings)||void 0===fi?void 0:fi.viewer)||void 0===wi?void 0:wi.filterOverview)||this._isEmptyOrSpaces(this.embedOptions.settings.viewer.filterOverview.viewId)?null:this.embedOptions.settings.viewer.filterOverview.viewId:this.embedOptions.dashboardSettings.filterOverviewSettings.viewId,viewName:this._isNullOrUndefined(null===(Ii=this.embedOptions.dashboardSettings)||void 0===Ii?void 0:Ii.filterOverviewSettings)||this._isEmptyOrSpaces(this.embedOptions.dashboardSettings.filterOverviewSettings.viewName)?this._isNullOrUndefined(null===(_i=null===(Oi=this.embedOptions.settings)||void 0===Oi?void 0:Oi.viewer)||void 0===_i?void 0:_i.filterOverview)||this._isEmptyOrSpaces(this.embedOptions.settings.viewer.filterOverview.viewName)?null:this.embedOptions.settings.viewer.filterOverview.viewName:this.embedOptions.dashboardSettings.filterOverviewSettings.viewName}),this.loadMultipleWidget){var Td=this.embedOptions.widgetList;Td.forEach((e=>{const i=document.createElement("div");i.id=`${e.containerId}_embeddedbi`,i.style.width="100%",i.style.height="100%";var t=document.getElementById(e.containerId);t&&t.append(i)}));const i="string"==typeof e.Data.WidgetList?JSON.parse(e.Data.WidgetList):e.Data.WidgetList,t={};Object.keys(i).forEach((e=>{t[e.toLowerCase()]=i[e]}));const s=Td.map((e=>{const i=e.widgetName.toLowerCase();return{widgetId:t[i]||"",container:`${e.containerId}_embeddedbi`}}));Ud.loadMultipleWidget=this.loadMultipleWidget,Ud.multipleWidgetsCollection=s}if(""==this.embedOptions.widgetList&&(Ud.actionBegin=function(e){Md._onBoldBIDashboardInstaceActionBegin(e,Fd)}),(this.embedOptions.mode!=BoldBI.Mode.View||this.isWidgetMode||this.isMultipleWidgetMode||this.isPinboardRendering)&&this.embedOptions.mode!=BoldBI.Mode.Design&&this.embedOptions.mode!=BoldBI.Mode.AIAssistant||(Ud.languageSettings={hideLanguageDropdown:"boolean"==typeof(null===(yi=this.embedOptions.languageSettings)||void 0===yi?void 0:yi.hideLanguageDropdown)?this.embedOptions.languageSettings.hideLanguageDropdown:null!==(Si=null===(Di=null===(Ei=this.embedOptions.settings)||void 0===Ei?void 0:Ei.language)||void 0===Di?void 0:Di.hideDropdown)&&void 0!==Si&&Si,languageCode:this._isEmptyOrSpaces(null===(Ci=null===(Bi=this.embedOptions)||void 0===Bi?void 0:Bi.languageSettings)||void 0===Ci?void 0:Ci.languageCode)?this._isEmptyOrSpaces(null===(Mi=null===(Ai=null===(xi=this.embedOptions)||void 0===xi?void 0:xi.settings)||void 0===Ai?void 0:Ai.language)||void 0===Mi?void 0:Mi.code)?"":this.embedOptions.settings.language.code:this.embedOptions.languageSettings.languageCode},Ud.customBrandSettings={hideHelpLink:"boolean"==typeof(null===(Fi=this.embedOptions.customBrandSettings)||void 0===Fi?void 0:Fi.hideHelpLink)?this.embedOptions.customBrandSettings.hideHelpLink:null!==(Li=null===(ki=null===(Ti=this.embedOptions.settings)||void 0===Ti?void 0:Ti.brand)||void 0===ki?void 0:ki.hideHelpLink)&&void 0!==Li&&Li,customBrandName:this._isEmptyOrSpaces(null===(zi=null===(Ni=this.embedOptions)||void 0===Ni?void 0:Ni.customBrandSettings)||void 0===zi?void 0:zi.customBrandName)?this._isEmptyOrSpaces(null===(Ui=null===(Pi=null===(Wi=this.embedOptions)||void 0===Wi?void 0:Wi.settings)||void 0===Pi?void 0:Pi.brand)||void 0===Ui?void 0:Ui.name)?"":this.embedOptions.settings.brand.name:this.embedOptions.customBrandSettings.customBrandName,customDomain:this._isEmptyOrSpaces(null===(Ri=null===(Vi=this.embedOptions)||void 0===Vi?void 0:Vi.customBrandSettings)||void 0===Ri?void 0:Ri.customDomain)?this._isEmptyOrSpaces(null===(Hi=null===(ji=null===($i=this.embedOptions)||void 0===$i?void 0:$i.settings)||void 0===ji?void 0:ji.brand)||void 0===Hi?void 0:Hi.domain)?"":this.embedOptions.settings.brand.domain:this.embedOptions.customBrandSettings.customDomain}),this.embedOptions.enableDomainMasking||(this.embedOptions.mode==BoldBI.Mode.View&&!this.isPinboardRendering||this.embedOptions.mode==BoldBI.Mode.Design)&&(Ud.enableMobileView=this.restrictMobileView,this.embedOptions.isPublicDashboard||this.embedOptions.embedToken||!kd.IsAnonymousUser||(Ud.anonymousUserEmail=kd.email)),this.embedOptions.mode==BoldBI.Mode.Design){(this.authToken&&!this.embedOptions.dashboardId||!this.authToken&&!this.embedOptions.enableDomainMasking&&!this._isNullOrUndefined(kd)&&kd.ItemDetail.IsDraft)&&(Ud.dashboardPath="","string"!=typeof this.embedOptions.datasourceId||this._isEmptyOrSpaces(this.embedOptions.datasourceId)||(Ud.datasource=this.embedOptions.datasourceId));const e=this._isNullOrUndefined(kd)||this.embedOptions.enableDomainMasking||this._isEmptyOrSpaces(kd.DatasourceId)?"":kd.DatasourceId;this._isEmptyOrSpaces(e)||(Ud.datasource=e);const i=Array.isArray(null===(qi=this.embedOptions)||void 0===qi?void 0:qi.datasources)&&this.embedOptions.datasources.length>0?this.embedOptions.datasources:Array.isArray(null===(Ji=null===(Qi=this.embedOptions)||void 0===Qi?void 0:Qi.settings)||void 0===Ji?void 0:Ji.datasources)&&this.embedOptions.settings.datasources.length>0?this.embedOptions.settings.datasources:[];Ud.datasources=i,Ud.disableAutoRecover=this.disableAutoRecover,Ud.schedule={endPoint:this.scheduleEndpointUrl,summaryText:""},Ud.serverSettings={isAdmin:!this.embedOptions.enableDomainMasking&&(void 0!==kd.IsAdmin&&kd.IsAdmin)},Ud.intermediateDbStatus=this.embedOptions.enableDomainMasking?void 0:kd.IntermediateDbStatus,Ud.connectionList=this.embedOptions.enableDomainMasking?void 0:kd.ConnectionList,Ud.isAllowUserToCreateDatasource=this.embedOptions.enableDomainMasking?void 0:kd.CanCreateDatasource,Ud.enablePublicDashboardSetting=!1,Ud.beforeNavigateToDashboard=function(e){Md._onBoldBIBeforeNavigateToDashboard(e)},Ud.toolbarSettings={showToolbar:"boolean"==typeof(null===(Gi=this.embedOptions.toolbarSettings)||void 0===Gi?void 0:Gi.showToolbar)?this.embedOptions.toolbarSettings.showToolbar:null===(Zi=null===(Yi=null===(Xi=null===(Ki=this.embedOptions.settings)||void 0===Ki?void 0:Ki.designer)||void 0===Xi?void 0:Xi.toolbar)||void 0===Yi?void 0:Yi.enabled)||void 0===Zi||Zi},Ud.predefinedWidgets={categoryName:this._isEmptyOrSpaces(null===(it=null===(et=this.embedOptions)||void 0===et?void 0:et.preConfiguredWidgets)||void 0===it?void 0:it.categoryName)?this._isEmptyOrSpaces(null===(nt=null===(ot=null===(st=null===(tt=this.embedOptions)||void 0===tt?void 0:tt.settings)||void 0===st?void 0:st.designer)||void 0===ot?void 0:ot.preConfiguredWidgets)||void 0===nt?void 0:nt.categoryName)?"":this.embedOptions.settings.designer.preConfiguredWidgets.categoryName:this.embedOptions.preConfiguredWidgets.categoryName,dashboardId:this._isEmptyOrSpaces(null===(at=null===(dt=this.embedOptions)||void 0===dt?void 0:dt.preConfiguredWidgets)||void 0===at?void 0:at.dashboardId)?this._isEmptyOrSpaces(null===(mt=null===(bt=null===(lt=null===(rt=this.embedOptions)||void 0===rt?void 0:rt.settings)||void 0===lt?void 0:lt.designer)||void 0===bt?void 0:bt.preConfiguredWidgets)||void 0===mt?void 0:mt.dashboardId)?"":this.embedOptions.settings.designer.preConfiguredWidgets.dashboardId:this.embedOptions.preConfiguredWidgets.dashboardId},this.embedOptions.environment==BoldBI.Environment.Enterprise?Ud.configuration=this.embedOptions.enableDomainMasking?" ":this.rootUrl+"/webdesignerservice/scripts/settings/"+kd.Branding+"/settings.min.js":Ud.configuration=this.cdnLink+"/scripts/settings/"+kd.Branding+"/settings.min.js",Ud.designerSettings={widgetsPanel:{hideExistingWidgets:"boolean"==typeof(null===(ct=null===(ht=this.embedOptions.dashboardSettings)||void 0===ht?void 0:ht.widgetsPanel)||void 0===ct?void 0:ct.hideExistingWidgets)?this.embedOptions.dashboardSettings.widgetsPanel.hideExistingWidgets:null!==(vt=null===(gt=null===(ut=null===(pt=this.embedOptions.settings)||void 0===pt?void 0:pt.designer)||void 0===ut?void 0:ut.widgetsPanel)||void 0===gt?void 0:gt.hideExistingWidgets)&&void 0!==vt&&vt,hideDefaultWidgets:"boolean"==typeof(null===(wt=null===(ft=this.embedOptions.dashboardSettings)||void 0===ft?void 0:ft.widgetsPanel)||void 0===wt?void 0:wt.hideDefaultWidgets)?this.embedOptions.dashboardSettings.widgetsPanel.hideDefaultWidgets:null!==(yt=null===(_t=null===(Ot=null===(It=this.embedOptions.settings)||void 0===It?void 0:It.designer)||void 0===Ot?void 0:Ot.widgetsPanel)||void 0===_t?void 0:_t.hideDefaultWidgets)&&void 0!==yt&&yt,defaultPanelDisplayText:(null===(Dt=null===(Et=this.embedOptions.settings)||void 0===Et?void 0:Et.designer)||void 0===Dt?void 0:Dt.widgetsPanel)?null===(Bt=null===(St=this.embedOptions.settings)||void 0===St?void 0:St.designer)||void 0===Bt?void 0:Bt.widgetsPanel.defaultPanelDisplayText:"",existingPanelDisplayText:(null===(xt=null===(Ct=this.embedOptions.settings)||void 0===Ct?void 0:Ct.designer)||void 0===xt?void 0:xt.widgetsPanel)?null===(Mt=null===(At=this.embedOptions.settings)||void 0===At?void 0:At.designer)||void 0===Mt?void 0:Mt.widgetsPanel.existingPanelDisplayText:"",defaultPanelSearchPlaceholder:(null===(Tt=null===(Ft=this.embedOptions.settings)||void 0===Ft?void 0:Ft.designer)||void 0===Tt?void 0:Tt.widgetsPanel)?null===(Lt=null===(kt=this.embedOptions.settings)||void 0===kt?void 0:kt.designer)||void 0===Lt?void 0:Lt.widgetsPanel.defaultPanelSearchPlaceholder:"",existingPanelSearchPlaceholder:(null===(zt=null===(Nt=this.embedOptions.settings)||void 0===Nt?void 0:Nt.designer)||void 0===zt?void 0:zt.widgetsPanel)?null===(Pt=null===(Wt=this.embedOptions.settings)||void 0===Wt?void 0:Wt.designer)||void 0===Pt?void 0:Pt.widgetsPanel.existingPanelSearchPlaceholder:"",existingDashboards:Array.isArray(null===(Vt=null===(Ut=this.embedOptions.dashboardSettings)||void 0===Ut?void 0:Ut.widgetsPanel)||void 0===Vt?void 0:Vt.existingDashboards)&&this.embedOptions.dashboardSettings.widgetsPanel.existingDashboards.length>0?this.embedOptions.dashboardSettings.widgetsPanel.existingDashboards:Array.isArray(null===(jt=null===($t=null===(Rt=this.embedOptions.settings)||void 0===Rt?void 0:Rt.designer)||void 0===$t?void 0:$t.widgetsPanel)||void 0===jt?void 0:jt.existingDashboards)&&this.embedOptions.settings.designer.widgetsPanel.existingDashboards.length>0?this.embedOptions.settings.designer.widgetsPanel.existingDashboards:[],dragAndDropSettings:{rowSpan:null!==(Gt=null===(Jt=null===(Qt=null===(qt=null===(Ht=this.embedOptions.settings)||void 0===Ht?void 0:Ht.designer)||void 0===qt?void 0:qt.widgetsPanel)||void 0===Qt?void 0:Qt.dragAndDropSettings)||void 0===Jt?void 0:Jt.rowSpan)&&void 0!==Gt?Gt:null,columnSpan:null!==(es=null===(Zt=null===(Yt=null===(Xt=null===(Kt=this.embedOptions.settings)||void 0===Kt?void 0:Kt.designer)||void 0===Xt?void 0:Xt.widgetsPanel)||void 0===Yt?void 0:Yt.dragAndDropSettings)||void 0===Zt?void 0:Zt.columnSpan)&&void 0!==es?es:null,isWidgetMode:null!==(ns=null===(os=null===(ss=null===(ts=null===(is=this.embedOptions.settings)||void 0===is?void 0:is.designer)||void 0===ts?void 0:ts.widgetsPanel)||void 0===ss?void 0:ss.dragAndDropSettings)||void 0===os?void 0:os.isWidgetMode)&&void 0!==ns&&ns}},dataSourceConfig:{hideDataSourceConfig:"boolean"==typeof(null===(as=null===(ds=this.embedOptions.dashboardSettings)||void 0===ds?void 0:ds.dataSourceConfig)||void 0===as?void 0:as.hideDataSourceConfig)?this.embedOptions.dashboardSettings.dataSourceConfig.hideDataSourceConfig:null!==(ms=null===(bs=null===(ls=null===(rs=this.embedOptions.settings)||void 0===rs?void 0:rs.designer)||void 0===ls?void 0:ls.dataSourceConfig)||void 0===bs?void 0:bs.hideDataSourceConfig)&&void 0!==ms&&ms,hideSampleDataSources:"boolean"==typeof(null===(cs=null===(hs=this.embedOptions.dashboardSettings)||void 0===hs?void 0:hs.dataSourceConfig)||void 0===cs?void 0:cs.hideSampleDataSources)?this.embedOptions.dashboardSettings.dataSourceConfig.hideSampleDataSources:null!==(vs=null===(gs=null===(us=null===(ps=this.embedOptions.settings)||void 0===ps?void 0:ps.designer)||void 0===us?void 0:us.dataSourceConfig)||void 0===gs?void 0:gs.hideSampleDataSources)&&void 0!==vs&&vs,hideDataSourceList:"boolean"==typeof(null===(ws=null===(fs=this.embedOptions.dashboardSettings)||void 0===fs?void 0:fs.dataSourceConfig)||void 0===ws?void 0:ws.hideDataSourceList)?this.embedOptions.dashboardSettings.dataSourceConfig.hideDataSourceList:null!==(ys=null===(_s=null===(Os=null===(Is=this.embedOptions.settings)||void 0===Is?void 0:Is.designer)||void 0===Os?void 0:Os.dataSourceConfig)||void 0===_s?void 0:_s.hideDataSourceList)&&void 0!==ys&&ys,hideExpression:"boolean"==typeof(null===(Ds=null===(Es=this.embedOptions.dashboardSettings)||void 0===Es?void 0:Es.dataSourceConfig)||void 0===Ds?void 0:Ds.hideExpression)?this.embedOptions.dashboardSettings.dataSourceConfig.hideExpression:null!==(xs=null===(Cs=null===(Bs=null===(Ss=this.embedOptions.settings)||void 0===Ss?void 0:Ss.designer)||void 0===Bs?void 0:Bs.dataSourceConfig)||void 0===Cs?void 0:Cs.hideExpression)&&void 0!==xs&&xs},hidePropertySettingIcon:null===(Ms=null===(As=this.embedOptions.settings)||void 0===As?void 0:As.designer)||void 0===Ms?void 0:Ms.hideSettings},Ud.userSettings={hidePreviewAs:"boolean"==typeof(null===(Fs=this.embedOptions.dashboardSettings)||void 0===Fs?void 0:Fs.showPreviewAs)?!this.embedOptions.dashboardSettings.showPreviewAs:!(null===(Ls=null===(ks=null===(Ts=this.embedOptions.settings)||void 0===Ts?void 0:Ts.designer)||void 0===ks?void 0:ks.previewAs)||void 0===Ls||Ls)}}this.embedOptions.mode==BoldBI.Mode.Connection&&(Ud.connectionList=kd.ConnectionList),this.embedOptions.mode==BoldBI.Mode.DataSource&&(Ud.itemId=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?kd.ItemDetail.Id:this.embedOptions.datasourceId,Ud.datasourceName=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?kd.ItemDetail.Name:this.embedOptions.datasourceName,Ud.datasource=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?kd.ItemDetail.Id:this.embedOptions.datasourceId),this.isMultipleWidgetMode=""!=this.embedOptions.widgetList&&this.isMultipleWidgetMode,this.isWidgetMode&&(Ud.isPinWidget=this.isWidgetMode,Ud.widgetId=this._isNullOrUndefined(this.authToken)||this._isEmptyOrSpaces(this.authToken)?kd.WidgetId:this.widgetName);const $d="boolean"==typeof(null===(Ns=this.embedOptions.dashboardSettings)||void 0===Ns?void 0:Ns.showHeader)?this.embedOptions.dashboardSettings.showHeader:null===(Ps=null===(Ws=null===(zs=this.embedOptions.settings)||void 0===zs?void 0:zs.viewer)||void 0===Ws?void 0:Ws.header)||void 0===Ps||Ps;Ud.isHideHeader=0==$d,this.isMultiTab&&(Ud.dashboardSettings={parentId:this.parentDbrdId,isMultiTab:null!=this.parentDbrdId&&""!==this.parentDbrdId});("boolean"==typeof(null===(Us=this.embedOptions.dynamicConnection)||void 0===Us?void 0:Us.isEnabled)?this.embedOptions.dynamicConnection.isEnabled:null!==($s=null===(Rs=null===(Vs=this.embedOptions.settings)||void 0===Vs?void 0:Vs.dynamicConnection)||void 0===Rs?void 0:Rs.enabled)&&void 0!==$s&&$s)&&(Ud.customIdentity=this._isEmptyOrSpaces(null===(Hs=null===(js=this.embedOptions)||void 0===js?void 0:js.dynamicConnection)||void 0===Hs?void 0:Hs.identity)?this._isEmptyOrSpaces(null===(Js=null===(Qs=null===(qs=this.embedOptions)||void 0===qs?void 0:qs.settings)||void 0===Qs?void 0:Qs.dynamicConnection)||void 0===Js?void 0:Js.identity)?"":this.embedOptions.settings.dynamicConnection.identity:this.embedOptions.dynamicConnection.identity);if(("boolean"==typeof(null===(Gs=this.embedOptions.autoRefreshSettings)||void 0===Gs?void 0:Gs.enabled)?null===(Ks=this.embedOptions.autoRefreshSettings)||void 0===Ks?void 0:Ks.enabled:null!==(eo=null===(Zs=null===(Ys=null===(Xs=this.embedOptions.settings)||void 0===Xs?void 0:Xs.viewer)||void 0===Ys?void 0:Ys.autoRefresh)||void 0===Zs?void 0:Zs.enabled)&&void 0!==eo&&eo)&&(Ud.enableAutoRefresh=!0,Ud.autoRefreshSettings={intervalSettings:{mode:"Hourly",hourlySchedule:{hours:"number"==typeof(null===(io=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===io?void 0:io.hours)?null===(to=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===to?void 0:to.hours:null===(no=null===(oo=null===(so=this.embedOptions.settings.viewer)||void 0===so?void 0:so.autoRefresh)||void 0===oo?void 0:oo.hourlySchedule)||void 0===no?void 0:no.hours,minutes:"number"==typeof(null===(ao=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===ao?void 0:ao.minutes)?null===(ro=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===ro?void 0:ro.minutes:null===(mo=null===(bo=null===(lo=this.embedOptions.settings.viewer)||void 0===lo?void 0:lo.autoRefresh)||void 0===bo?void 0:bo.hourlySchedule)||void 0===mo?void 0:mo.minutes,seconds:"number"==typeof(null===(ho=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===ho?void 0:ho.seconds)?null===(co=this.embedOptions.autoRefreshSettings.hourlySchedule)||void 0===co?void 0:co.seconds:null===(go=null===(uo=null===(po=this.embedOptions.settings.viewer)||void 0===po?void 0:po.autoRefresh)||void 0===uo?void 0:uo.hourlySchedule)||void 0===go?void 0:go.seconds}}}),this.embedOptions.mode==BoldBI.Mode.AIAssistant&&(Ud.isUnifiedAI=!0,Ud.dataSourceId=this.embedOptions.dataSourceId,Ud.dashboardApiUrl=this.dashboardServerApiUrl),(!this.loadMultipleWidget&&((null===(vo=this.embedOptions.embedAiAssistant)||void 0===vo?void 0:vo.enabled)||(null===(wo=null===(fo=this.embedOptions.settings)||void 0===fo?void 0:fo.aiAssistant)||void 0===wo?void 0:wo.enabled))||this.embedOptions.mode==BoldBI.Mode.AIAssistant)&&(Ud.embedAiAssistant={enableAiAssistant:!0,aiAssistantPosition:this._isEmptyOrSpaces(null===(Oo=null===(Io=this.embedOptions)||void 0===Io?void 0:Io.embedAiAssistant)||void 0===Oo?void 0:Oo.position)?this._isEmptyOrSpaces(null===(Eo=null===(yo=null===(_o=this.embedOptions)||void 0===_o?void 0:_o.settings)||void 0===yo?void 0:yo.aiAssistant)||void 0===Eo?void 0:Eo.position)?"bottom":this.embedOptions.settings.aiAssistant.position:this.embedOptions.embedAiAssistant.position,hideAIDataUsage:"boolean"==typeof(null===(Do=this.embedOptions.embedAiAssistant)||void 0===Do?void 0:Do.hideAiDataUsage)?null===(So=this.embedOptions.embedAiAssistant)||void 0===So?void 0:So.hideAiDataUsage:"boolean"==typeof(null===(Co=null===(Bo=this.embedOptions.settings)||void 0===Bo?void 0:Bo.aiAssistant)||void 0===Co?void 0:Co.hideUsageAnalytics)?null===(Ao=null===(xo=this.embedOptions.settings)||void 0===xo?void 0:xo.aiAssistant)||void 0===Ao?void 0:Ao.hideUsageAnalytics:null!==(ko=null===(To=null===(Fo=null===(Mo=this.embedOptions.settings)||void 0===Mo?void 0:Mo.aiAssistant)||void 0===Fo?void 0:Fo.hideIcons)||void 0===To?void 0:To.usageAnalytics)&&void 0!==ko&&ko,hideAIChatHelp:"boolean"==typeof(null===(No=null===(Lo=this.embedOptions.embedAiAssistant)||void 0===Lo?void 0:Lo.hideIcons)||void 0===No?void 0:No.helpLink)?null===(Wo=null===(zo=this.embedOptions.embedAiAssistant)||void 0===zo?void 0:zo.hideIcons)||void 0===Wo?void 0:Wo.helpLink:null!==(Vo=null===(Uo=null===(Po=this.embedOptions.settings)||void 0===Po?void 0:Po.aiAssistant)||void 0===Uo?void 0:Uo.hideChatHelp)&&void 0!==Vo&&Vo,enableChatHistory:"boolean"!=typeof(null===(jo=null===($o=null===(Ro=this.embedOptions.settings)||void 0===Ro?void 0:Ro.aiAssistant)||void 0===$o?void 0:$o.hideIcons)||void 0===jo?void 0:jo.history)||!this.embedOptions.settings.aiAssistant.hideIcons.history,enableNewSession:"boolean"!=typeof(null===(Qo=null===(qo=null===(Ho=this.embedOptions.settings)||void 0===Ho?void 0:Ho.aiAssistant)||void 0===qo?void 0:qo.hideIcons)||void 0===Qo?void 0:Qo.newSession)||!this.embedOptions.settings.aiAssistant.hideIcons.newSession,showBetaTag:"boolean"!=typeof(null===(Go=null===(Jo=this.embedOptions.settings)||void 0===Jo?void 0:Jo.aiAssistant)||void 0===Go?void 0:Go.hideBetaTag)||!this.embedOptions.settings.aiAssistant.hideBetaTag,headerTextColorHex:this._isEmptyOrSpaces(null===(Xo=null===(Ko=this.embedOptions.settings)||void 0===Ko?void 0:Ko.aiAssistant)||void 0===Xo?void 0:Xo.headerTextColor)?"":this.embedOptions.settings.aiAssistant.headerTextColor,showChatLogo:"boolean"!=typeof(null===(Zo=null===(Yo=this.embedOptions.settings)||void 0===Yo?void 0:Yo.aiAssistant)||void 0===Zo?void 0:Zo.hideLogo)||!this.embedOptions.settings.aiAssistant.hideLogo,showWelcomeMessage:"boolean"!=typeof(null===(tn=null===(en=this.embedOptions.settings)||void 0===en?void 0:en.aiAssistant)||void 0===tn?void 0:tn.hideWelcomeNote)||!this.embedOptions.settings.aiAssistant.hideWelcomeNote,showDashboardCategory:"boolean"!=typeof(null===(on=null===(sn=this.embedOptions.settings)||void 0===sn?void 0:sn.aiAssistant)||void 0===on?void 0:on.hideDashboardTag)||!this.embedOptions.settings.aiAssistant.hideDashboardTag,showDatasourceCategory:"boolean"!=typeof(null===(dn=null===(nn=this.embedOptions.settings)||void 0===nn?void 0:nn.aiAssistant)||void 0===dn?void 0:dn.hideDatasourceTag)||!this.embedOptions.settings.aiAssistant.hideDatasourceTag,dashboardId:Array.isArray(null===(rn=null===(an=this.embedOptions.settings)||void 0===an?void 0:an.aiAssistant)||void 0===rn?void 0:rn.dashboards)&&(null===(bn=null===(ln=this.embedOptions.settings)||void 0===ln?void 0:ln.aiAssistant)||void 0===bn?void 0:bn.dashboards.length)>0?this.embedOptions.settings.aiAssistant.dashboards:[],datasourceId:Array.isArray(null===(hn=null===(mn=this.embedOptions.settings)||void 0===mn?void 0:mn.aiAssistant)||void 0===hn?void 0:hn.dataSources)&&(null===(pn=null===(cn=this.embedOptions.settings)||void 0===cn?void 0:cn.aiAssistant)||void 0===pn?void 0:pn.dataSources.length)>0?this.embedOptions.settings.aiAssistant.dataSources:[],suggestionCount:"number"==typeof(null===(gn=null===(un=this.embedOptions.settings)||void 0===un?void 0:un.aiAssistant)||void 0===gn?void 0:gn.queryDisplayLimit)?this.embedOptions.settings.aiAssistant.queryDisplayLimit:6,customizedAITitle:this._isEmptyOrSpaces(this.embedOptions.embedAiAssistant.name)?null!==(wn=null===(fn=null===(vn=this.embedOptions.settings)||void 0===vn?void 0:vn.aiAssistant)||void 0===fn?void 0:fn.name)&&void 0!==wn?wn:"":this.embedOptions.embedAiAssistant.name,customizedUserName:null!==(_n=null===(On=null===(In=this.embedOptions.settings)||void 0===In?void 0:In.aiAssistant)||void 0===On?void 0:On.userName)&&void 0!==_n?_n:"",customDashboardSummaryIntroText:null!==(Dn=null===(En=null===(yn=this.embedOptions.settings)||void 0===yn?void 0:yn.aiAssistant)||void 0===En?void 0:En.aiSummaryIntroMessage)&&void 0!==Dn?Dn:"",aiAssistantCustomPrompt:{welcomeMessage:null!==(Cn=null===(Bn=null===(Sn=this.embedOptions.settings)||void 0===Sn?void 0:Sn.aiAssistant)||void 0===Bn?void 0:Bn.welcomeMessage)&&void 0!==Cn?Cn:"",exploreMessage:null!==(Mn=null===(An=null===(xn=this.embedOptions.settings)||void 0===xn?void 0:xn.aiAssistant)||void 0===An?void 0:An.exploreMessage)&&void 0!==Mn?Mn:""},dashboardAiAssistantCustomPrompt:{welcomeMessage:null!==(kn=null===(Tn=null===(Fn=this.embedOptions.settings)||void 0===Fn?void 0:Fn.aiAssistant)||void 0===Tn?void 0:Tn.welcomeMessage)&&void 0!==kn?kn:"",exploreMessage:null!==(zn=null===(Nn=null===(Ln=this.embedOptions.settings)||void 0===Ln?void 0:Ln.aiAssistant)||void 0===Nn?void 0:Nn.exploreMessage)&&void 0!==zn?zn:"",widgetSuggestions:{title:null!==(Vn=null===(Un=null===(Pn=null===(Wn=this.embedOptions.settings)||void 0===Wn?void 0:Wn.aiAssistant)||void 0===Pn?void 0:Pn.widgetSuggestions)||void 0===Un?void 0:Un.title)&&void 0!==Vn?Vn:"",suggestionPrompt:null!==(Hn=null===(jn=null===($n=null===(Rn=this.embedOptions.settings)||void 0===Rn?void 0:Rn.aiAssistant)||void 0===$n?void 0:$n.widgetSuggestions)||void 0===jn?void 0:jn.prompt)&&void 0!==Hn?Hn:""},dashboardSuggestions:{title:null!==(Gn=null===(Jn=null===(Qn=null===(qn=this.embedOptions.settings)||void 0===qn?void 0:qn.aiAssistant)||void 0===Qn?void 0:Qn.dashboardSuggestions)||void 0===Jn?void 0:Jn.title)&&void 0!==Gn?Gn:"",suggestionPrompt:null!==(Zn=null===(Yn=null===(Xn=null===(Kn=this.embedOptions.settings)||void 0===Kn?void 0:Kn.aiAssistant)||void 0===Xn?void 0:Xn.dashboardSuggestions)||void 0===Yn?void 0:Yn.prompt)&&void 0!==Zn?Zn:""}}},this.embedOptions.mode==BoldBI.Mode.AIAssistant&&(Ud.customBrandSettings=Object.assign(Object.assign({},Ud.customBrandSettings),{hideHelpLink:"boolean"==typeof(null===(td=null===(id=null===(ed=this.embedOptions.settings)||void 0===ed?void 0:ed.aiAssistant)||void 0===id?void 0:id.hideIcons)||void 0===td?void 0:td.helpLink)&&(null===(od=null===(sd=this.embedOptions.settings)||void 0===sd?void 0:sd.aiAssistant.hideIcons)||void 0===od?void 0:od.helpLink)}))),Ud.isAiSummariesEnabledGlobally="boolean"==typeof(null===(dd=null===(nd=this.embedOptions.embedAiAssistant)||void 0===nd?void 0:nd.summary)||void 0===dd?void 0:dd.enabled)?null===(rd=null===(ad=this.embedOptions.embedAiAssistant)||void 0===ad?void 0:ad.summary)||void 0===rd?void 0:rd.enabled:null!==(hd=null===(md=null===(bd=null===(ld=this.embedOptions.settings)||void 0===ld?void 0:ld.aiAssistant)||void 0===bd?void 0:bd.summary)||void 0===md?void 0:md.enabled)&&void 0!==hd&&hd,Ud.isAiSummariesEnabledGlobally&&(Ud.embedAiAssistant=Ud.embedAiAssistant||{},Ud.embedAiAssistant.summarization=Ud.embedAiAssistant.summarization||{},Ud.embedAiAssistant.summarization.enableWidgetSummary="boolean"==typeof(null===(pd=null===(cd=this.embedOptions.embedAiAssistant)||void 0===cd?void 0:cd.summary)||void 0===pd?void 0:pd.includeWidgetSummary)?null===(gd=null===(ud=this.embedOptions.embedAiAssistant)||void 0===ud?void 0:ud.summary)||void 0===gd?void 0:gd.includeWidgetSummary:null!==(wd=null===(fd=null===(vd=this.embedOptions.settings.aiAssistant)||void 0===vd?void 0:vd.summary)||void 0===fd?void 0:fd.widget)&&void 0!==wd&&wd,Ud.embedAiAssistant.summarization.enableDashboardSummary="boolean"==typeof(null===(Od=null===(Id=this.embedOptions.embedAiAssistant)||void 0===Id?void 0:Id.summary)||void 0===Od?void 0:Od.includeDashboardSummary)?null===(yd=null===(_d=this.embedOptions.embedAiAssistant)||void 0===_d?void 0:_d.summary)||void 0===yd?void 0:yd.includeDashboardSummary:null!==(Bd=null===(Sd=null===(Dd=null===(Ed=this.embedOptions.settings)||void 0===Ed?void 0:Ed.aiAssistant)||void 0===Dd?void 0:Dd.summary)||void 0===Sd?void 0:Sd.dashboard)&&void 0!==Bd&&Bd),Md.embedOptions.mode==BoldBI.Mode.AIAssistant){if(void 0===window.BoldBIAI||!window.BoldBIAI.UnifiedAIAgent)throw new Error(embeddingLocalization_1.errorMessages.AIAgentInitializationFailed);try{let e=window.bbEmbed.call(Md,"#"+Fd);new window.BoldBIAI.UnifiedAIAgent(e,Ud);console.log("AI Assitant initialized successfully.")}catch(e){console.error("Error initializing AI Assitant Agent:",e)}}if(Md.embedOptions.mode!=BoldBI.Mode.AIAssistant&&window.bbEmbed instanceof Function){let e,i=window.bbEmbed.call(Md,"#"+(Md.pinboardIds.length>0?Fd+"_embeddedbi":Md.childContainer.id));if(0===i.length&&(i=window.bbEmbed.call(Md,"#"+Fd+"_embeddedbi"),e=Fd+"_embeddedbi"),window.BoldBIDashboardDesigner instanceof Function){const t=this._getDashboardInstance(e);null!=t?(t.model=Object.assign(t.model,Ud),t.redrawDashboard()):window.BoldBIDashboardDesigner.call(Md,i,Ud)}else this._throwError(embeddingLocalization_1.errorMessages.ErrorInBoldBIDesigner);if(1==this.isMultipleWidgetMode){const e="string"==typeof kd.WidgetList?JSON.parse(kd.WidgetList):kd.WidgetList;let i=-1;if(Object.keys(e).forEach((t=>{if(i++,""==e[String(t)]){const s=embeddingLocalization_1.errorMessages.InvalidWidgetName;delete e[String(t)];const o=this.embedOptions.widgetList[Number(i)].containerId;this.errorOnContainer(s,o),this.embedOptions.widgetList.splice(i,1),i--}})),0==this.embedOptions.widgetList.length){if(this._isNullOrUndefined(this.embedOptions.events.onError)||""==this.embedOptions.events.onError)throw new Error(embeddingLocalization_1.errorMessages.InvalidAllWidgetNames);{const e=new Error(embeddingLocalization_1.errorMessages.InvalidAllWidgetNames);this.onErrorClient(e)}}kd.WidgetList=JSON.stringify(e)}}else if(this.embedOptions.mode!=BoldBI.Mode.AIAssistant)throw new Error(embeddingLocalization_1.errorMessages.bbEmbedNotDefined);if(""==this.embedOptions.widgetList&&this._removeElementsClass(Fd,".preloader-wrap","viewer-blue-loader"),this.isMultiTab&&!this.embedOptions.token&&!this.embedOptions.isPublicDashboard&&!this.embedOptions.embedToken&&kd.ItemDetail.ItemViews){const e=null===(Cd=this.embedOptions.dashboardSettings)||void 0===Cd?void 0:Cd.filterOverviewSettings,i=null===(Ad=null===(xd=this.embedOptions.settings)||void 0===xd?void 0:xd.viewer)||void 0===Ad?void 0:Ad.filterOverview;e&&(e.viewId=null,e.viewName=null),i&&(i.viewId=null,i.viewName=null),this.embedOptions.filterParameters=null}}}})),this._changeLayoutSuccess=this.Invoke((function(e){if(e.Status&&""!=this.homepageItemId&&this.isVirtualHomepage)this.afterVirtualHomepageSave(this.homepageItemId);else if(!e.Status)throw new Error(embeddingLocalization_1.errorMessages.LayoutFailure+e.Message)})),this._createPinboardDom=this.Invoke((function(e){const i=this;if(bbEmbed("#widget-container").attr("data-homepage-id",e.Id).attr("data-current-layout",e.ColumnInfo.Layout).attr("data-item-type",e.ItemType).attr("data-virtual-homepage",e.IsVirtualHomepage),"widget"==e.ItemType.toLowerCase()){const t=e.ColumnInfo.Column;bbEmbed.each(t,(function(e){bbEmbed("#widget-container").append("<ul id=column-"+(e+1)+' class="widget-list" data-column-id='+(e+1)+"></ul>"),t[`${e}`].Item.length>0?bbEmbed.each(t[`${e}`].Item,(function(s){var o,n,d,a,r;const l=null==t[`${e}`].Item[`${s}`].Id?"/bi/"+i.siteIdentifier+"/widgets/widgets":"/bi/"+i.siteIdentifier+"/dashboards",b=t[`${e}`].Item[`${s}`].Name,m=t[`${e}`].Item[`${s}`].WidgetType;let h=0;h=null!=m&&(m.includes("Card")||m.includes("Image"))?250:400;const c=null!=t[`${e}`].Item[`${s}`].QueryString?t[`${e}`].Item[`${s}`].QueryString:"",p=null==t[`${e}`].Item[`${s}`].TabId?l+"/"+t[`${e}`].Item[`${s}`].ItemId+"/"+(null!=t[`${e}`].Item[`${s}`].Id?t[`${e}`].Item[`${s}`].CategoryName+"/":"")+t[`${e}`].Item[`${s}`].ItemName+(""!=c?"?"+c:c):l+"/"+t[`${e}`].Item[`${s}`].ItemId+"/"+(null!=t[`${e}`].Item[`${s}`].Id?t[`${e}`].Item[`${s}`].CategoryName+"/":"")+t[`${e}`].Item[`${s}`].ItemName+"?tab="+t[`${e}`].Item[`${s}`].TabId+(""!=c?"&"+c:c),u=0!=s?'style="width:100%;height:100%;"':"";if(".sydj"!=t[`${e}`].Item[`${s}`].ItemExtension.toLowerCase())bbEmbed("#column-"+(e+1)).append('<li class="list-item" '+u+'><div class="widget" id=widget_'+(e+1)+"_"+(s+1)+' data-dashboardurl="'+p+'" style="height:100%;width:100%;"></div></li>');else{const t=("boolean"==typeof(null===(o=i.embedOptions.pinboardSettings)||void 0===o?void 0:o.enableUnpinWidget)?null===(n=i.embedOptions.pinboardSettings)||void 0===n?void 0:n.enableUnpinWidget:null===(r=null===(a=null===(d=i.embedOptions.settings)||void 0===d?void 0:d.pinboard)||void 0===a?void 0:a.unpinWidget)||void 0===r||r)?'<div id="widget-icons"><i class="items unpin-widget su su-delete" data-bs-toggle="tooltip" data-original-title="Unpin Widget"  style="color: black;" /></div>':"";bbEmbed("#column-"+(e+1)).append('<li class="list-item" '+u+'><div class="widget" id=widget_'+(e+1)+"_"+(s+1)+' data-dashboardurl="'+p+'" style="height: '+h+'px;width:100%;background:#fff;"><div class="widget-sortable" style="width:100%;float:left;display:block;height:0px"><div style="height:100%;width:100%;cursor:move;"><div id="item-name">'+b+"</div>"+t+"</div></div></div></li>")}})):bbEmbed("#column-"+(e+1)).append('<li class="empty click-container"><div class="empty-content empty-homepage"><span class="drag-widget" style="font-family:var(--font-family)">Drag your widgets here to customize layout</span></div></li>')}));const s=bbEmbed("li.list-item a");for(let e=0;e<s.length;e++)bbEmbed("li.list-item a").eq(e).attr("href",bbEmbed("li.list-item a").eq(e).attr("data-url"))}else"dashboard"==e.ItemType.toLowerCase()&&(bbEmbed("#add-item, #layout-container, #divider").hide(),bbEmbed("#widget-container").append('<ul id="column-1" class="dashboard-column col-lg-12 col-md-12 col-sm-12 col-12" data-column-id="1"><li class="dashboard-list"><div class="dashboard" id="dashboard_1_1" style="height:100%;width:100%"></div></li></ul>'))})),this._dragAndDropSuccess=this.Invoke((function(e){if(!e.Status)throw new Error(embeddingLocalization_1.errorMessages.DragAndDropError+e.Message)})),this._renderMultiTabDashboard=this.Invoke((function(e){this.isMultiTab=!0;const i=this,t=bbEmbed("#"+i.embedOptions.embedContainerId);t.html(""),"undefined"!=typeof ejdashboard&&ejdashboard.base&&"function"==typeof ejdashboard.base.registerLicense&&ejdashboard.base.registerLicense("Ngo9BigBOggjGyl/Vkd+XU9FfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTH9Td0BiXH9ecnVWTmFfWkd3");const s=i.embedOptions.embedContainerId+"_parent_multi_tab_dashboard",o=bbEmbed('<div id="'+s+'" class="bi-dashboard parent-multitab-dbrd" style="height: 100% !important"></div>');t.append(o);const n=i.embedOptions.embedContainerId+"_multi_tab_dashboard",d=bbEmbed('<div id="'+n+'" class="multitab-dbrd" style="height: 100% !important"></div>');o.append(d);const a=bbEmbed('<div class="e-tab-header"></div>'),r=bbEmbed('<div class="e-content"></div>');bbEmbed.map(e,(function(e){let t={};i.embedOptions.token||i.embedOptions.embedToken?(t.Id=e.DashboardId,t.Name=e.DashboardName,t.TabName=e.TabName||e.DashboardName):(t=JSON.parse(e.ItemDetail),t.TabName=e.TabName||t.Name),i.parentDbrdId=i.authToken?i.embedOptions.dashboardId:e.parentId;const s=t.Id.replaceAll("-","");i.dashboardDetails[`${s}`]=e,i._isNullOrUndefined(i.embedOptions.dashboardSettings.dashboardName)||"string"==typeof i.embedOptions.dashboardSettings.dashboardName||bbEmbed.map(i.embedOptions.dashboardSettings.dashboardName,(function(e){t.Name=s==e.dashboardId.replaceAll("-","")?i._isEmptyOrSpaces(e.displayName)?t.Name:e.displayName:t.Name})),a.append(bbEmbed('<div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+t.TabName+"</div>"));const o=bbEmbed('<div style="height:100%;width:100%;overflow: hidden !important;" id="multi_'+s+'"></div>');r.append(bbEmbed("<div></div>").append(o.append('<div id="multi_'+s+'_embeddedbi" class="bbembed-multitab-dbrd"></div>')))})),d.append(a).append(r),tabInstance=new ejdashboard.navigations.Tab({enableAnimation:!1,selected:bbEmbed.proxy(this._tabSelected,this)}),tabInstance.appendTo("#"+n),bbEmbed(".e-tab-header .e-toolbar-item .e-tab-text").css({display:"inline-block",width:"150px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis",color:"#000","font-family":"var(--font-family)","text-transform":"none"}),bbEmbed('<style type="text/css"> .embed-multi-tab-indicator{ background: var(--primary-branding-color) !important; border-radius: 4px; display: block !important; height: 5px !important;}</style>').appendTo("head"),bbEmbed(".e-control.e-tab .e-tab-header .e-indicator").addClass("embed-multi-tab-indicator"),bbEmbed.map(bbEmbed(".e-tab-header .e-toolbar-item .e-tab-text"),(function(e,i){bbEmbed(e).attr("title",bbEmbed(e).text()),bbEmbed(bbEmbed(".e-content").find("#e-content-multi_tab_dashboard_"+i).children()).css({height:"100%",width:"100%",overflow:"hidden",display:"block",position:"absolute",left:bbEmbed(".e-content.e-lib.e-touch").width()*i})})),bbEmbed(".multitab-dbrd .e-content").attr("style","height: 100% !important"),bbEmbed.map(bbEmbed(".multitab-dbrd .e-content").children(),(function(e){bbEmbed(e).css({height:"100%"})})),bbEmbed(t).css({"overflow-x":"hidden","overflow-y":"hidden",width:i.embedOptions.width}),bbEmbed("#"+n).css({width:bbEmbed(".e-content.e-lib.e-touch").width(),height:this.embedOptions.height}),bbEmbed(".e-tab-header")[0].ej2_instances[0].refreshOverflow(),tabInstance.resizeContext(),bbEmbed.map(e,(function(e,t){if(0==t){const t={Apistatus:!0,Data:e,Status:!0};i._renderDashboard(t)}}))})),this._getAuthorizationToken=this.Invoke((function(e){const i=this,t=e||this.embedOptions.dashboardId,s=this.embedOptions.dashboardIds.join(","),o=this.embedOptions.dashboardPaths.join(",");let n="embed_nonce="+this._uuidv4Generator()+"&embed_dashboard_id="+t+"&embed_dashboard_ids="+s+"&embed_dashboard_path="+this.embedOptions.dashboardPath+"&embed_dashboard_paths="+o+"&pinboard_name="+(this.pinBoardRendered?this.embedOptions.pinboardName:"")+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(this.embedOptions.anonymousToken.isEnabled){const{groupName:e,userEmail:i}=this.embedOptions.anonymousToken;n+=`&embed_user_email=${i}&embed_anonymous_token=true&embed_authorize_group=${e}`}if(this.embedOptions.viewId?n=n+"&embed_dashboardview_id="+this.embedOptions.viewId:this.embedOptions.viewName&&(n=n+"&embed_dashboardview_name="+this.embedOptions.viewName),this.isWidgetMode)if(0==this.isMultipleWidgetMode)n=n+"&embed_widget_isenabled="+this.isWidgetMode+"&embed_widget_name="+this.widgetName;else{const e=[];this.embedOptions.widgetList.forEach((function(i){e.push(i.widgetName.toLowerCase())})),n=n+"&embed_widget_isenabled="+this.isWidgetMode+"&embed_widget_list="+e}this.isMultiTab&&(n=n+"&isMultiTab="+this.isMultiTab),this._isEmptyOrSpaces(this.embedOptions.datasourceId)?this._isEmptyOrSpaces(this.embedOptions.datasourceName)||(n=n+"&embed_datasource_name="+this.embedOptions.datasourceName):n=n+"&embed_datasource_id="+this.embedOptions.datasourceId;const d={embedQuerString:encodeURI(n),embedQueryString:encodeURI(n),dashboardServerApiUrl:this.dashboardServerApiUrl};if(""!=this.embedOptions.authorizationServer.url)this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,d,this.embedOptions.authorizationServer.headers,this._renderDashboard);else if(this._isNullOrUndefined(this.embedOptions.authorizationServer.data)||""==this.embedOptions.authorizationServer.data||""!=this.embedOptions.authorizationServer.url)if(this.embedOptions.enableDomainMasking)this._renderDashboard(this.embedOptions.authorizationServer.data);else{if(""!=this.embedOptions.authorizationServer.url&&""!=this.embedOptions.authorizationServer.data||this.embedOptions.mode!=BoldBI.Mode.View||!this._isEmptyOrSpaces(this.embedOptions.pinboardName)||!(this.embedOptions.dashboardId||this.embedOptions.dashboardPath||this.embedOptions.dashboardIds||this.embedOptions.dashboardPaths))throw new Error(embeddingLocalization_1.errorMessages.AuthorizationServerMissing);bbEmbed.ajax({async:!0,type:"POST",url:this.dashboardServerApiUrl+this.embedAuthorizeEndPoint,data:JSON.stringify(n),contentType:"application/json",success:bbEmbed.proxy(i._renderDashboard,i)})}else this._renderDashboard(this.embedOptions.authorizationServer.data);this.pinBoardRendered=!0})),this._validateOptions=this.Invoke((function(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B,C;const x=e;this.embedOptions=Object.assign(Object.assign({},this.embedOptions),{embedContainer:e.embedContainerId,hideErrorMessage:e.hideErrorMessage,widgetSettings:Object.assign({},x.widgetSettings),exportSettings:Object.assign({},x.exportSettings),pinboardSettings:Object.assign({},x.pinboardtSettings),autoRefreshSettings:Object.assign({},x.autoRefreshSettings),designCanvasSettings:Object.assign({},x.designCanvasSettings),dashboardSettings:Object.assign({},x.dashboardSettings),embedAiAssistant:Object.assign({},x.embedAiAssistant),customBrandSettings:Object.assign({},x.customBrandSettings),toolbarSettings:Object.assign({},x.toolbarSettings),languageSettings:Object.assign({},x.languageSettings),localeSettings:Object.assign({},x.localeSettings),dynamicConnection:Object.assign({},x.dynamicConnection),settings:Object.assign({},x.settings)});const A=null===(i=x.settings)||void 0===i?void 0:i.viewer;this.editIgnore=null!==(o=null!==(s=null===(t=x.dashboardSettings)||void 0===t?void 0:t.edit)&&void 0!==s?s:null==A?void 0:A.edit)&&void 0!==o?o:(null==e?void 0:e.mode)===BoldBI.Mode.Design,this.bingMapRequired="boolean"==typeof x.isBingMapRequired?x.isBingMapRequired:null!==(d=null===(n=x.settings)||void 0===n?void 0:n.bingMapRequired)&&void 0!==d&&d,this.restrictMobileView="boolean"==typeof x.restrictMobileView?x.restrictMobileView:null!==(r=null===(a=x.settings)||void 0===a?void 0:a.restrictMobileView)&&void 0!==r&&r,this.disableAutoRecover="boolean"==typeof x.disableAutoRecover?x.disableAutoRecover:null!==(b=null===(l=x.settings)||void 0===l?void 0:l.disableAutoRecover)&&void 0!==b&&b;const M=this.embedOptions.dashboardSettings,F=this.embedOptions.widgetSettings,T=this.embedOptions.exportSettings,k=this.embedOptions.settings;if(this.dashboardWidgetExports.dashboard={showExport:"boolean"==typeof(null==M?void 0:M.showExport)?M.showExport:null===(h=null===(m=null==k?void 0:k.viewer)||void 0===m?void 0:m.export)||void 0===h||h,showMoreOption:"boolean"==typeof(null==M?void 0:M.showMoreOption)?M.showMoreOption:null===(p=null===(c=null==k?void 0:k.viewer)||void 0===c?void 0:c.moreOption)||void 0===p||p,showMetrics:"boolean"==typeof(null==M?void 0:M.showMetrics)?M.showMetrics:null===(g=null===(u=null==k?void 0:k.viewer)||void 0===u?void 0:u.metrics)||void 0===g||g},this.dashboardWidgetExports.widget={showExport:"boolean"==typeof(null==F?void 0:F.showExport)?F.showExport:null===(f=null===(v=null==k?void 0:k.widget)||void 0===v?void 0:v.export)||void 0===f||f,showMoreOption:"boolean"==typeof(null==F?void 0:F.showMoreOption)?F.showMoreOption:null===(I=null===(w=null==k?void 0:k.widget)||void 0===w?void 0:w.moreOption)||void 0===I||I},this.dashboardWidgetExports.export={excel:"boolean"==typeof(null==T?void 0:T.showExcel)?T.showExcel:null===(_=null===(O=null==k?void 0:k.export)||void 0===O?void 0:O.excel)||void 0===_||_,pdf:"boolean"==typeof(null==T?void 0:T.showPDF)?T.showPDF:null===(E=null===(y=null==k?void 0:k.export)||void 0===y?void 0:y.pdf)||void 0===E||E,image:"boolean"==typeof(null==T?void 0:T.showImage)?T.showImage:null===(S=null===(D=null==k?void 0:k.export)||void 0===D?void 0:D.image)||void 0===S||S,csv:"boolean"==typeof(null==T?void 0:T.showCSV)?T.showCSV:null===(C=null===(B=null==k?void 0:k.export)||void 0===B?void 0:B.csv)||void 0===C||C},e.enableDomainMasking)return!0;if(this._isNullOrUndefined(e.onError)||(this.embedOptions.events.onError=e.onError),this._isEmptyOrSpaces(e.embedContainerId)&&this._isNullOrUndefined(e.widgetList))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.InvalidEmbedContainerID);if(this._isEmptyOrSpaces(e.serverUrl))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.EmptyServerURL);if(e.mode==BoldBI.Mode.AIAssistant)return!0;if(!this._isUrl(e.serverUrl))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.InvalidServerURL);if(!this._isEmptyOrSpaces(e.pinboardName))return!0;if(e.mode==BoldBI.Mode.Connection)return!0;if(e.dashboardPath||e.dashboardPaths&&e.mode!==BoldBI.Mode.DataSource){const i=e.dashboardPath?[e.dashboardPath]:e.dashboardPaths;i.forEach(((e,t)=>{i[Number(t)]=`${e.startsWith("/")?"":"/"}${e}`.replace(/\/+$/,"");const s=i[Number(t)].split("/");if(3!==s.length||""!==s[0]||""===s[1]||""===s[2])throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardPath+e)})),e.dashboardPath?e.dashboardPath=i[0]:e.dashboardPaths=i}if(this._isEmptyOrSpaces(e.dashboardId)&&(!e.dashboardIds||!e.dashboardIds.length)&&(!e.dashboardPaths||!e.dashboardPaths.length)&&this._isEmptyOrSpaces(e.dashboardPath)&&e.mode!==BoldBI.Mode.Design&&this._isEmptyOrSpaces(e.datasourceId)&&this._isEmptyOrSpaces(e.datasourceName)){if(e.mode==BoldBI.Mode.DataSource)throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.EmptyDatasourceDetails);if(this._isEmptyOrSpaces(e.pinboardName)&&!this._isNullOrUndefined(e.pinboardName))throw this.invalidDetail=!0,new Error(embeddingLocalization_1.errorMessages.PinboardNameEmpty);if(this._isEmptyOrSpaces(e.viewId))throw this.invalidDetail=!0,this._isNullOrUndefined(e.token)&&this._isNullOrUndefined(e.embedToken)?new Error(embeddingLocalization_1.errorMessages.EmptyDbrdOrViewID):new Error(embeddingLocalization_1.errorMessages.EmptyDbrdOrViewIDForToken)}return!0}));const i=JSON.parse(JSON.stringify(default_1.DefaultConstructor));Object.assign(this,i,e),this.loadDashboard=this.Invoke((function(e){this._loadDashboard(e)})),this.loadMultitabDashboard=this.Invoke((function(e){this.deprecationMessage("loadMultitabDashboard"),this._loadMultitabDashboard(e)})),this.loadTabbedDashboards=this.Invoke((function(e){this.deprecated=!1,this._loadMultitabDashboard(e)})),this.loadView=this.Invoke((function(){this._loadView()})),this.loadDashboardWidget=this.Invoke((function(e,i){this.deprecationMessage("loadDashboardWidget"),this._loadDashboardWidget(e,i)})),this.loadAIAssistant=this.Invoke((function(){this._loadAIAssistant()})),this.loadWidget=this.Invoke((function(e,i){this.deprecated=!1,this._loadDashboardWidget(e,i)})),this.loadMultipleWidgets=this.Invoke((function(e){this.deprecationMessage("loadMultipleWidgets"),this._loadMultipleWidgets(e)})),this.loadWidgets=this.Invoke((function(e){this.deprecated=!1,this._loadMultipleWidgets(e)})),this.loadDesigner=this.Invoke((function(e){this._loadDesigner(e)})),this.refreshWidgetData=this.Invoke((function(e,i,t){this.deprecationMessage("refreshWidgetData"),this._refreshWidgetData(e,i,t)})),this.addWidgetToPinboard=this.Invoke((function(e,i,t){this.deprecationMessage("addWidgetToPinboard"),this._addWidgetToPinboard(e,i,t)})),this.saveFilterView=this.Invoke((function(e,i){this.deprecationMessage("saveFilterView"),this._saveFilterViews(e,i)})),this.saveAsFilterView=this.Invoke((function(e,i){this.deprecationMessage("saveAsFilterView"),this._saveAsFilterViews(e,i)})),this.updateFilterView=this.Invoke((function(e,i){this.deprecationMessage("updateFilterView"),this._updateFilterViews(e,i)})),this.getViewsByDashboardId=this.Invoke((function(e,i){this.deprecationMessage("getViewsByDashboardId"),this._getViewsByDashboardId(e,i)})),this.getViewByViewId=this.Invoke((function(e,i){this.deprecationMessage("getViewByViewId"),this._getViewByViewId(e,i)})),this.deleteFilterView=this.Invoke((function(e,i){this.deprecationMessage("deleteFilterView"),this._deleteFilterView(e,i)}))}_loadAIAssistant(){this._isInvalidEmbed(BoldBI.Mode.AIAssistant,"EmbedModeInvalid")||(this._showLoader(),this._isAIDepdencyLoaded(this))}_loadDashboard(e){if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(null!=e&&(this.embedOptions.dashboardId=e),this._isEmptyOrSpaces(this.embedOptions.dashboardId)&&this._isEmptyOrSpaces(this.embedOptions.dashboardPath)&&this._isEmptyOrSpaces(this.embedOptions.ViewId))throw new Error(embeddingLocalization_1.errorMessages.EmptyDbrdOrViewID);if(this.embedOptions.anonymousToken.isEnabled){const{groupName:e,userEmail:i}=this.embedOptions.anonymousToken;if(this._isEmptyOrSpaces(e)&&this._isEmptyOrSpaces(i))throw new Error(embeddingLocalization_1.errorMessages.AnonymousEmailandGroup);if(this._isEmptyOrSpaces(e))throw new Error(embeddingLocalization_1.errorMessages.AnonymousGroup);if(this._isEmptyOrSpaces(i))throw new Error(embeddingLocalization_1.errorMessages.AnonymousEmail)}this._checkWidgetList()||(this.embedOptions.embedType==BoldBI.EmbedType.Component?(this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],this.isDashboardRendering=!0,this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this)):this.embedOptions.embedType==BoldBI.EmbedType.IFrame&&this._createIframe(`${this.embedOptions.serverUrl}/dashboards/${this.embedOptions.dashboardId}?isembed=true`))}}_loadMultitabDashboard(e){var i,t;if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(null!=e&&(this.embedOptions.dashboardIds=e),this.embedOptions.embedToken||this.embedOptions.token)throw new Error(embeddingLocalization_1.errorMessages.UnableMultitabDashboardToken);(null===(i=this.embedOptions.dashboardIds)||void 0===i?void 0:i.length)&&(this.embedOptions.dashboardIds=Array.from(new Set(this.embedOptions.dashboardIds))),(null===(t=this.embedOptions.dashboardPaths)||void 0===t?void 0:t.length)&&(this.embedOptions.dashboardPaths=Array.from(new Set(this.embedOptions.dashboardPaths))),this.embedOptions.embedType==BoldBI.EmbedType.Component&&(this.embedOptions.viewId="",this.embedOptions.viewName="",this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this))}}_loadView(){if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(""==this.embedOptions.viewId&&""==this.embedOptions.viewName)throw new Error(embeddingLocalization_1.errorMessages.EmptyViewDetails);this.embedOptions.embedType==BoldBI.EmbedType.Component&&(this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],this.isDashboardViewRendering=!0,this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this))}}_loadDashboardWidget(e,i){if(this._isEmptyOrSpaces(e))throw new Error(embeddingLocalization_1.errorMessages.EmptyWidgetID);this._isInvalidEmbed(BoldBI.Mode.View,"UnableWidgetRender")||(""!=this.embedOptions.pinboardName&&this.pinBoardRendered&&(this.embedOptions.pinboardName=""),this._checkWidgetList()||(this.embedOptions.embedType==BoldBI.EmbedType.Component?(this.embedOptions.viewId="",this.embedOptions.viewName="",this.embedOptions.dashboardIds=[],this.embedOptions.dashboardPaths=[],this._setEmbedDefaults(),this.isWidgetMode=!0,this.widgetName=e,this._showLoader(),this._isDependencyLoaded(this,i)):this.embedOptions.embedType==BoldBI.EmbedType.IFrame&&this._createIframe(`${this.embedOptions.serverUrl}/dashboards/${this.embedOptions.dashboardId}?isembed=true`)))}_loadMultipleWidgets(e){if(""==this.embedOptions.widgetList)throw new Error(embeddingLocalization_1.errorMessages.EmptyWidgetList);if(!this._isInvalidEmbed(BoldBI.Mode.View,"EmbedModeInvalid")){if(null!=e&&(this.embedOptions.dashboardId=e),this.embedOptions.embedToken||this.embedOptions.token)throw new Error(embeddingLocalization_1.errorMessages.UnableMultipleWidgetsToken);if(this.embedOptions.embedType==BoldBI.EmbedType.Component){this._setEmbedDefaults(),this.isWidgetMode=!0,this.isMultipleWidgetMode=!0,this.loadMultipleWidget=!0;const i=setInterval((()=>{window.jQuery&&(clearInterval(i),this._widgetNamesEmpty()&&this._isDependencyLoaded(this,e))}),1e3)}}}_loadDesigner(e){this._isInvalidEmbed(BoldBI.Mode.Design,"EmbedModeInvalid")||(null!=e&&(this.embedOptions.dashboardId=e),this._checkWidgetList()||(this.embedOptions.embedType==BoldBI.EmbedType.Component?(this.isDashboardRendering=!0,this._setEmbedDefaults(),this._showLoader(),this._isDependencyLoaded(this)):this.embedOptions.embedType==BoldBI.EmbedType.IFrame&&this._createIframe(`${this.embedOptions.serverUrl}/dashboard-designer/${this.embedOptions.dashboardId}?isembed=true`)))}_createIframe(e){var i;const t=document.createElement("iframe");t.frameBorder=0,t.width=this.embedOptions.width,t.height=this.embedOptions.height,t.id=`${this.embedOptions.embedContainerId}_${this.embedOptions.dashboardId}`,t.allowfullscreen=this.embedOptions.dashboardSettings.showFullScreen,t.setAttribute("src",e),null===(i=document.getElementById(this.embedOptions.embedContainerId))||void 0===i||i.appendChild(t)}_setEmbedDefaults(){this.isWidgetMode=!1,this.widgetName="",this.isDashboardViewMode=!1,this.dashboardViewName=""}_isInvalidEmbed(e,i){if(this.invalidDetail)return!0;if(this.embedOptions.mode!==e)throw new Error(embeddingLocalization_1.errorMessages[i]);return""!=this.embedOptions.pinboardName&&(this.embedOptions.pinboardName=""),!1}_refreshWidgetData(e,i,t){if(1!=Array.isArray(e))throw new Error(embeddingLocalization_1.errorMessages.ArrayWidgetNames);if(this.isMultiTab){const s=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let o=0;o<s.length;o++)if(bbEmbed(s[`${o}`]).attr("id").includes(t.toString().replaceAll("-",""))>0){const t=bbEmbed(s[`${o}`]).attr("id"),n=this._getDashboardInstance(t);null!=n&&n.refreshWidget(e,i);break}}else if(this.isMultipleWidgetMode)this._multipleWidgets("refreshWidget",e,i);else{const t=this._getDashboardInstance();null!=t&&t.refreshWidget(e,i)}}_addWidgetToPinboard(e,i,t){if(this._isEmptyOrSpaces(e)||this._isEmptyOrSpaces(i)||this._isEmptyOrSpaces(t))throw this._isEmptyOrSpaces(e)||this._isEmptyOrSpaces(i)?new Error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidget):new Error(embeddingLocalization_1.errorMessages.InvalidWidgetName);{if(!/^[a-zA-Z0-9!@$^ ()_=\-}{.`~]*$/.test(t))throw new Error(embeddingLocalization_1.errorMessages.WidgetNameSpecialChar);const s=bbEmbed("#widget-container").attr("data-homepage-id"),o=this,n="embed_nonce="+this._uuidv4Generator()+"&homepageId="+s+"&isPinUpdate="+!0+"&pinWidgetId="+i+"&pinDashbooardId="+e+"&pinWidgetName="+(this._isNullOrUndefined(t)?null:t)+"&pinboard_name="+this.embedOptions.pinboardName+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime,d={embedQuerString:encodeURI(n),embedQueryString:encodeURI(n),dashboardServerApiUrl:this.dashboardServerApiUrl};this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,d,this.embedOptions.authorizationServer.headers,(function(e){e.Status?o._addWidgetInPinboard(e.Data):e.Status||o._throwError(embeddingLocalization_1.errorMessages.UnableAddWidget+e.Message)}))}}_makeAjaxRequest(e,i,t,s,o={},n){const d=this._validatetoken(this.accessToken),a=this;bbEmbed.ajax({async:!1,type:e,url:i,headers:{Authorization:d},data:JSON.stringify(t),contentType:"application/json",success:function(e){a[n](e,s,a,o)},error:function(e){a.ajaxErrorFnc(e)}})}_saveFilterViews(e,i){const t=this._isValidGuid(e.ItemId),s=!!this.isMultiTab&&this._isValidGuid(e.ChildItemId);if(this._isEmptyOrSpaces(e.ViewName)||this._isEmptyOrSpaces(e.QueryString)||!(this.isMultiTab&&s&&t||t)){if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID);if(this.isMultiTab&&!s)throw new Error(embeddingLocalization_1.errorMessages.InvalidChildDbrdID);if(this._isEmptyOrSpaces(e.ViewName))throw new Error(embeddingLocalization_1.errorMessages.InvalidViewName);if(this._isEmptyOrSpaces(e.QueryString))throw new Error(embeddingLocalization_1.errorMessages.InvalidQueryString)}else{const t={ViewName:e.ViewName,ItemId:e.ItemId,QueryString:e.QueryString,IsPublic:!1,ChildItemId:this.isMultiTab?e.ChildItemId:null,IsDefault:!!e.IsDefault&&e.IsDefault};this._makeAjaxRequest("POST",`${this.dashboardServerApiUrl}/v4.0/dashboards/views`,t,i,e,"_saveViewSuccess")}}_saveAsFilterViews(e,i){const t=this._isValidGuid(e.ItemId),s=!!this.isMultiTab&&this._isValidGuid(e.ChildItemId);if(this._isEmptyOrSpaces(e.ViewName)||this._isEmptyOrSpaces(e.QueryString)||!(this.isMultiTab&&s&&t||t)){if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID);if(this.isMultiTab&&!s)throw new Error(embeddingLocalization_1.errorMessages.InvalidChildDbrdID);if(this._isEmptyOrSpaces(e.ViewName))throw new Error(embeddingLocalization_1.errorMessages.InvalidViewName);if(this._isEmptyOrSpaces(e.QueryString))throw new Error(embeddingLocalization_1.errorMessages.InvalidQueryString)}else{const t={ViewName:e.ViewName,ItemId:e.ItemId,QueryString:e.QueryString,ChildItemId:this.isMultiTab?e.ChildItemId:null,IsDefault:!!e.IsDefault&&e.IsDefault};this._makeAjaxRequest("POST",`${this.dashboardServerApiUrl}/v4.0/dashboards/views`,t,i,e,"_saveViewSuccess")}}_updateFilterViews(e,i){const t=this._isValidGuid(e.DashboardId),s=this._isValidGuid(e.ViewId);if(t&&!this._isEmptyOrSpaces(e.QueryString)&&s){const t={ViewId:e.ViewId,DashboardId:e.DashboardId,QueryString:e.QueryString,IsDefault:e.IsDefault};this._makeAjaxRequest("PUT",`${this.dashboardServerApiUrl}/v4.0/dashboards/views`,t,i,e,"_updateFilterViewsSuccess")}else{if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID);if(!s)throw new Error(embeddingLocalization_1.errorMessages.InvalidViewID);if(this._isEmptyOrSpaces(e.QueryString))throw new Error(embeddingLocalization_1.errorMessages.InvalidQueryString)}}_getViewsByDashboardId(e,i){const t=this._isValidGuid(e);if(t){const t={DashboardId:e};this._makeAjaxRequest("GET",`${this.dashboardServerApiUrl}/v4.0/dashboards/${e}/views`,t,i,null,"_getViewsByDashboardIdSuccess")}else if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}_getViewByViewId(e,i){const t=this._isValidGuid(e);if(t){const t={ViewId:e};this._makeAjaxRequest("GET",`${this.dashboardServerApiUrl}/v4.0/dashboards/views/${e}`,t,i,null,"_getViewByViewIdSuccess")}else if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidViewID)}_deleteFilterView(e,i){const t=this._isValidGuid(e);if(t){const t={ViewId:e};this._makeAjaxRequest("DELETE",`${this.dashboardServerApiUrl}/v4.0/dashboards/views/${e}`,t,i,e,"_deleteFilterViewSuccess")}else if(!t)throw new Error(embeddingLocalization_1.errorMessages.InvalidViewID)}_saveViewSuccess(e,i,t,s){const o=t;if(e.Status){const t={ItemId:s.ItemId,ViewId:e.Data,ViewName:s.ViewName};o._updateInFilterOverviewUI(t.ViewName,e.Data),window[`${i}`]instanceof Function?window[`${i}`].call(o,t,e.StatusMessage):i.call(o,t,e.StatusMessage)}else window[`${i}`]instanceof Function?window[`${i}`].call(o,null,e.StatusMessage):i.call(o,null,e.StatusMessage)}_updateFilterViewsSuccess(e,i,t,s){const o=t;if(e.Status){const t={};t.ViewId=s.ViewId,window[`${i}`]instanceof Function?window[`${i}`].call(o,t,e.StatusMessage):i.call(o,t,e.StatusMessage)}}_deleteFilterViewSuccess(e,i,t,s){var o=t;window[`${i}`]instanceof Function?window[`${i}`].call(o,s):i.call(o,s)}_getViewByViewIdSuccess(e,i,t){const s=t,o={};e&&(o.ViewId=e.ViewId,o.ViewName=e.ViewName,o.QueryString=e.QueryString),window[`${i}`]instanceof Function?window[`${i}`].call(s,o):i.call(s,o)}_getViewsByDashboardIdSuccess(e,i,t){const s=t;if(e){const t=[];for(let i=0;i<e.length;i++){const s={};s.ItemId=e[`${i}`].ItemId,s.ViewId=e[`${i}`].ViewId,s.ViewName=e[`${i}`].ViewName,s.QueryString=e[`${i}`].QueryString,t.push(s)}window[`${i}`]instanceof Function?window[`${i}`].call(s,t):i.call(s,t)}else window[`${i}`]instanceof Function?window[`${i}`].call(s):i.call(s)}_isValidGuid(e){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)}_initializeDashboardContainer(){const e=this.embedOptions.embedContainerId;this.childContainer=document.createElement("div"),this.childContainer.id=e+"_embeddedbi";const i=BoldBI._gettinstance(document.getElementById(e),"embeddedBoldBI");i&&void 0!==bbEmbed&&(this.deprecated=!1,i.destroy());const t=document.getElementById(e);t&&(t.innerHTML="",t.append(this.childContainer)),BoldBI._putinstance(t,"embeddedBoldBI",this.storeObj)}static create(e){const i=new BoldBI;if(i.isMultiTab=!1,i.parentDbrdId="",i.pinboardIds=[],delete window.multiTabFilterParameter,document.addEventListener&&(document.addEventListener("webkitfullscreenchange",(function(){i._fullscreenExitHandler(i)}),!1),document.addEventListener("mozfullscreenchange",(function(){i._fullscreenExitHandler(i)}),!1),document.addEventListener("fullscreenchange",(function(){i._fullscreenExitHandler(i)}),!1),document.addEventListener("MSFullscreenChange",(function(){i._fullscreenExitHandler(i)}),!1),window.addEventListener("resize",(function(){i._isNullOrUndefined(bbEmbed)||(i.deprecated=!1,i.resizeDashboard()),i._isEmptyOrSpaces(i.embedOptions.pinboardName)&&(i._isNullOrUndefined(i.embedOptions.pinboardName)||i._isNullOrUndefined(bbEmbed))||i.setListMinimumHeight()}))),i._validateOptions(e)){if(i._initializeEmbedOptions(e),i.embedOptions.embedType!=BoldBI.EmbedType.Component){i._throwError(embeddingLocalization_1.errorMessages.InvalidEmbedType,i.embedOptions.embedContainerId),i.invalidDetail=!0;const e=Object.assign(i);return i.storeObj=e,e}try{if(""==i.embedOptions.widgetList||i.embedOptions.embedContainerId){i.childContainer=document.createElement("div"),i.childContainer.id=i.embedOptions.embedContainerId+"_embeddedbi";const e=BoldBI._gettinstance(document.getElementById(i.embedOptions.embedContainerId),"embeddedBoldBI");null==e&&null==e||i._isNullOrUndefined(bbEmbed)||e.dispose(),document.getElementById(i.embedOptions.embedContainerId).innerHTML="",document.getElementById(i.embedOptions.embedContainerId).append(i.childContainer)}if(!i._initializeUrls()){i.invalidDetail=!0;const e=Object.assign(i);return i.storeObj=e,e}i.embedOptions.width||i.embedOptions.height||i._setDimensions(),i.IsDependencyLoaded||(i.embedOptions.environment==BoldBI.Environment.Cloud?(i._isEmptyOrSpaces(i.cdnLink)||i._isEmptyOrSpaces(i.designerRootUrl))&&i._getCloudLinks():i._addJquerydependentFiles())}catch(e){if(e.message==embeddingLocalization_1.errorMessages.CantReadNull)return alert(embeddingLocalization_1.errorMessages.InvalidEmbedContainerID),!1;{i._throwError(e.message,i.embedOptions.embedContainerId),i.invalidDetail=!0;const t=Object.assign(i);return i.storeObj=t,t}}if(""==i.embedOptions.widgetList||i.embedOptions.embedContainerId){const e=document.getElementById(i.embedOptions.embedContainerId);this._hasinstance(e,"embeddedBoldBI")&&this._removeinstance(e,"embeddedBoldBI")}const t=Object.assign(i);if(i.storeObj=t,""==i.embedOptions.widgetList||i.embedOptions.embedContainerId){const e=document.getElementById(i.embedOptions.embedContainerId);this._putinstance(e,"embeddedBoldBI",t)}return t}i._initializeEmbedOptions(e),i.invalidDetail=!0;const t=Object.assign(i);return i.storeObj=t,t}static getInstance(e){return BoldBI._widgetsCollection=[],this._gettinstance(document.getElementById(e),"embeddedBoldBI")}Invoke(e){const i=this;return function(...t){try{return e.apply(this,t)}catch(e){i._throwError(e,this.embedOptions.embedContainer)}}.bind(this)}dispose(){this.deprecated=!1,this.destroy()}destroy(){this.deprecationMessage("destroy");const e=this;if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.destroy()}BoldBI._removeinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBI"),document.getElementById(this.embedOptions.embedContainerId).innerHTML=""}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each((function(){const i=e._getDashboardInstance(this.id);null!=i&&i.destroy()})),BoldBI._removeinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBI"),document.getElementById(this.embedOptions.embedContainerId).innerHTML="";else{this.isMultipleWidgetMode&&this._multipleWidgets("destroy");const e=this.embedOptions.embedContainerId,i=this._getDashboardInstance();null!=i&&i.destroy(),BoldBI._removeinstance(document.getElementById(e),"embeddedBoldBI"),document.getElementById(e).innerHTML=""}1==this.embedOptions.isRemoveStyle&&document.querySelectorAll("link").forEach((function(i){e.cssFiles.forEach((function(e){-1!=i.href.toLowerCase().indexOf(e.toLowerCase())&&i.parentNode.removeChild(i)}))}))}loadDashboardView(){throw new Error(embeddingLocalization_1.errorMessages.NotImplementedMethod)}exportDashboardAsPdf(e){if(this.deprecationMessage("exportDashboardAsPdf"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportAsPdf(e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}else{const i=this._getDashboardInstance();null!=i&&(e?i.exportAsPdf(e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters):i.exportAsPdf())}}exportDashboardAsImage(e){if(this.deprecationMessage("exportDashboardAsImage"),parseInt(e.resolutionDpi,10)>300&&(e.resolutionDpi="300"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportAsImage(e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}else{const i=this._getDashboardInstance();null!=i&&(e?i.exportAsImage(e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters):i.exportAsImage())}}exportDashboardAsExcel(e){if(this.deprecationMessage("exportDashboardAsExcel"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportAsExcel(e.fileName,e.fileType)}else{const i=this._getDashboardInstance();null!=i&&(e?i.exportAsExcel(e.fileName,e.fileType):i.exportAsExcel())}}exportWidgetAsPdf(e){this.deprecationMessage("exportWidgetAsPdf");const i=this;if(this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsPdf(e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsPdf(e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsPdf",e.dashboardId,e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsPdf(e.widgetName,e.fileName,e.pageSize,e.pageOrientation,e.showAppliedFilters)}}exportWidgetAsImage(e){this.deprecationMessage("exportWidgetAsImage");const i=this;if(parseInt(e.resolutionDpi,10)>300&&(e.resolutionDpi="300"),this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsImage(e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsImage(e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsImage",e.dashboardId,e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsImage(e.widgetName,e.fileName,e.exportImageFormat,e.resolutionDpi,e.showAppliedFilters)}}exportWidgetAsExcel(e){this.deprecationMessage("exportWidgetAsExcel");const i=this;if(this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsExcel(e.widgetName,e.fileName,e.fileType)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsExcel(e.widgetName,e.fileName,e.fileType)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsExcel",e.dashboardId,e.widgetName,e.fileName,e.fileType);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsExcel(e.widgetName,e.fileName,e.fileType)}}exportWidgetAsCsv(e){this.deprecationMessage("exportWidgetAsCsv");const i=this;if(this.isMultiTab){let i=e.dashboardId;i=i.replaceAll("-","");const t="multi_"+i+"_embeddedbi",s=this._getDashboardInstance(t);null!=s&&s.exportWidgetAsCsv(e.widgetName,e.fileName)}else if(bbEmbed(".pinBoardDbrd").length>0){const t=bbEmbed(".pinBoardDbrd").length;for(let s=0;s<t;s++)if(i.pinboardIds[`${s}`].widgetId==e.dashboardId){const t=i.pinboardIds[`${s}`].pinboardContainerId,o=i._getDashboardInstance(t+"_embeddedbi");null!=o&&o.exportWidgetAsCsv(e.widgetName,e.fileName)}}else if(this.isMultipleWidgetMode)this._multipleWidgets("exportWidgetAsCsv",e.dashboardId,e.widgetName,e.fileName);else{const i=this._getDashboardInstance();null!=i&&i.exportWidgetAsCsv(e.widgetName,e.fileName)}}updateDatasource(){this.deprecationMessage("updateDatasource");const e=this._getDashboardInstance();null!=e&&e.modules.queryDesigner.saveQueryInfo()}updateFilters(e){this.deprecationMessage("updateFilters");const i=this;if(this.isMultiTab){window.multiTabFilterParameter=e;const i=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let t=0;t<i.length;t++){const s=bbEmbed(i[`${t}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.option("filterParameters",e)}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each((function(){const t=i._getDashboardInstance(this.id);null!=t&&t.option("filterParameters",e)}));else if(this.isMultipleWidgetMode)this._multipleWidgets("filterParameters",e);else{const i=this._getDashboardInstance();null!=i&&i.option("filterParameters",e)}}applyTheme(e){this.deprecated=!1,this.updateDashboardTheme(e)}updateDashboardTheme(e){if(this.deprecationMessage("updateDashboardTheme"),e&&""!==e.trim()){const i=this;this.embedOptions.dashboardSettings=this.embedOptions.dashboardSettings||{},this.embedOptions.settings.theme=this.embedOptions.settings.theme||{},this.embedOptions.dashboardSettings.themeSettings=this.embedOptions.dashboardSettings.themeSettings||{},this.embedOptions.dashboardSettings.themeSettings.dashboard=e,this.embedOptions.settings.theme.dashboard=e,document.querySelectorAll("link").forEach((function(e){e.href.includes("/dashboard?theme=")&&e.parentNode.removeChild(e)}));const t=document.createElement("link");if(t.rel="stylesheet",this.embedOptions.environment==BoldBI.Environment.Enterprise?t.href=this.customThemeUrl+"/dashboard?theme="+e:t.href=this.rootUrl+"/theme/styles/dashboard?theme="+e,bbEmbed('link[href="'+t.href+'"]').length<1&&document.head.appendChild(t),this.isMultiTab){const i=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let t=0;t<i.length;t++){const s=bbEmbed(i[`${t}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.option("dashboardThemeSettings.dashboardTheme",e)}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each((function(){const t=i._getDashboardInstance(this.id);null!=t&&t.option("dashboardThemeSettings.dashboardTheme",e)}));else{const i=this._getDashboardInstance();null!=i&&i.option("dashboardThemeSettings.dashboardTheme",e)}}else this._throwError(embeddingLocalization_1.errorMessages.InvalidThemeName)}resizeDashboard(e){this.deprecationMessage("resizeDashboard");const i=this;if(this.embedOptions.isDynamicWidth&&this.embedOptions.isDynamicHeight&&this._onBrowserWindowResize(),this.isMultiTab){bbEmbed("#"+i.embedOptions.embedContainerId+"_multi_tab_dashboard").css("width",bbEmbed("#"+i.embedOptions.embedContainerId).width()),window.multiTabFilterParameter=e;const t=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let e=0;e<t.length;e++){const s=bbEmbed(t[`${e}`]).attr("id"),o=this._getDashboardInstance(s);if(null!=o){const e=window[i.embedOptions.events.onResize];e instanceof Function&&e.call(this,o),this.embedOptions.events.onResize instanceof Function&&this.embedOptions.events.onResize.call(this,o),setTimeout((()=>{o.resizeDashboard()}),200)}}this._tabSelected()}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each((function(){const e=i._getDashboardInstance(this.id);if(null!=e){const t=window[i.embedOptions.events.onResize];t instanceof Function&&t.call(i,e),i.embedOptions.events.onResize instanceof Function&&i.embedOptions.events.onResize.call(i,e),e.resizeDashboard()}}));else if(this.isMultipleWidgetMode)this._multipleWidgets("resizeDashboard");else{const e=this._getDashboardInstance();if(null!=e){const t=window[i.embedOptions.events.onResize];t instanceof Function&&t.call(this,e),this.embedOptions.events.onResize instanceof Function&&this.embedOptions.events.onResize.call(this,e),setTimeout((()=>{e.resizeDashboard()}),200)}}}deprecationMessage(e){this.deprecated&&(0,sdk_deprecation_utils_1.deprecatedMethod)(e),this.deprecated=!0}refreshDashboard(){this.deprecationMessage("refreshDashboard");const e=this;if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.updateDashboard()}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each((function(){const i=e._getDashboardInstance(this.id);null!=i&&i.updateDashboard()}));else if(this.isMultipleWidgetMode)this._multipleWidgets("updateDashboard");else{const e=this._getDashboardInstance();null!=e&&e.updateDashboard()}}clearAllFilter(){if(this.deprecationMessage("clearAllFilter"),this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.clearAllFilters()}}else if(this.isMultipleWidgetMode)this._multipleWidgets("clearAllFilters");else{const e=this._getDashboardInstance();null!=e&&e.clearAllFilters()}}hidePopup(){if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=this._getDashboardInstance(t);null!=s&&s.hideAllPopupsForDashboard()}}else{const e=this._getDashboardInstance();null!=e&&e.hideAllPopupsForDashboard()}}hideLoader(){this.deprecated=!1,this.hideWaitingIndicator()}hideWaitingIndicator(){if(this.deprecationMessage("hideWaitingIndicator"),this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const t=bbEmbed(e[`${i}`]).attr("id"),s=bbEmbed("#"+t+"_designAreaContainer").data("BoldBIDashboardWaitingPopup");null!=s&&s.destroy()}}else{const e=bbEmbed(".bbi-dashboarddesigner-designAreaContainer").data("BoldBIDashboardWaitingPopup");null!=e&&e.destroy()}}getWidgetData(e,i,t){let s;if(this.deprecationMessage("getWidgetData"),this.isMultiTab){const o=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let n=0;n<o.length;n++)if(bbEmbed(o[`${n}`]).attr("id").includes(t.toString().replaceAll("-",""))>0){const t=bbEmbed(o[`${n}`]).attr("id"),d=this._getDashboardInstance(t);null!=d&&(s=d.getWidgetData(e,i),s.toLowerCase().includes("widget")>0&&(window[`${i}`]instanceof Function?window[`${i}`].call(this,s):i.call(this,s)));break}}else{const t=this._getDashboardInstance();null!=t&&(s=t.getWidgetData(e,i),s.toLowerCase().includes("widget")>0&&(window[`${i}`]instanceof Function?window[`${i}`].call(this,s):i.call(this,s)))}}getWidgetDataWithFilters(e,i,t,s){let o;const n=JSON.stringify({dashboardId:i,widgetName:e,filter:t});if(this._isEmptyOrSpaces(i))return o={status:!1,message:embeddingLocalization_1.errorMessages.InvalidDashboardID,request:n},o;if(this._isEmptyOrSpaces(e))return o={status:!1,message:embeddingLocalization_1.errorMessages.InvalidWidgetName,request:n},o;const d=this;var a=this._validatetoken(d.accessToken);return bbEmbed.ajax({type:"POST",url:this.designerRootUrl+"/v1.0/design/loadwidgetdata",data:n,contentType:"application/json; charset=utf-8",beforeSend:function(e){e.setRequestHeader("Authorization",a),e.setRequestHeader("Caller",d.dashboardServerApiUrl)},success:function(e){o=e.Status?{status:e.Status,data:e.Data,message:e.Message,request:n}:{status:e.Status,message:e.Message,request:n},s.call(d,o)},error:function(e,i){o={status:!1,message:i,request:e},s.call(d,o)}}),o={status:!0,message:embeddingLocalization_1.errorMessages.InitFetch,request:n},o}fetchCategories(e,i){this.deprecated=!1,this.getDashboardCategories(e,i)}getDashboardCategories(e,i){this.deprecationMessage("getDashboardCategories");const t=this._isNullOrUndefined(i)||this._isEmptyOrSpaces(i)?this._getDashboardInstance():this._getDashboardInstance(i+"_embeddedbi");if(null!=t){const i=t.GetDashboardCategories(e);window[`${e}`]instanceof Function?window[`${e}`].call(this,i):e.call(this,i)}}createCategory(e,i,t,s){this.deprecated=!1,this.createDashboardCategory(e,i,t,s)}createDashboardCategory(e,i,t,s){this.deprecationMessage("createDashboardCategory");const o=this._isNullOrUndefined(s)||this._isEmptyOrSpaces(s)?this._getDashboardInstance():this._getDashboardInstance(s+"_embeddedbi");if(null!=o){const s=o.CreateDashboardCategory(e,i,t);window[`${t}`]instanceof Function?window[`${t}`].call(this,s):t.call(this,s)}}saveDashboard(e,i){this.deprecationMessage("saveDashboard");const t=this._isNullOrUndefined(i)||this._isEmptyOrSpaces(i)?this._getDashboardInstance():this._getDashboardInstance(i+"_embeddedbi");null!=t&&(t.model.serverSettings.enableMarkAsPublic=!!e.isPublic&&e.isPublic,t.saveDashboardToServer(e))}getWidgetInstance(e){this.deprecationMessage("getWidgetInstance");const i=new widgetBI;i.containerID=this.embedOptions.embedContainerId,this._widgetsCollection[this._widgetsCollection.length]=e;const t=Object.assign(i);return i.widgetCollection=this._widgetsCollection,BoldBI._hasinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBIWidget_"+e)||BoldBI._putinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBIWidget_"+e,t),t}updateWidgetFilters(e){this.deprecationMessage("updateWidgetFilters");const i=this,t=this._getWidgetFilterInfo();if(this.isMultiTab){const e=bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<e.length;i++){const s=bbEmbed(e[`${i}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.option("widgets",t)}}else if(bbEmbed(".pinBoardDbrd").length>0)bbEmbed(".pinBoardDbrd").each((function(){const e=i._getDashboardInstance(this.id);null!=e&&e.option("widgets",t)}));else if(this.isMultipleWidgetMode)this._multipleWidgets("widgets",t);else{const i=this._isNullOrUndefined(e)||this._isEmptyOrSpaces(e)?this._getDashboardInstance():this._getDashboardInstance(e+"_embeddedbi");null!=i&&i.option("widgets",t)}}_initializeEmbedOptions(e){(0,sdk_deprecation_utils_1.checkDeprecatedEmbedOptions)(e),this.embedOptions=Object.assign(this.embedOptions,e),this.embedOptions=(0,sdk_deprecation_utils_1.migrateDeprecatedEventKeys)(this.embedOptions)}_setDimensions(){const e=document.getElementById(this.embedOptions.embedContainerId);if(e.style.width&&e.style.height)this.embedOptions.width=e.style.width,this.embedOptions.height=e.style.height;else{const i=e.parentNode;this.embedOptions.width=`${(null==i?void 0:i.clientWidth)||window.innerWidth}px`,this.embedOptions.height=`${(null==i?void 0:i.clientHeight)||window.innerHeight}px`,Object.assign(this.embedOptions,{isDynamicWidth:!0,isDynamicHeight:!0})}}_onBrowserWindowResize(){if(this.embedOptions.isDynamicWidth&&this.embedOptions.isDynamicHeight){const e=document.getElementById(this.embedOptions.embedContainerId),i=e.parentNode;e.style.width=`${(null==i?void 0:i.clientWidth)||window.innerWidth}px`,e.style.height=`${(null==i?void 0:i.clientHeight)||window.innerHeight}px`}}_loadCloudDepedentFiles(e){const i=e.Data;this.cdnLink=i.CdnUrl,this.designerRootUrl=i.DesignerServerUrl,this._addJquerydependentFiles()}_handleEnvironmentError(e){"error"==e.type&&(this._throwError(embeddingLocalization_1.errorMessages.EnvironmentMemberError),this.invalidDetail=!0)}_getCloudLinks(){this._isEmptyOrSpaces(this.embedOptions.cloudCdnTimeStamp)?this._xhrRequestHelper("Get",this.dashboardServerApiUrl+"/system-settings/get-url",{},{},this._loadCloudDepedentFiles):(this.cdnLink=`https://cdn.boldbi.com/ds/${this.embedOptions.cloudCdnTimeStamp}/cdn`,this.designerRootUrl="https://data.boldbi.com",this._addJquerydependentFiles())}_loadDepedentFiles(){var e,i,t,s,o,n,d,a,r,l,b,m;const h=null===(i=null===(e=this.embedOptions)||void 0===e?void 0:e.dashboardSettings)||void 0===i?void 0:i.themeSettings,c=null===(s=null===(t=this.embedOptions)||void 0===t?void 0:t.settings)||void 0===s?void 0:s.theme,p="boolean"==typeof(null==h?void 0:h.isLocalTheme)?h.isLocalTheme:"boolean"==typeof(null==c?void 0:c.localTheme)&&c.localTheme,u=(null===(o=null==h?void 0:h.dashboard)||void 0===o?void 0:o.trim())||(null===(n=null==c?void 0:c.dashboard)||void 0===n?void 0:n.trim())||"",g=(null===(d=null==h?void 0:h.application)||void 0===d?void 0:d.trim())||(null===(a=null==c?void 0:c.application)||void 0===a?void 0:a.trim())||"";h&&!p&&""!==u?this._addedDependentFiles(this,this.dashboardThemeCssFiles,!0):h&&!p&&""!==g?this._addedDependentFiles(this,this.applicationThemeCssFiles,!0):h&&c||this._addedDependentFiles(this,this.applicationThemeCssFiles,!0),this.embedOptions.mode==BoldBI.Mode.Design||this.embedOptions.mode==BoldBI.Mode.DataSource||this.embedOptions.mode==BoldBI.Mode.Connection?this._addedDependentFiles(this,this.designerScriptFiles,!1):this._addedDependentFiles(this,this.viewerScriptFiles,!1);""!==(this._isEmptyOrSpaces(null===(r=this.embedOptions.dashboardSettings)||void 0===r?void 0:r.fontFamily)?this._isEmptyOrSpaces(null===(m=null===(b=null===(l=this.embedOptions)||void 0===l?void 0:l.settings)||void 0===b?void 0:b.theme)||void 0===m?void 0:m.fontFamily)?"":this.embedOptions.settings.theme.fontFamily:this.embedOptions.dashboardSettings.fontFamily)&&this._addedDependentFiles(this,this.fontFamilyCssFiles,!0),""!=this.embedOptions.pinboardName&&this._addedDependentFiles(this,this.pinBoardScriptFiles,!1),this.embedOptions.mode==BoldBI.Mode.AIAssistant&&(this._addedDependentFiles(this,this.AICssFiles,!0),this._addedDependentFiles(this,this.AIScriptFiles,!1),this._addedDependentFiles(this,this.applicationThemeCssFiles,!0)),this._addedDependentFiles(this,this.cssFiles,!0),""!=this.embedOptions.pinboardName&&this._addedDependentFiles(this,this.pinboardCssFiles,!0),this.embedOptions.mode!=BoldBI.Mode.Design&&this.embedOptions.mode!=BoldBI.Mode.DataSource&&this.embedOptions.mode!=BoldBI.Mode.Connection||this._addedDependentFiles(this,this.designerCssFiles,!0);this.bingMapRequired&&this._loadBingmapDependentFiles(),this.embedOptions.settings.azureMapRequired&&this._loadAzureMapDependentFiles(),this.embedOptions.mode!=BoldBI.Mode.AIAssistant&&this._loadDependentDesignerFiles(this)}_loadBingmapDependentFiles(){const e=document.createElement("script");this.embedOptions.nonce&&(e.nonce=this.embedOptions.nonce),e.src="https://www.bing.com/api/maps/mapcontrol",e.async=!0,document.head.appendChild(e)}_loadAzureMapDependentFiles(){const e=document.createElement("link");e.rel="stylesheet",e.href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css",document.head.appendChild(e);const i=document.createElement("script");this.embedOptions.nonce&&(i.nonce=this.embedOptions.nonce),i.type="text/javascript",i.src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js",i.async=!0,document.head.appendChild(i)}_loadDependentDesignerFiles(e){window.BoldBIDashboard instanceof Object&&window.BoldBIDashboard.createObject instanceof Function&&window.Designer instanceof Object?(e._addedDependentFiles(e,e.ejViewerDependentFiles,!1),e.embedOptions.mode!=BoldBI.Mode.Design&&e.embedOptions.mode!=BoldBI.Mode.DataSource&&e.embedOptions.mode!=BoldBI.Mode.Connection||e._addedDependentFiles(e,e.ejDesignerDependentFiles,!1)):setTimeout(e._loadDependentDesignerFiles,50,e)}_addWrapperDependentFiles(e,i){const t=e;i.forEach(function(e){if(!("jquery-ui.min.js"==e&&null!=window.jQuery.ui&&"1.14.1"==window.jQuery.ui.version||"jsrender.min.js"==e&&null!=window.jQuery.views&&"v1.0.0-beta"==window.jQuery.views.jsviews)){const i=document.createElement("script");this.embedOptions.nonce&&(i.nonce=this.embedOptions.nonce),"jquery.easing.1.3.min.js"==e&&(i.src=t.embedOptions.environment==BoldBI.Environment.Enterprise?t.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+e:t.rootUrl+"/cdn/scripts/designer/"+e:t.cdnLink+"/scripts/designer/"+e),"jquery-ui.min.js"==e?i.src=t.embedOptions.environment==BoldBI.Environment.Enterprise?t.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+e:t.rootUrl+"/cdn/scripts/"+e:t.cdnLink+"/scripts/"+e:"jsrender.min.js"==e&&(i.src=t.embedOptions.environment==BoldBI.Environment.Enterprise?t.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+e:t.rootUrl+"/cdn/scripts/designer/"+e:t.cdnLink+"/scripts/designer/"+e),document.head.appendChild(i),i.onerror=e=>this._handleEnvironmentError(e)}}.bind(t))}_addedDependentFiles(e,i,t){var s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B;let C="";const x="boolean"==typeof(null===(o=null===(s=this.embedOptions.dashboardSettings)||void 0===s?void 0:s.themeSettings)||void 0===o?void 0:o.isLocalTheme)?null===(d=null===(n=this.embedOptions.dashboardSettings)||void 0===n?void 0:n.themeSettings)||void 0===d?void 0:d.isLocalTheme:null!==(l=null===(r=null===(a=this.embedOptions.settings)||void 0===a?void 0:a.theme)||void 0===r?void 0:r.localTheme)&&void 0!==l&&l,A=this._isEmptyOrSpaces(null===(h=null===(m=null===(b=this.embedOptions)||void 0===b?void 0:b.dashboardSettings)||void 0===m?void 0:m.themeSettings)||void 0===h?void 0:h.appearance)?this._isEmptyOrSpaces(null===(u=null===(p=null===(c=this.embedOptions)||void 0===c?void 0:c.settings)||void 0===p?void 0:p.theme)||void 0===u?void 0:u.appearance)?"light":this.embedOptions.settings.theme.appearance:this.embedOptions.dashboardSettings.themeSettings.appearance,M=this._isEmptyOrSpaces(null===(f=null===(v=null===(g=this.embedOptions)||void 0===g?void 0:g.dashboardSettings)||void 0===v?void 0:v.themeSettings)||void 0===f?void 0:f.application)?this._isEmptyOrSpaces(null===(O=null===(I=null===(w=this.embedOptions)||void 0===w?void 0:w.settings)||void 0===I?void 0:I.theme)||void 0===O?void 0:O.application)?"":this.embedOptions.settings.theme.application:this.embedOptions.dashboardSettings.themeSettings.application,F=this._isEmptyOrSpaces(null===(E=null===(y=null===(_=this.embedOptions)||void 0===_?void 0:_.dashboardSettings)||void 0===y?void 0:y.themeSettings)||void 0===E?void 0:E.dashboard)?this._isEmptyOrSpaces(null===(B=null===(S=null===(D=this.embedOptions)||void 0===D?void 0:D.settings)||void 0===S?void 0:S.theme)||void 0===B?void 0:B.dashboard)?"":this.embedOptions.settings.theme.dashboard:this.embedOptions.dashboardSettings.themeSettings.dashboard;i.forEach(function(i){var s,o,n,d,a,r,l,b,m;if(!e._checkDepedentFileExists(i,t))if(t){const t=this._isEmptyOrSpaces(null===(s=this.embedOptions.dashboardSettings)||void 0===s?void 0:s.fontFamily)?this._isEmptyOrSpaces(null===(d=null===(n=null===(o=this.embedOptions)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.theme)||void 0===d?void 0:d.fontFamily)?"":this.embedOptions.settings.theme.fontFamily:this.embedOptions.dashboardSettings.fontFamily;if(e.embedOptions.environment==BoldBI.Environment.Enterprise)if("font-server.min.css"==i)C=e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.rootUrl+"/cdn/css/"+i;else if("bootstrap.min.css"==i)C=e.rootUrl+"/Content/Styles/Bootstrap/"+i;else if("pinboard-embed.min.css"==i)C=e.rootUrl+"/cdn/css/"+i;else if("dashboard-viewer-bundle.min.css"==i)C=e.rootUrl+"/cdn/css/designer/"+i;else if("dashboard-designer.min.css"==i)C=e.rootUrl+"/cdn/css/designer/"+i;else if("boldbi.theme.definition.min.css"==i)C=x||!A||e.embedOptions.enableDomainMasking?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/light/"+i:e.rootUrl+"/cdn/css/designer/light/"+i:e.rootUrl+"/cdn/css/designer/"+A+"/"+i;else if("application.theme.css"==i||"dashboard.theme.css"==i)!x&&F?C=e.customThemeUrl+"/dashboard?theme="+F:!x&&M&&(C=e.customThemeUrl+"/application?theme="+M);else if("font-family.min.css"==i){const e=this.rootUrl.replace(/\/bi(?!.*\/bi)/,"/ums/user-interface/fonts");C=e+"?family="+t}else C=e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.rootUrl+"/webdesignerservice/themes/"+i;else"font-server.min.css"==i?C=e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.cdnLink+"/css/"+i:"bootstrap.min.css"==i||"pinboard-embed.min.css"==i?C=e.cdnLink+"/css/"+i:"boldbi.theme.definition.min.css"==i?C=!x&&A?e.cdnLink+"/css/designer/"+A+"/"+i:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/light/"+i:e.cdnLink+"/css/designer/light/"+i:"application.theme.css"==i||"dashboard.theme.css"==i?!x&&F?C=e.rootUrl+"/theme/styles/dashboard?theme="+F:!x&&M&&(C=e.rootUrl+"/theme/styles/application?theme="+M):C="font-family.min.css"==i?e.rootUrl+"/user-interface/fonts?family="+t:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/css/"+i:e.cdnLink+"/css/designer/"+i;const a=document.createElement("link");a.rel="stylesheet",a.href=C,bbEmbed('link[href="'+C+'"]').length<1&&document.head.appendChild(a)}else{if(e.embedOptions.environment==BoldBI.Environment.Enterprise){const t=this._isEmptyOrSpaces(null===(r=null===(a=this.embedOptions)||void 0===a?void 0:a.localeSettings)||void 0===r?void 0:r.appLocale)?this._isEmptyOrSpaces(null===(m=null===(b=null===(l=this.embedOptions)||void 0===l?void 0:l.settings)||void 0===b?void 0:b.locale)||void 0===m?void 0:m.appLocale)?"en-US":this.embedOptions.settings.locale.appLocale:this.embedOptions.localeSettings.appLocale;C="bootstrap.min.js"==i?e.rootUrl+"/cdn/scripts/"+i:"designerlocalization.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.rootUrl+"/designer/localization/"+i+"?c="+t:"signalr.min.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.rootUrl+"/cdn/scripts/signalr/"+i:"bbi-unifiedaiagent.min.js"==i||"dashboard-designer-dependency.min.js"==i?e.rootUrl+"/cdn/scripts/designer/"+i:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.rootUrl+"/cdn/scripts/designer/"+i}else C="bootstrap.min.js"==i?e.cdnLink+"/scripts/"+i:"designerlocalization.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.designerRootUrl+"/localization/"+i:"signalr.min.js"==i?e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.cdnLink+"/scripts/signalr/"+i:e.embedOptions.enableDomainMasking?this.maskedCdnUrl+this.embedSDKWrapperVersion+"/script/"+i:e.cdnLink+"/scripts/designer/"+i;const t=document.createElement("script");t.type="text/javascript",t.src=C,this.embedOptions.nonce&&(t.nonce=this.embedOptions.nonce),bbEmbed('script[src= "'+C+'"]').length<1&&document.head.appendChild(t),t.onerror=e=>this._handleEnvironmentError(e)}}.bind(e))}_checkDepedentFileExists(e,i){let t=!1;const s=i?"link":"script";return document.head.querySelectorAll(s).forEach((function(s){t||(t=i?-1!=s.href.indexOf(e):-1!=s.src.indexOf(e))})),t}getDashboardData(){return this._getDashboardInstance().getDashboardData()}_renderPinboard(e){var i,t,s,o;const n="boolean"==typeof(null===(i=this.embedOptions.pinboardSettings)||void 0===i?void 0:i.enablePinboardHeader)?null===(t=this.embedOptions.pinboardSettings)||void 0===t?void 0:t.enablePinboardHeader:null===(o=null===(s=this.embedOptions.settings.pinboard)||void 0===s?void 0:s.header)||void 0===o||o,d=bbEmbed('<div id="server-app-container" style="background: #f9f9f9; overflow: hidden !important;min-height: 600px; width:'+this.embedOptions.width+';"><div id="content-area" class="clearfix col-12 e-waitingpopup e-js" style="padding: 0;padding-bottom: 30px"><div id="homepage-page-container"><div id="homepage-header" style="display:'+(n?"block":"none")+';font-family:var(--font-family)"><div id="element-container"><div id="homepage-menu" style="margin-top: 5px"><span id="homepage-list-container" style="font-size: 15px;width: 165px;line-height: 18px;padding: 25px;">'+this.embedOptions.pinboardName+'</span></div><div id="options-container"><div id="pinboard-fullscreen" class="server-banner-icon e-dashboard-banner-icon bbi-dbrd-designer-hoverable su su-maximize-1 e-icon-dbrd-theme" data-tooltip="Fullscreen" data-name="fullscreen" data-event="true" style="font-size: 14px;display: block;float: left;margin: 8px 15px 0 7px; cursor: pointer"></div><div id="divider"></div><div id="layout-container"><div id="layout" class="dropdown-toggle" data-bs-toggle="dropdown">Edit Layout</div><div class="dropdown-menu" id="layout-items" role="menu"><span class="su su-single-column" id="1"></span><span class="su su-two-column" id="11"></span><span class="su su-small-big-column" id="12"></span><span class="su su-big-small-column" id="21"></span><span class="su su-three-column" id="111"></span></div></div></div></div></div><div id="widget-container" data-homepage-id="" data-current-layout="" data-virtual-homepage="" style="margin-bottom: 30px"></div></div></div></div>');bbEmbed("#"+this.embedOptions.embedContainerId).append(d),this._createPinboardDom(e),this._renderItem(e),this._removeElementsClass(this.embedOptions.embedContainerId,".preloader-wrap","viewer-blue-loader");const a=this;bbEmbed(document).on("click",".unpin-widget",(function(e){var i,t,s,o,n,d;e.preventDefault();const r=bbEmbed("#"+bbEmbed(e.target).parents("li").find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner"),l=window[null===(t=null===(i=a.embedOptions.events)||void 0===i?void 0:i.pinboard)||void 0===t?void 0:t.onUnpin];l instanceof Function&&l.call(this,r),(null===(o=null===(s=a.embedOptions.events)||void 0===s?void 0:s.pinboard)||void 0===o?void 0:o.onUnpin)instanceof Function&&(null===(d=null===(n=a.embedOptions.events)||void 0===n?void 0:n.pinboard)||void 0===d||d.onUnpin.call(a,r)),a.column=parseInt(bbEmbed(this).closest("ul").attr("data-column-id"),10),a.position=bbEmbed(this).parents("li").index()+1,r.destroy(),a._unPinItem(a.column,a.position)})),bbEmbed(document).on("click","#pinboard-fullscreen",(function(){const e=bbEmbed("#server-app-container")[0];if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; height:"+bbEmbed("#content-area").height()+"px;overflow: hidden !important;min-height: 600px; width:"+a.embedOptions.width),document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else if(bbEmbed("#server-app-container").removeAttr("style"),bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; overflow: auto !important"),e.requestFullscreen)e.requestFullscreen();else if(e.msRequestFullscreen)e.msRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if("ActiveXObject"in window){new ActiveXObject("Wscript.shell").SendKeys("{F11}"),setTimeout((function(){(screen.availHeight||screen.height-30)<=window.innerHeight?bbEmbed("#pinboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"):bbEmbed("#pinboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen")}),400)}})),bbEmbed(document).on("click","#layout-items span",(function(){var e,i,t,s,o,n;const d=window[null===(i=null===(e=a.embedOptions.events)||void 0===e?void 0:e.pinboard)||void 0===i?void 0:i.onLayoutChange];d instanceof Function&&d.call(this,bbEmbed("#widget-container")),(null===(s=null===(t=a.embedOptions.events)||void 0===t?void 0:t.pinboard)||void 0===s?void 0:s.onLayoutChange)instanceof Function&&(null===(n=null===(o=a.embedOptions.events)||void 0===o?void 0:o.pinboard)||void 0===n||n.onLayoutChange.call(a,bbEmbed("#widget-container")));const r=bbEmbed("#widget-container").attr("data-current-layout");switch(bbEmbed("#widget-container").attr("data-current-layout",bbEmbed(this).attr("id")),bbEmbed("#layout-items span").removeClass("active"),bbEmbed(this).addClass("active"),bbEmbed(this).attr("id")){case"1":"1"!=r&&(a.changeLayout(1),"111"==r?a.appendListItem(1,2):"11"!=r&&"12"!=r&&"21"!=r||a.appendListItem(1,1),a._setLayout(1));break;case"11":"11"!=r&&(a.changeLayout(11),"111"==r?a.appendListItem(2,1):"1"==r&&a.createEmptyList(2,2),a._setLayout(11));break;case"12":"12"!=r&&(a.changeLayout(12),"111"==r?a.appendListItem(2,1):"1"==r&&a.createEmptyList(2,2),a._setLayout(12));break;case"21":"21"!=r&&(a.changeLayout(21),"111"==r?a.appendListItem(2,1):"1"==r&&a.createEmptyList(2,2),a._setLayout(21));break;case"111":"111"!=r&&(a.changeLayout(111),"1"==r?a.createEmptyList(2,3):"11"!=r&&"12"!=r&&"21"!=r||a.createEmptyList(3,3),a._setLayout(111))}})),bbEmbed.map(a.pinboardDetails,(function(e){a.isWidgetMode=!0,a.widgetName=a.authToken?e.Id:e.WidgetId,a.isDashboardViewMode=!1,a.dashboardViewName="";const i={Apistatus:!0,Data:a.authToken?e:JSON.parse(e),Status:!0};a._renderDashboard(i)}))}_widgetNamesEmpty(){const e=embeddingLocalization_1.errorMessages.EmptyWidgetName;for(let i=0;i<this.embedOptions.widgetList.length;i++){const t=this.embedOptions.widgetList[Number(i)];this._isEmptyOrSpaces(t.widgetName)&&(this.errorOnContainer(e,t.containerId),this.embedOptions.widgetList.splice(i,1),i--)}return this.embedOptions.widgetList.length>0}errorOnContainer(e,i){const t='<div id="embedded-bi-error" style="display:table;height:100%;width:100%;"><div style="display: table-cell;vertical-align: middle;text-align: center;"><div style="display: inline-block;"><img src='+this.errorImage+' style="float: left"/><div style="float: left;margin-left: 10px;line-height: 20px;">BoldBI Embedded: '+e+"</div></div>";document.getElementById(i).innerHTML=t}createEmptyList(e,i){for(let t=e;t<=i;t++)bbEmbed("#widget-container").append('<ul id="column-'+t+'" data-column-id="'+t+'" data-child-count="0"><li class="empty click-container"><div class="empty-content empty-homepage"><span class="drag-widget" style="font-family:var(--font-family)">Drag your widgets here to customize layout</span></div></li></ul>')}appendListItem(e,i){for(let t=e+1;t<=e+i;t++)bbEmbed("#column-"+t+" li:not(.empty)").length>0&&bbEmbed("#column-"+e+" li.empty").remove(),bbEmbed("#column-"+e).append(bbEmbed("#column-"+t+" li:not(.empty)")),bbEmbed("#column-"+t).remove()}changeLayout(e){const i=this;let t;i.homepageItemId=bbEmbed("#widget-container").attr("data-homepage-id"),i.isVirtualHomepage=bbEmbed("#widget-container").attr("data-virtual-homepage"),""==i.homepageItemId&&i.isVirtualHomepage&&bbEmbed("#initial-message").hide();const s="embed_nonce="+this._uuidv4Generator()+"&homepageId="+i.homepageItemId+"&layout="+e+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(i.authToken||i._isEmptyOrSpaces(i.embedOptions.authorizationServer.url)){const s=this._validatetoken(i.authToken);t={homepageId:i.homepageItemId,layout:e},bbEmbed.ajax({async:!1,type:"POST",url:i.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:s},data:JSON.stringify(t),contentType:"application/json",success:bbEmbed.proxy(i._changeLayoutSuccess,i)})}else t={embedQuerString:encodeURI(s),embedQueryString:encodeURI(s),dashboardServerApiUrl:this.dashboardServerApiUrl},this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,t,this.embedOptions.authorizationServer.headers,this._changeLayoutSuccess)}_checkEmptyHomepage(){let e=0,i=!1;return bbEmbed("#widget-container ul").each((function(t){return e=bbEmbed("#column-"+(t+1)+' li:not(".empty")').length,i=!(e>0),!(e>0)})),i}_setLayout(e){const i=bbEmbed("#widget-container").attr("data-item-type").toLowerCase();switch(bbEmbed("#layout-items").find("span#"+e).addClass("active"),e){case 1:bbEmbed("#column-1").removeClass().addClass("col-lg-12 col-md-12 col-sm-12 col-12");break;case 11:bbEmbed("#column-1,#column-2").removeClass().addClass("col-lg-6 col-md-6 col-sm-6 col-6");break;case 12:bbEmbed("#column-1").removeClass().addClass("col-lg-4 col-md-4 col-sm-4 col-4"),bbEmbed("#column-2").removeClass().addClass("col-lg-8 col-md-8 col-sm-8 col-8");break;case 21:bbEmbed("#column-1").removeClass().addClass("col-lg-8 col-md-8 col-sm-8 col-8"),bbEmbed("#column-2").removeClass().addClass("col-lg-4 col-md-4 col-sm-4 col-4");break;case 111:bbEmbed("#column-1,#column-2,#column-3").removeClass().addClass("col-lg-4 col-md-4 col-sm-4 col-4")}if(this._checkEmptyHomepage()&&(window.IsMobile?(bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("mobile-empty-homepage"),bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").text("Log in using a desktop client to add widgets to this pinboard.").show(),bbEmbed("#widget-container ul li.empty").css("border","none")):(bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").hide(),bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("empty-homepage"))),"dashboard"!=i){const e=this;this.enableSorting(),this.setListMinimumHeight(),bbEmbed(".pinBoardDbrd").each((function(){const i=e._getDashboardInstance(this.id),t=window[e.embedOptions.events.onResize];t instanceof Function&&t.call(e,i),e.embedOptions.events.onResize instanceof Function&&e.embedOptions.events.onResize.call(e,i),i.resizeDashboard()}))}}setListMinimumHeight(){const e=[];bbEmbed("#widget-container > ul").each((function(i){let t=0;bbEmbed(this).find("li").each((function(){t=t+bbEmbed(this).innerHeight()+20})),e[`${i}`]=t}));const i=Math.max(...e)>400?Math.max(...e):440;bbEmbed("#widget-container > ul").css("min-height",i),bbEmbed("#server-app-container").height(bbEmbed("#content-area").height())}enableSorting(){"function"!=typeof window.bbEmbed.uniqueSort&&(window.bbEmbed.uniqueSort=window.bbEmbed.unique);const e=this;window.bbEmbed("#column-1, #column-2, #column-3").sortable({connectWith:"ul",placeholder:"placeholder",handle:".e-rteItem .e-rte-content, .bbi-dbrd-control-header:not(.bbi-dbrd-control-menu-icon)",cancel:".empty, .bbi-dbrd-control-menu-icon",containment:"#server-app-container",cursor:"move",tolerance:"pointer",scroll:!0,scrollSensitivity:10,scrollSpeed:20,update:function(i,t){e.toColumn=bbEmbed(i.target).data("column-id"),e.toPosition=t.item.index()+1},start:function(i,t){var s,o,n,d,a,r;bbEmbed("li.placeholder").append('<div class="placeholder-text" style="color: dimgray; font-size: 20px;padding-top: 10px;text-align: center;font-family:var(--font-family)">Drag your widgets here to customize layout</div>'),bbEmbed("li.placeholder").css({height:t.item.height().toString()+"px","background-color":"#eeeeee",border:"dashed lightgray"}),bbEmbed("#widget-container ul li.empty").remove(),e.fromColumn=bbEmbed(i.target).data("column-id"),e.fromPosition=t.item.index()+1,e.toColumn=bbEmbed(i.target).data("column-id"),e.toPosition=t.item.index()+1;const l=bbEmbed("#"+t.item.find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner"),b=window[null===(o=null===(s=e.embedOptions.events)||void 0===s?void 0:s.pinboard)||void 0===o?void 0:o.onDrag];b instanceof Function&&b.call(this,l),(null===(d=null===(n=e.embedOptions.events)||void 0===n?void 0:n.pinboard)||void 0===d?void 0:d.onDrag)instanceof Function&&(null===(r=null===(a=e.embedOptions.events)||void 0===a?void 0:a.pinboard)||void 0===r||r.onDrag.call(e,l))},stop:function(i,t){var s,o,n,d,a,r;e.showEmptyList();const l=window[null===(o=null===(s=e.embedOptions.events)||void 0===s?void 0:s.pinboard)||void 0===o?void 0:o.onDrop],b=bbEmbed("#"+t.item.find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner");l instanceof Function&&l.call(this,b),(null===(d=null===(n=e.embedOptions.events)||void 0===n?void 0:n.pinboard)||void 0===d?void 0:d.onDrop)instanceof Function&&(null===(r=null===(a=e.embedOptions.events)||void 0===a?void 0:a.pinboard)||void 0===r||r.onDrop.call(e,b)),e.fromColumn==e.toColumn&&e.fromPosition==e.toPosition||(e.fromColumn!=e.toColumn&&window.bbEmbed("#"+t.item.find(".pinWidget").attr("id")+"_embeddedbi").data("BoldBIDashboardDesigner").resizeDashboard(),e.dragAndDrop(e.fromColumn,e.toColumn,e.fromPosition,e.toPosition)),e.setListMinimumHeight()}}),window.bbEmbed("#column-1, #column-2, #column-3").disableSelection()}showEmptyList(){bbEmbed("#widget-container ul").each((function(e){bbEmbed("#column-"+(e+1)+" li").length<1&&bbEmbed("#column-"+(e+1)).append('<li class="empty click-container"><div class="empty-content empty-homepage"><span class="drag-widget" style="font-family:var(--font-family)">Drag your widgets here to customize layout</span></div></li>')}))}dragAndDrop(e,i,t,s){const o=this;let n;const d=bbEmbed("#widget-container").attr("data-homepage-id"),a={Column:e,Position:t},r={Column:i,Position:s},l="embed_nonce="+this._uuidv4Generator()+"&homepageId="+d+"&moveFrom="+JSON.stringify(a)+"&moveTo="+JSON.stringify(r)+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(o.authToken||o._isEmptyOrSpaces(o.embedOptions.authorizationServer.url)){var b=this._validatetoken(o.authToken);n={homepageId:d,moveFrom:JSON.stringify(a),moveTo:JSON.stringify(r)},bbEmbed.ajax({async:!1,type:"POST",url:o.dashboardServerApiUrl+this.embedGetDetailsEndPoint,data:JSON.stringify(n),headers:{Authorization:b},contentType:"application/json",success:bbEmbed.proxy(o._dragAndDropSuccess,o)})}else n={embedQuerString:encodeURI(l),embedQueryString:encodeURI(l),dashboardServerApiUrl:this.dashboardServerApiUrl},this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,n,this.embedOptions.authorizationServer.headers,this._dragAndDropSuccess)}_unPinItem(e,i){const t=this;let s;const o=bbEmbed("#widget-container").attr("data-homepage-id"),n={Column:e,Position:i},d="embed_nonce="+this._uuidv4Generator()+"&homepageId="+o+"&unpinPosition="+JSON.stringify(n)+"&isUnpin="+!0+"&embed_mode="+this.embedOptions.mode+"&embed_timestamp="+Math.round((new Date).getTime()/1e3)+"&embed_expirationtime="+this.embedOptions.expirationTime;if(t.authToken||t._isEmptyOrSpaces(t.embedOptions.authorizationServer.url)){let e=this._validatetoken(t.authToken);s={homepageId:o,unpinPosition:JSON.stringify(n),isUnpin:!0},bbEmbed.ajax({async:!1,type:"POST",url:t.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:e},data:JSON.stringify(s),contentType:"application/json",success:bbEmbed.proxy(t._unPinSuccess,t)})}else s={embedQuerString:encodeURI(d),embedQueryString:encodeURI(d),dashboardServerApiUrl:this.dashboardServerApiUrl},this._xhrRequestHelper("POST",this.embedOptions.authorizationServer.url,s,this.embedOptions.authorizationServer.headers,this._unPinSuccess)}_unPinSuccess(e){if(e.Status){bbEmbed("#column-"+this.column+" li:eq("+(this.position-1)+")").remove(),this.showEmptyList();this.checkEmptyHomepage()&&(bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").hide(),bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("empty-homepage")),this.setListMinimumHeight()}}checkEmptyHomepage(){let e=0,i=!1;return bbEmbed("#widget-container ul").each((function(t){return e=bbEmbed("#column-"+(t+1)+' li:not(".empty")').length,i=!(e>0),!(e>0)})),i}_renderItem(e){const i=this;if(this._checkEmptyHomepage()&&(bbEmbed("#widget-container ul li.empty .empty-content").find(".drag-widget").hide(),bbEmbed("#widget-container ul li.empty .empty-content").removeClass("non-empty-homepage").addClass("empty-homepage")),bbEmbed("#widget-container").hide(),"widget"==e.ItemType.toLowerCase()){this._setLayout(e.ColumnInfo.Layout);const t=e.ColumnInfo.Column;bbEmbed.each(t,(function(e){t[`${e}`].Item.length>0?(bbEmbed.each(t[`${e}`].Item,(function(s){if(".sydj"!=t[`${e}`].Item[`${s}`].ItemExtension.toLowerCase())bbEmbed("#widget_"+(e+1)+"_"+(s+1)).ejDashboardViewer({accessToken:this.accessToken,serviceUrl:this.dashboardServiceUrl,serverUrl:this.dashboardServerUrl,_enableHyperLinkOnErrorMessage:!1,cdnFilePath:this.isUseCdn?this.cdnLink+"/scripts/viewer":"",dashboardPath:t[`${e}`].Item[`${s}`].Path,_itemId:t[`${e}`].Item[`${s}`].ItemId,reportName:"",reportDescription:"",enableExport:!0,enablePrint:!1,actionBegin:function(e){"beforeNavigate"==e.eventType&&(this.hasWidgetLink=!0)},localeSettings:{resourcePath:""},enableWidgetMode:null!=t[`${e}`].Item[`${s}`].Id,filterParameters:t[`${e}`].Item[`${s}`].QueryString,showTab:null==t[`${e}`].Item[`${s}`].TabId,widgetModeSettings:{name:"",id:null==t[`${e}`].Item[`${s}`].Id?"":t[`${e}`].Item[`${s}`].Id,title:t[`${e}`].Item[`${s}`].Name},_selectedTabGuid:null==t[`${e}`].Item[`${s}`].TabId?"":t[`${e}`].Item[`${s}`].TabId,afterWidgetRender:bbEmbed.proxy((function(i,t){if("card"==t.data.controlType.toLowerCase()&&(bbEmbed("#widget_"+(e+1)+"_"+(s+1)+" .e-control-heading span").hasClass("e-control-title")||bbEmbed("#widget_"+(e+1)+"_"+(s+1)+" .e-control-heading").text(i[`${e}`].Item[`${s}`].Name)),i[`${e}`].Item[`${s}`].IsActive&&!i[`${e}`].Item[`${s}`].IsHavingPermission?(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control-container").append('<div class="no-permission"><span class="message">You do not have permission to view this widget.</span></div>')):i[`${e}`].Item[`${s}`].IsActive||i[`${e}`].Item[`${s}`].IsHavingPermission||(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control-container").append('<div class="no-permission"><span class="message">This widget has been deleted.</span></div>')),i[`${e}`].Item[`${s}`].IsActive&&i[`${e}`].Item[`${s}`].IsHavingPermission&&null!=i[`${e}`].Item[`${s}`].QueryString){const i=bbEmbed("#widget_"+(e+1)+"_"+(s+1));i.find("#filter-info").parent().append('<div class="filter-overview"><span id="heading">Applied Filters</span><div id="outer-div"><div id="scroller-content"><div id="applied-filters-container"></div></div></div></div>'),i.find(".filter-overview #applied-filters-container").height()>180&&i.find(".filter-overview #scroller-content").BoldBIDashboardScroller({height:180,width:248,scrollerSize:9}),i.find(".filter-overview").addClass("display-none")}}),this,t),beforeWidgetIconRendered:bbEmbed.proxy((function(i,t){"widget not configured"!=t.widgetInformation.Name.toLowerCase()?window.IsMobile?bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="250px":"card"!=t.widgetInformation.Name.toLowerCase()?bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="400px":bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="250px":(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).data("ejDashboardViewer").model.size.height="200px",bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".bbi-dbrd-control-container").append('<div class="no-permission"><span class="message">This widget has been deleted.</span></div>')),t.iconsinformation.length>0&&"bbi-dbrd-link-enable"==t.iconsinformation[0].classname&&(t.iconsinformation[0].margintop="1px"),window.IsMobile||t.iconsinformation.unshift({classname:"su su-delete unpin",name:"Unpin Widget",datatooltip:"Unpin Widget",marginright:"-18px",margintop:"4px"});const o=i[`${e}`].Item[`${s}`].IsActive&&i[`${e}`].Item[`${s}`].IsHavingPermission&&"widget not configured"!=t.widgetInformation.Name.toLowerCase();o&&(t.iconsinformation.unshift({classname:"su su-maximize unpin",name:"Maximize Widget",datatooltip:"Maximize Widget",marginright:"-18px",margintop:"4px"}),t.iconsinformation.unshift({classname:"su su-open-link-newtab unpin",name:"Go to Dashboard",datatooltip:"Go to Dashboard",marginright:"-18px",margintop:"4px"})),o&&null!=i[`${e}`].Item[`${s}`].QueryString&&t.iconsinformation.unshift({id:"filter-info",classname:"su su-info unpin",name:"Applied Filters",datatooltip:"View Applied Filters",margintop:"4px",marginright:"0px"}),bbEmbed("#widget-container").show();bbEmbed("#widget_"+(e+1)+"_"+(s+1)).ejDashboardViewer().resize()}),this,t),dashboardCreated:function(){const i=bbEmbed("#widget_"+(e+1)+"_"+(s+1)).attr("data-dashboardurl");bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find(".su-open-link-newtab").wrap(bbEmbed('<a class="redirect" href="'+i+'" target="_blank">'))},onMenuIconClick:function(e){if(void 0!==e.name&&"unpin widget"==e.name.toLowerCase()){const i=e.target.parents("ul").data("column-id"),t=e.target.parents("li").index()+1;this.unPinItem(i,t,e.event)}else if(void 0!==e.name&&"maximize widget"==e.name.toLowerCase());else if(void 0!==e.name&&"applied filters"==e.name.toLowerCase()){const i=bbEmbed(e.event.target).parent().find(".filter-overview");i.toggleClass("display-none"),bbEmbed(".filter-overview").not(i).addClass("display-none"),e.event.preventDefault()}}});else{const o=i.embedOptions.embedContainerId+"_pinBoard_"+(e+1)+"_"+(s+1);bbEmbed("#widget_"+(e+1)+"_"+(s+1)).append('<div class="pinWidget" style="height:calc(100% - 5px);width:calc(100% - 25px);overflow: hidden !important;" id="'+o+'"><div id="'+o+'_embeddedbi" class="pinBoardDbrd"></div ></div>'),i.pinBoardRendered=!1,i.pinboardIds.push({widgetId:t[`${e}`].Item[`${s}`].Id,pinboardContainerId:o}),i.pinboardDetails[i.pinboardDetails.length]=i.authToken?t[`${e}`].Item[`${s}`]:t[`${e}`].Item[`${s}`].WidgetDetails,t[`${e}`].Item[`${s}`].IsActive&&!t[`${e}`].Item[`${s}`].IsHavingPermission?(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find("iframe").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).append('<div class="no-permission"><span class="message">You do not have permission to view this widget.</span></div>')):t[`${e}`].Item[`${s}`].IsActive||t[`${e}`].Item[`${s}`].IsHavingPermission||(bbEmbed("#widget_"+(e+1)+"_"+(s+1)).find("iframe").remove(),bbEmbed("#widget_"+(e+1)+"_"+(s+1)).append('<div class="no-permission"><span class="message">This widget has been deleted.</span></div>'))}})),bbEmbed("#widget-container").show()):bbEmbed("#widget-container").show()})),this.enableSorting(),this.setListMinimumHeight()}else if("dashboard"==e.ItemType.toLowerCase()){const i=e.ColumnInfo.Column;bbEmbed("#dashboard_1_1").css({height:bbEmbed(window).height()-bbEmbed("#header-area").outerHeight()-bbEmbed("#base-footer-div").outerHeight()-bbEmbed("#homepage-header").outerHeight()-30,width:bbEmbed("#content-area").width()-10}),i[0].Item[0].IsActive&&i[0].Item[0].IsHavingPermission&&".sydj"!=i[0].Item[0].ItemExtension.toLowerCase()?bbEmbed("#dashboard_1_1").ejDashboardViewer({dashboardPath:e.ColumnInfo.Column[0].Item[0].Path,_itemId:e.ColumnInfo.Column[0].Item[0].ItemId,reportName:"",reportDescription:"",enableExport:!0,enablePrint:!1,showGetLinkIcon:!1,localeSettings:{resourcePath:""},interactionSettings:{allowHistoryMaintenance:!1,handleHistoryEvent:!1},enableWidgetMode:!1,filterParameters:e.ColumnInfo.Column[0].Item[0].QueryString,showTab:null==e.ColumnInfo.Column[0].Item[0].TabId,_selectedTabGuid:null!=e.ColumnInfo.Column[0].Item[0].TabId?e.ColumnInfo.Column[0].Item[0].TabId:"",beforeControlMenuOpen:function(e){e.menuData.splice(1,1)},onTabSelectionFailure:"OnFailtoLoadChildDashboard",beforeContextMenuOpen:function(e){!function(e,i,t){let s=e.length;for(;s--;)e[`${s}`]&&Object.prototype.hasOwnProperty.call(e[`${s}`],i)&&arguments.length>2&&e[`${s}`][`${i}`]==t&&e.splice(s,1)}(e.menuData,"text","Export")}}):i[0].Item[0].IsActive?i[0].Item[0].IsActive&&!i[0].Item[0].IsHavingPermission?bbEmbed("#dashboard_1_1").append('<div class="no-permission"><span class="message">You do not have permission to view this dashboard.</span></div>'):i[0].Item[0].IsActive&&i[0].Item[0].IsHavingPermission&&".sydj"==i[0].Item[0].ItemExtension.toLowerCase()&&bbEmbed("#dashboard_1_1").append('<div class="no-permission"><span class="message">Currently this dashboard is not supported.</span></div>'):bbEmbed("#dashboard_1_1").append('<div class="no-permission"><span class="message">This dashboard has been deleted.</span></div>'),bbEmbed("#widget-container").show()}}_addWidgetInPinboard(e){const i=bbEmbed("#widget-container").find("ul:first");1==bbEmbed("#widget-container").find("ul:first li").length&&bbEmbed("#widget-container").find("ul:first li").hasClass("empty")&&bbEmbed("#widget-container").find("ul:first li").remove();const t=bbEmbed("#widget-container").find("ul:first li").length,s=e.ColumnInfo.Column[0],o=null==s.Item[0].Id?"/bi/"+this.siteIdentifier+"/widgets/widgets":"/bi/"+this.siteIdentifier+"/dashboards",n=s.Item[0].Name,d=s.Item[0].WidgetType;let a=0;a=null!=d&&(d.includes("Card")||d.includes("Image"))?250:400;const r=null!=s.Item[0].QueryString?s.Item[0].QueryString:"",l=null==s.Item[0].TabId?o+"/"+s.Item[0].ItemId+"/"+(null!=s.Item[0].Id?s.Item[0].CategoryName+"/":"")+s.Item[0].ItemName+(""!=r?"?"+r:r):o+"/"+s.Item[0].ItemId+"/"+(null!=s.Item[0].Id?s.Item[0].CategoryName+"/":"")+s.Item[0].ItemName+"?tab="+s.Item[0].TabId+(""!=r?"&"+r:r),b=this.embedOptions.pinboardSettings.enableUnpinWidget||void 0===this.embedOptions.pinboardSettings.enableUnpinWidget?'<div id="widget-icons"><i class="items unpin-widget su su-delete" data-bs-toggle="tooltip" data-original-title="Unpin Widget"  style="color: black;" /></div>':"";bbEmbed(i).prepend('<li class="list-item"><div class="widget" id=widget_1_'+(t+1)+' data-dashboardurl="'+l+'" style="height: '+a+'px;width:100%;background:#fff;"><div class="widget-sortable" style="width:100%;float:left;display:block;height:0px"><div style="height:100%;width:100%;cursor:move;"><div id="item-name">'+n+"</div>"+b+"</div></div></div></li>");const m=this.embedOptions.embedContainerId+"_pinBoard_1_"+(t+1);bbEmbed("#widget_1_"+(t+1)).append('<div class="pinWidget" style="height:calc(100% - 5px);width:calc(100% - 25px);overflow: hidden !important;" id="'+m+'"><div id="'+m+'_embeddedbi" class="pinBoardDbrd"></div ></div>'),this.pinBoardRendered=!1,this.pinboardIds.push({widgetId:s.Item[0].Id,pinboardContainerId:m}),this.loadWidget(s.Item[0].Id,s.Item[0].ItemId),this.enableSorting(),this.setListMinimumHeight(),this._removeElementsClass(this.embedOptions.embedContainerId,".preloader-wrap","viewer-blue-loader")}_tabSelected(){if("undefined"!=typeof ejdashboard&&ejdashboard.base&&"function"==typeof ejdashboard.base.registerLicense){const e=window.bbEmbed(".parent-multitab-dbrd").children().attr("id");for(let i=0;i<window.bbEmbed("#"+e+" .e-toolbar-item").length;i++)window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).attr("style","display:block !important"),window.bbEmbed("#"+e+" .e-toolbar-item.e-active").children().attr("aria-controls")=="e-content-"+e+"_"+i?this._handleTabSelected(e,i):window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).css({display:"block",position:"absolute",left:window.bbEmbed(".e-content.e-lib.e-touch").width()*(i+1)})}else{const e=window.bbEmbed(".multitab-dbrd").attr("id");for(let i=0;i<window.bbEmbed("#"+e+" .e-toolbar-item").length;i++)window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).attr("style","display:block !important"),window.bbEmbed("#"+e+" .e-toolbar-item.e-active").attr("aria-controls")=="e-content-"+e+"_"+i?this._handleTabSelected(e,i):window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).css({display:"block",position:"absolute",left:window.bbEmbed(".e-content.e-lib.e-touch").width()*(i+1)})}}_handleTabSelected(e,i){window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).css({display:"block",position:"absolute",left:0});const t=window.bbEmbed("#"+window.bbEmbed(window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children()).children().attr("id")).data("BoldBIDashboardDesigner");if(null==t||null==t){const t=window.bbEmbed(".e-content").find("#e-content-"+e+"_"+i).children().attr("id").split("_")[1],s={Apistatus:!0,Data:this.dashboardDetails[`${t}`],Status:!0};this._renderDashboard(s)}}_isAIDepdencyLoaded(e){e.embedOptions.mode==BoldBI.Mode.AIAssistant&&window.bbEmbed instanceof Function&&void 0!==window.BoldBIAI&&window.BoldBIAI.UnifiedAIAgent?e.embedOptions.token||e.embedOptions.embedToken?(e.tokenResponse={ItemDetail:{IsPublic:!1,Name:"AIAssitant"}},e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})):e._getAuthorizationToken():setTimeout(e._isAIDepdencyLoaded,500,e)}_isDependencyLoaded(e,i){if(window.bbEmbed instanceof Function&&window.BoldBIDashboard instanceof Object&&!e._isNullOrUndefined(window.BoldBIDashboard)&&window.BoldBIDashboard.Designer instanceof Object&&window.BoldBIDashboardDesigner instanceof Function&&!e._isEmptyOrSpaces(e.designerRootUrl)&&window.Designer instanceof Object)if(e.IsDependencyLoaded||(e.IsDependencyLoaded=!0),e.embedOptions.token||e.embedOptions.embedToken)if(e.authToken=e.embedOptions.token?e.embedOptions.token:e.embedOptions.embedToken,e.embedOptions.token&&e.embedOptions.isPublicDashboard||e.embedOptions.embedToken&&e.embedOptions.mode!=BoldBI.Mode.Design&&e.embedOptions.mode!=BoldBI.Mode.Connection&&e.embedOptions.mode!=BoldBI.Mode.DataSource&&!e.embedOptions.isMultiTabDashboard&&!e.widgetName&&!e.embedOptions.viewId&&!e.embedOptions.pinboardName&&!e.editIgnore)e.tokenResponse={dashboardVersion:e.embedOptions.customDashboardVersion,ItemDetail:{IsPublic:!0,Description:"",Name:""}},e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0});else{var t=e._validatetoken(e.authToken);if(e.embedOptions.dashboardPath&&!e.embedOptions.dashboardId)e._throwError(embeddingLocalization_1.errorMessages.DbrdPathTokenAPIError);else if(e.embedOptions.datasourceName&&!e.embedOptions.datasourceId)e._throwError(embeddingLocalization_1.errorMessages.DataSourceTokenAPIError);else if(e.embedOptions.viewName&&!e.embedOptions.viewId)e._throwError(embeddingLocalization_1.errorMessages.ViewNameTokenAPIError);else if(e.isDashboardRendering&&e.embedOptions.dashboardId||e.isPinboardRendering&&e.embedOptions.pinboardName){const i=e.isDashboardRendering?e.dashboardServerApiUrl+"/v5.0/dashboards/"+e.embedOptions.dashboardId+"?canIgnorePublishDetails=true":e.dashboardServerApiUrl+"/pinboard/"+e.embedOptions.pinboardName;bbEmbed.ajax({async:!1,type:"GET",url:i,headers:{Authorization:t},contentType:"application/json",success:function(i){var t;if(i){e.tokenResponse.dashboardVersion=i.Version,e.tokenResponse.CanWrite=null!==(t=null==i?void 0:i.CanWrite)&&void 0!==t&&t;const s=e.isDashboardRendering&&i.IsMultiDashboard&&e.embedOptions.mode==BoldBI.Mode.Design?"Designer embedding":e.isDashboardRendering&&i.IsMultiDashboard?i.TabDetail:e.isPinboardRendering&&i.Status?i.Data:e.tokenResponse;e._authorizeResponse={Apistatus:!0,Data:s,Status:!0},"Designer embedding"!=s&&e.embedOptions.mode!=BoldBI.Mode.Design?e._renderDashboard({Apistatus:!0,Data:s,Status:!0}):"Designer embedding"!=s&&e.embedOptions.mode==BoldBI.Mode.Design?i.CanWrite?e._renderDashboard({Apistatus:!0,Data:s,Status:!0}):e._throwError(embeddingLocalization_1.errorMessages.InvalidEditAccess):e._throwError(embeddingLocalization_1.errorMessages.NotRenderMultitabDashboard)}else e.embedOptions.isMultiTabDashboard&&e.embedOptions.embedToken&&e.embedOptions.mode==BoldBI.Mode.Design?e._throwError(embeddingLocalization_1.errorMessages.NotRenderMultitabDashboardForAnonymousUser):e.embedOptions.embedToken&&e.embedOptions.mode==BoldBI.Mode.Design?e._throwError(embeddingLocalization_1.errorMessages.NotRenderDesignerForAnonymousUser):e._throwError(embeddingLocalization_1.errorMessages.DashboardNotAvailable)},error:function(i){if(0==i.status&&e._throwError(embeddingLocalization_1.errorMessages.PageUnavailable),401==i.status){const i=e._isJwtFormat(e.authToken);e._throwError(i?embeddingLocalization_1.errorMessages.InvalidAccessToken:embeddingLocalization_1.errorMessages.InvalidApiKey)}else 404==i.status&&e.isDashboardRendering?e._throwError(embeddingLocalization_1.errorMessages.InvalidDashboardID):e._throwError(embeddingLocalization_1.errorMessages.InvalidPinboardName)}})}else if(e.isDashboardRendering&&e.embedOptions.mode==BoldBI.Mode.Design&&e._isEmptyOrSpaces(e.embedOptions.dashboardId)&&e._isEmptyOrSpaces(e.embedOptions.dashboardPath))bbEmbed.ajax({async:!1,type:"POST",url:e.dashboardServerApiUrl+"/v5.0/dashboards/drafts",headers:{Authorization:t},contentType:"application/json",success:function(i){e.embedOptions.isdesignerdraft=!0,e.tokenResponse.draftItemID=i.Id,e.tokenResponse.ItemDetail.Name=i.Name,e.tokenResponse.CanWrite=!0,e._authorizeResponse={Apistatus:!0,Data:e.tokenResponse,Status:!0},e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})},error:function(i){if(401==i.status){const i=e._isJwtFormat(e.authToken);e._throwError(i?embeddingLocalization_1.errorMessages.InvalidAccessToken:embeddingLocalization_1.errorMessages.InvalidApiKey)}else 403==i.status&&e._throwError(embeddingLocalization_1.errorMessages.ProvideCreatePermission)}});else if(e.embedOptions.viewId&&e.isDashboardViewRendering)bbEmbed.ajax({async:!1,type:"GET",url:e.dashboardServerApiUrl+"/v5.0/dashboards/views/"+e.embedOptions.viewId,headers:{Authorization:t},contentType:"application/json",success:function(i){e.embedOptions.dashboardSettings=e.embedOptions.dashboardSettings||{},e.embedOptions.dashboardSettings.filterOverviewSettings=e.embedOptions.dashboardSettings.filterOverviewSettings||{},e.embedOptions.settings=e.embedOptions.settings||{},e.embedOptions.settings.viewer=e.embedOptions.settings.viewer||{},e.embedOptions.settings.viewer.filterOverview=e.embedOptions.settings.viewer.filterOverview||{},e.embedOptions.dashboardId=i.ItemId,e.embedOptions.dashboardSettings.filterOverviewSettings.viewId=e.embedOptions.settings.viewer.filterOverview.viewId=e.embedOptions.viewId,e.embedOptions.dashboardSettings.filterOverviewSettings.viewName=e.embedOptions.settings.viewer.filterOverview.ViewName=i.ViewName,e.embedOptions.filterParameters=i.QueryString,e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})},error:function(i){if(401==i.status){const i=e._isJwtFormat(e.authToken);e._throwError(i?embeddingLocalization_1.errorMessages.InvalidAccessToken:embeddingLocalization_1.errorMessages.InvalidApiKey)}else 400==i.status?e._throwError(embeddingLocalization_1.errorMessages.InvalidViewID):404==i.status&&e._throwError(embeddingLocalization_1.errorMessages.ViewDetailsNotFound)}});else if(e.widgetName){const i=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/.exec(e.widgetName);/[a-zA-Z]/.test(e.widgetName)&&/\d/.test(e.widgetName)&&e.widgetName.includes("-")&&!i?e._throwError(embeddingLocalization_1.errorMessages.InvalidWidgetID):i?e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0}):e._throwError(embeddingLocalization_1.errorMessages.WidgetNameTokenAPIError)}else e._renderDashboard({Apistatus:!0,Data:e.tokenResponse,Status:!0})}else e._getAuthorizationToken(i);else setTimeout(e._isDependencyLoaded,500,e)}checkCompatibility(){this.deprecated=!1,this.validateServerAndWrapperVersion()}validateServerAndWrapperVersion(){this.deprecationMessage("validateServerAndWrapperVersion");const e=this;e.embedOptions.environment==BoldBI.Environment.Enterprise?bbEmbed.ajax({async:!0,type:"POST",url:e.dashboardServerApiUrl+"/server-version/get",contentType:"application/json",success:function(i){console.log(e.embedSDKWrapperVersion===i.Data.split(".").slice(0,2).join(".")?embeddingLocalization_1.successMessages.MatchVersion:embeddingLocalization_1.errorMessages.NotMatchVersion)}}):console.log(embeddingLocalization_1.errorMessages.EnsureServerOrSDKVersion)}_getDashboardInstance(e){const i=window.bbEmbed.call(this,"#"+(e||this.childContainer.id))[0];if(i)return window.bbEmbed.data.call(this,i,"BoldBIDashboardDesigner")}_checkWidgetList(){if(this.embedOptions.widgetList.length>0&&!this.embedOptions.embedContainerId){const e=embeddingLocalization_1.errorMessages.ErrorLoadMultipleWidget;return this.embedOptions.widgetList.forEach((i=>{const t=i.containerId,s='<div id="embedded-bi-error" style="display:table;height:100%;width:100%;"><div style="display: table-cell;vertical-align: middle;text-align: center;"><div style="display: inline-block;"><img src='+this.errorImage+' style="float: left"/><div style="float: left;margin-left: 10px;line-height: 20px;">BoldBI Embedded: '+e+"</div></div>";document.getElementById(t).innerHTML=s})),!0}return this.embedOptions.widgetList="",!1}_onBoldBIDashboardInstaceActionBegin(e,i){var t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v;if(this.isMultiTab&&0===parseInt(null!==(n=null===(o=null===(s=null===(t=bbEmbed(".e-content .e-active"))||void 0===t?void 0:t.attr("id"))||void 0===s?void 0:s.split("_"))||void 0===o?void 0:o.pop())&&void 0!==n?n:"",10)){const e=bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner");this.setDefaultTheme(e.modules.themeHelper.getBannerBackground(),e.modules.themeHelper.getBannerTextColor(),e.modules.themeHelper.getBannerIconColor())}if(void 0!==e&&"renderLayout"===e.eventType)this._removeElementsClass(i,".preloader-wrap","viewer-blue-loader");if(this.embedOptions.mode==BoldBI.Mode.Connection||this.embedOptions.mode==BoldBI.Mode.Design){if(!document.querySelector('style[data-id="hideRefreshSettingsButton"]')){const e=document.createElement("style");e.type="text/css",e.setAttribute("data-id","hideRefreshSettingsButton");const i=".bbi-dbrd-datasource-schedule { display: none !important }";e.appendChild(document.createTextNode(i)),document.head.appendChild(e)}}const f=window[this.actionBeginFn];f instanceof Function&&f.call(this,e);const w=window[this.embedOptions.events.onActionStart];if(w instanceof Function&&w.call(this,e),this.embedOptions.events.onActionStart instanceof Function&&this.embedOptions.events.onActionStart.call(this,e),"dataSourceSaveAction"==e.eventType&&this._onBoldBIBeforeDatasourceSaveAction(e),"filterInteraction"==e.eventType){const i=window[null===(a=null===(d=this.embedOptions.events)||void 0===d?void 0:d.filters)||void 0===a?void 0:a.beforeApply];i instanceof Function&&i.call(this,e),(null===(l=null===(r=this.embedOptions.events)||void 0===r?void 0:r.filters)||void 0===l?void 0:l.beforeApply)instanceof Function&&(null===(m=null===(b=this.embedOptions.events)||void 0===b?void 0:b.filters)||void 0===m||m.beforeApply.call(this,e))}if("publishAsAction"==e.eventType){const i=window[null===(c=null===(h=this.embedOptions.events)||void 0===h?void 0:h.designer)||void 0===c?void 0:c.beforePublishDialogOpen];i instanceof Function&&i.call(this,e),(null===(u=null===(p=this.embedOptions.events)||void 0===p?void 0:p.designer)||void 0===u?void 0:u.beforePublishDialogOpen)instanceof Function&&(null===(v=null===(g=this.embedOptions.events)||void 0===g?void 0:g.designer)||void 0===v||v.beforePublishDialogOpen.call(this,e))}}_onBoldBIDashboardInstaceActionComplete(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v;const f=this;let w;const I=window[this.actionCompleteFn];this._isNullOrUndefined(e.data)||("createConnection"==e.data.event&&(this.embedOptions.datasourceId=e.data.source.data,this.embedOptions.mode=BoldBI.Mode.DataSource,this.isNewConnection=!0,f.authToken?f._renderDashboard({Apistatus:!0,Data:this.tokenResponse,Status:!0}):f._isEmptyOrSpaces(f.embedOptions.authorizationServer.url)?(w={embed_datasource_id:f.embedOptions.datasourceId,embed_mode:f.embedOptions.mode},bbEmbed.ajax({async:!1,type:"POST",url:f.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:"Bearer "+f.accessToken},data:JSON.stringify(w),contentType:"application/json",success:bbEmbed.proxy(f._renderDashboard,f)})):this._getAuthorizationToken()),"cancelDataSource"==e.data.event&&(this.embedOptions.mode=BoldBI.Mode.Connection,f.authToken?f._renderDashboard({Apistatus:!0,Data:this.tokenResponse,Status:!0}):f._isEmptyOrSpaces(f.embedOptions.authorizationServer.url)?(w={embed_mode:f.embedOptions.mode},bbEmbed.ajax({async:!1,type:"POST",url:f.dashboardServerApiUrl+this.embedGetDetailsEndPoint,headers:{Authorization:"Bearer "+f.accessToken},data:JSON.stringify(w),contentType:"application/json",success:bbEmbed.proxy(f._renderDashboard,f)})):this._getAuthorizationToken()));const O="boolean"==typeof(null===(i=this.embedOptions.dashboardSettings)||void 0===i?void 0:i.edit)?null===(t=this.embedOptions.dashboardSettings)||void 0===t?void 0:t.edit:null!==(n=null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.edit)&&void 0!==n&&n;if("dashboardRendered"==e.eventType&&O){const e=document.querySelector('[data-name="editdashboard"]');e&&(e.removeAttribute("disabled"),e.classList.remove("disabled"),e.style.pointerEvents="auto",e.style.opacity="1")}if(this.pinboardIds.length>0&&"renderWidget"===e.eventType){0===e.source.element.find(".bbi-dbrd-control-header .bbi-dbrd-control-title-wrapper").length?(e.source.element.parents(".widget").find("#widget-icons").css("margin-top","8px"),e.source.element.attr("data-name").toLowerCase().includes("card")&&e.source.element.find(".bbi-dbrd-control").css("top","20px")):(e.source.element.find(".bbi-dbrd-control-header").css("margin-left","-8px"),e.source.element.find(".bbi-dbrd-control-title-wrapper").css("margin-left","8px"))}if("interactionCompleted"==e.eventType){w={filterData:this._getFilterData(e.source.data.encryptedData),data:e};const i=window[null===(a=null===(d=this.embedOptions.events)||void 0===d?void 0:d.filters)||void 0===a?void 0:a.onInteraction];i instanceof Function&&i.call(this,w),(null===(l=null===(r=this.embedOptions.events)||void 0===r?void 0:r.filters)||void 0===l?void 0:l.onInteraction)instanceof Function&&(null===(m=null===(b=this.embedOptions.events)||void 0===b?void 0:b.filters)||void 0===m||m.onInteraction.call(this,e))}else{I instanceof Function&&I.call(this,e);const i=window[this.embedOptions.events.onActionComplete];i instanceof Function&&i.call(this,e),this.embedOptions.events.onActionComplete instanceof Function&&this.embedOptions.events.onActionComplete.call(this,e)}if("filterInteraction"==e.eventType){const i=window[null===(c=null===(h=this.embedOptions.events)||void 0===h?void 0:h.filters)||void 0===c?void 0:c.afterApply];i instanceof Function&&i.call(this,e),(null===(u=null===(p=this.embedOptions.events)||void 0===p?void 0:p.filters)||void 0===u?void 0:u.afterApply)instanceof Function&&(null===(v=null===(g=this.embedOptions.events)||void 0===g?void 0:g.filters)||void 0===v||v.afterApply.call(this,e))}if("dataSourceSaveAction"==e.eventType&&JSON.parse(e.schema.schema).length>0&&this._onBoldBIAfterDatasourceSaveAction(e),"Save"==e.eventType){this._authorizeResponse.Data.ItemDetail.Name=e.data.dashboardName;const i=this._authorizeResponse.Data.ItemDetail.ItemLocation;this.authToken?this._authorizeResponse.Data.dashboardVersion=e.data.version:this._authorizeResponse.Data.ItemDetail.ItemLocation=i.replace(/\/\d+$/,"/"+e.data.version)}"SaveAs"==e.eventType&&(this._authorizeResponse.Data.ItemDetail.Id=e.data.dashboardId,this._authorizeResponse.Data.ItemDetail.Name=e.data.dashboardName,this.authToken?this._authorizeResponse.Data.dashboardVersion=e.data.version:this._authorizeResponse.Data.ItemDetail.ItemLocation=e.data.dashboardId+"/"+e.data.version,this.embedOptions.dashboardId=e.data.dashboardId)}_onBoldBIDashboardInstaceReportOpen(e){const i=window[this.reportOpenedFn];i instanceof Function&&i.call(this,e);const t=window[this.embedOptions.reportOpened];t instanceof Function&&t.call(this,e),this.embedOptions.reportOpened instanceof Function&&this.embedOptions.reportOpened.call(this,e)}_onBoldBIDashboardInstanceNavigateToDashboard(e){var i,t;this._initializeDashboardContainer(),this.embedOptions.mode=BoldBI.Mode.View,this.embedOptions.dashboardSettings.edit=this.editIgnore,(null===(t=null===(i=this.embedOptions.settings)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.edit)&&(this.embedOptions.settings.viewer.edit=this.editIgnore),this._authorizeResponse.Data.ItemDetail.Name=e.PublishName,this.embedOptions.isdesignerdraft&&this.authToken&&(this._authorizeResponse.Data.ItemDetail.Id=e.PublishId,"0"==this._authorizeResponse.Data.dashboardVersion||this._authorizeResponse.Data.dashboardVersion,this.embedOptions.dashboardId=e.PublishId),this._renderDashboard(this._authorizeResponse);const s=window[this.performNavigateDashboardFn];s instanceof Function&&s.call(this,e);const o=window[this.embedOptions.performNavigateToDashboard];o instanceof Function&&o.call(this,e),this.embedOptions.performNavigateToDashboard instanceof Function&&this.embedOptions.performNavigateToDashboard.call(this,e)}_onBoldBIBeforeDatasourceSaveAction(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.beforeSave];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.beforeSave)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.beforeSave.call(this,e))}_onBoldBIAfterDatasourceSaveAction(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.afterSave];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.afterSave)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.afterSave.call(this,e))}_onBoldBIDashboardBeforeBannerIconRender(e,i){var t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O,_,y,E,D,S,B,C,x=!1,A=!1;if(this.isEditGroupSeparatorEnabled=!1,e.iconsinformation.find((e=>"Summarize"===e.groupId))){var M=e.iconsinformation.shift();A=!0}const F=e.iconsinformation.shift();if(e.iconsinformation.find((e=>"translatorgroup"===e.groupId))){var T=e.iconsinformation.shift();x=!0}const k=e.iconsinformation.shift(),L=e.iconsinformation.shift();this.dashboardWidgetExports.dashboard.showMoreOption&&(this.dashboardWidgetExports.dashboard.showExport||this.dashboardWidgetExports.dashboard.showMetrics)&&(this.dashboardWidgetExports.export.excel||this.dashboardWidgetExports.export.image||this.dashboardWidgetExports.export.pdf||this.dashboardWidgetExports.export.csv||this.dashboardWidgetExports.dashboard.showMetrics)||(e.iconsinformation=this._arraySlice(e.iconsinformation,"groupName","Option"));if(0==("boolean"==typeof(null===(t=this.embedOptions.dashboardSettings)||void 0===t?void 0:t.showDashboardParameter)?this.embedOptions.dashboardSettings.showDashboardParameter:null===(n=null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.dashboardParameter)||void 0===n||n))for(let e=k.items.length-1;e>=0;e--)this._isNullOrUndefined(k.items[`${e}`])||"dashboardparameters"!=k.items[`${e}`][0].dataset.name||k.items.splice(e,1);("boolean"==typeof(null===(d=this.embedOptions.dashboardSettings)||void 0===d?void 0:d.showRefresh)?null===(a=this.embedOptions.dashboardSettings)||void 0===a?void 0:a.showRefresh:null===(b=null===(l=null===(r=this.embedOptions.settings)||void 0===r?void 0:r.viewer)||void 0===l?void 0:l.refresh)||void 0===b||b)||L.items.splice(0,1);const N=window[this.beforeBannerIconRenderFn],z="boolean"==typeof(null===(m=this.embedOptions.dashboardSettings)||void 0===m?void 0:m.enableFullScreen)?null===(h=this.embedOptions.dashboardSettings)||void 0===h?void 0:h.enableFullScreen:null!==(u=null===(p=null===(c=this.embedOptions.settings)||void 0===c?void 0:c.viewer)||void 0===p?void 0:p.fullScreen)&&void 0!==u&&u;if(z){const i={groupId:"refresh-fullscreen",groupName:"Refresh & FullScreen",enableGroupSeperator:!0,items:[this._createBannerIcon("<div/>","dashboard-refresh","e-dbrd-banner-refresh","Refresh","refreshdashboard",!0,!1,{display:"none","font-size":"14px"}),this._createBannerIcon("<div/>","dashboard-fullscreen",this.isFullscreen?"su su-minimize":"su su-maximize-1","Fullscreen","fullscreen",!0,!1,{"font-size":"14px"})]};e.iconsinformation.unshift(i)}const W="boolean"==typeof(null===(g=this.embedOptions.dashboardSettings)||void 0===g?void 0:g.edit)?null===(v=this.embedOptions.dashboardSettings)||void 0===v?void 0:v.edit:null!==(I=null===(w=null===(f=this.embedOptions.settings)||void 0===f?void 0:f.viewer)||void 0===w?void 0:w.edit)&&void 0!==I&&I;if(W&&((null===(O=null==i?void 0:i.ItemDetail)||void 0===O?void 0:O.CanWrite)||(null==i?void 0:i.CanWrite))){this.isEditGroupSeparatorEnabled=!0;const i=this._createBannerIcon("<a/>","dashboard-edit","su su-edit","Edit","editdashboard",!0,!1,{"font-size":"13px","padding-left":"7px"},""),t={groupId:"edit-share",groupName:"Edit & Share",items:[i]};t.enableGroupSeperator=!z,e.iconsinformation.unshift(t),i.attr("disabled","true"),i.addClass("disabled"),i.css("pointer-events","none"),i.css("opacity","0.5")}else this.isDashboardRendering&&W&&!(null===(_=null==i?void 0:i.ItemDetail)||void 0===_?void 0:_.CanWrite)&&!(null==i?void 0:i.CanWrite)&&console.warn("Edit is set to true, but you’re not authorized to make changes to this dashboard.");L.items.length>0&&(e.iconsinformation.unshift(L),e.iconsinformation[0].enableGroupSeperator=!z&&!this.isEditGroupSeparatorEnabled),k.items.length>0&&e.iconsinformation.unshift(k),x&&e.iconsinformation.unshift(T),F.items.length>0&&e.iconsinformation.unshift(F),A&&e.iconsinformation.unshift(M),N instanceof Function&&N.call(this,e);const P=window[null===(E=null===(y=this.embedOptions.events)||void 0===y?void 0:y.viewer)||void 0===E?void 0:E.beforeToolBarItemsRender];P instanceof Function&&P.call(this,e),(null===(S=null===(D=this.embedOptions.events)||void 0===D?void 0:D.viewer)||void 0===S?void 0:S.beforeToolBarItemsRender)instanceof Function&&(null===(C=null===(B=this.embedOptions.events)||void 0===B?void 0:B.viewer)||void 0===C||C.beforeToolBarItemsRender.call(this,e)),[...document.head.querySelectorAll("style")].some((e=>e.innerHTML.includes("#dashboard-refresh { display: none !important")))||bbEmbed('<style type="text/css"> #dashboard-refresh { display: none !important} </style>').appendTo("head");const U=document.querySelectorAll("script"),V=Array.from(U).filter((e=>e.src.includes("cultures/boldbi.cultures.min.js")));V.length>1&&V.slice(1).forEach((e=>{var i;null===(i=e.parentElement)||void 0===i||i.removeChild(e)}))}_createBannerIcon(e,i,t,s,o,n,d,a,r){return bbEmbed(e,d?{id:i,html:bbEmbed("<span/>",{class:"icon-with-label",text:s,css:{"font-family":"Roboto",padding:"10px"}}),class:"server-banner-icon e-dashboard-banner-icon bbi-dbrd-designer-hoverable "+t,"data-name":o,"data-event":n,href:r,css:a}:{id:i,class:"server-banner-icon e-dashboard-banner-icon bbi-dbrd-designer-hoverable "+t,"data-tooltip":s,"data-name":o,"data-event":n,css:a})}_onBoldBIDashboardBeforeOtherOptionContextMenuRender(e){var i,t,s,o,n,d;0==this.dashboardWidgetExports.dashboard.showExport&&(e.iconsinformation=this._arraySlice(e.iconsinformation,"groupName","export"));const a=window[this.beforeOtherRenderFn];a instanceof Function&&a.call(this,e);const r=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.beforeContextMenuRender];r instanceof Function&&r.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.beforeContextMenuRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.beforeContextMenuRender.call(this,e))}_onBoldBIDashboardSaveFilter(e){var i,t;const s=this,o=(null===(t=null===(i=s.embedOptions.events)||void 0===i?void 0:i.filters)||void 0===t?void 0:t.beforeSaveViewDialogOpen)||s.embedOptions.dashboardSettings.saveFilterClick,n=window[s.beforeSaveViewDialogOpenFn];n instanceof Function&&n.call(s,e);const d=window[`${o}`];if(d instanceof Function&&d.call(s,e),o instanceof Function&&o.call(s,e),!1===e.cancel)if(""==s.embedOptions.dashboardId&&""==s.embedOptions.dashboardIds)console.error(embeddingLocalization_1.errorMessages.EmptyDbrdCreate);else{let i;if(bbEmbed("body").find("#save_view_dialog_wrapper").remove(),i=s.embedOptions.dashboardIds&&s.embedOptions.dashboardIds.length>0?s.embedOptions.dashboardId=s.getActiveChildDashboardId():s.isMultiTab?s.getActiveChildDashboardId():s.embedOptions.dashboardId,e.viewId){const t={ViewId:e.viewId,DashboardId:i,QueryString:e.data.encryptedData};s.updateFilterView(t,(function(e,i){console.log(i+embeddingLocalization_1.successMessages.UpdateFilterViewMsg+e.ViewId)}))}else s._createSaveViewDialog(e)}}_addSaveViewDialogStyles(){bbEmbed('<style type="text/css">                     #save_view_dialog_header .su-view { float: left; padding-top: 5px; padding-right: 5px; font-size: 14px; color: var(--primary-text-normal-color); }                     #save_view_dialog_content { font-size: 12px; line-height: 1.4; }                     #save_view_dialog_header #save_view_dialog_header_title { color: var(--primary-text-normal-color);font-family: var(--font-family); font-size: 14px; padding-top: 5px; line-height: 15px; }                     #view_name_left_col { width: 25%; font-family: var(--font-family); font-size: 13px; float: left; text-align: right; margin: 5px 0px; }                     #view_name_right_col { width: 61%; float: left; margin-left: 50px; }                     #view_name_division {height: 50px}                     #default_view_division {height: 50px}                     #default_view_left {width: 25%; font-size: 13px; font-family: var(--font-family); float: left; text-align: right; margin: 5px 0px;}                     #default_view_right { width: 61%; float: left; margin-left: 50px; margin-top:5px; margin-bottom:5px}                     #view_name_textbox { width: 100%; border: 1px solid var(--secondary-border-color); padding: 6px 12px; color: var(--primary-text-normal-color); background: var(--primary-background-color); font-size: 12px; }                     #view_name_textbox:focus { border-color: var(--primary-branding-border-color)!important; }                     #cancel_button:hover { background: var(--secondary-btn-bg-hover-color); border: 1px solid var(--secondary-btn-border-normal-color); color: var(--secondary-btn-text-hover-color); }                     #save_button:hover { background: var(--primary-btn-bg-hover-color); border: 1px solid var(--primary-btn-border-normal-color); color: var(--primary-btn-text-hover-color) !important; }                     #save_view_dialog_footer { padding: 10px 15px; border-top: 1px solid var(--secondary-border-color); background: var(--secondary-background-color); }                     #save_view_dialog .e-dlg-closeicon-btn { margin-right: 5px; padding: 5px 0px; width: 15px; height: 20px; }                     #save_view_dialog .e-dlg-closeicon-btn .e-icon-dlg-close { font-size: 10px; color: var(--hyper-link-hover-color); }                     #save_view_dialog .e-dlg-closeicon-btn:hover, #save_view_dialog .e-dlg-closeicon-btn { background: var(--primary-background-color); }                     #save_view_dialog .e-dlg-content { background: var(--primary-background-color); color: var(--primary-text-normal-color); padding-bottom: 25px; }                     #view_name_err_msg { display: none; color: #ff3b30; font-size: 12px; }                     #cancel_button { background: var(--secondary-btn-bg-normal-color); border: 1px solid var(--secondary-btn-border-normal-color); color: var(--secondary-text-normal-color); font-family: var(--font-family); }                     #save_button { margin-right: 15px; background: var(--primary-btn-bg-normal-color); border: 1px solid var(--primary-btn-border-normal-color); color: var(--primary-btn-text-normal-color); font-family: var(--font-family); }                     #save_view_dialog .e-dlg-header-content { padding: 10px 15px; height: 40px; background: var(--primary-background-color); color: var(--primary-text-normal-color); }                     #save_view_dialog { background: var(--primary-background-color); }                     .footer-button-class { border-radius: 4px; display: inline-block; cursor: pointer; font-size: 12px; float: right; font-weight: 600; height: 32px; line-height: 18px; min-width: 90px; outline: 0; text-align: center; padding: 6px 20px; }                     .e-dlg-overlay { position: fixed; }                     .viewname-textbox-error { border: 1px solid #ff3b30 !important; }                     .default_view_switch {position: relative;display: inline-block;width: 28px; /* Width of the switch */height: 16px; /* Height of the switch margin-top: */}                    .default_view_switch input {  display: none;}                    .default_view_slider {position: absolute;cursor: pointer;top: 0;left: 0;right: 0;bottom: 0;background-color: var(--material-switch-background-bg-normal-color); border: 1px solid var(--secondary-btn-border-normal-color); -webkit-transition: .4s;transition: .4s;border-radius: 16px; /* Half of the height for a round shape */}                    .default_view_slider:before { position: absolute; content: ""; height: 9px; /* Height minus border width */width: 9px; /* Height minus border width */top: 3px; /* (Width - Height) / 2 to center it horizontally */ bottom: 3px; /* (Height - Height) / 2 to center it vertically  */left:2px; background-color: var(--material-switch-foreground-bg-normal-color); -webkit-transition: .4s; transition: .4s; border-radius: 50%; }                    .default_view_slider:hover {border: 1px solid var(--hover-icon-color);}                    input:checked + .default_view_slider { background-color: var(--primary-branding-color); border-color:var(--primary-branding-border-color);}                    input:focus + .default_view_slider {  box-shadow: 0 0 0.5px #2196F3;}                    input:checked + .default_view_slider:before {-webkit-transform: translateX(17.5px); /* Half of the width minus half of the height */-ms-transform: translateX(17.5px);transform: translateX(13.5px);background-color: white;}                    #info-icon {padding-left: 15px; cursor: pointer; font-size: 12px;}                     .su-info:before {content: ⓘ;}                    .default_view_slider_disable:before { position: absolute; content: ""; height: 9px; /* Height minus border width */width: 9px; /* Height minus border width */top: 3px; /* (Width - Height) / 2 to center it horizontally */ bottom: 3px; /* (Height - Height) / 2 to center it vertically */left:2px;background: var(--material-switch-foreground-bg-disable-color); -webkit-transition: .4s; transition: .4s; border-radius: 50%; }                    .tooltip {position: relative;display: inline-block;}                    .tooltip .tooltiptext {visibility: hidden;font-size: 11.8px;width: 320px;background: var(--primary-background-color);font-family: var(--font-family);color: var(--primary-text-normal-color);text-align: left;border-radius: 6px;padding: 5px;position: absolute;z-index: 1;top:130%;left:270%;margin-left:-60px; opacity: 0;transition: opacity 0.3s; border: 1px solid var(--secondary-border-color); box-shadow: 0 6px 12px rgba(0,0,0,.175)}                    .tooltip:hover .tooltiptext {visibility: visible;opacity: 1;}                    </style > ').appendTo("head")}_createSaveViewDialog(e){const i=this;i._addSaveViewDialogStyles();const t=bbEmbed("<div>").attr({id:"save_view_dialog_wrapper",class:"bi-dashboard"}).appendTo("body"),s=bbEmbed("<div>").attr("id","save_view_dialog").appendTo(t),o=`\n            <div id='save_view_dialog_content'>\n                <div id = "view_name_division">\n                    <label id='view_name_left_col'>Name*</label>\n                    <div id='view_name_right_col'>\n                        <input type='text' id='view_name_textbox' data-query='${e.data.encryptedData}' data-id='${e.viewId}'>\n                        <span id='view_name_err_msg'></span>\n                    </div>\n                </div>\n                <div id="default_view_division">\n                <label class="text-label" id="default_view_left">Mark as Default</label>\n                    <div id='default_view_right'>\n                        <label class="default_view_switch">\n                            <input type="checkbox" id="default_view_checkbox">\n                            <span class="default_view_slider" id="default_slider"></span>\n                        </label>\n                        <div class="tooltip">\n                            <div class="su su-info bbi-dbrd-designer-hoverable" id="info-icon" data-tooltip></div>\n                            <div class="tooltiptext" id="tooltip-text"></div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        `,n=bbEmbed("<div>").attr("id","save_view_dialog_footer"),d=bbEmbed("<button>").attr("id","save_button").addClass("footer-button-class").text("Save").on("click",(()=>i._saveFilterView(i))),a=bbEmbed("<button>").attr("id","cancel_button").addClass("footer-button-class").text("Cancel").on("click",(function(){bbEmbed("body").find("#save_view_dialog_wrapper, #success_save_view_dialog_wrapper").remove()}));n.append(a),n.append(d),s.append(n);new window.ejdashboard.popups.Dialog({header:'<div id="save_view_dialog_header"><span class="su su-view"></span><div id="save_view_dialog_header_title">Save View</div></div>',width:"600px",isModal:!0,showCloseIcon:!0,target:t[0],content:o}).appendTo("#save_view_dialog"),document.getElementById("view_name_textbox").addEventListener("input",(function(){i._viewNameValidation()}));const r=document.getElementById("info-icon"),l=document.getElementById("tooltip-text");let b;if(r.addEventListener("mouseover",(function(){l.textContent=b})),r.addEventListener("mouseout",(function(){l.textContent=""})),this.isDefaultView)document.getElementById("default_view_checkbox").checked=!0,b=embeddingLocalization_1.successMessages.NonDefaultViewInfoMsg;else{bbEmbed(".default_view_slider").css({background:"var(--material-switch-background-bg-disable-color)",border:"1px solid var(--material-switch-background-border-disable-color)"});document.getElementById("default_slider").classList.add("default_view_slider_disable"),document.getElementById("default_view_checkbox").checked=!1,document.getElementById("default_view_checkbox").disabled=!0,b=embeddingLocalization_1.successMessages.DefaultViewInfoMsg}}_saveFilterView(e){const i=e,t=bbEmbed("#view_name_textbox")[0];if(i._viewNameValidation()){let e;this.embedOptions.dashboardIds.length>0||(e=i.isMultiTab?i.getActiveChildDashboardId():"");const s=t.value,o=t.getAttribute("data-query"),n=t.getAttribute("data-id"),d={ViewName:s,ItemId:i.embedOptions.dashboardId,QueryString:o,ChildItemId:e,IsDefault:!!document.getElementById("default_view_checkbox").checked},a=e=>{e?bbEmbed("body").find("#save_view_dialog_wrapper").remove():i._viewNameValidation(!0)};"null"===n?i.saveFilterView(d,a):i.saveAsFilterView(d,a)}}_updateInFilterOverviewUI(e,i){let t={};t=this.isMultiTab?window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner"):this._getDashboardInstance(),t&&t._updateFilterOverview(e,i)}_viewNameValidation(e){const i=bbEmbed("#view_name_textbox"),t=bbEmbed("#view_name_err_msg"),s=!/^[a-zA-Z0-9!@$^ ()_=\-}{.`~]*$/.test(i.val()),o=this._isEmptyOrSpaces(i[0].value);return e||s||o?(t.css({display:"block","font-family":"var(--font-family)"}).text(e?embeddingLocalization_1.errorMessages.ExistedViewName:s?embeddingLocalization_1.errorMessages.AvoidSplChar:o?embeddingLocalization_1.errorMessages.EmptyViewName:""),i.addClass("viewname-textbox-error"),!1):(t.css("display","none").text(),i.removeClass("viewname-textbox-error"),!0)}getActiveChildDashboardId(){return window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner")._id.split("_")[1].replace(/^([\da-f]{8})([\da-f]{4})([\da-f]{4})([\da-f]{4})([\da-f]{12})$/,"$1-$2-$3-$4-$5")}_getParametersFromQueryString(e){return JSON.parse(decodeURIComponent(e).split("filterQuery=")[1]).map((e=>({name:e.dimfi&&!e.dimfi.c.toLowerCase().includes("include")?`${e.cn} (${e.dimfi.c})`:e.cn,values:e.dimfi?e.dimfi.t:e.idf.dfl})))}_onBoldBIDashboardSaveAsFilter(e){var i,t;const s=this,o=(null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.filters)||void 0===t?void 0:t.beforeSaveAsViewDialogOpen)||this.embedOptions.dashboardSettings.saveAsFilterClick,n=window[this.beforeSaveAsViewDialogOpenFn];n instanceof Function&&n.call(this,e);const d=window[`${o}`];d instanceof Function&&d.call(this,e),o instanceof Function&&o.call(this,e),!1===e.cancel&&(""==s.embedOptions.dashboardId?console.error(embeddingLocalization_1.errorMessages.EmptyDbrdCreate):(bbEmbed("body").find("#save_view_dialog_wrapper").remove(),s._createSaveViewDialog(e)))}_onBoldBIDashboardOpenViewSection(e){var i,t;const s=this,o=(null===(t=null===(i=s.embedOptions.events)||void 0===i?void 0:i.filters)||void 0===t?void 0:t.onSavedFilterClick)||s.embedOptions.dashboardSettings.viewSavedFiltersClick,n=window[s.onViewSavedFiltersClickFn],d=this.isMultiTab?this.getActiveChildDashboardId():this.embedOptions.dashboardId;this.deprecated=!1,this.getViewsByDashboardId(d,(function(i){e.viewInfos=i})),n instanceof Function&&n.call(s,e);const a=window[`${o}`];a instanceof Function&&a.call(s,e),o instanceof Function&&o.call(s,e)}_onGetLinkedDashboardDetails(e){const i=this;var t,s=void 0!==e&&null!=e?e:"",o=this._isNullOrUndefined(s)||void 0===s.itemType||null==s.itemType?null:s.itemType;if(!this._isNullOrUndefined(o))if("set"==o.toLowerCase()){var n={itemIdList:e.itemCollection};const t=this._validatetoken(i.accessToken);bbEmbed.ajax({type:"POST",url:this.dashboardServerApiUrl+"/embed/linked-dashboard-details",headers:{Authorization:t},contentType:"application/json",data:JSON.stringify(n),success:function(e){i.embedOptions.dashboardDetailList=e.Data}})}else if("get"==o.toLowerCase()&&!this._isNullOrUndefined(i.embedOptions.dashboardDetailList)){var d=i.embedOptions.dashboardDetailList.filter((i=>i.Id===e.itemId)),a=d[0].CategoryName;bbEmbed("#favorite_Item").attr("data-item-id",d[0].Id),bbEmbed("#dashboard_Comment").attr({"data-item-id":d[0].Id,"data-category-name":a,"data-item-name":d[0].Name}),bbEmbed("#isMultiDashboard").attr("data-item-id",e.itemId),t={itemId:e.itemId,dashboardPath:e.itemId+"/"+d[0].Version,dashboardName:d[0].Name},e.modelInfo=t}}_onBoldBIDashboardBannerIconClick(e){var i,t,s,o,n,d;if("fullscreen"==e.name.toLowerCase()&&this._switchFullscreenMode(e),"refreshdashboard"==e.name.toLowerCase())if(this.isMultiTab){window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner").updateDashboard()}else{this._getDashboardInstance().updateDashboard()}if("editdashboard"==e.name.toLowerCase()&&(this._initializeDashboardContainer(),this.embedOptions.mode=BoldBI.Mode.Design,this._renderDashboard(this._authorizeResponse)),"dashboardparameters"==e.name.toLowerCase()){const e=document.createElement("style");e.innerHTML=".remove-scroller-dashboard-parameter { width: 100% !important; height: 100% !important; color: #333; background: #fff; border-radius: 0; }",document.head.appendChild(e);const i=this;setTimeout((function(){const e=i.isMultiTab?window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner"):i._getDashboardInstance();bbEmbed("#"+e._id+"_dashboardparameter_dialog").addClass("remove-scroller-dashboard-parameter")}),50)}const a=window[this.onBannerIconClickFn];a instanceof Function&&a.call(this,e);const r=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.onToolbarItemClick];if(r instanceof Function&&r.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.onToolbarItemClick)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.onToolbarItemClick.call(this,e)),void 0!==e.name&&"theming"==e.name.toLowerCase()){let i;if(this.isMultiTab){this.multiTabTheme=e.selectedTheme;const i=window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd").data("BoldBIDashboardDesigner");i.applyDashboardTheme(e.selectedTheme),this.setDefaultTheme(i.modules.themeHelper.getBannerBackground(),i.modules.themeHelper.getBannerTextColor(),i.modules.themeHelper.getBannerIconColor());const t=window.bbEmbed("#"+this.embedOptions.embedContainerId).find(".e-content .bbembed-multitab-dbrd");for(let i=0;i<t.length;i++)if(window.bbEmbed(window.bbEmbed(".e-content .e-active").find(".bbembed-multitab-dbrd")).attr("id")!=window.bbEmbed(t[`${i}`]).attr("id")){const s=window.bbEmbed(t[`${i}`]).attr("id"),o=this._getDashboardInstance(s);null!=o&&o.applyDashboardTheme(e.selectedTheme)}}else{this._getDashboardInstance(i).applyDashboardTheme(e.selectedTheme)}}}getComments(e,i,t){this.deprecationMessage("getComments");const s=this,o={ItemId:"dashboard"==e?i.dashboardId:i.widgetId,DashboardItemId:"dashboard"==e&&this.isMultiTab?i.multitabDashboardId:i.dashboardId,ItemType:e,ParentItemId:this.isMultiTab?i.multitabDashboardId:null,CommentAction:3,OrderBy:1};var n=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:n},data:JSON.stringify(o),contentType:"application/json",success:function(o){if(o.Status)if("dashboard"==e)s.commentsArgs.Comments=o.Comments,s.commentsArgs.ActiveCommentsCount=o.ActiveCommentsCount,s.commentsArgs.SortBy=1,s.commentsArgs.DashboardId=o.ItemId,window[`${t}`]instanceof Function?window[`${t}`].call(s,s.commentsArgs):t.call(s,s.commentsArgs);else if("widget"==e){const e=bbEmbed("[data-widget-id="+i.widgetId+"]"),n=e[0].id,d=bbEmbed("#"+n).width(),a=e.offset().left+d,r=e.offset().top;let l=bbEmbed(window).width()-(a+350);l<0&&(l=bbEmbed(window).width()-(a-(bbEmbed(window).width()<450?0:75)),bbEmbed(window).width()<375&&(l=0)),s.commentsArgs.Comments=o.Comments,s.commentsArgs.Position={top:r+20,right:l+40},s.commentsArgs.ActiveCommentsCount=o.ActiveCommentsCount,s.commentsArgs.SortBy=1,s.commentsArgs.WidgetId=i.widgetId,s.commentsArgs.DashboardId=i.dashboardId,window[`${t}`]instanceof Function?window[`${t}`].call(s,s.commentsArgs):t.call(s,s.commentsArgs)}},error:function(e){s.ajaxErrorFnc(e)}})}addDashboardComment(e,i){this.deprecationMessage("addDashboardComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId),d=!e.parentCommentId||!!Number(e.parentCommentId);if(o&&n&&d&&!this._isEmptyOrSpaces(e.content)){const s=(new Date).toISOString(),o={ItemType:"dashboard",Comment:e.content,ItemId:e.dashboardId,ParentId:e.parentCommentId,ParentItemId:e.multitabDashboardId,CommentAction:0,CurrentDate:s,Url:this.dashboardUrl};var a=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:a},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("dashboard",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&n?d?this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidReplyCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}addWidgetComment(e,i){this.deprecationMessage("addWidgetComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=s.exec(e.widgetId),d=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId),a=!e.parentCommentId||!!Number(e.parentCommentId);if(n&&o&&d&&a&&!this._isEmptyOrSpaces(e.content)){const s=(new Date).toISOString(),o={ItemType:"widget",Comment:e.content,ItemId:e.widgetId,DashboardItemId:e.dashboardId,ParentId:e.parentCommentId,ParentItemId:e.multitabDashboardId,CommentAction:0,CurrentDate:s,Url:this.dashboardUrl};var r=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:r},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("widget",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&d&&n?a?this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidReplyCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidgetID)}deleteDashboardComment(e,i){this.deprecationMessage("deleteDashboardComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(o&&n&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"dashboard",CommentId:e.commentId,ItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:2,CurrentDate:s,Url:this.dashboardUrl};var d=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:d},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("dashboard",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&n?this._isEmptyOrSpaces(e.commentId)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}deleteWidgetComment(e,i){this.deprecationMessage("deleteWidgetComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=s.exec(e.widgetId),d=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(n&&o&&d&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"widget",CommentId:e.commentId,ItemId:e.widgetId,DashboardItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:2,CurrentDate:s,Url:this.dashboardUrl};var a=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:a},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("widget",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&d&&n?this._isEmptyOrSpaces(e.commentId)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):console.error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidgetID)}editDashboardComment(e,i){this.deprecationMessage("editDashboardComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(o&&n&&!this._isEmptyOrSpaces(e.content)&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"dashboard",Comment:e.content,CommentId:e.commentId,ItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:1,CurrentDate:s,Url:this.dashboardUrl};var d=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:d},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.deprecated=!1,t.getComments("dashboard",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&n?this._isEmptyOrSpaces(e.commentId)?console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidDashboardID)}editWidgetComment(e,i){this.deprecationMessage("editWidgetComment");const t=this,s=/^(?:\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\}{0,1})$/,o=s.exec(e.dashboardId),n=s.exec(e.widgetId),d=!e.multitabDashboardId||!!s.exec(e.multitabDashboardId);if(n&&o&&d&&!this._isEmptyOrSpaces(e.content)&&!this._isEmptyOrSpaces(e.commentId)){const s=(new Date).toISOString(),o={ItemType:"widget",Comment:e.content,CommentId:e.commentId,ItemId:e.widgetId,DashboardItemId:e.dashboardId,ParentItemId:e.multitabDashboardId,CommentAction:1,CurrentDate:s,Url:this.dashboardUrl};var a=this._validatetoken(this.accessToken);bbEmbed.ajax({async:!1,type:"POST",url:this.dashboardServerApiUrl+"/comments/operation",headers:{Authorization:a},data:JSON.stringify(o),contentType:"application/json",success:function(s){s.Status&&(t.commentsArgs.StatusMessage=s.StatusMessage,t.deprecated=!1,t.getComments("widget",e,i))},error:function(e){t.ajaxErrorFnc(e)}})}else o&&d&&n?this._isEmptyOrSpaces(e.commentId)?console.error(embeddingLocalization_1.errorMessages.InvalidCommentID):this._isEmptyOrSpaces(e.content)&&console.error(embeddingLocalization_1.errorMessages.InvalidCommentText):console.error(embeddingLocalization_1.errorMessages.InvalidDbrdAndWidgetID)}ajaxErrorFnc(e){let i="";i=0==e.status?embeddingLocalization_1.errorMessages.NetworkIssue:404==e.status?"Not Found"==e.statusText?embeddingLocalization_1.errorMessages.ViewIDNotFound:embeddingLocalization_1.errorMessages.PageNotFound:500==e.status?embeddingLocalization_1.errorMessages.InternalServerError:embeddingLocalization_1.errorMessages.UncaughtError+e.responseText,this._isNullOrUndefined(this.embedOptions.events.onError)||""==this.embedOptions.events.onError?console.error(i):this.onErrorClient(i)}setDefaultTheme(e,i,t){bbEmbed(".e-tab-header.e-control.e-toolbar.e-lib.e-keyboard").css("color",t),bbEmbed(".e-toolbar-item .e-tab-text").css("color",i),bbEmbed(".e-toolbar-item.e-active .e-tab-text").addClass("active-font-color"),bbEmbed(".multitab-dbrd").css("background",e),bbEmbed(".e-items.e-toolbar-items.e-lib.e-hscroll.e-control.e-touch .e-nav-arrow").css("color",t)}_switchFullscreenMode(e){const i=document.getElementById(e.target.parent().attr("id").split("_embeddedbi")[0]);if(this.isFullscreen=!1,document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else if(i.requestFullscreen)i.requestFullscreen();else if(i.msRequestFullscreen)i.msRequestFullscreen();else if(i.mozRequestFullScreen)i.mozRequestFullScreen();else if(i.webkitRequestFullscreen)i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if("ActiveXObject"in window){new ActiveXObject("Wscript.shell").SendKeys("{F11}"),setTimeout((function(){(screen.availHeight||screen.height-30)<=window.innerHeight?(bbEmbed('<style id="embed-fullscreen" type="text/css"> .hide-dashboard-icons #dashboard-refresh {  display: block !important; } .hide-dashboard-icons ul.options, .hide-dashboard-icons .su-pin, .hide-dashboard-icons .su-edit, .hide-dashboard-icons .bbi-dbrd-banner-link, .hide-dashboard-icons .bbi-dbrd-banner-menu, .hide-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-dashboard-icons .bbi-dbrd-control-menu, .hide-dashboard-icons .e-dashboard-banner-menu, .hide-dashboard-icons .e-dashboard-banner-link, .hide-dashboard-icons .su-icon, .hide-dashboard-icons .bbi-dbrd-control-menu-icon, .hide-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#pinboard-fullscreen), .hide-dashboard-icons .e-dashboard-banner-description, .hide-dashboard-icons .server-banner-icon + .e-banner-verticalsplitline, .hide-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-dashboard-icons .bbi-dashboard-widget-menu { display: none !important; } .hide-dashboard-icons #dashboard { width: 100% !important; } .hide-embed-dashboard-icons .bbi-dbrd-banner-link, .hide-embed-dashboard-icons .bbi-dbrd-banner-menu, .hide-embed-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-embed-dashboard-icons .bbi-dbrd-control-menu, .hide-embed-dashboard-icons .e-dashboard-banner-menu, .hide-embed-dashboard-icons .e-dashboard-banner-link, .hide-embed-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#dashboard_otheroption):not(#dashboard-view):not(#dashboard-comment):not(#dashboard_dashboardmenu), .hide-embed-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-embed-dashboard-icons .saved-view .su.cursor-pointer { display: none !important; } </style>').appendTo("head"),bbEmbed("body").addClass("hide-dashboard-icons"),bbEmbed("#dashboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen")):(bbEmbed("#embed-fullscreen").remove(),bbEmbed("body").removeClass("hide-dashboard-icons"),this.isMultiTab&&bbEmbed("#"+this.embedOptions.embedContainerId).find(".multitab-dbrd").css("width",this.embedOptions.width),bbEmbed("#dashboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen"))}),400)}}_fullscreenExitHandler(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u,g,v,f,w,I,O;if(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement){const i=document.getElementById("remove-view-saved");if("boolean"==typeof(null===(b=null===(l=this.embedOptions.dashboardSettings)||void 0===l?void 0:l.filterOverviewSettings)||void 0===b?void 0:b.showViewSavedFilterIcon)?null===(h=null===(m=this.embedOptions.dashboardSettings)||void 0===m?void 0:m.filterOverviewSettings)||void 0===h?void 0:h.showViewSavedFilterIcon:null!==(g=null===(u=null===(p=null===(c=this.embedOptions.settings)||void 0===c?void 0:c.viewer)||void 0===p?void 0:p.filterOverview)||void 0===u?void 0:u.viewSavedFilter)&&void 0!==g&&g)if(i)document.getElementById("remove-view-saved").innerHTML=".bbi-dbrd-view-saved { display: none; }";else{const e=document.createElement("style");e.type="text/css",e.id="remove-view-saved";const i=".bbi-dbrd-view-saved{display:none}";e.appendChild(document.createTextNode(i)),document.head.appendChild(e)}this.isFullscreen=!0;const t="boolean"==typeof(null===(v=this.embedOptions.dashboardSettings)||void 0===v?void 0:v.showRefresh)?null===(f=this.embedOptions.dashboardSettings)||void 0===f?void 0:f.showRefresh:null===(O=null===(I=null===(w=this.embedOptions.settings)||void 0===w?void 0:w.viewer)||void 0===I?void 0:I.refresh)||void 0===O||O;bbEmbed('<style id="embed-fullscreen" type="text/css"> .hide-dashboard-icons #dashboard-refresh { display:'+(t?"block !important":"none !important")+"; } .hide-dashboard-icons ul.options, .hide-dashboard-icons .su-pin, .hide-dashboard-icons .su-edit, .hide-dashboard-icons .bbi-dbrd-banner-link, .hide-dashboard-icons .bbi-dbrd-banner-menu, .hide-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-dashboard-icons .bbi-dbrd-control-menu, .hide-dashboard-icons .e-dashboard-banner-menu, .hide-dashboard-icons .e-dashboard-banner-link, .hide-dashboard-icons .su-icon, .hide-dashboard-icons .bbi-dbrd-control-menu-icon, .hide-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#pinboard-fullscreen), .hide-dashboard-icons .e-dashboard-banner-description, .hide-dashboard-icons .server-banner-icon + .e-banner-verticalsplitline, .hide-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-dashboard-icons .bbi-dashboard-widget-menu { display: none !important; } .hide-dashboard-icons #dashboard { width: 100% !important; } .hide-embed-dashboard-icons .bbi-dbrd-banner-link, .hide-embed-dashboard-icons .bbi-dbrd-banner-menu, .hide-embed-dashboard-icons .bbi-dbrd-banner-text-icon, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withoutcomments, .hide-embed-dashboard-icons .bbi-dbrd-banner-widget-withcomments, .hide-embed-dashboard-icons .bbi-dbrd-control-menu, .hide-embed-dashboard-icons .e-dashboard-banner-menu, .hide-embed-dashboard-icons .e-dashboard-banner-link, .hide-embed-dashboard-icons .e-dashboard-banner-icon:not(#dashboard-fullscreen):not(#dashboard-refresh):not(#dashboard_otheroption):not(#dashboard-view):not(#dashboard-comment):not(#dashboard_dashboardmenu), .hide-embed-dashboard-icons #dashboard_bannerPanel div a + .e-banner-verticalsplitline, .hide-embed-dashboard-icons .saved-view .su.cursor-pointer { display: none !important; } </style>").appendTo("head"),bbEmbed("body").addClass("hide-dashboard-icons"),e.isMultiTab?bbEmbed("#"+e.embedOptions.embedContainerId).find(".multitab-dbrd .e-content .e-active").find("#dashboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"):bbEmbed("#dashboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"),bbEmbed("#pinboard-fullscreen").removeClass("su-maximize-1").addClass("su-minimize").attr("data-tooltip","Exit Fullscreen"),bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; overflow: auto !important")}else{bbEmbed("#embed-fullscreen").remove(),bbEmbed("body").removeClass("hide-dashboard-icons"),e.isMultiTab?(bbEmbed("#"+e.embedOptions.embedContainerId).find(".multitab-dbrd").css("width","100%"),bbEmbed("#"+e.embedOptions.embedContainerId).find(".multitab-dbrd .e-content .e-active").find("#dashboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen")):bbEmbed("#dashboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen"),bbEmbed("#pinboard-fullscreen").addClass("su-maximize-1").removeClass("su-minimize").attr("data-tooltip","Fullscreen"),bbEmbed("#server-app-container").attr("style","background-color: #f9f9f9; height:"+bbEmbed("#content-area").height()+"px;overflow: hidden !important;min-height: 600px; width:"+e.embedOptions.width);("boolean"==typeof(null===(t=null===(i=this.embedOptions.dashboardSettings)||void 0===i?void 0:i.filterOverviewSettings)||void 0===t?void 0:t.showViewSavedFilterIcon)?null===(o=null===(s=this.embedOptions.dashboardSettings)||void 0===s?void 0:s.filterOverviewSettings)||void 0===o?void 0:o.showViewSavedFilterIcon:null!==(r=null===(a=null===(d=null===(n=this.embedOptions.settings)||void 0===n?void 0:n.viewer)||void 0===d?void 0:d.filterOverview)||void 0===a?void 0:a.viewSavedFilter)&&void 0!==r&&r)&&(document.getElementById("remove-view-saved").innerHTML=".bbi-dbrd-view-saved { display: block; }")}}_onBoldBIDashboardBeforeWidgetIconRendered(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p;const u="boolean"==typeof(null===(i=this.embedOptions.widgetSettings)||void 0===i?void 0:i.showMaximize)?this.embedOptions.widgetSettings.showMaximize:null===(o=null===(s=null===(t=this.embedOptions.settings)||void 0===t?void 0:t.widget)||void 0===s?void 0:s.maximize)||void 0===o||o,g="boolean"==typeof(null===(n=this.embedOptions.widgetSettings)||void 0===n?void 0:n.showFilter)?this.embedOptions.widgetSettings.showFilter:null===(r=null===(a=null===(d=this.embedOptions.settings)||void 0===d?void 0:d.widget)||void 0===a?void 0:a.filter)||void 0===r||r;u||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","maximize")),g||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","filter")),!1!==this.dashboardWidgetExports.widget.showExport&&(this.dashboardWidgetExports.export.excel||this.dashboardWidgetExports.export.image||this.dashboardWidgetExports.export.pdf||this.dashboardWidgetExports.export.csv)||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","export"),this._isNullOrUndefined(e.widgetInformation)||this._isNullOrUndefined(e.widgetInformation.widgetJson)||this._isNullOrUndefined(e.widgetInformation.widgetJson.ContainerSettings)||e.widgetInformation.widgetJson.ContainerSettings.ViewData&&1!=e.widgetInformation.widgetJson.ContainerSettings.ViewActionData||(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","menu"))),0==this.dashboardWidgetExports.widget.showMoreOption&&(e.iconsinformation=this._arraySlice(e.iconsinformation,"name","menu"));const v=window[this.beforeWidgetIconRenderedFn];v instanceof Function&&v.call(this,e);const f=window[null===(b=null===(l=this.embedOptions.events)||void 0===l?void 0:l.widget)||void 0===b?void 0:b.beforeToolBarItemsRender];f instanceof Function&&f.call(this,e),(null===(h=null===(m=this.embedOptions.events)||void 0===m?void 0:m.widget)||void 0===h?void 0:h.beforeToolBarItemsRender)instanceof Function&&(null===(p=null===(c=this.embedOptions.events)||void 0===c?void 0:c.widget)||void 0===p||p.beforeToolBarItemsRender.call(this,e))}_onBoldBIBeforeControlMenuOpen(e){var i,t,s,o,n,d;!1!==this.dashboardWidgetExports.widget.showExport&&(this.dashboardWidgetExports.export.excel||this.dashboardWidgetExports.export.image||this.dashboardWidgetExports.export.pdf||this.dashboardWidgetExports.export.csv)||(e.menuItems=this._arraySlice(e.menuItems,"id","export"));const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.beforeContextMenuRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.beforeContextMenuRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.beforeContextMenuRender.call(this,e))}_onBoldBIBeforeDashboardMobileMenuOpen(e){var i,t,s,o,n,d,a,r,l,b,m,h,c,p,u;const g="boolean"==typeof(null===(i=this.embedOptions.dashboardSettings)||void 0===i?void 0:i.showRefresh)?null===(t=this.embedOptions.dashboardSettings)||void 0===t?void 0:t.showRefresh:null===(n=null===(o=null===(s=this.embedOptions.settings)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.refresh)||void 0===n||n,v="boolean"==typeof(null===(d=this.embedOptions.dashboardSettings)||void 0===d?void 0:d.showDashboardParameter)?this.embedOptions.dashboardSettings.showDashboardParameter:null===(l=null===(r=null===(a=this.embedOptions.settings)||void 0===a?void 0:a.viewer)||void 0===r?void 0:r.dashboardParameter)||void 0===l||l;if(0==v||!g||0==this.dashboardWidgetExports.dashboard.showExport)for(let i=e.menuItems.length-1;i>=0;i--)(0==v&&"dashboardparameters"==e.menuItems[`${i}`].id||!g&&"refreshDashboard"==e.menuItems[`${i}`].id||0==this.dashboardWidgetExports.dashboard.showExport&&"export"==e.menuItems[`${i}`].id)&&e.menuItems.splice(i,1);const f=window[null===(m=null===(b=this.embedOptions.events)||void 0===b?void 0:b.viewer)||void 0===m?void 0:m.beforeMobileMenuOpen];f instanceof Function&&f.call(this,e),(null===(c=null===(h=this.embedOptions.events)||void 0===h?void 0:h.viewer)||void 0===c?void 0:c.beforeMobileMenuOpen)instanceof Function&&(null===(u=null===(p=this.embedOptions.events)||void 0===p?void 0:p.viewer)||void 0===u||u.beforeMobileMenuOpen.call(this,e))}_onBoldBIAjaxBeforeLoad(e){const i=window[this.embedOptions.events.onAjaxStart];i instanceof Function&&i.call(this,e),this.embedOptions.events.onAjaxStart instanceof Function&&this.embedOptions.events.onAjaxStart.call(this,e)}_onBoldBIbeforeDesignerToolbarButtonsRendered(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.designer)||void 0===t?void 0:t.beforeToolbarButtonsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.designer)||void 0===o?void 0:o.beforeToolbarButtonsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.designer)||void 0===d||d.beforeToolbarButtonsRender.call(this,e))}_onBoldBIbeforeDatasourceToolbarButtonsRendered(e){var i,t,s,o,n,d;for(let i=e.toolbarButtons.length-1;i>=0;i--)e.toolbarButtons[`${i}`].elementId!=this.embedOptions.embedContainerId+"_embeddedbi_continue_dashboard_button"&&e.toolbarButtons[`${i}`].elementId!=this.embedOptions.embedContainerId+"_embeddedbi_editScheduleButton"||e.toolbarButtons.splice(i,1),this.isNewConnection||this.embedOptions.mode==BoldBI.Mode.Design||e.toolbarButtons[`${i}`].elementId==this.embedOptions.embedContainerId+"_embeddedbi_cancelButton"&&e.toolbarButtons.splice(i,1);this.isNewConnection=!1;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.beforeToolbarButtonsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.beforeToolbarButtonsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.beforeToolbarButtonsRender.call(this,e))}_onBoldBIbeforeDatasourceToolbarIconsRendered(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.datasource)||void 0===t?void 0:t.beforeToolbarIconsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.datasource)||void 0===o?void 0:o.beforeToolbarIconsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.datasource)||void 0===d||d.beforeToolbarIconsRender.call(this,e))}_onBoldBIbeforeDesignerToolbarIconsRendered(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.designer)||void 0===t?void 0:t.beforeToolbarIconsRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.designer)||void 0===o?void 0:o.beforeToolbarIconsRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.designer)||void 0===d||d.beforeToolbarIconsRender.call(this,e))}_onBoldBItoolbarClick(e){var i,t,s;const o=null===(i=this.embedOptions)||void 0===i?void 0:i.mode,n="design"===o?"designer":"datasource"===o?"datasource":null;if(!n)return;const d=null===(s=null===(t=this.embedOptions.events)||void 0===t?void 0:t[n])||void 0===s?void 0:s.onToolbarItemClick;if("string"==typeof d){const i=window[d];"function"==typeof i&&i.call(this,e)}"function"==typeof d&&d.call(this,e)}_onBoldBIbeforeWidgetItemsListed(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.designer)||void 0===t?void 0:t.beforeWidgetsListed];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.designer)||void 0===o?void 0:o.beforeWidgetsListed)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.designer)||void 0===d||d.beforeWidgetsListed.call(this,e))}_onBoldBIbeforeWidgetLayoutRender(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.beforeLayoutRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.beforeLayoutRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.beforeLayoutRender.call(this,e))}_onBoldBIDashboardWidgetIconClick(e){var i,t,s,o,n,d;const a=window[this.onWidgetIconClickFn];a instanceof Function&&a.call(this,e);const r=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.onToolbarItemClick];r instanceof Function&&r.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.onToolbarItemClick)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.onToolbarItemClick.call(this,e))}_onBoldBIonControlMenuClick(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.widget)||void 0===t?void 0:t.onToolbarItemClick];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.widget)||void 0===o?void 0:o.onToolbarItemClick)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.widget)||void 0===d||d.onToolbarItemClick.call(this,e))}_onBoldBIDashboardUpdatefavorite(e){const i=window[this.onFavoriteStateChangeFn];i instanceof Function&&i.call(this,e);const t=window[this.embedOptions.dashboardSettings.onFavoriteIconClick];t instanceof Function&&t.call(this,e),this.embedOptions.dashboardSettings.onFavoriteIconClick instanceof Function&&this.embedOptions.dashboardSettings.onFavoriteIconClick.call(this,e)}_onBoldBIBeforeNavigateUrlLinking(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.beforeUrlNavigation];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.beforeUrlNavigation)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.beforeUrlNavigation.call(this,e))}_onBoldBIBeforeViewdataIconRender(e){var i,t,s,o,n,d;const a=window[null===(t=null===(i=this.embedOptions.events)||void 0===i?void 0:i.viewer)||void 0===t?void 0:t.beforeViewDataRender];a instanceof Function&&a.call(this,e),(null===(o=null===(s=this.embedOptions.events)||void 0===s?void 0:s.viewer)||void 0===o?void 0:o.beforeViewDataRender)instanceof Function&&(null===(d=null===(n=this.embedOptions.events)||void 0===n?void 0:n.viewer)||void 0===d||d.beforeViewDataRender.call(this,e))}_onBoldBIBeforeNavigateToDashboard(e){const i=window[this.embedOptions.beforeNavigateToDashboard];i instanceof Function&&i.call(this,e),this.embedOptions.beforeNavigateToDashboard instanceof Function&&this.embedOptions.beforeNavigateToDashboard.call(this,e)}_onBoldBIAuthorizionComplete(e){const i=window[this.embedOptions.authorizationServer.authorizionComplete];i instanceof Function&&i.call(this,e),this.embedOptions.authorizationServer.authorizionComplete instanceof Function&&this.embedOptions.authorizationServer.authorizionComplete.call(this,e)}_showLoader(e){this.isMultipleWidgetMode&&(this.embedOptions.embedContainerId=e);const i=this.embedOptions.embedContainerId,t=`\n        #${i} .viewer-blue-loader { display: block !important; }\n        #${i} .loader-icon { display: block; left: 0 !important; position: relative; margin: 0 auto; width: 54px; height: 54px; }\n        #${i} .loader-icon .circular { animation: rotate 2s linear infinite; height: 54px; width: 54px; position: relative; }\n        #${i} .loader-icon .path { stroke-dasharray: 1,200; stroke-dashoffset: 0; animation: dash 1.5s ease-in-out infinite; stroke: #5592FB; stroke-linecap: square; }\n        @keyframes rotate { 100% { transform: rotate(360deg); } }\n        @keyframes dash {\n            0% { stroke-dasharray: 1,200; stroke-dashoffset: 0; }\n            50% { stroke-dasharray: 89,200; stroke-dashoffset: -35; }\n            100% { stroke-dasharray: 89,200; stroke-dashoffset: -124; }\n        }\n        `;if(![...document.head.querySelectorAll("style")].some((e=>e.innerHTML.includes(`#${i} .viewer-blue-loader`)))){const e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e)}const s='<div class="preloader-wrap viewer-blue-loader" style="display: none; width: '+this.embedOptions.width+";height: "+this.embedOptions.height+'; top: 0; bottom: 0; z-index : 2;"> <div id="loader_image" align="center" style="position:relative;top:45%;"> <div class="loader-blue loader-icon" id="loader-icon"> <svg class="circular"> <circle class="path" cx="27" cy="27" r="20" fill="none" stroke-width="4" stroke-miterlimit="10"></circle> </svg> </div> </div> </div>';this._removeElement("embedded-bi-error"),document.getElementById(this.embedOptions.embedContainerId).insertAdjacentHTML("afterbegin",s)}_xhrRequestHelper(e,i,t,s,o){const n=this,d=new XMLHttpRequest;d.open(e,i,!0),d.responseType="json",d.setRequestHeader("Content-type","application/json");for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&d.setRequestHeader(e,s[`${e}`]);d.onreadystatechange=function(){if(4==d.readyState&&200==d.status){const e="object"==typeof d.response?d.response:JSON.parse(d.response);n._authorizeResponse=e,o.call(n,e)}else 4==d.readyState&&404==d.status?n._throwError(embeddingLocalization_1.errorMessages.ServerNotFound):4==d.readyState&&n._throwError(d.statusText)},d.send(JSON.stringify(t))}_emptyHtml(e){document.getElementById(e).innerHTML=""}_removeElement(e){const i=document.getElementById(e);null!=i&&i.parentNode.removeChild(i)}_uuidv4Generator(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const i=16*Math.random()|0;return("x"==e?i:3&i|8).toString(16)}))}_isEmptyOrSpaces(e){return void 0===e||null==e||null!=e.match(/^ *$/)}_isNullOrUndefined(e){return null==e||null==e}_isUrl(e){let i;try{i=new URL(e)}catch(e){return!1}return"http:"==i.protocol||"https:"==i.protocol}_throwError(e,i){var t,s,o,n,d,a,r,l;i=this._isEmptyOrSpaces(i)?this.embedOptions.embedContainerId:i;const b=!("boolean"==typeof this.embedOptions.hideErrorMessage?this.embedOptions.hideErrorMessage:null!==(s=null===(t=this.embedOptions.settings)||void 0===t?void 0:t.hideErrorMessage)&&void 0!==s&&s);if(i){e&&"string"==typeof e?e=e.replace(/^BoldBI Embedded:\s*/,""):e&&"string"==typeof e.message&&(e=e.message.replace(/^BoldBI Embedded:\s*/,""));const t=(null===(d=null===(n=null===(o=this.embedOptions)||void 0===o?void 0:o.settings)||void 0===n?void 0:n.brand)||void 0===d?void 0:d.name)?this.embedOptions.settings.brand.name:"BoldBI Embedded";if(this._removeElementsClass(i,".preloader-wrap","viewer-blue-loader"),b){const s='<div id="embedded-bi-error" style="display:table;height:100%;width:100%;"><div style="display: table-cell;vertical-align: middle;text-align: center;"><div style="display: inline-block;"><img src='+this.errorImage+' style="float: left"/><div style="float: left;margin-left: 10px;line-height: 20px;">'+t+":"+e+"</div></div>",o=document.getElementById(i);o&&(o.innerHTML=s)}}else b&&alert(e);if(this._isNullOrUndefined(this.embedOptions.events.onError)||""==this.embedOptions.events.onError)throw new Error(embeddingLocalization_1.errorMessages.BoldBIEmbedded+e);{const i=(null===(l=null===(r=null===(a=this.embedOptions)||void 0===a?void 0:a.settings)||void 0===r?void 0:r.brand)||void 0===l?void 0:l.name)?new Error(this.embedOptions.settings.brand.name+":"+e):new Error(embeddingLocalization_1.errorMessages.BoldBIEmbedded+e);this.onErrorClient(i)}}onErrorClient(e){const i={errorStatus:!0,StatusMessage:e,StatusCode:500},t=window[this.embedOptions.events.onError];t instanceof Function&&t.call(this,i),this.embedOptions.events.onError instanceof Function&&this.embedOptions.events.onError.call(this,i)}_removeElementsClass(e,i,t){let s=[];if(this._isEmptyOrSpaces(e))s=document.querySelector(i);else if(this._isEmptyOrSpaces(i))s.push(document.getElementById(e));else{const t=document.getElementById(e);s=t?t.querySelectorAll(i):[]}s.forEach(function(e){this._removeClass(e,t)}.bind(this))}_hasClass(e,i){if(e.classList)return e.classList.contains(i);const t=RegExp;return!!e.className.match(new t("(\\s|^)"+i+"(\\s|$)"))}_addClass(e,i){e.classList?e.classList.add(i):this._hasClass(e,i)||(e.className+=" "+i)}_removeClass(e,i){if(e.classList)e.classList.remove(i);else if(this._hasClass(e,i)){const t=new RegExp("(\\s|^)"+i+"(\\s|$)");e.className=e.className.replace(t," ")}}_arraySlice(e,i,t){return e.forEach(function(e,s,o){e[`${i}`]==t&&o.splice(s,1)}.bind(this)),e}_getFilterData(e){const i={masterData:[]},t=decodeURI(e).replace(/~&~/g,String.fromCharCode(251)+String.fromCharCode(251)).replace(/~=~/g,String.fromCharCode(250)+String.fromCharCode(250)).replace(/~[?]~/g,String.fromCharCode(253)+String.fromCharCode(253)).replace(/~[/]~/g,String.fromCharCode(254)+String.fromCharCode(254)).replace(/&&/g,"&").replace(/&/g,"|,|").replace(/=/g,"|:|").replace(/~,~/g,String.fromCharCode(252)+String.fromCharCode(252)).split("|,|");for(let e=0;e<t.length;e++){const s=t[`${e}`].split("|:|");if(s.length>=2&&"FILTERQUERY"==s[0].trim().toUpperCase()){const e=s[1],t=bbEmbed.parseJSON(e);""!=t&&0!=t.length&&(i.masterData=this._lengthensSelectedFilterInfo(t),this._unEscapeSelectedFilterDataforURLFilter(i.masterData))}else;}return this._createFilterCollection(i.masterData)}_createFilterCollection(e){if(e){const i=[];return e.forEach(function(e){let t=e.ColumnName,s=[];e.InitialDateFilter.DisplayDateFilterList.length>0&&(s=e.InitialDateFilter.DisplayDateFilterList,e.IsRange&&(s=[s[0]+" - "+s[1]])),e.InitialMeasureFilter.Values.length>0&&(s=e.InitialMeasureFilter.Values),e.InitialDimensionFilter.Text.length>0&&(s=e.InitialDimensionFilter.Text,t=t+" ("+e.InitialDimensionFilter.DimesnionFilterCondition+")"),e.InitialDimensionFilter.Text.length>0&&(s=e.InitialDimensionFilter.Text),i.push({ColumnName:t,Values:s})}.bind(this)),i}}_lengthensSelectedFilterInfo(e){const i=[],t=e.length;for(let s=0;s<t;s++){const t=e[`${s}`],o=new SelectedFilterValue;this._hasValue(t,shortenEnum.UniqueColumnName)&&(o[lengthenEnum.UniqueColumnName]=t[shortenEnum.UniqueColumnName]),this._hasValue(t,shortenEnum.ReportName)&&(o[lengthenEnum.ReportName]=t[shortenEnum.ReportName]),this._hasValue(t,shortenEnum.IsStdDateTime)&&(o[lengthenEnum.IsStdDateTime]=t[shortenEnum.IsStdDateTime]),this._hasValue(t,shortenEnum.IsRange)&&(o[lengthenEnum.IsRange]=t[shortenEnum.IsRange]),this._hasValue(t,shortenEnum.IsGroupBarFilter)&&(o[lengthenEnum.IsGroupBarFilter]=t[shortenEnum.IsGroupBarFilter]),this._hasValue(t,shortenEnum.IsMultiSelection)&&(o[lengthenEnum.IsMultiSelection]=t[shortenEnum.IsMultiSelection]),this._hasValue(t,shortenEnum.ColumnName)&&(o[lengthenEnum.ColumnName]=t[shortenEnum.ColumnName]),this._hasValue(t,shortenEnum.FieldId)&&(o[lengthenEnum.FieldId]=t[shortenEnum.FieldId]),this._hasValue(t,shortenEnum.IsPoPWidget)&&(o[lengthenEnum.IsPoPWidget]=t[shortenEnum.IsPoPWidget]),this._hasValue(t,shortenEnum.InitialDateFilter)&&(this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFilterCondition)&&(o.InitialDateFilter[lengthenEnum.DateFilterCondition]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFilterCondition]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFilterList)&&(o.InitialDateFilter[lengthenEnum.DateFilterList]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFilterList]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFilterType)&&(o.InitialDateFilter[lengthenEnum.DateFilterType]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFilterType]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DisplayDateFilterList)&&(o.InitialDateFilter[lengthenEnum.DisplayDateFilterList]=t[shortenEnum.InitialDateFilter][shortenEnum.DisplayDateFilterList]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.DateFormat)&&(o.InitialDateFilter[lengthenEnum.DateFormat]=t[shortenEnum.InitialDateFilter][shortenEnum.DateFormat]),this._hasValue(t[shortenEnum.InitialDateFilter],shortenEnum.SelectedRangeforRelativeFilter)&&(o.InitialDateFilter[lengthenEnum.SelectedRangeforRelativeFilter]=t[shortenEnum.InitialDateFilter][shortenEnum.SelectedRangeforRelativeFilter])),this._hasValue(t,shortenEnum.InitialDimensionFilter)&&(this._hasValue(t[shortenEnum.InitialDimensionFilter],shortenEnum.DimesnionFilterCondition)&&(o.InitialDimensionFilter[lengthenEnum.DimesnionFilterCondition]=t[shortenEnum.InitialDimensionFilter][shortenEnum.DimesnionFilterCondition]),this._hasValue(t[shortenEnum.InitialDimensionFilter],shortenEnum.Text)&&(o.InitialDimensionFilter[lengthenEnum.Text]=t[shortenEnum.InitialDimensionFilter][shortenEnum.Text])),this._hasValue(t,shortenEnum.InitialMeasureFilter)&&(this._hasValue(t[shortenEnum.InitialMeasureFilter],shortenEnum.MeasureFilterCondition)&&(o.InitialMeasureFilter[lengthenEnum.MeasureFilterCondition]=t[shortenEnum.InitialMeasureFilter][shortenEnum.MeasureFilterCondition]),this._hasValue(t[shortenEnum.InitialMeasureFilter],shortenEnum.Values)&&(o.InitialMeasureFilter[lengthenEnum.Values]=t[shortenEnum.InitialMeasureFilter][shortenEnum.Values])),this._hasValue(t,shortenEnum.PoPFilter)&&(this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.DateFieldId)&&(o.PoPFilter[lengthenEnum.DateFieldId]=t[shortenEnum.PoPFilter][shortenEnum.DateFieldId]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.PrimaryType)&&(o.PoPFilter[lengthenEnum.PrimaryType]=t[shortenEnum.PoPFilter][shortenEnum.PrimaryType]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.SecondaryType)&&(o.PoPFilter[lengthenEnum.SecondaryType]=t[shortenEnum.PoPFilter][shortenEnum.SecondaryType]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.PrimaryCustomRange)&&(o.PoPFilter[lengthenEnum.PrimaryCustomRange][lengthenEnum.StartRange]=t[shortenEnum.PoPFilter][shortenEnum.PrimaryCustomRange][shortenEnum.StartRange],o.PoPFilter[lengthenEnum.PrimaryCustomRange][lengthenEnum.EndRange]=t[shortenEnum.PoPFilter][shortenEnum.PrimaryCustomRange][shortenEnum.EndRange]),this._hasValue(t[shortenEnum.PoPFilter],shortenEnum.SecondaryCustomRange)&&t[shortenEnum.PoPFilter][shortenEnum.SecondaryCustomRange].length>0&&(o.PoPFilter[lengthenEnum.SecondaryCustomRange][0][lengthenEnum.StartRange]=t[shortenEnum.PoPFilter][shortenEnum.SecondaryCustomRange][0][shortenEnum.StartRange],o.PoPFilter[lengthenEnum.SecondaryCustomRange][0][lengthenEnum.EndRange]=t[shortenEnum.PoPFilter][shortenEnum.SecondaryCustomRange][0][shortenEnum.EndRange])),this._hasValue(o,lengthenEnum.UniqueColumnName)&&this._hasValue(o,lengthenEnum.ReportName)&&i.push(o)}return i}_hasValue(e,i){return!this._isNullOrUndefined(e)&&!this._isNullOrUndefined(e[`${i}`])}_unEscapeSelectedFilterDataforURLFilter(e){for(let i=0;i<e.length;i++){const t=e[`${i}`];if(!this._isNullOrUndefined(t.InitialDimensionFilter.Text)&&0!=t.InitialDimensionFilter.Text.length)for(let e=0;e<t.InitialDimensionFilter.Text.length;e++)t.InitialDimensionFilter.Text[`${e}`]=t.InitialDimensionFilter.Text[`${e}`].replaceAll(String.fromCharCode(252)+String.fromCharCode(252),",").replaceAll(String.fromCharCode(251)+String.fromCharCode(251),"&").replaceAll(String.fromCharCode(250)+String.fromCharCode(250),"=").replaceAll(String.fromCharCode(253)+String.fromCharCode(253),"?").replaceAll(String.fromCharCode(254)+String.fromCharCode(254),"/")}return e}_getWidgetFilterInfo(){const e=this._widgetsCollection,i=[];if(1==Array.isArray(e))for(let t=0;t<e.length;t++){let s=BoldBI._gettinstance(document.getElementById(this.embedOptions.embedContainerId),"embeddedBoldBIWidget_"+e[`${t}`]);s=Array.isArray(s)?s:[s];const o=[];let n;for(let e=0;e<s.length;e++)n=s[`${e}`].includes("=")?{columnName:s[`${e}`].split("=")[0].toString(),values:s[`${e}`].split("=")[1].split(",")}:{values:s},o[o.length]=n;const d={id:e[`${t}`],filters:o};i[i.length]=d}return i}_multipleWidgets(e,...i){const t=this._getDashboardInstance();if(!this._isNullOrUndefined(t)){var s=t.loadMultipleWidget.multipleWidgetInstanceCollection;for(let t=0;t<s.length;t++){const o=s[t].currentInstance;if("widgets"==e)s[t].widgetId==i[0][0].id&&(o.model[e]=[],o.option(e,...i));else if("exportWidgetAsCsv"!=e&&"exportWidgetAsImage"!=e&&"exportWidgetAsExcel"!=e&&"exportWidgetAsPdf"!=e)"function"==typeof o[e]?o[e](...i):(o.model[e]="",o.option(e,...i));else if(s[t].widgetId==i[0]&&"function"==typeof o[e]){const t=i.slice(1);o[e](...t)}}}}applyStyles(){this.deprecated=!1,this.addStyles()}addStyles(){this.deprecationMessage("addStyles");this._loadDepedentFiles()}removeStyles(){this.deprecated=!1,this.destroyStyles()}destroyStyles(){this.deprecationMessage("destroyStyles");const e=this;document.querySelectorAll("link").forEach((function(i){e.cssFiles.forEach((function(e){-1!=i.href.toLowerCase().indexOf(e.toLowerCase())&&i.parentNode.removeChild(i)}))}))}_validatetoken(e){const i=e||this.authToken;return this._isJwtFormat(i)?`bearer ${i}`:`basic ${i}`}_isJwtFormat(e){return/^[A-Za-z0-9-_=]+?\.[A-Za-z0-9-_=]+?\.[A-Za-z0-9-_.+/=]*$/.test(e)}removeWidgetInstance(e){this.deprecationMessage("removeWidgetInstance");const i=document.getElementById(this.embedOptions.embedContainerId);BoldBI._removewidgetinstance(i,"embeddedBoldBIWidget_"+e),this._widgetsCollection=this._widgetsCollection.filter((i=>i!==e))}static _putinstance(e,i,t){BoldBI._storage.has(e)||BoldBI._storage.set(e,new Map),BoldBI._storage.get(e).set(i,t)}static _gettinstance(e,i){if(BoldBI._storage.has(e))return BoldBI._storage.get(e).get(i)}static _hasinstance(e,i){return BoldBI._storage.has(e)&&BoldBI._storage.get(e).has(i)}static _removeinstance(e,i){if(BoldBI._storage.has(e)){const t=BoldBI._storage.get(e).delete(i);return 0!=BoldBI._storage.get(e).size&&BoldBI._storage.delete(e),t}}static _removewidgetinstance(e,i){if(BoldBI._storage.has(e)){return BoldBI._storage.get(e).delete(i)}}}exports.BoldBI=BoldBI,BoldBI.Mode=enum_1.Mode,BoldBI.EmbedType=enum_1.EmbedType,BoldBI.Environment=enum_1.Environment,BoldBI.Theme=enum_1.Theme,BoldBI._storage=new WeakMap,BoldBI._widgetsCollection=[];class widgetBI{constructor(){this.containerID="",this.widgetCollection=[],this.deprecated=!0}setFilterParameters(e){this.deprecated&&((0,sdk_deprecation_utils_1.deprecatedMethod)("setFilterParameters"),this.deprecated=!0);const i=this.widgetCollection;1==Array.isArray(i)&&BoldBI._hasinstance(document.getElementById(this.containerID),"embeddedBoldBIWidget_"+i[i.length-1])&&BoldBI._putinstance(document.getElementById(this.containerID),"embeddedBoldBIWidget_"+i[i.length-1],e)}setFilters(e){this.deprecated=!1,this.setFilterParameters(e)}}exports.widgetBI=widgetBI;
//# sourceMappingURL=/sm/3bdbbe110890b4f044ff526f28279e0dfaa7289d6dea0aacd160a7775f5de7b2.map