@pronto-tools-and-more/files 10.50.0 → 10.52.0
Sign up to get free protection for your applications and to get access to all the features.
- package/files/framework/src/default/storefront/buildInfo.json +4 -4
- package/files/framework/src/default/storefront/deep-link-landing/purple-deep-link-landing.js +7 -7
- package/files/framework/src/default/storefront/index.html +3 -3
- package/files/framework/src/default/storefront/modules/common.js +1 -1
- package/files/framework/src/default/storefront/modules/default-projects_storefront_src_app_component_content_content_module_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/default-projects_storefront_src_app_component_issue_issue_module_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/default-projects_storefront_src_app_service_tts_tts_service_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/main.js +1 -1
- package/files/framework/src/default/storefront/modules/projects_storefront_src_app_common-pipes_common-pipes_module_ts-projects_storefront_src_app_c-94b9b6.js +1 -1
- package/files/framework/src/default/storefront/modules/projects_storefront_src_app_component_app-menu-xml_app-menu-xml_module_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/projects_storefront_src_app_component_catalog-content_content-body_content-body_module_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/projects_storefront_src_app_component_iframe_iframe_module_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/projects_storefront_src_app_component_issue-search-result_issue-search-result_module_ts.js +1 -1
- package/files/framework/src/default/storefront/modules/projects_storefront_src_app_component_web-presenter_presenter_presenter_module_ts.js +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunkstorefront=self.webpackChunkstorefront||[]).push([["default-projects_storefront_src_app_component_issue_issue_module_ts","projects_storefront_src_app_common-pipes_common-pipes_module_ts-projects_storefront_src_app_c-94b9b6"],{4767:(k,C,r)=>{r.d(C,{d:()=>e});var a=r(177),c=r(3953);let e=(()=>{var _;class I{}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275mod=c.$C({type:_}),_.\u0275inj=c.G2t({imports:[a.MD]}),I})()},2914:(k,C,r)=>{r.d(C,{w:()=>I});var a=r(4049),c=r(7370),e=r(3953),_=r(9516);let I=(()=>{var h;class b{constructor(p){this.contextService=p}transform(p,m){if(!p||(0,c.vh)(p))return p;let O=p?(0,a.K)(p,m):"";const D=this.contextService.getIsCustomerDomainUsed()?"":"/".concat(this.contextService.getBrand(),"/"),E=new URL(window.location.href),g="true"===E.searchParams.get("preview")||0===E.pathname.indexOf("/preview");return"/"===O&&(O=""),O="".concat(D).concat(O).concat(g?"?preview=true":""),O}}return(h=b).\u0275fac=function(p){return new(p||h)(e.rXU(_.V,16))},h.\u0275pipe=e.EJ8({name:"urlTransform",type:h,pure:!0}),h.\u0275prov=e.jDH({token:h,factory:h.\u0275fac,providedIn:"root"}),b})()},2932:(k,C,r)=>{r.d(C,{h:()=>D,q:()=>E});var a=r(177),c=r(3953),e=r(8251),_=r(8890),I=r(9876),h=r(345),b=r(4748),y=r(9516),p=r(5102);const m=["image"];function O(g,L){if(1&g){const T=c.RV6();c.j41(0,"img",2,0),c.bIt("error",function(){c.eBV(T);const f=c.XpG();return c.Njj(f.onError())}),c.k0s()}if(2&g){const T=c.XpG();c.Y8G("priority",T.lcpPrioritized())("ngSrc",T.safeResizeSrc)("alt",T.alt)("title",T.title),c.BMQ("aria-label",T.ariaLabel)}}let D=(()=>{var g;class L{set image(d){d&&this.onLoad(d),this._image=d}get image(){return this._image}constructor(d,f,P,G,j,X,S,B){this.sanitizer=d,this.changeDetectorRef=f,this.elementRef=P,this.subscriptions=G,this.platformId=j,this.ssrService=X,this.contextService=S,this.purpleService=B,this.lcpPrioritized=(0,c.hFB)(!1),this.error=new c.bkB,this.height=E.AUTO}get empty(){return!this.src}ngOnInit(){this.initProperties(),(0,a.UE)(this.platformId)&&this.subscriptions.subscribe((0,_.eh)(this,this.elementRef,{skipWait:!1}),d=>this.load())}initProperties(){var d,f,P,G;this.alt=(null===(d=this.extendedThumbnail)||void 0===d?void 0:d.properties.alt)||(null===(f=this.extendedThumbnail)||void 0===f?void 0:f.properties.caption)||"",this.title=this.alt,this.ariaLabel=null!==(P=this.label)&&void 0!==P?P:this.alt,this.focalPoint=null===(G=this.extendedThumbnail)||void 0===G?void 0:G.properties.focuspoint}initAndLoad(){this.initProperties(),this.load()}load(){this.loaded||(this.loaded=!0,this.src&&this.update(),this.changeDetectorRef.detectChanges())}ngOnChanges(d){d.src&&this.loaded&&this.update()}update(){this.updateImageRatio(),this.updateResizeSrc()}onLoad(d){d.nativeElement.classList.add("loaded"),this.elementRef.nativeElement.classList.add("loaded"),this.changeDetectorRef.detectChanges(),d.nativeElement.addEventListener("load",()=>{this.updateImageRatio(!0,d),this.changeDetectorRef.markForCheck()}),d.nativeElement.addEventListener("error",function(){d.nativeElement.style.display="none",d.nativeElement.nextElementSibling&&(d.nativeElement.nextElementSibling.style.display="inline")}),this.purpleService.addImageSrc(this.resizeSrc)}onError(){if(!this.safeResizeSrc)return;const d=this.purpleService.getAlternativeSrc(this.src);var f;d&&d!==this.resizeSrc?(this.setResizeSrc(d),this.changeDetectorRef.detectChanges()):(null===(f=this.image)||void 0===f||f.nativeElement.classList.add("error"),this.elementRef.nativeElement.classList.add("error"),this.error.emit(this))}updateImageRatio(d=!1,f=this.image){this.imageRatio=this.height===E.AUTO?(0,I.z)(!d,null==f?void 0:f.nativeElement,this.src)+"%":void 0}updateResizeSrc(){this.setResizeSrc((0,I.G)(this.elementRef.nativeElement,this.src,this.imageResolutionStrategy,this.focalPoint)),this.changeDetectorRef.detectChanges()}setResizeSrc(d){const f=this.contextService.toResourceUrl(d);this.resizeSrc=f,this.safeResizeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(f)}}return(g=L).\u0275fac=function(d){return new(d||g)(c.rXU(h.up),c.rXU(c.gRc),c.rXU(c.aKT),c.rXU(e.v),c.rXU(c.Agw),c.rXU(b.i),c.rXU(y.V),c.rXU(p.Wj))},g.\u0275cmp=c.VBU({type:g,selectors:[["storefront-image"]],viewQuery:function(d,f){if(1&d&&c.GBs(m,5),2&d){let P;c.mGM(P=c.lsd())&&(f.image=P.first)}},hostAttrs:["ngSkipHydration","true"],hostVars:12,hostBindings:function(d,f){2&d&&(c.BMQ("src",f.src)("label",f.label)("resolution-strategy",f.imageResolutionStrategy)("alt",f.alt)("title",f.title)("aria-label",f.ariaLabel)("focal-point",f.focalPoint)("height-strategy",f.height),c.xc7("padding-top",f.imageRatio),c.AVh("empty",f.empty))},inputs:{src:"src",label:"label",extendedThumbnail:"extendedThumbnail",imageResolutionStrategy:"imageResolutionStrategy",lcpPrioritized:[1,"lcpPrioritized"],height:"height"},outputs:{error:"error"},features:[c.Jv_([e.v]),c.OA$],decls:1,vars:1,consts:[["image",""],["fill","true",3,"priority","ngSrc","alt","title","error",4,"ngIf"],["fill","true",3,"error","priority","ngSrc","alt","title"]],template:function(d,f){1&d&&c.DNE(0,O,2,5,"img",1),2&d&&c.Y8G("ngIf",f.loaded&&f.src)},dependencies:[a.bT,a.kt],styles:["storefront-image{display:flex;justify-content:center;align-items:center;position:relative;background-color:var(--imageLoadingColor);transition:.2s background-color ease-in}storefront-image[height-strategy=FIXED]>img,storefront-image[height-strategy=AUTO]>img{position:absolute;width:auto;max-width:100%;top:0;object-fit:contain}storefront-image[height-strategy=DEFAULT]>img{position:static!important}storefront-image.img-with-hidden-alt{content:attr(data-alt);display:none}storefront-image>img{display:block;transition:opacity .2s ease-in,background-color .2s ease-in;background-color:#fff0;max-width:100%;max-height:100%;opacity:0}storefront-image>img.loaded{opacity:1;background-color:var(--imageBackgroundColor)}storefront-image.loaded{background:#fff0}\n"],encapsulation:2,changeDetection:0}),L})();var E=function(g){return g.AUTO="AUTO",g.FIXED="FIXED",g.DEFAULT="DEFAULT",g}(E||{})},4403:(k,C,r)=>{r.d(C,{U:()=>e});var a=r(177),c=r(3953);let e=(()=>{var _;class I{}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275mod=c.$C({type:_}),_.\u0275inj=c.G2t({imports:[a.MD]}),I})()},4744:(k,C,r)=>{r.d(C,{z:()=>Rt});var a=r(467),c=r(177),e=r(3953),_=r(4404),h=r(362),y=r(4412),p=r(5964),m=r(6354),O=r(6697),D=r(6843),E=r(4452),g=r(8179),L=r(5102),T=r(9745),d=r(4945),f=r(8251),P=r(4004),G=r(4622),j=r(1739),X=r(610),S=r(3178),B=r(5706),w=r(8091),N=r(7879),H=r(8890),z=r(1210),W=r(2932),Y=r(3092),M=r(4365),Z=r(20),Q=r(8004),J=r(9516),q=r(244),ee=r(6889),te=r(1652),se=r(5820),ne=r(4748),oe=r(680),ie=r(8909),re=r(7240),ae=r(6600),le=r(395),ce=r(2914),_e=r(2813);const K=o=>[o],ue=o=>({path:o}),pe=()=>({path:""}),ge=()=>[];function de(o,l){if(1&o){const n=e.RV6();e.j41(0,"div",10),e.nrm(1,"span",11),e.j41(2,"button",12),e.bIt("click",function(){e.eBV(n);const t=e.XpG(2);return e.Njj(t.reload())}),e.k0s()()}if(2&o){const n=e.XpG(2);e.R7$(),e.Y8G("storefrontTranslateArgs",e.eq3(1,K,n.dataSourceError.code))}}function fe(o,l){if(1&o&&(e.qex(0),e.j41(1,"div",4),e.nrm(2,"storefront-image",5),e.k0s(),e.j41(3,"div",6),e.nrm(4,"h3",7)(5,"div",8),e.k0s(),e.DNE(6,de,3,3,"div",9),e.bVm()),2&o){const n=e.XpG();e.R7$(2),e.Y8G("height","FIXED"),e.R7$(4),e.Y8G("ngIf",n.dataSourceError)}}function me(o,l){1&o&&e.eu8(0)}function he(o,l){if(1&o){const n=e.RV6();e.j41(0,"a",16),e.nI1(1,"urlTransform"),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.DNE(2,me,1,0,"ng-container",17),e.k0s()}if(2&o){const n=e.XpG().ngIf;e.XpG();const s=e.sdS(6),t=e.XpG();e.Y8G("href",e.i5U(1,2,n,t.context),e.B4B),e.R7$(2),e.Y8G("ngTemplateOutlet",s)}}function Ee(o,l){1&o&&e.eu8(0)}function ve(o,l){if(1&o){const n=e.RV6();e.j41(0,"a",18),e.nI1(1,"urlTransform"),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickIssue(t))}),e.DNE(2,Ee,1,0,"ng-container",19),e.k0s()}if(2&o){const n=e.XpG().ngIf;e.XpG();const s=e.sdS(8),t=e.XpG();e.AVh("expanded",t.descriptionExpanded),e.Y8G("href",e.i5U(1,5,n,t.context),e.B4B),e.R7$(2),e.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",e.eq3(8,ue,n))}}function Ie(o,l){if(1&o&&(e.qex(0),e.DNE(1,he,3,5,"a",14)(2,ve,3,10,"a",15),e.bVm()),2&o){const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.cover),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.allData)}}function Ce(o,l){1&o&&e.eu8(0)}function be(o,l){if(1&o){const n=e.RV6();e.j41(0,"div",22),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.DNE(1,Ce,1,0,"ng-container",17),e.k0s()}if(2&o){e.XpG(2);const n=e.sdS(6);e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function Te(o,l){if(1&o){const n=e.RV6();e.j41(0,"div",23),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickIssue(t))}),e.eu8(1,24),e.k0s()}if(2&o){e.XpG(2);const n=e.sdS(8),s=e.XpG();e.AVh("expanded",s.descriptionExpanded),e.R7$(),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.lJ4(4,pe))}}function De(o,l){if(1&o&&e.DNE(0,be,2,1,"div",20)(1,Te,2,5,"div",21),2&o){const n=e.XpG(2);e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.cover),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.allData)}}function Oe(o,l){1&o&&e.nrm(0,"storefront-spinner")}function Re(o,l){1&o&&(e.j41(0,"div",28),e.nrm(1,"span",29),e.k0s())}function xe(o,l){if(1&o&&e.nrm(0,"storefront-progress",30),2&o){const n=e.XpG(3);e.Y8G("type",n.getProgressType())("progress",n.installState.progress)}}function Ae(o,l){if(1&o&&(e.nrm(0,"storefront-image",25),e.DNE(1,Oe,1,0,"storefront-spinner",3)(2,Re,2,0,"div",26)(3,xe,1,2,"storefront-progress",27)),2&o){const n=e.XpG(2);e.Y8G("lcpPrioritized",0===(null==n.context?null:n.context.entryIndex)&&(null==n.config?null:n.config.lcpPrioritized))("src",n.issue.thumbnails&&n.issue.thumbnails.default)("imageResolutionStrategy",null==n.config?null:n.config.imageResolutionStrategy)("height",n.getImageHeight())("extendedThumbnail",null==n.issue||null==n.issue.thumbnailsExtended?null:n.issue.thumbnailsExtended.default)("label",null==n.issue?null:n.issue.name),e.R7$(),e.Y8G("ngIf",n.coverLoading),e.R7$(),e.Y8G("ngIf",n.showUpdateBehavior()),e.R7$(),e.Y8G("ngIf",n.showProgress())}}function ye(o,l){if(1&o){const n=e.RV6();e.j41(0,"h3",46),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.nrm(1,"span",47),e.k0s()}if(2&o){const n=e.XpG(3);e.R7$(),e.Y8G("storefrontTranslate",n.config.publicationTitleMessage)("storefrontTranslateArgs",e.eq3(2,K,n.publication&&n.publication.name))}}function Pe(o,l){if(1&o){const n=e.RV6();e.j41(0,"h3",48),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.nrm(1,"span",47),e.k0s()}if(2&o){const n=e.XpG(3);e.R7$(),e.Y8G("storefrontTranslate",n.config.titleMessage)("storefrontTranslateArgs",e.eq3(2,K,n.issue.name))}}function Se(o,l){1&o&&e.nrm(0,"i",49)}function ke(o,l){if(1&o&&(e.j41(0,"div",50),e.EFF(1),e.nI1(2,"storefrontDate"),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,n.issue.publicationDate)," ")}}function Le(o,l){if(1&o&&e.nrm(0,"div",51),2&o){const n=e.XpG(3);e.Y8G("storefrontTranslate",n.config.descriptionMessage)("storefrontTranslateArgs",e.eq3(2,K,n.issue.description))}}function Me(o,l){if(1&o){const n=e.RV6();e.j41(0,"span",52),e.bIt("click",function(){e.eBV(n);const t=e.XpG(3);return e.Njj(t.descriptionExpanded=!t.descriptionExpanded)}),e.nrm(1,"span",53)(2,"i",54),e.k0s()}if(2&o){const n=e.XpG(3);e.R7$(),e.Y8G("storefrontTranslate",n.descriptionExpanded?"ISSUE_DESCRIPTION_TOGGLE_COLLAPSE":"ISSUE_DESCRIPTION_TOGGLE_EXPAND")}}function Ue(o,l){if(1&o&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.nrm(3,"i"),e.k0s()),2&o){const n=l.$implicit;e.ZWY("issue-property issue-property-",n.key," issue-property-",n.key,"-",n.value,""),e.R7$(2),e.JRh(n.value),e.R7$(),e.ee0("'icon icon-",n.key," icon-",n.value," icon-",n.key,"-",n.value,"")}}function Be(o,l){if(1&o&&(e.j41(0,"div",55),e.DNE(1,Ue,4,12,"div",56),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.visibleProperties)("ngForTrackBy",n.trackByProperty)}}function Ge(o,l){if(1&o&&(e.j41(0,"div",59)(1,"span"),e.EFF(2),e.k0s(),e.nrm(3,"i"),e.k0s()),2&o){const n=l.$implicit;e.ZvI("issue-category issue-category-",n.id,""),e.R7$(2),e.JRh(n.name||n.id),e.R7$(),e.ZvI("icon icon-",n.id,"")}}function we(o,l){if(1&o&&(e.j41(0,"div",57),e.DNE(1,Ge,4,7,"div",58),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.displayedCategories)("ngForTrackBy",n.trackByCategory)}}function Ne(o,l){if(1&o&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.nrm(3,"i"),e.k0s()),2&o){const n=l.$implicit;e.ZvI("issue-tag issue-tag-",n,""),e.R7$(2),e.JRh(n),e.R7$(),e.ZvI("icon icon-",n,"")}}function Ke(o,l){if(1&o&&(e.j41(0,"div",60),e.DNE(1,Ne,4,7,"div",56),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.tags)("ngForTrackBy",n.trackByTag)}}function $e(o,l){if(1&o&&e.nrm(0,"div",47),2&o){const n=l.$implicit;e.ZvI("issue-custom-message ",n.class||"",""),e.Y8G("storefrontTranslate",n.message)("storefrontTranslateArgs",n.variables||e.lJ4(5,ge))}}function je(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",61),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickShare(t))}),e.k0s()}}function Xe(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",62),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickBookmark(t))}),e.k0s()}if(2&o){const n=e.XpG(3);e.ZvI("icon ",n.bookmark?"icon-bookmark-active":"icon-bookmark","")}}function We(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Ye(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",65),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickRead(t))}),e.nrm(1,"span",66),e.DNE(2,We,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.openLoading),e.R7$(2),e.Y8G("ngIf",n.openLoading)}}function Fe(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Ve(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",69),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickPreview(t))}),e.nrm(1,"span",70),e.DNE(2,Fe,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.previewLoading),e.R7$(2),e.Y8G("ngIf",n.previewLoading)}}function He(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function ze(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",74),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(7);return e.Njj(i.onClickCancel(t))}),e.nrm(1,"span",75),e.DNE(2,He,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(7);e.Y8G("disabled",n.deleteLoading),e.R7$(2),e.Y8G("ngIf",n.deleteLoading)}}function Ze(o,l){if(1&o&&(e.qex(0),e.DNE(1,ze,3,2,"button",73),e.bVm()),2&o){const n=e.XpG(6);e.R7$(),e.Y8G("ngIf",n.showCancel())}}function Qe(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Je(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",76),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(6);return e.Njj(i.onClickDownload(t))}),e.nrm(1,"span",77),e.DNE(2,Qe,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(6);e.Y8G("disabled",n.downloadLoading),e.R7$(2),e.Y8G("ngIf",n.downloadLoading)}}function qe(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function et(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",78),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(6);return e.Njj(i.onClickDelete(t))}),e.nrm(1,"span",79),e.DNE(2,qe,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(6);e.Y8G("disabled",n.deleteLoading),e.R7$(2),e.Y8G("ngIf",n.deleteLoading)}}function tt(o,l){if(1&o&&(e.qex(0),e.DNE(1,Ze,2,1,"ng-container",3)(2,Je,3,2,"button",71)(3,et,3,2,"button",72),e.bVm()),2&o){const n=e.XpG(5);e.R7$(),e.Y8G("ngIf",n.installState.downloading),e.R7$(),e.Y8G("ngIf",!n.installState.downloading&&"COMPLETE"!==n.installState.installState&&!n.deleteLoading),e.R7$(),e.Y8G("ngIf",n.showDelete())}}function st(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function nt(o,l){if(1&o&&e.nrm(0,"storefront-progress",82),2&o){const n=e.XpG(7);e.Y8G("type",n.getProgressType())("progress",n.installState.progress)}}function ot(o,l){if(1&o&&(e.j41(0,"p",83),e.EFF(1),e.k0s()),2&o){const n=e.XpG(7);e.R7$(),e.SpI(" ",n.installState.progress,"% ")}}function it(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",62),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(6);return e.Njj(i.onClickState(t))}),e.nrm(1,"span",53),e.DNE(2,st,1,0,"storefront-spinner",67)(3,nt,1,2,"storefront-progress",80)(4,ot,2,1,"p",81),e.k0s()}if(2&o){const n=e.XpG(6);e.ZWY("button-state action-button ",n.installState.downloading?"button-state-downloading":""," ","button-state-"+n.installState.installState," ",n.deleteLoading||n.downloadLoading?"button-state-loading":"",""),e.R7$(),e.Y8G("storefrontTranslate",n.getStateText()),e.R7$(),e.Y8G("ngIf",n.deleteLoading||n.downloadLoading),e.R7$(),e.Y8G("ngIf",n.showProgress(!0)),e.R7$(),e.Y8G("ngIf",n.showProgress(!0))}}function rt(o,l){if(1&o&&(e.qex(0),e.DNE(1,it,5,9,"button",43),e.bVm()),2&o){const n=e.XpG(5);e.R7$(),e.Y8G("ngIf",n.installState)}}function at(o,l){if(1&o&&(e.qex(0),e.DNE(1,tt,4,3,"ng-container",3)(2,rt,2,1,"ng-container",3),e.bVm()),2&o){const n=e.XpG(4);e.R7$(),e.Y8G("ngIf","MULTI"===n.downloadOptions.buttonType),e.R7$(),e.Y8G("ngIf","SINGLE"===n.downloadOptions.buttonType)}}function lt(o,l){if(1&o&&(e.qex(0),e.DNE(1,Ye,3,2,"button",63)(2,Ve,3,2,"button",64)(3,at,3,2,"ng-container",3),e.bVm()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",!n.locked),e.R7$(),e.Y8G("ngIf",n.locked&&n.hasPreview()),e.R7$(),e.Y8G("ngIf",n.downloadOptions&&!n.locked)}}function ct(o,l){1&o&&e.nrm(0,"span",92)}function _t(o,l){1&o&&e.nrm(0,"span",93)}function ut(o,l){if(1&o&&e.nrm(0,"span",94),2&o){const n=e.XpG(5);e.Y8G("storefrontTranslateArgs",e.eq3(1,K,n.price&&n.price.formattedPrice))}}function pt(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function gt(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",88),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickPurchase(t))}),e.DNE(1,ct,1,0,"span",89)(2,_t,1,0,"span",90)(3,ut,1,3,"span",91)(4,pt,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("ngClass",n.getPriceState())("disabled",!n.price||n.purchaseLoading),e.R7$(),e.Y8G("ngIf",!n.visible||n.priceLoading),e.R7$(),e.Y8G("ngIf",n.visible&&!n.priceLoading&&!n.price),e.R7$(),e.Y8G("ngIf",n.price),e.R7$(),e.Y8G("ngIf",n.purchaseLoading)}}function dt(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",95),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickSubscribe(t))}),e.k0s()}}function ft(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",96),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickLogin(t))}),e.k0s()}}function mt(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",97),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickCoupon(t))}),e.k0s()}}function ht(o,l){if(1&o&&(e.qex(0),e.DNE(1,gt,5,6,"button",84)(2,dt,1,0,"button",85)(3,ft,1,0,"button",86)(4,mt,1,0,"button",87),e.bVm()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.purchaseOptions.purchase),e.R7$(),e.Y8G("ngIf",n.purchaseOptions.subscribe),e.R7$(),e.Y8G("ngIf",!n.loggedIn&&n.purchaseOptions.login),e.R7$(),e.Y8G("ngIf",n.purchaseOptions.coupon)}}function Et(o,l){if(1&o&&(e.qex(0),e.nrm(1,"storefront-button",98),e.bVm()),2&o){const n=l.$implicit,s=e.XpG(3);e.R7$(),e.Y8G("baseConfig",n)("disableAnchor",!0)("baseContext",s.context)}}function vt(o,l){if(1&o&&e.nrm(0,"storefront-progress",103),2&o){const n=e.XpG(4);e.Y8G("progress",n.installState.progress)("type",n.getProgressType())("showBorder",!0)}}function It(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",104),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickDownload(t))}),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.downloadLoading)}}function Ct(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",105),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickDelete(t))}),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.deleteLoading)}}function bt(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Tt(o,l){if(1&o&&(e.j41(0,"div",99),e.DNE(1,vt,1,3,"storefront-progress",100)(2,It,1,1,"button",101)(3,Ct,1,1,"button",102)(4,bt,1,0,"storefront-spinner",67),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.showProgress(!0)),e.R7$(),e.Y8G("ngIf",!n.locked&&"COMPLETE"!==n.installState.installState&&!n.installState.downloading&&!n.downloadLoading),e.R7$(),e.Y8G("ngIf",n.showDelete()||n.showCancel()),e.R7$(),e.Y8G("ngIf",n.downloadLoading)}}function Dt(o,l){if(1&o&&(e.DNE(0,ye,2,4,"h3",31)(1,Pe,2,4,"h3",32)(2,Se,1,0,"i",33)(3,ke,3,3,"div",34)(4,Le,1,4,"div",35)(5,Me,3,1,"span",36)(6,Be,2,2,"div",37)(7,we,2,2,"div",38)(8,Ke,2,2,"div",39)(9,$e,1,6,"div",40),e.j41(10,"div",41),e.DNE(11,je,1,0,"button",42)(12,Xe,1,3,"button",43)(13,lt,4,3,"ng-container",3)(14,ht,5,4,"ng-container",3)(15,Et,2,3,"ng-container",44),e.k0s(),e.DNE(16,Tt,5,4,"div",45)),2&o){const n=e.XpG(2);e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.publication),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.title),e.R7$(),e.Y8G("ngIf",n.showCheck()),e.R7$(),e.Y8G("ngIf",n.issue.publicationDate&&(!n.config.hideComponents||!n.config.hideComponents.publicationDate)),e.R7$(),e.Y8G("ngIf",n.issue.description&&(!n.config.hideComponents||!n.config.hideComponents.description)),e.R7$(),e.Y8G("ngIf",n.issue.description&&(!n.config.hideComponents||!n.config.hideComponents.description)),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.properties),e.R7$(),e.Y8G("ngIf",!(n.config.displayCategories&&"NOTHING"===n.config.displayCategories.mode||n.config.hideComponents&&n.config.hideComponents.categories)),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.tags),e.R7$(),e.Y8G("ngForOf",n.customMessages)("ngForTrackBy",n.trackByMessage),e.R7$(2),e.Y8G("ngIf",n.config.sharing),e.R7$(),e.Y8G("ngIf",n.config.bookmark),e.R7$(),e.Y8G("ngIf",n.installState),e.R7$(),e.Y8G("ngIf",n.purchaseOptions&&n.locked),e.R7$(),e.Y8G("ngForOf",n.customButtons)("ngForTrackBy",n.trackByButton),e.R7$(),e.Y8G("ngIf",n.installState)}}function Ot(o,l){if(1&o&&(e.qex(0),e.DNE(1,Ie,3,2,"ng-container",13),e.nI1(2,"async"),e.DNE(3,De,2,2,"ng-template",null,0,e.C5r)(5,Ae,4,9,"ng-template",null,1,e.C5r)(7,Dt,17,18,"ng-template",null,2,e.C5r),e.bVm()),2&o){const n=e.sdS(4),s=e.XpG();e.R7$(),e.Y8G("ngIf",e.bMT(2,2,s.issuePath$))("ngIfElse",n)}}let Rt=(()=>{var o;class l extends z.${constructor(s,t,i,u,R,x,v,A,U,$,F,xt,At,yt,Pt,V,St,kt){super(x,s,A,$,V),this.elementRef=s,this.ngZone=t,this.changeDetectorRef=i,this.store=u,this.dialog=R,this.injector=x,this.eventActionService=v,this.contextService=A,this.cleanUpService=U,this.document=$,this.platformId=F,this.purpleEnv=xt,this.transferState=At,this.purpleService=yt,this.urlResolver=Pt,this.globalService=V,this.anchorService=St,this.ssrService=kt,this.defaultConfig={...M.Mw},this.priceLoading=!1,this.purchaseLoading=!1,this.downloadLoading=!1,this.deleteLoading=!1,this.openLoading=!1,this.previewLoading=!1,this.coverLoading=!1,this.bookmarkLoading=!1,this.descriptionExpanded=!1,this.downloadError=null,this.dataSourceError=null,this.visible=!1,this.anchorFeatureEnabled=!1,this.anchorPathCover=null,this.visibleProperties=[],this.issuePath$=new y.t(null),this.purchaseConfig={...M.Rp}}get purchasable(){var s;return(null===(s=this.issue)||void 0===s?void 0:s.access)===_.Access.PURCHASABLE}get hasError(){var s;return!(!this.dataSourceError||null!==(s=this.dataSource)&&void 0!==s&&s.hasData())}get issueType(){return this.issue&&(0,B.xl)(this.issue)&&this.issue.type}get contentType(){var s;return null===(s=this.issue)||void 0===s?void 0:s.contentType}get postType(){return this.issue&&(0,B.mF)(this.issue)?this.issue.postType:void 0}get contextKey(){var s;return(null!==(s=this.issueContextKey)&&void 0!==s?s:this.context.content)?"content":"issue"}get issueContextKey(){var s,t;return null!==(s=null===(t=this.config)||void 0===t?void 0:t.issueContextKey)&&void 0!==s?s:this.baseConfig.issueContextKey}get contextContent(){var s,t;return null!==(s=null!==(t=this.context[this.issueContextKey])&&void 0!==t?t:this.context.content)&&void 0!==s?s:this.context.issue}ngOnInit(){this.anchorFeatureEnabled=this.anchorService.isAnchorFeatureEnabled(),this.anchorFeatureEnabled||this.issuePath$.next(null),super.ngOnInit(),this.store.select((0,d.jZ)(D.O.DOWNLOAD_OPTIONS),s=>this.updateBehavior=null==s?void 0:s.autoUpdateBehavior)}get taxonomies(){var s;return null!==(s=this.issue.taxonomies)&&void 0!==s?s:[]}get categories(){return this.taxonomies.filter(s=>"category"===s.type).map(s=>s.id)}get tags(){return this.taxonomies.filter(s=>"tag"===s.type).map(s=>s.id)}ngOnDestroy(){super.ngOnDestroy(),this.downloadHandler&&this.ngZone.runOutsideAngular(()=>{setTimeout(()=>this.purpleService.destroyDownloadHandler(this.downloadHandler),1e3)}),this.dataSource&&this.contextService.unregisterDataSource(this.dataSource),this.trackingObserver&&this.trackingObserver.disconnect()}onConfigChanges(){var s=this;return(0,a.A)(function*(){var t;const i=s.issue,u=(0,g.v3)(s.config.dataSource),R={...u,limit:1};var x;if(s.loggedIn=!!s.context[_.METADATA_KEY.ENTITLEMENT_TOKEN],s.dataSource&&!s.dataSource.hasConfigChanged(R)&&s.issue)return s.context[null!==(x=s.issueContextKey)&&void 0!==x?x:"issue"]=i,s.updateConfig(i),void s.changeDetectorRef.detectChanges();if(u)delete s.issue,delete s.dataSourceError,s.changeDetectorRef.detectChanges(),s.dataSource=(0,E.O8)(s.injector,R,s.elementRef.nativeElement,s.document),s.store.subscribe(s.dataSource.data$.pipe((0,p.p)(A=>A&&!!A[0])),A=>{var U;const $=s.issue;s.issue=A[0],(0,L.GA)(s.issue,s.purpleService).then(F=>s.locked=F),s.context[null!==(U=s.issueContextKey)&&void 0!==U?U:"issue"]=s.issue,s.updateConfig($)},S.lQ,S.lQ,"data"),s.store.subscribe(s.dataSource.error$,A=>s.dataSourceError=A,S.lQ,S.lQ,"error"),yield s.dataSource.loadData();else{const A=s.contextContent;var v;"object"!=typeof A||s.issue&&(!A||s.purchaseLoading)?s.context[null!==(v=s.issueContextKey)&&void 0!==v?v:"issue"]=s.issue:(s.issue=A,(0,L.GA)(s.issue,s.purpleService).then(U=>s.locked=U)),s.updateConfig(i)}void 0===s.issue&&(null===(t=s.baseContext)||void 0===t||!t.isGhost)&&(0,c.UE)(s.platformId)&&s.ngZone.runOutsideAngular(()=>{setTimeout(()=>{void 0===s.issue&&s.ngZone.run(()=>s.dataSourceError={code:_.ERROR_CODE.ISSUE_NOT_FOUND})},1e3)})})()}updateConfig(s){var t=this;return(0,a.A)(function*(){var i;const u={...t.context};u.publication||(u.publication=t.publication),t.config=(0,g.uQ)({...M.Mw,...t.baseConfig},u,t.contextService.$functions,t.globalService.getGlobalData());const R=(0,g.v3)(t.config.purchaseOptions);R&&(t.purchaseOptions=Object.keys(R).reduce((v,A)=>({...v,[A]:(0,g.v3)(R[A])}),{}),t.purchaseOptions.purchase&&"object"==typeof t.purchaseOptions.purchase&&(t.purchaseConfig={...M.Rp,...t.purchaseOptions.purchase})),t.handleAnchorTags();const x={buttonClass:"action-button"};t.customButtons=t.config.customButtons.filter(v=>(0,g.Ol)(v)).map(v=>(0,g.v3)(v)).map(v=>({...x,...v,buttonClass:v.buttonClass?x.buttonClass.concat(" ",v.buttonClass):x.buttonClass})),t.customMessages=t.config.customMessages.filter(v=>(0,g.Ol)(v)).map(v=>(0,g.v3)(v)),t.downloadOptions=(0,g.v3)(t.config.downloadOptions),JSON.stringify(s)!==JSON.stringify(t.issue)&&t.loadOnVisible(),t.visibleProperties=(null!==(i=t.config.renderProperties)&&void 0!==i?i:[]).map(v=>(0,g.v3)(v)).filter(v=>!!v&&void 0!==t.issue.properties[v]).map(v=>({key:v,value:t.issue.properties[v]})),t.issue&&t.setDisplayCategories(),t.changeDetectorRef.markForCheck()})()}setDisplayCategories(){var s,t;switch(null!==(s=null===(t=this.config.displayCategories)||void 0===t?void 0:t.mode)&&void 0!==s?s:"SLUG"){case"SLUG":this.displayedCategories=this.taxonomies.filter(u=>"category"===u.type).map(u=>({id:u.id}));break;case"NAME":this.displayedCategories=this.taxonomies.filter(u=>"category"===u.type)}}handleAnchorTags(){var s=this;return(0,a.A)(function*(){if(!s.anchorFeatureEnabled)return;s.anchorPathCover=s.anchorService.getAnchorPathForEventAction(s.config.tapCover,s.context);const t=yield s.anchorService.getAnchorPathForContent(s.issue);t&&s.issuePath$.next(t)})()}loadOnVisible(){var s=this;if(this.installState=null,this.price=null,this.deleteLoading=!1,this.downloadLoading=!1,this.purchaseLoading=!1,this.previewLoading=!1,this.priceLoading=!1,this.openLoading=!1,this.bookmarkLoading=!1,!this.isGhost()){if(this.config.trackVisible){const i=!0===this.config.trackVisible?0:this.config.trackVisible.trackDelay;let R,x=v=>{v[0].isIntersecting?R=setTimeout(()=>{this.getDownloadHandler().then(function(){var A=(0,a.A)(function*(U){s.publication||(yield s.loadPublication()),s.handleTrackAction("VISIBLE",U)});return function(U){return A.apply(this,arguments)}}())},i):clearTimeout(R)};this.trackingObserver=new IntersectionObserver(x,{rootMargin:"0px",threshold:!0===this.config.trackVisible?1:this.config.trackVisible.minIssueVisibility}),this.trackingObserver.observe(this.elementRef.nativeElement)}this.store.subscribe((0,H.eh)(this,this.elementRef,{skipWait:this.purpleEnv.isUniversal&&!this.ssrService.currentPrebootStatus}),t=>{this.visible=!0,this.loadIssueState(),this.loadPublication(),this.loadPrice(),this.loadBookmark(),this.purpleService.addInvalidationListener((0,a.A)(function*(){var i;s.dataSource&&(s.issue=yield s.purpleService.getIssue(s.issue.id).catch(()=>null),s.locked=yield(0,L.GA)(s.issue,s.purpleService),s.context[null!==(i=s.issueContextKey)&&void 0!==i?i:"issue"]=s.issue,s.updateConfig(s.issue)),s.loadPrice()}))},S.lQ,S.lQ,"visible")}}loadIssueState(){var s=this;return(0,a.A)(function*(){!s.issue||!s.downloadOptions||(yield s.getDownloadHandler(),s.downloadHandler&&(s.store.subscribe(s.downloadHandler.updates$,t=>{s.installState=t,t&&t.error&&!s.downloadError&&(s.downloadError=t.error),s.changeDetectorRef.detectChanges()},S.lQ,S.lQ,"installState"),s.downloadHandler.autoUpdate&&s.downloadHandler.downloadStarted&&s.downloadHandler.update()),s.changeDetectorRef.detectChanges())})()}loadPrice(){var s=this;return(0,a.A)(function*(){if(s.purchaseOptions&&s.locked){var t;s.priceLoading=!0;const i=s.issue.productId||(null===(t=yield s.purpleService.getRepeatablePublicationProductByPublicationId(s.issue.publicationId))||void 0===t?void 0:t.productId);i?(s.store.select((0,G.Zt)(i),u=>{(0,j.b)(u)||(s.price=u),s.priceLoading=!1}),s.store.dispatch((0,P.qF)({productId:i}))):s.priceLoading=!1}})()}loadPublication(){var s=this;return(0,a.A)(function*(){if(s.issue)try{const t=s.issue.publicationId,i=(0,e.zw6)("publication_".concat(t));s.transferState.hasKey(i)?(s.publication=s.transferState.get(i,null),(0,c.UE)(s.platformId)&&s.transferState.remove(i)):(s.publication=yield s.purpleService.getPublication(t),(0,c.Vy)(s.platformId)&&s.transferState.onSerialize(i,()=>s.publication)),yield s.updateConfig(s.issue),s.changeDetectorRef.detectChanges()}catch{console.log("error loading publication for issue",s)}})()}loadBookmark(){var s=this;return(0,a.A)(function*(){s.config.bookmark&&s.store.subscribe(s.purpleService.bookmarks.pipe((0,m.T)(t=>t.find(i=>i.issueId===s.issue.id))),t=>s.bookmark=t,S.lQ,S.lQ,"bookmark")})()}getData(){return this.issue}getImageHeight(){return this.config.coverHeight||this.getDefaultImageHeight()}hasPreview(){return(0,B.xl)(this.issue)?!!this.issue.previewIssue:(0,B.mF)(this.issue)?!!this.issue.previewContentHtml:!(0,B.G4)(this.issue)&&void 0}getDefaultImageHeight(){return this.template===M.W9.DETAILS?W.q.AUTO:W.q.FIXED}onClickDownload(s){var t=this;return(0,a.A)(function*(){s.stopPropagation(),t.downloadLoading=!0,delete t.downloadError,t.changeDetectorRef.detectChanges();const i=yield t.getDownloadHandler();if(t.handleTrackAction("DOWNLOAD_CLICKED",i),i){if(t.purpleService.downloadOptions.showConfirmDownloadDialog){const u={issue:t.issue};try{yield t.dialog.confirm({text:"ISSUE_DOWNLOAD_CONFIRM_MESSAGE",args:[u]},{text:"ISSUE_DOWNLOAD_CONFIRM_TITLE",args:[u]},"ISSUE_DOWNLOAD_CONFIRM_OK","ISSUE_DOWNLOAD_CONFIRM_CANCEL")}catch{return t.handleTrackAction("DOWNLOAD_CONFIRM_CANCELLED",i,void 0,"_COLLECTION"),void(t.downloadLoading=!1)}}try{yield i.download(),t.cleanUpService.addIssue(t.issue.id),t.installState.downloading=!0,t.installState.installState=_.ContentInstallState.INCOMPLETE,t.installState.progress=0}catch(u){console.error(u),u.code===_.ERROR_CODE.PAYMENT_REQUIRED&&t.purpleService.invalidate()}}t.downloadLoading=!1,t.changeDetectorRef.detectChanges()})()}onClickDelete(s){var t=this;return(0,a.A)(function*(){if(s.stopPropagation(),t.config.deleteConfirm)try{yield t.dialog.confirm({text:"ISSUE_DELETE_MESSAGE",args:[t.issue.name]},"ISSUE_DELETE_TITLE","ISSUE_DELETE_CONFIRM","ISSUE_DELETE_CANCEL"),yield t.deleteIssue()}catch{}else yield t.deleteIssue()})()}onClickCancel(s){var t=this;return(0,a.A)(function*(){if(s.stopPropagation(),!t.deleteLoading)try{t.deleteLoading=!0,delete t.downloadError,t.changeDetectorRef.detectChanges(),t.getDownloadHandler().then(i=>t.handleTrackAction("CANCEL_CLICKED",i)),t.cleanUpService.removeIssue(t.issue.id),t.downloadHandler&&(yield t.downloadHandler.delete()),t.deleteLoading=!1,t.changeDetectorRef.detectChanges(),t.delete.emit(t.issue)}catch(i){console.log(i),t.deleteLoading=!1,t.changeDetectorRef.detectChanges()}})()}onClickRead(s){var t=this;return(0,a.A)(function*(){t.contextService.closeModal(t.elementRef.nativeElement),t.contextService.closeModalSubject.observers.length>0?t.contextService.closeModalCompleteSubject.pipe((0,O.s)(t.contextService.closeModalSubject.observers.length)).subscribe(()=>{},()=>{},(0,a.A)(function*(){t.openContent("READ_CLICKED")})):t.openContent("READ_CLICKED")})()}onClickPurchase(s){var t=this;return(0,a.A)(function*(){var i;s.stopPropagation(),t.purchaseLoading=!0,t.changeDetectorRef.detectChanges();const u={...t.purchaseConfig,productId:t.price.productId,price:t.price.price,currency:t.price.currency};t.issue.productId!==(null===(i=t.price)||void 0===i?void 0:i.productId)&&(u.consumeOptions={issueIds:[],contentIds:[t.issue.id]}),yield t.eventActionService.processPurchaseAction(u,t),t.purchaseLoading=!1,t.changeDetectorRef.detectChanges()})()}onClickPreview(s){var t=this;return(0,a.A)(function*(){t.contextService.closeModal(t.elementRef.nativeElement),t.contextService.closeModalSubject.observers.length>0?t.contextService.closeModalCompleteSubject.pipe((0,O.s)(t.contextService.closeModalSubject.observers.length)).subscribe(()=>{},()=>{},(0,a.A)(function*(){t.openContent("PREVIEW_CLICKED")})):t.openContent("PREVIEW_CLICKED")})()}onClickSubscribe(s){s.stopPropagation(),this.getDownloadHandler().then(t=>this.handleTrackAction("SUBSCRIBE_CLICKED",t)),this.eventActionService.processEventAction({type:T.H.SUBSCRIPTIONS,params:{issue:this.issue.id,publication:this.issue.publicationId}},this)}onClickLogin(s){s.stopPropagation(),this.getDownloadHandler().then(t=>this.handleTrackAction("LOGIN_CLICKED",t)),this.eventActionService.processEventAction({type:T.H.LOGIN,params:{issue:this.issue.id,publication:this.issue.publicationId}},this)}onClickCoupon(s){s.stopPropagation(),this.getDownloadHandler().then(t=>this.handleTrackAction("COUPON_CLICKED",t)),this.eventActionService.processEventAction({type:T.H.COUPON,params:{issue:this.issue.id,publication:this.issue.publicationId}},this)}getId(){return this.issue&&this.issue.id}getTrackingBaseKey(s,t){return this.elementId||s&&"".concat(s.getContentType(t))||this.getType()}getTrackingParams(s){const t=(0,N.bJ)(this.issue,this.publication,this.price);return{...s&&(0,N.Gw)(s.getContentType())?(0,N.bJ)(s.content,s.publication,this.price,"SOURCE_"):{},...t}}handleTrackAction(s,t,i,u){const R="".concat(this.getTrackingBaseKey(t,u),"_").concat(s);let x=i?(0,N.aM)(i):{};x={...x,...this.getTrackingParams(t)},this.store.dispatch((0,X.k4)({url:"".concat(window.location.href),key:R,params:x}))}onClickCover(s){this.clickIssueAction(s,"tapCover","COVER_CLICKED")}onClickIssue(s){this.clickIssueAction(s,"tapIssue","ISSUE_CLICKED")}clickIssueAction(s,t,i){var u=this;return(0,a.A)(function*(){u.anchorFeatureEnabled&&s.preventDefault();const R=(0,g.v3)(u.config[t]);if(R){if(s.stopPropagation(),u.coverLoading)return;u.coverLoading=!0,u.changeDetectorRef.detectChanges(),u.getDownloadHandler().then(x=>u.handleTrackAction(i,x)),yield u.eventActionService.processEventAction(R,u),u.coverLoading=!1,u.changeDetectorRef.detectChanges()}})()}isGhost(){return!(this.issue&&this.issue.id||this.dataSourceError)}onClickState(s){var t=this;return(0,a.A)(function*(){if(s.stopPropagation(),t.installState)return t.installState.downloading?t.onClickCancel(s):t.installState.installState===_.ContentInstallState.COMPLETE?t.onClickDelete(s):t.onClickDownload(s)})()}onClickBookmark(s){var t=this;return(0,a.A)(function*(){if(s.preventDefault(),s.stopPropagation(),!t.bookmarkLoading){if(t.bookmarkLoading=!0,t.bookmark){t.config.bookmark&&"boolean"!=typeof t.config.bookmark&&t.config.bookmark.deleteConfirm&&(yield t.dialog.confirm(t.bookmark.title?{text:"BOOKMARK_DELETE_MESSAGE_WITH_TITLE",args:[t.bookmark.title]}:"BOOKMARK_DELETE_MESSAGE","BOOKMARK_DELETE_TITLE","BOOKMARK_DELETE_CONFIRM","BOOKMARK_DELETE_CANCEL")),t.getDownloadHandler().then(i=>t.handleTrackAction("BOOKMARK_DELETE_CLICKED",i,t.bookmark));try{yield t.purpleService.deleteBookmark({id:t.bookmark.id}),t.getDownloadHandler().then(i=>t.handleTrackAction("BOOKMARK_DELETED",i,t.bookmark))}catch(i){t.dialog.alert(t.bookmark.title?{text:"ERROR_DELETE_BOOKMARK_WITH_TITLE",args:(0,w._3)((0,w.E2)(i,t.contextService),t.bookmark)}:{text:"ERROR_DELETE_BOOKMARK",args:[(0,w.E2)(i,t.contextService)]},"DIALOG_ERROR"),t.getDownloadHandler().then(u=>t.handleTrackAction("BOOKMARK_DELETE_FAILED",u,t.bookmark))}}else{t.getDownloadHandler().then(u=>t.handleTrackAction("BOOKMARK_ADD_CLICKED",u,t.bookmark));let i={title:t.issue.name,description:t.issue.description,issueId:t.issue.id,customData:{contentType:t.issue.contentType}};t.issue.thumbnails&&t.issue.thumbnails.default&&(i.thumbnailURL=t.issue.thumbnails.default),"object"==typeof t.config.bookmark&&(i={...i,...t.config.bookmark});try{yield t.purpleService.createBookmark(i),t.getDownloadHandler().then(u=>t.handleTrackAction("BOOKMARK_ADDED",u,t.bookmark))}catch(u){t.getDownloadHandler().then(R=>t.handleTrackAction("BOOKMARK_ADD_FAILED",R,t.bookmark)),t.dialog.alert({text:"ERROR_ADD_BOOKMARK",args:t.getErrorDialogArgs(u)},"DIALOG_ERROR")}}t.bookmarkLoading=!1,t.changeDetectorRef.detectChanges()}})()}onClickShare(s){var t=this;return(0,a.A)(function*(){s.stopPropagation(),t.getDownloadHandler().then(u=>t.handleTrackAction("SHARE_CLICKED",u));let i={text:t.issue.name,url:t.getSharingUrl()};"object"==typeof t.config.sharing&&(i={...i,...t.config.sharing});try{yield t.purpleService.share(i),t.getDownloadHandler().then(u=>t.handleTrackAction("SHARED",u))}catch{t.getDownloadHandler().then(R=>t.handleTrackAction("SHARE_FAILED",R)),t.dialog.alert("ERROR_SHARE","DIALOG_ERROR")}})()}getSharingUrl(){return"".concat(this.context[_.METADATA_KEY.MANAGER_BASE_URL],"/i/").concat(this.context[_.METADATA_KEY.APP_ID],"/").concat(this.issue.id,"?preview=").concat(this.context[_.METADATA_KEY.PREVIEW_APP])}getStateText(){return this.downloadLoading||this.deleteLoading?" ":this.installState?this.installState.downloading?"ISSUE_ACTION_CANCEL":this.installState.installState===_.ContentInstallState.COMPLETE?"ISSUE_ACTION_DELETE":"ISSUE_ACTION_DOWNLOAD":void 0}getPriceState(){return this.priceLoading?"price-loading":this.priceLoading||this.price?this.price?"price-available":"":"price-unavailable"}getConfigEscapeProperties(){return[...super.getConfigEscapeProperties(),"downloadOptions","customButtons","customMessages"]}getDownloadHandler(){var s=this;return(0,a.A)(function*(){return(0,c.UE)(s.platformId)&&((0,B.xl)(s.issue)||console.warn("tried to get download handler for "+s.issue.contentType),(!s.downloadHandler||s.downloadHandler.content.id!==s.issue.id)&&(s.downloadHandler&&(yield s.purpleService.destroyDownloadHandler(s.downloadHandler)),s.downloadHandler=yield s.purpleService.getDownloadHandler(s.issue,s.dialog))),s.downloadHandler})()}showProgress(s=!1){return!this.deleteLoading&&!this.downloadLoading&&this.installState&&this.installState.downloading&&!(this.installState.updating&&this.updateBehavior===M.FZ.SILENT)&&(s||"MULTI"===this.downloadOptions.buttonType)}showCancel(){return!this.downloadLoading&&this.installState.downloading&&!(this.installState.updating&&this.updateBehavior===M.FZ.SILENT)}showDelete(){return!this.downloadLoading&&this.installState.installState!==_.ContentInstallState.NOT_INSTALLED&&(!this.installState.downloading||this.installState.updating&&this.updateBehavior===M.FZ.SILENT)}showCheck(){return this.downloadOptions&&this.downloadOptions.statusIndicator&&this.installState&&(this.installState.installState===_.ContentInstallState.COMPLETE&&!this.locked||this.installState.updating&&this.updateBehavior===M.FZ.SILENT)}showUpdateBehavior(){if(this.installState&&(0,B.xl)(this.issue))return(0,L.YH)(this.installState,this.issue.type===_.IssueType.ISSUE)}reload(){window.location.reload()}hasContextChanged(s){var t;return!(null!==(t=this.config)&&void 0!==t&&t.dataSource)&&!h(this.contextContent,this.issue)||!h(s[_.METADATA_KEY.ENTITLEMENT_TOKEN],this.context[_.METADATA_KEY.ENTITLEMENT_TOKEN])||super.hasContextChanged(s)}deleteIssue(){var s=this;return(0,a.A)(function*(){if(!s.deleteLoading)try{s.deleteLoading=!0,delete s.downloadError,s.changeDetectorRef.detectChanges(),s.getDownloadHandler().then(t=>s.handleTrackAction("DELETE_CLICKED",t)),s.cleanUpService.removeIssue(s.issue.id),s.downloadHandler&&(yield s.downloadHandler.delete()),s.deleteLoading=!1,s.changeDetectorRef.detectChanges(),s.delete.emit(s.issue)}catch(t){console.log(t),s.deleteLoading=!1,s.changeDetectorRef.detectChanges()}})()}getProgressType(){const t=(this.config||this.baseConfig).downloadOptions;return t.progressType?t.progressType:this.template===M.W9.COVER?Y.s.RADIAL:Y.s.BAR}getErrorDialogArgs(s){return(0,w.$C)((0,w.E2)(s,this.contextService),this.issue)}getIssuePath(){var s=this;return(0,a.A)(function*(){if(s.issue&&(!s.issue.ad||s.issue.contentType)&&s.purpleEnv.isUniversal){const t=(0,e.zw6)("url_".concat(s.issue.id));if(s.transferState.hasKey(t))s.issuePath$.next(s.transferState.get(t,null));else{const i=yield s.urlResolver.getPathForContent(s.issue);s.issuePath$.next(i),(0,c.Vy)(s.platformId)&&s.transferState.set(t,i)}}})()}trackByProperty(s,t){var i;return null!==(i=null==t?void 0:t.key)&&void 0!==i?i:s}trackByCategory(s,t){var i;return null!==(i=null==t?void 0:t.id)&&void 0!==i?i:s}trackByTag(s,t){return null!=t?t:s}trackByMessage(s,t){var i;return null!==(i=null==t?void 0:t.message)&&void 0!==i?i:s}trackByButton(s,t){var i;return null!==(i=null==t?void 0:t.id)&&void 0!==i?i:s}openContent(s){var t=this;return(0,a.A)(function*(){t.openLoading=!0,t.changeDetectorRef.detectChanges(),t.getDownloadHandler().then(i=>t.handleTrackAction(s,i)),yield t.eventActionService.processOpenContentAction({type:T.H.OPEN_CONTENT,...t.config.openContent},t),t.openLoading=!1,t.changeDetectorRef.detectChanges()})()}getContextKey(){return this.contextKey}}return(o=l).type="issue",o.\u0275fac=function(s){return new(s||o)(e.rXU(e.aKT),e.rXU(e.SKi),e.rXU(e.gRc),e.rXU(f.B),e.rXU(Z.o),e.rXU(e.zZn),e.rXU(Q.G),e.rXU(J.V),e.rXU(q.I),e.rXU(c.qQ),e.rXU(e.Agw),e.rXU(N.r6),e.rXU(e.pJN),e.rXU(L.Wj),e.rXU(ee.K),e.rXU(te.d),e.rXU(se.X),e.rXU(ne.i))},o.\u0275cmp=e.VBU({type:o,selectors:[["storefront-issue"]],hostVars:9,hostBindings:function(s,t){2&s&&(e.BMQ("issue-type",t.issueType)("content-type",t.contentType)("post-type",t.postType),e.AVh("locked",t.locked)("purchasable",t.purchasable)("error",t.hasError))},features:[e.Jv_([f.B]),e.Vt3],decls:2,vars:2,consts:[["noAnchorTemplate",""],["imageTemplate",""],["issueData",""],[4,"ngIf"],[1,"issue-image"],[3,"height"],[1,"issue-data"],[1,"issue-title"],[1,"issue-description"],["class","issue-error",4,"ngIf"],[1,"issue-error"],["storefrontTranslate","ISSUE_ERROR",3,"storefrontTranslateArgs"],["storefrontTranslate","ISSUE_ERROR_BUTTON","mat-ripple","",1,"action-button",3,"click"],[4,"ngIf","ngIfElse"],["class","issue-image",3,"href","click",4,"ngIf"],["class","issue-data",3,"href","expanded","click",4,"ngIf"],[1,"issue-image",3,"click","href"],[4,"ngTemplateOutlet"],[1,"issue-data",3,"click","href"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","issue-image",3,"click",4,"ngIf"],["class","issue-data",3,"expanded","click",4,"ngIf"],[1,"issue-image",3,"click"],[1,"issue-data",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"lcpPrioritized","src","imageResolutionStrategy","height","extendedThumbnail","label"],["class","issue-update-badge",4,"ngIf"],[3,"type","progress",4,"ngIf"],[1,"issue-update-badge"],["storefrontTranslate","ISSUE_UPDATE_BADGE_MESSAGE"],[3,"type","progress"],["class","issue-publication-title",3,"click",4,"ngIf"],["class","issue-title",3,"click",4,"ngIf"],["class","icon icon-check-bg",4,"ngIf"],["class","issue-pub-date",4,"ngIf"],["class","issue-description","storefrontCheckOverflow","vertical","storefrontCheckOverflowTarget","self",3,"storefrontTranslate","storefrontTranslateArgs",4,"ngIf"],["class","issue-description-expand-toggle",3,"click",4,"ngIf"],["class","issue-properties",4,"ngIf"],["class","issue-categories",4,"ngIf"],["class","issue-tags",4,"ngIf"],[3,"class","storefrontTranslate","storefrontTranslateArgs",4,"ngFor","ngForOf","ngForTrackBy"],[1,"issue-actions"],["class","icon icon-share","mat-ripple","",3,"click",4,"ngIf"],["mat-ripple","",3,"class","click",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],["class","issue-state",4,"ngIf"],[1,"issue-publication-title",3,"click"],[3,"storefrontTranslate","storefrontTranslateArgs"],[1,"issue-title",3,"click"],[1,"icon","icon-check-bg"],[1,"issue-pub-date"],["storefrontCheckOverflow","vertical","storefrontCheckOverflowTarget","self",1,"issue-description",3,"storefrontTranslate","storefrontTranslateArgs"],[1,"issue-description-expand-toggle",3,"click"],[3,"storefrontTranslate"],[1,"icon","icon-arrow-down"],[1,"issue-properties"],[3,"class",4,"ngFor","ngForOf","ngForTrackBy"],[1,"issue-categories"],["purpleColorize","accent","purpleColorizeProps","background-color",3,"class",4,"ngFor","ngForOf","ngForTrackBy"],["purpleColorize","accent","purpleColorizeProps","background-color"],[1,"issue-tags"],["mat-ripple","",1,"icon","icon-share",3,"click"],["mat-ripple","",3,"click"],["class","button-read action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","button-preview action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["mat-ripple","",1,"button-read","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_READ"],["class","button-spinner",4,"ngIf"],[1,"button-spinner"],["mat-ripple","",1,"button-preview","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_PREVIEW"],["class","button-download action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","button-delete action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","button-cancel action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["mat-ripple","",1,"button-cancel","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_CANCEL"],["mat-ripple","",1,"button-download","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_DOWNLOAD"],["mat-ripple","",1,"button-delete","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_DELETE"],["message","",3,"type","progress",4,"ngIf"],["class","progress-percentage",4,"ngIf"],["message","",3,"type","progress"],[1,"progress-percentage"],["class","button-purchase action-button","mat-ripple","",3,"ngClass","disabled","click",4,"ngIf"],["class","button-subscribe action-button","mat-ripple","","storefrontTranslate","ISSUE_ACTION_SUBSCRIBE",3,"click",4,"ngIf"],["class","button-login action-button","mat-ripple","","storefrontTranslate","ISSUE_ACTION_LOGIN",3,"click",4,"ngIf"],["class","button-coupon action-button","mat-ripple","","storefrontTranslate","ISSUE_ACTION_COUPON",3,"click",4,"ngIf"],["mat-ripple","",1,"button-purchase","action-button",3,"click","ngClass","disabled"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_LOADING",4,"ngIf"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_UNAVAILABLE",4,"ngIf"],["storefrontTranslate","ISSUE_ACTION_PURCHASE",3,"storefrontTranslateArgs",4,"ngIf"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_LOADING"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_UNAVAILABLE"],["storefrontTranslate","ISSUE_ACTION_PURCHASE",3,"storefrontTranslateArgs"],["mat-ripple","","storefrontTranslate","ISSUE_ACTION_SUBSCRIBE",1,"button-subscribe","action-button",3,"click"],["mat-ripple","","storefrontTranslate","ISSUE_ACTION_LOGIN",1,"button-login","action-button",3,"click"],["mat-ripple","","storefrontTranslate","ISSUE_ACTION_COUPON",1,"button-coupon","action-button",3,"click"],[1,"button-custom",3,"baseConfig","disableAnchor","baseContext"],[1,"issue-state"],[3,"progress","type","showBorder",4,"ngIf"],["class","icon icon-download-circle","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","icon icon-delete","mat-ripple","",3,"disabled","click",4,"ngIf"],[3,"progress","type","showBorder"],["mat-ripple","",1,"icon","icon-download-circle",3,"click","disabled"],["mat-ripple","",1,"icon","icon-delete",3,"click","disabled"]],template:function(s,t){1&s&&e.DNE(0,fe,7,2,"ng-container",3)(1,Ot,9,4,"ng-container",3),2&s&&(e.Y8G("ngIf",!t.issue||t.dataSourceError),e.R7$(),e.Y8G("ngIf",t.issue&&t.config&&!t.dataSourceError))},dependencies:[c.YU,c.Sq,c.bT,c.T3,Y.X,oe.G,ie.M,re.t,ae.r6,le.Q,W.h,c.Jj,ce.w,_e.Z],styles:['.aspectRatioBase{position:relative;display:block}.aspectRatioBase:before{content:"";position:relative;display:block}.aspectRatioBase>*{position:absolute}storefront-issue{display:flex;flex-direction:column;position:relative}storefront-issue .issue-image{position:relative;overflow:hidden}storefront-issue .issue-image storefront-spinner{position:absolute;top:0;height:100%;width:100%;background-color:#0000001a}storefront-issue .issue-image .issue-update-badge{--paddingVert: .25em;--fontSize: .8em;--width: 200%;--offset: calc(var(--fontSize) * 3);position:absolute;top:calc(var(--fontSize) + var(--paddingVert));left:calc(var(--width) / -2 + var(--offset));display:flex;justify-content:center;width:var(--width);padding:var(--paddingVert) 0;background:var(--issueUpdateBadgeBgColor);transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}@media (max-width: 767px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge{--fontSize: .6em}}@media (max-width: 330px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge{--fontSize: .6em}}storefront-issue .issue-image .issue-update-badge span{max-width:80px;text-align:center;font-size:var(--fontSize);color:var(--issueUpdateBadgeColor);-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;text-overflow:ellipsis;overflow:hidden}@media (max-width: 767px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge span{max-width:60px}}@media (max-width: 330px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge span{max-width:60px}}storefront-issue storefront-progress[type=BAR]{display:none;position:absolute;background-color:var(--issueProgressBgColor);border-radius:var(--borderRadius);overflow:hidden;text-align:center;padding:var(--issueProgressPaddingVert) var(--issueProgressPaddingHoriz);z-index:0;bottom:0;left:0;right:0;top:0}storefront-issue .issue-image storefront-progress[type=BAR]{top:auto;bottom:var(--issueProgressMarginVert);left:var(--issueProgressMarginHoriz);right:var(--issueProgressMarginHoriz)}storefront-issue .issue-data{display:flex;flex-direction:column;overflow:hidden;flex-grow:1}storefront-issue .issue-data .issue-description-expand-toggle{display:none}storefront-issue .issue-data .issue-description-expand-toggle i{display:inline-block;transition:transform .3s ease;font-size:12px;padding:0 4px}storefront-issue .issue-title{margin:.5em 0}storefront-issue .issue-description{color:var(--secondaryTextColor);width:100%;white-space:pre-wrap}storefront-issue .issue-custom-message{color:var(--textColor)}storefront-issue storefront-image{width:100%}storefront-issue .issue-actions{display:none;justify-content:space-between;z-index:1}storefront-issue .issue-actions button{color:#fff;background-color:var(--secondaryColor);padding:0}storefront-issue .issue-actions button.button-purchase,storefront-issue .issue-actions button.button-subscribe,storefront-issue .issue-actions button.button-download,storefront-issue .issue-actions button.button-read{background-color:var(--primaryColor)}storefront-issue .issue-actions button.button-state-downloading.button-state-INCOMPLETE .progress-percentage{display:none}storefront-issue .issue-actions button[disabled]{opacity:.5}storefront-issue .issue-actions button span{position:relative;z-index:1}storefront-issue .issue-actions button.icon{color:var(--primaryColor);background-color:transparent;width:1.4em;height:1.4em;font-size:1.4em}storefront-issue .issue-state{display:none}storefront-issue .issue-error .action-button{background-color:var(--secondaryColor);color:#fff;display:block}storefront-issue[template=cover] .issue-image{width:100%}storefront-issue[template=cover] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=cover] .issue-data{flex-direction:row;align-items:center}storefront-issue[template=cover] .issue-data>i,storefront-issue[template=cover] .issue-data .issue-state i,storefront-issue[template=cover] .issue-data .issue-state button,storefront-issue[template=cover] .issue-data .issue-state storefront-progress,storefront-issue[template=cover] .issue-data .issue-state storefront-spinner{font-size:21px;height:22px;width:22px;color:var(--secondaryColor)}storefront-issue[template=cover] .issue-data>i.icon-delete,storefront-issue[template=cover] .issue-data .issue-state i.icon-delete,storefront-issue[template=cover] .issue-data .issue-state button.icon-delete,storefront-issue[template=cover] .issue-data .issue-state storefront-progress.icon-delete,storefront-issue[template=cover] .issue-data .issue-state storefront-spinner.icon-delete{width:42px;height:42px;position:absolute;top:-20px;right:-20px;border-radius:100%;font-size:10px;color:#fff;padding:10px}storefront-issue[template=cover] .issue-data>i.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state i.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state button.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state storefront-progress.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state storefront-spinner.icon-delete:after{background-color:var(--secondaryColor);width:22px;height:22px;border-radius:100%;display:flex;justify-content:center;align-items:center}storefront-issue[template=cover] .issue-state{display:flex;right:0;bottom:0}storefront-issue[template=cover] .issue-state storefront-spinner{position:relative;z-index:1;--spinnerColor: var(--secondaryColor);background-color:transparent;padding:0}storefront-issue[template=cover] .issue-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}storefront-issue[template=cover] .issue-publication-title,storefront-issue[template=cover] .issue-description,storefront-issue[template=cover] .issue-categories,storefront-issue[template=cover] .issue-tags,storefront-issue[template=cover] .issue-pub-date,storefront-issue[template=cover] .issue-properties,storefront-issue[template=cover] .issue-custom-message{display:none}storefront-issue[template=cover] .issue-publication-title .issue-tag,storefront-issue[template=cover] .issue-publication-title .issue-category,storefront-issue[template=cover] .issue-description .issue-tag,storefront-issue[template=cover] .issue-description .issue-category,storefront-issue[template=cover] .issue-categories .issue-tag,storefront-issue[template=cover] .issue-categories .issue-category,storefront-issue[template=cover] .issue-tags .issue-tag,storefront-issue[template=cover] .issue-tags .issue-category,storefront-issue[template=cover] .issue-pub-date .issue-tag,storefront-issue[template=cover] .issue-pub-date .issue-category,storefront-issue[template=cover] .issue-properties .issue-tag,storefront-issue[template=cover] .issue-properties .issue-category,storefront-issue[template=cover] .issue-custom-message .issue-tag,storefront-issue[template=cover] .issue-custom-message .issue-category{display:none}storefront-issue[template=card]{border-radius:4px;box-shadow:0 0 5px 2px #0000001a;padding-bottom:var(--gutter);overflow:hidden;background-color:#fff}storefront-issue[template=card] storefront-image[height-strategy=FIXED]{padding-top:75%}storefront-issue[template=card] storefront-image[height-strategy=FIXED]>img{object-fit:cover;width:100%}storefront-issue[template=card] .issue-title,storefront-issue[template=card] .issue-pub-date,storefront-issue[template=card] .issue-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-left:calc(var(--gutter) / 2);margin-right:calc(var(--gutter) / 2);width:initial}storefront-issue[template=card] .issue-publication-title,storefront-issue[template=card] .issue-categories,storefront-issue[template=card] .issue-tags,storefront-issue[template=card] .issue-properties,storefront-issue[template=card] .issue-custom-message{display:none}storefront-issue[template=card] .issue-publication-title .issue-tag,storefront-issue[template=card] .issue-publication-title .issue-category,storefront-issue[template=card] .issue-categories .issue-tag,storefront-issue[template=card] .issue-categories .issue-category,storefront-issue[template=card] .issue-tags .issue-tag,storefront-issue[template=card] .issue-tags .issue-category,storefront-issue[template=card] .issue-properties .issue-tag,storefront-issue[template=card] .issue-properties .issue-category,storefront-issue[template=card] .issue-custom-message .issue-tag,storefront-issue[template=card] .issue-custom-message .issue-category{display:none}storefront-issue[template=highlight]{flex-direction:row;padding:calc(var(--gutter) / 2);width:100%}storefront-issue[template=highlight] .issue-image{width:calc(43% - var(--gutter) / 2);margin-right:var(--gutter);flex-shrink:0;align-self:flex-end}storefront-issue[template=highlight] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}@media (max-width: 533px) and (orientation: portrait),(max-height: 533px) and (orientation: landscape){storefront-issue[template=highlight] .issue-image{width:calc(50% - (var(--gutter)))}}storefront-issue[template=highlight] storefront-progress[type=BAR]{display:block}storefront-issue[template=highlight] .issue-data{margin-left:var(--gutter)}storefront-issue[template=highlight] .issue-title{font-size:2em;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}storefront-issue[template=highlight] .issue-publication-title,storefront-issue[template=highlight] .issue-pub-date,storefront-issue[template=highlight] .issue-properties,storefront-issue[template=highlight] .issue-categories,storefront-issue[template=highlight] .issue-tags{display:none}storefront-issue[template=highlight] .issue-publication-title .issue-tag,storefront-issue[template=highlight] .issue-publication-title .issue-category,storefront-issue[template=highlight] .issue-pub-date .issue-tag,storefront-issue[template=highlight] .issue-pub-date .issue-category,storefront-issue[template=highlight] .issue-properties .issue-tag,storefront-issue[template=highlight] .issue-properties .issue-category,storefront-issue[template=highlight] .issue-categories .issue-tag,storefront-issue[template=highlight] .issue-categories .issue-category,storefront-issue[template=highlight] .issue-tags .issue-tag,storefront-issue[template=highlight] .issue-tags .issue-category{display:none}storefront-issue[template=highlight] .issue-custom-message{margin:var(--gutter) 0}storefront-issue[template=highlight] .issue-actions{display:flex;flex-direction:column;flex-grow:1;justify-content:flex-end}storefront-issue[template=highlight] .issue-actions storefront-button button{width:100%}storefront-issue[template=details] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=details] .issue-data{align-items:center}storefront-issue[template=details] .issue-data.expanded .issue-description{-webkit-line-clamp:unset}storefront-issue[template=details] .issue-data.expanded .issue-description-expand-toggle{display:block}storefront-issue[template=details] .issue-data.expanded .issue-description-expand-toggle i{transform:rotate(180deg)}storefront-issue[template=details] .issue-data .issue-publication-title,storefront-issue[template=details] .issue-data .issue-properties,storefront-issue[template=details] .issue-data .issue-categories,storefront-issue[template=details] .issue-data .issue-tags{display:none}storefront-issue[template=details] .issue-data .issue-publication-title .issue-tag,storefront-issue[template=details] .issue-data .issue-publication-title .issue-category,storefront-issue[template=details] .issue-data .issue-publication-title .issue-property,storefront-issue[template=details] .issue-data .issue-properties .issue-tag,storefront-issue[template=details] .issue-data .issue-properties .issue-category,storefront-issue[template=details] .issue-data .issue-properties .issue-property,storefront-issue[template=details] .issue-data .issue-categories .issue-tag,storefront-issue[template=details] .issue-data .issue-categories .issue-category,storefront-issue[template=details] .issue-data .issue-categories .issue-property,storefront-issue[template=details] .issue-data .issue-tags .issue-tag,storefront-issue[template=details] .issue-data .issue-tags .issue-category,storefront-issue[template=details] .issue-data .issue-tags .issue-property{display:none}storefront-issue[template=details] storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=details] storefront-progress[type=BAR]{display:block}storefront-issue[template=details] .issue-pub-date{display:none}storefront-issue[template=details] .issue-description{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;text-overflow:ellipsis;overflow:hidden}storefront-issue[template=details] .issue-description.scrollable-vert+.issue-description-expand-toggle{display:flex}storefront-issue[template=details] .issue-description-expand-toggle{align-self:flex-start}storefront-issue[template=details] .issue-custom-message{margin-top:var(--gutter)}storefront-issue[template=details] .issue-actions{display:grid;width:100%;grid-template-columns:1fr 1fr;grid-column-gap:var(--gutter);margin-top:var(--gutter)}storefront-issue[template=details] .issue-actions>button:nth-child(odd):last-child,storefront-issue[template=details] .issue-actions>storefront-button:nth-child(odd):last-child{grid-column:1/3}storefront-issue[template=details] .issue-actions storefront-button button{width:100%}storefront-issue[template=group]{flex-direction:row}storefront-issue[template=group] .issue-image{width:100%}storefront-issue[template=group] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=group] .issue-data{flex-direction:column}storefront-issue[template=group] .issue-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}storefront-issue[template=group] .issue-actions{display:flex;justify-content:flex-start}storefront-issue[template=group] .issue-actions>button{display:none}storefront-issue[template=group] i,storefront-issue[template=group] .issue-publication-title,storefront-issue[template=group] .issue-pub-date,storefront-issue[template=group] .issue-description,storefront-issue[template=group] .issue-description-expand-toggle,storefront-issue[template=group] .issue-properties,storefront-issue[template=group] .issue-categories,storefront-issue[template=group] .issue-tags,storefront-issue[template=group] .issue-state,storefront-issue[template=group] .issue-update-badge{display:none}storefront-issue[template=group] i .issue-tag,storefront-issue[template=group] i .issue-category,storefront-issue[template=group] .issue-publication-title .issue-tag,storefront-issue[template=group] .issue-publication-title .issue-category,storefront-issue[template=group] .issue-pub-date .issue-tag,storefront-issue[template=group] .issue-pub-date .issue-category,storefront-issue[template=group] .issue-description .issue-tag,storefront-issue[template=group] .issue-description .issue-category,storefront-issue[template=group] .issue-description-expand-toggle .issue-tag,storefront-issue[template=group] .issue-description-expand-toggle .issue-category,storefront-issue[template=group] .issue-properties .issue-tag,storefront-issue[template=group] .issue-properties .issue-category,storefront-issue[template=group] .issue-categories .issue-tag,storefront-issue[template=group] .issue-categories .issue-category,storefront-issue[template=group] .issue-tags .issue-tag,storefront-issue[template=group] .issue-tags .issue-category,storefront-issue[template=group] .issue-state .issue-tag,storefront-issue[template=group] .issue-state .issue-category,storefront-issue[template=group] .issue-update-badge .issue-tag,storefront-issue[template=group] .issue-update-badge .issue-category{display:none}storefront-issue.locked .issue-actions button.icon-share{display:none}storefront-issue.ghost{pointer-events:none}storefront-issue.ghost .issue-image{animation:ghost-opacity 2s infinite linear;background-color:var(--ghostColor);margin-bottom:var(--gutter)}storefront-issue.ghost .issue-image storefront-image{background-color:transparent}storefront-issue.ghost[template=highlight]>.issue-image{margin-bottom:0}storefront-issue.ghost[template=highlight]>.issue-image>storefront-image{margin-bottom:0}storefront-issue.ghost[template=highlight] .issue-description,storefront-issue.ghost[template=highlight] .issue-title{width:100%;margin-bottom:0}storefront-issue.ghost[template=cover] storefront-image{padding-top:133%}storefront-issue.ghost[template=card] storefront-image{padding-top:75%}storefront-issue.ghost .issue-description,storefront-issue.ghost .issue-title{background-color:var(--ghostColor);color:transparent;border-radius:4px;width:90%;height:1.2em;margin-bottom:calc(var(--gutter) / 2)!important;background-image:linear-gradient(90deg,var(--ghostColor) 0px,rgb(236,236,236) 40px,var(--ghostColor) 80px);background-size:80vw;animation:ghost-lines 2s infinite linear}storefront-issue.ghost .issue-description{height:3em}storefront-issue.error .issue-data{display:none}storefront-issue.error[template=cover] .issue-error,storefront-issue.error[template=card] .issue-error,storefront-issue.error[template=details] .issue-error{margin-top:var(--gutter)}\n'],encapsulation:2,changeDetection:0}),l})()},4365:(k,C,r)=>{r.d(C,{AN:()=>h,FZ:()=>b,Mw:()=>y,Rp:()=>I,W9:()=>_});var a=r(4404),_=function(p){return p.COVER="cover",p.CARD="card",p.HIGHLIGHT="highlight",p.DETAILS="details",p.GROUP="group",p}(_||{});const I={showErrorDialog:!0};var h=function(p){return p.SINGLE="SINGLE",p.MULTI="MULTI",p}(h||{}),b=function(p){return p.SILENT="SILENT",p}(b||{});const y={template:_.CARD,openContent:{mode:a.DisplayMode.MODAL,titleBar:!0},downloadOptions:null,customButtons:[],customMessages:[],titleMessage:"ISSUE_TITLE",descriptionMessage:"ISSUE_DESCRIPTION",publicationTitleMessage:"ISSUE_PUBLICATION_TITLE"}},1367:(k,C,r)=>{r.r(C),r.d(C,{IssueModule:()=>g,component:()=>L});var a=r(177),c=r(4744),e=r(3363),_=r(8301),I=r(6483),h=r(6215),b=r(1605),y=r(6600),p=r(6953),m=r(9805),O=r(4767),D=r(4403),E=r(3953);let g=(()=>{var T;class d{}return(T=d).\u0275fac=function(P){return new(P||T)},T.\u0275mod=E.$C({type:T}),T.\u0275inj=E.G2t({imports:[a.MD,e.E,_.d,I.h,h.O,b.P,O.d,y.pZ,p.n,m.ButtonModule,D.U]}),d})();const L=c.z},3092:(k,C,r)=>{r.d(C,{X:()=>p,s:()=>y});var a=r(3953),c=r(345);function e(m,O){1&m&&a.nrm(0,"div",5)}function _(m,O){if(1&m&&(a.qex(0),a.nrm(1,"div",1),a.j41(2,"div",2),a.nrm(3,"div",3),a.k0s(),a.DNE(4,e,1,0,"div",4),a.bVm()),2&m){const D=a.XpG();a.R7$(2),a.xc7("-webkit-clip-path",D.getClipPath())("clip-path",D.getClipPath()),a.R7$(2),a.Y8G("ngIf",D.showBorder)}}function I(m,O){if(1&m&&(a.qex(0),a.j41(1,"div",6),a.nrm(2,"div",7)(3,"div",8),a.k0s(),a.bVm()),2&m){const D=a.XpG();a.R7$(2),a.xc7("width",D.progress,"%"),a.R7$(),a.Y8G("storefrontTranslate",D.message)}}function h(m,O){1&m&&a.nrm(0,"div",5)}function b(m,O){if(1&m&&(a.qex(0),a.nrm(1,"storefront-spinner",9),a.DNE(2,h,1,0,"div",4),a.j41(3,"div",10),a.EFF(4),a.k0s(),a.nrm(5,"i",11),a.bVm()),2&m){const D=a.XpG();a.R7$(2),a.Y8G("ngIf",D.showBorder),a.R7$(2),a.SpI("",D.progress,"%")}}var y=function(m){return m.RADIAL="RADIAL",m.BAR="BAR",m.NUMERIC="NUMERIC",m}(y||{});let p=(()=>{var m;class O{constructor(E){this.sanitizer=E,this.type=y.RADIAL,this.showBorder=!1,this.message="ISSUE_ACTION_DOWNLOADING",this.progressOnBorder=!1}getClipPath(){let E;const g=this.progress;return E=g<=12.5?"polygon(50% 0, 50% 50%, ".concat(50+4*g,"% 0, 100% 0)"):g<=25?"polygon(50% 50%, 50% 0, 100% 0, 100% ".concat(4*(g-12.5),"%)"):g<=37.5?"polygon(50% 50%, 50% 0, 100% 0, 100% ".concat(4*(g-25)+50,"%)"):g<=75?"polygon(50% 50%, ".concat(100-4*(g-37.5),"% 100%, 100% 100%, 100% 0, 50% 0)"):g<=87.5?"polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 ".concat(50-4*(g-75),"%)"):"polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0, ".concat(4*(g-87.5),"% 0)"),this.sanitizer.bypassSecurityTrustStyle(E)}}return(m=O).\u0275fac=function(E){return new(E||m)(a.rXU(c.up))},m.\u0275cmp=a.VBU({type:m,selectors:[["storefront-progress"]],hostVars:3,hostBindings:function(E,g){2&E&&(a.BMQ("type",g.type),a.AVh("progress-on-border",g.progressOnBorder))},inputs:{type:"type",showBorder:"showBorder",message:"message",progressOnBorder:"progressOnBorder",progress:"progress"},decls:3,vars:3,consts:[[4,"ngIf"],[1,"background-circle"],[1,"loader"],[1,"circle"],["class","border-circle",4,"ngIf"],[1,"border-circle"],[1,"bar"],[1,"bar-indicator"],[1,"bar-message",3,"storefrontTranslate"],["type","segments",1,"progress-spinner"],[1,"bar-progress"],[1,"icon","icon-delete"]],template:function(E,g){1&E&&a.DNE(0,_,5,5,"ng-container",0)(1,I,4,3,"ng-container",0)(2,b,6,2,"ng-container",0),2&E&&(a.Y8G("ngIf","RADIAL"===g.type),a.R7$(),a.Y8G("ngIf","BAR"===g.type),a.R7$(),a.Y8G("ngIf","NUMERIC"===g.type))},styles:["storefront-progress[type=RADIAL]{position:relative;display:flex;width:22px;height:22px}storefront-progress[type=RADIAL] .loader{position:absolute;left:50%;top:50%;transform:translate(-50%) translateY(-50%);width:calc(100% + 2px);height:calc(100% + 2px);display:flex;align-items:center;justify-content:center}storefront-progress[type=RADIAL] .loader .circle{width:calc(100% - 2px);height:calc(100% - 2px);background-color:var(--secondaryColor)}storefront-progress[type=RADIAL] .background-circle,storefront-progress[type=RADIAL] .border-circle,storefront-progress[type=RADIAL] .circle{border-radius:100%;box-sizing:border-box}storefront-progress[type=RADIAL] .background-circle,storefront-progress[type=RADIAL] .border-circle{position:absolute;left:50%;top:50%;transform:translate(-50%) translateY(-50%);width:100%;height:100%}storefront-progress[type=RADIAL] .border-circle{border:2px solid var(--secondaryColor)}storefront-progress[type=RADIAL].progress-on-border{-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' width='110' height='110'%3E%3Ccircle cx='55' cy='55' r='50' stroke='black' stroke-width='4' fill='none' /%3E%3C/svg%3E\");mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' width='110' height='110'%3E%3Ccircle cx='55' cy='55' r='50' stroke='black' stroke-width='4' fill='none' /%3E%3C/svg%3E\");-webkit-mask-size:100%;mask-size:100%}storefront-progress[type=BAR] .bar-indicator{position:absolute;height:100%;top:0;left:0;background-color:var(--issueProgressColor);transition:width .2s ease}storefront-progress[type=BAR] .bar-message{font-size:.8em;z-index:1;position:relative;color:var(--issueProgressFontColor)}storefront-progress[type=NUMERIC]{display:flex;justify-content:space-between;align-items:center;padding:0 var(--gutter)}storefront-progress[type=NUMERIC] storefront-spinner.progress-spinner{position:relative;background:transparent;--spinnerColor: var(--issueProgressColor);padding:0;display:flex;width:20px}storefront-progress[type=NUMERIC] i{font-size:12px}\n"],encapsulation:2}),O})()},3363:(k,C,r)=>{r.d(C,{E:()=>y});var a=r(177),c=r(3092),e=r(6483),_=r(6215),I=r(3953),h=r(8909),b=r(7240);let y=(()=>{var p;class m{}return(p=m).\u0275fac=function(D){return new(D||p)},p.\u0275mod=I.$C({type:p}),p.\u0275inj=I.G2t({imports:[a.MD,e.h,_.O]}),m})();I.wjB(c.X,[a.bT,h.M,b.t],[])},6953:(k,C,r)=>{r.d(C,{n:()=>e});var a=r(177),c=r(3953);let e=(()=>{var _;class I{}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275mod=c.$C({type:_}),_.\u0275inj=c.G2t({imports:[a.MD]}),I})()},2813:(k,C,r)=>{r.d(C,{Z:()=>e});var a=r(3178),c=r(3953);let e=(()=>{var _;class I{transform(b,y){return new Date(b).toLocaleDateString((0,a.JK)())}}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275pipe=c.EJ8({name:"storefrontDate",type:_,pure:!0}),I})()},1739:(k,C,r)=>{function a(c){return c&&!!c.code}r.d(C,{b:()=>a})}}]);
|
1
|
+
"use strict";(self.webpackChunkstorefront=self.webpackChunkstorefront||[]).push([["default-projects_storefront_src_app_component_issue_issue_module_ts","projects_storefront_src_app_common-pipes_common-pipes_module_ts-projects_storefront_src_app_c-94b9b6"],{4767:(k,C,r)=>{r.d(C,{d:()=>e});var a=r(177),c=r(3953);let e=(()=>{var _;class I{}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275mod=c.$C({type:_}),_.\u0275inj=c.G2t({imports:[a.MD]}),I})()},2914:(k,C,r)=>{r.d(C,{w:()=>I});var a=r(4049),c=r(7370),e=r(3953),_=r(9516);let I=(()=>{var h;class b{constructor(p){this.contextService=p}transform(p,m){if(!p||(0,c.vh)(p))return p;let O=p?(0,a.K)(p,m):"";const D=this.contextService.getIsCustomerDomainUsed()?"":"/".concat(this.contextService.getBrand(),"/"),v=this.contextService.isPreview();return"/"===O&&(O=""),O="".concat(D).concat(O).concat(v?"?preview=true":""),O}}return(h=b).\u0275fac=function(p){return new(p||h)(e.rXU(_.V,16))},h.\u0275pipe=e.EJ8({name:"urlTransform",type:h,pure:!0}),h.\u0275prov=e.jDH({token:h,factory:h.\u0275fac,providedIn:"root"}),b})()},2932:(k,C,r)=>{r.d(C,{h:()=>D,q:()=>v});var a=r(177),c=r(3953),e=r(8251),_=r(8890),I=r(9876),h=r(345),b=r(4748),y=r(9516),p=r(5102);const m=["image"];function O(g,L){if(1&g){const T=c.RV6();c.j41(0,"img",2,0),c.bIt("error",function(){c.eBV(T);const f=c.XpG();return c.Njj(f.onError())}),c.k0s()}if(2&g){const T=c.XpG();c.Y8G("priority",T.lcpPrioritized())("ngSrc",T.safeResizeSrc)("alt",T.alt)("title",T.title),c.BMQ("aria-label",T.ariaLabel)}}let D=(()=>{var g;class L{set image(d){d&&this.onLoad(d),this._image=d}get image(){return this._image}constructor(d,f,P,G,j,X,S,U){this.sanitizer=d,this.changeDetectorRef=f,this.elementRef=P,this.subscriptions=G,this.platformId=j,this.ssrService=X,this.contextService=S,this.purpleService=U,this.lcpPrioritized=(0,c.hFB)(!1),this.error=new c.bkB,this.height=v.AUTO}get empty(){return!this.src}ngOnInit(){this.initProperties(),(0,a.UE)(this.platformId)&&this.subscriptions.subscribe((0,_.eh)(this,this.elementRef,{skipWait:!1}),d=>this.load())}initProperties(){var d,f,P,G;this.alt=(null===(d=this.extendedThumbnail)||void 0===d?void 0:d.properties.alt)||(null===(f=this.extendedThumbnail)||void 0===f?void 0:f.properties.caption)||"",this.title=this.alt,this.ariaLabel=null!==(P=this.label)&&void 0!==P?P:this.alt,this.focalPoint=null===(G=this.extendedThumbnail)||void 0===G?void 0:G.properties.focuspoint}initAndLoad(){this.initProperties(),this.load()}load(){this.loaded||(this.loaded=!0,this.src&&this.update(),this.changeDetectorRef.detectChanges())}ngOnChanges(d){d.src&&this.loaded&&this.update()}update(){this.updateImageRatio(),this.updateResizeSrc()}onLoad(d){d.nativeElement.classList.add("loaded"),this.elementRef.nativeElement.classList.add("loaded"),this.changeDetectorRef.detectChanges(),d.nativeElement.addEventListener("load",()=>{this.updateImageRatio(!0,d),this.changeDetectorRef.markForCheck()}),d.nativeElement.addEventListener("error",function(){d.nativeElement.style.display="none",d.nativeElement.nextElementSibling&&(d.nativeElement.nextElementSibling.style.display="inline")}),this.purpleService.addImageSrc(this.resizeSrc)}onError(){if(!this.safeResizeSrc)return;const d=this.purpleService.getAlternativeSrc(this.src);var f;d&&d!==this.resizeSrc?(this.setResizeSrc(d),this.changeDetectorRef.detectChanges()):(null===(f=this.image)||void 0===f||f.nativeElement.classList.add("error"),this.elementRef.nativeElement.classList.add("error"),this.error.emit(this))}updateImageRatio(d=!1,f=this.image){this.imageRatio=this.height===v.AUTO?(0,I.z)(!d,null==f?void 0:f.nativeElement,this.src)+"%":void 0}updateResizeSrc(){this.setResizeSrc((0,I.G)(this.elementRef.nativeElement,this.src,this.imageResolutionStrategy,this.focalPoint)),this.changeDetectorRef.detectChanges()}setResizeSrc(d){const f=this.contextService.toResourceUrl(d);this.resizeSrc=f,this.safeResizeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(f)}}return(g=L).\u0275fac=function(d){return new(d||g)(c.rXU(h.up),c.rXU(c.gRc),c.rXU(c.aKT),c.rXU(e.v),c.rXU(c.Agw),c.rXU(b.i),c.rXU(y.V),c.rXU(p.Wj))},g.\u0275cmp=c.VBU({type:g,selectors:[["storefront-image"]],viewQuery:function(d,f){if(1&d&&c.GBs(m,5),2&d){let P;c.mGM(P=c.lsd())&&(f.image=P.first)}},hostAttrs:["ngSkipHydration","true"],hostVars:12,hostBindings:function(d,f){2&d&&(c.BMQ("src",f.src)("label",f.label)("resolution-strategy",f.imageResolutionStrategy)("alt",f.alt)("title",f.title)("aria-label",f.ariaLabel)("focal-point",f.focalPoint)("height-strategy",f.height),c.xc7("padding-top",f.imageRatio),c.AVh("empty",f.empty))},inputs:{src:"src",label:"label",extendedThumbnail:"extendedThumbnail",imageResolutionStrategy:"imageResolutionStrategy",lcpPrioritized:[1,"lcpPrioritized"],height:"height"},outputs:{error:"error"},features:[c.Jv_([e.v]),c.OA$],decls:1,vars:1,consts:[["image",""],["fill","true",3,"priority","ngSrc","alt","title","error",4,"ngIf"],["fill","true",3,"error","priority","ngSrc","alt","title"]],template:function(d,f){1&d&&c.DNE(0,O,2,5,"img",1),2&d&&c.Y8G("ngIf",f.loaded&&f.src)},dependencies:[a.bT,a.kt],styles:["storefront-image{display:flex;justify-content:center;align-items:center;position:relative;background-color:var(--imageLoadingColor);transition:.2s background-color ease-in}storefront-image[height-strategy=FIXED]>img,storefront-image[height-strategy=AUTO]>img{position:absolute;width:auto;max-width:100%;top:0;object-fit:contain}storefront-image[height-strategy=DEFAULT]>img{position:static!important}storefront-image.img-with-hidden-alt{content:attr(data-alt);display:none}storefront-image>img{display:block;transition:opacity .2s ease-in,background-color .2s ease-in;background-color:#fff0;max-width:100%;max-height:100%;opacity:0}storefront-image>img.loaded{opacity:1;background-color:var(--imageBackgroundColor)}storefront-image.loaded{background:#fff0}\n"],encapsulation:2,changeDetection:0}),L})();var v=function(g){return g.AUTO="AUTO",g.FIXED="FIXED",g.DEFAULT="DEFAULT",g}(v||{})},4403:(k,C,r)=>{r.d(C,{U:()=>e});var a=r(177),c=r(3953);let e=(()=>{var _;class I{}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275mod=c.$C({type:_}),_.\u0275inj=c.G2t({imports:[a.MD]}),I})()},4744:(k,C,r)=>{r.d(C,{z:()=>Rt});var a=r(467),c=r(177),e=r(3953),_=r(4404),h=r(362),y=r(4412),p=r(5964),m=r(6354),O=r(6697),D=r(6843),v=r(4452),g=r(8179),L=r(5102),T=r(9745),d=r(4945),f=r(8251),P=r(4004),G=r(4622),j=r(1739),X=r(610),S=r(3178),U=r(5706),w=r(8091),N=r(7879),H=r(8890),z=r(1210),W=r(2932),Y=r(3092),M=r(4365),Z=r(20),Q=r(8004),J=r(9516),q=r(244),ee=r(6889),te=r(1652),se=r(5820),ne=r(4748),oe=r(680),ie=r(8909),re=r(7240),ae=r(6600),le=r(395),ce=r(2914),_e=r(2813);const K=o=>[o],ue=o=>({path:o}),pe=()=>({path:""}),ge=()=>[];function de(o,l){if(1&o){const n=e.RV6();e.j41(0,"div",10),e.nrm(1,"span",11),e.j41(2,"button",12),e.bIt("click",function(){e.eBV(n);const t=e.XpG(2);return e.Njj(t.reload())}),e.k0s()()}if(2&o){const n=e.XpG(2);e.R7$(),e.Y8G("storefrontTranslateArgs",e.eq3(1,K,n.dataSourceError.code))}}function fe(o,l){if(1&o&&(e.qex(0),e.j41(1,"div",4),e.nrm(2,"storefront-image",5),e.k0s(),e.j41(3,"div",6),e.nrm(4,"h3",7)(5,"div",8),e.k0s(),e.DNE(6,de,3,3,"div",9),e.bVm()),2&o){const n=e.XpG();e.R7$(2),e.Y8G("height","FIXED"),e.R7$(4),e.Y8G("ngIf",n.dataSourceError)}}function me(o,l){1&o&&e.eu8(0)}function he(o,l){if(1&o){const n=e.RV6();e.j41(0,"a",16),e.nI1(1,"urlTransform"),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.DNE(2,me,1,0,"ng-container",17),e.k0s()}if(2&o){const n=e.XpG().ngIf;e.XpG();const s=e.sdS(6),t=e.XpG();e.Y8G("href",e.i5U(1,2,n,t.context),e.B4B),e.R7$(2),e.Y8G("ngTemplateOutlet",s)}}function Ee(o,l){1&o&&e.eu8(0)}function ve(o,l){if(1&o){const n=e.RV6();e.j41(0,"a",18),e.nI1(1,"urlTransform"),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickIssue(t))}),e.DNE(2,Ee,1,0,"ng-container",19),e.k0s()}if(2&o){const n=e.XpG().ngIf;e.XpG();const s=e.sdS(8),t=e.XpG();e.AVh("expanded",t.descriptionExpanded),e.Y8G("href",e.i5U(1,5,n,t.context),e.B4B),e.R7$(2),e.Y8G("ngTemplateOutlet",s)("ngTemplateOutletContext",e.eq3(8,ue,n))}}function Ie(o,l){if(1&o&&(e.qex(0),e.DNE(1,he,3,5,"a",14)(2,ve,3,10,"a",15),e.bVm()),2&o){const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.cover),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.allData)}}function Ce(o,l){1&o&&e.eu8(0)}function be(o,l){if(1&o){const n=e.RV6();e.j41(0,"div",22),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.DNE(1,Ce,1,0,"ng-container",17),e.k0s()}if(2&o){e.XpG(2);const n=e.sdS(6);e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function Te(o,l){if(1&o){const n=e.RV6();e.j41(0,"div",23),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickIssue(t))}),e.eu8(1,24),e.k0s()}if(2&o){e.XpG(2);const n=e.sdS(8),s=e.XpG();e.AVh("expanded",s.descriptionExpanded),e.R7$(),e.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",e.lJ4(4,pe))}}function De(o,l){if(1&o&&e.DNE(0,be,2,1,"div",20)(1,Te,2,5,"div",21),2&o){const n=e.XpG(2);e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.cover),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.allData)}}function Oe(o,l){1&o&&e.nrm(0,"storefront-spinner")}function Re(o,l){1&o&&(e.j41(0,"div",28),e.nrm(1,"span",29),e.k0s())}function xe(o,l){if(1&o&&e.nrm(0,"storefront-progress",30),2&o){const n=e.XpG(3);e.Y8G("type",n.getProgressType())("progress",n.installState.progress)}}function Ae(o,l){if(1&o&&(e.nrm(0,"storefront-image",25),e.DNE(1,Oe,1,0,"storefront-spinner",3)(2,Re,2,0,"div",26)(3,xe,1,2,"storefront-progress",27)),2&o){const n=e.XpG(2);e.Y8G("lcpPrioritized",0===(null==n.context?null:n.context.entryIndex)&&(null==n.config?null:n.config.lcpPrioritized))("src",n.issue.thumbnails&&n.issue.thumbnails.default)("imageResolutionStrategy",null==n.config?null:n.config.imageResolutionStrategy)("height",n.getImageHeight())("extendedThumbnail",null==n.issue||null==n.issue.thumbnailsExtended?null:n.issue.thumbnailsExtended.default)("label",null==n.issue?null:n.issue.name),e.R7$(),e.Y8G("ngIf",n.coverLoading),e.R7$(),e.Y8G("ngIf",n.showUpdateBehavior()),e.R7$(),e.Y8G("ngIf",n.showProgress())}}function ye(o,l){if(1&o){const n=e.RV6();e.j41(0,"h3",46),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.nrm(1,"span",47),e.k0s()}if(2&o){const n=e.XpG(3);e.R7$(),e.Y8G("storefrontTranslate",n.config.publicationTitleMessage)("storefrontTranslateArgs",e.eq3(2,K,n.publication&&n.publication.name))}}function Pe(o,l){if(1&o){const n=e.RV6();e.j41(0,"h3",48),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickCover(t))}),e.nrm(1,"span",47),e.k0s()}if(2&o){const n=e.XpG(3);e.R7$(),e.Y8G("storefrontTranslate",n.config.titleMessage)("storefrontTranslateArgs",e.eq3(2,K,n.issue.name))}}function Se(o,l){1&o&&e.nrm(0,"i",49)}function ke(o,l){if(1&o&&(e.j41(0,"div",50),e.EFF(1),e.nI1(2,"storefrontDate"),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.SpI(" ",e.bMT(2,1,n.issue.publicationDate)," ")}}function Le(o,l){if(1&o&&e.nrm(0,"div",51),2&o){const n=e.XpG(3);e.Y8G("storefrontTranslate",n.config.descriptionMessage)("storefrontTranslateArgs",e.eq3(2,K,n.issue.description))}}function Me(o,l){if(1&o){const n=e.RV6();e.j41(0,"span",52),e.bIt("click",function(){e.eBV(n);const t=e.XpG(3);return e.Njj(t.descriptionExpanded=!t.descriptionExpanded)}),e.nrm(1,"span",53)(2,"i",54),e.k0s()}if(2&o){const n=e.XpG(3);e.R7$(),e.Y8G("storefrontTranslate",n.descriptionExpanded?"ISSUE_DESCRIPTION_TOGGLE_COLLAPSE":"ISSUE_DESCRIPTION_TOGGLE_EXPAND")}}function Be(o,l){if(1&o&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.nrm(3,"i"),e.k0s()),2&o){const n=l.$implicit;e.ZWY("issue-property issue-property-",n.key," issue-property-",n.key,"-",n.value,""),e.R7$(2),e.JRh(n.value),e.R7$(),e.ee0("'icon icon-",n.key," icon-",n.value," icon-",n.key,"-",n.value,"")}}function Ue(o,l){if(1&o&&(e.j41(0,"div",55),e.DNE(1,Be,4,12,"div",56),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.visibleProperties)("ngForTrackBy",n.trackByProperty)}}function Ge(o,l){if(1&o&&(e.j41(0,"div",59)(1,"span"),e.EFF(2),e.k0s(),e.nrm(3,"i"),e.k0s()),2&o){const n=l.$implicit;e.ZvI("issue-category issue-category-",n.id,""),e.R7$(2),e.JRh(n.name||n.id),e.R7$(),e.ZvI("icon icon-",n.id,"")}}function we(o,l){if(1&o&&(e.j41(0,"div",57),e.DNE(1,Ge,4,7,"div",58),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.displayedCategories)("ngForTrackBy",n.trackByCategory)}}function Ne(o,l){if(1&o&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.nrm(3,"i"),e.k0s()),2&o){const n=l.$implicit;e.ZvI("issue-tag issue-tag-",n,""),e.R7$(2),e.JRh(n),e.R7$(),e.ZvI("icon icon-",n,"")}}function Ke(o,l){if(1&o&&(e.j41(0,"div",60),e.DNE(1,Ne,4,7,"div",56),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.tags)("ngForTrackBy",n.trackByTag)}}function $e(o,l){if(1&o&&e.nrm(0,"div",47),2&o){const n=l.$implicit;e.ZvI("issue-custom-message ",n.class||"",""),e.Y8G("storefrontTranslate",n.message)("storefrontTranslateArgs",n.variables||e.lJ4(5,ge))}}function je(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",61),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickShare(t))}),e.k0s()}}function Xe(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",62),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(3);return e.Njj(i.onClickBookmark(t))}),e.k0s()}if(2&o){const n=e.XpG(3);e.ZvI("icon ",n.bookmark?"icon-bookmark-active":"icon-bookmark","")}}function We(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Ye(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",65),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickRead(t))}),e.nrm(1,"span",66),e.DNE(2,We,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.openLoading),e.R7$(2),e.Y8G("ngIf",n.openLoading)}}function Fe(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Ve(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",69),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickPreview(t))}),e.nrm(1,"span",70),e.DNE(2,Fe,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.previewLoading),e.R7$(2),e.Y8G("ngIf",n.previewLoading)}}function He(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function ze(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",74),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(7);return e.Njj(i.onClickCancel(t))}),e.nrm(1,"span",75),e.DNE(2,He,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(7);e.Y8G("disabled",n.deleteLoading),e.R7$(2),e.Y8G("ngIf",n.deleteLoading)}}function Ze(o,l){if(1&o&&(e.qex(0),e.DNE(1,ze,3,2,"button",73),e.bVm()),2&o){const n=e.XpG(6);e.R7$(),e.Y8G("ngIf",n.showCancel())}}function Qe(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Je(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",76),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(6);return e.Njj(i.onClickDownload(t))}),e.nrm(1,"span",77),e.DNE(2,Qe,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(6);e.Y8G("disabled",n.downloadLoading),e.R7$(2),e.Y8G("ngIf",n.downloadLoading)}}function qe(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function et(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",78),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(6);return e.Njj(i.onClickDelete(t))}),e.nrm(1,"span",79),e.DNE(2,qe,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(6);e.Y8G("disabled",n.deleteLoading),e.R7$(2),e.Y8G("ngIf",n.deleteLoading)}}function tt(o,l){if(1&o&&(e.qex(0),e.DNE(1,Ze,2,1,"ng-container",3)(2,Je,3,2,"button",71)(3,et,3,2,"button",72),e.bVm()),2&o){const n=e.XpG(5);e.R7$(),e.Y8G("ngIf",n.installState.downloading),e.R7$(),e.Y8G("ngIf",!n.installState.downloading&&"COMPLETE"!==n.installState.installState&&!n.deleteLoading),e.R7$(),e.Y8G("ngIf",n.showDelete())}}function st(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function nt(o,l){if(1&o&&e.nrm(0,"storefront-progress",82),2&o){const n=e.XpG(7);e.Y8G("type",n.getProgressType())("progress",n.installState.progress)}}function ot(o,l){if(1&o&&(e.j41(0,"p",83),e.EFF(1),e.k0s()),2&o){const n=e.XpG(7);e.R7$(),e.SpI(" ",n.installState.progress,"% ")}}function it(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",62),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(6);return e.Njj(i.onClickState(t))}),e.nrm(1,"span",53),e.DNE(2,st,1,0,"storefront-spinner",67)(3,nt,1,2,"storefront-progress",80)(4,ot,2,1,"p",81),e.k0s()}if(2&o){const n=e.XpG(6);e.ZWY("button-state action-button ",n.installState.downloading?"button-state-downloading":""," ","button-state-"+n.installState.installState," ",n.deleteLoading||n.downloadLoading?"button-state-loading":"",""),e.R7$(),e.Y8G("storefrontTranslate",n.getStateText()),e.R7$(),e.Y8G("ngIf",n.deleteLoading||n.downloadLoading),e.R7$(),e.Y8G("ngIf",n.showProgress(!0)),e.R7$(),e.Y8G("ngIf",n.showProgress(!0))}}function rt(o,l){if(1&o&&(e.qex(0),e.DNE(1,it,5,9,"button",43),e.bVm()),2&o){const n=e.XpG(5);e.R7$(),e.Y8G("ngIf",n.installState)}}function at(o,l){if(1&o&&(e.qex(0),e.DNE(1,tt,4,3,"ng-container",3)(2,rt,2,1,"ng-container",3),e.bVm()),2&o){const n=e.XpG(4);e.R7$(),e.Y8G("ngIf","MULTI"===n.downloadOptions.buttonType),e.R7$(),e.Y8G("ngIf","SINGLE"===n.downloadOptions.buttonType)}}function lt(o,l){if(1&o&&(e.qex(0),e.DNE(1,Ye,3,2,"button",63)(2,Ve,3,2,"button",64)(3,at,3,2,"ng-container",3),e.bVm()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",!n.locked),e.R7$(),e.Y8G("ngIf",n.locked&&n.hasPreview()),e.R7$(),e.Y8G("ngIf",n.downloadOptions&&!n.locked)}}function ct(o,l){1&o&&e.nrm(0,"span",92)}function _t(o,l){1&o&&e.nrm(0,"span",93)}function ut(o,l){if(1&o&&e.nrm(0,"span",94),2&o){const n=e.XpG(5);e.Y8G("storefrontTranslateArgs",e.eq3(1,K,n.price&&n.price.formattedPrice))}}function pt(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function gt(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",88),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickPurchase(t))}),e.DNE(1,ct,1,0,"span",89)(2,_t,1,0,"span",90)(3,ut,1,3,"span",91)(4,pt,1,0,"storefront-spinner",67),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("ngClass",n.getPriceState())("disabled",!n.price||n.purchaseLoading),e.R7$(),e.Y8G("ngIf",!n.visible||n.priceLoading),e.R7$(),e.Y8G("ngIf",n.visible&&!n.priceLoading&&!n.price),e.R7$(),e.Y8G("ngIf",n.price),e.R7$(),e.Y8G("ngIf",n.purchaseLoading)}}function dt(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",95),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickSubscribe(t))}),e.k0s()}}function ft(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",96),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickLogin(t))}),e.k0s()}}function mt(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",97),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickCoupon(t))}),e.k0s()}}function ht(o,l){if(1&o&&(e.qex(0),e.DNE(1,gt,5,6,"button",84)(2,dt,1,0,"button",85)(3,ft,1,0,"button",86)(4,mt,1,0,"button",87),e.bVm()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.purchaseOptions.purchase),e.R7$(),e.Y8G("ngIf",n.purchaseOptions.subscribe),e.R7$(),e.Y8G("ngIf",!n.loggedIn&&n.purchaseOptions.login),e.R7$(),e.Y8G("ngIf",n.purchaseOptions.coupon)}}function Et(o,l){if(1&o&&(e.qex(0),e.nrm(1,"storefront-button",98),e.bVm()),2&o){const n=l.$implicit,s=e.XpG(3);e.R7$(),e.Y8G("baseConfig",n)("disableAnchor",!0)("baseContext",s.context)}}function vt(o,l){if(1&o&&e.nrm(0,"storefront-progress",103),2&o){const n=e.XpG(4);e.Y8G("progress",n.installState.progress)("type",n.getProgressType())("showBorder",!0)}}function It(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",104),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickDownload(t))}),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.downloadLoading)}}function Ct(o,l){if(1&o){const n=e.RV6();e.j41(0,"button",105),e.bIt("click",function(t){e.eBV(n);const i=e.XpG(4);return e.Njj(i.onClickDelete(t))}),e.k0s()}if(2&o){const n=e.XpG(4);e.Y8G("disabled",n.deleteLoading)}}function bt(o,l){1&o&&e.nrm(0,"storefront-spinner",68)}function Tt(o,l){if(1&o&&(e.j41(0,"div",99),e.DNE(1,vt,1,3,"storefront-progress",100)(2,It,1,1,"button",101)(3,Ct,1,1,"button",102)(4,bt,1,0,"storefront-spinner",67),e.k0s()),2&o){const n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.showProgress(!0)),e.R7$(),e.Y8G("ngIf",!n.locked&&"COMPLETE"!==n.installState.installState&&!n.installState.downloading&&!n.downloadLoading),e.R7$(),e.Y8G("ngIf",n.showDelete()||n.showCancel()),e.R7$(),e.Y8G("ngIf",n.downloadLoading)}}function Dt(o,l){if(1&o&&(e.DNE(0,ye,2,4,"h3",31)(1,Pe,2,4,"h3",32)(2,Se,1,0,"i",33)(3,ke,3,3,"div",34)(4,Le,1,4,"div",35)(5,Me,3,1,"span",36)(6,Ue,2,2,"div",37)(7,we,2,2,"div",38)(8,Ke,2,2,"div",39)(9,$e,1,6,"div",40),e.j41(10,"div",41),e.DNE(11,je,1,0,"button",42)(12,Xe,1,3,"button",43)(13,lt,4,3,"ng-container",3)(14,ht,5,4,"ng-container",3)(15,Et,2,3,"ng-container",44),e.k0s(),e.DNE(16,Tt,5,4,"div",45)),2&o){const n=e.XpG(2);e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.publication),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.title),e.R7$(),e.Y8G("ngIf",n.showCheck()),e.R7$(),e.Y8G("ngIf",n.issue.publicationDate&&(!n.config.hideComponents||!n.config.hideComponents.publicationDate)),e.R7$(),e.Y8G("ngIf",n.issue.description&&(!n.config.hideComponents||!n.config.hideComponents.description)),e.R7$(),e.Y8G("ngIf",n.issue.description&&(!n.config.hideComponents||!n.config.hideComponents.description)),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.properties),e.R7$(),e.Y8G("ngIf",!(n.config.displayCategories&&"NOTHING"===n.config.displayCategories.mode||n.config.hideComponents&&n.config.hideComponents.categories)),e.R7$(),e.Y8G("ngIf",!n.config.hideComponents||!n.config.hideComponents.tags),e.R7$(),e.Y8G("ngForOf",n.customMessages)("ngForTrackBy",n.trackByMessage),e.R7$(2),e.Y8G("ngIf",n.config.sharing),e.R7$(),e.Y8G("ngIf",n.config.bookmark),e.R7$(),e.Y8G("ngIf",n.installState),e.R7$(),e.Y8G("ngIf",n.purchaseOptions&&n.locked),e.R7$(),e.Y8G("ngForOf",n.customButtons)("ngForTrackBy",n.trackByButton),e.R7$(),e.Y8G("ngIf",n.installState)}}function Ot(o,l){if(1&o&&(e.qex(0),e.DNE(1,Ie,3,2,"ng-container",13),e.nI1(2,"async"),e.DNE(3,De,2,2,"ng-template",null,0,e.C5r)(5,Ae,4,9,"ng-template",null,1,e.C5r)(7,Dt,17,18,"ng-template",null,2,e.C5r),e.bVm()),2&o){const n=e.sdS(4),s=e.XpG();e.R7$(),e.Y8G("ngIf",e.bMT(2,2,s.issuePath$))("ngIfElse",n)}}let Rt=(()=>{var o;class l extends z.${constructor(s,t,i,u,R,x,E,A,B,$,F,xt,At,yt,Pt,V,St,kt){super(x,s,A,$,V),this.elementRef=s,this.ngZone=t,this.changeDetectorRef=i,this.store=u,this.dialog=R,this.injector=x,this.eventActionService=E,this.contextService=A,this.cleanUpService=B,this.document=$,this.platformId=F,this.purpleEnv=xt,this.transferState=At,this.purpleService=yt,this.urlResolver=Pt,this.globalService=V,this.anchorService=St,this.ssrService=kt,this.defaultConfig={...M.Mw},this.priceLoading=!1,this.purchaseLoading=!1,this.downloadLoading=!1,this.deleteLoading=!1,this.openLoading=!1,this.previewLoading=!1,this.coverLoading=!1,this.bookmarkLoading=!1,this.descriptionExpanded=!1,this.downloadError=null,this.dataSourceError=null,this.visible=!1,this.anchorFeatureEnabled=!1,this.anchorPathCover=null,this.visibleProperties=[],this.issuePath$=new y.t(null),this.purchaseConfig={...M.Rp}}get purchasable(){var s;return(null===(s=this.issue)||void 0===s?void 0:s.access)===_.Access.PURCHASABLE}get hasError(){var s;return!(!this.dataSourceError||null!==(s=this.dataSource)&&void 0!==s&&s.hasData())}get issueType(){return this.issue&&(0,U.xl)(this.issue)&&this.issue.type}get contentType(){var s;return null===(s=this.issue)||void 0===s?void 0:s.contentType}get postType(){return this.issue&&(0,U.mF)(this.issue)?this.issue.postType:void 0}get contextKey(){var s;return(null!==(s=this.issueContextKey)&&void 0!==s?s:this.context.content)?"content":"issue"}get issueContextKey(){var s,t;return null!==(s=null===(t=this.config)||void 0===t?void 0:t.issueContextKey)&&void 0!==s?s:this.baseConfig.issueContextKey}get contextContent(){var s,t;return null!==(s=null!==(t=this.context[this.issueContextKey])&&void 0!==t?t:this.context.content)&&void 0!==s?s:this.context.issue}ngOnInit(){this.anchorFeatureEnabled=this.anchorService.isAnchorFeatureEnabled(),this.anchorFeatureEnabled||this.issuePath$.next(null),super.ngOnInit(),this.store.select((0,d.jZ)(D.O.DOWNLOAD_OPTIONS),s=>this.updateBehavior=null==s?void 0:s.autoUpdateBehavior)}get taxonomies(){var s;return null!==(s=this.issue.taxonomies)&&void 0!==s?s:[]}get categories(){return this.taxonomies.filter(s=>"category"===s.type).map(s=>s.id)}get tags(){return this.taxonomies.filter(s=>"tag"===s.type).map(s=>s.id)}ngOnDestroy(){super.ngOnDestroy(),this.downloadHandler&&this.ngZone.runOutsideAngular(()=>{setTimeout(()=>this.purpleService.destroyDownloadHandler(this.downloadHandler),1e3)}),this.dataSource&&this.contextService.unregisterDataSource(this.dataSource),this.trackingObserver&&this.trackingObserver.disconnect()}onConfigChanges(){var s=this;return(0,a.A)(function*(){var t;const i=s.issue,u=(0,g.v3)(s.config.dataSource),R={...u,limit:1};var x;if(s.loggedIn=!!s.context[_.METADATA_KEY.ENTITLEMENT_TOKEN],s.dataSource&&!s.dataSource.hasConfigChanged(R)&&s.issue)return s.context[null!==(x=s.issueContextKey)&&void 0!==x?x:"issue"]=i,s.updateConfig(i),void s.changeDetectorRef.detectChanges();if(u)delete s.issue,delete s.dataSourceError,s.changeDetectorRef.detectChanges(),s.dataSource=(0,v.O8)(s.injector,R,s.elementRef.nativeElement,s.document),s.store.subscribe(s.dataSource.data$.pipe((0,p.p)(A=>A&&!!A[0])),A=>{var B;const $=s.issue;s.issue=A[0],(0,L.GA)(s.issue,s.purpleService).then(F=>s.locked=F),s.context[null!==(B=s.issueContextKey)&&void 0!==B?B:"issue"]=s.issue,s.updateConfig($)},S.lQ,S.lQ,"data"),s.store.subscribe(s.dataSource.error$,A=>s.dataSourceError=A,S.lQ,S.lQ,"error"),yield s.dataSource.loadData();else{const A=s.contextContent;var E;"object"!=typeof A||s.issue&&(!A||s.purchaseLoading)?s.context[null!==(E=s.issueContextKey)&&void 0!==E?E:"issue"]=s.issue:(s.issue=A,(0,L.GA)(s.issue,s.purpleService).then(B=>s.locked=B)),s.updateConfig(i)}void 0===s.issue&&(null===(t=s.baseContext)||void 0===t||!t.isGhost)&&(0,c.UE)(s.platformId)&&s.ngZone.runOutsideAngular(()=>{setTimeout(()=>{void 0===s.issue&&s.ngZone.run(()=>s.dataSourceError={code:_.ERROR_CODE.ISSUE_NOT_FOUND})},1e3)})})()}updateConfig(s){var t=this;return(0,a.A)(function*(){var i;const u={...t.context};u.publication||(u.publication=t.publication),t.config=(0,g.uQ)({...M.Mw,...t.baseConfig},u,t.contextService.$functions,t.globalService.getGlobalData());const R=(0,g.v3)(t.config.purchaseOptions);R&&(t.purchaseOptions=Object.keys(R).reduce((E,A)=>({...E,[A]:(0,g.v3)(R[A])}),{}),t.purchaseOptions.purchase&&"object"==typeof t.purchaseOptions.purchase&&(t.purchaseConfig={...M.Rp,...t.purchaseOptions.purchase})),t.handleAnchorTags();const x={buttonClass:"action-button"};t.customButtons=t.config.customButtons.filter(E=>(0,g.Ol)(E)).map(E=>(0,g.v3)(E)).map(E=>({...x,...E,buttonClass:E.buttonClass?x.buttonClass.concat(" ",E.buttonClass):x.buttonClass})),t.customMessages=t.config.customMessages.filter(E=>(0,g.Ol)(E)).map(E=>(0,g.v3)(E)),t.downloadOptions=(0,g.v3)(t.config.downloadOptions),JSON.stringify(s)!==JSON.stringify(t.issue)&&t.loadOnVisible(),t.visibleProperties=(null!==(i=t.config.renderProperties)&&void 0!==i?i:[]).map(E=>(0,g.v3)(E)).filter(E=>!!E&&void 0!==t.issue.properties[E]).map(E=>({key:E,value:t.issue.properties[E]})),t.issue&&t.setDisplayCategories(),t.changeDetectorRef.markForCheck()})()}setDisplayCategories(){var s,t;switch(null!==(s=null===(t=this.config.displayCategories)||void 0===t?void 0:t.mode)&&void 0!==s?s:"SLUG"){case"SLUG":this.displayedCategories=this.taxonomies.filter(u=>"category"===u.type).map(u=>({id:u.id}));break;case"NAME":this.displayedCategories=this.taxonomies.filter(u=>"category"===u.type)}}handleAnchorTags(){var s=this;return(0,a.A)(function*(){if(!s.anchorFeatureEnabled)return;s.anchorPathCover=s.anchorService.getAnchorPathForEventAction(s.config.tapCover,s.context);const t=yield s.anchorService.getAnchorPathForContent(s.issue);t&&s.issuePath$.next(t)})()}loadOnVisible(){var s=this;if(this.installState=null,this.price=null,this.deleteLoading=!1,this.downloadLoading=!1,this.purchaseLoading=!1,this.previewLoading=!1,this.priceLoading=!1,this.openLoading=!1,this.bookmarkLoading=!1,!this.isGhost()){if(this.config.trackVisible){const i=!0===this.config.trackVisible?0:this.config.trackVisible.trackDelay;let R,x=E=>{E[0].isIntersecting?R=setTimeout(()=>{this.getDownloadHandler().then(function(){var A=(0,a.A)(function*(B){s.publication||(yield s.loadPublication()),s.handleTrackAction("VISIBLE",B)});return function(B){return A.apply(this,arguments)}}())},i):clearTimeout(R)};this.trackingObserver=new IntersectionObserver(x,{rootMargin:"0px",threshold:!0===this.config.trackVisible?1:this.config.trackVisible.minIssueVisibility}),this.trackingObserver.observe(this.elementRef.nativeElement)}this.store.subscribe((0,H.eh)(this,this.elementRef,{skipWait:this.purpleEnv.isUniversal&&!this.ssrService.currentPrebootStatus}),t=>{this.visible=!0,this.loadIssueState(),this.loadPublication(),this.loadPrice(),this.loadBookmark(),this.purpleService.addInvalidationListener((0,a.A)(function*(){var i;s.dataSource&&(s.issue=yield s.purpleService.getIssue(s.issue.id).catch(()=>null),s.locked=yield(0,L.GA)(s.issue,s.purpleService),s.context[null!==(i=s.issueContextKey)&&void 0!==i?i:"issue"]=s.issue,s.updateConfig(s.issue)),s.loadPrice()}))},S.lQ,S.lQ,"visible")}}loadIssueState(){var s=this;return(0,a.A)(function*(){!s.issue||!s.downloadOptions||(yield s.getDownloadHandler(),s.downloadHandler&&(s.store.subscribe(s.downloadHandler.updates$,t=>{s.installState=t,t&&t.error&&!s.downloadError&&(s.downloadError=t.error),s.changeDetectorRef.detectChanges()},S.lQ,S.lQ,"installState"),s.downloadHandler.autoUpdate&&s.downloadHandler.downloadStarted&&s.downloadHandler.update()),s.changeDetectorRef.detectChanges())})()}loadPrice(){var s=this;return(0,a.A)(function*(){if(s.purchaseOptions&&s.locked){var t;s.priceLoading=!0;const i=s.issue.productId||(null===(t=yield s.purpleService.getRepeatablePublicationProductByPublicationId(s.issue.publicationId))||void 0===t?void 0:t.productId);i?(s.store.select((0,G.Zt)(i),u=>{(0,j.b)(u)||(s.price=u),s.priceLoading=!1}),s.store.dispatch((0,P.qF)({productId:i}))):s.priceLoading=!1}})()}loadPublication(){var s=this;return(0,a.A)(function*(){if(s.issue)try{const t=s.issue.publicationId,i=(0,e.zw6)("publication_".concat(t));s.transferState.hasKey(i)?(s.publication=s.transferState.get(i,null),(0,c.UE)(s.platformId)&&s.transferState.remove(i)):(s.publication=yield s.purpleService.getPublication(t),(0,c.Vy)(s.platformId)&&s.transferState.onSerialize(i,()=>s.publication)),yield s.updateConfig(s.issue),s.changeDetectorRef.detectChanges()}catch{console.log("error loading publication for issue",s)}})()}loadBookmark(){var s=this;return(0,a.A)(function*(){s.config.bookmark&&s.store.subscribe(s.purpleService.bookmarks.pipe((0,m.T)(t=>t.find(i=>i.issueId===s.issue.id))),t=>s.bookmark=t,S.lQ,S.lQ,"bookmark")})()}getData(){return this.issue}getImageHeight(){return this.config.coverHeight||this.getDefaultImageHeight()}hasPreview(){return(0,U.xl)(this.issue)?!!this.issue.previewIssue:(0,U.mF)(this.issue)?!!this.issue.previewContentHtml:!(0,U.G4)(this.issue)&&void 0}getDefaultImageHeight(){return this.template===M.W9.DETAILS?W.q.AUTO:W.q.FIXED}onClickDownload(s){var t=this;return(0,a.A)(function*(){s.stopPropagation(),t.downloadLoading=!0,delete t.downloadError,t.changeDetectorRef.detectChanges();const i=yield t.getDownloadHandler();if(t.handleTrackAction("DOWNLOAD_CLICKED",i),i){if(t.purpleService.downloadOptions.showConfirmDownloadDialog){const u={issue:t.issue};try{yield t.dialog.confirm({text:"ISSUE_DOWNLOAD_CONFIRM_MESSAGE",args:[u]},{text:"ISSUE_DOWNLOAD_CONFIRM_TITLE",args:[u]},"ISSUE_DOWNLOAD_CONFIRM_OK","ISSUE_DOWNLOAD_CONFIRM_CANCEL")}catch{return t.handleTrackAction("DOWNLOAD_CONFIRM_CANCELLED",i,void 0,"_COLLECTION"),void(t.downloadLoading=!1)}}try{yield i.download(),t.cleanUpService.addIssue(t.issue.id),t.installState.downloading=!0,t.installState.installState=_.ContentInstallState.INCOMPLETE,t.installState.progress=0}catch(u){console.error(u),u.code===_.ERROR_CODE.PAYMENT_REQUIRED&&t.purpleService.invalidate()}}t.downloadLoading=!1,t.changeDetectorRef.detectChanges()})()}onClickDelete(s){var t=this;return(0,a.A)(function*(){if(s.stopPropagation(),t.config.deleteConfirm)try{yield t.dialog.confirm({text:"ISSUE_DELETE_MESSAGE",args:[t.issue.name]},"ISSUE_DELETE_TITLE","ISSUE_DELETE_CONFIRM","ISSUE_DELETE_CANCEL"),yield t.deleteIssue()}catch{}else yield t.deleteIssue()})()}onClickCancel(s){var t=this;return(0,a.A)(function*(){if(s.stopPropagation(),!t.deleteLoading)try{t.deleteLoading=!0,delete t.downloadError,t.changeDetectorRef.detectChanges(),t.getDownloadHandler().then(i=>t.handleTrackAction("CANCEL_CLICKED",i)),t.cleanUpService.removeIssue(t.issue.id),t.downloadHandler&&(yield t.downloadHandler.delete()),t.deleteLoading=!1,t.changeDetectorRef.detectChanges(),t.delete.emit(t.issue)}catch(i){console.log(i),t.deleteLoading=!1,t.changeDetectorRef.detectChanges()}})()}onClickRead(s){var t=this;return(0,a.A)(function*(){t.contextService.closeModal(t.elementRef.nativeElement),t.contextService.closeModalSubject.observers.length>0?t.contextService.closeModalCompleteSubject.pipe((0,O.s)(t.contextService.closeModalSubject.observers.length)).subscribe(()=>{},()=>{},(0,a.A)(function*(){t.openContent("READ_CLICKED")})):t.openContent("READ_CLICKED")})()}onClickPurchase(s){var t=this;return(0,a.A)(function*(){var i;s.stopPropagation(),t.purchaseLoading=!0,t.changeDetectorRef.detectChanges();const u={...t.purchaseConfig,productId:t.price.productId,price:t.price.price,currency:t.price.currency};t.issue.productId!==(null===(i=t.price)||void 0===i?void 0:i.productId)&&(u.consumeOptions={issueIds:[],contentIds:[t.issue.id]}),yield t.eventActionService.processPurchaseAction(u,t),t.purchaseLoading=!1,t.changeDetectorRef.detectChanges()})()}onClickPreview(s){var t=this;return(0,a.A)(function*(){t.contextService.closeModal(t.elementRef.nativeElement),t.contextService.closeModalSubject.observers.length>0?t.contextService.closeModalCompleteSubject.pipe((0,O.s)(t.contextService.closeModalSubject.observers.length)).subscribe(()=>{},()=>{},(0,a.A)(function*(){t.openContent("PREVIEW_CLICKED")})):t.openContent("PREVIEW_CLICKED")})()}onClickSubscribe(s){s.stopPropagation(),this.getDownloadHandler().then(t=>this.handleTrackAction("SUBSCRIBE_CLICKED",t)),this.eventActionService.processEventAction({type:T.H.SUBSCRIPTIONS,params:{issue:this.issue.id,publication:this.issue.publicationId}},this)}onClickLogin(s){s.stopPropagation(),this.getDownloadHandler().then(t=>this.handleTrackAction("LOGIN_CLICKED",t)),this.eventActionService.processEventAction({type:T.H.LOGIN,params:{issue:this.issue.id,publication:this.issue.publicationId}},this)}onClickCoupon(s){s.stopPropagation(),this.getDownloadHandler().then(t=>this.handleTrackAction("COUPON_CLICKED",t)),this.eventActionService.processEventAction({type:T.H.COUPON,params:{issue:this.issue.id,publication:this.issue.publicationId}},this)}getId(){return this.issue&&this.issue.id}getTrackingBaseKey(s,t){return this.elementId||s&&"".concat(s.getContentType(t))||this.getType()}getTrackingParams(s){const t=(0,N.bJ)(this.issue,this.publication,this.price);return{...s&&(0,N.Gw)(s.getContentType())?(0,N.bJ)(s.content,s.publication,this.price,"SOURCE_"):{},...t}}handleTrackAction(s,t,i,u){const R="".concat(this.getTrackingBaseKey(t,u),"_").concat(s);let x=i?(0,N.aM)(i):{};x={...x,...this.getTrackingParams(t)},this.store.dispatch((0,X.k4)({url:"".concat(window.location.href),key:R,params:x}))}onClickCover(s){this.clickIssueAction(s,"tapCover","COVER_CLICKED")}onClickIssue(s){this.clickIssueAction(s,"tapIssue","ISSUE_CLICKED")}clickIssueAction(s,t,i){var u=this;return(0,a.A)(function*(){u.anchorFeatureEnabled&&s.preventDefault();const R=(0,g.v3)(u.config[t]);if(R){if(s.stopPropagation(),u.coverLoading)return;u.coverLoading=!0,u.changeDetectorRef.detectChanges(),u.getDownloadHandler().then(x=>u.handleTrackAction(i,x)),yield u.eventActionService.processEventAction(R,u),u.coverLoading=!1,u.changeDetectorRef.detectChanges()}})()}isGhost(){return!(this.issue&&this.issue.id||this.dataSourceError)}onClickState(s){var t=this;return(0,a.A)(function*(){if(s.stopPropagation(),t.installState)return t.installState.downloading?t.onClickCancel(s):t.installState.installState===_.ContentInstallState.COMPLETE?t.onClickDelete(s):t.onClickDownload(s)})()}onClickBookmark(s){var t=this;return(0,a.A)(function*(){if(s.preventDefault(),s.stopPropagation(),!t.bookmarkLoading){if(t.bookmarkLoading=!0,t.bookmark){t.config.bookmark&&"boolean"!=typeof t.config.bookmark&&t.config.bookmark.deleteConfirm&&(yield t.dialog.confirm(t.bookmark.title?{text:"BOOKMARK_DELETE_MESSAGE_WITH_TITLE",args:[t.bookmark.title]}:"BOOKMARK_DELETE_MESSAGE","BOOKMARK_DELETE_TITLE","BOOKMARK_DELETE_CONFIRM","BOOKMARK_DELETE_CANCEL")),t.getDownloadHandler().then(i=>t.handleTrackAction("BOOKMARK_DELETE_CLICKED",i,t.bookmark));try{yield t.purpleService.deleteBookmark({id:t.bookmark.id}),t.getDownloadHandler().then(i=>t.handleTrackAction("BOOKMARK_DELETED",i,t.bookmark))}catch(i){t.dialog.alert(t.bookmark.title?{text:"ERROR_DELETE_BOOKMARK_WITH_TITLE",args:(0,w._3)((0,w.E2)(i,t.contextService),t.bookmark)}:{text:"ERROR_DELETE_BOOKMARK",args:[(0,w.E2)(i,t.contextService)]},"DIALOG_ERROR"),t.getDownloadHandler().then(u=>t.handleTrackAction("BOOKMARK_DELETE_FAILED",u,t.bookmark))}}else{t.getDownloadHandler().then(u=>t.handleTrackAction("BOOKMARK_ADD_CLICKED",u,t.bookmark));let i={title:t.issue.name,description:t.issue.description,issueId:t.issue.id,customData:{contentType:t.issue.contentType}};t.issue.thumbnails&&t.issue.thumbnails.default&&(i.thumbnailURL=t.issue.thumbnails.default),"object"==typeof t.config.bookmark&&(i={...i,...t.config.bookmark});try{yield t.purpleService.createBookmark(i),t.getDownloadHandler().then(u=>t.handleTrackAction("BOOKMARK_ADDED",u,t.bookmark))}catch(u){t.getDownloadHandler().then(R=>t.handleTrackAction("BOOKMARK_ADD_FAILED",R,t.bookmark)),t.dialog.alert({text:"ERROR_ADD_BOOKMARK",args:t.getErrorDialogArgs(u)},"DIALOG_ERROR")}}t.bookmarkLoading=!1,t.changeDetectorRef.detectChanges()}})()}onClickShare(s){var t=this;return(0,a.A)(function*(){s.stopPropagation(),t.getDownloadHandler().then(u=>t.handleTrackAction("SHARE_CLICKED",u));let i={text:t.issue.name,url:t.getSharingUrl()};"object"==typeof t.config.sharing&&(i={...i,...t.config.sharing});try{yield t.purpleService.share(i),t.getDownloadHandler().then(u=>t.handleTrackAction("SHARED",u))}catch{t.getDownloadHandler().then(R=>t.handleTrackAction("SHARE_FAILED",R)),t.dialog.alert("ERROR_SHARE","DIALOG_ERROR")}})()}getSharingUrl(){return"".concat(this.context[_.METADATA_KEY.MANAGER_BASE_URL],"/i/").concat(this.context[_.METADATA_KEY.APP_ID],"/").concat(this.issue.id,"?preview=").concat(this.contextService.isPreview())}getStateText(){return this.downloadLoading||this.deleteLoading?" ":this.installState?this.installState.downloading?"ISSUE_ACTION_CANCEL":this.installState.installState===_.ContentInstallState.COMPLETE?"ISSUE_ACTION_DELETE":"ISSUE_ACTION_DOWNLOAD":void 0}getPriceState(){return this.priceLoading?"price-loading":this.priceLoading||this.price?this.price?"price-available":"":"price-unavailable"}getConfigEscapeProperties(){return[...super.getConfigEscapeProperties(),"downloadOptions","customButtons","customMessages"]}getDownloadHandler(){var s=this;return(0,a.A)(function*(){return(0,c.UE)(s.platformId)&&((0,U.xl)(s.issue)||console.warn("tried to get download handler for "+s.issue.contentType),(!s.downloadHandler||s.downloadHandler.content.id!==s.issue.id)&&(s.downloadHandler&&(yield s.purpleService.destroyDownloadHandler(s.downloadHandler)),s.downloadHandler=yield s.purpleService.getDownloadHandler(s.issue,s.dialog))),s.downloadHandler})()}showProgress(s=!1){return!this.deleteLoading&&!this.downloadLoading&&this.installState&&this.installState.downloading&&!(this.installState.updating&&this.updateBehavior===M.FZ.SILENT)&&(s||"MULTI"===this.downloadOptions.buttonType)}showCancel(){return!this.downloadLoading&&this.installState.downloading&&!(this.installState.updating&&this.updateBehavior===M.FZ.SILENT)}showDelete(){return!this.downloadLoading&&this.installState.installState!==_.ContentInstallState.NOT_INSTALLED&&(!this.installState.downloading||this.installState.updating&&this.updateBehavior===M.FZ.SILENT)}showCheck(){return this.downloadOptions&&this.downloadOptions.statusIndicator&&this.installState&&(this.installState.installState===_.ContentInstallState.COMPLETE&&!this.locked||this.installState.updating&&this.updateBehavior===M.FZ.SILENT)}showUpdateBehavior(){if(this.installState&&(0,U.xl)(this.issue))return(0,L.YH)(this.installState,this.issue.type===_.IssueType.ISSUE)}reload(){window.location.reload()}hasContextChanged(s){var t;return!(null!==(t=this.config)&&void 0!==t&&t.dataSource)&&!h(this.contextContent,this.issue)||!h(s[_.METADATA_KEY.ENTITLEMENT_TOKEN],this.context[_.METADATA_KEY.ENTITLEMENT_TOKEN])||super.hasContextChanged(s)}deleteIssue(){var s=this;return(0,a.A)(function*(){if(!s.deleteLoading)try{s.deleteLoading=!0,delete s.downloadError,s.changeDetectorRef.detectChanges(),s.getDownloadHandler().then(t=>s.handleTrackAction("DELETE_CLICKED",t)),s.cleanUpService.removeIssue(s.issue.id),s.downloadHandler&&(yield s.downloadHandler.delete()),s.deleteLoading=!1,s.changeDetectorRef.detectChanges(),s.delete.emit(s.issue)}catch(t){console.log(t),s.deleteLoading=!1,s.changeDetectorRef.detectChanges()}})()}getProgressType(){const t=(this.config||this.baseConfig).downloadOptions;return t.progressType?t.progressType:this.template===M.W9.COVER?Y.s.RADIAL:Y.s.BAR}getErrorDialogArgs(s){return(0,w.$C)((0,w.E2)(s,this.contextService),this.issue)}getIssuePath(){var s=this;return(0,a.A)(function*(){if(s.issue&&(!s.issue.ad||s.issue.contentType)&&s.purpleEnv.isUniversal){const t=(0,e.zw6)("url_".concat(s.issue.id));if(s.transferState.hasKey(t))s.issuePath$.next(s.transferState.get(t,null));else{const i=yield s.urlResolver.getPathForContent(s.issue);s.issuePath$.next(i),(0,c.Vy)(s.platformId)&&s.transferState.set(t,i)}}})()}trackByProperty(s,t){var i;return null!==(i=null==t?void 0:t.key)&&void 0!==i?i:s}trackByCategory(s,t){var i;return null!==(i=null==t?void 0:t.id)&&void 0!==i?i:s}trackByTag(s,t){return null!=t?t:s}trackByMessage(s,t){var i;return null!==(i=null==t?void 0:t.message)&&void 0!==i?i:s}trackByButton(s,t){var i;return null!==(i=null==t?void 0:t.id)&&void 0!==i?i:s}openContent(s){var t=this;return(0,a.A)(function*(){t.openLoading=!0,t.changeDetectorRef.detectChanges(),t.getDownloadHandler().then(i=>t.handleTrackAction(s,i)),yield t.eventActionService.processOpenContentAction({type:T.H.OPEN_CONTENT,...t.config.openContent},t),t.openLoading=!1,t.changeDetectorRef.detectChanges()})()}getContextKey(){return this.contextKey}}return(o=l).type="issue",o.\u0275fac=function(s){return new(s||o)(e.rXU(e.aKT),e.rXU(e.SKi),e.rXU(e.gRc),e.rXU(f.B),e.rXU(Z.o),e.rXU(e.zZn),e.rXU(Q.G),e.rXU(J.V),e.rXU(q.I),e.rXU(c.qQ),e.rXU(e.Agw),e.rXU(N.r6),e.rXU(e.pJN),e.rXU(L.Wj),e.rXU(ee.K),e.rXU(te.d),e.rXU(se.X),e.rXU(ne.i))},o.\u0275cmp=e.VBU({type:o,selectors:[["storefront-issue"]],hostVars:9,hostBindings:function(s,t){2&s&&(e.BMQ("issue-type",t.issueType)("content-type",t.contentType)("post-type",t.postType),e.AVh("locked",t.locked)("purchasable",t.purchasable)("error",t.hasError))},features:[e.Jv_([f.B]),e.Vt3],decls:2,vars:2,consts:[["noAnchorTemplate",""],["imageTemplate",""],["issueData",""],[4,"ngIf"],[1,"issue-image"],[3,"height"],[1,"issue-data"],[1,"issue-title"],[1,"issue-description"],["class","issue-error",4,"ngIf"],[1,"issue-error"],["storefrontTranslate","ISSUE_ERROR",3,"storefrontTranslateArgs"],["storefrontTranslate","ISSUE_ERROR_BUTTON","mat-ripple","",1,"action-button",3,"click"],[4,"ngIf","ngIfElse"],["class","issue-image",3,"href","click",4,"ngIf"],["class","issue-data",3,"href","expanded","click",4,"ngIf"],[1,"issue-image",3,"click","href"],[4,"ngTemplateOutlet"],[1,"issue-data",3,"click","href"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","issue-image",3,"click",4,"ngIf"],["class","issue-data",3,"expanded","click",4,"ngIf"],[1,"issue-image",3,"click"],[1,"issue-data",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"lcpPrioritized","src","imageResolutionStrategy","height","extendedThumbnail","label"],["class","issue-update-badge",4,"ngIf"],[3,"type","progress",4,"ngIf"],[1,"issue-update-badge"],["storefrontTranslate","ISSUE_UPDATE_BADGE_MESSAGE"],[3,"type","progress"],["class","issue-publication-title",3,"click",4,"ngIf"],["class","issue-title",3,"click",4,"ngIf"],["class","icon icon-check-bg",4,"ngIf"],["class","issue-pub-date",4,"ngIf"],["class","issue-description","storefrontCheckOverflow","vertical","storefrontCheckOverflowTarget","self",3,"storefrontTranslate","storefrontTranslateArgs",4,"ngIf"],["class","issue-description-expand-toggle",3,"click",4,"ngIf"],["class","issue-properties",4,"ngIf"],["class","issue-categories",4,"ngIf"],["class","issue-tags",4,"ngIf"],[3,"class","storefrontTranslate","storefrontTranslateArgs",4,"ngFor","ngForOf","ngForTrackBy"],[1,"issue-actions"],["class","icon icon-share","mat-ripple","",3,"click",4,"ngIf"],["mat-ripple","",3,"class","click",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],["class","issue-state",4,"ngIf"],[1,"issue-publication-title",3,"click"],[3,"storefrontTranslate","storefrontTranslateArgs"],[1,"issue-title",3,"click"],[1,"icon","icon-check-bg"],[1,"issue-pub-date"],["storefrontCheckOverflow","vertical","storefrontCheckOverflowTarget","self",1,"issue-description",3,"storefrontTranslate","storefrontTranslateArgs"],[1,"issue-description-expand-toggle",3,"click"],[3,"storefrontTranslate"],[1,"icon","icon-arrow-down"],[1,"issue-properties"],[3,"class",4,"ngFor","ngForOf","ngForTrackBy"],[1,"issue-categories"],["purpleColorize","accent","purpleColorizeProps","background-color",3,"class",4,"ngFor","ngForOf","ngForTrackBy"],["purpleColorize","accent","purpleColorizeProps","background-color"],[1,"issue-tags"],["mat-ripple","",1,"icon","icon-share",3,"click"],["mat-ripple","",3,"click"],["class","button-read action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","button-preview action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["mat-ripple","",1,"button-read","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_READ"],["class","button-spinner",4,"ngIf"],[1,"button-spinner"],["mat-ripple","",1,"button-preview","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_PREVIEW"],["class","button-download action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","button-delete action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","button-cancel action-button","mat-ripple","",3,"disabled","click",4,"ngIf"],["mat-ripple","",1,"button-cancel","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_CANCEL"],["mat-ripple","",1,"button-download","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_DOWNLOAD"],["mat-ripple","",1,"button-delete","action-button",3,"click","disabled"],["storefrontTranslate","ISSUE_ACTION_DELETE"],["message","",3,"type","progress",4,"ngIf"],["class","progress-percentage",4,"ngIf"],["message","",3,"type","progress"],[1,"progress-percentage"],["class","button-purchase action-button","mat-ripple","",3,"ngClass","disabled","click",4,"ngIf"],["class","button-subscribe action-button","mat-ripple","","storefrontTranslate","ISSUE_ACTION_SUBSCRIBE",3,"click",4,"ngIf"],["class","button-login action-button","mat-ripple","","storefrontTranslate","ISSUE_ACTION_LOGIN",3,"click",4,"ngIf"],["class","button-coupon action-button","mat-ripple","","storefrontTranslate","ISSUE_ACTION_COUPON",3,"click",4,"ngIf"],["mat-ripple","",1,"button-purchase","action-button",3,"click","ngClass","disabled"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_LOADING",4,"ngIf"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_UNAVAILABLE",4,"ngIf"],["storefrontTranslate","ISSUE_ACTION_PURCHASE",3,"storefrontTranslateArgs",4,"ngIf"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_LOADING"],["storefrontTranslate","ISSUE_ACTION_PURCHASE_UNAVAILABLE"],["storefrontTranslate","ISSUE_ACTION_PURCHASE",3,"storefrontTranslateArgs"],["mat-ripple","","storefrontTranslate","ISSUE_ACTION_SUBSCRIBE",1,"button-subscribe","action-button",3,"click"],["mat-ripple","","storefrontTranslate","ISSUE_ACTION_LOGIN",1,"button-login","action-button",3,"click"],["mat-ripple","","storefrontTranslate","ISSUE_ACTION_COUPON",1,"button-coupon","action-button",3,"click"],[1,"button-custom",3,"baseConfig","disableAnchor","baseContext"],[1,"issue-state"],[3,"progress","type","showBorder",4,"ngIf"],["class","icon icon-download-circle","mat-ripple","",3,"disabled","click",4,"ngIf"],["class","icon icon-delete","mat-ripple","",3,"disabled","click",4,"ngIf"],[3,"progress","type","showBorder"],["mat-ripple","",1,"icon","icon-download-circle",3,"click","disabled"],["mat-ripple","",1,"icon","icon-delete",3,"click","disabled"]],template:function(s,t){1&s&&e.DNE(0,fe,7,2,"ng-container",3)(1,Ot,9,4,"ng-container",3),2&s&&(e.Y8G("ngIf",!t.issue||t.dataSourceError),e.R7$(),e.Y8G("ngIf",t.issue&&t.config&&!t.dataSourceError))},dependencies:[c.YU,c.Sq,c.bT,c.T3,Y.X,oe.G,ie.M,re.t,ae.r6,le.Q,W.h,c.Jj,ce.w,_e.Z],styles:['.aspectRatioBase{position:relative;display:block}.aspectRatioBase:before{content:"";position:relative;display:block}.aspectRatioBase>*{position:absolute}storefront-issue{display:flex;flex-direction:column;position:relative}storefront-issue .issue-image{position:relative;overflow:hidden}storefront-issue .issue-image storefront-spinner{position:absolute;top:0;height:100%;width:100%;background-color:#0000001a}storefront-issue .issue-image .issue-update-badge{--paddingVert: .25em;--fontSize: .8em;--width: 200%;--offset: calc(var(--fontSize) * 3);position:absolute;top:calc(var(--fontSize) + var(--paddingVert));left:calc(var(--width) / -2 + var(--offset));display:flex;justify-content:center;width:var(--width);padding:var(--paddingVert) 0;background:var(--issueUpdateBadgeBgColor);transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}@media (max-width: 767px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge{--fontSize: .6em}}@media (max-width: 330px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge{--fontSize: .6em}}storefront-issue .issue-image .issue-update-badge span{max-width:80px;text-align:center;font-size:var(--fontSize);color:var(--issueUpdateBadgeColor);-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;text-overflow:ellipsis;overflow:hidden}@media (max-width: 767px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge span{max-width:60px}}@media (max-width: 330px) and (orientation: portrait){storefront-issue .issue-image .issue-update-badge span{max-width:60px}}storefront-issue storefront-progress[type=BAR]{display:none;position:absolute;background-color:var(--issueProgressBgColor);border-radius:var(--borderRadius);overflow:hidden;text-align:center;padding:var(--issueProgressPaddingVert) var(--issueProgressPaddingHoriz);z-index:0;bottom:0;left:0;right:0;top:0}storefront-issue .issue-image storefront-progress[type=BAR]{top:auto;bottom:var(--issueProgressMarginVert);left:var(--issueProgressMarginHoriz);right:var(--issueProgressMarginHoriz)}storefront-issue .issue-data{display:flex;flex-direction:column;overflow:hidden;flex-grow:1}storefront-issue .issue-data .issue-description-expand-toggle{display:none}storefront-issue .issue-data .issue-description-expand-toggle i{display:inline-block;transition:transform .3s ease;font-size:12px;padding:0 4px}storefront-issue .issue-title{margin:.5em 0}storefront-issue .issue-description{color:var(--secondaryTextColor);width:100%;white-space:pre-wrap}storefront-issue .issue-custom-message{color:var(--textColor)}storefront-issue storefront-image{width:100%}storefront-issue .issue-actions{display:none;justify-content:space-between;z-index:1}storefront-issue .issue-actions button{color:#fff;background-color:var(--secondaryColor);padding:0}storefront-issue .issue-actions button.button-purchase,storefront-issue .issue-actions button.button-subscribe,storefront-issue .issue-actions button.button-download,storefront-issue .issue-actions button.button-read{background-color:var(--primaryColor)}storefront-issue .issue-actions button.button-state-downloading.button-state-INCOMPLETE .progress-percentage{display:none}storefront-issue .issue-actions button[disabled]{opacity:.5}storefront-issue .issue-actions button span{position:relative;z-index:1}storefront-issue .issue-actions button.icon{color:var(--primaryColor);background-color:transparent;width:1.4em;height:1.4em;font-size:1.4em}storefront-issue .issue-state{display:none}storefront-issue .issue-error .action-button{background-color:var(--secondaryColor);color:#fff;display:block}storefront-issue[template=cover] .issue-image{width:100%}storefront-issue[template=cover] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=cover] .issue-data{flex-direction:row;align-items:center}storefront-issue[template=cover] .issue-data>i,storefront-issue[template=cover] .issue-data .issue-state i,storefront-issue[template=cover] .issue-data .issue-state button,storefront-issue[template=cover] .issue-data .issue-state storefront-progress,storefront-issue[template=cover] .issue-data .issue-state storefront-spinner{font-size:21px;height:22px;width:22px;color:var(--secondaryColor)}storefront-issue[template=cover] .issue-data>i.icon-delete,storefront-issue[template=cover] .issue-data .issue-state i.icon-delete,storefront-issue[template=cover] .issue-data .issue-state button.icon-delete,storefront-issue[template=cover] .issue-data .issue-state storefront-progress.icon-delete,storefront-issue[template=cover] .issue-data .issue-state storefront-spinner.icon-delete{width:42px;height:42px;position:absolute;top:-20px;right:-20px;border-radius:100%;font-size:10px;color:#fff;padding:10px}storefront-issue[template=cover] .issue-data>i.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state i.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state button.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state storefront-progress.icon-delete:after,storefront-issue[template=cover] .issue-data .issue-state storefront-spinner.icon-delete:after{background-color:var(--secondaryColor);width:22px;height:22px;border-radius:100%;display:flex;justify-content:center;align-items:center}storefront-issue[template=cover] .issue-state{display:flex;right:0;bottom:0}storefront-issue[template=cover] .issue-state storefront-spinner{position:relative;z-index:1;--spinnerColor: var(--secondaryColor);background-color:transparent;padding:0}storefront-issue[template=cover] .issue-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}storefront-issue[template=cover] .issue-publication-title,storefront-issue[template=cover] .issue-description,storefront-issue[template=cover] .issue-categories,storefront-issue[template=cover] .issue-tags,storefront-issue[template=cover] .issue-pub-date,storefront-issue[template=cover] .issue-properties,storefront-issue[template=cover] .issue-custom-message{display:none}storefront-issue[template=cover] .issue-publication-title .issue-tag,storefront-issue[template=cover] .issue-publication-title .issue-category,storefront-issue[template=cover] .issue-description .issue-tag,storefront-issue[template=cover] .issue-description .issue-category,storefront-issue[template=cover] .issue-categories .issue-tag,storefront-issue[template=cover] .issue-categories .issue-category,storefront-issue[template=cover] .issue-tags .issue-tag,storefront-issue[template=cover] .issue-tags .issue-category,storefront-issue[template=cover] .issue-pub-date .issue-tag,storefront-issue[template=cover] .issue-pub-date .issue-category,storefront-issue[template=cover] .issue-properties .issue-tag,storefront-issue[template=cover] .issue-properties .issue-category,storefront-issue[template=cover] .issue-custom-message .issue-tag,storefront-issue[template=cover] .issue-custom-message .issue-category{display:none}storefront-issue[template=card]{border-radius:4px;box-shadow:0 0 5px 2px #0000001a;padding-bottom:var(--gutter);overflow:hidden;background-color:#fff}storefront-issue[template=card] storefront-image[height-strategy=FIXED]{padding-top:75%}storefront-issue[template=card] storefront-image[height-strategy=FIXED]>img{object-fit:cover;width:100%}storefront-issue[template=card] .issue-title,storefront-issue[template=card] .issue-pub-date,storefront-issue[template=card] .issue-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-left:calc(var(--gutter) / 2);margin-right:calc(var(--gutter) / 2);width:initial}storefront-issue[template=card] .issue-publication-title,storefront-issue[template=card] .issue-categories,storefront-issue[template=card] .issue-tags,storefront-issue[template=card] .issue-properties,storefront-issue[template=card] .issue-custom-message{display:none}storefront-issue[template=card] .issue-publication-title .issue-tag,storefront-issue[template=card] .issue-publication-title .issue-category,storefront-issue[template=card] .issue-categories .issue-tag,storefront-issue[template=card] .issue-categories .issue-category,storefront-issue[template=card] .issue-tags .issue-tag,storefront-issue[template=card] .issue-tags .issue-category,storefront-issue[template=card] .issue-properties .issue-tag,storefront-issue[template=card] .issue-properties .issue-category,storefront-issue[template=card] .issue-custom-message .issue-tag,storefront-issue[template=card] .issue-custom-message .issue-category{display:none}storefront-issue[template=highlight]{flex-direction:row;padding:calc(var(--gutter) / 2);width:100%}storefront-issue[template=highlight] .issue-image{width:calc(43% - var(--gutter) / 2);margin-right:var(--gutter);flex-shrink:0;align-self:flex-end}storefront-issue[template=highlight] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}@media (max-width: 533px) and (orientation: portrait),(max-height: 533px) and (orientation: landscape){storefront-issue[template=highlight] .issue-image{width:calc(50% - (var(--gutter)))}}storefront-issue[template=highlight] storefront-progress[type=BAR]{display:block}storefront-issue[template=highlight] .issue-data{margin-left:var(--gutter)}storefront-issue[template=highlight] .issue-title{font-size:2em;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}storefront-issue[template=highlight] .issue-publication-title,storefront-issue[template=highlight] .issue-pub-date,storefront-issue[template=highlight] .issue-properties,storefront-issue[template=highlight] .issue-categories,storefront-issue[template=highlight] .issue-tags{display:none}storefront-issue[template=highlight] .issue-publication-title .issue-tag,storefront-issue[template=highlight] .issue-publication-title .issue-category,storefront-issue[template=highlight] .issue-pub-date .issue-tag,storefront-issue[template=highlight] .issue-pub-date .issue-category,storefront-issue[template=highlight] .issue-properties .issue-tag,storefront-issue[template=highlight] .issue-properties .issue-category,storefront-issue[template=highlight] .issue-categories .issue-tag,storefront-issue[template=highlight] .issue-categories .issue-category,storefront-issue[template=highlight] .issue-tags .issue-tag,storefront-issue[template=highlight] .issue-tags .issue-category{display:none}storefront-issue[template=highlight] .issue-custom-message{margin:var(--gutter) 0}storefront-issue[template=highlight] .issue-actions{display:flex;flex-direction:column;flex-grow:1;justify-content:flex-end}storefront-issue[template=highlight] .issue-actions storefront-button button{width:100%}storefront-issue[template=details] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=details] .issue-data{align-items:center}storefront-issue[template=details] .issue-data.expanded .issue-description{-webkit-line-clamp:unset}storefront-issue[template=details] .issue-data.expanded .issue-description-expand-toggle{display:block}storefront-issue[template=details] .issue-data.expanded .issue-description-expand-toggle i{transform:rotate(180deg)}storefront-issue[template=details] .issue-data .issue-publication-title,storefront-issue[template=details] .issue-data .issue-properties,storefront-issue[template=details] .issue-data .issue-categories,storefront-issue[template=details] .issue-data .issue-tags{display:none}storefront-issue[template=details] .issue-data .issue-publication-title .issue-tag,storefront-issue[template=details] .issue-data .issue-publication-title .issue-category,storefront-issue[template=details] .issue-data .issue-publication-title .issue-property,storefront-issue[template=details] .issue-data .issue-properties .issue-tag,storefront-issue[template=details] .issue-data .issue-properties .issue-category,storefront-issue[template=details] .issue-data .issue-properties .issue-property,storefront-issue[template=details] .issue-data .issue-categories .issue-tag,storefront-issue[template=details] .issue-data .issue-categories .issue-category,storefront-issue[template=details] .issue-data .issue-categories .issue-property,storefront-issue[template=details] .issue-data .issue-tags .issue-tag,storefront-issue[template=details] .issue-data .issue-tags .issue-category,storefront-issue[template=details] .issue-data .issue-tags .issue-property{display:none}storefront-issue[template=details] storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=details] storefront-progress[type=BAR]{display:block}storefront-issue[template=details] .issue-pub-date{display:none}storefront-issue[template=details] .issue-description{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;text-overflow:ellipsis;overflow:hidden}storefront-issue[template=details] .issue-description.scrollable-vert+.issue-description-expand-toggle{display:flex}storefront-issue[template=details] .issue-description-expand-toggle{align-self:flex-start}storefront-issue[template=details] .issue-custom-message{margin-top:var(--gutter)}storefront-issue[template=details] .issue-actions{display:grid;width:100%;grid-template-columns:1fr 1fr;grid-column-gap:var(--gutter);margin-top:var(--gutter)}storefront-issue[template=details] .issue-actions>button:nth-child(odd):last-child,storefront-issue[template=details] .issue-actions>storefront-button:nth-child(odd):last-child{grid-column:1/3}storefront-issue[template=details] .issue-actions storefront-button button{width:100%}storefront-issue[template=group]{flex-direction:row}storefront-issue[template=group] .issue-image{width:100%}storefront-issue[template=group] .issue-image storefront-image[height-strategy=FIXED]{padding-top:133%}storefront-issue[template=group] .issue-data{flex-direction:column}storefront-issue[template=group] .issue-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}storefront-issue[template=group] .issue-actions{display:flex;justify-content:flex-start}storefront-issue[template=group] .issue-actions>button{display:none}storefront-issue[template=group] i,storefront-issue[template=group] .issue-publication-title,storefront-issue[template=group] .issue-pub-date,storefront-issue[template=group] .issue-description,storefront-issue[template=group] .issue-description-expand-toggle,storefront-issue[template=group] .issue-properties,storefront-issue[template=group] .issue-categories,storefront-issue[template=group] .issue-tags,storefront-issue[template=group] .issue-state,storefront-issue[template=group] .issue-update-badge{display:none}storefront-issue[template=group] i .issue-tag,storefront-issue[template=group] i .issue-category,storefront-issue[template=group] .issue-publication-title .issue-tag,storefront-issue[template=group] .issue-publication-title .issue-category,storefront-issue[template=group] .issue-pub-date .issue-tag,storefront-issue[template=group] .issue-pub-date .issue-category,storefront-issue[template=group] .issue-description .issue-tag,storefront-issue[template=group] .issue-description .issue-category,storefront-issue[template=group] .issue-description-expand-toggle .issue-tag,storefront-issue[template=group] .issue-description-expand-toggle .issue-category,storefront-issue[template=group] .issue-properties .issue-tag,storefront-issue[template=group] .issue-properties .issue-category,storefront-issue[template=group] .issue-categories .issue-tag,storefront-issue[template=group] .issue-categories .issue-category,storefront-issue[template=group] .issue-tags .issue-tag,storefront-issue[template=group] .issue-tags .issue-category,storefront-issue[template=group] .issue-state .issue-tag,storefront-issue[template=group] .issue-state .issue-category,storefront-issue[template=group] .issue-update-badge .issue-tag,storefront-issue[template=group] .issue-update-badge .issue-category{display:none}storefront-issue.locked .issue-actions button.icon-share{display:none}storefront-issue.ghost{pointer-events:none}storefront-issue.ghost .issue-image{animation:ghost-opacity 2s infinite linear;background-color:var(--ghostColor);margin-bottom:var(--gutter)}storefront-issue.ghost .issue-image storefront-image{background-color:transparent}storefront-issue.ghost[template=highlight]>.issue-image{margin-bottom:0}storefront-issue.ghost[template=highlight]>.issue-image>storefront-image{margin-bottom:0}storefront-issue.ghost[template=highlight] .issue-description,storefront-issue.ghost[template=highlight] .issue-title{width:100%;margin-bottom:0}storefront-issue.ghost[template=cover] storefront-image{padding-top:133%}storefront-issue.ghost[template=card] storefront-image{padding-top:75%}storefront-issue.ghost .issue-description,storefront-issue.ghost .issue-title{background-color:var(--ghostColor);color:transparent;border-radius:4px;width:90%;height:1.2em;margin-bottom:calc(var(--gutter) / 2)!important;background-image:linear-gradient(90deg,var(--ghostColor) 0px,rgb(236,236,236) 40px,var(--ghostColor) 80px);background-size:80vw;animation:ghost-lines 2s infinite linear}storefront-issue.ghost .issue-description{height:3em}storefront-issue.error .issue-data{display:none}storefront-issue.error[template=cover] .issue-error,storefront-issue.error[template=card] .issue-error,storefront-issue.error[template=details] .issue-error{margin-top:var(--gutter)}\n'],encapsulation:2,changeDetection:0}),l})()},4365:(k,C,r)=>{r.d(C,{AN:()=>h,FZ:()=>b,Mw:()=>y,Rp:()=>I,W9:()=>_});var a=r(4404),_=function(p){return p.COVER="cover",p.CARD="card",p.HIGHLIGHT="highlight",p.DETAILS="details",p.GROUP="group",p}(_||{});const I={showErrorDialog:!0};var h=function(p){return p.SINGLE="SINGLE",p.MULTI="MULTI",p}(h||{}),b=function(p){return p.SILENT="SILENT",p}(b||{});const y={template:_.CARD,openContent:{mode:a.DisplayMode.MODAL,titleBar:!0},downloadOptions:null,customButtons:[],customMessages:[],titleMessage:"ISSUE_TITLE",descriptionMessage:"ISSUE_DESCRIPTION",publicationTitleMessage:"ISSUE_PUBLICATION_TITLE"}},1367:(k,C,r)=>{r.r(C),r.d(C,{IssueModule:()=>g,component:()=>L});var a=r(177),c=r(4744),e=r(3363),_=r(8301),I=r(6483),h=r(6215),b=r(1605),y=r(6600),p=r(6953),m=r(9805),O=r(4767),D=r(4403),v=r(3953);let g=(()=>{var T;class d{}return(T=d).\u0275fac=function(P){return new(P||T)},T.\u0275mod=v.$C({type:T}),T.\u0275inj=v.G2t({imports:[a.MD,e.E,_.d,I.h,h.O,b.P,O.d,y.pZ,p.n,m.ButtonModule,D.U]}),d})();const L=c.z},3092:(k,C,r)=>{r.d(C,{X:()=>p,s:()=>y});var a=r(3953),c=r(345);function e(m,O){1&m&&a.nrm(0,"div",5)}function _(m,O){if(1&m&&(a.qex(0),a.nrm(1,"div",1),a.j41(2,"div",2),a.nrm(3,"div",3),a.k0s(),a.DNE(4,e,1,0,"div",4),a.bVm()),2&m){const D=a.XpG();a.R7$(2),a.xc7("-webkit-clip-path",D.getClipPath())("clip-path",D.getClipPath()),a.R7$(2),a.Y8G("ngIf",D.showBorder)}}function I(m,O){if(1&m&&(a.qex(0),a.j41(1,"div",6),a.nrm(2,"div",7)(3,"div",8),a.k0s(),a.bVm()),2&m){const D=a.XpG();a.R7$(2),a.xc7("width",D.progress,"%"),a.R7$(),a.Y8G("storefrontTranslate",D.message)}}function h(m,O){1&m&&a.nrm(0,"div",5)}function b(m,O){if(1&m&&(a.qex(0),a.nrm(1,"storefront-spinner",9),a.DNE(2,h,1,0,"div",4),a.j41(3,"div",10),a.EFF(4),a.k0s(),a.nrm(5,"i",11),a.bVm()),2&m){const D=a.XpG();a.R7$(2),a.Y8G("ngIf",D.showBorder),a.R7$(2),a.SpI("",D.progress,"%")}}var y=function(m){return m.RADIAL="RADIAL",m.BAR="BAR",m.NUMERIC="NUMERIC",m}(y||{});let p=(()=>{var m;class O{constructor(v){this.sanitizer=v,this.type=y.RADIAL,this.showBorder=!1,this.message="ISSUE_ACTION_DOWNLOADING",this.progressOnBorder=!1}getClipPath(){let v;const g=this.progress;return v=g<=12.5?"polygon(50% 0, 50% 50%, ".concat(50+4*g,"% 0, 100% 0)"):g<=25?"polygon(50% 50%, 50% 0, 100% 0, 100% ".concat(4*(g-12.5),"%)"):g<=37.5?"polygon(50% 50%, 50% 0, 100% 0, 100% ".concat(4*(g-25)+50,"%)"):g<=75?"polygon(50% 50%, ".concat(100-4*(g-37.5),"% 100%, 100% 100%, 100% 0, 50% 0)"):g<=87.5?"polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 ".concat(50-4*(g-75),"%)"):"polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0, ".concat(4*(g-87.5),"% 0)"),this.sanitizer.bypassSecurityTrustStyle(v)}}return(m=O).\u0275fac=function(v){return new(v||m)(a.rXU(c.up))},m.\u0275cmp=a.VBU({type:m,selectors:[["storefront-progress"]],hostVars:3,hostBindings:function(v,g){2&v&&(a.BMQ("type",g.type),a.AVh("progress-on-border",g.progressOnBorder))},inputs:{type:"type",showBorder:"showBorder",message:"message",progressOnBorder:"progressOnBorder",progress:"progress"},decls:3,vars:3,consts:[[4,"ngIf"],[1,"background-circle"],[1,"loader"],[1,"circle"],["class","border-circle",4,"ngIf"],[1,"border-circle"],[1,"bar"],[1,"bar-indicator"],[1,"bar-message",3,"storefrontTranslate"],["type","segments",1,"progress-spinner"],[1,"bar-progress"],[1,"icon","icon-delete"]],template:function(v,g){1&v&&a.DNE(0,_,5,5,"ng-container",0)(1,I,4,3,"ng-container",0)(2,b,6,2,"ng-container",0),2&v&&(a.Y8G("ngIf","RADIAL"===g.type),a.R7$(),a.Y8G("ngIf","BAR"===g.type),a.R7$(),a.Y8G("ngIf","NUMERIC"===g.type))},styles:["storefront-progress[type=RADIAL]{position:relative;display:flex;width:22px;height:22px}storefront-progress[type=RADIAL] .loader{position:absolute;left:50%;top:50%;transform:translate(-50%) translateY(-50%);width:calc(100% + 2px);height:calc(100% + 2px);display:flex;align-items:center;justify-content:center}storefront-progress[type=RADIAL] .loader .circle{width:calc(100% - 2px);height:calc(100% - 2px);background-color:var(--secondaryColor)}storefront-progress[type=RADIAL] .background-circle,storefront-progress[type=RADIAL] .border-circle,storefront-progress[type=RADIAL] .circle{border-radius:100%;box-sizing:border-box}storefront-progress[type=RADIAL] .background-circle,storefront-progress[type=RADIAL] .border-circle{position:absolute;left:50%;top:50%;transform:translate(-50%) translateY(-50%);width:100%;height:100%}storefront-progress[type=RADIAL] .border-circle{border:2px solid var(--secondaryColor)}storefront-progress[type=RADIAL].progress-on-border{-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' width='110' height='110'%3E%3Ccircle cx='55' cy='55' r='50' stroke='black' stroke-width='4' fill='none' /%3E%3C/svg%3E\");mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' width='110' height='110'%3E%3Ccircle cx='55' cy='55' r='50' stroke='black' stroke-width='4' fill='none' /%3E%3C/svg%3E\");-webkit-mask-size:100%;mask-size:100%}storefront-progress[type=BAR] .bar-indicator{position:absolute;height:100%;top:0;left:0;background-color:var(--issueProgressColor);transition:width .2s ease}storefront-progress[type=BAR] .bar-message{font-size:.8em;z-index:1;position:relative;color:var(--issueProgressFontColor)}storefront-progress[type=NUMERIC]{display:flex;justify-content:space-between;align-items:center;padding:0 var(--gutter)}storefront-progress[type=NUMERIC] storefront-spinner.progress-spinner{position:relative;background:transparent;--spinnerColor: var(--issueProgressColor);padding:0;display:flex;width:20px}storefront-progress[type=NUMERIC] i{font-size:12px}\n"],encapsulation:2}),O})()},3363:(k,C,r)=>{r.d(C,{E:()=>y});var a=r(177),c=r(3092),e=r(6483),_=r(6215),I=r(3953),h=r(8909),b=r(7240);let y=(()=>{var p;class m{}return(p=m).\u0275fac=function(D){return new(D||p)},p.\u0275mod=I.$C({type:p}),p.\u0275inj=I.G2t({imports:[a.MD,e.h,_.O]}),m})();I.wjB(c.X,[a.bT,h.M,b.t],[])},6953:(k,C,r)=>{r.d(C,{n:()=>e});var a=r(177),c=r(3953);let e=(()=>{var _;class I{}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275mod=c.$C({type:_}),_.\u0275inj=c.G2t({imports:[a.MD]}),I})()},2813:(k,C,r)=>{r.d(C,{Z:()=>e});var a=r(3178),c=r(3953);let e=(()=>{var _;class I{transform(b,y){return new Date(b).toLocaleDateString((0,a.JK)())}}return(_=I).\u0275fac=function(b){return new(b||_)},_.\u0275pipe=c.EJ8({name:"storefrontDate",type:_,pure:!0}),I})()},1739:(k,C,r)=>{function a(c){return c&&!!c.code}r.d(C,{b:()=>a})}}]);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunkstorefront=self.webpackChunkstorefront||[]).push([["default-projects_storefront_src_app_service_tts_tts_service_ts"],{5628:(x,O,o)=>{o.d(O,{z:()=>M});var d=o(467),v=o(177),m=o(3953);function S(l,e={}){var t;return l.startsWith("//")&&(l=window.location.protocol+l),e.useFetch?fetch(l,{method:null!==(t=e.method)&&void 0!==t?t:"GET"}).then(s=>{if(s.status>399){if(e.returnRedirect)return{redirectUrl:s.url};throw new Error("Failed to load json ".concat(l," : ").concat(s.statusText))}return s.redirected&&e.returnRedirect?{response:s.json(),redirectUrl:s.url}:{response:s.json()}}):new Promise((s,i)=>{const n=new XMLHttpRequest;n.addEventListener("load",()=>{n.status>399&&i(new Error("Failed to load json ".concat(l," : ").concat(n.statusText)));try{s(JSON.parse(n.responseText))}catch{i()}}),n.addEventListener("error",()=>{i()}),n.open(e&&e.method||"GET",l),n.send()})}var P=o(1413),R=o(4412),L=o(7879),N=o(7370);let c=(()=>{var l;class e{}return(l=e).SPEECH_IDENTIFIER="TTS_SPEECH",l.SPEECH_RATE_IDENTIFIER="TTS_SPEECH_RATE",l.PLAYER_OPEN_IDENTIFIER="TTS_PLAYER_OPEN",l.AUDIO_PLAYING_IDENTIFIER="TTS_AUDIO_PLAYING",e})();class I{constructor(e){this.foundTagName="span",this.foundTagClass="word",this.skipClasses=[],this.skipTags=[],this.root=null,this.currentDepth=-1,this.currentNode=null,this.lastSuccessfulNode=null,this.lastSuccessfulDepth=-1,this.currentWord="";for(let t in e)this[t]=e[t];this.skipClassesRegex=new RegExp("("+this.skipClasses.map(t=>"".concat(t,"(?=(\\s|$))")).join("|")+")","i"),this.skipTagsRegex=new RegExp("("+this.skipTags.map(t=>"".concat(t,"(?=(\\s|$))")).join("|")+")","i")}reset(){this.root=null,this.currentDepth=-1,this.currentNode=null,this.lastSuccessfulNode=null,this.lastSuccessfulDepth=-1}next(e){return this.currentWord=e,null==this.lastSuccessfulNode?(this.currentNode=this.root.childNodes[0],this.currentDepth=1):(this.currentNode=this.lastSuccessfulNode,this.currentDepth=this.lastSuccessfulDepth),this.searchNodes()}searchNodes(){let e=null;for(;this.currentNode&&this.currentDepth>0&&null==e;){switch(this.currentNode.nodeType){case 1:if(!this.skipTagsRegex.test(this.currentNode.tagName)&&!this.skipClassesRegex.test(this.currentNode.className.toLowerCase())&&this.currentNode.childNodes.length>0&&!this.currentNode.classList.contains(this.foundTagClass)){this.currentNode=this.currentNode.childNodes[0],this.currentDepth++;continue}break;case 3:case 4:if(e=this.findTextInNode(),null!=e)return this.lastSuccessfulNode=e,this.lastSuccessfulDepth=this.currentDepth,this.currentNode=null,this.currentDepth=-1,e}if(this.currentNode.nextSibling)this.currentNode=this.currentNode.nextSibling;else for(;this.currentDepth>0;)if(this.currentNode=this.currentNode.parentNode,this.currentDepth--,this.currentNode.nextSibling){this.currentNode=this.currentNode.nextSibling;break}}return null}findTextInNode(){let t=this.currentNode&&this.currentNode.parentNode.tagName===this.foundTagName.toUpperCase()&&this.currentNode.parentNode.classList.contains(this.foundTagClass)?-1:this.currentNode.data.indexOf(this.currentWord);if(t>-1){let s=1===this.currentNode.nodeType?this.currentNode.firstChild:this.currentNode,i=t>0?s.splitText(t):s;i.splitText(this.currentWord.length);let n=document.createElement(this.foundTagName);n.setAttribute("class",this.foundTagClass);const r=i.parentNode;return n.innerText=i.data,r.replaceChild(n,i),n}return null}}class A{constructor(e,t,s,i,n,r,a){this.currentWordClassName="current",this.markersData=[],this.isScrolling=!1,this.previousMarker=null,this.wordFinder=new I({root:s,skipClasses:i,skipTags:n}),this.audio=e,this.markerSrc=t,this.ttsService=r,this.ttsPlayer=a}reset(e,t,s){this.wordFinder.root=s,this.audio=e,this.markerSrc=t}align(){return new Promise((e,t)=>{e(this.loadMarkers())})}selectWord(e){if(null!=this.markersData){let t=this.audio.currentTime;this.markersData.forEach((s,i)=>{let n=i<Object.keys(this.markersData).length-1?this.markersData[i+1]:null;if(t>=s.time&&(null==n||t<=n.time)&&!this.compareMarkers(s,this.previousMarker))for(let r of s.node){this.deselectWord(),this.previousMarker=s,r.classList.add(this.currentWordClassName);let a={top:80,bottom:185,left:0,right:0},u=this.isOutOfViewport(r,a);const p=this.ttsPlayer.contentElement.scrollTop,g=this.ttsPlayer.contentElement.clientHeight,h=this.ttsPlayer.contentElement.scrollHeight;if(this.isScrolling=this.isScrolling&&Math.floor(this.lastScrollTo)!=Math.floor(p)&&Math.floor(p)+g+1<h&&p+g<h,e&&u&&!this.isScrolling){let f=this.ttsPlayer.contentElement,C=r.getBoundingClientRect().top+f.scrollTop+f.offsetTop;const w=C-(C>a.top?a.top:0);f.scrollTo({top:w,behavior:"smooth"}),this.isScrolling=!0,this.lastScrollTo=w}}})}}deselectWord(){Array.from(document.getElementsByClassName(this.currentWordClassName)).forEach(e=>e.classList.remove(this.currentWordClassName))}loadMarkers(){var e=this;return(0,d.A)(function*(){try{e.markersData=(yield S(e.markerSrc)).markers,e.assignMarkers()}catch(t){console.error("Could not load markers: "+t)}})()}assignMarkers(){this.markersData.forEach(e=>{if(e.node=[],e.markerValues)for(let t of e.markerValues)this.createNode(this.encodeString(t),e);else this.createNode(this.encodeString(e.value),e)}),this.wordFinder.reset()}isOutOfViewport(e,t={top:0,bottom:0,left:0,right:0}){const s=e.getBoundingClientRect(),r=s.bottom>(window.innerHeight||document.documentElement.clientHeight)-t.bottom,a=s.right>(window.innerWidth||document.documentElement.clientWidth)-t.right;return s.top<t.top||s.left<t.left||r||a}createNode(e,t){let s=this.wordFinder.next(e);null!=s&&t.node.push(s)}encodeString(e){return(new DOMParser).parseFromString(e,"text/html").body.textContent}compareMarkers(e,t){return!(!e||!t)&&e.end==t.end&&e.start==t.start&&e.time==t.time}}class E{static getFormattedTime(e){return new Date(e).toLocaleTimeString([],{minute:"2-digit",second:"2-digit"})}static convertSecondsToMilli(e){return 1e3*e}static setSettingsContainerPosition(e,t){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect(),n=window.getComputedStyle(t,"::before"),a=Math.round(s.top)-i.height/2+s.height/2;let u=s.left;const p=n?window.innerWidth-u-parseInt(n.right,10):window.innerWidth-u;t.style.top=a+"px",t.style.right=p+"px"}}class B{constructor(e,t,s,i,n){var r,a;if(this.ttsConfig=e,this.post=t,this.ttsService=s,this.purpleService=i,this.previousState=n,this.articleIndex=0,this.contentElement=null,this.markerContentElement=null,this.audio={src:"",duration:0,currentTime:0,bufferedTime:0,speech:"",speechMarkerSrc:"",speechRate:this.ttsService.ttsConfig.ttsSpeechRateOptionNormal},this.audioAligner=null,this.selectWordInterval=null,this.state={isOpen:new R.t((null===(r=this.previousState)||void 0===r?void 0:r.isOpen.value)||!1),isFirst:!0,isCurrent:!1,isPlaying:!1,isOffline:!1,progressListener:null,stateListener:null,connectionStateListener:null,forceOpen:!1},this.uiElements={playerElement:null,progressContainer:null,currentTimeElement:null,durationElement:null,progressElement:null,bufferingElement:null,settingsButton:null,settingsContainer:null,speechRateContainer:null,speechRateOptionVerySlow:null,speechRateOptionSlow:null,speechRateOptionNormal:null,speechRateOptionFast:null,speechRateOptionVeryFast:null,speechContainer:null,controlsContainer:null,loadingElement:null,playButton:null,seekBackButton:null,seekForwardButton:null,navigateBackButton:null,navigateForwardButton:null,openPlayerButton:null},this.ttsPlayerStateSubject=new R.t(null),this.ttsPlayerState$=this.ttsPlayerStateSubject.asObservable(),this.isUiRendered=!1,this.isDeleted=!1,this.contentElement=null===(a=document.querySelectorAll(e.ttsContentSelector)[0])||void 0===a?void 0:a.firstElementChild,this.markerContentElement=document.querySelectorAll(e.ttsMarkerContentSelector)[0],!this.contentElement||!this.markerContentElement)throw{message:"Failed to init TTS.\n Found contentElement (".concat(e.ttsContentSelector,"): ").concat(!!this.contentElement,"\n Found markerContentElement (").concat(e.ttsMarkerContentSelector,"): ").concat(!!this.markerContentElement,"\n ")}}init(){var e=this;return(0,d.A)(function*(){let t;e.state.isFirst=!0;try{t=yield e.purpleService.getState(c.SPEECH_IDENTIFIER),(!t||""===t)&&(t=e.getDefaultSpeech(),e.purpleService.setState(c.SPEECH_IDENTIFIER,t))}catch(s){t=e.getDefaultSpeech(),e.purpleService.setState(c.SPEECH_IDENTIFIER,t),console.warn("Could not get speech: "+s)}if(!e.isDeleted){try{let s=parseFloat(yield e.purpleService.getState(c.SPEECH_RATE_IDENTIFIER));s||(s=e.ttsConfig.ttsSpeechRateOptionNormal),yield e.setSpeechRate(s)}catch(s){yield e.setSpeechRate(e.ttsConfig.ttsSpeechRateOptionNormal),console.warn("Can not get state of speech rate: "+s)}e.isDeleted||(e.setAudioParameters(t),e.audioAligner=new A(e.audio,e.audio.speechMarkerSrc,e.markerContentElement,e.ttsConfig.ttsSkipContentClasses,e.ttsConfig.ttsSkipContentTags,e.ttsService,e),yield e.audioAligner.align(),!e.isDeleted&&e.afterAudioAlignment())}})()}reset(){var e,t;this.selectWordInterval&&clearInterval(this.selectWordInterval),this.audioAligner.deselectWord(),this.contentElement.scrollTop=0,this.state.isFirst=!0,null===(e=this.uiElements.loadingElement)||void 0===e||e.classList.remove("show"),null===(t=this.uiElements.playButton)||void 0===t||t.classList.remove("pause"),this.isUiRendered&&this.setAudioProgress(0,0)}delete(){this.stop(),window.purple.media.removeProgressListener(this.state.progressListener),window.purple.media.removeStatusListener(this.state.stateListener),window.purple.app.removeConnectionStateListener(this.state.connectionStateListener),this.isDeleted=!0}openPlayer(e=!1){this.purpleService.setState(c.PLAYER_OPEN_IDENTIFIER,"1"),(!this.state.isOpen.value||!this.uiElements.playerElement.classList.contains("open"))&&(this.uiElements.playerElement.classList.add("open"),this.state.isOpen.next(!0)),e&&this.play()}closePlayer(e=!1){this.purpleService.setState(c.PLAYER_OPEN_IDENTIFIER,"0"),this.uiElements.playerElement&&this.uiElements.playerElement.classList.remove("open"),this.state.isOpen.next(!1),this.audioAligner.deselectWord(),e&&this.pause()}play(){this.purpleService.setState(c.AUDIO_PLAYING_IDENTIFIER,"1"),this.state.isFirst?window.purple.media.startAudio({displayName:this.post.name,url:this.audio.src}):window.purple.media.resumeAudio()}pause(){this.purpleService.setState(c.AUDIO_PLAYING_IDENTIFIER,"0"),window.purple.media.pauseAudio()}stop(){this.purpleService.setState(c.AUDIO_PLAYING_IDENTIFIER,"0"),window.purple.media.stopAudio()}seekTo(e){window.purple.media.seekTo({time:Math.round(e)})}changeSpeech(e,t=!1){this.purpleService.setState(c.SPEECH_IDENTIFIER,e),this.setAudioParameters(e),this.reloadContentMarker(),this.setSelectedSpeech(),this.reset()}changeSpeechRate(e,t=!1){var s=this;return(0,d.A)(function*(){yield s.setSpeechRate(e),s.setSpeechRateUi(e),s.setAudioProgress(s.audio.currentTime,s.audio.bufferedTime)})()}reloadContentMarker(){var e=this;return(0,d.A)(function*(){let t=Array.from(e.markerContentElement.getElementsByClassName("word"));for(let s of t)s.replaceWith(s.innerHTML);e.audioAligner.reset(e.audio,e.audio.speechMarkerSrc,e.markerContentElement),yield e.audioAligner.align(),e.afterAudioAlignment()})()}setAudioParameters(e){let t=this.getSpeechObject()[e];t||(e=this.getDefaultSpeech(),t=this.getSpeechObject()[e],this.purpleService.setState(c.SPEECH_IDENTIFIER,e)),this.audio.speech=e,this.audio.src=this.createSpeechPropertiesUrl(t.url),this.audio.speechMarkerSrc=this.createSpeechPropertiesUrl(t.speechMarkerUrl),this.audio.duration=t.length}afterAudioAlignment(){this.uiElements.playerElement||this.initUi()}initUi(){this.state.progressListener=i=>{const n=i.detail?i.detail:i;this.isCurrent()&&n.duration>0&&(n.currentTime>=n.duration?(this.setAudioProgress(0),this.closePlayer()):this.setAudioProgress(n.currentTime,n.bufferedTime,n.duration))},this.purpleService.purpleRef.media.addProgressListener(this.state.progressListener),this.state.stateListener=i=>{const n=i.detail?i.detail:i;if(this.state.isCurrent=n.url===this.audio.src,this.isCurrent())switch(n.playbackState){case"READY":this.selectWordInterval&&clearInterval(this.selectWordInterval),this.state.isPlaying=!1,this.uiElements.loadingElement.classList.remove("show"),this.uiElements.playButton.classList.remove("pause");break;case"LOADING":this.selectWordInterval&&clearInterval(this.selectWordInterval),this.uiElements.loadingElement.classList.add("show");break;case"PLAYING":{if(this.state.isFirst){let a=this.uiElements.progressElement.value*this.audio.duration;a>0&&this.seekTo(a),this.state.isFirst=!1}this.state.isPlaying=!0,this.uiElements.loadingElement.classList.remove("show"),this.uiElements.playButton.classList.add("pause");const r=200/this.audio.speechRate;this.selectWordInterval&&clearInterval(this.selectWordInterval),this.selectWordInterval=setInterval(()=>{this.audio.currentTime+=r,this.audioAligner.selectWord(!0)},r);break}case"ERROR":this.reset();break;default:this.state.isFirst?this.uiElements.loadingElement.classList.remove("show"):this.reset()}else this.state.isFirst||this.reset()},this.purpleService.purpleRef.media.addStatusListener(this.state.stateListener),this.state.connectionStateListener=i=>{"OFFLINE"===i.state?this.state.isOffline=!0:(this.state.isOffline=!1,this.uiElements.loadingElement.classList.remove("show"))},window.purple.app.addConnectionStateListener(this.state.connectionStateListener);const e=document.getElementById("tts-player");var t,s;this.createPlayerElement(),e&&(e.remove(),null!==(t=this.previousState)&&void 0!==t&&t.isOpen.value&&this.openPlayer(null===(s=this.previousState)||void 0===s?void 0:s.isPlaying)),this.isUiRendered=!0}createTopBarElements(){let e=document.getElementsByTagName("storefront-app-bar")[0];this.uiElements.openPlayerButton=document.createElement("span"),this.uiElements.openPlayerButton.id="tts-player-open",this.uiElements.openPlayerButton.classList.add("icon"),(this.ttsService.disabledForPreview()||this.ttsService.disabledForAd())&&this.uiElements.openPlayerButton.classList.add("disabled"),this.uiElements.openPlayerButton.href="javascript:;",this.uiElements.openPlayerButton.addEventListener("click",()=>this.toggleOpenPlayer()),e.insertBefore(this.uiElements.openPlayerButton,e.childNodes[0])}createPlayerElement(){this.uiElements.playerElement=document.createElement("div"),this.uiElements.playerElement.id="tts-player",this.uiElements.playerElement.addEventListener("click",t=>{t.target!==this.uiElements.progressElement&&t.preventDefault()}),this.uiElements.playerElement.addEventListener("touchmove",t=>{t.target!==this.uiElements.progressElement&&t.preventDefault()}),this.createPlayerProgressElements(),this.createPlayerControlElements(),this.createSettingsElements();const e=document.getElementsByClassName("bottom-sticky-elements")[0];e&&e.insertBefore(this.uiElements.playerElement,e.firstElementChild)}createPlayerControlElements(){this.uiElements.controlsContainer=document.createElement("div"),this.uiElements.controlsContainer.id="tts-player-controls",this.uiElements.playButton=document.createElement("div"),this.uiElements.playButton.id="tts-player-button-play",this.uiElements.playButton.className="tts-button",this.uiElements.playButton.addEventListener("click",()=>this.togglePlay()),this.uiElements.seekBackButton=document.createElement("div"),this.uiElements.seekBackButton.id="tts-player-button-seek-back",this.uiElements.seekBackButton.classList.add("tts-player-button-seek","tts-button"),this.uiElements.seekBackButton.innerHTML=this.ttsService.ttsConfig.ttsSeekInterval,this.uiElements.seekBackButton.addEventListener("click",()=>{let t=Math.max(0,this.audio.currentTime-E.convertSecondsToMilli(this.ttsService.ttsConfig.ttsSeekInterval)*this.audio.speechRate);t!==this.audio.currentTime&&(this.seekTo(t),this.setAudioProgress(t,this.audio.bufferedTime),this.audioAligner.selectWord(!0),0===t&&(this.contentElement.scrollTop=0))}),this.uiElements.seekForwardButton=document.createElement("div"),this.uiElements.seekForwardButton.id="tts-player-button-seek-forward",this.uiElements.seekForwardButton.classList.add("tts-player-button-seek","tts-button"),this.uiElements.seekForwardButton.innerHTML=this.ttsService.ttsConfig.ttsSeekInterval,this.uiElements.seekForwardButton.addEventListener("click",t=>{let s=Math.min(this.audio.duration,this.audio.currentTime+E.convertSecondsToMilli(this.ttsService.ttsConfig.ttsSeekInterval)*this.audio.speechRate);s!==this.audio.currentTime&&(this.seekTo(s),this.setAudioProgress(s,this.audio.bufferedTime),this.audioAligner.selectWord(!0))}),this.uiElements.controlsContainer.classList.add("no-navigation"),this.uiElements.loadingElement=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.uiElements.loadingElement.id="tts-player-loading",this.uiElements.loadingElement.setAttribute("viewBox","0 0 66 66");let e=document.createElementNS("http://www.w3.org/2000/svg","circle");e.setAttribute("cx","33"),e.setAttribute("cy","33"),e.setAttribute("r","30"),this.uiElements.loadingElement.appendChild(e),this.uiElements.controlsContainer.appendChild(this.uiElements.seekBackButton),this.uiElements.controlsContainer.appendChild(this.uiElements.playButton),this.uiElements.controlsContainer.appendChild(this.uiElements.seekForwardButton),this.uiElements.controlsContainer.appendChild(this.uiElements.loadingElement),this.uiElements.playerElement.appendChild(this.uiElements.controlsContainer)}createSettingsElements(){const e=document.createElement("div");e.id="tts-player-button-settings",e.className="tts-button",this.uiElements.settingsButton=document.createElement("span"),this.uiElements.settingsButton.addEventListener("click",i=>{i.preventDefault(),this.uiElements.settingsContainer.classList.contains("open")?this.closeSettings():this.openSettings()}),e.appendChild(this.uiElements.settingsButton),this.uiElements.settingsContainer=document.createElement("div"),this.uiElements.settingsContainer.id="tts-player-settings",this.uiElements.settingsContainer.classList.add("container-popup"),window.addEventListener("click",i=>{i.target!==this.uiElements.settingsContainer&&i.target!==this.uiElements.speechContainer&&i.target!==this.uiElements.speechRateContainer&&i.target!==this.uiElements.settingsButton&&this.uiElements.settingsContainer.classList.contains("open")&&this.closeSettings()}),window.addEventListener("resize",()=>{this.uiElements.settingsContainer.classList.contains("open")&&this.closeSettings()}),this.uiElements.progressContainer.appendChild(e),this.uiElements.playerElement.appendChild(this.uiElements.settingsContainer);let t=this.getSpeechObject();if(Object.keys(t).length>1){let i=document.createElement("h3");i.innerHTML=this.ttsService.ttsMessages.TTS_SPEECH_TITLE||"",this.uiElements.settingsContainer.appendChild(i),this.uiElements.speechContainer=document.createElement("div"),this.uiElements.speechContainer.id="tts-speech";for(let[n,r]of Object.entries(t)){let a=r.gender,u=document.createElement("span");u.className="speech-icon";let p=document.createElement("span");p.className="speech-name",p.innerHTML=n;let g=document.createElement("input");g.className="speech-btn",g.setAttribute("type","radio");let h=document.createElement("div");h.id=n,h.classList.add(a+"-speech-container","speech-container"),h.appendChild(u),h.appendChild(p),h.appendChild(g),h.addEventListener("click",f=>{if(f.preventDefault(),h.id!==this.audio.speech){let C=this.state.isPlaying;this.stop(),this.changeSpeech(h.id,!0),C&&this.play()}},!0),this.uiElements.speechContainer.appendChild(h)}this.setSelectedSpeech(),this.uiElements.settingsContainer.appendChild(this.uiElements.speechContainer)}let s=document.createElement("h3");s.innerHTML=this.ttsService.ttsMessages.TTS_SPEECH_RATE_TITLE||"",this.uiElements.settingsContainer.appendChild(s),this.uiElements.speechRateContainer=document.createElement("div"),this.uiElements.speechRateContainer.id="tts-speech-rate",this.uiElements.speechRateOptionVerySlow=document.createElement("div"),this.uiElements.speechRateOptionVerySlow.className="speech-rate-option",this.uiElements.speechRateOptionVerySlow.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow),this.uiElements.speechRateOptionVerySlow.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow,!0)}),this.uiElements.speechRateOptionSlow=document.createElement("div"),this.uiElements.speechRateOptionSlow.className="speech-rate-option",this.uiElements.speechRateOptionSlow.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionSlow),this.uiElements.speechRateOptionSlow.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionSlow,!0)}),this.uiElements.speechRateOptionNormal=document.createElement("div"),this.uiElements.speechRateOptionNormal.className="speech-rate-option",this.uiElements.speechRateOptionNormal.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionNormal),this.uiElements.speechRateOptionNormal.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionNormal,!0)}),this.uiElements.speechRateOptionFast=document.createElement("div"),this.uiElements.speechRateOptionFast.className="speech-rate-option",this.uiElements.speechRateOptionFast.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionFast),this.uiElements.speechRateOptionFast.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionFast,!0)}),this.uiElements.speechRateOptionVeryFast=document.createElement("div"),this.uiElements.speechRateOptionVeryFast.className="speech-rate-option",this.uiElements.speechRateOptionVeryFast.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast),this.uiElements.speechRateOptionVeryFast.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast,!0)}),this.setSpeechRateUi(this.audio.speechRate),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionVerySlow),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionSlow),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionNormal),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionFast),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionVeryFast),this.uiElements.settingsContainer.appendChild(this.uiElements.speechRateContainer)}togglePlay(){this.state.isPlaying?this.pause():this.play()}toggleOpenPlayer(){this.state.isOpen.value?this.closePlayer(!0):this.openPlayer(!0)}updateProgressBarWithBuffering(e,t){const s=100*t,i=100*e;this.uiElements.progressElement.value=e,this.uiElements.progressElement.style.background="-webkit-gradient(linear, left top, right top, color-stop("+i+"%, var(--progressColor)), color-stop("+i+"%, var(--bufferingColor)), color-stop("+s+"%, var(--bufferingColor)), color-stop("+s+"%, var(--progressBgColor)))"}setAudioProgress(e,t,s){this.setCurrentTime(e),this.setDuration(s=s||this.audio.duration),this.setBufferedTime(t=t||this.audio.bufferedTime);let i=e/s;this.updateProgressBarWithBuffering(i,t>=e?t/s:i)}onProgressChange(e){let t=e.target.value*this.audio.duration;("input"===e.type||"touchend"===e.type)&&this.seekTo(t),this.setAudioProgress(t,this.audio.bufferedTime),this.audioAligner.selectWord(!0)}onProgressTouchEvent(e){e.preventDefault(),e.target.value=((e.pageX||e.touches&&e.touches[0]&&e.touches[0].pageX||e.changedTouches&&e.changedTouches[0]&&e.changedTouches[0].pageX)-e.target.offsetLeft)/e.target.offsetWidth,this.onProgressChange(e)}setCurrentTime(e){this.audio.currentTime=e,this.uiElements.currentTimeElement&&(this.uiElements.currentTimeElement.innerHTML=E.getFormattedTime(e/this.audio.speechRate))}setDuration(e){this.audio.duration=e,this.uiElements.durationElement&&(this.uiElements.durationElement.innerHTML=E.getFormattedTime(e/this.audio.speechRate))}setBufferedTime(e){this.audio.bufferedTime=e}setSpeechRate(e){var t=this;return(0,d.A)(function*(){try{var s;(null===(s=window.purple.media.version)||void 0===s?void 0:s.major)>=2?yield window.purple.media.setPlaybackRate({playbackRate:e}):window.purple.media.setPlaybackRate(e),t.audio.speechRate=e,t.purpleService.setState(c.SPEECH_RATE_IDENTIFIER,e.toString())}catch(i){console.warn("TTS playback rate could not be set: "+i)}})()}setSpeechRateUi(e){Array.from(document.getElementsByClassName("speech-rate-option")).forEach(t=>t.classList.remove("selected")),e===this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow?this.uiElements.speechRateOptionVerySlow.classList.toggle("selected"):e===this.ttsService.ttsConfig.ttsSpeechRateOptionSlow?this.uiElements.speechRateOptionSlow.classList.toggle("selected"):e===this.ttsService.ttsConfig.ttsSpeechRateOptionFast?this.uiElements.speechRateOptionFast.classList.toggle("selected"):e===this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast?this.uiElements.speechRateOptionVeryFast.classList.toggle("selected"):this.uiElements.speechRateOptionNormal.classList.toggle("selected"),this.uiElements.speechRateContainer.classList.remove("open")}getSpeechRateValue(e){let t;switch(e){case this.ttsService.ttsConfig.ttsSpeechRateOptionNormal:t="0";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionSlow:t="-1";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow:t="-2";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionFast:t="+1";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast:t="+2";break;default:t=""}return t}getFirstSpeechKey(){let e=this.getSpeechObject();return Object.keys(e)[0]}getSpeechObject(){return this.ttsService.ttsContentConfig}getDefaultSpeech(){return Object.keys(this.getSpeechObject()).includes(this.ttsService.ttsConfig.ttsDefaultSpeech)?this.ttsService.ttsConfig.ttsDefaultSpeech:this.getFirstSpeechKey()}openSettings(){this.uiElements.settingsContainer.classList.add("open"),E.setSettingsContainerPosition(this.uiElements.settingsButton,this.uiElements.settingsContainer)}closeSettings(){this.uiElements.settingsContainer.classList.remove("open")}setSelectedSpeech(){Array.from(this.uiElements.speechContainer.getElementsByClassName("speech-container")).forEach(e=>{let t=e.getElementsByTagName("input")[0];t.classList.remove("selected"),e.id===this.audio.speech&&t.classList.add("selected")})}getTrackingBaseKey(){return"TTS"}isCurrent(){return this.state.isCurrent}createPlayerProgressElements(){this.uiElements.progressContainer=document.createElement("div"),this.uiElements.progressContainer.id="tts-player-progress",this.uiElements.currentTimeElement=document.createElement("span"),this.uiElements.currentTimeElement.className="tts-player-time",this.uiElements.currentTimeElement.innerHTML=E.getFormattedTime(0),this.uiElements.durationElement=document.createElement("span"),this.uiElements.durationElement.className="tts-player-time",this.uiElements.durationElement.innerHTML=E.getFormattedTime(this.audio.duration/this.audio.speechRate),this.uiElements.progressElement=document.createElement("input"),this.uiElements.progressElement.type="range",this.uiElements.progressElement.min=0,this.uiElements.progressElement.max=1,this.uiElements.progressElement.value=0,this.uiElements.progressElement.step=1e-5,this.uiElements.progressElement.addEventListener("input",e=>this.onProgressChange(e)),this.uiElements.progressElement.addEventListener("touchmove",e=>this.onProgressTouchEvent(e)),this.uiElements.progressElement.addEventListener("touchend",e=>this.onProgressTouchEvent(e)),this.uiElements.progressElement.addEventListener("click",e=>this.onProgressTouchEvent(e)),this.uiElements.progressContainer.appendChild(this.uiElements.currentTimeElement),this.uiElements.progressContainer.appendChild(this.uiElements.progressElement),this.uiElements.progressContainer.appendChild(this.uiElements.durationElement),this.uiElements.playerElement.appendChild(this.uiElements.progressContainer)}createSpeechPropertiesUrl(e){const t=new URL(this.ttsService.getTtsResourceBaseUrl()),i=new URL(e).pathname.split("/").splice(-4).join("/");return t.pathname=("/"==t.pathname?"":t.pathname)+"/"+i,t.href}}var b=o(1626),F=o(9516),D=o(7900),_=o(5102);const T={ttsContentSelector:"#sprylab_purple_content",ttsMarkerContentSelector:"#sprylab_purple_content .purple-inner-container",ttsSkipContentClasses:["no-tts"],ttsSkipContentTags:["svg","polygon","path"],ttsDefaultSpeech:"",ttsSeekInterval:10,ttsSpeechRateOptionVerySlow:.7,ttsSpeechRateOptionSlow:.85,ttsSpeechRateOptionNormal:1,ttsSpeechRateOptionFast:1.15,ttsSpeechRateOptionVeryFast:1.3,ttsNextArticleLoadingTime:1e4,ttsDisableForPreview:!1,ttsDisableForAd:!0},k={TTS_SPEECH_TITLE:"Speaker",TTS_SPEECH_RATE_TITLE:"Speed rate",TTS_NO_INTERNET_CONNECTION_TITLE:"No internet connection!",TTS_NO_INTERNET_CONNECTION_TEXT:"To activate read mode, you need to have internet connection.",TTS_NO_INTERNET_CONNECTION_RETRY_BUTTON:"Retry",TTS_NEXT_ARTICLE_TITLE:"Next article",TTS_NEXT_ARTICLE_TEXT:'"%s"',TTS_NEXT_ARTICLE_SKIP_BUTTON:"Skip",TTS_LAST_ARTICLE_TITLE:"End of issue",TTS_LAST_ARTICLE_TEXT:"You have heard the last article of this issue.",TTS_LAST_ARTICLE_CLOSE_BUTTON:"Close",TTS_CANCEL_BUTTON:"Cancel"};let M=(()=>{var l;class e{constructor(s,i,n,r,a,u,p){this.platformId=s,this.document=i,this.purpleEnv=n,this.http=r,this.contextService=a,this.translateService=u,this.purpleService=p,this.initTts$=new P.B,this.ttsPlayerCancel$=new R.t(!1),(0,v.UE)(this.platformId)&&(this.loadTTSConfig(),this.loadTTSMessages())}initTTSforPost(s){(0,v.UE)(this.platformId)&&this.init(s)}init(s){var i=this;return(0,d.A)(function*(){var n;i.ttsPlayerCancel$.next(!1),s.resources||(s=yield i.purpleService.getCatalogContent(s.id,!0,{includeResources:!0}));const r=null===(n=s.resources)||void 0===n?void 0:n.find(a=>!!a.properties.ttsResource);if(r)if(yield i.loadTTSContentConfig(r.url),i.purpleService.purpleRef&&i.purpleService.purpleRef.media&&i.ttsContentConfig&&i.ttsConfig&&i.ttsMessages){let a;if(i.ttsPlayer&&(i.ttsPlayer.delete(),a=i.ttsPlayer.state,delete i.ttsPlayer),!0===i.ttsPlayerCancel$.getValue())return console.debug("TTS init canceled"),void i.initTts$.next(!1);try{i.ttsPlayer=new B(i.ttsConfig,s,i,i.purpleService,a),i.ttsPlayer.init(),i.initTts$.next(!0)}catch(u){i.initTts$.next(!1),console.error("TTS init error:",u)}}else i.initTts$.next(!1),console.error("Could not init TTS player");else i.initTts$.next(!1)})()}disabledForPreview(){return this.ttsConfig.ttsDisableForPreview}disabledForAd(){return this.ttsConfig.ttsDisableForAd}loadTTSContentConfig(s){var i=this;return(0,d.A)(function*(){try{let n=yield S(s,{useFetch:!0,returnRedirect:!0});if(n.redirectUrl){const r=new URL(n.redirectUrl);n.response||(r.search="",n=yield S(r.href,{useFetch:!0}));const a=r.pathname.split("/");a.splice(-4),r.pathname=a.join("/"),i.ttsResourceBaseUrl=r.href,i.ttsContentConfig=yield n.response}else i.ttsContentConfig=yield n.response}catch(n){console.error("Could not load tts content config: "+n)}})()}loadTTSConfig(){var s=this;return(0,d.A)(function*(){try{const i=(0,N.vA)((0,N.bU)(s.document.location.href),s.purpleEnv,s.contextService),n=yield S("".concat(s.contextService.getBaseUrl(),"assets/tts_config.json").concat(i));s.ttsConfig={...T,...n},n.ttsSkipContentClasses&&(s.ttsConfig.ttsSkipContentClasses=[...T.ttsSkipContentClasses,...n.ttsSkipContentClasses]),n.ttsSkipContentTags&&(s.ttsConfig.ttsSkipContentTags=[...T.ttsSkipContentTags,...n.ttsSkipContentTags])}catch(i){s.ttsConfig=T,console.warn("Could not load custom tts config: "+i)}})()}loadTTSMessages(){var s=this;return(0,d.A)(function*(){try{const i=s.translateService.messages;s.ttsMessages={...k,...i}}catch(i){s.ttsMessages=k,console.warn("Could not load custom tts messages: "+i)}})()}delete(){var s,i,n,r;this.ttsPlayerCancel$.next(!0),null===(s=this.ttsPlayer)||void 0===s||s.reset(),null===(i=this.ttsPlayer)||void 0===i||i.delete(),null!==(n=this.ttsPlayer)&&void 0!==n&&null!==(n=n.state)&&void 0!==n&&n.forceOpen||null===(r=this.ttsPlayer)||void 0===r||r.closePlayer()}updateForceOpen(){var s;null!==(s=this.ttsPlayer)&&void 0!==s&&s.state.isOpen.value&&(this.ttsPlayer.state.forceOpen=!0)}getTtsResourceBaseUrl(){return this.ttsResourceBaseUrl}}return(l=e).\u0275fac=function(s){return new(s||l)(m.KVO(m.Agw),m.KVO(v.qQ),m.KVO(L.r6),m.KVO(b.Qq),m.KVO(F.V),m.KVO(D.c),m.KVO(_.Wj))},l.\u0275prov=m.jDH({token:l,factory:l.\u0275fac,providedIn:"root"}),e})()}}]);
|
1
|
+
"use strict";(self.webpackChunkstorefront=self.webpackChunkstorefront||[]).push([["default-projects_storefront_src_app_service_tts_tts_service_ts"],{5628:(x,w,o)=>{o.d(w,{z:()=>M});var d=o(467),v=o(177),m=o(3953);function S(l,e={}){var t;return l.startsWith("//")&&(l=window.location.protocol+l),e.useFetch?fetch(l,{method:null!==(t=e.method)&&void 0!==t?t:"GET"}).then(s=>{if(s.status>399){if(e.returnRedirect)return{redirectUrl:s.url};throw new Error("Failed to load json ".concat(l," : ").concat(s.statusText))}return s.redirected&&e.returnRedirect?{response:s.json(),redirectUrl:s.url}:{response:s.json()}}):new Promise((s,i)=>{const n=new XMLHttpRequest;n.addEventListener("load",()=>{n.status>399&&i(new Error("Failed to load json ".concat(l," : ").concat(n.statusText)));try{s(JSON.parse(n.responseText))}catch{i()}}),n.addEventListener("error",()=>{i()}),n.open(e&&e.method||"GET",l),n.send()})}var P=o(1413),R=o(4412),O=o(7879),L=o(7370);let c=(()=>{var l;class e{}return(l=e).SPEECH_IDENTIFIER="TTS_SPEECH",l.SPEECH_RATE_IDENTIFIER="TTS_SPEECH_RATE",l.PLAYER_OPEN_IDENTIFIER="TTS_PLAYER_OPEN",l.AUDIO_PLAYING_IDENTIFIER="TTS_AUDIO_PLAYING",e})();class I{constructor(e){this.foundTagName="span",this.foundTagClass="word",this.skipClasses=[],this.skipTags=[],this.root=null,this.currentDepth=-1,this.currentNode=null,this.lastSuccessfulNode=null,this.lastSuccessfulDepth=-1,this.currentWord="";for(let t in e)this[t]=e[t];this.skipClassesRegex=new RegExp("("+this.skipClasses.map(t=>"".concat(t,"(?=(\\s|$))")).join("|")+")","i"),this.skipTagsRegex=new RegExp("("+this.skipTags.map(t=>"".concat(t,"(?=(\\s|$))")).join("|")+")","i")}reset(){this.root=null,this.currentDepth=-1,this.currentNode=null,this.lastSuccessfulNode=null,this.lastSuccessfulDepth=-1}next(e){return this.currentWord=e,null==this.lastSuccessfulNode?(this.currentNode=this.root.childNodes[0],this.currentDepth=1):(this.currentNode=this.lastSuccessfulNode,this.currentDepth=this.lastSuccessfulDepth),this.searchNodes()}searchNodes(){let e=null;for(;this.currentNode&&this.currentDepth>0&&null==e;){switch(this.currentNode.nodeType){case 1:if(!this.skipTagsRegex.test(this.currentNode.tagName)&&!this.skipClassesRegex.test(this.currentNode.className.toLowerCase())&&this.currentNode.childNodes.length>0&&!this.currentNode.classList.contains(this.foundTagClass)){this.currentNode=this.currentNode.childNodes[0],this.currentDepth++;continue}break;case 3:case 4:if(e=this.findTextInNode(),null!=e)return this.lastSuccessfulNode=e,this.lastSuccessfulDepth=this.currentDepth,this.currentNode=null,this.currentDepth=-1,e}if(this.currentNode.nextSibling)this.currentNode=this.currentNode.nextSibling;else for(;this.currentDepth>0;)if(this.currentNode=this.currentNode.parentNode,this.currentDepth--,this.currentNode.nextSibling){this.currentNode=this.currentNode.nextSibling;break}}return null}findTextInNode(){let t=this.currentNode&&this.currentNode.parentNode.tagName===this.foundTagName.toUpperCase()&&this.currentNode.parentNode.classList.contains(this.foundTagClass)?-1:this.currentNode.data.indexOf(this.currentWord);if(t>-1){let s=1===this.currentNode.nodeType?this.currentNode.firstChild:this.currentNode,i=t>0?s.splitText(t):s;i.splitText(this.currentWord.length);let n=document.createElement(this.foundTagName);n.setAttribute("class",this.foundTagClass);const r=i.parentNode;return n.innerText=i.data,r.replaceChild(n,i),n}return null}}class A{constructor(e,t,s,i,n,r,a){this.currentWordClassName="current",this.markersData=[],this.isScrolling=!1,this.previousMarker=null,this.wordFinder=new I({root:s,skipClasses:i,skipTags:n}),this.audio=e,this.markerSrc=t,this.ttsService=r,this.ttsPlayer=a}reset(e,t,s){this.wordFinder.root=s,this.audio=e,this.markerSrc=t}align(){return new Promise((e,t)=>{e(this.loadMarkers())})}selectWord(e){if(null!=this.markersData){let t=this.audio.currentTime;this.markersData.forEach((s,i)=>{let n=i<Object.keys(this.markersData).length-1?this.markersData[i+1]:null;if(t>=s.time&&(null==n||t<=n.time)&&!this.compareMarkers(s,this.previousMarker))for(let r of s.node){this.deselectWord(),this.previousMarker=s,r.classList.add(this.currentWordClassName);let a={top:80,bottom:185,left:0,right:0},u=this.isOutOfViewport(r,a);const p=this.ttsPlayer.contentElement.scrollTop,g=this.ttsPlayer.contentElement.clientHeight,h=this.ttsPlayer.contentElement.scrollHeight;if(this.isScrolling=this.isScrolling&&Math.floor(this.lastScrollTo)!=Math.floor(p)&&Math.floor(p)+g+1<h&&p+g<h,e&&u&&!this.isScrolling){let f=this.ttsPlayer.contentElement,C=r.getBoundingClientRect().top+f.scrollTop+f.offsetTop;const k=C-(C>a.top?a.top:0);f.scrollTo({top:k,behavior:"smooth"}),this.isScrolling=!0,this.lastScrollTo=k}}})}}deselectWord(){Array.from(document.getElementsByClassName(this.currentWordClassName)).forEach(e=>e.classList.remove(this.currentWordClassName))}loadMarkers(){var e=this;return(0,d.A)(function*(){try{e.markersData=(yield S(e.markerSrc)).markers,e.assignMarkers()}catch(t){console.error("Could not load markers: "+t)}})()}assignMarkers(){this.markersData.forEach(e=>{if(e.node=[],e.markerValues)for(let t of e.markerValues)this.createNode(this.encodeString(t),e);else this.createNode(this.encodeString(e.value),e)}),this.wordFinder.reset()}isOutOfViewport(e,t={top:0,bottom:0,left:0,right:0}){const s=e.getBoundingClientRect(),r=s.bottom>(window.innerHeight||document.documentElement.clientHeight)-t.bottom,a=s.right>(window.innerWidth||document.documentElement.clientWidth)-t.right;return s.top<t.top||s.left<t.left||r||a}createNode(e,t){let s=this.wordFinder.next(e);null!=s&&t.node.push(s)}encodeString(e){return(new DOMParser).parseFromString(e,"text/html").body.textContent}compareMarkers(e,t){return!(!e||!t)&&e.end==t.end&&e.start==t.start&&e.time==t.time}}class E{static getFormattedTime(e){return new Date(e).toLocaleTimeString([],{minute:"2-digit",second:"2-digit"})}static convertSecondsToMilli(e){return 1e3*e}static setSettingsContainerPosition(e,t){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect(),n=window.getComputedStyle(t,"::before"),a=Math.round(s.top)-i.height/2+s.height/2;let u=s.left;const p=n?window.innerWidth-u-parseInt(n.right,10):window.innerWidth-u;t.style.top=a+"px",t.style.right=p+"px"}}class B{constructor(e,t,s,i,n){var r,a;if(this.ttsConfig=e,this.post=t,this.ttsService=s,this.purpleService=i,this.previousState=n,this.articleIndex=0,this.contentElement=null,this.markerContentElement=null,this.audio={src:"",duration:0,currentTime:0,bufferedTime:0,speech:"",speechMarkerSrc:"",speechRate:this.ttsService.ttsConfig.ttsSpeechRateOptionNormal},this.audioAligner=null,this.selectWordInterval=null,this.state={isOpen:new R.t((null===(r=this.previousState)||void 0===r?void 0:r.isOpen.value)||!1),isFirst:!0,isCurrent:!1,isPlaying:!1,isOffline:!1,progressListener:null,stateListener:null,connectionStateListener:null,forceOpen:!1},this.uiElements={playerElement:null,progressContainer:null,currentTimeElement:null,durationElement:null,progressElement:null,bufferingElement:null,settingsButton:null,settingsContainer:null,speechRateContainer:null,speechRateOptionVerySlow:null,speechRateOptionSlow:null,speechRateOptionNormal:null,speechRateOptionFast:null,speechRateOptionVeryFast:null,speechContainer:null,controlsContainer:null,loadingElement:null,playButton:null,seekBackButton:null,seekForwardButton:null,navigateBackButton:null,navigateForwardButton:null,openPlayerButton:null},this.ttsPlayerStateSubject=new R.t(null),this.ttsPlayerState$=this.ttsPlayerStateSubject.asObservable(),this.isUiRendered=!1,this.isDeleted=!1,this.contentElement=null===(a=document.querySelectorAll(e.ttsContentSelector)[0])||void 0===a?void 0:a.firstElementChild,this.markerContentElement=document.querySelectorAll(e.ttsMarkerContentSelector)[0],!this.contentElement||!this.markerContentElement)throw{message:"Failed to init TTS.\n Found contentElement (".concat(e.ttsContentSelector,"): ").concat(!!this.contentElement,"\n Found markerContentElement (").concat(e.ttsMarkerContentSelector,"): ").concat(!!this.markerContentElement,"\n ")}}init(){var e=this;return(0,d.A)(function*(){let t;e.state.isFirst=!0;try{t=yield e.purpleService.getState(c.SPEECH_IDENTIFIER),(!t||""===t)&&(t=e.getDefaultSpeech(),e.purpleService.setState(c.SPEECH_IDENTIFIER,t))}catch(s){t=e.getDefaultSpeech(),e.purpleService.setState(c.SPEECH_IDENTIFIER,t),console.warn("Could not get speech: "+s)}if(!e.isDeleted){try{let s=parseFloat(yield e.purpleService.getState(c.SPEECH_RATE_IDENTIFIER));s||(s=e.ttsConfig.ttsSpeechRateOptionNormal),yield e.setSpeechRate(s)}catch(s){yield e.setSpeechRate(e.ttsConfig.ttsSpeechRateOptionNormal),console.warn("Can not get state of speech rate: "+s)}e.isDeleted||(e.setAudioParameters(t),e.audioAligner=new A(e.audio,e.audio.speechMarkerSrc,e.markerContentElement,e.ttsConfig.ttsSkipContentClasses,e.ttsConfig.ttsSkipContentTags,e.ttsService,e),yield e.audioAligner.align(),!e.isDeleted&&e.afterAudioAlignment())}})()}reset(){var e,t;this.selectWordInterval&&clearInterval(this.selectWordInterval),this.audioAligner.deselectWord(),this.contentElement.scrollTop=0,this.state.isFirst=!0,null===(e=this.uiElements.loadingElement)||void 0===e||e.classList.remove("show"),null===(t=this.uiElements.playButton)||void 0===t||t.classList.remove("pause"),this.isUiRendered&&this.setAudioProgress(0,0)}delete(){this.stop(),window.purple.media.removeProgressListener(this.state.progressListener),window.purple.media.removeStatusListener(this.state.stateListener),window.purple.app.removeConnectionStateListener(this.state.connectionStateListener),this.isDeleted=!0}openPlayer(e=!1){this.purpleService.setState(c.PLAYER_OPEN_IDENTIFIER,"1"),(!this.state.isOpen.value||!this.uiElements.playerElement.classList.contains("open"))&&(this.uiElements.playerElement.classList.add("open"),this.state.isOpen.next(!0)),e&&this.play()}closePlayer(e=!1){this.purpleService.setState(c.PLAYER_OPEN_IDENTIFIER,"0"),this.uiElements.playerElement&&this.uiElements.playerElement.classList.remove("open"),this.state.isOpen.next(!1),this.audioAligner.deselectWord(),e&&this.pause()}play(){this.purpleService.setState(c.AUDIO_PLAYING_IDENTIFIER,"1"),this.state.isFirst?window.purple.media.startAudio({displayName:this.post.name,url:this.audio.src}):window.purple.media.resumeAudio()}pause(){this.purpleService.setState(c.AUDIO_PLAYING_IDENTIFIER,"0"),window.purple.media.pauseAudio()}stop(){this.purpleService.setState(c.AUDIO_PLAYING_IDENTIFIER,"0"),window.purple.media.stopAudio()}seekTo(e){window.purple.media.seekTo({time:Math.round(e)})}changeSpeech(e,t=!1){this.purpleService.setState(c.SPEECH_IDENTIFIER,e),this.setAudioParameters(e),this.reloadContentMarker(),this.setSelectedSpeech(),this.reset()}changeSpeechRate(e,t=!1){var s=this;return(0,d.A)(function*(){yield s.setSpeechRate(e),s.setSpeechRateUi(e),s.setAudioProgress(s.audio.currentTime,s.audio.bufferedTime)})()}reloadContentMarker(){var e=this;return(0,d.A)(function*(){let t=Array.from(e.markerContentElement.getElementsByClassName("word"));for(let s of t)s.replaceWith(s.innerHTML);e.audioAligner.reset(e.audio,e.audio.speechMarkerSrc,e.markerContentElement),yield e.audioAligner.align(),e.afterAudioAlignment()})()}setAudioParameters(e){let t=this.getSpeechObject()[e];t||(e=this.getDefaultSpeech(),t=this.getSpeechObject()[e],this.purpleService.setState(c.SPEECH_IDENTIFIER,e)),this.audio.speech=e,this.audio.src=this.createSpeechPropertiesUrl(t.url),this.audio.speechMarkerSrc=this.createSpeechPropertiesUrl(t.speechMarkerUrl),this.audio.duration=t.length}afterAudioAlignment(){this.uiElements.playerElement||this.initUi()}initUi(){this.state.progressListener=i=>{const n=i.detail?i.detail:i;this.isCurrent()&&n.duration>0&&(n.currentTime>=n.duration?(this.setAudioProgress(0),this.closePlayer()):this.setAudioProgress(n.currentTime,n.bufferedTime,n.duration))},this.purpleService.purpleRef.media.addProgressListener(this.state.progressListener),this.state.stateListener=i=>{const n=i.detail?i.detail:i;if(this.state.isCurrent=n.url===this.audio.src,this.isCurrent())switch(n.playbackState){case"READY":this.selectWordInterval&&clearInterval(this.selectWordInterval),this.state.isPlaying=!1,this.uiElements.loadingElement.classList.remove("show"),this.uiElements.playButton.classList.remove("pause");break;case"LOADING":this.selectWordInterval&&clearInterval(this.selectWordInterval),this.uiElements.loadingElement.classList.add("show");break;case"PLAYING":{if(this.state.isFirst){let a=this.uiElements.progressElement.value*this.audio.duration;a>0&&this.seekTo(a),this.state.isFirst=!1}this.state.isPlaying=!0,this.uiElements.loadingElement.classList.remove("show"),this.uiElements.playButton.classList.add("pause");const r=200/this.audio.speechRate;this.selectWordInterval&&clearInterval(this.selectWordInterval),this.selectWordInterval=setInterval(()=>{this.audio.currentTime+=r,this.audioAligner.selectWord(!0)},r);break}case"ERROR":this.reset();break;default:this.state.isFirst?this.uiElements.loadingElement.classList.remove("show"):this.reset()}else this.state.isFirst||this.reset()},this.purpleService.purpleRef.media.addStatusListener(this.state.stateListener),this.state.connectionStateListener=i=>{"OFFLINE"===i.state?this.state.isOffline=!0:(this.state.isOffline=!1,this.uiElements.loadingElement.classList.remove("show"))},window.purple.app.addConnectionStateListener(this.state.connectionStateListener);const e=document.getElementById("tts-player");var t,s;this.createPlayerElement(),e&&(e.remove(),null!==(t=this.previousState)&&void 0!==t&&t.isOpen.value&&this.openPlayer(null===(s=this.previousState)||void 0===s?void 0:s.isPlaying)),this.isUiRendered=!0}createTopBarElements(){let e=document.getElementsByTagName("storefront-app-bar")[0];this.uiElements.openPlayerButton=document.createElement("span"),this.uiElements.openPlayerButton.id="tts-player-open",this.uiElements.openPlayerButton.classList.add("icon"),(this.ttsService.disabledForPreview()||this.ttsService.disabledForAd())&&this.uiElements.openPlayerButton.classList.add("disabled"),this.uiElements.openPlayerButton.href="javascript:;",this.uiElements.openPlayerButton.addEventListener("click",()=>this.toggleOpenPlayer()),e.insertBefore(this.uiElements.openPlayerButton,e.childNodes[0])}createPlayerElement(){this.uiElements.playerElement=document.createElement("div"),this.uiElements.playerElement.id="tts-player",this.uiElements.playerElement.addEventListener("click",t=>{t.target!==this.uiElements.progressElement&&t.preventDefault()}),this.uiElements.playerElement.addEventListener("touchmove",t=>{t.target!==this.uiElements.progressElement&&t.preventDefault()}),this.createPlayerProgressElements(),this.createPlayerControlElements(),this.createSettingsElements();const e=document.getElementsByClassName("bottom-sticky-elements")[0];e&&e.insertBefore(this.uiElements.playerElement,e.firstElementChild)}createPlayerControlElements(){this.uiElements.controlsContainer=document.createElement("div"),this.uiElements.controlsContainer.id="tts-player-controls",this.uiElements.playButton=document.createElement("div"),this.uiElements.playButton.id="tts-player-button-play",this.uiElements.playButton.className="tts-button",this.uiElements.playButton.addEventListener("click",()=>this.togglePlay()),this.uiElements.seekBackButton=document.createElement("div"),this.uiElements.seekBackButton.id="tts-player-button-seek-back",this.uiElements.seekBackButton.classList.add("tts-player-button-seek","tts-button"),this.uiElements.seekBackButton.innerHTML=this.ttsService.ttsConfig.ttsSeekInterval,this.uiElements.seekBackButton.addEventListener("click",()=>{let t=Math.max(0,this.audio.currentTime-E.convertSecondsToMilli(this.ttsService.ttsConfig.ttsSeekInterval)*this.audio.speechRate);t!==this.audio.currentTime&&(this.seekTo(t),this.setAudioProgress(t,this.audio.bufferedTime),this.audioAligner.selectWord(!0),0===t&&(this.contentElement.scrollTop=0))}),this.uiElements.seekForwardButton=document.createElement("div"),this.uiElements.seekForwardButton.id="tts-player-button-seek-forward",this.uiElements.seekForwardButton.classList.add("tts-player-button-seek","tts-button"),this.uiElements.seekForwardButton.innerHTML=this.ttsService.ttsConfig.ttsSeekInterval,this.uiElements.seekForwardButton.addEventListener("click",t=>{let s=Math.min(this.audio.duration,this.audio.currentTime+E.convertSecondsToMilli(this.ttsService.ttsConfig.ttsSeekInterval)*this.audio.speechRate);s!==this.audio.currentTime&&(this.seekTo(s),this.setAudioProgress(s,this.audio.bufferedTime),this.audioAligner.selectWord(!0))}),this.uiElements.controlsContainer.classList.add("no-navigation"),this.uiElements.loadingElement=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.uiElements.loadingElement.id="tts-player-loading",this.uiElements.loadingElement.setAttribute("viewBox","0 0 66 66");let e=document.createElementNS("http://www.w3.org/2000/svg","circle");e.setAttribute("cx","33"),e.setAttribute("cy","33"),e.setAttribute("r","30"),this.uiElements.loadingElement.appendChild(e),this.uiElements.controlsContainer.appendChild(this.uiElements.seekBackButton),this.uiElements.controlsContainer.appendChild(this.uiElements.playButton),this.uiElements.controlsContainer.appendChild(this.uiElements.seekForwardButton),this.uiElements.controlsContainer.appendChild(this.uiElements.loadingElement),this.uiElements.playerElement.appendChild(this.uiElements.controlsContainer)}createSettingsElements(){const e=document.createElement("div");e.id="tts-player-button-settings",e.className="tts-button",this.uiElements.settingsButton=document.createElement("span"),this.uiElements.settingsButton.addEventListener("click",i=>{i.preventDefault(),this.uiElements.settingsContainer.classList.contains("open")?this.closeSettings():this.openSettings()}),e.appendChild(this.uiElements.settingsButton),this.uiElements.settingsContainer=document.createElement("div"),this.uiElements.settingsContainer.id="tts-player-settings",this.uiElements.settingsContainer.classList.add("container-popup"),window.addEventListener("click",i=>{i.target!==this.uiElements.settingsContainer&&i.target!==this.uiElements.speechContainer&&i.target!==this.uiElements.speechRateContainer&&i.target!==this.uiElements.settingsButton&&this.uiElements.settingsContainer.classList.contains("open")&&this.closeSettings()}),window.addEventListener("resize",()=>{this.uiElements.settingsContainer.classList.contains("open")&&this.closeSettings()}),this.uiElements.progressContainer.appendChild(e),this.uiElements.playerElement.appendChild(this.uiElements.settingsContainer);let t=this.getSpeechObject();if(Object.keys(t).length>1){let i=document.createElement("h3");i.innerHTML=this.ttsService.ttsMessages.TTS_SPEECH_TITLE||"",this.uiElements.settingsContainer.appendChild(i),this.uiElements.speechContainer=document.createElement("div"),this.uiElements.speechContainer.id="tts-speech";for(let[n,r]of Object.entries(t)){let a=r.gender,u=document.createElement("span");u.className="speech-icon";let p=document.createElement("span");p.className="speech-name",p.innerHTML=n;let g=document.createElement("input");g.className="speech-btn",g.setAttribute("type","radio");let h=document.createElement("div");h.id=n,h.classList.add(a+"-speech-container","speech-container"),h.appendChild(u),h.appendChild(p),h.appendChild(g),h.addEventListener("click",f=>{if(f.preventDefault(),h.id!==this.audio.speech){let C=this.state.isPlaying;this.stop(),this.changeSpeech(h.id,!0),C&&this.play()}},!0),this.uiElements.speechContainer.appendChild(h)}this.setSelectedSpeech(),this.uiElements.settingsContainer.appendChild(this.uiElements.speechContainer)}let s=document.createElement("h3");s.innerHTML=this.ttsService.ttsMessages.TTS_SPEECH_RATE_TITLE||"",this.uiElements.settingsContainer.appendChild(s),this.uiElements.speechRateContainer=document.createElement("div"),this.uiElements.speechRateContainer.id="tts-speech-rate",this.uiElements.speechRateOptionVerySlow=document.createElement("div"),this.uiElements.speechRateOptionVerySlow.className="speech-rate-option",this.uiElements.speechRateOptionVerySlow.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow),this.uiElements.speechRateOptionVerySlow.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow,!0)}),this.uiElements.speechRateOptionSlow=document.createElement("div"),this.uiElements.speechRateOptionSlow.className="speech-rate-option",this.uiElements.speechRateOptionSlow.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionSlow),this.uiElements.speechRateOptionSlow.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionSlow,!0)}),this.uiElements.speechRateOptionNormal=document.createElement("div"),this.uiElements.speechRateOptionNormal.className="speech-rate-option",this.uiElements.speechRateOptionNormal.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionNormal),this.uiElements.speechRateOptionNormal.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionNormal,!0)}),this.uiElements.speechRateOptionFast=document.createElement("div"),this.uiElements.speechRateOptionFast.className="speech-rate-option",this.uiElements.speechRateOptionFast.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionFast),this.uiElements.speechRateOptionFast.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionFast,!0)}),this.uiElements.speechRateOptionVeryFast=document.createElement("div"),this.uiElements.speechRateOptionVeryFast.className="speech-rate-option",this.uiElements.speechRateOptionVeryFast.innerHTML=this.getSpeechRateValue(this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast),this.uiElements.speechRateOptionVeryFast.addEventListener("click",i=>{i.preventDefault(),this.changeSpeechRate(this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast,!0)}),this.setSpeechRateUi(this.audio.speechRate),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionVerySlow),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionSlow),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionNormal),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionFast),this.uiElements.speechRateContainer.appendChild(this.uiElements.speechRateOptionVeryFast),this.uiElements.settingsContainer.appendChild(this.uiElements.speechRateContainer)}togglePlay(){this.state.isPlaying?this.pause():this.play()}toggleOpenPlayer(){this.state.isOpen.value?this.closePlayer(!0):this.openPlayer(!0)}updateProgressBarWithBuffering(e,t){const s=100*t,i=100*e;this.uiElements.progressElement.value=e,this.uiElements.progressElement.style.background="-webkit-gradient(linear, left top, right top, color-stop("+i+"%, var(--progressColor)), color-stop("+i+"%, var(--bufferingColor)), color-stop("+s+"%, var(--bufferingColor)), color-stop("+s+"%, var(--progressBgColor)))"}setAudioProgress(e,t,s){this.setCurrentTime(e),this.setDuration(s=s||this.audio.duration),this.setBufferedTime(t=t||this.audio.bufferedTime);let i=e/s;this.updateProgressBarWithBuffering(i,t>=e?t/s:i)}onProgressChange(e){let t=e.target.value*this.audio.duration;("input"===e.type||"touchend"===e.type)&&this.seekTo(t),this.setAudioProgress(t,this.audio.bufferedTime),this.audioAligner.selectWord(!0)}onProgressTouchEvent(e){e.preventDefault(),e.target.value=((e.pageX||e.touches&&e.touches[0]&&e.touches[0].pageX||e.changedTouches&&e.changedTouches[0]&&e.changedTouches[0].pageX)-e.target.offsetLeft)/e.target.offsetWidth,this.onProgressChange(e)}setCurrentTime(e){this.audio.currentTime=e,this.uiElements.currentTimeElement&&(this.uiElements.currentTimeElement.innerHTML=E.getFormattedTime(e/this.audio.speechRate))}setDuration(e){this.audio.duration=e,this.uiElements.durationElement&&(this.uiElements.durationElement.innerHTML=E.getFormattedTime(e/this.audio.speechRate))}setBufferedTime(e){this.audio.bufferedTime=e}setSpeechRate(e){var t=this;return(0,d.A)(function*(){try{var s;(null===(s=window.purple.media.version)||void 0===s?void 0:s.major)>=2?yield window.purple.media.setPlaybackRate({playbackRate:e}):window.purple.media.setPlaybackRate(e),t.audio.speechRate=e,t.purpleService.setState(c.SPEECH_RATE_IDENTIFIER,e.toString())}catch(i){console.warn("TTS playback rate could not be set: "+i)}})()}setSpeechRateUi(e){Array.from(document.getElementsByClassName("speech-rate-option")).forEach(t=>t.classList.remove("selected")),e===this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow?this.uiElements.speechRateOptionVerySlow.classList.toggle("selected"):e===this.ttsService.ttsConfig.ttsSpeechRateOptionSlow?this.uiElements.speechRateOptionSlow.classList.toggle("selected"):e===this.ttsService.ttsConfig.ttsSpeechRateOptionFast?this.uiElements.speechRateOptionFast.classList.toggle("selected"):e===this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast?this.uiElements.speechRateOptionVeryFast.classList.toggle("selected"):this.uiElements.speechRateOptionNormal.classList.toggle("selected"),this.uiElements.speechRateContainer.classList.remove("open")}getSpeechRateValue(e){let t;switch(e){case this.ttsService.ttsConfig.ttsSpeechRateOptionNormal:t="0";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionSlow:t="-1";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionVerySlow:t="-2";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionFast:t="+1";break;case this.ttsService.ttsConfig.ttsSpeechRateOptionVeryFast:t="+2";break;default:t=""}return t}getFirstSpeechKey(){let e=this.getSpeechObject();return Object.keys(e)[0]}getSpeechObject(){return this.ttsService.ttsContentConfig}getDefaultSpeech(){return Object.keys(this.getSpeechObject()).includes(this.ttsService.ttsConfig.ttsDefaultSpeech)?this.ttsService.ttsConfig.ttsDefaultSpeech:this.getFirstSpeechKey()}openSettings(){this.uiElements.settingsContainer.classList.add("open"),E.setSettingsContainerPosition(this.uiElements.settingsButton,this.uiElements.settingsContainer)}closeSettings(){this.uiElements.settingsContainer.classList.remove("open")}setSelectedSpeech(){Array.from(this.uiElements.speechContainer.getElementsByClassName("speech-container")).forEach(e=>{let t=e.getElementsByTagName("input")[0];t.classList.remove("selected"),e.id===this.audio.speech&&t.classList.add("selected")})}getTrackingBaseKey(){return"TTS"}isCurrent(){return this.state.isCurrent}createPlayerProgressElements(){this.uiElements.progressContainer=document.createElement("div"),this.uiElements.progressContainer.id="tts-player-progress",this.uiElements.currentTimeElement=document.createElement("span"),this.uiElements.currentTimeElement.className="tts-player-time",this.uiElements.currentTimeElement.innerHTML=E.getFormattedTime(0),this.uiElements.durationElement=document.createElement("span"),this.uiElements.durationElement.className="tts-player-time",this.uiElements.durationElement.innerHTML=E.getFormattedTime(this.audio.duration/this.audio.speechRate),this.uiElements.progressElement=document.createElement("input"),this.uiElements.progressElement.type="range",this.uiElements.progressElement.min=0,this.uiElements.progressElement.max=1,this.uiElements.progressElement.value=0,this.uiElements.progressElement.step=1e-5,this.uiElements.progressElement.addEventListener("input",e=>this.onProgressChange(e)),this.uiElements.progressElement.addEventListener("touchmove",e=>this.onProgressTouchEvent(e)),this.uiElements.progressElement.addEventListener("touchend",e=>this.onProgressTouchEvent(e)),this.uiElements.progressElement.addEventListener("click",e=>this.onProgressTouchEvent(e)),this.uiElements.progressContainer.appendChild(this.uiElements.currentTimeElement),this.uiElements.progressContainer.appendChild(this.uiElements.progressElement),this.uiElements.progressContainer.appendChild(this.uiElements.durationElement),this.uiElements.playerElement.appendChild(this.uiElements.progressContainer)}createSpeechPropertiesUrl(e){const t=new URL(this.ttsService.getTtsResourceBaseUrl()),i=new URL(e).pathname.split("/").splice(-4).join("/");return t.pathname=("/"==t.pathname?"":t.pathname)+"/"+i,t.href}}var b=o(1626),F=o(9516),D=o(7900),_=o(5102);const T={ttsContentSelector:"#sprylab_purple_content",ttsMarkerContentSelector:"#sprylab_purple_content .purple-inner-container",ttsSkipContentClasses:["no-tts"],ttsSkipContentTags:["svg","polygon","path"],ttsDefaultSpeech:"",ttsSeekInterval:10,ttsSpeechRateOptionVerySlow:.7,ttsSpeechRateOptionSlow:.85,ttsSpeechRateOptionNormal:1,ttsSpeechRateOptionFast:1.15,ttsSpeechRateOptionVeryFast:1.3,ttsNextArticleLoadingTime:1e4,ttsDisableForPreview:!1,ttsDisableForAd:!0},N={TTS_SPEECH_TITLE:"Speaker",TTS_SPEECH_RATE_TITLE:"Speed rate",TTS_NO_INTERNET_CONNECTION_TITLE:"No internet connection!",TTS_NO_INTERNET_CONNECTION_TEXT:"To activate read mode, you need to have internet connection.",TTS_NO_INTERNET_CONNECTION_RETRY_BUTTON:"Retry",TTS_NEXT_ARTICLE_TITLE:"Next article",TTS_NEXT_ARTICLE_TEXT:'"%s"',TTS_NEXT_ARTICLE_SKIP_BUTTON:"Skip",TTS_LAST_ARTICLE_TITLE:"End of issue",TTS_LAST_ARTICLE_TEXT:"You have heard the last article of this issue.",TTS_LAST_ARTICLE_CLOSE_BUTTON:"Close",TTS_CANCEL_BUTTON:"Cancel"};let M=(()=>{var l;class e{constructor(s,i,n,r,a,u,p){this.platformId=s,this.document=i,this.purpleEnv=n,this.http=r,this.contextService=a,this.translateService=u,this.purpleService=p,this.initTts$=new P.B,this.ttsPlayerCancel$=new R.t(!1),(0,v.UE)(this.platformId)&&(this.loadTTSConfig(),this.loadTTSMessages())}initTTSforPost(s){(0,v.UE)(this.platformId)&&this.init(s)}init(s){var i=this;return(0,d.A)(function*(){var n;i.ttsPlayerCancel$.next(!1),s.resources||(s=yield i.purpleService.getCatalogContent(s.id,!0,{includeResources:!0}));const r=null===(n=s.resources)||void 0===n?void 0:n.find(a=>!!a.properties.ttsResource);if(r)if(yield i.loadTTSContentConfig(r.url),i.purpleService.purpleRef&&i.purpleService.purpleRef.media&&i.ttsContentConfig&&i.ttsConfig&&i.ttsMessages){let a;if(i.ttsPlayer&&(i.ttsPlayer.delete(),a=i.ttsPlayer.state,delete i.ttsPlayer),!0===i.ttsPlayerCancel$.getValue())return console.debug("TTS init canceled"),void i.initTts$.next(!1);try{i.ttsPlayer=new B(i.ttsConfig,s,i,i.purpleService,a),i.ttsPlayer.init(),i.initTts$.next(!0)}catch(u){i.initTts$.next(!1),console.error("TTS init error:",u)}}else i.initTts$.next(!1),console.error("Could not init TTS player");else i.initTts$.next(!1)})()}disabledForPreview(){return this.ttsConfig.ttsDisableForPreview}disabledForAd(){return this.ttsConfig.ttsDisableForAd}loadTTSContentConfig(s){var i=this;return(0,d.A)(function*(){try{let n=yield S(s,{useFetch:!0,returnRedirect:!0});if(n.redirectUrl){const r=new URL(n.redirectUrl);n.response||(r.search="",n=yield S(r.href,{useFetch:!0}));const a=r.pathname.split("/");a.splice(-4),r.pathname=a.join("/"),i.ttsResourceBaseUrl=r.href,i.ttsContentConfig=yield n.response}else i.ttsContentConfig=yield n.response}catch(n){console.error("Could not load tts content config: "+n)}})()}loadTTSConfig(){var s=this;return(0,d.A)(function*(){try{const i=(0,L.vA)(s.contextService.isPreview(),s.purpleEnv,s.contextService),n=yield S("".concat(s.contextService.getBaseUrl(),"assets/tts_config.json").concat(i));s.ttsConfig={...T,...n},n.ttsSkipContentClasses&&(s.ttsConfig.ttsSkipContentClasses=[...T.ttsSkipContentClasses,...n.ttsSkipContentClasses]),n.ttsSkipContentTags&&(s.ttsConfig.ttsSkipContentTags=[...T.ttsSkipContentTags,...n.ttsSkipContentTags])}catch(i){s.ttsConfig=T,console.warn("Could not load custom tts config: "+i)}})()}loadTTSMessages(){var s=this;return(0,d.A)(function*(){try{const i=s.translateService.messages;s.ttsMessages={...N,...i}}catch(i){s.ttsMessages=N,console.warn("Could not load custom tts messages: "+i)}})()}delete(){var s,i,n,r;this.ttsPlayerCancel$.next(!0),null===(s=this.ttsPlayer)||void 0===s||s.reset(),null===(i=this.ttsPlayer)||void 0===i||i.delete(),null!==(n=this.ttsPlayer)&&void 0!==n&&null!==(n=n.state)&&void 0!==n&&n.forceOpen||null===(r=this.ttsPlayer)||void 0===r||r.closePlayer()}updateForceOpen(){var s;null!==(s=this.ttsPlayer)&&void 0!==s&&s.state.isOpen.value&&(this.ttsPlayer.state.forceOpen=!0)}getTtsResourceBaseUrl(){return this.ttsResourceBaseUrl}}return(l=e).\u0275fac=function(s){return new(s||l)(m.KVO(m.Agw),m.KVO(v.qQ),m.KVO(O.r6),m.KVO(b.Qq),m.KVO(F.V),m.KVO(D.c),m.KVO(_.Wj))},l.\u0275prov=m.jDH({token:l,factory:l.\u0275fac,providedIn:"root"}),e})()}}]);
|